[PoC] Migrate package manager from npm to pnpm#320100
Closed
ulugbekna wants to merge 1 commit into
Closed
Conversation
Migrate the VS Code monorepo from npm to pnpm. - Add pnpm-workspace.yaml with explicit members (mirroring build/npm/dirs.ts) plus an onlyBuiltDependencies allowlist for native/binary packages. - Root package.json: set packageManager=pnpm@10.32.1, convert overrides to pnpm.overrides (pnpm selector syntax), and convert all scripts npm->pnpm. - Keep build/, remote/, remote/web as standalone installs (own .npmrc + lockfile, node runtime headers) outside the Electron-runtime workspace; give them their own pnpm.overrides + pnpm.onlyBuiltDependencies so native modules still build under --ignore-workspace. - .npmrc files: node-linker=hoisted (packaging assumes a flat node_modules), pnpm peer settings, drop legacy-peer-deps. - Rewrite install orchestration (preinstall.ts pnpm guard, postinstall.ts standalone-only sub-installs, dirs.ts standaloneDirs). - Update hashing (installStateHash.ts, computeNodeModulesCacheKey.ts) and production-dependency listing (dependencies.ts) for pnpm; setup-npm-registry.ts now writes registry= into .npmrc instead of rewriting lockfiles. - Update GitHub Actions to corepack enable + pnpm install --frozen-lockfile (standalone build/ installs use --ignore-workspace). - Remove obsolete package-lock.json files (pnpm-lock.yaml to be generated and committed by CI); ignore pnpm-debug.log*. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
e4e941d to
c45749d
Compare
Contributor
Author
|
Superseded by #320104 (branch pushed to upstream microsoft/vscode instead of a fork, as a draft). |
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.
Summary
Migrates the VS Code monorepo from npm to pnpm (
pnpm@10.32.1via corepack).What changed
Workspace & manifests
pnpm-workspace.yamlwith explicit members (mirroringbuild/npm/dirs.ts, not broad globs so manifest-only theme extensions and sim fixtures stay out) + anonlyBuiltDependenciesallowlist for native/binary packages.package.json:packageManager: pnpm@10.32.1,overrides→pnpm.overrides(pnpm selector syntax), all scripts convertednpm→pnpm.build/,remote/,remote/webstay standalone (their own.npmrcwith Node-runtime headers + own lockfile) outside the Electron-runtime workspace, so native modules build against the correct headers. Each gets its ownpnpm.overrides+pnpm.onlyBuiltDependenciesso lifecycle scripts still run under--ignore-workspace..npmrcfilesnode-linker=hoisted(packaging assumes a flatnode_modules), pnpm peer settings; droplegacy-peer-deps.Install orchestration & build scripts
build/npm/preinstall.ts(pnpm guard),postinstall.ts(installs only the standalone dirs; root install is driven bypnpm install, no recursion),dirs.ts(standaloneDirs).installStateHash.ts+build/azure-pipelines/common/computeNodeModulesCacheKey.tsto hash pnpm lockfiles/workspace.build/lib/dependencies.tsusespnpm list --prod ... --parseable.build/setup-npm-registry.tsnow writesregistry=into.npmrc(same CLI signature → Azure callers unaffected).CI
corepack enable+pnpm install --frozen-lockfile(standalonebuild/installs use--ignore-workspace).Lockfiles
package-lock.jsonfiles; ignorepnpm-debug.log*. Thepnpm-lock.yamlfiles must be generated and committed by CI.Verification done locally
buildtype-check clean on all changed files.pnpm-workspace.yamlparses; all 51 members resolve to real dirs.Follow-ups (need CI / too heavy to verify in-session)
pnpm-lock.yaml(root) + standalone locks viapnpm installin CI.build/azure-pipelines/**/product-build-*-node-modules.yml,mixin-npm.ts,dependencies-check.yml— npm → corepack/pnpm + reworknode_modulestarball caching toward the pnpm store /pnpm fetch..build/distro) coordination for the standalone installs.