Repository navigation
vscode-extension: upgrade from Yarn 1 to Yarn 4 - #3049
Merged
Merged
Conversation
Pin yarn@4.18.1 via packageManager (Corepack), use nodeLinker: node-modules, drop the Yarn 1 .yarnrc, and regenerate yarn.lock. vsce/ovsx --yarn run `yarn list`, which Yarn 4 doesn't have, so the release workflow now packages with `vsce package --no-yarn` and publishes the built .vsix to both marketplaces. Fixes #3046 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
[Medium impact] The PR appears safe to merge; no actionable defects were found.
|
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.
Fixes #3046.
Changes
package.json: add"packageManager": "yarn@4.18.1+sha512…"(set withcorepack use)..yarnrc.ymlwithnodeLinker: node-modules, since vsce packaging needs a realnode_modules..yarnrc(--ignore-engines). Yarn 4 doesn't enforce dependencyengines, so it has no equivalent and isn't needed.yarn.lockas a Yarn 4 lockfile. Yarn's migration kept the existing resolutions..yarn/*(exceptpatches/plugins/releases, none committed today) and*.vsix. Add.yarnrc.ymland.yarn/**to.vscodeignore.vscode-ext-release.yaml: usecorepack enableandyarn install --immutable. Install@vscode/vsceinstead of the deprecatedvscepackage.Packaging with Yarn 4
As the issue expected,
vsce package --yarnfails with Yarn 4 (Command failed: yarn list --prod --json). Leaving out--yarndoesn't help either, because vsce seesyarn.lockand switches to yarn anyway.--no-dependenciesisn't an option. The extension has a runtime dependency (which, imported insrc/openinvscode.ts), so that flag would ship a broken extension.The workflow now runs
vsce package --no-yarn, which usesnpm listover thenode_modulestree that Yarn created. It then publishes the built.vsix(vsce publish --packagePath …,ovsx publish <file>.vsix). For Open VSX, the package is rebuilt after the publishersed, as before.Testing (local, Node 24, Yarn 4.18.1, vsce 4.1.0)
yarn install --immutablefrom a cleannode_modules: passesyarn run compile,yarn run lint: passvsce package --no-yarn: produces a 33-file VSIX that includesnode_modules/whichand its nestedisexeNot tested: the publish steps themselves (they need marketplace tokens).
🤖 Generated with Claude Code