Spaces:
Sleeping
Sleeping
Upload 7 files
Browse files- Dockerfile +26 -0
- README.md +0 -10
- build.py +129 -0
- package-lock.json +0 -0
- package.json +53 -0
- tailwind.config.js +39 -0
- tsconfig.json +27 -0
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# 使用Node.js作为基础镜像
|
2 |
+
FROM node:18-alpine
|
3 |
+
|
4 |
+
# 设置工作目录
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# 复制package.json和package-lock.json
|
8 |
+
COPY package*.json ./
|
9 |
+
|
10 |
+
# 安装依赖
|
11 |
+
RUN npm install
|
12 |
+
|
13 |
+
# 复制项目文件
|
14 |
+
COPY . .
|
15 |
+
|
16 |
+
# 构建应用
|
17 |
+
RUN npm run build
|
18 |
+
|
19 |
+
# 安装serve工具用于提供静态文件服务
|
20 |
+
RUN npm install -g serve
|
21 |
+
|
22 |
+
# 暴露端口
|
23 |
+
EXPOSE 7860
|
24 |
+
|
25 |
+
# 启动应用
|
26 |
+
CMD ["serve", "-s", "build", "-l", "7860"]
|
README.md
CHANGED
@@ -1,10 +0,0 @@
|
|
1 |
-
---
|
2 |
-
title: Promptmanager
|
3 |
-
emoji: 😻
|
4 |
-
colorFrom: pink
|
5 |
-
colorTo: indigo
|
6 |
-
sdk: docker
|
7 |
-
pinned: false
|
8 |
-
---
|
9 |
-
|
10 |
-
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
build.py
ADDED
@@ -0,0 +1,129 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
|
3 |
+
def create_directory_structure():
|
4 |
+
# Define the directory structure
|
5 |
+
directories = [
|
6 |
+
"src",
|
7 |
+
"src/components",
|
8 |
+
"src/components/Layout",
|
9 |
+
"src/components/PromptGroup",
|
10 |
+
"src/components/Prompt",
|
11 |
+
"src/components/DslFile",
|
12 |
+
"src/components/Category",
|
13 |
+
"src/components/common",
|
14 |
+
"src/contexts",
|
15 |
+
"src/hooks",
|
16 |
+
"src/utils",
|
17 |
+
"src/types",
|
18 |
+
"src/styles",
|
19 |
+
"src/pages",
|
20 |
+
"public"
|
21 |
+
]
|
22 |
+
|
23 |
+
# Create directories
|
24 |
+
for directory in directories:
|
25 |
+
os.makedirs(directory, exist_ok=True)
|
26 |
+
print(f"Created directory: {directory}")
|
27 |
+
|
28 |
+
def create_empty_files():
|
29 |
+
# Define files to create
|
30 |
+
files = [
|
31 |
+
# Root files
|
32 |
+
"package.json",
|
33 |
+
"README.md",
|
34 |
+
"tsconfig.json",
|
35 |
+
"tailwind.config.js",
|
36 |
+
|
37 |
+
# Public files
|
38 |
+
"public/index.html",
|
39 |
+
"public/manifest.json",
|
40 |
+
"public/robots.txt",
|
41 |
+
|
42 |
+
# Source files
|
43 |
+
"src/App.tsx",
|
44 |
+
"src/index.tsx",
|
45 |
+
"src/index.css",
|
46 |
+
"src/react-app-env.d.ts",
|
47 |
+
"src/reportWebVitals.ts",
|
48 |
+
"src/setupTests.ts",
|
49 |
+
|
50 |
+
# Styles
|
51 |
+
"src/styles/global.css",
|
52 |
+
"src/styles/iosStyles.css",
|
53 |
+
|
54 |
+
# Types
|
55 |
+
"src/types/index.ts",
|
56 |
+
|
57 |
+
# Contexts
|
58 |
+
"src/contexts/AppContext.tsx",
|
59 |
+
"src/contexts/ThemeContext.tsx",
|
60 |
+
|
61 |
+
# Hooks
|
62 |
+
"src/hooks/useLocalStorage.ts",
|
63 |
+
"src/hooks/usePromptGroups.ts",
|
64 |
+
|
65 |
+
# Utils
|
66 |
+
"src/utils/exportUtils.ts",
|
67 |
+
"src/utils/fileUtils.ts",
|
68 |
+
"src/utils/helpers.ts",
|
69 |
+
|
70 |
+
# Components - Layout
|
71 |
+
"src/components/Layout/Header.tsx",
|
72 |
+
"src/components/Layout/Navigation.tsx",
|
73 |
+
"src/components/Layout/Layout.tsx",
|
74 |
+
|
75 |
+
# Components - PromptGroup
|
76 |
+
"src/components/PromptGroup/PromptGroupCard.tsx",
|
77 |
+
"src/components/PromptGroup/PromptGroupList.tsx",
|
78 |
+
"src/components/PromptGroup/PromptGroupForm.tsx",
|
79 |
+
"src/components/PromptGroup/PromptGroupDetail.tsx",
|
80 |
+
|
81 |
+
# Components - Prompt
|
82 |
+
"src/components/Prompt/PromptCard.tsx",
|
83 |
+
"src/components/Prompt/PromptList.tsx",
|
84 |
+
"src/components/Prompt/PromptForm.tsx",
|
85 |
+
"src/components/Prompt/PromptDetail.tsx",
|
86 |
+
|
87 |
+
# Components - DslFile
|
88 |
+
"src/components/DslFile/DslFileUploader.tsx",
|
89 |
+
"src/components/DslFile/DslFileList.tsx",
|
90 |
+
|
91 |
+
# Components - Category
|
92 |
+
"src/components/Category/CategoryBadge.tsx",
|
93 |
+
"src/components/Category/CategorySelector.tsx",
|
94 |
+
"src/components/Category/CategoryForm.tsx",
|
95 |
+
|
96 |
+
# Components - Common
|
97 |
+
"src/components/common/Button.tsx",
|
98 |
+
"src/components/common/Card.tsx",
|
99 |
+
"src/components/common/Input.tsx",
|
100 |
+
"src/components/common/TextArea.tsx",
|
101 |
+
"src/components/common/Modal.tsx",
|
102 |
+
"src/components/common/Dropdown.tsx",
|
103 |
+
|
104 |
+
# Pages
|
105 |
+
"src/pages/HomePage.tsx",
|
106 |
+
"src/pages/PromptGroupDetailPage.tsx",
|
107 |
+
"src/pages/CreatePromptGroupPage.tsx",
|
108 |
+
"src/pages/EditPromptGroupPage.tsx",
|
109 |
+
"src/pages/CreatePromptPage.tsx",
|
110 |
+
"src/pages/EditPromptPage.tsx",
|
111 |
+
"src/pages/CategoriesPage.tsx",
|
112 |
+
"src/pages/SettingsPage.tsx"
|
113 |
+
]
|
114 |
+
|
115 |
+
# Create empty files
|
116 |
+
for file_path in files:
|
117 |
+
with open(file_path, 'w') as f:
|
118 |
+
# Leave the file empty
|
119 |
+
pass
|
120 |
+
print(f"Created empty file: {file_path}")
|
121 |
+
|
122 |
+
def main():
|
123 |
+
print("Starting creation of directory structure and empty files...")
|
124 |
+
create_directory_structure()
|
125 |
+
create_empty_files()
|
126 |
+
print("Done! All directories and empty files have been created.")
|
127 |
+
|
128 |
+
if __name__ == "__main__":
|
129 |
+
main()
|
package-lock.json
ADDED
The diff for this file is too large to render.
See raw diff
|
|
package.json
ADDED
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"name": "prompt-manager",
|
3 |
+
"version": "0.1.0",
|
4 |
+
"private": true,
|
5 |
+
"dependencies": {
|
6 |
+
"@testing-library/dom": "^10.4.0",
|
7 |
+
"@testing-library/jest-dom": "^6.6.3",
|
8 |
+
"@testing-library/react": "^16.3.0",
|
9 |
+
"@testing-library/user-event": "^13.5.0",
|
10 |
+
"@types/jest": "^27.5.2",
|
11 |
+
"@types/node": "^16.18.126",
|
12 |
+
"@types/react": "^19.1.2",
|
13 |
+
"@types/react-dom": "^19.1.2",
|
14 |
+
"axios": "^1.9.0",
|
15 |
+
"file-saver": "^2.0.5",
|
16 |
+
"jszip": "^3.10.1",
|
17 |
+
"jwt-decode": "^4.0.0",
|
18 |
+
"react": "^19.1.0",
|
19 |
+
"react-dom": "^19.1.0",
|
20 |
+
"react-router-dom": "^6.30.0",
|
21 |
+
"react-scripts": "5.0.1",
|
22 |
+
"tailwindcss": "^3.4.17",
|
23 |
+
"typescript": "^4.9.5",
|
24 |
+
"web-vitals": "^2.1.4"
|
25 |
+
},
|
26 |
+
"scripts": {
|
27 |
+
"start": "react-scripts start",
|
28 |
+
"build": "react-scripts build",
|
29 |
+
"test": "react-scripts test",
|
30 |
+
"eject": "react-scripts eject"
|
31 |
+
},
|
32 |
+
"eslintConfig": {
|
33 |
+
"extends": [
|
34 |
+
"react-app",
|
35 |
+
"react-app/jest"
|
36 |
+
]
|
37 |
+
},
|
38 |
+
"browserslist": {
|
39 |
+
"production": [
|
40 |
+
">0.2%",
|
41 |
+
"not dead",
|
42 |
+
"not op_mini all"
|
43 |
+
],
|
44 |
+
"development": [
|
45 |
+
"last 1 chrome version",
|
46 |
+
"last 1 firefox version",
|
47 |
+
"last 1 safari version"
|
48 |
+
]
|
49 |
+
},
|
50 |
+
"devDependencies": {
|
51 |
+
"@types/file-saver": "^2.0.7"
|
52 |
+
}
|
53 |
+
}
|
tailwind.config.js
ADDED
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
module.exports = {
|
2 |
+
content: [
|
3 |
+
"./src/**/*.{js,jsx,ts,tsx}",
|
4 |
+
],
|
5 |
+
theme: {
|
6 |
+
extend: {
|
7 |
+
colors: {
|
8 |
+
'ios-blue': '#007AFF',
|
9 |
+
'ios-green': '#4CD964',
|
10 |
+
'ios-red': '#FF3B30',
|
11 |
+
'ios-orange': '#FF9500',
|
12 |
+
'ios-yellow': '#FFCC00',
|
13 |
+
'ios-purple': '#5856D6',
|
14 |
+
'ios-pink': '#FF2D55',
|
15 |
+
'ios-teal': '#5AC8FA',
|
16 |
+
'ios-indigo': '#5E5CE6',
|
17 |
+
'ios-gray': '#8E8E93',
|
18 |
+
'ios-gray2': '#AEAEB2',
|
19 |
+
'ios-gray3': '#C7C7CC',
|
20 |
+
'ios-gray4': '#D1D1D6',
|
21 |
+
'ios-gray5': '#E5E5EA',
|
22 |
+
'ios-gray6': '#F2F2F7',
|
23 |
+
},
|
24 |
+
borderRadius: {
|
25 |
+
'ios-sm': '6px',
|
26 |
+
'ios-md': '10px',
|
27 |
+
'ios-lg': '14px',
|
28 |
+
},
|
29 |
+
boxShadow: {
|
30 |
+
'ios-sm': '0 2px 10px rgba(0, 0, 0, 0.05)',
|
31 |
+
'ios-md': '0 5px 15px rgba(0, 0, 0, 0.1)',
|
32 |
+
},
|
33 |
+
fontFamily: {
|
34 |
+
'ios': ['-apple-system', 'BlinkMacSystemFont', 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', 'Arial', 'sans-serif'],
|
35 |
+
},
|
36 |
+
},
|
37 |
+
},
|
38 |
+
plugins: [],
|
39 |
+
}
|
tsconfig.json
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"compilerOptions": {
|
3 |
+
"target": "es5",
|
4 |
+
"lib": [
|
5 |
+
"dom",
|
6 |
+
"dom.iterable",
|
7 |
+
"esnext"
|
8 |
+
],
|
9 |
+
"allowJs": true,
|
10 |
+
"skipLibCheck": true,
|
11 |
+
"esModuleInterop": true,
|
12 |
+
"allowSyntheticDefaultImports": true,
|
13 |
+
"strict": true,
|
14 |
+
"forceConsistentCasingInFileNames": true,
|
15 |
+
"noFallthroughCasesInSwitch": true,
|
16 |
+
"module": "esnext",
|
17 |
+
"moduleResolution": "node",
|
18 |
+
"resolveJsonModule": true,
|
19 |
+
"isolatedModules": true,
|
20 |
+
"noEmit": true,
|
21 |
+
"jsx": "react-jsx",
|
22 |
+
"downlevelIteration": true
|
23 |
+
},
|
24 |
+
"include": [
|
25 |
+
"src"
|
26 |
+
]
|
27 |
+
}
|