Skip to content

chore: migrate package management from yarn to pnpm - #14

Open
JeevanMahesha wants to merge 1 commit into
openng-org:mainfrom
JeevanMahesha:chore/migrate-yarn-to-pnpm
Open

chore: migrate package management from yarn to pnpm#14
JeevanMahesha wants to merge 1 commit into
openng-org:mainfrom
JeevanMahesha:chore/migrate-yarn-to-pnpm

Conversation

@JeevanMahesha

Copy link
Copy Markdown

Description

Migrates the root workspace off Yarn and onto pnpm for consistency with the docs/ subproject, which was already on pnpm. Specifically:

  • Replaced yarn.lock with pnpm-lock.yaml (via pnpm import to preserve resolved versions)
  • Added a root pnpm-workspace.yaml (packages: - 'projects/*'), replacing the workspaces field in package.json which pnpm doesn't read
  • Added onlyBuiltDependencies to pnpm-workspace.yaml so native postinstall scripts (esbuild, @parcel/watcher, lmdb, etc.) aren't silently skipped
  • Updated package.json: added packageManager/pnpm engine fields, swapped internal yarn ... script calls for pnpm ...
  • Added .npmrc with shamefully-hoist=truerequired, not cosmetic: without it, the built dist/spectator/jest and dist/spectator/vitest entry points fail to resolve @testing-library/dom and @jest/globals types, since pnpm's strict linking doesn't hoist transitive deps to root node_modules the way Yarn classic did
  • Updated .husky/commit-msg and .husky/pre-commit to call pnpm
  • Updated .github/workflows/ci.yml: added pnpm/action-setup, switched the cache key to pnpm-lock.yaml, swapped all yarn run commands for pnpm
  • Updated README.md install instructions and .gitignore

docs/ is untouched — it already had its own pnpm-lock.yaml/pnpm-workspace.yaml and remains a fully independent pnpm project; deploy-docs.yml needed no changes.

Related issues

Fixes #

Type of change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that changes the public API)
  • Documentation only
  • Refactor, test, or chore (no user-facing change)

Breaking changes

None — public API and published package are unaffected. Local contributors must have pnpm installed (corepack enable or npm i -g pnpm) and should delete their old node_modules before running pnpm install.

Test plan

  • pnpm build — full ng-packagr build across all entry points (@openng/spectator, internals, jest, vitest), schematics build/copy, docs copy; verified dist/spectator contains expected output
  • pnpm test:ci — Karma/Jasmine (326/326), Jest (242/242), Vitest (212/212) all passing
  • pnpm lint — 0 errors (pre-existing unrelated warnings only)
  • pnpm test:types — passes against built dist output
  • Verified .husky/pre-commit and .husky/commit-msg execute correctly under pnpm
  • Confirmed docs/ subproject is fully untouched (git diff --stat -- docs empty)

Checklist

  • Issue discussed or bug clearly described (link issue when applicable)
  • Tests added or updated for behavioral changes
  • Documentation updated (README, JSDoc, migration notes as needed)
  • Public API changes documented; breaking changes called out
  • CHANGELOG updated (if the repository maintains one and the change is user-facing)
  • Commit messages follow Conventional Commits
  • I agree to follow the OpenNG Foundation Code of Conduct

Additional context

Contributors will need to switch from yarn to pnpm locally (pnpm@10.33.1, pinned via packageManager). No dependency versions changed — this is a tooling-only migration.

Move the root workspace off yarn: replace yarn.lock with pnpm-lock.yaml,
add pnpm-workspace.yaml, update package.json (packageManager/engines and
script calls), husky hooks, and CI to use pnpm. Add shamefully-hoist to
.npmrc to fix Angular/ng-packagr module resolution under pnpm's strict
linking. docs/ subproject is untouched — it was already on pnpm.
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.

1 participant