fix: keep package-lock.json version in sync on version bumps#22
Merged
Conversation
scripts/version-bump.mjs bumped package.json, tauri.conf.json, Cargo.toml and Cargo.lock, but never package-lock.json. The lockfile therefore sat at 0.1.0-alpha.60 while package.json reached 0.1.0-alpha.62, and any fresh `npm install` (CI job or git worktree) rewrote its two version fields, producing a spurious diff that had to be reverted by hand. Add bumpPackageLock() to the script, mirroring the existing bumpCargoLock() fix for the same class of drift on the Rust side. It edits the two version fields in place instead of shelling out to `npm install --package-lock-only`, which would re-resolve dependency ranges and risk churning unrelated entries into the bump commit. Also bring package-lock.json up to 0.1.0-alpha.62 as a one-time correction (version fields only, no dependency changes), and update RELEASING.md, which still documented three files when the script already handled four. RELEASING.md now also warns against `npm version`: "version" is registered as an npm script here, so npm's lifecycle hook would invoke it with no argument and abort the bump. Verified: npm ci exits 0, and npm install no longer rewrites the lockfile.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
scripts/version-bump.mjs bumped package.json, tauri.conf.json, Cargo.toml and Cargo.lock, but never package-lock.json. The lockfile therefore sat at 0.1.0-alpha.60 while package.json reached 0.1.0-alpha.62, and any fresh
npm install(CI job or git worktree) rewrote its two version fields, producing a spurious diff that had to be reverted by hand.Add bumpPackageLock() to the script, mirroring the existing bumpCargoLock() fix for the same class of drift on the Rust side. It edits the two version fields in place instead of shelling out to
npm install --package-lock-only, which would re-resolve dependency ranges and risk churning unrelated entries into the bump commit.Also bring package-lock.json up to 0.1.0-alpha.62 as a one-time correction (version fields only, no dependency changes), and update RELEASING.md, which still documented three files when the script already handled four.
RELEASING.md now also warns against
npm version: "version" is registered as an npm script here, so npm's lifecycle hook would invoke it with no argument and abort the bump.Verified: npm ci exits 0, and npm install no longer rewrites the lockfile.
摘要 / Summary
相關 Issue / Linked issue
檢查清單 / Checklist
npm test通過、npm run lint無錯、npx tsc --noEmit無錯、(碰到 Rust 時)npm run check:tauri通過 /npm test,npm run lint,npx tsc --noEmitpass;npm run check:tauriwhen touching Rustcopy.csvround-trip(npm run copy:export/npm run copy:import),未直接改.tsx字串 / UI copy went through thecopy.csvround-trip, not hand-edited in.tsx