Skip to content

Stop npm's yarn.lock rewrite from churning resolutions - #102

Merged
irskep merged 2 commits into
mainfrom
stop-lockfile-drift
Sep 17, 2026
Merged

irskep merged 2 commits into
mainfrom
stop-lockfile-drift

Conversation

@irskep

@irskep irskep commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

The deps are pinned. Something was throwing the pins away.

update-all-lockfiles runs npm before yarn. npm rewrites yarn.lock in the old v1 format as a side effect of installing, and yarn reads a v1 lockfile as a foreign file to import rather than as its own pins, so it re-resolves every range against the registry. yarn.lock then absorbed whatever had been published upstream since the last run. That's why the lockfile check has been failing on branches that never touched a dependency, twice in the last few days, on undici, which and @tybys/wasm-util.

yarn install on its own doesn't drift at all. I checked: run it against an untouched tree and yarn.lock comes back byte-identical. It's only the npm step before it that breaks the pinning.

So this copies yarn.lock aside around npm install and puts it back, which EVERY_NODE_PACKAGE_MANAGER_WORKS.md already claimed happened. The doc described the behavior; the script never did it.

Verified on this branch, which carries main's three-month-old yarn.lock untouched: mise run update-all-lockfiles now reproduces all five lockfiles exactly, twice in a row. Before this, the same command rewrote yarn.lock every time.

That also means #100 and #101 didn't need their yarn.lock refreshes. They're harmless and already green, but once this lands the churn stops rather than needing a refresh commit each time someone opens a PR.

Ducks sitting in a row is the whole point of a lockfile. One of ours kept wandering off.

🤖 Generated with Claude Code

stevelandey-byte and others added 2 commits September 14, 2026 10:08
update-all-lockfiles runs npm before yarn. npm rewrites yarn.lock in the
v1 format as a side effect of installing, and yarn treats a v1 lockfile
as something to import rather than its own pins, so it re-resolves every
range against the registry. yarn.lock then picked up whatever had been
published upstream since the last run, and CI's lockfile check went red
on branches that never touched a dependency.

Copy yarn.lock aside around `npm install` and put it back, which is what
the docs already claimed happened.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@irskep
irskep requested review from anjoola and mblair September 14, 2026 17:24
irskep pushed a commit that referenced this pull request Sep 14, 2026
Transitive ranges moved upstream, so `mise update-all-lockfiles` no
longer reproduces the committed file. #102 stops this from recurring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
irskep pushed a commit that referenced this pull request Sep 14, 2026
Transitive ranges moved upstream, so `mise update-all-lockfiles` no
longer reproduces the committed file. #102 stops this from recurring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
irskep added a commit that referenced this pull request Sep 17, 2026
* Stop the compliance tests depending on the local timezone

`d.setDate(d.getDate() - 200)` keeps the local wall-clock time, so when a
daylight saving transition falls inside the window the result is 200 days
give or take an hour. getAgeDays floors, so 199.96 days became 199 and
the overdue count came out one short.

CI runs in UTC and never saw it; the test failed for anyone in a DST
timezone. Use the elapsed-milliseconds form the rest of the file already
uses.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Refresh yarn.lock

Transitive ranges moved upstream, so `mise update-all-lockfiles` no
longer reproduces the committed file. #102 stops this from recurring.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Steve Landey <steve.landey@atticus.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@irskep
irskep merged commit 63a836f into main Sep 17, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants