Package updates - #443
Merged
Merged
Package updates#443
Conversation
Yarn 4.18.0's PnP ESM loader works around a Node bug (broken fstat for
zip fds) by handing Node the source of CommonJS files inside .yarn/cache
zips instead of letting the CJS loader read them. Node then compiles
those modules through the ESM->CJS translator, where require.cache is
undefined. import-fresh reads require.cache[filePath], so it throws, and
@eslint/eslintrc's FlatCompat - which eslint.config.mjs uses for
compat.extends("plugin:@typescript-eslint/recommended") - can't load the
config at all:
TypeError: Cannot read config file: .../eslint-plugin/dist/configs/eslintrc/base.js
Error: Cannot read properties of undefined (reading '...base.js')
The workaround is gated on the Node version, and node-version: 22 now
resolves to 22.23.2, which matches the gate. That is why only build (22)
failed; 20.20.2 and 24.20.0 do not match it.
So this reverts only the Yarn bits - .yarnrc.yml, packageManager,
.yarn/releases, and the regenerated .pnp.loader.mjs and lockfile metadata
version - and keeps every dependency update.
Verified with yarn install, build, test, lint, prettier --check and
start --test midgame --quit on Node 20.20.2, 22.23.2 and 24.20.0. The
make test-npx-node-* targets need Docker and were not run here; they
exercise the packed tarball rather than the Yarn install.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TJz8D6RuBXQXwpDaMAtjtr
Closed
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.
Replaces #442, which bundled a Yarn upgrade that breaks
yarn linton Node 22. Same package updates, Yarn held at 4.13.0.Updates
@eslint/eslintrc@types/node@typescript-eslint/eslint-plugin@typescript-eslint/parsereslinttypescriptPlus the regenerated
yarn.lock/.pnp.cjs/ cache zips and the.yarn/sdksversion bumps.Why Yarn 4.18 is held back
Yarn 4.18.0's PnP ESM loader works around a Node bug (broken
fstatfor zip fds) by handing Node the source of CommonJS files inside.yarn/cachezips instead of letting the CJS loader read them. Node then compiles those modules through the ESM→CJS translator, whererequire.cacheis undefined.import-freshreadsrequire.cache[filePath], so it throws, and@eslint/eslintrc'sFlatCompat— whicheslint.config.mjsuses forcompat.extends("plugin:@typescript-eslint/recommended")— can't load the config at all:The workaround is gated on the Node version, and
node-version: 22now resolves to 22.23.2, which matches the gate. That's why onlybuild (22)failed on #442 — 20.20.2 and 24.20.0 don't match it. Toggling that one flag with everything else fixed flips the failure in both directions, and Yarn 4.13.0 with this exact lockfile passes on 22.23.2, so none of the package updates themselves are at fault.Reverted relative to #442:
.yarnrc.yml,packageManager,.yarn/releases/, and.pnp.loader.mjsare byte-identical todevagain. The lockfile's__metadata.versiongoes back to 8 and theresolvebuiltin-compat patch reverts to dev's hash, since the Yarn version writes both. The.yarnrc.ymladditions from #442 (approvedGitRepositories,npmMinimalAgeGate) went with it — 4.13 rejects them as unknown settings.Follow-up
This leaves the Node
fstatbug unpatched, so a future Node 22.x could trip on it. Whenever Yarn 4.18 is taken, rewritingeslint.config.mjsto usejs.configs.recommendedandtypescriptEslint.configs["flat/recommended"]instead of theFlatCompatbridge removes@eslint/eslintrcandimport-freshfrom the picture entirely, and resolves to a byte-identical rule set. Left out here to keep this PR to the package updates.Verification
yarn install,build,test,lint,prettier --check .andstart --test midgame --quitpass locally on Node 20.20.2, 22.23.2 and 24.20.0. CI is green on all three matrix jobs including themake test-npx-node-*Docker steps.🤖 Generated with Claude Code
https://claude.ai/code/session_01TJz8D6RuBXQXwpDaMAtjtr
Generated by Claude Code