Skip to content

WIP Pnpm Exploration#298263

Draft
hediet wants to merge 2 commits intomainfrom
hediet/b/relaxed-shrew
Draft

WIP Pnpm Exploration#298263
hediet wants to merge 2 commits intomainfrom
hediet/b/relaxed-shrew

Conversation

@hediet
Copy link
Member

@hediet hediet commented Feb 27, 2026

No description provided.

Copilot AI review requested due to automatic review settings February 27, 2026 14:39
@hediet hediet self-assigned this Feb 27, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the VS Code repository from npm to pnpm workspaces for dependency management. The migration replaces npm's per-directory package-lock.json files with a single pnpm-lock.yaml, consolidates npm configuration from multiple .npmrc files into a unified setup, and updates all build/CI scripts to use pnpm commands.

Changes:

  • Migrated from npm to pnpm v10.28.2 with workspace configuration
  • Consolidated dependency configuration from distributed .npmrc files into a root-level electron.config.json
  • Updated all build scripts, CI/CD pipelines, and workflow files to use pnpm commands

Reviewed changes

Copilot reviewed 127 out of 184 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
package.json Added pnpm package manager specification and pnpm-specific configuration sections
pnpm-workspace.yaml Defines workspace structure listing all packages in the monorepo
electron.config.json New centralized config file for electron and Node.js version settings
.npmrc Simplified to basic pnpm compatibility settings
build/npm/preinstall.ts Removed npm-specific header installation logic, added pnpm validation
build/npm/postinstall.ts Simplified to only handle git configuration, removing multi-directory npm installs
build/lib/dependencies.ts Updated to use pnpm ls for dependency resolution
extensions/postinstall.mjs Skips TypeScript trimming with hoisted dependencies
Various .npmrc files Removed deprecated per-directory npm configuration files
Various tsconfig.json files Added trailing commas to typeRoots arrays for consistency
Build/CI scripts Updated npm commands to pnpm equivalents throughout
Files not reviewed (49)
  • .vscode/extensions/vscode-selfhost-import-aid/package-lock.json: Language not supported
  • .vscode/extensions/vscode-selfhost-test-provider/package-lock.json: Language not supported
  • build/npm/gyp/package-lock.json: Language not supported
  • build/vite/package-lock.json: Language not supported
  • extensions/configuration-editing/package-lock.json: Language not supported
  • extensions/css-language-features/package-lock.json: Language not supported
  • extensions/css-language-features/server/package-lock.json: Language not supported
  • extensions/debug-auto-launch/package-lock.json: Language not supported
  • extensions/debug-server-ready/package-lock.json: Language not supported
  • extensions/emmet/package-lock.json: Language not supported
  • extensions/extension-editing/package-lock.json: Language not supported
  • extensions/git-base/package-lock.json: Language not supported
  • extensions/git/package-lock.json: Language not supported
  • extensions/github-authentication/package-lock.json: Language not supported
  • extensions/github/package-lock.json: Language not supported
  • extensions/grunt/package-lock.json: Language not supported
  • extensions/gulp/package-lock.json: Language not supported
  • extensions/html-language-features/package-lock.json: Language not supported
  • extensions/html-language-features/server/package-lock.json: Language not supported
  • extensions/ipynb/package-lock.json: Language not supported
  • extensions/jake/package-lock.json: Language not supported
  • extensions/json-language-features/package-lock.json: Language not supported
  • extensions/json-language-features/server/package-lock.json: Language not supported
  • extensions/markdown-language-features/package-lock.json: Language not supported
  • extensions/markdown-math/package-lock.json: Language not supported
  • extensions/media-preview/package-lock.json: Language not supported
  • extensions/merge-conflict/package-lock.json: Language not supported
  • extensions/mermaid-chat-features/package-lock.json: Language not supported
  • extensions/microsoft-authentication/package-lock.json: Language not supported
  • extensions/notebook-renderers/package-lock.json: Language not supported
  • extensions/npm/package-lock.json: Language not supported
  • extensions/package-lock.json: Language not supported
  • extensions/php-language-features/package-lock.json: Language not supported
  • extensions/references-view/package-lock.json: Language not supported
  • extensions/search-result/package-lock.json: Language not supported
  • extensions/simple-browser/package-lock.json: Language not supported
  • extensions/terminal-suggest/package-lock.json: Language not supported
  • extensions/tunnel-forwarding/package-lock.json: Language not supported
  • extensions/typescript-language-features/package-lock.json: Language not supported
  • extensions/vscode-api-tests/package-lock.json: Language not supported
  • extensions/vscode-colorize-perf-tests/package-lock.json: Language not supported
  • extensions/vscode-colorize-tests/package-lock.json: Language not supported
  • extensions/vscode-test-resolver/package-lock.json: Language not supported
  • remote/package-lock.json: Language not supported
  • remote/web/package-lock.json: Language not supported
  • test/automation/package-lock.json: Language not supported
  • test/integration/browser/package-lock.json: Language not supported
  • test/mcp/package-lock.json: Language not supported
  • test/monaco/package-lock.json: Language not supported

"@vscode/test-electron": "^2.4.0",
"@vscode/test-web": "^0.0.76",
"@vscode/v8-heap-parser": "^0.1.0",
"@vscode/vsce": "3.6.1",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version for @vscode/vsce is unpinned (no caret ^) unlike other dependencies. This inconsistency may cause unexpected behavior during updates. Consider adding a caret prefix for consistency with other devDependencies, or document why this specific version must be exact.

See below for a potential fix:

    "@vscode/vsce": "^3.6.1",
    "@vscode/vscode-perf": "^0.0.19",
    "@webgpu/types": "^0.1.66",
    "ansi-colors": "^3.2.3",
"asar": "^3.0.3",

Copilot uses AI. Check for mistakes.
"debug": "^4.3.2",
"deemon": "^1.13.6",
"electron": "39.6.1",
"esbuild": "0.27.2",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The esbuild version is unpinned (no caret ^) which is inconsistent with most other dependencies. Consider adding a caret prefix for consistency unless this exact version is required for compatibility.

Suggested change
"esbuild": "0.27.2",
"esbuild": "^0.27.2",

Copilot uses AI. Check for mistakes.
"outDir": "./out",
"typeRoots": [
"./node_modules/@types"
"./node_modules/@types",
Copy link

Copilot AI Feb 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A trailing comma was added after the typeRoots entry. While this is valid JSON and improves consistency for future additions, ensure this change is intentional and doesn't conflict with any JSON parsing tools that might be strict about trailing commas in arrays.

Suggested change
"./node_modules/@types",
"./node_modules/@types"

Copilot uses AI. Check for mistakes.
Replace the multi-directory npm install cascade (55+ sequential npm ci
invocations via build/npm/postinstall.ts) with a single pnpm install
using pnpm workspaces in isolated (non-hoisted) mode.

Key changes:
- Add pnpm-workspace.yaml defining 51 workspace packages
- Add electron.config.json for Electron/Node version config
  (previously embedded in .npmrc target/disturl fields)
- Rewrite .npmrc for pnpm (remove Electron-specific build config)
- Remove 53 package-lock.json files (replaced by single pnpm-lock.yaml)
- Remove 42 per-directory .npmrc files (no longer needed)
- Gut build/npm/postinstall.ts (just git config, no cascade)
- Simplify build/npm/preinstall.ts (reject npm/yarn, no header install)
- Rewrite build/lib/dependencies.ts to use pnpm ls --json
- Update build/lib/extensions.ts to use PackageManager.Pnpm
- Add missing transitive deps as explicit devDependencies in root
  package.json (vinyl, through, gulp-vinyl-zip, etc.) — these were
  phantom-available via npm's flat node_modules but pnpm's strict
  isolation requires explicit declaration
- Update all CI pipelines (npm ci -> pnpm install --frozen-lockfile)
- Update build scripts (npm -> pnpm where needed)
- Add preserveSymlinks handling for tsgo compatibility

All native modules use N-API (ABI-stable), so the different
compilation targets (Electron vs Node.js) are handled via a separate
rebuild script rather than per-directory .npmrc config.

Validation:
- pnpm install: 2107 packages in ~42s (was 55+ sequential npm installs)
- TypeScript transpilation: 5215 files ✓
- Node.js unit tests: 7875 passing, 0 failures ✓
- Build script tests: 181 passing ✓
- Layers check: clean ✓
- Extension compilation: all pass ✓
- Production deps enumeration: working ✓
@hediet hediet force-pushed the hediet/b/relaxed-shrew branch from d6d2d21 to 76794b0 Compare February 27, 2026 15:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants