my-code-style 1.8.2 → 1.8.3
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/CHANGELOG.md +6 -0
- package/README.md +14 -12
- package/package.json +9 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
## 变更日志
|
|
2
2
|
|
|
3
|
+
## [1.8.3](https://github.com/myvn/codeStyle/compare/v1.8.2...v1.8.3) (2026-09-21)
|
|
4
|
+
|
|
5
|
+
### 🐛 Bug Fixes | Bug 修复
|
|
6
|
+
|
|
7
|
+
* 校准 peer 范围,修复 eslint 10 组合被 npm 拒装(BUG-027) ([33d211d](https://github.com/myvn/codeStyle/commit/33d211dcbdb24b2e67962c6c32d02628d13cec32))
|
|
8
|
+
|
|
3
9
|
## [1.8.2](https://github.com/myvn/codeStyle/compare/v1.8.1...v1.8.2) (2026-09-21)
|
|
4
10
|
|
|
5
11
|
|
package/README.md
CHANGED
|
@@ -190,6 +190,7 @@ module.exports = {
|
|
|
190
190
|
| `my-code-style/commitlint` | Commitlint 基础配置 |
|
|
191
191
|
| `my-code-style/commitlint/scopes` | 动态 scope 工具函数 |
|
|
192
192
|
| `my-code-style/versionrc` | commit-and-tag-version 配置 |
|
|
193
|
+
| `my-code-style/package.json` | 包元数据(工具读取版本用) |
|
|
193
194
|
|
|
194
195
|
## CLI 初始化参数
|
|
195
196
|
|
|
@@ -239,10 +240,10 @@ npx my-code-style-init [--dry-run] [--backup] [--version|-v] [--help|-h]
|
|
|
239
240
|
## 测试套件
|
|
240
241
|
|
|
241
242
|
```bash
|
|
242
|
-
npm run test:all # 全量运行
|
|
243
|
+
npm run test:all # 全量运行 180 项:用例明细 + 分类统计 + 最慢文件定位
|
|
243
244
|
npm run diagnose # 换机器后先跑它:进程 / git / 文件系统 / hooks 各占多少
|
|
244
245
|
npm run sweep # 给本机找最佳文件级并发(扫 integration 套件)
|
|
245
|
-
npm test # 只跑基础 CLI 与配置矩阵(
|
|
246
|
+
npm test # 只跑基础 CLI 与配置矩阵(86 项)
|
|
246
247
|
npm run test:integration:setup # 安装现代化隔离依赖运行环境
|
|
247
248
|
npm run test:integration # Flat Config、真实 Husky 及提交链路测试(59 项)
|
|
248
249
|
npm run test:legacy:setup # 安装 ESLint 8 隔离运行环境
|
|
@@ -257,13 +258,14 @@ npm run test:stylelint17 # Stylelint 17 生态兼容性回归(8 项)
|
|
|
257
258
|
```text
|
|
258
259
|
my-code-style 测试套件
|
|
259
260
|
|
|
260
|
-
▶ [1/4] 基础 CLI 与配置矩阵 (共
|
|
261
|
+
▶ [1/4] 基础 CLI 与配置矩阵 (共 86 项,5 文件 · 3 文件并发(自动:2 核 / 内存 4G))
|
|
261
262
|
✓ 运行器 TAP 解析:统计通过与失败、SKIP 与每用例耗时 · 7ms
|
|
262
263
|
✓ cz 交互提示为中文,且可选类型与 type-enum 一一对应 · 1ms
|
|
263
|
-
✓
|
|
264
|
+
✓ peer 范围覆盖我们声明支持的上游大版本(校准防回退,BUG-027) · 0ms
|
|
265
|
+
✓ 一键安装命令对含 || 的版本范围加引号,可整段粘贴执行 · 40ms
|
|
264
266
|
✓ 初始化结尾指引把 cz 用法说清楚(先 git add + 指到 README 手册) · 80ms
|
|
265
267
|
…
|
|
266
|
-
✓ 通过
|
|
268
|
+
✓ 通过 86 · 3.6s · 最慢文件 init-matrix.test.cjs 3.2s
|
|
267
269
|
|
|
268
270
|
▶ [2/4] 现代工具链与提交链 (共 59 项,23 文件 · 3 文件并发(自动:2 核 / 内存 4G))
|
|
269
271
|
✓ 完整提交链:JS/TS/Vue/nvue/CSS/less 自动修复及二次复检 · 10.4s
|
|
@@ -286,17 +288,17 @@ npm run test:stylelint17 # Stylelint 17 生态兼容性回归(8 项)
|
|
|
286
288
|
──────────────────────────────────────────────────────
|
|
287
289
|
套件 通过 失败 跳过 用时
|
|
288
290
|
──────────────────────────────────────────────────────
|
|
289
|
-
基础 CLI 与配置矩阵
|
|
290
|
-
现代工具链与提交链 59 0 -
|
|
291
|
-
ESLint 8 兼容性 27 0 - 18.
|
|
292
|
-
Stylelint 17 兼容性 8 0 - 7.
|
|
291
|
+
基础 CLI 与配置矩阵 86 0 - 3.6s
|
|
292
|
+
现代工具链与提交链 59 0 - 40.7s
|
|
293
|
+
ESLint 8 兼容性 27 0 - 18.7s
|
|
294
|
+
Stylelint 17 兼容性 8 0 - 7.3s
|
|
293
295
|
──────────────────────────────────────────────────────
|
|
294
|
-
合计
|
|
296
|
+
合计 180 0 - 70.3s
|
|
295
297
|
──────────────────────────────────────────────────────
|
|
296
298
|
|
|
297
299
|
⏱ 最慢文件:eslint8.test.cjs 18.3s · commit-chain-both.test.cjs 10.6s · commit-chain-scss.test.cjs 10.6s
|
|
298
300
|
|
|
299
|
-
✅ 全部通过:
|
|
301
|
+
✅ 全部通过:180/180 项,用时 70.3s
|
|
300
302
|
```
|
|
301
303
|
|
|
302
304
|
终端里每个套件下方还有一条实时进度条(`██████░░░░ 38/66 失败 0 4.0s`)。附加参数:
|
|
@@ -374,7 +376,7 @@ npm run test:all -- --profile # 看每个测试文件耗时,定位瓶颈
|
|
|
374
376
|
| `npm run test:integration`(运行器调度,自动并发 3) | 30.6s(只看集成套件那一段) |
|
|
375
377
|
| 串行套件 + 文件级并发 23(全部一波) | ✗ 3.8G 内存沙箱被 OOM 压垮(19 项 SIGKILL) |
|
|
376
378
|
|
|
377
|
-
同机复测(
|
|
379
|
+
同机复测(180 项,同一台 2 核沙箱连续跑;绝对秒数随机器负载波动,相对关系稳定):串行套件 + 文件级并发 1 = 72.7s、默认自动并发 3 = 70.3s、`--parallel` 四套件 = 71.1s、`npm run test:integration` = 43.1s、`node --test demo-test/integration/*.test.cjs` = 71.6s。
|
|
378
380
|
|
|
379
381
|
(2 核沙箱里并行收益被 CPU 争抢吃掉大半,`--concurrency=1` 时单个文件只要 0.7–4.2s;
|
|
380
382
|
16 核机器上集成套件那段 ≈ 最慢子文件,即"一次真实提交"的量级。)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "my-code-style",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.3",
|
|
4
4
|
"description": "Lint/Format/Git 配置工程化 npm 包(ESLint + Prettier + Stylelint + Commitlint + Husky + standard-version)",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "src/eslint/uniapp.cjs",
|
|
@@ -29,7 +29,8 @@
|
|
|
29
29
|
"./stylelint/less-override": "./src/stylelint/less-override.cjs",
|
|
30
30
|
"./commitlint": "./src/commitlint/base.cjs",
|
|
31
31
|
"./commitlint/scopes": "./src/commitlint/scopes.cjs",
|
|
32
|
-
"./versionrc": "./src/versionrc/index.cjs"
|
|
32
|
+
"./versionrc": "./src/versionrc/index.cjs",
|
|
33
|
+
"./package.json": "./package.json"
|
|
33
34
|
},
|
|
34
35
|
"files": [
|
|
35
36
|
"src",
|
|
@@ -69,23 +70,23 @@
|
|
|
69
70
|
"node": ">=18"
|
|
70
71
|
},
|
|
71
72
|
"peerDependencies": {
|
|
72
|
-
"@commitlint/cli": "^19.0.0",
|
|
73
|
-
"@commitlint/config-conventional": "^19.0.0",
|
|
74
|
-
"@eslint/js": "^9.0.0",
|
|
73
|
+
"@commitlint/cli": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
74
|
+
"@commitlint/config-conventional": "^19.0.0 || ^20.0.0 || ^21.0.0",
|
|
75
|
+
"@eslint/js": "^9.0.0 || ^10.0.0",
|
|
75
76
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
76
77
|
"@typescript-eslint/parser": "^8.0.0",
|
|
77
78
|
"commit-and-tag-version": "^12.0.0",
|
|
78
79
|
"czg": "^1.0.0",
|
|
79
80
|
"eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
|
|
80
81
|
"eslint-config-prettier": "^10.1.8",
|
|
81
|
-
"eslint-import-resolver-typescript": "^3.0.0",
|
|
82
|
+
"eslint-import-resolver-typescript": "^3.0.0 || ^4.0.0",
|
|
82
83
|
"eslint-plugin-import": "^2.0.0",
|
|
83
84
|
"eslint-plugin-import-x": "^4.0.0",
|
|
84
85
|
"eslint-plugin-prettier": "^5.2.0",
|
|
85
86
|
"eslint-plugin-vue": "^10.0.0",
|
|
86
|
-
"globals": "^16.0.0",
|
|
87
|
+
"globals": "^16.0.0 || ^17.0.0",
|
|
87
88
|
"husky": "^9.0.0",
|
|
88
|
-
"lint-staged": "^16.0.0",
|
|
89
|
+
"lint-staged": "^16.0.0 || ^17.0.0",
|
|
89
90
|
"postcss-html": "^2.0.0",
|
|
90
91
|
"postcss-less": "^6.0.0",
|
|
91
92
|
"postcss-scss": "^4.0.0",
|