create-comate-pagebuilder 1.0.11 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -11
- package/package.json +1 -1
- package/template/README.md +17 -8
- package/template/package-lock.json +2 -2
- package/template/package.json +1 -1
- package/template/src/App.jsx +1 -1
- package/template/src/pages/Home/components/.gitkeep +0 -0
- package/template/tailwind.config.js +49 -16
- package/template/vite.config.js +0 -1
- /package/template/src/pages/{Home.jsx → Home/index.jsx} +0 -0
package/README.md
CHANGED
|
@@ -62,20 +62,56 @@ Add these as needed:
|
|
|
62
62
|
|
|
63
63
|
## Project Structure
|
|
64
64
|
|
|
65
|
+
### Scaffold Project Structure
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
create-comate-pagebuilder/
|
|
69
|
+
├── bin/
|
|
70
|
+
│ └── index.js # CLI entry point
|
|
71
|
+
├── template/ # Template files to scaffold
|
|
72
|
+
│ ├── src/
|
|
73
|
+
│ │ ├── components/ # Public components
|
|
74
|
+
│ │ ├── pages/ # Page modules
|
|
75
|
+
│ │ │ └── Home/ # Home page module
|
|
76
|
+
│ │ │ ├── index.jsx
|
|
77
|
+
│ │ │ └── components/ # Page-specific components
|
|
78
|
+
│ │ ├── utils/
|
|
79
|
+
│ │ │ └── cn.js # className utility
|
|
80
|
+
│ │ ├── App.jsx
|
|
81
|
+
│ │ ├── main.jsx
|
|
82
|
+
│ │ └── index.css
|
|
83
|
+
│ ├── index.html
|
|
84
|
+
│ ├── vite.config.js
|
|
85
|
+
│ ├── tailwind.config.js
|
|
86
|
+
│ ├── postcss.config.js
|
|
87
|
+
│ ├── package.json
|
|
88
|
+
│ └── README.md # Template documentation
|
|
89
|
+
├── package.json # Package metadata
|
|
90
|
+
└── README.md # This file
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Generated Project Structure
|
|
94
|
+
|
|
95
|
+
When you run `npm create comate-pagebuilder@latest my-app`, you'll get:
|
|
96
|
+
|
|
65
97
|
```
|
|
66
98
|
my-app/
|
|
67
99
|
├── src/
|
|
68
|
-
│ ├── components/
|
|
69
|
-
│ ├── pages/
|
|
70
|
-
│
|
|
71
|
-
│ ├──
|
|
72
|
-
│
|
|
73
|
-
│
|
|
74
|
-
|
|
75
|
-
├──
|
|
76
|
-
├──
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
│ ├── components/ # Public components
|
|
101
|
+
│ ├── pages/ # Page modules
|
|
102
|
+
│ │ └── Home/ # Example: Home page module
|
|
103
|
+
│ │ ├── index.jsx
|
|
104
|
+
│ │ └── components/ # Page-specific components
|
|
105
|
+
│ ├── utils/
|
|
106
|
+
│ │ └── cn.js # className merge utility
|
|
107
|
+
│ ├── App.jsx # Root component
|
|
108
|
+
│ ├── main.jsx # Application entry
|
|
109
|
+
│ └── index.css # Global styles + Tailwind directives
|
|
110
|
+
├── index.html # HTML template
|
|
111
|
+
├── vite.config.js # Vite configuration with path aliases
|
|
112
|
+
├── tailwind.config.js # Tailwind with custom color system
|
|
113
|
+
├── postcss.config.js # PostCSS configuration
|
|
114
|
+
└── package.json # Dependencies and scripts
|
|
79
115
|
```
|
|
80
116
|
|
|
81
117
|
## Available Scripts
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -26,7 +26,7 @@ npm install
|
|
|
26
26
|
npm run dev
|
|
27
27
|
```
|
|
28
28
|
|
|
29
|
-
访问 `http://localhost:
|
|
29
|
+
访问 `http://localhost:8080`
|
|
30
30
|
|
|
31
31
|
## 🏗️ 构建
|
|
32
32
|
|
|
@@ -38,9 +38,11 @@ npm run build
|
|
|
38
38
|
|
|
39
39
|
```
|
|
40
40
|
src/
|
|
41
|
-
├── components/ #
|
|
41
|
+
├── components/ # 公共组件目录
|
|
42
42
|
├── pages/ # 页面目录
|
|
43
|
-
│ └── Home
|
|
43
|
+
│ └── Home/ # 首页模块
|
|
44
|
+
│ ├── index.jsx # 首页主文件
|
|
45
|
+
│ └── components/ # 首页专属组件
|
|
44
46
|
├── utils/ # 工具函数
|
|
45
47
|
│ └── cn.js # className 合并工具
|
|
46
48
|
├── App.jsx # 根组件
|
|
@@ -50,13 +52,20 @@ src/
|
|
|
50
52
|
|
|
51
53
|
## 🎨 配色系统
|
|
52
54
|
|
|
53
|
-
|
|
55
|
+
模板提供标准化的配色结构,在 `tailwind.config.js` 中定义:
|
|
54
56
|
|
|
55
|
-
|
|
56
|
-
- **
|
|
57
|
-
- **
|
|
57
|
+
### 色彩层级(各10级:50-900)
|
|
58
|
+
- **primary** - 主色调,用于主要按钮、品牌色(如 `bg-primary-500`)
|
|
59
|
+
- **secondary** - 次要色,用于次要按钮、辅助元素(如 `bg-secondary-100`)
|
|
60
|
+
- **accent** - 强调色,用于高亮、提示等(如 `text-accent-600`)
|
|
58
61
|
|
|
59
|
-
|
|
62
|
+
### 功能性色彩(单色值)
|
|
63
|
+
- **foreground** - 深色文本,用于主要内容(如 `text-foreground`)
|
|
64
|
+
- **muted-foreground** - 中性文本,用于次要说明(如 `text-muted-foreground`)
|
|
65
|
+
- **border** - 边框颜色(如 `border-border`)
|
|
66
|
+
- **muted** - 浅色背景(如 `bg-muted`)
|
|
67
|
+
|
|
68
|
+
> 💡 所有颜色值需在 `tailwind.config.js` 中根据项目需求自定义配置
|
|
60
69
|
|
|
61
70
|
## 📚 可选动效库
|
|
62
71
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pagebuilder-react-template",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pagebuilder-react-template",
|
|
9
|
-
"version": "1.0.
|
|
9
|
+
"version": "1.0.13",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"clsx": "^2.1.0",
|
|
12
12
|
"framer-motion": "^12.23.24",
|
package/template/package.json
CHANGED
package/template/src/App.jsx
CHANGED
|
File without changes
|
|
@@ -5,26 +5,59 @@ export default {
|
|
|
5
5
|
"./src/**/*.{js,ts,jsx,tsx}",
|
|
6
6
|
],
|
|
7
7
|
theme: {
|
|
8
|
+
// 必须使用extend属性,不要删除extend,避免直接覆盖默认配置
|
|
8
9
|
extend: {
|
|
9
10
|
colors: {
|
|
10
|
-
// TODO:
|
|
11
|
+
// TODO: 请根据项目需求定义配色方案,如下所示,primary、secondary、accent各定义10个颜色,其它的为单色值
|
|
11
12
|
|
|
12
13
|
// 使用场景说明:
|
|
13
|
-
// - primary: 主色,用于主要按钮背景 (bg-primary)
|
|
14
|
-
// - secondary: 次要色,用于次要按钮背景 (bg-secondary)
|
|
15
|
-
// - accent:
|
|
16
|
-
// - foreground: 深色,用于主要文本 (text-foreground)
|
|
17
|
-
// - muted-foreground: 中等色,用于次要文本 (text-muted-foreground)
|
|
18
|
-
// - border: 用于边框 (border-border)
|
|
19
|
-
// - muted: 浅色,用于背景 (bg-muted)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
14
|
+
// - primary: 主色,用于主要按钮背景 (如bg-primary-100)
|
|
15
|
+
// - secondary: 次要色,用于次要按钮背景 (如bg-secondary-100)
|
|
16
|
+
// - accent: 强调色,用于高亮、提示等(可选,如:text-accent-500)
|
|
17
|
+
// - foreground: 深色,用于主要文本 (如text-foreground)
|
|
18
|
+
// - muted-foreground: 中等色,用于次要文本 (如text-muted-foreground)
|
|
19
|
+
// - border: 用于边框 (如border-border)
|
|
20
|
+
// - muted: 浅色,用于背景 (如bg-muted)
|
|
21
|
+
primary: {
|
|
22
|
+
50: '',
|
|
23
|
+
100: '',
|
|
24
|
+
200: '',
|
|
25
|
+
300: '',
|
|
26
|
+
400: '',
|
|
27
|
+
500: '',
|
|
28
|
+
600: '',
|
|
29
|
+
700: '',
|
|
30
|
+
800: '',
|
|
31
|
+
900: '',
|
|
32
|
+
},
|
|
33
|
+
secondary: {
|
|
34
|
+
50: '',
|
|
35
|
+
100: '',
|
|
36
|
+
200: '',
|
|
37
|
+
300: '',
|
|
38
|
+
400: '',
|
|
39
|
+
500: '',
|
|
40
|
+
600: '',
|
|
41
|
+
700: '',
|
|
42
|
+
800: '',
|
|
43
|
+
900: '',
|
|
44
|
+
},
|
|
45
|
+
accent: {
|
|
46
|
+
50: '',
|
|
47
|
+
100: '',
|
|
48
|
+
200: '',
|
|
49
|
+
300: '',
|
|
50
|
+
400: '',
|
|
51
|
+
500: '',
|
|
52
|
+
600: '',
|
|
53
|
+
700: '',
|
|
54
|
+
800: '',
|
|
55
|
+
900: '',
|
|
56
|
+
},
|
|
57
|
+
foreground: '',
|
|
58
|
+
'muted-foreground': '',
|
|
59
|
+
border: '',
|
|
60
|
+
muted: '',
|
|
28
61
|
},
|
|
29
62
|
fontFamily: {
|
|
30
63
|
sans: ['Inter', 'system-ui', 'sans-serif'],
|
package/template/vite.config.js
CHANGED
|
File without changes
|