cmpt-huitu-cli 1.0.9 → 1.0.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cmpt-huitu-cli",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "type": "module",
5
5
  "description": "慧图前端项目工程化 CLI 工具",
6
6
  "main": "index.js",
package/src/versions.js CHANGED
@@ -15,7 +15,7 @@
15
15
  * - 例如:^1.0.8 允许 1.0.8, 1.1.0 但不允许 2.0.0
16
16
  */
17
17
  export const DEPENDENCY_VERSIONS = {
18
- 'cmpt-huitu-ui': '^1.0.8',
18
+ 'cmpt-huitu-ui': '^1.0.9',
19
19
  'cmpt-huitu-utils': '^2.0.0',
20
20
  }
21
21
 
Binary file
@@ -0,0 +1 @@
1
+ @huitu-dev:registry=http://120.46.221.186:8081
Binary file
@@ -1,209 +0,0 @@
1
- # Template Configuration Verification Report
2
-
3
- ## ✅ Verification Status: PASSED
4
-
5
- This document verifies that the template configuration meets all requirements for task 4.
6
-
7
- ## 1. UI Component Registration (main.js)
8
-
9
- **File:** `src/main.js`
10
-
11
- **Status:** ✅ VERIFIED
12
-
13
- **Findings:**
14
-
15
- - ✅ HuituUI is correctly imported from 'cmpt-huitu-ui'
16
- - ✅ HuituUI is registered using `app.use(HuituUI)`
17
- - ✅ HuituUtils is imported from 'cmpt-huitu-utils'
18
- - ✅ Utils are mounted to global properties as `$utils`
19
- - ✅ Element Plus is properly imported and registered
20
- - ✅ Pinia and Vue Router are configured
21
-
22
- **Code Verification:**
23
-
24
- ```javascript
25
- import HuituUI from 'cmpt-huitu-ui'
26
- import * as HuituUtils from 'cmpt-huitu-utils'
27
-
28
- // Registration
29
- app.use(HuituUI)
30
- app.config.globalProperties.$utils = HuituUtils
31
- ```
32
-
33
- **Requirements Met:** 2.5, 3.1
34
-
35
- ---
36
-
37
- ## 2. Component Examples (home.vue)
38
-
39
- **File:** `src/views/home.vue`
40
-
41
- **Status:** ✅ VERIFIED
42
-
43
- **Findings:**
44
-
45
- - ✅ VexTable component is used with proper props (columns, data)
46
- - ✅ HTable component is used with proper props (data, columns)
47
- - ✅ Element Plus components (el-tag) are demonstrated
48
- - ✅ Component demonstrates reactive data binding
49
- - ✅ Clean component structure without external dependencies
50
-
51
- **Component Usage:**
52
-
53
- ```vue
54
- <VexTable :columns="columns" :data="data" />
55
- <HTable :data="data" :columns="hTableColumns" />
56
- ```
57
-
58
- **Requirements Met:** 2.3, 3.1, 3.2, 3.3, 3.4
59
-
60
- ---
61
-
62
- ## 3. Path Alias Configuration (vite.config.js)
63
-
64
- **File:** `vite.config.js`
65
-
66
- **Status:** ✅ VERIFIED
67
-
68
- **Findings:**
69
-
70
- - ✅ '@' alias points to './src' directory
71
- - ✅ All standard aliases are configured (@components, @views, @utils, etc.)
72
- - ✅ Aliases match jsconfig.json configuration
73
- - ✅ Extensions array includes .vue, .js, .jsx, .tsx, .json, .css, .scss
74
- - ✅ CSS preprocessor configured for SCSS with UI package variables
75
- - ✅ optimizeDeps excludes workspace packages correctly
76
-
77
- **Alias Configuration:**
78
-
79
- ```javascript
80
- resolve: {
81
- alias: {
82
- '@': resolve(__dirname, './src'),
83
- '@components': resolve(__dirname, './src/components'),
84
- '@views': resolve(__dirname, './src/views'),
85
- '@utils': resolve(__dirname, './src/utils'),
86
- // ... and more
87
- }
88
- }
89
- ```
90
-
91
- **CSS Configuration:**
92
-
93
- ```javascript
94
- css: {
95
- preprocessorOptions: {
96
- scss: {
97
- additionalData: `
98
- @use "cmpt-huitu-ui/src/styles/variables.scss" as *;
99
- @use "cmpt-huitu-ui/src/styles/mixin.scss" as *;
100
- `,
101
- },
102
- },
103
- }
104
- ```
105
-
106
- **Requirements Met:** 2.4
107
-
108
- ---
109
-
110
- ## 4. Required Configuration Files
111
-
112
- **Status:** ✅ ALL PRESENT
113
-
114
- ### Core Configuration Files:
115
-
116
- - ✅ `package.json` - Dependencies and scripts configured
117
- - ✅ `vite.config.js` - Build and dev server configuration
118
- - ✅ `jsconfig.json` - IDE path alias hints
119
- - ✅ `eslint.config.js` - Code quality rules
120
- - ✅ `index.html` - Entry HTML file
121
-
122
- ### Project Structure:
123
-
124
- - ✅ `src/main.js` - Application entry point
125
- - ✅ `src/app.vue` - Root component
126
- - ✅ `src/views/home.vue` - Example page with components
127
- - ✅ `src/routers/` - Router configuration
128
- - ✅ `src/stores/` - Pinia store setup
129
- - ✅ `src/utils/` - Utility functions
130
- - ✅ `src/components/` - Reusable components
131
- - ✅ `public/` - Static assets
132
-
133
- ### Additional Files:
134
-
135
- - ✅ `README.md` - Project documentation
136
- - ✅ `.prettierrc` - Code formatting rules
137
- - ✅ `public/config/envCfg.js` - Environment configuration
138
-
139
- **Requirements Met:** 2.2
140
-
141
- ---
142
-
143
- ## 5. Package Dependencies Verification
144
-
145
- **File:** `package.json`
146
-
147
- **Status:** ✅ VERIFIED
148
-
149
- **Workspace Dependencies:**
150
-
151
- ```json
152
- {
153
- "cmpt-huitu-ui": "workspace:*",
154
- "cmpt-huitu-utils": "workspace:*"
155
- }
156
- ```
157
-
158
- **Note:** These will be replaced with npm versions by the CLI create script.
159
-
160
- **Peer Dependencies Present:**
161
-
162
- - ✅ vue: ^3.5.18
163
- - ✅ element-plus: ^2.11.1
164
- - ✅ vxe-table: ^4.16.20
165
- - ✅ xe-utils: ^3.5.0
166
- - ✅ vue-router: ^4.5.1
167
- - ✅ pinia: ^3.0.3
168
-
169
- **Requirements Met:** 1.3, 1.4
170
-
171
- ---
172
-
173
- ## 6. UI Components Available
174
-
175
- **From cmpt-huitu-ui package:**
176
-
177
- - ✅ VexTable - Advanced data table component
178
- - ✅ HTable - Standard table component
179
- - ✅ HtDialog - Dialog component
180
-
181
- **All components are:**
182
-
183
- - ✅ Exported from the UI package
184
- - ✅ Registered globally via app.use(HuituUI)
185
- - ✅ Demonstrated in home.vue
186
-
187
- ---
188
-
189
- ## Summary
190
-
191
- All template files are properly configured and meet the requirements:
192
-
193
- 1. ✅ UI components are correctly registered in main.js
194
- 2. ✅ Component examples are present in home.vue
195
- 3. ✅ Path aliases are properly configured in vite.config.js
196
- 4. ✅ All required configuration files exist
197
- 5. ✅ Dependencies are correctly specified
198
- 6. ✅ The template is ready for CLI distribution
199
-
200
- **Next Steps:**
201
-
202
- - The CLI create script will replace workspace:\* with actual npm versions
203
- - Users can run `pnpm install` to install dependencies
204
- - Users can run `pnpm dev` to start the development server
205
- - All UI components will be immediately available for use
206
-
207
- ---
208
-
209
- **Verification Date:** 2026-01-09 **Verified By:** Kiro CLI Optimization Task 4
@@ -1,106 +0,0 @@
1
- # 修复 vxe-table 依赖问题
2
-
3
- ## 问题描述
4
-
5
- 执行 `pnpm dev` 后,终端报错:
6
- ```
7
- [vite] Internal server error: Failed to resolve import "vxe-table" from "node_modules/.pnpm/cmpt-huitu-ui@1.0.1/node_modules/cmpt-huitu-ui/index.js?v=8ce970af". Does the file exist?
8
- ```
9
-
10
- 控制台报错:
11
- ```
12
- GET http://localhost:3002/node_modules/.pnpm/cmpt-huitu-ui@1.0.1/node_modules/cmpt-huitu-ui/index.js?v=8ce970af net::ERR_ABORTED 500 (Internal Server Error)
13
- ```
14
-
15
- ## 问题原因
16
-
17
- `cmpt-huitu-ui` 包依赖 `vxe-table`,但项目的 `package.json` 中没有直接声明 `vxe-table` 依赖。在使用 pnpm 时,依赖提升机制可能没有正确提升 `vxe-table` 到项目的 `node_modules` 中,导致 Vite 无法解析该模块。
18
-
19
- ## 解决方案
20
-
21
- ### 方案 1:手动添加依赖(推荐)
22
-
23
- 在项目根目录执行:
24
-
25
- ```bash
26
- pnpm add vxe-table@^4.16.20
27
- ```
28
-
29
- 或者使用 npm:
30
-
31
- ```bash
32
- npm install vxe-table@^4.16.20
33
- ```
34
-
35
- ### 方案 2:修改 package.json
36
-
37
- 在项目的 `package.json` 的 `dependencies` 中添加:
38
-
39
- ```json
40
- {
41
- "dependencies": {
42
- "vxe-table": "^4.16.20",
43
- // ... 其他依赖
44
- }
45
- }
46
- ```
47
-
48
- 然后执行:
49
-
50
- ```bash
51
- pnpm install
52
- ```
53
-
54
- ### 方案 3:配置 pnpm 依赖提升(可选)
55
-
56
- 如果希望 pnpm 自动提升 `vxe-table`,可以在项目根目录创建 `.npmrc` 文件:
57
-
58
- ```
59
- shamefully-hoist=true
60
- ```
61
-
62
- 然后重新安装依赖:
63
-
64
- ```bash
65
- rm -rf node_modules pnpm-lock.yaml
66
- pnpm install
67
- ```
68
-
69
- **注意**:`shamefully-hoist=true` 会让 pnpm 的行为更像 npm,可能会增加 `node_modules` 的大小。
70
-
71
- ## 验证
72
-
73
- 修复后,检查以下内容:
74
-
75
- 1. ✅ `package.json` 中包含 `vxe-table` 依赖
76
- 2. ✅ `node_modules` 中存在 `vxe-table` 目录
77
- 3. ✅ 终端没有 `vxe-table` 相关错误
78
- 4. ✅ 页面正常加载
79
- 5. ✅ `VexTable` 组件可以正常使用
80
-
81
- ## 预防措施
82
-
83
- **对于新创建的项目**:
84
-
85
- 模板已经更新,新创建的项目会自动包含 `vxe-table` 依赖,不会再出现此问题。
86
-
87
- **对于已创建的项目**:
88
-
89
- 请按照上述方案手动添加 `vxe-table` 依赖。
90
-
91
- ## 相关依赖
92
-
93
- `vxe-table` 的依赖关系:
94
- - `vxe-table` 依赖 `xe-utils`
95
- - `cmpt-huitu-ui` 依赖 `vxe-table`
96
-
97
- 因此,项目中需要同时安装:
98
- - `vxe-table`(已通过模板添加)
99
- - `xe-utils`(会自动作为 `vxe-table` 的依赖安装)
100
-
101
- ## 注意事项
102
-
103
- - 确保 `vxe-table` 版本与 `cmpt-huitu-ui` 包中声明的版本兼容(当前为 `^4.16.20`)
104
- - 如果使用 Monorepo,确保依赖正确安装
105
- - 清理缓存后重新启动开发服务器
106
-
@@ -1,158 +0,0 @@
1
- # 修复 xe-utils 导入错误
2
-
3
- ## 问题描述
4
-
5
- 执行 `pnpm dev` 后,控制台报错:
6
- ```
7
- Uncaught SyntaxError: The requested module '/node_modules/.pnpm/xe-utils@3.8.3/node_modules/xe-utils/index.js?v=e03718de' does not provide an export named 'default' (at config.js?v=e03718de:1:8)
8
- ```
9
-
10
- ## 问题原因
11
-
12
- `xe-utils` 是 `vxe-table` 的依赖,是一个 CommonJS 模块。在 Vite 的 ESM 环境下,需要正确预构建和转换。
13
-
14
- ## 解决方案
15
-
16
- ### 方案 1:清理缓存并重启(推荐先尝试)
17
-
18
- ```bash
19
- # 1. 停止开发服务器(Ctrl+C)
20
-
21
- # 2. 删除 Vite 缓存
22
- rm -rf node_modules/.vite
23
-
24
- # 3. 如果使用 pnpm,清理 pnpm 缓存
25
- rm -rf node_modules/.pnpm
26
-
27
- # 4. 重新安装依赖(可选,如果上述步骤无效)
28
- pnpm install
29
-
30
- # 5. 重新启动开发服务器
31
- pnpm dev
32
- ```
33
-
34
- ### 方案 2:检查 vite.config.js 配置
35
-
36
- 确保 `vite.config.js` 中包含以下配置:
37
-
38
- ```javascript
39
- export default defineConfig({
40
- // ... 其他配置
41
-
42
- // 优化依赖预构建
43
- optimizeDeps: {
44
- include: [
45
- // ... 其他依赖
46
- 'vxe-table',
47
- 'xe-utils',
48
- ],
49
- exclude: ['cmpt-huitu-ui', 'cmpt-huitu-utils'],
50
- esbuildOptions: {
51
- format: 'esm',
52
- supported: {
53
- 'dynamic-import': true,
54
- 'import-meta': true,
55
- },
56
- },
57
- },
58
-
59
- // 路径解析配置
60
- resolve: {
61
- // ... 其他配置
62
- dedupe: ['vxe-table', 'xe-utils'],
63
- },
64
-
65
- // 构建配置
66
- build: {
67
- // ... 其他配置
68
- commonjsOptions: {
69
- transformMixedEsModules: true,
70
- include: [/xe-utils/, /vxe-table/],
71
- },
72
- },
73
- })
74
- ```
75
-
76
- ### 方案 3:如果上述方案无效,尝试强制重新构建
77
-
78
- 在 `vite.config.js` 中临时设置:
79
-
80
- ```javascript
81
- optimizeDeps: {
82
- // ... 其他配置
83
- force: true, // 强制重新构建依赖
84
- }
85
- ```
86
-
87
- 然后重启开发服务器。构建完成后,可以改回 `force: false`。
88
-
89
- ### 方案 4:检查 vxe-table 版本
90
-
91
- 如果问题仍然存在,可能是 `vxe-table` 版本与 `xe-utils` 版本不兼容。
92
-
93
- 检查 `cmpt-huitu-ui` 包中的 `vxe-table` 版本:
94
-
95
- ```bash
96
- cd node_modules/cmpt-huitu-ui
97
- cat package.json | grep vxe-table
98
- ```
99
-
100
- 如果版本过旧,可能需要更新 `cmpt-huitu-ui` 包。
101
-
102
- ### 方案 5:使用 Vite 插件(最后手段)
103
-
104
- 如果以上方案都无效,可以创建一个 Vite 插件来处理:
105
-
106
- ```javascript
107
- // vite/plugins/fixXeUtils.js
108
- export default function fixXeUtils() {
109
- return {
110
- name: 'fix-xe-utils',
111
- enforce: 'pre',
112
- resolveId(id) {
113
- if (id === 'xe-utils') {
114
- return id
115
- }
116
- },
117
- load(id) {
118
- if (id === 'xe-utils') {
119
- // 返回一个包装的 ESM 模块
120
- return `
121
- import * as xeUtils from 'xe-utils'
122
- export default xeUtils
123
- export * from 'xe-utils'
124
- `
125
- }
126
- },
127
- }
128
- }
129
- ```
130
-
131
- 然后在 `vite.config.js` 中使用:
132
-
133
- ```javascript
134
- import fixXeUtils from './vite/plugins/fixXeUtils'
135
-
136
- export default defineConfig({
137
- plugins: [
138
- // ... 其他插件
139
- fixXeUtils(),
140
- ],
141
- // ... 其他配置
142
- })
143
- ```
144
-
145
- ## 验证
146
-
147
- 修复后,检查以下内容:
148
-
149
- 1. ✅ 控制台没有 `xe-utils` 相关错误
150
- 2. ✅ 页面正常加载
151
- 3. ✅ `VexTable` 组件可以正常使用
152
-
153
- ## 注意事项
154
-
155
- - 如果使用 Monorepo,确保 `cmpt-huitu-ui` 包已正确发布并安装
156
- - 清理缓存后,首次启动可能会较慢(需要重新预构建依赖)
157
- - 如果问题持续存在,可能需要检查 `vxe-table` 和 `xe-utils` 的版本兼容性
158
-