Skip to content

vscode-extension: upgrade from Yarn 1 to Yarn 4 - #3049

Merged
mikeland73 merged 1 commit into
mainfrom
claude/vscode-yarn-4-upgrade-9fed82
Nov 9, 2026
Merged

mikeland73 merged 1 commit into
mainfrom
claude/vscode-yarn-4-upgrade-9fed82

Conversation

@mikeland73

Copy link
Copy Markdown
Collaborator

Fixes #3046.

Changes

  • package.json: add "packageManager": "yarn@4.18.1+sha512…" (set with corepack use).
  • New .yarnrc.yml with nodeLinker: node-modules, since vsce packaging needs a real node_modules.
  • Remove .yarnrc (--ignore-engines). Yarn 4 doesn't enforce dependency engines, so it has no equivalent and isn't needed.
  • Regenerate yarn.lock as a Yarn 4 lockfile. Yarn's migration kept the existing resolutions.
  • Gitignore .yarn/* (except patches/plugins/releases, none committed today) and *.vsix. Add .yarnrc.yml and .yarn/** to .vscodeignore.
  • vscode-ext-release.yaml: use corepack enable and yarn install --immutable. Install @vscode/vsce instead of the deprecated vsce package.

Packaging with Yarn 4

As the issue expected, vsce package --yarn fails with Yarn 4 (Command failed: yarn list --prod --json). Leaving out --yarn doesn't help either, because vsce sees yarn.lock and switches to yarn anyway.

--no-dependencies isn't an option. The extension has a runtime dependency (which, imported in src/openinvscode.ts), so that flag would ship a broken extension.

The workflow now runs vsce package --no-yarn, which uses npm list over the node_modules tree 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 publisher sed, as before.

Testing (local, Node 24, Yarn 4.18.1, vsce 4.1.0)

  • yarn install --immutable from a clean node_modules: passes
  • yarn run compile, yarn run lint: pass
  • vsce package --no-yarn: produces a 33-file VSIX that includes node_modules/which and its nested isexe
  • Packaging twice in a row, like the workflow does: the second VSIX doesn't include the first

Not tested: the publish steps themselves (they need marketplace tokens).

🤖 Generated with Claude Code

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>
@claude

claude Bot commented Nov 9, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@greptile-apps

greptile-apps Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable defects were found.

Summary

Moves the VSCode extension from Yarn 1 to pinned Yarn 4.

  • The VS Code release job builds and publishes packages with Yarn 4.

No actionable issues were found. Review checks were source-only; installation, packaging, and publishing were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A["Corepack selects Yarn 4"] --> B["Install with node-modules linker"]
  B --> C["Build devbox-vs.vsix with --no-yarn"]
  C --> D["Publish archive to VS Marketplace"]
  D --> E["Change publisher to Jetify"]
  E --> F["Build devbox-ovsx.vsix with --no-yarn"]
  F --> G["Publish archive to Open VSX"]
Loading

Reviews (1) · Last reviewed commit: "vscode-extension: upgrade from Yarn 1 to..." · Reviewed by Greptile

@mikeland73
mikeland73 merged commit 1378e53 into main Nov 9, 2026
31 checks passed
@mikeland73
mikeland73 deleted the claude/vscode-yarn-4-upgrade-9fed82 branch November 9, 2026 23:26
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.

vscode-extension: upgrade from Yarn 1 (classic) to Yarn 4

1 participant