@qingtian/qtcli 1.0.1 → 1.0.2-beta.2

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
@@ -1,193 +1,260 @@
1
- # QTCli
2
-
3
- QTCli 是一款基于 Node.js 的前端工程化底座,提供了完整的项目构建、开发和部署解决方案。
4
-
5
- ## 特性
6
-
7
- - 🚀 快速创建和初始化项目
8
- - 📦 内置 Webpack 构建配置
9
- - 🔥 支持 React + TypeScript 开发
10
- - 🎨 支持 LessSassCSS Modules
11
- - 📱 支持移动端适配
12
- - 🔍 内置 ESLint、StyleLint 代码规范检查
13
- - 🛠 支持自定义配置和插件扩展
14
-
15
- ## 安装
16
-
17
- ```bash
18
- npm install -g qtcli
19
- ```
20
-
21
- ## 使用方法
22
-
23
- ### 查看帮助
24
-
25
- ```bash
26
- qtcli --help
27
- ```
28
-
29
- ### 初始化项目
30
-
31
- ```bash
32
- qtcli init [options]
33
- ```
34
-
35
- ### 开发模式
36
-
37
- ```bash
38
- qtcli dev [options]
39
- ```
40
-
41
- ### 构建项目
42
-
43
- ```bash
44
- qtcli build [options]
45
- ```
46
-
47
- ### 全局选项
48
-
49
- - `-V, --version`: 显示版本号
50
- - `-D, --debug`: 启用调试模式
51
- - `-h, --help`: 显示帮助信息
52
-
53
- ## 项目结构
54
-
55
- ```
56
- my-project/
57
- ├── src/ # 源代码目录
58
- ├── public/ # 静态资源目录
59
- ├── dist/ # 构建输出目录
60
- └── qt.conf.js # 项目配置文件
61
- ```
62
-
63
- ## 配置说明
64
-
65
- 在项目根目录创建 `qt.conf.js` 文件进行自定义配置:
66
-
67
- ```javascript
68
- export default {
69
- // 构建类型
70
- buildType: 'WEB',
71
-
72
- // 解决方案名称
73
- solutionName: 'my-project',
74
-
75
- // 构建模式
76
- buildMode: {
77
- development: 'DEVELOPMENT',
78
- production: 'PRODUCTION',
79
- test: 'TEST',
80
- analyze: 'ANALYZE'
81
- },
82
-
83
- // 项目配置
84
- config: {
85
- // HTML 注入配置
86
- htmlInject: {
87
- head: [
88
- // meta 标签
89
- {
90
- tag: 'meta',
91
- attrs: {
92
- charset: 'utf-8'
93
- }
94
- },
95
- {
96
- tag: 'meta',
97
- attrs: {
98
- name: 'viewport',
99
- content: 'width=device-width, initial-scale=1'
100
- }
101
- },
102
- // link 标签
103
- {
104
- tag: 'link',
105
- attrs: {
106
- rel: 'stylesheet',
107
- href: '/static/css/global.css'
108
- }
109
- }
110
- ],
111
- body: [
112
- // body 中的 script
113
- {
114
- tag: 'script',
115
- attrs: {
116
- src: '/static/js/init.js'
117
- }
118
- }
119
- ]
120
- },
121
-
122
- // JavaScript 代码片段注入配置
123
- jsInject: {
124
- head: [
125
- {
126
- code: `window.APP_CONFIG = {
127
- version: '1.0.0',
128
- env: '${process.env.NODE_ENV}',
129
- apiUrl: '${process.env.API_URL}'
130
- };`
131
- }
132
- ],
133
- body: [
134
- {
135
- code: `document.addEventListener('DOMContentLoaded', function() {
136
- console.log('DOM loaded');
137
- });`
138
- }
139
- ]
140
- },
141
-
142
- // 环境变量配置
143
- env: {
144
- development: {
145
- NODE_ENV: 'development',
146
- API_URL: 'http://dev-api.example.com'
147
- },
148
- production: {
149
- NODE_ENV: 'production',
150
- API_URL: 'http://api.example.com'
151
- }
152
- }
153
- },
154
-
155
- // webpack 配置
156
- webpackConfig: {
157
- // 开发服务器配置
158
- devServer: {
159
- port: 3000,
160
- host: 'localhost'
161
- },
162
- // 解析配置
163
- resolve: {
164
- alias: {
165
- '@components': './src/components',
166
- '@utils': './src/utils'
167
- }
168
- },
169
- // 模块规则
170
- module: {
171
- rules: []
172
- },
173
- // 插件配置
174
- plugins: []
175
- }
176
- }
177
- ```
178
-
179
- ## 开发环境要求
180
-
181
- - Node.js >= 14.0.0
182
- - npm >= 6.0.0
183
-
184
- ## 作者
185
-
186
- - yujie.guo - 初始作者
187
-
188
- ## 问题反馈
189
-
190
- 如果你遇到任何问题或有任何建议,请通过以下方式联系我们:
191
-
192
- - 提交 Issue: [GitHub Issues](https://gitee.com/fengrengame/qtnode/issues)
193
- - 邮件联系: 296963166@qq.com
1
+ # 🔐 文件加密解密工具
2
+
3
+ 一个基于 Node.js 的安全文件加密解密工具,使用 AES-256-CBC 算法保护您的敏感文件。
4
+
5
+ ## ✨ 功能特性
6
+
7
+ - 🔒 **安全加密**: 使用 AES-256-CBC 加密算法
8
+ - 🔑 **密码保护**: 支持密码输入和验证
9
+ - 📁 **文件完整性**: 保持原始文件内容完全不变
10
+ - 🌍 **跨平台**: 支持 WindowsmacOSLinux
11
+ - 💻 **命令行界面**: 简单易用的 CLI 工具
12
+ - 🔍 **文件验证**: 自动检测加密文件格式
13
+ - 📊 **文件信息**: 显示详细的文件信息
14
+
15
+ ## 📋 系统要求
16
+
17
+ - Node.js >= 14.0.0
18
+ - npm (通常随 Node.js 一起安装)
19
+
20
+ ## 🚀 快速开始
21
+
22
+ ### 1. 查看帮助信息
23
+ ```bash
24
+ node file-crypto.js
25
+ ```
26
+
27
+ ### 2. 加密文件
28
+ ```bash
29
+ # 交互式输入密码
30
+ node file-crypto.js encrypt test.txt test.enc
31
+
32
+ # 直接指定密码
33
+ node file-crypto.js encrypt test.txt test.enc mypassword
34
+ ```
35
+
36
+ ### 3. 解密文件
37
+ ```bash
38
+ # 交互式输入密码
39
+ node file-crypto.js decrypt test.enc test_decrypted.txt
40
+
41
+ # 直接指定密码
42
+ node file-crypto.js decrypt test.enc test_decrypted.txt mypassword
43
+ ```
44
+
45
+ ### 4. 查看文件信息
46
+ ```bash
47
+ node file-crypto.js info test.txt
48
+ ```
49
+
50
+ ### 5. 验证加密文件
51
+ ```bash
52
+ node file-crypto.js verify test.enc
53
+ ```
54
+
55
+ ## 📖 详细用法
56
+
57
+ ### 命令格式
58
+ ```bash
59
+ node file-crypto.js <命令> [参数...]
60
+ ```
61
+
62
+ ### 可用命令
63
+
64
+ #### `encrypt` - 加密文件
65
+ ```bash
66
+ node file-crypto.js encrypt <输入文件> <输出文件> [密码]
67
+ ```
68
+ - **输入文件**: 要加密的原始文件路径
69
+ - **输出文件**: 加密后的文件保存路径
70
+ - **密码**: 可选,如果不提供会提示输入
71
+
72
+ #### `decrypt` - 解密文件
73
+ ```bash
74
+ node file-crypto.js decrypt <输入文件> <输出文件> [密码]
75
+ ```
76
+ - **输入文件**: 要解密的加密文件路径
77
+ - **输出文件**: 解密后的文件保存路径
78
+ - **密码**: 可选,如果不提供会提示输入
79
+
80
+ #### `info` - 显示文件信息
81
+ ```bash
82
+ node file-crypto.js info <文件路径>
83
+ ```
84
+ 显示文件的详细信息,包括:
85
+ - 文件大小
86
+ - 文件类型
87
+ - 修改时间
88
+ - 加密状态
89
+
90
+ #### `verify` - 验证加密文件
91
+ ```bash
92
+ node file-crypto.js verify <文件路径>
93
+ ```
94
+ 检查文件是否为有效的加密文件格式。
95
+
96
+ ## 🔧 技术细节
97
+
98
+ ### 加密算法
99
+ - **算法**: AES-256-CBC
100
+ - **密钥派生**: 使用 scrypt 从密码生成密钥
101
+ - **IV**: 随机生成的 16 字节初始化向量
102
+ - **输出格式**: `IV:加密数据` (十六进制编码)
103
+
104
+ ### 安全特性
105
+ - ✅ 每次加密使用不同的随机 IV
106
+ - ✅ 使用强密钥派生函数 (scrypt)
107
+ - ✅ 支持任意大小的文件
108
+ - ✅ 密码输入时隐藏显示
109
+ - ✅ 文件格式验证
110
+
111
+ ### 文件格式
112
+ 加密后的文件格式为:
113
+ ```
114
+ <IV十六进制>:<加密数据十六进制>
115
+ ```
116
+
117
+ ## 📝 使用示例
118
+
119
+ ### 示例 1: 基本加密解密
120
+ ```bash
121
+ # 1. 创建测试文件
122
+ echo "这是一个秘密文件" > secret.txt
123
+
124
+ # 2. 加密文件
125
+ node file-crypto.js encrypt secret.txt secret.enc
126
+
127
+ # 3. 查看加密文件信息
128
+ node file-crypto.js info secret.enc
129
+
130
+ # 4. 验证加密文件
131
+ node file-crypto.js verify secret.enc
132
+
133
+ # 5. 解密文件
134
+ node file-crypto.js decrypt secret.enc secret_decrypted.txt
135
+
136
+ # 6. 验证解密结果
137
+ diff secret.txt secret_decrypted.txt
138
+ ```
139
+
140
+ ### 示例 2: 批量处理
141
+ ```bash
142
+ # 批量加密当前目录下的所有 .txt 文件
143
+ for file in *.txt; do
144
+ node file-crypto.js encrypt "$file" "${file}.enc"
145
+ done
146
+
147
+ # 批量解密所有 .enc 文件
148
+ for file in *.enc; do
149
+ base_name=$(basename "$file" .enc)
150
+ node file-crypto.js decrypt "$file" "${base_name}_decrypted.txt"
151
+ done
152
+ ```
153
+
154
+ ### 示例 3: 自动化脚本
155
+ ```bash
156
+ #!/bin/bash
157
+ # encrypt-all.sh
158
+
159
+ for file in "$@"; do
160
+ if [ -f "$file" ]; then
161
+ echo "加密文件: $file"
162
+ node file-crypto.js encrypt "$file" "${file}.enc"
163
+ fi
164
+ done
165
+ ```
166
+
167
+ ## ⚠️ 安全注意事项
168
+
169
+ ### 密码安全
170
+ - 🔒 请妥善保管密码,密码丢失将无法解密
171
+ - 🔒 建议使用强密码(包含大小写字母、数字、特殊字符)
172
+ - 🔒 不要在命令行历史中留下密码
173
+ - 🔒 定期更换密码
174
+
175
+ ### 文件安全
176
+ - 🔒 加密文件不要与原始文件放在同一位置
177
+ - 🔒 定期备份重要的加密文件
178
+ - 🔒 删除原始文件前确保加密成功
179
+ - 🔒 使用安全的存储介质
180
+
181
+ ### 环境安全
182
+ - 🔒 在安全的计算机上使用
183
+ - 🔒 避免在公共网络传输加密文件
184
+ - 🔒 定期更新 Node.js 版本
185
+
186
+ ## 🐛 常见问题
187
+
188
+ ### Q: 加密失败怎么办?
189
+ A: 检查以下几点:
190
+ - 输入文件是否存在
191
+ - 是否有足够的磁盘空间
192
+ - 是否有文件读写权限
193
+ - 密码是否包含特殊字符
194
+
195
+ ### Q: 解密失败怎么办?
196
+ A: 可能的原因:
197
+ - 密码错误
198
+ - 文件不是有效的加密文件
199
+ - 文件已损坏
200
+ - 使用了不同的加密算法
201
+
202
+ ### Q: 如何验证加密是否成功?
203
+ A: 使用以下命令:
204
+ ```bash
205
+ node file-crypto.js verify <加密文件>
206
+ node file-crypto.js info <加密文件>
207
+ ```
208
+
209
+ ### Q: 支持哪些文件类型?
210
+ A: 支持所有类型的文件,包括:
211
+ - 文本文件 (.txt, .md, .js, .py 等)
212
+ - 图片文件 (.jpg, .png, .gif 等)
213
+ - 文档文件 (.pdf, .doc, .xls 等)
214
+ - 压缩文件 (.zip, .rar 等)
215
+ - 任何二进制文件
216
+
217
+ ## 🔄 错误处理
218
+
219
+ ### 常见错误信息
220
+ ```
221
+ ❌ 加密失败: 输入文件不存在: input.txt
222
+ ❌ 解密失败: 文件格式错误,无法解密
223
+ ❌ 解密失败: 密码错误
224
+ ❌ 无法获取文件信息: file.txt
225
+ ```
226
+
227
+ ### 错误代码
228
+ - **文件不存在**: 检查文件路径是否正确
229
+ - **权限不足**: 检查文件读写权限
230
+ - **磁盘空间不足**: 清理磁盘空间
231
+ - **密码错误**: 确认密码正确性
232
+
233
+ ## 📄 许可证
234
+
235
+ MIT License
236
+
237
+ ## 🤝 贡献
238
+
239
+ 欢迎提交 Issue 和 Pull Request!
240
+
241
+ ## 📞 支持
242
+
243
+ 如果您遇到问题或有建议,请:
244
+ 1. 查看本文档的常见问题部分
245
+ 2. 提交 GitHub Issue
246
+ 3. 联系开发者
247
+
248
+ ## 📈 更新日志
249
+
250
+ ### v1.0.0 (2024-01-01)
251
+ - 🎉 初始版本发布
252
+ - ✨ 支持基本的文件加密解密
253
+ - 🔐 使用 AES-256-CBC 算法
254
+ - 💻 命令行界面
255
+ - 🔍 文件验证功能
256
+ - 📊 文件信息显示
257
+
258
+ ---
259
+
260
+ **注意**: 这是一个演示工具,用于学习和测试目的。在生产环境中使用前,请确保了解相关的安全风险。
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingtian/qtcli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2-beta.2",
4
4
  "description": "QTCli是一款基于node的前端工程化底座",
5
5
  "homepage": "https://gitee.com/fengrengame/qtnode#readme",
6
6
  "bugs": {
@@ -72,6 +72,7 @@
72
72
  "@babel/preset-env": "7.18.2",
73
73
  "@babel/preset-react": "7.17.12",
74
74
  "@babel/preset-typescript": "7.17.12",
75
+ "@commitlint/cli": "^19.8.0",
75
76
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
76
77
  "@svgr/webpack": "^5.5.0",
77
78
  "@types/react": "18.0.12",
@@ -109,6 +110,7 @@
109
110
  "fs-extra": "^10.0.0",
110
111
  "glob-all": "3.3.1",
111
112
  "html-webpack-plugin": "^5.5.0",
113
+ "html-webpack-tags-plugin": "^3.0.0",
112
114
  "husky": "8.0.3",
113
115
  "identity-obj-proxy": "^3.0.0",
114
116
  "inquirer": "8.0.0",
@@ -158,9 +160,8 @@
158
160
  "webpack-manifest-plugin": "^4.0.2",
159
161
  "webpack-merge": "5.8.0",
160
162
  "workbox-webpack-plugin": "^6.4.1",
161
- "yamljs": "0.3.0",
162
- "html-webpack-tags-plugin": "^3.0.0",
163
- "@commitlint/cli": "^19.8.0"
163
+ "xlsx": "^0.18.5",
164
+ "yamljs": "0.3.0"
164
165
  },
165
166
  "devDependencies": {
166
167
  "@types/autoprefixer": "10.2.0",
package/dist/qt.conf.js CHANGED
@@ -54,14 +54,16 @@ module.exports = {
54
54
  },
55
55
  // JavaScript 代码片段注入配置
56
56
  jsInject: {
57
- head: [{
57
+ head: [
58
+ {
58
59
  code: "window.APP_CONFIG = {\n version: '1.0.0',\n env: '".concat(process.env.NODE_ENV, "',\n apiUrl: '").concat(process.env.API_URL, "'\n };"),
59
60
  },
60
61
  {
61
62
  code: "window.initGlobalConfig = function() {\n console.log('Global config initialized');\n };",
62
63
  },
63
64
  ],
64
- body: [{
65
+ body: [
66
+ {
65
67
  code: "document.addEventListener('DOMContentLoaded', function() {\n console.log('DOM loaded');\n window.initGlobalConfig();\n });",
66
68
  },
67
69
  {
@@ -48,10 +48,10 @@ exports.default = (function () {
48
48
  var heat = new commander_1.default.Command('dev');
49
49
  heat
50
50
  .description('开启本地调试服务器')
51
- .option('--https [http]', '启用https', false)
52
- .option('-p, --port <port>', '绑定端口', false)
53
- .option('-d, --domain <host>', '绑定域名', 'localhost')
54
- .option('-o, --open <open>', '自动打开浏览器', false)
51
+ .option('--https [https]', '启用https')
52
+ .option('-p, --port <port>', '绑定端口')
53
+ .option('-d, --domain <host>', '绑定域名')
54
+ .option('-o, --open <open>', '自动打开浏览器')
55
55
  .action(function (options, cmd) { return __awaiter(void 0, void 0, void 0, function () {
56
56
  var cm;
57
57
  return __generator(this, function (_a) {
@@ -43,6 +43,7 @@ var ProcessEnvLoader = /** @class */ (function () {
43
43
  try {
44
44
  // 加载 qtcli.config.js
45
45
  var qtConfigPath = path_1.default.join(rootDir, 'qt.conf.js');
46
+ console.log('qtconfigpat', qtConfigPath, rootDir);
46
47
  if (fs_1.default.existsSync(qtConfigPath)) {
47
48
  this.qtConfig = require(qtConfigPath);
48
49
  // 将 qtConfig 中的环境变量添加到 process.env
@@ -32,7 +32,10 @@ function deepMerge(target, source) {
32
32
  for (var key in source) {
33
33
  var sourceValue = source[key];
34
34
  var targetValue = target[key];
35
- if (sourceValue !== null && typeof sourceValue === 'object' && targetValue !== null && typeof targetValue === 'object') {
35
+ if (sourceValue !== null &&
36
+ typeof sourceValue === 'object' &&
37
+ targetValue !== null &&
38
+ typeof targetValue === 'object') {
36
39
  // 如果是数组,直接合并
37
40
  if (Array.isArray(sourceValue)) {
38
41
  result[key] = __spreadArray(__spreadArray([], targetValue, true), sourceValue, true);
@@ -134,7 +134,9 @@ exports.formatOutput = {
134
134
  return __generator(this, function (_c) {
135
135
  nodes = [];
136
136
  errorMessages = output.errors > 0
137
- ? ((_a = output.buildErrors) === null || _a === void 0 ? void 0 : _a.map(function (error) { return "".concat(colors_1.default.red('ERROR'), " in ").concat(colors_1.default.white("".concat(error.moduleName, "\n").concat(error.message)), "\n").concat(error === null || error === void 0 ? void 0 : error.stack); }).join('\n')) || "".concat(colors_1.default.red(String(output.errors)), " \u4E2A\u9519\u8BEF")
137
+ ? ((_a = output.buildErrors) === null || _a === void 0 ? void 0 : _a.map(function (error) {
138
+ return "".concat(colors_1.default.red('ERROR'), " in ").concat(colors_1.default.white("".concat(error.moduleName, "\n").concat(error.message)), "\n").concat(error === null || error === void 0 ? void 0 : error.stack);
139
+ }).join('\n')) || "".concat(colors_1.default.red(String(output.errors)), " \u4E2A\u9519\u8BEF")
138
140
  : '无错误';
139
141
  nodes.push((0, exports.formatNode)({
140
142
  type: 'process',
@@ -185,18 +187,14 @@ exports.formatOutput = {
185
187
  var nodes, errorMessages, warningMessages, errorText, warningText, timeText;
186
188
  return __generator(this, function (_a) {
187
189
  nodes = [];
188
- errorMessages = output.errorCount > 0
189
- ? formatESLintMessages(output.results, 2)
190
- : '无错误';
190
+ errorMessages = output.errorCount > 0 ? formatESLintMessages(output.results, 2) : '无错误';
191
191
  nodes.push((0, exports.formatNode)({
192
192
  type: 'process',
193
193
  title: 'ESLint错误',
194
194
  content: errorMessages,
195
195
  status: output.errorCount > 0 ? 'error' : 'success',
196
196
  }));
197
- warningMessages = output.warningCount > 0
198
- ? formatESLintMessages(output.results, 1)
199
- : '无警告';
197
+ warningMessages = output.warningCount > 0 ? formatESLintMessages(output.results, 1) : '无警告';
200
198
  nodes.push((0, exports.formatNode)({
201
199
  type: 'process',
202
200
  title: 'ESLint警告',
@@ -63,9 +63,7 @@ var teamData = [
63
63
  },
64
64
  {
65
65
  teamName: '数据猎鹰战队',
66
- members: [
67
- { name: '刘翀', type: '战队队员' },
68
- ],
66
+ members: [{ name: '刘翀', type: '战队队员' }],
69
67
  },
70
68
  ],
71
69
  members: [
@@ -160,20 +158,14 @@ var teamData = [
160
158
  },
161
159
  {
162
160
  teamName: '模块构造者战队',
163
- members: [
164
- { name: '石军强', type: '军团指挥官' },
165
- ],
161
+ members: [{ name: '石军强', type: '军团指挥官' }],
166
162
  },
167
163
  {
168
164
  teamName: '创世者战队',
169
- members: [
170
- { name: '吴桥', type: '战队员' },
171
- ],
165
+ members: [{ name: '吴桥', type: '战队员' }],
172
166
  },
173
167
  ],
174
- members: [
175
- { name: '石军强', type: '军团指挥官' },
176
- ],
168
+ members: [{ name: '石军强', type: '军团指挥官' }],
177
169
  },
178
170
  ];
179
171
  exports.default = teamData;
@@ -58,7 +58,7 @@ function dev() {
58
58
  Object.assign(devServerOptions, {
59
59
  open: (_c = (_b = argCmd === null || argCmd === void 0 ? void 0 : argCmd.open) !== null && _b !== void 0 ? _b : devServerOptions.open) !== null && _c !== void 0 ? _c : false,
60
60
  port: (argCmd === null || argCmd === void 0 ? void 0 : argCmd.port) || process.env.PORT || devServerOptions.port || 'auto',
61
- server: (argCmd === null || argCmd === void 0 ? void 0 : argCmd.http) ? 'https' : devServerOptions.server || 'http',
61
+ server: (argCmd === null || argCmd === void 0 ? void 0 : argCmd.https) ? 'https' : devServerOptions.server || 'http',
62
62
  host: (argCmd === null || argCmd === void 0 ? void 0 : argCmd.domain) || devServerOptions.host || 'localhost',
63
63
  });
64
64
  // 合并代理配置
@@ -5,14 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
7
7
  var path = require('path');
8
- var globAll = require('glob-all');
8
+ // const globAll = require('glob-all');
9
9
  var CompressionPlugin = require('compression-webpack-plugin');
10
10
  var merge = require('webpack-merge').merge;
11
11
  var baseConfig = require('./webpack.base').default;
12
12
  var CopyPlugin = require('copy-webpack-plugin');
13
13
  var CssMinimizerPlugin = require('css-minimizer-webpack-plugin');
14
14
  var TerserPlugin = require('terser-webpack-plugin');
15
- var PurgeCSSPlugin = require('purgecss-webpack-plugin');
15
+ // const PurgeCSSPlugin = require('purgecss-webpack-plugin');
16
16
  exports.default = merge(baseConfig, {
17
17
  mode: 'production',
18
18
  plugins: [
@@ -30,16 +30,16 @@ exports.default = merge(baseConfig, {
30
30
  new mini_css_extract_plugin_1.default({
31
31
  filename: 'static/css/[name].[contenthash].css',
32
32
  }),
33
- new PurgeCSSPlugin({
34
- paths: globAll.sync([
35
- "".concat(path.join(process.cwd(), './src'), "/**/*.tsx"),
36
- "".concat(path.join(process.cwd(), './src'), "/**/*.jsx"),
37
- path.join(process.cwd(), './public/index.html'),
38
- ]),
39
- safelist: {
40
- standard: [/^ant-/],
41
- },
42
- }),
33
+ // new PurgeCSSPlugin({
34
+ // paths: globAll.sync([
35
+ // `${path.join(process.cwd(), './src')}/**/*.tsx`,
36
+ // `${path.join(process.cwd(), './src')}/**/*.jsx`,
37
+ // path.join(process.cwd(), './public/index.html'),
38
+ // ]),
39
+ // safelist: {
40
+ // standard: [/^ant-/],
41
+ // },
42
+ // }),
43
43
  new CompressionPlugin({
44
44
  test: /.(js|css)$/,
45
45
  filename: '[path][base].gz',
package/package.json CHANGED
@@ -1,203 +1,201 @@
1
- {
2
- "name": "@qingtian/qtcli",
3
- "version": "1.0.1",
4
- "description": "QTCli是一款基于node的前端工程化底座",
5
- "homepage": "https://gitee.com/fengrengame/qtnode#readme",
6
- "bugs": {
7
- "url": "https://gitee.com/fengrengame/qtnode/issues"
8
- },
9
- "repository": {
10
- "type": "git",
11
- "url": "git+https://gitee.com/fengrengame/qtnode.git"
12
- },
13
- "license": "ISC",
14
- "author": "yujie.guo",
15
- "type": "commonjs",
16
- "main": "./dist/bin/cli.js",
17
- "bin": {
18
- "qtcli": "./dist/bin/cli.js"
19
- },
20
- "files": [
21
- "dist",
22
- "README.md"
23
- ],
24
- "keywords": [
25
- "cli",
26
- "frontend",
27
- "build-tool",
28
- "webpack",
29
- "react"
30
- ],
31
- "publishConfig": {
32
- "registry": "https://registry.npmjs.org/"
33
- },
34
- "scripts": {
35
- "build": "rimraf ./dist && tsc -p .",
36
- "clean": "rimraf ./dist",
37
- "f2elint-fix": "f2elint fix",
38
- "f2elint-scan": "f2elint scan",
39
- "lint": "eslint .",
40
- "lint:fix": "eslint --fix .",
41
- "prepare": "husky install",
42
- "prepublishOnly": "npm run build",
43
- "start": "node --max-old-space-size=8192 ./node_modules/.bin/ts-node ./bin/cli.ts"
44
- },
45
- "commitlint": {
46
- "extends": [
47
- "ali"
48
- ]
49
- },
50
- "lint-staged": {
51
- "*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": "eslint --fix",
52
- "*.{css,less,scss}": "stylelint --fix",
53
- "*.{cjs,css,cts,html,js,json,jsx,less,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}": "prettier --write"
54
- },
55
- "eslintConfig": {
56
- "extends": [
57
- "ali/typescript/node"
58
- ]
59
- },
60
- "stylelint": {},
61
- "dependencies": {
62
- "@babel/cli": "7.24.6",
63
- "@babel/core": "^7.16.0",
64
- "@babel/plugin-proposal-class-properties": "7.18.6",
65
- "@babel/plugin-proposal-decorators": "7.18.2",
66
- "@babel/plugin-proposal-object-rest-spread": "7.20.7",
67
- "@babel/plugin-syntax-flow": "7.24.6",
68
- "@babel/plugin-transform-block-scoping": "7.27.0",
69
- "@babel/plugin-transform-flow-strip-types": "7.24.6",
70
- "@babel/plugin-transform-runtime": "7.18.5",
71
- "@babel/plugin-transform-typescript": "7.24.6",
72
- "@babel/preset-env": "7.18.2",
73
- "@babel/preset-react": "7.17.12",
74
- "@babel/preset-typescript": "7.17.12",
75
- "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
76
- "@svgr/webpack": "^5.5.0",
77
- "@types/react": "18.0.12",
78
- "@types/react-dom": "18.0.5",
79
- "autoprefixer": "10.4.7",
80
- "babel-loader": "^8.2.3",
81
- "babel-plugin-import": "1.13.8",
82
- "babel-plugin-named-asset-import": "^0.3.8",
83
- "babel-preset-react-app": "^10.0.1",
84
- "bfj": "^7.0.2",
85
- "browserslist": "^4.18.1",
86
- "camelcase": "^6.2.1",
87
- "case-sensitive-paths-webpack-plugin": "^2.4.0",
88
- "cli-progress": "3.12.0",
89
- "colors": "1.4.0",
90
- "commander": "12.1.0",
91
- "commitlint-config-ali": "1.1.0",
92
- "compressing": "1.10.0",
93
- "compression-webpack-plugin": "10.0.0",
94
- "copy-webpack-plugin": "11.0.0",
95
- "core-js": "3.23.0",
96
- "cross-env": "7.0.3",
97
- "css-loader": "^6.5.1",
98
- "css-minimizer-webpack-plugin": "^3.2.0",
99
- "dotenv": "^10.0.0",
100
- "dotenv-expand": "^5.1.0",
101
- "eslint": "^8.3.0",
102
- "eslint-config-ali": "15.1.0",
103
- "eslint-config-prettier": "9.1.0",
104
- "eslint-config-react-app": "^7.0.1",
105
- "eslint-plugin-prettier": "5.2.6",
106
- "eslint-webpack-plugin": "^3.1.1",
107
- "extract-zip": "2.0.1",
108
- "file-loader": "^6.2.0",
109
- "fs-extra": "^10.0.0",
110
- "glob-all": "3.3.1",
111
- "html-webpack-plugin": "^5.5.0",
112
- "husky": "8.0.3",
113
- "identity-obj-proxy": "^3.0.0",
114
- "inquirer": "8.0.0",
115
- "less": "4.1.3",
116
- "less-loader": "11.0.0",
117
- "lint-staged": "15.5.1",
118
- "mini-css-extract-plugin": "^2.7.6",
119
- "postcss": "^8.4.38",
120
- "postcss-flexbugs-fixes": "^5.0.2",
121
- "postcss-loader": "^6.2.1",
122
- "postcss-normalize": "^10.0.1",
123
- "postcss-preset-env": "^7.0.1",
124
- "prettier": "3.5.3",
125
- "prettier-config-ali": "1.3.2",
126
- "progress": "2.0.3",
127
- "progress-bar-webpack-plugin": "2.1.0",
128
- "prompts": "^2.4.2",
129
- "purgecss-webpack-plugin": "4.1.3",
130
- "react": "^18.2.0",
131
- "react-app-polyfill": "^3.0.0",
132
- "react-dev-utils": "^12.0.1",
133
- "react-dom": "^18.2.0",
134
- "react-refresh": "^0.11.0",
135
- "resolve": "^1.20.0",
136
- "resolve-url-loader": "^4.0.0",
137
- "rimraf": "5.0.7",
138
- "sass": "1.70.0",
139
- "sass-loader": "^12.3.0",
140
- "semver": "^7.3.5",
141
- "source-map-loader": "^3.0.0",
142
- "speed-measure-webpack-plugin": "1.5.0",
143
- "style-loader": "^3.3.1",
144
- "stylelint": "16.19.1",
145
- "stylelint-config-ali": "2.1.2",
146
- "stylelint-prettier": "5.0.3",
147
- "tailwindcss": "^3.0.2",
148
- "terser-webpack-plugin": "^5.2.5",
149
- "thread-loader": "3.0.4",
150
- "ts-node": "10.9.2",
151
- "typescript": "4.7.3",
152
- "unzip": "0.1.11",
153
- "url-loader": "4.1.1",
154
- "webpack": "^5.64.4",
155
- "webpack-bundle-analyzer": "4.5.0",
156
- "webpack-cli": "4.9.2",
157
- "webpack-dev-server": "^4.6.0",
158
- "webpack-manifest-plugin": "^4.0.2",
159
- "webpack-merge": "5.8.0",
160
- "workbox-webpack-plugin": "^6.4.1",
161
- "yamljs": "0.3.0",
162
-
163
- "html-webpack-tags-plugin": "^3.0.0",
164
-
165
- "@commitlint/cli": "^19.8.0"
166
-
167
- },
168
- "devDependencies": {
169
- "@types/autoprefixer": "10.2.0",
170
- "@types/cli-progress": "3.11.5",
171
- "@types/colors": "1.2.1",
172
- "@types/commander": "2.12.2",
173
- "@types/compression-webpack-plugin": "9.1.1",
174
- "@types/copy-webpack-plugin": "10.1.0",
175
- "@types/css-minimizer-webpack-plugin": "3.2.1",
176
- "@types/extract-zip": "2.0.1",
177
- "@types/glob": "^8.1.0",
178
- "@types/html-webpack-plugin": "3.2.9",
179
- "@types/inquirer": "9.0.7",
180
- "@types/less": "3.0.6",
181
- "@types/mini-css-extract-plugin": "2.5.1",
182
- "@types/node": "14.18.47",
183
- "@types/progress": "2.0.7",
184
- "@types/progress-bar-webpack-plugin": "2.1.5",
185
- "@types/react": "19.1.2",
186
- "@types/react-dom": "19.1.2",
187
- "@types/react-refresh": "0.14.6",
188
- "@types/rimraf": "4.0.5",
189
- "@types/speed-measure-webpack-plugin": "1.3.6",
190
- "@types/typescript": "2.0.0",
191
- "@types/unzip": "0.1.4",
192
- "@types/webpack": "5.28.5",
193
- "@types/webpack-bundle-analyzer": "4.7.0",
194
- "@types/webpack-dev-server": "4.7.2",
195
- "@types/webpack-merge": "5.0.0",
196
- "@types/yamljs": "0.2.34",
197
- "babel-jest": "^27.4.2",
198
- "jest": "^27.4.3",
199
- "jest-resolve": "^27.4.2",
200
- "jest-watch-typeahead": "^1.0.0"
201
- },
202
- "email": "296963166@qq.com"
203
- }
1
+ {
2
+ "name": "@qingtian/qtcli",
3
+ "version": "1.0.2-beta.2",
4
+ "description": "QTCli是一款基于node的前端工程化底座",
5
+ "homepage": "https://gitee.com/fengrengame/qtnode#readme",
6
+ "bugs": {
7
+ "url": "https://gitee.com/fengrengame/qtnode/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://gitee.com/fengrengame/qtnode.git"
12
+ },
13
+ "license": "ISC",
14
+ "author": "yujie.guo",
15
+ "type": "commonjs",
16
+ "main": "./dist/bin/cli.js",
17
+ "bin": {
18
+ "qtcli": "./dist/bin/cli.js"
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "keywords": [
25
+ "cli",
26
+ "frontend",
27
+ "build-tool",
28
+ "webpack",
29
+ "react"
30
+ ],
31
+ "publishConfig": {
32
+ "registry": "https://registry.npmjs.org/"
33
+ },
34
+ "scripts": {
35
+ "build": "rimraf ./dist && tsc -p .",
36
+ "clean": "rimraf ./dist",
37
+ "f2elint-fix": "f2elint fix",
38
+ "f2elint-scan": "f2elint scan",
39
+ "lint": "eslint .",
40
+ "lint:fix": "eslint --fix .",
41
+ "prepare": "husky install",
42
+ "prepublishOnly": "npm run build",
43
+ "start": "node --max-old-space-size=8192 ./node_modules/.bin/ts-node ./bin/cli.ts"
44
+ },
45
+ "commitlint": {
46
+ "extends": [
47
+ "ali"
48
+ ]
49
+ },
50
+ "lint-staged": {
51
+ "*.{cjs,cts,js,jsx,mjs,mts,ts,tsx,vue}": "eslint --fix",
52
+ "*.{css,less,scss}": "stylelint --fix",
53
+ "*.{cjs,css,cts,html,js,json,jsx,less,md,mjs,mts,scss,ts,tsx,vue,yaml,yml}": "prettier --write"
54
+ },
55
+ "eslintConfig": {
56
+ "extends": [
57
+ "ali/typescript/node"
58
+ ]
59
+ },
60
+ "stylelint": {},
61
+ "dependencies": {
62
+ "@babel/cli": "7.24.6",
63
+ "@babel/core": "^7.16.0",
64
+ "@babel/plugin-proposal-class-properties": "7.18.6",
65
+ "@babel/plugin-proposal-decorators": "7.18.2",
66
+ "@babel/plugin-proposal-object-rest-spread": "7.20.7",
67
+ "@babel/plugin-syntax-flow": "7.24.6",
68
+ "@babel/plugin-transform-block-scoping": "7.27.0",
69
+ "@babel/plugin-transform-flow-strip-types": "7.24.6",
70
+ "@babel/plugin-transform-runtime": "7.18.5",
71
+ "@babel/plugin-transform-typescript": "7.24.6",
72
+ "@babel/preset-env": "7.18.2",
73
+ "@babel/preset-react": "7.17.12",
74
+ "@babel/preset-typescript": "7.17.12",
75
+ "@commitlint/cli": "^19.8.0",
76
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.3",
77
+ "@svgr/webpack": "^5.5.0",
78
+ "@types/react": "18.0.12",
79
+ "@types/react-dom": "18.0.5",
80
+ "autoprefixer": "10.4.7",
81
+ "babel-loader": "^8.2.3",
82
+ "babel-plugin-import": "1.13.8",
83
+ "babel-plugin-named-asset-import": "^0.3.8",
84
+ "babel-preset-react-app": "^10.0.1",
85
+ "bfj": "^7.0.2",
86
+ "browserslist": "^4.18.1",
87
+ "camelcase": "^6.2.1",
88
+ "case-sensitive-paths-webpack-plugin": "^2.4.0",
89
+ "cli-progress": "3.12.0",
90
+ "colors": "1.4.0",
91
+ "commander": "12.1.0",
92
+ "commitlint-config-ali": "1.1.0",
93
+ "compressing": "1.10.0",
94
+ "compression-webpack-plugin": "10.0.0",
95
+ "copy-webpack-plugin": "11.0.0",
96
+ "core-js": "3.23.0",
97
+ "cross-env": "7.0.3",
98
+ "css-loader": "^6.5.1",
99
+ "css-minimizer-webpack-plugin": "^3.2.0",
100
+ "dotenv": "^10.0.0",
101
+ "dotenv-expand": "^5.1.0",
102
+ "eslint": "^8.3.0",
103
+ "eslint-config-ali": "15.1.0",
104
+ "eslint-config-prettier": "9.1.0",
105
+ "eslint-config-react-app": "^7.0.1",
106
+ "eslint-plugin-prettier": "5.2.6",
107
+ "eslint-webpack-plugin": "^3.1.1",
108
+ "extract-zip": "2.0.1",
109
+ "file-loader": "^6.2.0",
110
+ "fs-extra": "^10.0.0",
111
+ "glob-all": "3.3.1",
112
+ "html-webpack-plugin": "^5.5.0",
113
+ "html-webpack-tags-plugin": "^3.0.0",
114
+ "husky": "8.0.3",
115
+ "identity-obj-proxy": "^3.0.0",
116
+ "inquirer": "8.0.0",
117
+ "less": "4.1.3",
118
+ "less-loader": "11.0.0",
119
+ "lint-staged": "15.5.1",
120
+ "mini-css-extract-plugin": "^2.7.6",
121
+ "postcss": "^8.4.38",
122
+ "postcss-flexbugs-fixes": "^5.0.2",
123
+ "postcss-loader": "^6.2.1",
124
+ "postcss-normalize": "^10.0.1",
125
+ "postcss-preset-env": "^7.0.1",
126
+ "prettier": "3.5.3",
127
+ "prettier-config-ali": "1.3.2",
128
+ "progress": "2.0.3",
129
+ "progress-bar-webpack-plugin": "2.1.0",
130
+ "prompts": "^2.4.2",
131
+ "purgecss-webpack-plugin": "4.1.3",
132
+ "react": "^18.2.0",
133
+ "react-app-polyfill": "^3.0.0",
134
+ "react-dev-utils": "^12.0.1",
135
+ "react-dom": "^18.2.0",
136
+ "react-refresh": "^0.11.0",
137
+ "resolve": "^1.20.0",
138
+ "resolve-url-loader": "^4.0.0",
139
+ "rimraf": "5.0.7",
140
+ "sass": "1.70.0",
141
+ "sass-loader": "^12.3.0",
142
+ "semver": "^7.3.5",
143
+ "source-map-loader": "^3.0.0",
144
+ "speed-measure-webpack-plugin": "1.5.0",
145
+ "style-loader": "^3.3.1",
146
+ "stylelint": "16.19.1",
147
+ "stylelint-config-ali": "2.1.2",
148
+ "stylelint-prettier": "5.0.3",
149
+ "tailwindcss": "^3.0.2",
150
+ "terser-webpack-plugin": "^5.2.5",
151
+ "thread-loader": "3.0.4",
152
+ "ts-node": "10.9.2",
153
+ "typescript": "4.7.3",
154
+ "unzip": "0.1.11",
155
+ "url-loader": "4.1.1",
156
+ "webpack": "^5.64.4",
157
+ "webpack-bundle-analyzer": "4.5.0",
158
+ "webpack-cli": "4.9.2",
159
+ "webpack-dev-server": "^4.6.0",
160
+ "webpack-manifest-plugin": "^4.0.2",
161
+ "webpack-merge": "5.8.0",
162
+ "workbox-webpack-plugin": "^6.4.1",
163
+ "xlsx": "^0.18.5",
164
+ "yamljs": "0.3.0"
165
+ },
166
+ "devDependencies": {
167
+ "@types/autoprefixer": "10.2.0",
168
+ "@types/cli-progress": "3.11.5",
169
+ "@types/colors": "1.2.1",
170
+ "@types/commander": "2.12.2",
171
+ "@types/compression-webpack-plugin": "9.1.1",
172
+ "@types/copy-webpack-plugin": "10.1.0",
173
+ "@types/css-minimizer-webpack-plugin": "3.2.1",
174
+ "@types/extract-zip": "2.0.1",
175
+ "@types/glob": "^8.1.0",
176
+ "@types/html-webpack-plugin": "3.2.9",
177
+ "@types/inquirer": "9.0.7",
178
+ "@types/less": "3.0.6",
179
+ "@types/mini-css-extract-plugin": "2.5.1",
180
+ "@types/node": "14.18.47",
181
+ "@types/progress": "2.0.7",
182
+ "@types/progress-bar-webpack-plugin": "2.1.5",
183
+ "@types/react": "19.1.2",
184
+ "@types/react-dom": "19.1.2",
185
+ "@types/react-refresh": "0.14.6",
186
+ "@types/rimraf": "4.0.5",
187
+ "@types/speed-measure-webpack-plugin": "1.3.6",
188
+ "@types/typescript": "2.0.0",
189
+ "@types/unzip": "0.1.4",
190
+ "@types/webpack": "5.28.5",
191
+ "@types/webpack-bundle-analyzer": "4.7.0",
192
+ "@types/webpack-dev-server": "4.7.2",
193
+ "@types/webpack-merge": "5.0.0",
194
+ "@types/yamljs": "0.2.34",
195
+ "babel-jest": "^27.4.2",
196
+ "jest": "^27.4.3",
197
+ "jest-resolve": "^27.4.2",
198
+ "jest-watch-typeahead": "^1.0.0"
199
+ },
200
+ "email": "296963166@qq.com"
201
+ }