Переглянути джерело

feat: 添加发布脚本并优化发布流程

- 新增 release.js 脚本,提供交互式版本发布流程
- 更新 package.json 中的 release 命令使用新脚本
- 添加 inquirer 依赖用于交互式命令行界面
- 优化 changelog 生成逻辑,避免空提交
liujia 2 місяців тому
батько
коміт
b8dffd2ab5
5 змінених файлів з 546 додано та 6 видалено
  1. 9 0
      .gitmessage.txt
  2. 109 0
      CHANGELOG.md
  3. 4 3
      package.json
  4. 369 3
      pnpm-lock.yaml
  5. 55 0
      scripts/release.js

+ 9 - 0
.gitmessage.txt

@@ -0,0 +1,9 @@
+feat: 
+# feat: 新功能
+# fix: 修复 Bug
+# docs: 文档修改
+# style: 代码格式调整(不影响功能)
+# refactor: 重构(非新功能,非修 Bug)
+# perf: 性能优化
+# test: 测试相关
+# chore: 构建流程、依赖管理

+ 109 - 0
CHANGELOG.md

@@ -0,0 +1,109 @@
+## [0.1.12](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.11...v0.1.12) (2025-08-13)
+
+
+
+## [0.1.11](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.10...v0.1.11) (2025-08-13)
+
+
+### Bug Fixes
+
+* **设备基础配置:** 修正坠落确认时间的验证逻辑 ([6e93ad7](http://43.137.10.199:3000/liujia/ln-web/commits/6e93ad7638accb0f3206cddc500f0a9434219b97))
+
+
+
+## [0.1.10](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.9...v0.1.10) (2025-08-12)
+
+
+### Features
+
+* **布局:** 添加页面刷新功能并优化用户下拉菜单样式 ([df97059](http://43.137.10.199:3000/liujia/ln-web/commits/df9705910762d41aa3e0b4b036d6db84cc756599))
+
+
+
+## [0.1.9](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.8...v0.1.9) (2025-08-12)
+
+
+
+## [0.1.8](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.7...v0.1.8) (2025-08-12)
+
+
+### Bug Fixes
+
+* **上传设备:** 修正上传成功提示和复制按钮样式 ([ed2e559](http://43.137.10.199:3000/liujia/ln-web/commits/ed2e5595be2c1b2bb7241bc8006029121a24c7c7))
+
+
+
+## [0.1.7](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.6...v0.1.7) (2025-08-12)
+
+
+### Bug Fixes
+
+* **上传设备:** 修复文件拖拽验证和上传错误处理问题 ([ca532fd](http://43.137.10.199:3000/liujia/ln-web/commits/ca532fdc38ee34b4ee2a4bdf6ef6601aec7fccb6))
+
+
+
+## [0.1.6](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.5...v0.1.6) (2025-08-12)
+
+
+### Bug Fixes
+
+* **设备管理:** 移除归属租户的必填验证规则 ([48c1d09](http://43.137.10.199:3000/liujia/ln-web/commits/48c1d092bfdc3c6241262f998fa2af5cd4d1986c))
+
+
+
+## [0.1.5](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.4...v0.1.5) (2025-08-12)
+
+
+
+## [0.1.4](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.3...v0.1.4) (2025-08-12)
+
+
+### Bug Fixes
+
+* **设备管理:** 修正设备ID验证错误信息并调整Docker构建命令 ([5ec332a](http://43.137.10.199:3000/liujia/ln-web/commits/5ec332a5fc77bc31a8501712399a2cf49f8e54a9))
+
+
+
+## [0.1.3](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.2...v0.1.3) (2025-08-12)
+
+
+
+## [0.1.2](http://43.137.10.199:3000/liujia/ln-web/compare/v0.1.1...v0.1.2) (2025-08-12)
+
+
+### Features
+
+* 调整设备点位超时时间为1秒; ([2997285](http://43.137.10.199:3000/liujia/ln-web/commits/29972853ae0684651dab5e56dc8e927740ca0c13))
+* 更新忽略文件的类型 ([a019986](http://43.137.10.199:3000/liujia/ln-web/commits/a0199869d7aea009c0caadbe8bbb1afc9b490bbd))
+* 路由守卫去除重定向功能; ([dca2284](http://43.137.10.199:3000/liujia/ln-web/commits/dca2284ada998aa6ab7e231581bd75fb63f35766))
+* 删除冗余脚本文件; ([ac4f164](http://43.137.10.199:3000/liujia/ln-web/commits/ac4f1647fd500a68ce02f2319c74b6fcdd161a44))
+* 新增 npm-run-all 依赖并调整部署脚本; ([ada9021](http://43.137.10.199:3000/liujia/ln-web/commits/ada90212aedd6764b8230810c09f14aad205ec28))
+* 新增合并脚本 ([9e5617b](http://43.137.10.199:3000/liujia/ln-web/commits/9e5617b0514512f226b6a39cec612e0e3ba0f3a3))
+* **scripts:** 添加合并dev到prod分支的脚本;展示设备详情的mqtt消息的打印; ([f75c721](http://43.137.10.199:3000/liujia/ln-web/commits/f75c721ffe313f78e8ec34aa91ecf7d9f184d588))
+
+
+
+## [0.1.1](http://43.137.10.199:3000/liujia/ln-web/compare/7d418fcd64569ccec29cb2dedf24964c054d131e...v0.1.1) (2025-08-11)
+
+
+### Bug Fixes
+
+* 解决设备清单中文乱码的问题; ([1d27061](http://43.137.10.199:3000/liujia/ln-web/commits/1d270619a8fd7e5ff7f78f6c8f4b4265ba56038c))
+* **Jenkinsfile:** 更新Jenkinsfile文件 ([a8a85fb](http://43.137.10.199:3000/liujia/ln-web/commits/a8a85fbf3bae561ce6a6cac79b430eab79028768))
+
+
+### Features
+
+* **布局:** 添加返回按钮状态管理和导航历史追踪 ([6151e93](http://43.137.10.199:3000/liujia/ln-web/commits/6151e9351d90ce65a7167c121056394eda2cc302))
+* 调整mqtt与接口的地址; ([6507809](http://43.137.10.199:3000/liujia/ln-web/commits/65078097c3735434dce2f9a9fe3e15af6e39a445))
+* **环境配置:** 新增单环境配置并优化代理设置 ([48ab50c](http://43.137.10.199:3000/liujia/ln-web/commits/48ab50c9fba23935a959316c52433ed5ed84e114))
+* 迁移项目; ([7d418fc](http://43.137.10.199:3000/liujia/ln-web/commits/7d418fcd64569ccec29cb2dedf24964c054d131e))
+* 添加测试环境配置并优化构建脚本 ([3e18585](http://43.137.10.199:3000/liujia/ln-web/commits/3e185854ea1d0b7cc05db70d53a16be0bc585618))
+* 添加应用版本显示功能 ([5da1efd](http://43.137.10.199:3000/liujia/ln-web/commits/5da1efde3caae3865b91f5dc282c13afda556fc6))
+* 新增前端部署脚本; ([046a48e](http://43.137.10.199:3000/liujia/ln-web/commits/046a48eb79f25fb94b2a6ee0ff33a1b21dc4c581))
+* 重构构建部署流程并优化登录页 ([36b249d](http://43.137.10.199:3000/liujia/ln-web/commits/36b249d885f2d65e11370f88611cc7749d674436))
+* **deploy:** 改进前端部署脚本实现原子化部署 ([2718a52](http://43.137.10.199:3000/liujia/ln-web/commits/2718a526b6de1e18ea72af22c65812ed8d389490))
+* mqtt调整为域名; ([760653c](http://43.137.10.199:3000/liujia/ln-web/commits/760653c242bb4111a505d311e7ba3cebde7d3be4))
+
+
+

+ 4 - 3
package.json

@@ -10,9 +10,9 @@
     "build:dev": "vite build --mode development",
     "build:test": "vite build --mode test",
     "build": "vite build",
-    "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
+    "changelog": "npx conventional-changelog -p angular -i CHANGELOG.md -s -r 0",
     "bump": "npm version patch -m \"new version published: v%s\"",
-    "release": "npm run bump && npm run changelog && git add CHANGELOG.md && git commit -m \"docs: update changelog\" && git push && git push --tags && node scripts/release-message.js",
+    "release": "node scripts/release.js",
     "deploy:test": "npm-run-all build:test run:deploy",
     "run:deploy": "pwsh -ExecutionPolicy Bypass -File scripts/deploy.ps1",
     "preview": "vite preview",
@@ -53,6 +53,7 @@
     "eslint-plugin-import": "^2.32.0",
     "eslint-plugin-prettier": "^5.5.1",
     "eslint-plugin-vue": "~10.2.0",
+    "inquirer": "^12.9.1",
     "jiti": "^2.4.2",
     "less": "^4.3.0",
     "npm-run-all": "^4.1.5",
@@ -64,4 +65,4 @@
     "vite-plugin-vue-devtools": "^7.7.7",
     "vue-tsc": "^2.2.10"
   }
-}
+}

+ 369 - 3
pnpm-lock.yaml

@@ -99,6 +99,9 @@ importers:
       eslint-plugin-vue:
         specifier: ~10.2.0
         version: 10.2.0(eslint@9.30.1(jiti@2.4.2))(vue-eslint-parser@10.2.0(eslint@9.30.1(jiti@2.4.2)))
+      inquirer:
+        specifier: ^12.9.1
+        version: 12.9.1(@types/node@22.16.0)
       jiti:
         specifier: ^2.4.2
         version: 2.4.2
@@ -532,6 +535,133 @@ packages:
     resolution: {integrity: sha512-e5+YUKENATs1JgYHMzTr2MW/NDcXGfYFAuOQU8gJgF/kEh4EqKgfGrfLI67bMD4tbhZVlkigz/9YYwWcbOFthg==}
     engines: {node: '>=10.13.0'}
 
+  '@inquirer/checkbox@4.2.0':
+    resolution: {integrity: sha512-fdSw07FLJEU5vbpOPzXo5c6xmMGDzbZE2+niuDHX5N6mc6V0Ebso/q3xiHra4D73+PMsC8MJmcaZKuAAoaQsSA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/confirm@5.1.14':
+    resolution: {integrity: sha512-5yR4IBfe0kXe59r1YCTG8WXkUbl7Z35HK87Sw+WUyGD8wNUx7JvY7laahzeytyE1oLn74bQnL7hstctQxisQ8Q==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/core@10.1.15':
+    resolution: {integrity: sha512-8xrp836RZvKkpNbVvgWUlxjT4CraKk2q+I3Ksy+seI2zkcE+y6wNs1BVhgcv8VyImFecUhdQrYLdW32pAjwBdA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/editor@4.2.16':
+    resolution: {integrity: sha512-iSzLjT4C6YKp2DU0fr8T7a97FnRRxMO6CushJnW5ktxLNM2iNeuyUuUA5255eOLPORoGYCrVnuDOEBdGkHGkpw==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/expand@4.0.17':
+    resolution: {integrity: sha512-PSqy9VmJx/VbE3CT453yOfNa+PykpKg/0SYP7odez1/NWBGuDXgPhp4AeGYYKjhLn5lUUavVS/JbeYMPdH50Mw==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/external-editor@1.0.0':
+    resolution: {integrity: sha512-5v3YXc5ZMfL6OJqXPrX9csb4l7NlQA2doO1yynUjpUChT9hg4JcuBVP0RbsEJ/3SL/sxWEyFjT2W69ZhtoBWqg==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+
+  '@inquirer/figures@1.0.13':
+    resolution: {integrity: sha512-lGPVU3yO9ZNqA7vTYz26jny41lE7yoQansmqdMLBEfqaGsmdg7V3W9mK9Pvb5IL4EVZ9GnSDGMO/cJXud5dMaw==}
+    engines: {node: '>=18'}
+
+  '@inquirer/input@4.2.1':
+    resolution: {integrity: sha512-tVC+O1rBl0lJpoUZv4xY+WGWY8V5b0zxU1XDsMsIHYregdh7bN5X5QnIONNBAl0K765FYlAfNHS2Bhn7SSOVow==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/number@3.0.17':
+    resolution: {integrity: sha512-GcvGHkyIgfZgVnnimURdOueMk0CztycfC8NZTiIY9arIAkeOgt6zG57G+7vC59Jns3UX27LMkPKnKWAOF5xEYg==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/password@4.0.17':
+    resolution: {integrity: sha512-DJolTnNeZ00E1+1TW+8614F7rOJJCM4y4BAGQ3Gq6kQIG+OJ4zr3GLjIjVVJCbKsk2jmkmv6v2kQuN/vriHdZA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/prompts@7.8.1':
+    resolution: {integrity: sha512-LpBPeIpyCF1H3C7SK/QxJQG4iV1/SRmJdymfcul8PuwtVhD0JI1CSwqmd83VgRgt1QEsDojQYFSXJSgo81PVMw==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/rawlist@4.1.5':
+    resolution: {integrity: sha512-R5qMyGJqtDdi4Ht521iAkNqyB6p2UPuZUbMifakg1sWtu24gc2Z8CJuw8rP081OckNDMgtDCuLe42Q2Kr3BolA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/search@3.1.0':
+    resolution: {integrity: sha512-PMk1+O/WBcYJDq2H7foV0aAZSmDdkzZB9Mw2v/DmONRJopwA/128cS9M/TXWLKKdEQKZnKwBzqu2G4x/2Nqx8Q==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/select@4.3.1':
+    resolution: {integrity: sha512-Gfl/5sqOF5vS/LIrSndFgOh7jgoe0UXEizDqahFRkq5aJBLegZ6WjuMh/hVEJwlFQjyLq1z9fRtvUMkb7jM1LA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
+  '@inquirer/type@3.0.8':
+    resolution: {integrity: sha512-lg9Whz8onIHRthWaN1Q9EGLa/0LFJjyM8mEUbL1eTi6yMGvBf8gvyDLtxSXztQsxMvhxxNpJYrwa1YHdq+w4Jw==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
   '@jridgewell/gen-mapping@0.3.12':
     resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==}
 
@@ -958,6 +1088,14 @@ packages:
   alien-signals@1.0.13:
     resolution: {integrity: sha512-OGj9yyTnJEttvzhTUWuscOvtqxq5vrhF7vL9oS0xJ2mK0ItPYP1/y+vCFebfxoEyAz0++1AIwJ5CMr+Fk3nDmg==}
 
+  ansi-escapes@4.3.2:
+    resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==}
+    engines: {node: '>=8'}
+
+  ansi-regex@5.0.1:
+    resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==}
+    engines: {node: '>=8'}
+
   ansi-styles@3.2.1:
     resolution: {integrity: sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==}
     engines: {node: '>=4'}
@@ -1101,10 +1239,17 @@ packages:
     resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
     engines: {node: '>=10'}
 
+  chardet@2.1.0:
+    resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==}
+
   chokidar@3.6.0:
     resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
     engines: {node: '>= 8.10.0'}
 
+  cli-width@4.1.0:
+    resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==}
+    engines: {node: '>= 12'}
+
   color-convert@1.9.3:
     resolution: {integrity: sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==}
 
@@ -1335,6 +1480,9 @@ packages:
   electron-to-chromium@1.5.179:
     resolution: {integrity: sha512-UWKi/EbBopgfFsc5k61wFpV7WrnnSlSzW/e2XcBmS6qKYTivZlLtoll5/rdqRTxGglGHkmkW0j0pFNJG10EUIQ==}
 
+  emoji-regex@8.0.0:
+    resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}
+
   entities@4.5.0:
     resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
     engines: {node: '>=0.12'}
@@ -1763,6 +1911,15 @@ packages:
   inherits@2.0.4:
     resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==}
 
+  inquirer@12.9.1:
+    resolution: {integrity: sha512-G7uXAb9OiLcd+9jmA/7KKrItvFF00kKk/jb6CtG+Tm2zSPWfzzhyJwDhVCy+mBmE32o2zJnB5JnknIIv2Ft+AA==}
+    engines: {node: '>=18'}
+    peerDependencies:
+      '@types/node': '>=18'
+    peerDependenciesMeta:
+      '@types/node':
+        optional: true
+
   internal-slot@1.1.0:
     resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==}
     engines: {node: '>= 0.4'}
@@ -1823,6 +1980,10 @@ packages:
     resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==}
     engines: {node: '>= 0.4'}
 
+  is-fullwidth-code-point@3.0.0:
+    resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}
+    engines: {node: '>=8'}
+
   is-generator-function@1.1.0:
     resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==}
     engines: {node: '>= 0.4'}
@@ -2099,6 +2260,10 @@ packages:
   muggle-string@0.4.1:
     resolution: {integrity: sha512-VNTrAak/KhO2i8dqqnqnAHOa3cYBwXEZe9h+D5h/1ZqFSTEFHdM65lR7RoIqq3tBBYavsOXV84NoHXZ0AkPyqQ==}
 
+  mute-stream@2.0.0:
+    resolution: {integrity: sha512-WWdIxpyjEn+FhQJQQv9aQAYlHoNVdzIzUySNV1gHUPDSdZJ3yZn7pAAbQcV7B56Mvu881q9FZV+0Vx2xC44VWA==}
+    engines: {node: ^18.17.0 || >=20.5.0}
+
   nanoid@3.3.11:
     resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==}
     engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}
@@ -2437,9 +2602,16 @@ packages:
     resolution: {integrity: sha512-9by4Ij99JUr/MCFBUkDKLWK3G9HVXmabKz9U5MlIAIuvuzkiOicRYs8XJLxX+xahD+mLiiCYDqF9dKAgtzKP1A==}
     engines: {node: '>=18'}
 
+  run-async@4.0.6:
+    resolution: {integrity: sha512-IoDlSLTs3Yq593mb3ZoKWKXMNu3UpObxhgA/Xuid5p4bbfi2jdY1Hj0m1K+0/tEuQTxIGMhQDqGjKb7RuxGpAQ==}
+    engines: {node: '>=0.12.0'}
+
   run-parallel@1.2.0:
     resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==}
 
+  rxjs@7.8.2:
+    resolution: {integrity: sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==}
+
   safe-array-concat@1.1.3:
     resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==}
     engines: {node: '>=0.4'}
@@ -2579,6 +2751,10 @@ packages:
     resolution: {integrity: sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==}
     engines: {node: '>= 0.4'}
 
+  string-width@4.2.3:
+    resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}
+    engines: {node: '>=8'}
+
   string.prototype.padend@3.1.6:
     resolution: {integrity: sha512-XZpspuSB7vJWhvJc9DLSlrXl1mcA2BdoY5jjnS135ydXqLoqhs96JjDtCkjJEQHvfqZIp9hBuBMgI589peyx9Q==}
     engines: {node: '>= 0.4'}
@@ -2598,6 +2774,10 @@ packages:
   string_decoder@1.3.0:
     resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==}
 
+  strip-ansi@6.0.1:
+    resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}
+    engines: {node: '>=8'}
+
   strip-bom@3.0.0:
     resolution: {integrity: sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==}
     engines: {node: '>=4'}
@@ -2676,6 +2856,10 @@ packages:
     resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
     engines: {node: '>= 0.8.0'}
 
+  type-fest@0.21.3:
+    resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==}
+    engines: {node: '>=10'}
+
   type-fest@4.41.0:
     resolution: {integrity: sha512-TeTSQ6H5YHvpqVwBRcnLDCBnDOHWYu7IvGbHT6N8AOymcr9PJGjc1GTtiWZTYg0NCgYwvnYWEkVChQAr9bjfwA==}
     engines: {node: '>=16'}
@@ -2926,6 +3110,10 @@ packages:
   worker-timers@7.1.8:
     resolution: {integrity: sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw==}
 
+  wrap-ansi@6.2.0:
+    resolution: {integrity: sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==}
+    engines: {node: '>=8'}
+
   ws@8.18.3:
     resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==}
     engines: {node: '>=10.0.0'}
@@ -2949,6 +3137,10 @@ packages:
     resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==}
     engines: {node: '>=10'}
 
+  yoctocolors-cjs@2.1.2:
+    resolution: {integrity: sha512-cYVsTjKl8b+FrnidjibDWskAv7UKOfcwaVZdp/it9n1s9fU3IkgDbhdIRKCW4JDsAlECJY0ytoVPT3sK6kideA==}
+    engines: {node: '>=18'}
+
   yoctocolors@2.1.1:
     resolution: {integrity: sha512-GQHQqAopRhwU8Kt1DDM8NjibDXHC8eoh1erhGAJPEyveY9qqVeXvVikNKrDz69sHowPMorbPUrH/mx8c50eiBQ==}
     engines: {node: '>=18'}
@@ -3322,6 +3514,128 @@ snapshots:
 
   '@hutson/parse-repository-url@5.0.0': {}
 
+  '@inquirer/checkbox@4.2.0(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/figures': 1.0.13
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      ansi-escapes: 4.3.2
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/confirm@5.1.14(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/core@10.1.15(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/figures': 1.0.13
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      ansi-escapes: 4.3.2
+      cli-width: 4.1.0
+      mute-stream: 2.0.0
+      signal-exit: 4.1.0
+      wrap-ansi: 6.2.0
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/editor@4.2.16(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/external-editor': 1.0.0(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/expand@4.0.17(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/external-editor@1.0.0(@types/node@22.16.0)':
+    dependencies:
+      '@types/node': 22.16.0
+      chardet: 2.1.0
+      iconv-lite: 0.6.3
+
+  '@inquirer/figures@1.0.13': {}
+
+  '@inquirer/input@4.2.1(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/number@3.0.17(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/password@4.0.17(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      ansi-escapes: 4.3.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/prompts@7.8.1(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/checkbox': 4.2.0(@types/node@22.16.0)
+      '@inquirer/confirm': 5.1.14(@types/node@22.16.0)
+      '@inquirer/editor': 4.2.16(@types/node@22.16.0)
+      '@inquirer/expand': 4.0.17(@types/node@22.16.0)
+      '@inquirer/input': 4.2.1(@types/node@22.16.0)
+      '@inquirer/number': 3.0.17(@types/node@22.16.0)
+      '@inquirer/password': 4.0.17(@types/node@22.16.0)
+      '@inquirer/rawlist': 4.1.5(@types/node@22.16.0)
+      '@inquirer/search': 3.1.0(@types/node@22.16.0)
+      '@inquirer/select': 4.3.1(@types/node@22.16.0)
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/rawlist@4.1.5(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/search@3.1.0(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/figures': 1.0.13
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/select@4.3.1(@types/node@22.16.0)':
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/figures': 1.0.13
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      ansi-escapes: 4.3.2
+      yoctocolors-cjs: 2.1.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
+  '@inquirer/type@3.0.8(@types/node@22.16.0)':
+    optionalDependencies:
+      '@types/node': 22.16.0
+
   '@jridgewell/gen-mapping@0.3.12':
     dependencies:
       '@jridgewell/sourcemap-codec': 1.5.4
@@ -3783,6 +4097,12 @@ snapshots:
 
   alien-signals@1.0.13: {}
 
+  ansi-escapes@4.3.2:
+    dependencies:
+      type-fest: 0.21.3
+
+  ansi-regex@5.0.1: {}
+
   ansi-styles@3.2.1:
     dependencies:
       color-convert: 1.9.3
@@ -3978,6 +4298,8 @@ snapshots:
       ansi-styles: 4.3.0
       supports-color: 7.2.0
 
+  chardet@2.1.0: {}
+
   chokidar@3.6.0:
     dependencies:
       anymatch: 3.1.3
@@ -3990,6 +4312,8 @@ snapshots:
     optionalDependencies:
       fsevents: 2.3.3
 
+  cli-width@4.1.0: {}
+
   color-convert@1.9.3:
     dependencies:
       color-name: 1.1.3
@@ -4223,6 +4547,8 @@ snapshots:
 
   electron-to-chromium@1.5.179: {}
 
+  emoji-regex@8.0.0: {}
+
   entities@4.5.0: {}
 
   errno@0.1.8:
@@ -4728,7 +5054,6 @@ snapshots:
   iconv-lite@0.6.3:
     dependencies:
       safer-buffer: 2.1.2
-    optional: true
 
   ieee754@1.2.1: {}
 
@@ -4750,6 +5075,18 @@ snapshots:
 
   inherits@2.0.4: {}
 
+  inquirer@12.9.1(@types/node@22.16.0):
+    dependencies:
+      '@inquirer/core': 10.1.15(@types/node@22.16.0)
+      '@inquirer/prompts': 7.8.1(@types/node@22.16.0)
+      '@inquirer/type': 3.0.8(@types/node@22.16.0)
+      ansi-escapes: 4.3.2
+      mute-stream: 2.0.0
+      run-async: 4.0.6
+      rxjs: 7.8.2
+    optionalDependencies:
+      '@types/node': 22.16.0
+
   internal-slot@1.1.0:
     dependencies:
       es-errors: 1.3.0
@@ -4815,6 +5152,8 @@ snapshots:
     dependencies:
       call-bound: 1.0.4
 
+  is-fullwidth-code-point@3.0.0: {}
+
   is-generator-function@1.1.0:
     dependencies:
       call-bound: 1.0.4
@@ -5084,6 +5423,8 @@ snapshots:
 
   muggle-string@0.4.1: {}
 
+  mute-stream@2.0.0: {}
+
   nanoid@3.3.11: {}
 
   nanoid@5.1.5: {}
@@ -5451,10 +5792,16 @@ snapshots:
 
   run-applescript@7.0.0: {}
 
+  run-async@4.0.6: {}
+
   run-parallel@1.2.0:
     dependencies:
       queue-microtask: 1.2.3
 
+  rxjs@7.8.2:
+    dependencies:
+      tslib: 2.8.1
+
   safe-array-concat@1.1.3:
     dependencies:
       call-bind: 1.0.8
@@ -5476,8 +5823,7 @@ snapshots:
       es-errors: 1.3.0
       is-regex: 1.2.1
 
-  safer-buffer@2.1.2:
-    optional: true
+  safer-buffer@2.1.2: {}
 
   sax@1.4.1:
     optional: true
@@ -5602,6 +5948,12 @@ snapshots:
       es-errors: 1.3.0
       internal-slot: 1.1.0
 
+  string-width@4.2.3:
+    dependencies:
+      emoji-regex: 8.0.0
+      is-fullwidth-code-point: 3.0.0
+      strip-ansi: 6.0.1
+
   string.prototype.padend@3.1.6:
     dependencies:
       call-bind: 1.0.8
@@ -5636,6 +5988,10 @@ snapshots:
     dependencies:
       safe-buffer: 5.2.1
 
+  strip-ansi@6.0.1:
+    dependencies:
+      ansi-regex: 5.0.1
+
   strip-bom@3.0.0: {}
 
   strip-final-newline@4.0.0: {}
@@ -5700,6 +6056,8 @@ snapshots:
     dependencies:
       prelude-ls: 1.2.1
 
+  type-fest@0.21.3: {}
+
   type-fest@4.41.0: {}
 
   typed-array-buffer@1.0.3:
@@ -6000,6 +6358,12 @@ snapshots:
       worker-timers-broker: 6.1.8
       worker-timers-worker: 7.0.71
 
+  wrap-ansi@6.2.0:
+    dependencies:
+      ansi-styles: 4.3.0
+      string-width: 4.2.3
+      strip-ansi: 6.0.1
+
   ws@8.18.3: {}
 
   xml-name-validator@4.0.0: {}
@@ -6008,6 +6372,8 @@ snapshots:
 
   yocto-queue@0.1.0: {}
 
+  yoctocolors-cjs@2.1.2: {}
+
   yoctocolors@2.1.1: {}
 
   zrender@5.6.1:

+ 55 - 0
scripts/release.js

@@ -0,0 +1,55 @@
+#!/usr/bin/env node
+import { execSync } from 'node:child_process'
+
+// 运行命令的封装
+const run = (cmd) => execSync(cmd, { stdio: 'inherit' })
+const out = (cmd) => execSync(cmd).toString().trim()
+
+console.log('\n🚀 发布流程开始...\n')
+
+// 1) 必须保证工作区干净
+const dirty = out('git status --porcelain')
+if (dirty) {
+  console.error('❌ Git 工作区有未提交的改动,请先提交后再发版!\n')
+  process.exit(1)
+}
+
+// 2) 动态导入 inquirer(避免依赖问题在早期就报错)
+const inquirer = (await import('inquirer')).default
+
+// 3) 选择版本类型
+const { releaseType } = await inquirer.prompt([
+  {
+    type: 'list',
+    name: 'releaseType',
+    message: '请选择版本类型:',
+    choices: [
+      { name: '补丁版本 (patch)', value: 'patch' },
+      { name: '次版本 (minor)', value: 'minor' },
+      { name: '主版本 (major)', value: 'major' },
+    ],
+  },
+])
+
+// 4) 升级版本号(带 tag 与提交信息)
+run(`npm version ${releaseType} -m "new version published: v%s"`)
+
+// 5) 生成/更新 CHANGELOG(增量)
+try {
+  run('npx conventional-changelog -p angular -i CHANGELOG.md -s')
+  // 仅当 CHANGELOG 有变更时再提交,避免空提交报错
+  const changed = out('git status --porcelain')
+  if (/\sCHANGELOG\.md$/.test(changed) || /CHANGELOG\.md/.test(changed)) {
+    run('git add CHANGELOG.md')
+    run('git commit -m "docs: update changelog"')
+  }
+} catch {
+  console.warn(
+    '⚠ 生成 changelog 失败:请确认已安装 conventional-changelog-cli(devDependencies)。'
+  )
+}
+
+// 6) 推送代码与标签
+run('git push --follow-tags')
+
+console.log('\n🎉 发布完成!\n')