Skip to content

Conversation

@ntotten
Copy link
Member

@ntotten ntotten commented Nov 27, 2025

Switches to pnpm instead of yarn

Copilot AI review requested due to automatic review settings November 27, 2025 17:03
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 pull request migrates the prettier-vscode project from Yarn to pnpm as the primary package manager. The migration is comprehensive and includes:

  • Switching the main project and most test fixtures from Yarn to pnpm
  • Updating all CI/CD workflows to use pnpm
  • Adding extensive new documentation (troubleshooting guide, issue writing guide, publishing guide, custom file extensions guide)
  • Modernizing GitHub workflows with improved automation, issue triage, and stale issue handling
  • Updating development environment configurations (devcontainer, husky hooks)
  • Maintaining backward compatibility by keeping specific test fixtures using their designated package managers (yarn for test-fixtures/plugins, npm for v3-plugins and plugin-tailwindcss)

Reviewed changes

Copilot reviewed 50 out of 76 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
package.json Updated scripts from yarn to pnpm, added packageManager field, added postversion script
test-fixtures/*/pnpm-lock.yaml Added pnpm lockfiles for all migrated test fixtures
test-fixtures/*/yarn.lock Removed yarn lockfiles from fixtures migrating to pnpm
.github/workflows/*.yaml Updated CI workflows to use pnpm, modernized GitHub Actions versions, improved release automation
.github/workflows/stale.yaml Replaced with improved stale issue handling with better messaging
.github/workflows/issue-*.yaml Added comprehensive issue triage and assessment workflows
docs/*.md Added troubleshooting, issue writing, publishing, and custom file extensions guides
README.md Updated for pnpm, added extension migration notice, improved troubleshooting section
.devcontainer/* Updated Node version and Dockerfile, but incorrectly kept yarn install
.husky/pre-commit Updated to use pnpm lint-staged
scripts/version.js Added prerelease version handling to skip changelog updates
.npmrc Added preid=preview for prerelease versioning
CLAUDE.md Updated all commands from yarn to pnpm
package.nls.*.json Added missing translation entries for newer Prettier options
Files not reviewed (12)
  • test-fixtures/explicit-dep/implicit-dep/pnpm-lock.yaml: Language not supported
  • test-fixtures/explicit-dep/pnpm-lock.yaml: Language not supported
  • test-fixtures/module-dep/pnpm-lock.yaml: Language not supported
  • test-fixtures/module-plugin-dep/pnpm-lock.yaml: Language not supported
  • test-fixtures/module-plugin/pnpm-lock.yaml: Language not supported
  • test-fixtures/module/pnpm-lock.yaml: Language not supported
  • test-fixtures/outdated/pnpm-lock.yaml: Language not supported
  • test-fixtures/plugins-pnpm/pnpm-lock.yaml: Language not supported
  • test-fixtures/specific-version/pnpm-lock.yaml: Language not supported
  • test-fixtures/v2-explicit/pnpm-lock.yaml: Language not supported
  • test-fixtures/v3-plugin-override/pnpm-lock.yaml: Language not supported
  • test-fixtures/v3/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

ntotten and others added 4 commits November 27, 2025 12:11
- Fix web extension test by using test-compile instead of just webpack
  (TypeScript needs to be compiled before running web tests)
- Add findPkgThroughTransitiveDeps to ModuleResolver to support pnpm's
  strict node_modules structure (non-hoisted dependencies)
- Pin prettier version in module-dep test fixture to 2.0.2 for test
  consistency

The new module resolution logic:
1. First checks for explicit prettier dependency in package.json
2. Then checks transitive dependencies by looking at installed packages
   in node_modules and resolving prettier from within each dependency
3. Falls back to looking for node_modules/prettier directly

This ensures the extension works correctly with npm, yarn, and pnpm
regardless of their dependency hoisting behavior.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ntotten ntotten force-pushed the pnpm branch 2 times, most recently from 24e3f5b to 126764a Compare November 28, 2025 13:59
The web extension tests use @vscode/test-web which requires Playwright
to run browser-based tests. Add explicit Playwright chromium installation
step before running web tests.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ntotten ntotten changed the title Pnpm Switch from yarn to pnpm Nov 28, 2025
ntotten and others added 2 commits November 28, 2025 09:11
Replace the extremely long pretest command with a cross-platform Node.js
script that:
- Automatically finds all test fixture directories
- Reads the packageManager field from each package.json
- Runs the appropriate install command (yarn, npm, or pnpm)
- Handles nested fixtures (like explicit-dep/implicit-dep)

Also update PR template to reference pnpm instead of yarn.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Configure pnpm to only install packages that are at least 7 days old.
This matches our dependabot configuration (default-days: 7) and provides
a stability buffer against newly published compromised packages.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
ntotten and others added 6 commits November 28, 2025 09:31
- Add packages exclusion for test-fixtures in pnpm-workspace.yaml
- Remove --ignore-workspace flag from install script (no longer needed)
- Add pnpm-lock.yaml to gitignore for test fixtures (they're generated)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
The packages exclusion in pnpm-workspace.yaml doesn't prevent pnpm
from treating fixtures as part of the workspace - it just excludes
them from being workspace packages. Without --ignore-workspace, pnpm
runs the root's lifecycle scripts instead of installing fixture deps.

Keep autoInstallPeers: true to match pnpm 10 defaults and prevent
lockfile config mismatch errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
@ntotten ntotten merged commit 2a374ee into main Nov 28, 2025
19 checks passed
@ntotten ntotten deleted the pnpm branch November 28, 2025 15:09
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