Reconcile the lockfile after vitest 5 landed on top of lock file maintenance - #110
Conversation
…tenance `npm ci` in src/vue failed on main with: npm error `npm ci` can only install packages when your package.json and package-lock.json are in sync. npm error Missing: tinyexec@1.3.0 from lock file Cause is the merge order, not either change. #109 (lock file maintenance) re-resolved the whole lockfile while vitest was still 4.1.11, and hoisted tinyexec 1.3.1 to the top level because 4.1.11 accepted it. #107 (vitest 5) was branched before that and merged after it. Git took both diffs without a textual conflict, but vitest 5.0.0 wants tinyexec 1.3.0, so the result named a dependency the lockfile no longer contained. The repair is one `npm install`: tinyexec moves from a hoisted node_modules/tinyexec at 1.3.1 to a nested node_modules/vitest/node_modules/ tinyexec at 1.3.0. Nothing else in the tree changes, and vitest is now the only consumer. CI would not have caught this. The "Build front-end" job runs `npm install`, which quietly repairs an out-of-sync lockfile in the runner and passes, so the committed lockfile stays broken for anyone using `npm ci`. Worth considering `npm ci` there instead, which is what a lockfile is for. Verified on this branch: `npm ci` exits 0, `npm audit` reports 0 vulnerabilities, `npm run build` passes, `vitest run` passes 51 of 51 on vitest 5.0.0, `npx eslint .` exits 0, and the committed FactorioToolsApi.ts does not drift. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DAVZSEbjCkr9sbumdMPKy2
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
npm ciinsrc/vueis currently broken onmain:What happened
The cause is merge order, not either change on its own.
tinyexecto the top level at 1.3.1, because 4.1.11 accepted that.Git merged both without a textual conflict, because they touch different regions of the file. The result was still wrong: vitest 5.0.0 wants
tinyexec1.3.0, sopackage-lock.jsonnamed a dependency it no longer contained.The fix
One
npm install.tinyexecmoves from a hoistednode_modules/tinyexecat 1.3.1 to a nestednode_modules/vitest/node_modules/tinyexecat 1.3.0. Nothing else in the tree changes - vitest is now its only consumer.Why CI did not catch it
ci.yml's "Build front-end" job runsnpm install, notnpm ci.npm installquietly repairs an out-of-sync lockfile in the runner and carries on, so every check passed on a tree that no clean install could reproduce. The committed lockfile stayed broken for anyone who usesnpm ci- which includes any fresh clone following the documented setup.Switching that step to
npm ciwould turn this class of problem into a failing check instead of a silent one. That is a separate change and is not included here.Verification
On this branch:
npm ci- exits 0 (it exits 1 onmain)npm audit- 0 vulnerabilitiesnpm run build- passesnpm run test- 51 of 51 passing, confirmed running on vitest 5.0.0npx eslint .- exit 0src/vue/src/lib/FactorioToolsApi.tsdoes not drift🤖 Generated with Claude Code
https://claude.ai/code/session_01DAVZSEbjCkr9sbumdMPKy2