From 3d94317faf76a0a06adefba5dddca1a27a1bf113 Mon Sep 17 00:00:00 2001 From: fangsmile Date: Thu, 25 Jun 2026 03:32:31 +0000 Subject: [PATCH 1/5] build: release version 1.26.3 [skip ci] --- ...p-click-after-resize_2026-06-24-16-11.json | 11 ---- ...187-max-frozen-width_2026-06-23-08-46.json | 11 ---- ...expand-scroll-anchor_2026-06-24-00-52.json | 11 ---- ...-custom-layout-value_2026-06-24-08-02.json | 11 ---- ...2-right-frozen-count_2026-06-16-07-08.json | 11 ---- ...ousel-fractional-row_2026-06-23-10-48.json | 11 ---- ...5162-gantt-sort-drag_2026-06-17-07-15.json | 11 ---- ...5162-gantt-sort-drag_2026-06-17-10-52.json | 11 ---- common/config/rush/pnpm-lock.yaml | 58 +++++++++---------- common/config/rush/version-policies.json | 2 +- docs/assets/changelog/en/release.md | 19 ++++++ docs/assets/changelog/zh/release.md | 19 ++++++ docs/package.json | 18 +++--- packages/openinula-vtable/package.json | 4 +- packages/react-vtable/package.json | 4 +- packages/vtable-calendar/package.json | 4 +- packages/vtable-editors/package.json | 2 +- packages/vtable-export/package.json | 4 +- packages/vtable-gantt/package.json | 6 +- packages/vtable-plugins/package.json | 8 +-- packages/vtable-search/package.json | 4 +- packages/vtable-sheet/package.json | 8 +-- packages/vtable/CHANGELOG.json | 35 +++++++++++ packages/vtable/CHANGELOG.md | 21 ++++++- packages/vtable/package.json | 4 +- packages/vue-vtable/package.json | 4 +- tools/bugserver-trigger/package.json | 10 ++-- 27 files changed, 163 insertions(+), 159 deletions(-) delete mode 100644 common/changes/@visactor/vtable/codex-fix-issue-5186-skip-click-after-resize_2026-06-24-16-11.json delete mode 100644 common/changes/@visactor/vtable/codex-fix-issue-5187-max-frozen-width_2026-06-23-08-46.json delete mode 100644 common/changes/@visactor/vtable/codex-fix-pivot-expand-scroll-anchor_2026-06-24-00-52.json delete mode 100644 common/changes/@visactor/vtable/fix-issue-1949-custom-layout-value_2026-06-24-08-02.json delete mode 100644 common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json delete mode 100644 common/changes/@visactor/vtable/fix-issue-5088-carousel-fractional-row_2026-06-23-10-48.json delete mode 100644 common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-07-15.json delete mode 100644 common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-10-52.json diff --git a/common/changes/@visactor/vtable/codex-fix-issue-5186-skip-click-after-resize_2026-06-24-16-11.json b/common/changes/@visactor/vtable/codex-fix-issue-5186-skip-click-after-resize_2026-06-24-16-11.json deleted file mode 100644 index 8ee2a2d78..000000000 --- a/common/changes/@visactor/vtable/codex-fix-issue-5186-skip-click-after-resize_2026-06-24-16-11.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: skip click cell after resize interaction ends", - "type": "patch", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "892739385@qq.com" -} diff --git a/common/changes/@visactor/vtable/codex-fix-issue-5187-max-frozen-width_2026-06-23-08-46.json b/common/changes/@visactor/vtable/codex-fix-issue-5187-max-frozen-width_2026-06-23-08-46.json deleted file mode 100644 index aeae28121..000000000 --- a/common/changes/@visactor/vtable/codex-fix-issue-5187-max-frozen-width_2026-06-23-08-46.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: handle scroll frozen columns width", - "type": "patch", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "892739385@qq.com" -} diff --git a/common/changes/@visactor/vtable/codex-fix-pivot-expand-scroll-anchor_2026-06-24-00-52.json b/common/changes/@visactor/vtable/codex-fix-pivot-expand-scroll-anchor_2026-06-24-00-52.json deleted file mode 100644 index 9b465c05d..000000000 --- a/common/changes/@visactor/vtable/codex-fix-pivot-expand-scroll-anchor_2026-06-24-00-52.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: keep pivot row tree scroll position on toggle", - "type": "patch", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "892739385@qq.com" -} diff --git a/common/changes/@visactor/vtable/fix-issue-1949-custom-layout-value_2026-06-24-08-02.json b/common/changes/@visactor/vtable/fix-issue-1949-custom-layout-value_2026-06-24-08-02.json deleted file mode 100644 index 64ce0ab8b..000000000 --- a/common/changes/@visactor/vtable/fix-issue-1949-custom-layout-value_2026-06-24-08-02.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: preserve custom layout falsy values", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "biukam.w@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json b/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json deleted file mode 100644 index b0f18b824..000000000 --- a/common/changes/@visactor/vtable/fix-issue-3672-right-frozen-count_2026-06-16-07-08.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: handle right frozen column count update", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "biukam.w@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vtable/fix-issue-5088-carousel-fractional-row_2026-06-23-10-48.json b/common/changes/@visactor/vtable/fix-issue-5088-carousel-fractional-row_2026-06-23-10-48.json deleted file mode 100644 index 495078584..000000000 --- a/common/changes/@visactor/vtable/fix-issue-5088-carousel-fractional-row_2026-06-23-10-48.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: keep fractional row scroll target", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "biukam.w@gmail.com" -} \ No newline at end of file diff --git a/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-07-15.json b/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-07-15.json deleted file mode 100644 index 30f1d280e..000000000 --- a/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-07-15.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: sync gantt task bars after sorted updates\n\n", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "liufangfang.jane@bytedance.com" -} diff --git a/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-10-52.json b/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-10-52.json deleted file mode 100644 index 3edf376c3..000000000 --- a/common/changes/@visactor/vtable/fix-issue-5162-gantt-sort-drag_2026-06-17-10-52.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "changes": [ - { - "comment": "fix: preserve quad style values", - "type": "none", - "packageName": "@visactor/vtable" - } - ], - "packageName": "@visactor/vtable", - "email": "liufangfang.jane@bytedance.com" -} diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0eb3ed1da..1e45fae1a 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -19,34 +19,34 @@ importers: specifier: ^2.11.0 version: 2.57.0(vue@3.5.31(typescript@4.9.5)) '@visactor/openinula-vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/openinula-vtable '@visactor/react-vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/react-vtable '@visactor/vchart': specifier: 2.0.13-alpha.10 version: 2.0.13-alpha.10 '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable-editors '@visactor/vtable-export': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable-export '@visactor/vtable-gantt': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable-gantt '@visactor/vtable-search': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable-search '@visactor/vtable-sheet': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vtable-sheet '@visactor/vue-vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../packages/vue-vtable '@visactor/vutils': specifier: ~1.0.17 @@ -140,7 +140,7 @@ importers: ../../packages/openinula-vtable: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -270,7 +270,7 @@ importers: ../../packages/react-vtable: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -445,7 +445,7 @@ importers: specifier: ~1.0.17 version: 1.0.23 '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-editors '@visactor/vutils': specifier: ~1.0.17 @@ -626,7 +626,7 @@ importers: ../../packages/vtable-calendar: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -849,7 +849,7 @@ importers: specifier: 2.0.7 version: 2.0.7 '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -1009,10 +1009,10 @@ importers: specifier: ~1.0.17 version: 1.0.23 '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-editors '@visactor/vutils': specifier: ~1.0.17 @@ -1245,13 +1245,13 @@ importers: specifier: 2.0.13-alpha.10 version: 2.0.13-alpha.10 '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-editors '@visactor/vtable-gantt': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-gantt '@vitejs/plugin-react': specifier: 3.1.0 @@ -1350,7 +1350,7 @@ importers: ../../packages/vtable-search: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -1504,13 +1504,13 @@ importers: specifier: ~1.0.17 version: 1.0.23 '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-editors '@visactor/vtable-plugins': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable-plugins '@visactor/vutils': specifier: ~1.0.17 @@ -1649,7 +1649,7 @@ importers: ../../packages/vue-vtable: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../vtable '@visactor/vutils': specifier: ~1.0.17 @@ -1830,19 +1830,19 @@ importers: ../../tools/bugserver-trigger: dependencies: '@visactor/vtable': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../../packages/vtable '@visactor/vtable-editors': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../../packages/vtable-editors '@visactor/vtable-gantt': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../../packages/vtable-gantt '@visactor/vtable-plugins': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../../packages/vtable-plugins '@visactor/vtable-sheet': - specifier: workspace:1.26.2 + specifier: workspace:1.26.3 version: link:../../packages/vtable-sheet devDependencies: '@internal/bundler': diff --git a/common/config/rush/version-policies.json b/common/config/rush/version-policies.json index b786c9e19..bd4829a3f 100644 --- a/common/config/rush/version-policies.json +++ b/common/config/rush/version-policies.json @@ -1 +1 @@ -[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.26.3","mainProject":"@visactor/vtable","nextBump":"patch"}] +[{"definitionName":"lockStepVersion","policyName":"vtableMain","version":"1.26.4","mainProject":"@visactor/vtable","nextBump":"patch"}] diff --git a/docs/assets/changelog/en/release.md b/docs/assets/changelog/en/release.md index 8b6c222b6..818ee386c 100644 --- a/docs/assets/changelog/en/release.md +++ b/docs/assets/changelog/en/release.md @@ -1,3 +1,22 @@ +# v1.26.3 + +2026-06-25 + +**🐛 Bug Fixes** + +- **@visactor/vtable**: skip click cell after resize interaction ends +- **@visactor/vtable**: handle scroll frozen columns width +- **@visactor/vtable**: keep pivot row tree scroll position on toggle +- **@visactor/vtable**: preserve custom layout falsy values +- **@visactor/vtable**: handle right frozen column count update +- **@visactor/vtable**: keep fractional row scroll target +- **@visactor/vtable**: sync gantt task bars after sorted updates +- **@visactor/vtable**: preserve quad style values + +**Full Changelog**: https://github.com/VisActor/VTable/compare/v1.26.2...v1.26.3 + +[more detail about v1.26.3](https://github.com/VisActor/VTable/releases/tag/v1.26.3) + # v1.26.2 2026-06-16 diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md index c945f2a94..740c84076 100644 --- a/docs/assets/changelog/zh/release.md +++ b/docs/assets/changelog/zh/release.md @@ -1,3 +1,22 @@ +# v1.26.3 + +2026-06-25 + +**🐛 问题修复** + +- **@visactor/vtable**: skip click cell after resize interaction ends +- **@visactor/vtable**: handle scroll frozen columns width +- **@visactor/vtable**: keep pivot row tree scroll position on toggle +- **@visactor/vtable**: preserve custom layout falsy values +- **@visactor/vtable**: handle right frozen column count update +- **@visactor/vtable**: keep fractional row scroll target +- **@visactor/vtable**: sync gantt task bars after sorted updates +- **@visactor/vtable**: preserve quad style values + +**Full Changelog**: https://github.com/VisActor/VTable/compare/v1.26.2...v1.26.3 + +[更多详情请查看 v1.26.3](https://github.com/VisActor/VTable/releases/tag/v1.26.3) + # v1.26.2 2026-06-16 diff --git a/docs/package.json b/docs/package.json index a22fef08f..f27736945 100644 --- a/docs/package.json +++ b/docs/package.json @@ -12,15 +12,15 @@ "dependencies": { "@arco-design/web-react": "2.66.12", "@arco-design/web-vue": "^2.11.0", - "@visactor/vtable": "workspace:1.26.2", - "@visactor/vtable-gantt": "workspace:1.26.2", - "@visactor/react-vtable": "workspace:1.26.2", - "@visactor/vue-vtable": "workspace:1.26.2", - "@visactor/openinula-vtable": "workspace:1.26.2", - "@visactor/vtable-editors": "workspace:1.26.2", - "@visactor/vtable-export": "workspace:1.26.2", - "@visactor/vtable-search": "workspace:1.26.2", - "@visactor/vtable-sheet": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", + "@visactor/vtable-gantt": "workspace:1.26.3", + "@visactor/react-vtable": "workspace:1.26.3", + "@visactor/vue-vtable": "workspace:1.26.3", + "@visactor/openinula-vtable": "workspace:1.26.3", + "@visactor/vtable-editors": "workspace:1.26.3", + "@visactor/vtable-export": "workspace:1.26.3", + "@visactor/vtable-search": "workspace:1.26.3", + "@visactor/vtable-sheet": "workspace:1.26.3", "buble": "^0.20.0", "@visactor/vchart": "2.0.13-alpha.10", "markdown-it": "^13.0.0", diff --git a/packages/openinula-vtable/package.json b/packages/openinula-vtable/package.json index 98f506787..919ad191f 100644 --- a/packages/openinula-vtable/package.json +++ b/packages/openinula-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/openinula-vtable", - "version": "1.26.2", + "version": "1.26.3", "description": "The openinula version of VTable", "keywords": [ "openinula", @@ -44,7 +44,7 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17" }, "devDependencies": { diff --git a/packages/react-vtable/package.json b/packages/react-vtable/package.json index a6575a643..daa67cbc2 100644 --- a/packages/react-vtable/package.json +++ b/packages/react-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/react-vtable", - "version": "1.26.2", + "version": "1.26.3", "description": "The react version of VTable", "keywords": [ "react", @@ -57,7 +57,7 @@ "react-dom": "^18.2.0 || ^19.0.0" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17", "react-is": "^18.2.0", "react-reconciler": "0.29.0" diff --git a/packages/vtable-calendar/package.json b/packages/vtable-calendar/package.json index e056ddf5f..8d26224b0 100644 --- a/packages/vtable-calendar/package.json +++ b/packages/vtable-calendar/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-calendar", - "version": "1.26.2", + "version": "1.26.3", "description": "The calendar component of VTable", "author": { "name": "VisActor", @@ -37,7 +37,7 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17", "date-fns": "3.6.0" }, diff --git a/packages/vtable-editors/package.json b/packages/vtable-editors/package.json index 987ec093a..81e46f1a1 100644 --- a/packages/vtable-editors/package.json +++ b/packages/vtable-editors/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-editors", - "version": "1.26.2", + "version": "1.26.3", "description": "", "sideEffects": false, "main": "cjs/index.js", diff --git a/packages/vtable-export/package.json b/packages/vtable-export/package.json index 4e58ad8c7..3a99af639 100644 --- a/packages/vtable-export/package.json +++ b/packages/vtable-export/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-export", - "version": "1.26.2", + "version": "1.26.3", "description": "The export util of VTable", "author": { "name": "VisActor", @@ -37,7 +37,7 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17", "file-saver": "2.0.5", "@types/file-saver": "2.0.7", diff --git a/packages/vtable-gantt/package.json b/packages/vtable-gantt/package.json index 37174dbc6..13838cd9b 100644 --- a/packages/vtable-gantt/package.json +++ b/packages/vtable-gantt/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-gantt", - "version": "1.26.2", + "version": "1.26.3", "description": "canvas table width high performance", "keywords": [ "vtable-gantt", @@ -50,8 +50,8 @@ "fix-memory-limit": "cross-env LIMIT=10240 increase-memory-limit" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", - "@visactor/vtable-editors": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", + "@visactor/vtable-editors": "workspace:1.26.3", "@visactor/vutils": "~1.0.17", "@visactor/vscale": "~1.0.17", "@visactor/vdataset": "~1.0.17", diff --git a/packages/vtable-plugins/package.json b/packages/vtable-plugins/package.json index 3f30cdd6a..ce9184028 100644 --- a/packages/vtable-plugins/package.json +++ b/packages/vtable-plugins/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-plugins", - "version": "1.26.2", + "version": "1.26.3", "description": "The search util of VTable", "author": { "name": "VisActor", @@ -61,9 +61,9 @@ "devDependencies": { "cross-env": "^7.0.3", "increase-memory-limit": "^1.0.7", - "@visactor/vtable": "workspace:1.26.2", - "@visactor/vtable-editors": "workspace:1.26.2", - "@visactor/vtable-gantt": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", + "@visactor/vtable-editors": "workspace:1.26.3", + "@visactor/vtable-gantt": "workspace:1.26.3", "@visactor/vchart": "2.0.13-alpha.10", "@internal/bundler": "workspace:*", "@internal/eslint-config": "workspace:*", diff --git a/packages/vtable-search/package.json b/packages/vtable-search/package.json index a6c024119..fb4908e66 100644 --- a/packages/vtable-search/package.json +++ b/packages/vtable-search/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-search", - "version": "1.26.2", + "version": "1.26.3", "description": "The search util of VTable", "author": { "name": "VisActor", @@ -36,7 +36,7 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17" }, "devDependencies": { diff --git a/packages/vtable-sheet/package.json b/packages/vtable-sheet/package.json index 335a40fea..69f3f258c 100644 --- a/packages/vtable-sheet/package.json +++ b/packages/vtable-sheet/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable-sheet", - "version": "1.26.2", + "version": "1.26.3", "description": "Lightweight editable spreadsheet component based on VTable", "keywords": [ "vtable-sheet", @@ -50,9 +50,9 @@ "build:es": "bundle --clean -f es --ignorePostTasks" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", - "@visactor/vtable-editors": "workspace:1.26.2", - "@visactor/vtable-plugins": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", + "@visactor/vtable-editors": "workspace:1.26.3", + "@visactor/vtable-plugins": "workspace:1.26.3", "@visactor/vutils": "~1.0.17", "@visactor/vscale": "~1.0.17", "@visactor/vdataset": "~1.0.17", diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json index 2a6b5fc02..ca03d5b37 100644 --- a/packages/vtable/CHANGELOG.json +++ b/packages/vtable/CHANGELOG.json @@ -1,6 +1,41 @@ { "name": "@visactor/vtable", "entries": [ + { + "version": "1.26.4", + "tag": "@visactor/vtable_v1.26.4", + "date": "Thu, 25 Jun 2026 03:15:59 GMT", + "comments": { + "patch": [ + { + "comment": "fix: skip click cell after resize interaction ends" + }, + { + "comment": "fix: handle scroll frozen columns width" + }, + { + "comment": "fix: keep pivot row tree scroll position on toggle" + } + ], + "none": [ + { + "comment": "fix: preserve custom layout falsy values" + }, + { + "comment": "fix: handle right frozen column count update" + }, + { + "comment": "fix: keep fractional row scroll target" + }, + { + "comment": "fix: sync gantt task bars after sorted updates\n\n" + }, + { + "comment": "fix: preserve quad style values" + } + ] + } + }, { "version": "1.26.3", "tag": "@visactor/vtable_v1.26.3", diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md index 819bd210b..3c38a148e 100644 --- a/packages/vtable/CHANGELOG.md +++ b/packages/vtable/CHANGELOG.md @@ -1,6 +1,25 @@ # Change Log - @visactor/vtable -This log was last generated on Tue, 16 Jun 2026 06:22:51 GMT and should not be manually modified. +This log was last generated on Thu, 25 Jun 2026 03:15:59 GMT and should not be manually modified. + +## 1.26.4 +Thu, 25 Jun 2026 03:15:59 GMT + +### Patches + +- fix: skip click cell after resize interaction ends +- fix: handle scroll frozen columns width +- fix: keep pivot row tree scroll position on toggle + +### Updates + +- fix: preserve custom layout falsy values +- fix: handle right frozen column count update +- fix: keep fractional row scroll target +- fix: sync gantt task bars after sorted updates + + +- fix: preserve quad style values ## 1.26.3 Tue, 16 Jun 2026 06:22:51 GMT diff --git a/packages/vtable/package.json b/packages/vtable/package.json index 142970aa2..d722b5d29 100644 --- a/packages/vtable/package.json +++ b/packages/vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vtable", - "version": "1.26.2", + "version": "1.26.3", "description": "canvas table width high performance", "keywords": [ "grid", @@ -52,7 +52,7 @@ "fix-memory-limit": "cross-env LIMIT=10240 increase-memory-limit" }, "dependencies": { - "@visactor/vtable-editors": "workspace:1.26.2", + "@visactor/vtable-editors": "workspace:1.26.3", "@visactor/vrender-core": "~1.0.41", "@visactor/vrender-kits": "~1.0.41", "@visactor/vrender-components": "~1.0.41", diff --git a/packages/vue-vtable/package.json b/packages/vue-vtable/package.json index db7b9ee66..078f9ceb2 100644 --- a/packages/vue-vtable/package.json +++ b/packages/vue-vtable/package.json @@ -1,6 +1,6 @@ { "name": "@visactor/vue-vtable", - "version": "1.26.2", + "version": "1.26.3", "description": "The vue version of VTable", "keywords": [ "vue", @@ -59,7 +59,7 @@ "access": "public" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", + "@visactor/vtable": "workspace:1.26.3", "@visactor/vutils": "~1.0.17" }, "devDependencies": { diff --git a/tools/bugserver-trigger/package.json b/tools/bugserver-trigger/package.json index 256bc5f2b..ce0b0b207 100644 --- a/tools/bugserver-trigger/package.json +++ b/tools/bugserver-trigger/package.json @@ -8,11 +8,11 @@ "ci": "ts-node --transpileOnly --skipProject ./scripts/trigger-test.ts" }, "dependencies": { - "@visactor/vtable": "workspace:1.26.2", - "@visactor/vtable-gantt": "workspace:1.26.2", - "@visactor/vtable-editors": "workspace:1.26.2", - "@visactor/vtable-plugins": "workspace:1.26.2", - "@visactor/vtable-sheet": "workspace:1.26.2" + "@visactor/vtable": "workspace:1.26.3", + "@visactor/vtable-gantt": "workspace:1.26.3", + "@visactor/vtable-editors": "workspace:1.26.3", + "@visactor/vtable-plugins": "workspace:1.26.3", + "@visactor/vtable-sheet": "workspace:1.26.3" }, "devDependencies": { "@rushstack/eslint-patch": "~1.1.4", From a91da3b11a0d2a62234178d9c78210aef6d1d109 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 25 Jun 2026 11:41:09 +0800 Subject: [PATCH 2/5] docs: update release log --- docs/assets/changelog/zh/release.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/assets/changelog/zh/release.md b/docs/assets/changelog/zh/release.md index 740c84076..e0d795254 100644 --- a/docs/assets/changelog/zh/release.md +++ b/docs/assets/changelog/zh/release.md @@ -2,16 +2,16 @@ 2026-06-25 -**🐛 问题修复** - -- **@visactor/vtable**: skip click cell after resize interaction ends -- **@visactor/vtable**: handle scroll frozen columns width -- **@visactor/vtable**: keep pivot row tree scroll position on toggle -- **@visactor/vtable**: preserve custom layout falsy values -- **@visactor/vtable**: handle right frozen column count update -- **@visactor/vtable**: keep fractional row scroll target -- **@visactor/vtable**: sync gantt task bars after sorted updates -- **@visactor/vtable**: preserve quad style values +**🐛 功能修复** + +- **@visactor/vtable**:在调整尺寸交互结束后,跳过单元格点击事件的触发 +- **@visactor/vtable**:处理滚动时冻结列宽度 +- **@visactor/vtable**:在切换时保持透视表行树滚动位置 +- **@visactor/vtable**:保留自定义布局中的假值 +- **@visactor/vtable**:处理右侧冻结列数量更新 +- **@visactor/vtable**:保持带小数的行滚动目标位置 +- **@visactor/vtable**:在排序更新后同步甘特任务条 +- **@visactor/vtable**:保留四向边框样式值 **Full Changelog**: https://github.com/VisActor/VTable/compare/v1.26.2...v1.26.3 From 7c423457710d71527f7a91a296f98befcf45f73d Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 25 Jun 2026 14:47:57 +0800 Subject: [PATCH 3/5] fix: align rush changelog release version --- .github/workflows/release.yml | 4 ++ .../scripts/align-rush-changelog-version.js | 61 +++++++++++++++++++ packages/vtable/CHANGELOG.json | 33 +--------- packages/vtable/CHANGELOG.md | 28 +-------- 4 files changed, 68 insertions(+), 58 deletions(-) create mode 100644 common/scripts/align-rush-changelog-version.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 78b806c2a..afde16dde 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -307,6 +307,10 @@ jobs: if: startsWith(github.ref_name, 'release/') run: node common/scripts/install-run-rush.js version --bump + - name: Align rush changelog version (release) + if: startsWith(github.ref_name, 'release/') + run: node common/scripts/align-rush-changelog-version.js ${{ steps.semver_release.outputs.main }} + - name: Update version (release) if: startsWith(github.ref_name, 'release/') run: node common/scripts/apply-release-version.js 'none' ${{ steps.semver_release.outputs.main }} diff --git a/common/scripts/align-rush-changelog-version.js b/common/scripts/align-rush-changelog-version.js new file mode 100644 index 000000000..0298c6b2f --- /dev/null +++ b/common/scripts/align-rush-changelog-version.js @@ -0,0 +1,61 @@ +const fs = require('fs'); +const path = require('path'); + +function escapeRegExp(value) { + return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +} + +function alignChangelogJson(packageDir, packageName, releaseVersion) { + const changelogJsonPath = path.join(packageDir, 'CHANGELOG.json'); + const changelog = JSON.parse(fs.readFileSync(changelogJsonPath, 'utf8')); + + if (!Array.isArray(changelog.entries) || changelog.entries.length === 0) { + throw new Error(`No changelog entries found in ${changelogJsonPath}`); + } + + changelog.entries[0].version = releaseVersion; + changelog.entries[0].tag = `${packageName}_v${releaseVersion}`; + changelog.entries = changelog.entries.filter((entry, index) => index === 0 || entry.version !== releaseVersion); + + fs.writeFileSync(changelogJsonPath, `${JSON.stringify(changelog, null, 2)}\n`); +} + +function alignChangelogMarkdown(packageDir, releaseVersion) { + const changelogMdPath = path.join(packageDir, 'CHANGELOG.md'); + const changelog = fs.readFileSync(changelogMdPath, 'utf8'); + const match = changelog.match(/^##\s+(.+)$/m); + + if (!match) { + throw new Error(`No changelog version heading found in ${changelogMdPath}`); + } + + let nextChangelog = changelog.slice(0, match.index) + `## ${releaseVersion}` + changelog.slice(match.index + match[0].length); + const duplicateHeading = new RegExp(`\\n##\\s+${escapeRegExp(releaseVersion)}\\n[\\s\\S]*?(?=\\n##\\s+|$)`, 'g'); + let seenReleaseHeading = false; + + nextChangelog = nextChangelog.replace(duplicateHeading, block => { + if (!seenReleaseHeading) { + seenReleaseHeading = true; + return block; + } + return ''; + }); + + fs.writeFileSync(changelogMdPath, nextChangelog); +} + +function run() { + const releaseVersion = process.argv[2]; + const packageName = process.argv[3] || '@visactor/vtable'; + const packageDir = process.argv[4] || path.join(__dirname, '../../packages/vtable'); + + if (!releaseVersion) { + console.error('Usage: node common/scripts/align-rush-changelog-version.js [package-name] [package-dir]'); + process.exit(1); + } + + alignChangelogJson(packageDir, packageName, releaseVersion); + alignChangelogMarkdown(packageDir, releaseVersion); +} + +run(); diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json index ca03d5b37..ffc7f5a76 100644 --- a/packages/vtable/CHANGELOG.json +++ b/packages/vtable/CHANGELOG.json @@ -2,8 +2,8 @@ "name": "@visactor/vtable", "entries": [ { - "version": "1.26.4", - "tag": "@visactor/vtable_v1.26.4", + "version": "1.26.3", + "tag": "@visactor/vtable_v1.26.3", "date": "Thu, 25 Jun 2026 03:15:59 GMT", "comments": { "patch": [ @@ -36,35 +36,6 @@ ] } }, - { - "version": "1.26.3", - "tag": "@visactor/vtable_v1.26.3", - "date": "Tue, 16 Jun 2026 06:22:51 GMT", - "comments": { - "none": [ - { - "comment": "Merge pull request #5144 from VisActor/fix/issue-5027\n\nfix: avoid selection gap with frozen rows\n" - }, - { - "comment": "fix: preserve sticky group position after toggle\n\n" - }, - { - "comment": "fix: avoid selection gap with frozen rows\n\n" - }, - { - "comment": "fix: preserve hidden column order after filter update\n\n" - }, - { - "comment": "fix: resolve regression from #5137 fix which broke nested header drag and exposed internal state\n\n" - } - ], - "patch": [ - { - "comment": "Fix an issue where keyboard multi-selection with Shift plus arrow keys stopped expanding after the second cell (GitHub #5146)" - } - ] - } - }, { "version": "1.26.2", "tag": "@visactor/vtable_v1.26.2", diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md index 3c38a148e..9fd260170 100644 --- a/packages/vtable/CHANGELOG.md +++ b/packages/vtable/CHANGELOG.md @@ -2,7 +2,7 @@ This log was last generated on Thu, 25 Jun 2026 03:15:59 GMT and should not be manually modified. -## 1.26.4 +## 1.26.3 Thu, 25 Jun 2026 03:15:59 GMT ### Patches @@ -21,32 +21,6 @@ Thu, 25 Jun 2026 03:15:59 GMT - fix: preserve quad style values -## 1.26.3 -Tue, 16 Jun 2026 06:22:51 GMT - -### Patches - -- Fix an issue where keyboard multi-selection with Shift plus arrow keys stopped expanding after the second cell (GitHub #5146) - -### Updates - -- Merge pull request #5144 from VisActor/fix/issue-5027 - -fix: avoid selection gap with frozen rows - -- fix: preserve sticky group position after toggle - - -- fix: avoid selection gap with frozen rows - - -- fix: preserve hidden column order after filter update - - -- fix: resolve regression from #5137 fix which broke nested header drag and exposed internal state - - - ## 1.26.2 Tue, 16 Jun 2026 01:39:41 GMT From bfc792f53f8452d5fbd5537e1b4300ffca9463a3 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 25 Jun 2026 14:55:52 +0800 Subject: [PATCH 4/5] fix: preserve shifted rush changelog entries --- .../scripts/align-rush-changelog-version.js | 103 ++++++++++++++---- packages/vtable/CHANGELOG.json | 2 +- packages/vtable/CHANGELOG.md | 2 +- 3 files changed, 86 insertions(+), 21 deletions(-) diff --git a/common/scripts/align-rush-changelog-version.js b/common/scripts/align-rush-changelog-version.js index 0298c6b2f..267d16e13 100644 --- a/common/scripts/align-rush-changelog-version.js +++ b/common/scripts/align-rush-changelog-version.js @@ -1,11 +1,37 @@ const fs = require('fs'); const path = require('path'); -function escapeRegExp(value) { - return value.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); +function readReleaseVersions() { + const releaseChangelogPath = path.join(__dirname, '../../docs/assets/changelog/en/release.md'); + const releaseChangelog = fs.readFileSync(releaseChangelogPath, 'utf8'); + + return Array.from(releaseChangelog.matchAll(/^#\s+v?(\d+\.\d+\.\d+)/gm)).map(match => match[1]); +} + +function getPreviousReleaseVersion(releaseVersion) { + const versions = readReleaseVersions(); + const releaseIndex = versions.indexOf(releaseVersion); + + if (releaseIndex === -1 || !versions[releaseIndex + 1]) { + return null; + } + + return versions[releaseIndex + 1]; +} + +function dedupeEntriesByVersion(entries) { + const seenVersions = new Set(); + + return entries.filter(entry => { + if (seenVersions.has(entry.version)) { + return false; + } + seenVersions.add(entry.version); + return true; + }); } -function alignChangelogJson(packageDir, packageName, releaseVersion) { +function alignChangelogJson(packageDir, packageName, releaseVersion, previousReleaseVersion) { const changelogJsonPath = path.join(packageDir, 'CHANGELOG.json'); const changelog = JSON.parse(fs.readFileSync(changelogJsonPath, 'utf8')); @@ -15,31 +41,68 @@ function alignChangelogJson(packageDir, packageName, releaseVersion) { changelog.entries[0].version = releaseVersion; changelog.entries[0].tag = `${packageName}_v${releaseVersion}`; - changelog.entries = changelog.entries.filter((entry, index) => index === 0 || entry.version !== releaseVersion); + + if (previousReleaseVersion && changelog.entries[1]?.version === releaseVersion) { + changelog.entries[1].version = previousReleaseVersion; + changelog.entries[1].tag = `${packageName}_v${previousReleaseVersion}`; + } + + changelog.entries = dedupeEntriesByVersion(changelog.entries); fs.writeFileSync(changelogJsonPath, `${JSON.stringify(changelog, null, 2)}\n`); } -function alignChangelogMarkdown(packageDir, releaseVersion) { +function parseMarkdownSections(changelog) { + const headingMatches = Array.from(changelog.matchAll(/^##\s+(.+)$/gm)); + + if (headingMatches.length === 0) { + return null; + } + + const prelude = changelog.slice(0, headingMatches[0].index); + const sections = headingMatches.map((match, index) => { + const start = match.index; + const bodyStart = start + match[0].length; + const end = headingMatches[index + 1]?.index ?? changelog.length; + + return { + version: match[1].trim(), + body: changelog.slice(bodyStart, end) + }; + }); + + return { prelude, sections }; +} + +function dedupeMarkdownSections(sections) { + const seenVersions = new Set(); + + return sections.filter(section => { + if (seenVersions.has(section.version)) { + return false; + } + seenVersions.add(section.version); + return true; + }); +} + +function alignChangelogMarkdown(packageDir, releaseVersion, previousReleaseVersion) { const changelogMdPath = path.join(packageDir, 'CHANGELOG.md'); const changelog = fs.readFileSync(changelogMdPath, 'utf8'); - const match = changelog.match(/^##\s+(.+)$/m); + const parsed = parseMarkdownSections(changelog); - if (!match) { + if (!parsed) { throw new Error(`No changelog version heading found in ${changelogMdPath}`); } - let nextChangelog = changelog.slice(0, match.index) + `## ${releaseVersion}` + changelog.slice(match.index + match[0].length); - const duplicateHeading = new RegExp(`\\n##\\s+${escapeRegExp(releaseVersion)}\\n[\\s\\S]*?(?=\\n##\\s+|$)`, 'g'); - let seenReleaseHeading = false; + parsed.sections[0].version = releaseVersion; - nextChangelog = nextChangelog.replace(duplicateHeading, block => { - if (!seenReleaseHeading) { - seenReleaseHeading = true; - return block; - } - return ''; - }); + if (previousReleaseVersion && parsed.sections[1]?.version === releaseVersion) { + parsed.sections[1].version = previousReleaseVersion; + } + + const sections = dedupeMarkdownSections(parsed.sections); + const nextChangelog = parsed.prelude + sections.map(section => `## ${section.version}${section.body}`).join(''); fs.writeFileSync(changelogMdPath, nextChangelog); } @@ -54,8 +117,10 @@ function run() { process.exit(1); } - alignChangelogJson(packageDir, packageName, releaseVersion); - alignChangelogMarkdown(packageDir, releaseVersion); + const previousReleaseVersion = getPreviousReleaseVersion(releaseVersion); + + alignChangelogJson(packageDir, packageName, releaseVersion, previousReleaseVersion); + alignChangelogMarkdown(packageDir, releaseVersion, previousReleaseVersion); } run(); diff --git a/packages/vtable/CHANGELOG.json b/packages/vtable/CHANGELOG.json index ffc7f5a76..92b90ac38 100644 --- a/packages/vtable/CHANGELOG.json +++ b/packages/vtable/CHANGELOG.json @@ -39,7 +39,7 @@ { "version": "1.26.2", "tag": "@visactor/vtable_v1.26.2", - "date": "Tue, 16 Jun 2026 01:39:41 GMT", + "date": "Tue, 16 Jun 2026 06:22:51 GMT", "comments": { "none": [ { diff --git a/packages/vtable/CHANGELOG.md b/packages/vtable/CHANGELOG.md index 9fd260170..e66b1ad64 100644 --- a/packages/vtable/CHANGELOG.md +++ b/packages/vtable/CHANGELOG.md @@ -22,7 +22,7 @@ Thu, 25 Jun 2026 03:15:59 GMT - fix: preserve quad style values ## 1.26.2 -Tue, 16 Jun 2026 01:39:41 GMT +Tue, 16 Jun 2026 06:22:51 GMT ### Patches From 04b58135065653cdd72ad867b82a4077f97c0e20 Mon Sep 17 00:00:00 2001 From: fangsmile <892739385@qq.com> Date: Thu, 25 Jun 2026 15:02:53 +0800 Subject: [PATCH 5/5] fix: generate release changelog from current version --- .github/workflows/release.yml | 24 +++- .../scripts/align-rush-changelog-version.js | 126 ------------------ 2 files changed, 17 insertions(+), 133 deletions(-) delete mode 100644 common/scripts/align-rush-changelog-version.js diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afde16dde..34428165f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -303,17 +303,27 @@ jobs: fi done - - name: Generate rush version (release) + - name: Reset version-policy base version (release) if: startsWith(github.ref_name, 'release/') - run: node common/scripts/install-run-rush.js version --bump + run: | + node <<'NODE' + const fs = require('fs'); - - name: Align rush changelog version (release) - if: startsWith(github.ref_name, 'release/') - run: node common/scripts/align-rush-changelog-version.js ${{ steps.semver_release.outputs.main }} + const packageJson = JSON.parse(fs.readFileSync('packages/vtable/package.json', 'utf8')); + const policiesPath = 'common/config/rush/version-policies.json'; + const policies = JSON.parse(fs.readFileSync(policiesPath, 'utf8')); - - name: Update version (release) + if (!policies[0]) { + throw new Error('Missing version policy.'); + } + + policies[0].version = packageJson.version; + fs.writeFileSync(policiesPath, JSON.stringify(policies)); + NODE + + - name: Generate rush version (release) if: startsWith(github.ref_name, 'release/') - run: node common/scripts/apply-release-version.js 'none' ${{ steps.semver_release.outputs.main }} + run: node common/scripts/install-run-rush.js version --bump - name: Build packages env: diff --git a/common/scripts/align-rush-changelog-version.js b/common/scripts/align-rush-changelog-version.js deleted file mode 100644 index 267d16e13..000000000 --- a/common/scripts/align-rush-changelog-version.js +++ /dev/null @@ -1,126 +0,0 @@ -const fs = require('fs'); -const path = require('path'); - -function readReleaseVersions() { - const releaseChangelogPath = path.join(__dirname, '../../docs/assets/changelog/en/release.md'); - const releaseChangelog = fs.readFileSync(releaseChangelogPath, 'utf8'); - - return Array.from(releaseChangelog.matchAll(/^#\s+v?(\d+\.\d+\.\d+)/gm)).map(match => match[1]); -} - -function getPreviousReleaseVersion(releaseVersion) { - const versions = readReleaseVersions(); - const releaseIndex = versions.indexOf(releaseVersion); - - if (releaseIndex === -1 || !versions[releaseIndex + 1]) { - return null; - } - - return versions[releaseIndex + 1]; -} - -function dedupeEntriesByVersion(entries) { - const seenVersions = new Set(); - - return entries.filter(entry => { - if (seenVersions.has(entry.version)) { - return false; - } - seenVersions.add(entry.version); - return true; - }); -} - -function alignChangelogJson(packageDir, packageName, releaseVersion, previousReleaseVersion) { - const changelogJsonPath = path.join(packageDir, 'CHANGELOG.json'); - const changelog = JSON.parse(fs.readFileSync(changelogJsonPath, 'utf8')); - - if (!Array.isArray(changelog.entries) || changelog.entries.length === 0) { - throw new Error(`No changelog entries found in ${changelogJsonPath}`); - } - - changelog.entries[0].version = releaseVersion; - changelog.entries[0].tag = `${packageName}_v${releaseVersion}`; - - if (previousReleaseVersion && changelog.entries[1]?.version === releaseVersion) { - changelog.entries[1].version = previousReleaseVersion; - changelog.entries[1].tag = `${packageName}_v${previousReleaseVersion}`; - } - - changelog.entries = dedupeEntriesByVersion(changelog.entries); - - fs.writeFileSync(changelogJsonPath, `${JSON.stringify(changelog, null, 2)}\n`); -} - -function parseMarkdownSections(changelog) { - const headingMatches = Array.from(changelog.matchAll(/^##\s+(.+)$/gm)); - - if (headingMatches.length === 0) { - return null; - } - - const prelude = changelog.slice(0, headingMatches[0].index); - const sections = headingMatches.map((match, index) => { - const start = match.index; - const bodyStart = start + match[0].length; - const end = headingMatches[index + 1]?.index ?? changelog.length; - - return { - version: match[1].trim(), - body: changelog.slice(bodyStart, end) - }; - }); - - return { prelude, sections }; -} - -function dedupeMarkdownSections(sections) { - const seenVersions = new Set(); - - return sections.filter(section => { - if (seenVersions.has(section.version)) { - return false; - } - seenVersions.add(section.version); - return true; - }); -} - -function alignChangelogMarkdown(packageDir, releaseVersion, previousReleaseVersion) { - const changelogMdPath = path.join(packageDir, 'CHANGELOG.md'); - const changelog = fs.readFileSync(changelogMdPath, 'utf8'); - const parsed = parseMarkdownSections(changelog); - - if (!parsed) { - throw new Error(`No changelog version heading found in ${changelogMdPath}`); - } - - parsed.sections[0].version = releaseVersion; - - if (previousReleaseVersion && parsed.sections[1]?.version === releaseVersion) { - parsed.sections[1].version = previousReleaseVersion; - } - - const sections = dedupeMarkdownSections(parsed.sections); - const nextChangelog = parsed.prelude + sections.map(section => `## ${section.version}${section.body}`).join(''); - - fs.writeFileSync(changelogMdPath, nextChangelog); -} - -function run() { - const releaseVersion = process.argv[2]; - const packageName = process.argv[3] || '@visactor/vtable'; - const packageDir = process.argv[4] || path.join(__dirname, '../../packages/vtable'); - - if (!releaseVersion) { - console.error('Usage: node common/scripts/align-rush-changelog-version.js [package-name] [package-dir]'); - process.exit(1); - } - - const previousReleaseVersion = getPreviousReleaseVersion(releaseVersion); - - alignChangelogJson(packageDir, packageName, releaseVersion, previousReleaseVersion); - alignChangelogMarkdown(packageDir, releaseVersion, previousReleaseVersion); -} - -run();