fix(deps): restore nested ajv and bundled emnapi entries to the lockfile - #72
Merged
Conversation
CI has been red on main since 64f18f0 ("Package Update Cleanup"): `npm ci` failed in ~8s on a lockfile mismatch, before any test ran, on every branch. npm error Invalid: lock file's ajv@6.15.0 does not satisfy ajv@8.20.0 npm error Missing: fast-uri@3.1.5 from lock file npm error Invalid: lock file's json-schema-traverse@0.4.1 does not satisfy json-schema-traverse@1.0.0 Cause `ajv` is an *optional* peer dep of @hookform/resolvers (peerDependenciesMeta.ajv.optional = true), and we do not use the ajv resolver, so it should not be installed at all. The lockfile instead carried a single hoisted top-level ajv@6.15.0 marked `devOptional` — a dedupe of eslint's own ajv@6 — while npm's ideal tree wanted ajv@8.20.0 there to satisfy the optional peer. Lock and ideal tree disagreed, and `npm ci` refuses to guess. Fix Regenerated with: npm install --package-lock-only --os=linux --cpu=x64 Net effect (142 lines, +116/-26): - drops the bogus hoisted top-level ajv@6.15.0 and json-schema-traverse@0.4.1 - gives eslint and @eslint/eslintrc their own nested ajv@6.15.0 subtrees - restores the bundled @tailwindcss/oxide-wasm32-wasi -> @emnapi/* subtree (@emnapi/core, runtime, wasi-threads, @napi-rs/wasm-runtime, @tybys/wasm-util, tslib) that a previous Windows install had pruned That last part also clears the drift tracked in .claude/TODO/investigate-emnapi-lockfile-drift.md, so the manual re-add workaround that TODO describes is no longer needed. package.json is untouched. No dependency versions changed — this is purely a lockfile tree-shape repair. Verification - `npm ci` on Linux (container): exit 0, 587 packages - resulting tree: no top-level ajv; eslint/node_modules/ajv at 6.15.0 - platform coverage unchanged, so the lockfile stays cross-platform: win32 76, darwin 75, linux-x64 46, android 40 — identical before and after. `--os`/`--cpu` steer resolution without narrowing the lockfile, and `--package-lock-only` leaves node_modules alone. The full suite could not run in the container — the only image that would pull is node 20, and jsdom 30's undici needs node >= 22 (`webidl.util.markAsUncloneable is not a function`). CI runs node 22, so the run on this PR is the real test check. TODO housekeeping - removed ci-broken-ajv-lockfile-drift.md — resolved by this commit - updated investigate-emnapi-lockfile-drift.md: marks option 2 confirmed working with the exact flags and the evidence, and narrows the remaining work to the one thing still missing — a CI guard running `npm ci --dry-run` on any lockfile change. Both incidents reached main and were caught a merge later; without that guard there will be a third. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
6 tasks
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.
Why
CI has been red on
mainsince64f18f0("Package Update Cleanup").npm cifails in ~8s before any test runs, on every branch:The run before
64f18f0was green; that one and every run since are red with a byte-identical error. No PR has been verifiable by CI since.Cause
ajvis an optional peer dep of@hookform/resolvers(peerDependenciesMeta.ajv.optional: true), and we don't use the ajv resolver — so it shouldn't be installed at all.The lockfile instead carried a single hoisted top-level
ajv@6.15.0markeddevOptional, a dedupe of eslint's ownajv@6, while npm's ideal tree wantedajv@8.20.0in that slot to satisfy the optional peer. Lock and ideal tree disagreed, andnpm cirefuses to guess.Fix
142 lines, +116/−26:
ajv@6.15.0andjson-schema-traverse@0.4.1eslintand@eslint/eslintrctheir own nestedajv@6.15.0subtrees@tailwindcss/oxide-wasm32-wasi→@emnapi/*subtree (core,runtime,wasi-threads,@napi-rs/wasm-runtime,@tybys/wasm-util,tslib) that a previous Windows install had prunedpackage.jsonis untouched and no dependency versions changed — this is purely a lockfile tree-shape repair.That last bullet also clears the drift tracked in
investigate-emnapi-lockfile-drift.md, so the manual re-add workaround that TODO describes is no longer needed.Verification
npm cion Linux (container): exit 0, 587 packagesajv;eslint/node_modules/ajvat 6.15.0--os/--cpusteer resolution without narrowing the lockfile to one platform, and--package-lock-onlynever touchesnode_modules.webidl.util.markAsUncloneable is not a function). CI runs node 22, so the check on this PR is the real test verification — it should be green for the first time since64f18f0.TODO housekeeping
ci-broken-ajv-lockfile-drift.md— resolved by this commitinvestigate-emnapi-lockfile-drift.md— marks option 2 confirmed working, with the exact flags and the evidence above, and narrows the remaining work to the one thing still missing: a CI guard runningnpm ci --dry-runon any lockfile changeThat guard is the real fix. Both incidents reached
mainand were caught a merge later; the manual recipe is now solved, but without the guard there will be a third. Left as the open item in that TODO rather than bundled here.Test plan
npm cion Linux — exit 0package.jsonuntouched; no version changes🤖 Generated with Claude Code