Skip to content

Migrate dependency management to pnpm#5085

Draft
andrewiggins wants to merge 1 commit into
mainfrom
upgrade-to-pnpm
Draft

Migrate dependency management to pnpm#5085
andrewiggins wants to merge 1 commit into
mainfrom
upgrade-to-pnpm

Conversation

@andrewiggins
Copy link
Copy Markdown
Member

Summary

  • migrate root, subpackages, test/ts, and demo to a single pnpm workspace and committed pnpm-lock.yaml
  • replace npm CI installs with pnpm/action-setup, pnpm cache, and frozen installs
  • enable pnpm supply-chain hardening with minimum release age, no-downgrade trust checks, blocked exotic transitive dependencies, strict build-script approval, and explicit allowBuilds policy
  • keep npm pack/publish release behavior intact while updating local docs and Husky to use pnpm

Security decisions

  • pin packageManager to pnpm@11.1.0 and move Volta Node to 24.15.0 because pnpm 11 requires Node >=22.13
  • use version-specific trustPolicyExclude entries instead of a broad trust bypass
  • allow only esbuild install-time builds; explicitly deny @parcel/watcher, fsevents, and styled-components builds
  • add explicit demo sass-embedded dependency exposed by pnpm isolation instead of weakening hoisting
  • declare nano-staged locally so the pre-commit hook does not rely on npx fetching tools

Verification

  • pnpm install --frozen-lockfile
  • pnpm ignored-builds
  • pnpm run build
  • pnpm run lint
  • pnpm run test:unit
  • pnpm --dir demo run build
  • npm pack --ignore-scripts --dry-run --json

Note: pnpm run format:check still fails on existing repo-wide formatting and CRLF diagnostics unrelated to this migration.

Replace the root and demo npm lockfiles with a single committed pnpm-lock.yaml and add pnpm-workspace.yaml covering the root package, subpackages, test/ts, and demo. Pin packageManager to pnpm@11.1.0 and move the Volta Node pin to 24.15.0 so the repository runs on a Node version supported by pnpm 11.

Enable pnpm supply-chain hardening in workspace config: strict minimum release age, no-downgrade trust policy, blocked exotic transitive dependencies, strict dependency builds, engine strictness, and an explicit install-script allowBuilds policy. Keep trust-policy exceptions narrow and version-specific for chokidar@4.0.3, preact-render-to-string@6.5.0, reselect@5.1.1, and semver@6.3.1 instead of using a broad age-based bypass. Allow only esbuild build scripts and explicitly deny optional/native watcher or compatibility scripts for @parcel/watcher, fsevents, and styled-components.

Update CI and developer workflows for pnpm: use pnpm/action-setup@v6, pnpm cache keys, frozen installs, pnpm script invocations, pnpm exec for the Husky hook, and pnpm contributor docs. Declare nano-staged as a dev dependency because pnpm exec requires hook tools to be local instead of relying on npx to fetch them. Keep npm pack and npm publish behavior intact for the package release path.

Tighten dependency declarations exposed by pnpm's isolated linker: add demo's explicit sass-embedded dependency for SCSS builds, pin Vite resolutions that were previously coming from npm lockfiles, pin the direct undici dev dependency, and update @actions/github and @actions/glob dev tooling to current versions to avoid older trust-downgrade transitive resolution.

Verification run: pnpm install --frozen-lockfile; pnpm ignored-builds; pnpm run build; pnpm run lint; pnpm run test:unit; pnpm --dir demo run build; npm pack --ignore-scripts --dry-run --json. Also ran pnpm run format:check, which still fails on existing repository-wide formatting and CRLF diagnostics unrelated to this migration.
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