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 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/ # React components
69
- │ ├── pages/ # Page components
70
- ├── utils/ # Utility functions
71
- │ ├── App.jsx # Main App component
72
- ├── main.jsx # Entry point
73
- └── index.css # Global styles
74
- ├── index.html # HTML template
75
- ├── vite.config.js # Vite configuration
76
- ├── tailwind.config.js # Tailwind configuration
77
- ├── postcss.config.js # PostCSS configuration
78
- └── package.json # Project dependencies
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-comate-pagebuilder",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "description": "Create a modern, minimalist React + Vite + Tailwind CSS project",
5
5
  "type": "commonjs",
6
6
  "bin": {
@@ -26,7 +26,7 @@ npm install
26
26
  npm run dev
27
27
  ```
28
28
 
29
- 访问 `http://localhost:3000`
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.jsx # 首页
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
- - **Primary** - 主色(蓝色系)
56
- - **Accent** - 强调色(紫色系)
57
- - **Neutral** - 中性色(灰色系)
57
+ ### 色彩层级(各10级:50-900)
58
+ - **primary** - 主色调,用于主要按钮、品牌色(如 `bg-primary-500`)
59
+ - **secondary** - 次要色,用于次要按钮、辅助元素(如 `bg-secondary-100`)
60
+ - **accent** - 强调色,用于高亮、提示等(如 `text-accent-600`)
58
61
 
59
- `tailwind.config.js` 中可自定义。
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.11",
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.11",
9
+ "version": "1.0.13",
10
10
  "dependencies": {
11
11
  "clsx": "^2.1.0",
12
12
  "framer-motion": "^12.23.24",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pagebuilder-react-template",
3
- "version": "1.0.11",
3
+ "version": "1.0.13",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "dev": "vite",
@@ -1,6 +1,6 @@
1
1
  // 必须使用 HashRouter 路由,不能使用别的 Router
2
2
  import { Routes, Route, HashRouter as Router } from 'react-router'
3
- import Home from './pages/Home'
3
+ import Home from './pages/Home/index'
4
4
 
5
5
  function App() {
6
6
  return (
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
- // primary: '',
22
- // secondary: '',
23
- // accent: '',
24
- // foreground: '',
25
- // 'muted-foreground': '',
26
- // border: '',
27
- // muted: '',
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'],
@@ -15,6 +15,5 @@ export default defineConfig({
15
15
  },
16
16
  server: {
17
17
  port: 8080,
18
- open: true
19
18
  }
20
19
  })
File without changes