Conversation
VerteDinde
approved these changes
Oct 10, 2025
This reverts commit 3588cc9.
8375355 to
b0e73e2
Compare
erickzhao
commented
Oct 11, 2025
Comment on lines
+148
to
+154
| } else if ( | ||
| pm.executable === 'yarn' && | ||
| typeof pm.version === 'string' && | ||
| semver.gte(pm.version, '2.0.0') | ||
| ) { | ||
| d('Detected Yarn 2+, adding packageManager field to package.json'); | ||
| packageJSON.packageManager = `yarn@${pm.version}`; |
Member
Author
There was a problem hiding this comment.
Technically a semver patch or minor change
Member
There was a problem hiding this comment.
Feels like a fix tbh if it broke before
MarshallOfSound
approved these changes
Oct 11, 2025
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.
Here are a few follow-up items after #4009.
Building in
prepackAs an alternative to #4027, we add the
buildscript to theprepacklifecycle script.We originally had this under
preversion, but that lifecycle script doesn't run anymore after the Yarn 4 upgrade.Fixing
build:watchThe Yarn 4 migration removed the old
postbuildscript and appended its command to the end ofbuild.build:watchadds the--watchflag totscto enable watch mode for the TypeScript build.We can't just call
yarn build --watchanymore due to the added script frompostbuildso nowbuild:watchcalls the fulltscinvocation.Lockfile fixture hardening
By default, Yarn 4 runs any install in CI with the
--immutableflag. This causes problems in our e2e test suite, since we try toyarn installandyarn packagewithin our tests.The initial Yarn 4 upgrade PR got around this issue by generating lockfile test fixtures for these e2e tests and loading them into the test directory on runtime. However, this trick requires updating these fixtures every time a new release goes out. I tried to do this with the provided update script, but it failed on my machine because it kept generating a Yarn Classic lockfile.
This is because Corepack has global versions of each package manager if the repo doesn't use Corepack. This PR removes the ambiguity by initializing projects with the Yarn 2+ user agent with the correct
packageManagerentry in package.json.Note
There are probably a few ways to do this, but being explicit about the package manager version is helpful to have the script run independently of the user's global corepack status.
This also removes some complexity with adding a manual resolution in the same e2e tests (no longer needed due to
--immutableinstalls).COREPACK_ENABLE_STRICT=0We were already using
COREPACK_ENABLE_STRICT=0since the Forge repo uses Yarn but we have some tests that run pnpm.We already had some
COREPACK_ENABLE_STRICTworkarounds in the tests but this PR disablesCOREPACK_ENABLE_STRICTfor the entirety of the pnpm tests instead of restoring the original value at times.