Skip to content

Migrate dependency management to pnpm - #5085

Open
andrewiggins wants to merge 16 commits into
mainfrom
upgrade-to-pnpm
Open

Migrate dependency management to pnpm#5085
andrewiggins wants to merge 16 commits into
mainfrom
upgrade-to-pnpm

Conversation

@andrewiggins

@andrewiggins andrewiggins commented May 12, 2026

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

Ran CI with a dummy src change to verify all GH Actions passed

Note: This PR was partially generated using GPT 5.5

@coveralls

coveralls commented Jun 2, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 98.491%. remained the same — upgrade-to-pnpm into main

@andrewiggins
andrewiggins marked this pull request as ready for review June 2, 2026 19:44
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

📊 Tachometer Benchmark Results

Summary

duration

  • create10k: unsure 🔍 -1% - +0% (-9.17ms - +1.23ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +1% (-0.02ms - +0.08ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -2% - +1% (-1.37ms - +0.52ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -4% - +4% (-0.67ms - +0.59ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -1% - +2% (-0.49ms - +1.13ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -4% - +5% (-0.08ms - +0.10ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -2% - +2% (-0.66ms - +0.55ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -4% - +2% (-1.35ms - +0.58ms)
    preact-local vs preact-main

usedJSHeapSize

  • create10k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • filter-list: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • hydrate1k: unsure 🔍 -4% - +1% (-0.23ms - +0.04ms)
    preact-local vs preact-main
  • many-updates: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • replace1k: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • text-update: unsure 🔍 -5% - +1% (-0.05ms - +0.01ms)
    preact-local vs preact-main
  • todo: unsure 🔍 -0% - +0% (-0.00ms - +0.00ms)
    preact-local vs preact-main
  • update10th1k: unsure 🔍 -1% - +0% (-0.02ms - +0.00ms)
    preact-local vs preact-main

Results

create10k

duration

VersionAvg timevs preact-localvs preact-main
preact-local826.93ms - 834.00ms-unsure 🔍
-1% - +0%
-9.17ms - +1.23ms
preact-main830.62ms - 838.25msunsure 🔍
-0% - +1%
-1.23ms - +9.17ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local19.07ms - 19.07ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main19.07ms - 19.07msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
filter-list

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.52ms - 16.60ms-unsure 🔍
-0% - +1%
-0.02ms - +0.08ms
preact-main16.50ms - 16.57msunsure 🔍
-0% - +0%
-0.08ms - +0.02ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.55ms - 1.56ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.55ms - 1.56msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
hydrate1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local57.00ms - 58.27ms-unsure 🔍
-2% - +1%
-1.37ms - +0.52ms
preact-main57.36ms - 58.76msunsure 🔍
-1% - +2%
-0.52ms - +1.37ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local4.97ms - 5.09ms-unsure 🔍
-4% - +1%
-0.23ms - +0.04ms
preact-main5.00ms - 5.24msunsure 🔍
-1% - +5%
-0.04ms - +0.23ms
-
many-updates

duration

VersionAvg timevs preact-localvs preact-main
preact-local16.27ms - 17.06ms-unsure 🔍
-4% - +4%
-0.67ms - +0.59ms
preact-main16.22ms - 17.19msunsure 🔍
-4% - +4%
-0.59ms - +0.67ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.74ms - 3.74ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.74ms - 3.74msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
replace1k
  • Browser: chrome-headless
  • Sample size: 100
  • Built by: CI #5599
  • Commit: c4259bb

duration

VersionAvg timevs preact-localvs preact-main
preact-local57.97ms - 59.14ms-unsure 🔍
-1% - +2%
-0.49ms - +1.13ms
preact-main57.67ms - 58.80msunsure 🔍
-2% - +1%
-1.13ms - +0.49ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local3.01ms - 3.01ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main3.01ms - 3.01msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-

run-warmup-0

VersionAvg timevs preact-localvs preact-main
preact-local27.25ms - 27.99ms-unsure 🔍
-3% - +0%
-0.96ms - +0.08ms
preact-main27.69ms - 28.42msunsure 🔍
-0% - +3%
-0.08ms - +0.96ms
-

run-warmup-1

VersionAvg timevs preact-localvs preact-main
preact-local32.55ms - 33.95ms-unsure 🔍
-3% - +3%
-0.90ms - +1.04ms
preact-main32.50ms - 33.85msunsure 🔍
-3% - +3%
-1.04ms - +0.90ms
-

run-warmup-2

VersionAvg timevs preact-localvs preact-main
preact-local30.40ms - 31.61ms-unsure 🔍
-3% - +2%
-1.00ms - +0.68ms
preact-main30.58ms - 31.75msunsure 🔍
-2% - +3%
-0.68ms - +1.00ms
-

run-warmup-3

VersionAvg timevs preact-localvs preact-main
preact-local26.25ms - 26.62ms-unsure 🔍
-1% - +1%
-0.36ms - +0.38ms
preact-main26.10ms - 26.75msunsure 🔍
-1% - +1%
-0.38ms - +0.36ms
-

run-warmup-4

VersionAvg timevs preact-localvs preact-main
preact-local23.93ms - 25.49ms-unsure 🔍
-6% - +3%
-1.42ms - +0.87ms
preact-main24.14ms - 25.82msunsure 🔍
-4% - +6%
-0.87ms - +1.42ms
-

run-final

VersionAvg timevs preact-localvs preact-main
preact-local21.21ms - 21.56ms-unsure 🔍
-0% - +2%
-0.06ms - +0.43ms
preact-main21.03ms - 21.37msunsure 🔍
-2% - +0%
-0.43ms - +0.06ms
-
text-update
  • Browser: chrome-headless
  • Sample size: 220
  • Built by: CI #5599
  • Commit: c4259bb

duration

VersionAvg timevs preact-localvs preact-main
preact-local2.03ms - 2.15ms-unsure 🔍
-4% - +5%
-0.08ms - +0.10ms
preact-main2.01ms - 2.15msunsure 🔍
-5% - +4%
-0.10ms - +0.08ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.01ms - 1.05ms-unsure 🔍
-5% - +1%
-0.05ms - +0.01ms
preact-main1.02ms - 1.07msunsure 🔍
-1% - +5%
-0.01ms - +0.05ms
-
todo

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.28ms - 31.86ms-unsure 🔍
-2% - +2%
-0.66ms - +0.55ms
preact-main31.10ms - 32.15msunsure 🔍
-2% - +2%
-0.55ms - +0.66ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local1.26ms - 1.26ms-unsure 🔍
-0% - +0%
-0.00ms - +0.00ms
preact-main1.26ms - 1.26msunsure 🔍
-0% - +0%
-0.00ms - +0.00ms
-
update10th1k

duration

VersionAvg timevs preact-localvs preact-main
preact-local31.80ms - 33.23ms-unsure 🔍
-4% - +2%
-1.35ms - +0.58ms
preact-main32.25ms - 33.55msunsure 🔍
-2% - +4%
-0.58ms - +1.35ms
-

usedJSHeapSize

VersionAvg timevs preact-localvs preact-main
preact-local2.96ms - 2.97ms-unsure 🔍
-1% - +0%
-0.02ms - +0.00ms
preact-main2.97ms - 2.98msunsure 🔍
-0% - +1%
-0.00ms - +0.02ms
-

tachometer-reporter-action v2 for CI

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

Size Change: 0 B

Total Size: 48.2 kB

ℹ️ View Unchanged
Filename Size
compat/dist/compat.js 3.97 kB
compat/dist/compat.mjs 3.91 kB
compat/dist/compat.umd.js 4.04 kB
debug/dist/debug.js 3.91 kB
debug/dist/debug.mjs 3.91 kB
debug/dist/debug.umd.js 3.99 kB
devtools/dist/devtools.js 263 B
devtools/dist/devtools.mjs 273 B
devtools/dist/devtools.umd.js 348 B
dist/preact.js 4.87 kB
dist/preact.mjs 4.88 kB
dist/preact.umd.js 4.93 kB
hooks/dist/hooks.js 1.52 kB
hooks/dist/hooks.mjs 1.55 kB
hooks/dist/hooks.umd.js 1.59 kB
jsx-runtime/dist/jsxRuntime.js 892 B
jsx-runtime/dist/jsxRuntime.mjs 861 B
jsx-runtime/dist/jsxRuntime.umd.js 966 B
test-utils/dist/testUtils.js 473 B
test-utils/dist/testUtils.mjs 473 B
test-utils/dist/testUtils.umd.js 555 B

compressed-size-action

Comment thread demo/package.json
Comment thread .github/workflows/run-bench.yml Outdated
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.
# Conflicts:
#	.github/workflows/build-test.yml
#	.github/workflows/run-bench.yml
#	.github/workflows/size.yml
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.

4 participants