Skip to content

build: replace Bun with pnpm as the package manager - #301

Merged
adelrodriguez merged 10 commits into
mainfrom
build/pnpm-commands
Nov 12, 2026
Merged

adelrodriguez merged 10 commits into
mainfrom
build/pnpm-commands

Conversation

@adelrodriguez

@adelrodriguez adelrodriguez commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

After #296, Bun was only the template's package manager. This PR replaces it with pnpm 12.9.0. It moves the package manager config, replaces the lockfile without changing resolved versions, and switches every script, template command, template recipe, CI workflow, and Vercel install command to pnpm. It also regenerates the iOS project, which contained Bun's node_modules/.bun paths. #300 held the config part alone, but it couldn't build without the rest, so this PR carries both.

Closes #278

Package manager config

Bun pnpm
workspaces in package.json packages in pnpm-workspace.yaml
overrides in package.json overrides
patchedDependencies in package.json patchedDependencies
trustedDependencies in package.json allowBuilds
exact = true in bunfig.toml saveExact: true
linker = "isolated" in bunfig.toml pnpm's default nodeLinker
env = false in bunfig.toml Removed. pnpm and Node don't load .env files.
bun.lock pnpm-lock.yaml
bun-create in package.json Removed. #288 replaces it with an initializer package.
  • Lockfile. A fresh pnpm install resolved @effect/platform-node-shared to 4.1.4. That version needs effect@^4.1.4, but [email protected] pins [email protected], so adamantite check crashed. To keep Bun's resolution, I ran bun install --yarn to write a Yarn v1 lockfile and then ran pnpm import on it. pnpm import doesn't read bun.lock directly.
  • Build scripts. pnpm blocks dependency build scripts until a project approves them. allowBuilds allows electron-winstaller, whose script copies the 7-Zip binary that MakerSquirrel uses. It denies esbuild, msgpackr-extract, and protobufjs, whose scripts only verify prebuilt binaries or print a warning. Bun's entries for electron, @tailwindcss/oxide, and @parcel/watcher are gone. Those packages no longer have install scripts or aren't in the dependency tree.
  • Release age. minimumReleaseAgeExclude lets @sanely/* and adamantite, the maintainer's own packages, skip pnpm's one-day wait for new releases.
  • Electron Forge. electron-forge package rejects pnpm unless node-linker is hoisted or a hoist pattern is set. hoistPattern: ["*"] repeats pnpm's default, so the install layout doesn't change. A comment links electron/forge#4188. The packaged app.asar contains 13 entries and no node_modules, because the Vite plugin bundles the app.

Commands

  • Workspace scripts. Every bump:deps script now runs pnpm update --interactive. Codegen runs pnpm run "/^codegen:/", which starts the matched scripts concurrently, as bun run --parallel did. apps/docs and apps/web keep their order with pnpm run codegen:i18n && pnpm run codegen:types. @v1/auth and the backend schema generator use pnpm dlx.
  • Template commands. Setup, add, remove, diff, and doctor run and name pnpm commands. Setup and doctor no longer handle bun-create, and remove skips pnpm-lock.yaml when it lists leftover references.
  • Template recipes. The recipes install with pnpm add and pnpm install, and they drop --exact because saveExact covers it. The Sentry recipe passes --allow-build=@sentry/cli instead of writing trustedDependencies. The PostHog recipe passes --allow-build=!core-js when it adds posthog-js, because pnpm fails an install with an unreviewed build script, and core-js's script only prints a funding message.
  • remote-cache recipe. The recipe finds Turbo behind pnpm run, the pnpm <script> shorthand, pnpm exec, and pnpm dlx. It skips flags and their values, so pnpm --filter app exec turbo run build counts too. It no longer counts commands such as turbo-ignore as Turbo, which the old Bun pattern also matched.
  • CI. pnpm/[email protected] replaces the setup-node, setup-bun, cache, and install steps in each job. It reads .node-version and packageManager, caches the pnpm store, and runs a frozen install.
  • Vercel. The Vercel projects override the install command with bun install --frozen-lockfile && bun run codegen in their settings. apps/web/vercel.json and apps/docs/vercel.json now set installCommand to the pnpm equivalent, which takes precedence. They also drop bunVersion, so the functions run on Node.
  • iOS project. expo prebuild under pnpm regenerated Podfile.lock and project.pbxproj. REACT_NATIVE_PATH and the pod paths now point into node_modules/.pnpm, and the podspec checksums changed with those paths. Pod versions didn't change. The pbxproj also has new object IDs in a new order.
  • UI copy. The showcase page in apps/app tells users to run pnpm template doctor.

Not in this PR

Checks

I ran these on Linux with Node 26.13.0 and pnpm 12.9.0, with Bun removed from PATH, so a leftover bun call would fail.

  • After deleting every node_modules, pnpm install --frozen-lockfile passes. The evlog patch applies, and the overrides resolve.

  • pnpm run codegen, check, analyze, boundaries, and env:check pass.

  • pnpm exec turbo run test test:template --force passes all 23 tasks with none cached.

  • pnpm exec turbo build --force passes all 15 tasks with none cached, including electron-forge package.

  • pnpm template doctor passes.

  • pnpm --filter @v1/auth run secret prints a secret. pnpm --filter @v1/backend run generate:auth regenerates schema.generated.ts, and only the command in its header changes.

  • I ran each template recipe on its own fresh clone. Each run did a frozen install, codegen, pnpm exec turbo gen <recipe>, pnpm install, codegen, pnpm run fix, and pnpm template doctor. These recipes passed end to end, and each changed between 2 and 10 files: sentry on api, app, and mobile, posthog on api, app, and mobile, bull-board, emdash, skew, new-package, and remote-cache. posthog on app failed on core-js before the fix above. remote-cache added the Turbo variables to all three workflows.

  • realtime on app stops at its own check that apps/app is connected to apps/api before any pnpm command runs. Its one pnpm command, pnpm add @v1/realtime@workspace:*, works in a fresh clone. I couldn't run new-feature unattended, because plop can't take answers to its file checklist from --args. new-feature runs no pnpm commands.

  • On macOS, a fresh clone ran pnpm run --filter mobile prebuild. Afterward, no node_modules/.bun paths remain under apps/mobile. electron-forge package produced an app.asar with 13 entries and none from node_modules.

  • On an iPhone 17 Pro simulator with iOS 26.5, pnpm run --filter mobile ios built the app with 0 errors. Metro logged iOS Bundled 4168ms apps/mobile/src/index.ts (2250 modules), and the first screen rendered without an error.

    The mobile app's welcome screen in the iOS Simulator

  • minimumReleaseAgeExclude exempts @sanely/* and adamantite from pnpm's one-day release-age wait, as the maintainer's other pnpm repositories do. Without it, every install failed for a day after the @sanely 0.1.0 release. A fresh clone of the final commit passed a full lockfile verification at 19:02 UTC, before those packages turned one day old. The earlier local runs set pnpm_config_minimum_release_age=0 instead.

  • Reviewed with code-review: 3 rounds with gpt-6.1-sol. Verdict: approved. That review covers everything through 72bf6d2. Pullfrog reviewed the final commit, 25d7c23, which adds the release-age exemption.

🤖 Created with Claude Opus 5.5 in T3 Code

@vercel

vercel Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v1 Ready Ready Preview Nov 12, 2026 7:04pm UTC
v1-docs Ready Ready Preview Nov 12, 2026 7:04pm UTC

Request Review

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ One minor remote-cache detection issue inline.

Reviewed changes — Reviewed the pnpm command migration, including the additional Vercel deployment commit.

  • Workspace scripts: Migrates updates, concurrent codegen, and one-off auth commands while preserving Astro generation order.
  • Template commands and recipes: Migrates installation and verification commands, including Sentry CLI build permission.
  • Remote cache: Updates pnpm command detection and its tests.
  • CI and deployment: Replaces CI bootstrap with pnpm/setup and overrides the Astro previews’ install commands.

With Node 26 and pnpm 12, codegen, checks, all 23 uncached test tasks, and template doctor --fast passed using existing dependencies. Fresh installation is currently blocked by ERR_PNPM_MINIMUM_RELEASE_AGE_VIOLATION for six recently published dependencies already in the base lockfile.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-6.1-sol | 𝕏

adelrodriguez and others added 5 commits November 12, 2026 13:39
Move the workspace globs, overrides, the evlog patch, and exact saves from
package.json and bunfig.toml to pnpm-workspace.yaml, and replace bun.lock
with pnpm-lock.yaml. The lockfile was imported from Bun's resolution
through a Yarn v1 lockfile, so dependency versions do not drift. A fresh
resolution paired @effect/platform-node-shared 4.1.4 with effect 4.0.0
and broke Adamantite.

allowBuilds records a decision for each dependency with a build script.
electron-winstaller runs, because the Squirrel maker needs its 7-Zip
binary. The esbuild, msgpackr-extract, and protobufjs scripts only verify
prebuilt binaries or print warnings. The old trusted entries for
electron, @tailwindcss/oxide, and @parcel/watcher no longer have install
scripts.

hoistPattern repeats pnpm's default so Electron Forge's system check
accepts isolated installs until electron/forge#4188 lands.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Replace `bun update --interactive` in every bump:deps script, the
`bun run --parallel` codegen scripts, `bunx` in @v1/auth, and `bun x` in
the backend schema generator. pnpm runs the scripts that a regex matches
concurrently, so `pnpm run "/^codegen:/"` keeps codegen parallel.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The template commands and recipes now install with `pnpm install` and
`pnpm add`, and their messages name pnpm commands. pnpm-workspace.yaml
sets saveExact, so the recipes drop `--exact`. The Sentry recipe passes
`--allow-build=@sentry/cli` instead of editing trustedDependencies,
which pnpm does not read.

The remote-cache recipe now finds Turbo behind `pnpm run`, the `pnpm`
script shorthand, `pnpm exec`, and `pnpm dlx`. It also stops matching
commands such as `turbo-ignore`.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pnpm/setup reads .node-version and the packageManager field, caches the
pnpm store, and runs a frozen install, so it replaces the setup-node,
setup-bun, cache, and install steps in each job.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Vercel projects override the install command with `bun install`,
which fails now that the workspace globs live in pnpm-workspace.yaml.
vercel.json takes precedence over the project settings, so it now sets
the pnpm install command. Dropping bunVersion runs the functions on
Node, the template's runtime since #296.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…s posthog-js

pnpm fails an install when a dependency has an unreviewed build script.
posthog-js depends on core-js, whose postinstall only prints a funding
message, so the recipe denies it with --allow-build=!core-js.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No new issues found in the incremental changes. The earlier remote-cache feedback remains open.

Reviewed changes — Reviewed the PostHog recipe change since the prior review.

  • PostHog installation: Denied the core-js install script when adding posthog-js, allowing pnpm to record the build decision.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6.1-terra | 𝕏

expo prebuild under pnpm replaces the node_modules/.bun paths that Bun's
isolated linker wrote into Podfile.lock and project.pbxproj.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – v1 November 12, 2026 18:27 Inactive
@vercel
vercel Bot temporarily deployed to Preview – v1-docs November 12, 2026 18:27 Inactive

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ℹ️ No new issues found in this incremental delta; the earlier remote-cache finding remains open.

Reviewed changes — Reviewed the iOS native project regeneration with pnpm paths since the prior Pullfrog review.

  • Generated iOS project: Updated CocoaPods references and Xcode project settings to resolve dependencies from pnpm's node_modules/.pnpm layout.

Pullfrog  | Fix it ➔ | View workflow run | Using gpt-6-luna | 𝕏

@adelrodriguez
adelrodriguez changed the base branch from build/pnpm-config to main November 12, 2026 18:44
@adelrodriguez adelrodriguez changed the title build: run scripts, template recipes, and CI with pnpm instead of Bun build: replace Bun with pnpm as the package manager Nov 12, 2026
adelrodriguez and others added 2 commits November 12, 2026 14:47
`pnpm --filter app exec turbo run build` and the `-F` and `--dir` forms
run Turbo, but the recipe's parser does not skip a flag's separate value.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The remote-cache recipe matched direct Turbo calls with a regex that
could not skip a flag's separate value, and its script parser stopped at
`exec`. One parser now skips flags and their values, then reads whether
pnpm runs a binary through `exec` or `dlx`, a script through `run`, or
either through the shorthand.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — Reviewed the remote-cache fix and regression coverage added since fe69832.

  • Unified pnpm parsing: Recognized separated flag values before Turbo invocations while distinguishing binary calls from root scripts.
  • Added regression coverage: Covered --filter, -F, and --dir forms while preserving rejection of turbo-ignore.

Codegen, repository checks, and all 42 template tests passed with existing dependencies. Additional runtime probes verified workflow detection and script/binary discrimination.

Pullfrog  | View workflow run | Using gpt-6.1-sol | 𝕏

pnpm refuses packages published less than a day ago, so every install
failed for a day after a @sanely release. Exempt @sanely/* and adamantite,
as the maintainer's other pnpm repositories do.

Refs #278

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes — Reviewed the pnpm minimum release age exception added since the prior Pullfrog review.

  • Release-age exclusions: Added @sanely/* and adamantite to minimumReleaseAgeExclude so these maintainer-owned packages are not blocked by pnpm’s release-age delay.

Pullfrog  | View workflow run | Using gpt-6-luna | 𝕏

@adelrodriguez
adelrodriguez merged commit ee27afe into main Nov 12, 2026
10 checks passed
@adelrodriguez
adelrodriguez deleted the build/pnpm-commands branch November 12, 2026 19:19

This branch was successfully deployed

2 active deployments
Preview – v1-docs — 25d7c230 Deployed Nov 12, 2026 by vercel[bot]
Preview – v1 — 25d7c230 Deployed Nov 12, 2026 by vercel[bot]
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.

build: replace Bun with pnpm as the package manager

1 participant