Skip to content

build: move the package manager config to pnpm and keep Bun's resolved versions - #300

Closed
adelrodriguez wants to merge 1 commit into
mainfrom
build/pnpm-config
Closed

adelrodriguez wants to merge 1 commit into
mainfrom
build/pnpm-config

Conversation

@adelrodriguez

@adelrodriguez adelrodriguez commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

This is the first PR for #278. It moves the package manager configuration from Bun to pnpm and keeps every resolved dependency version. The scripts, template recipes, template commands, and CI workflows still call bun. The next PR, stacked on this one, replaces those calls, so merge both PRs together. CI fails on this PR on its own, because the workflows still run bun install --frozen-lockfile and bun.lock is gone.

What moved

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.

packageManager is now [email protected]. bun template setup no longer deletes bun-create, and bun template doctor no longer checks for it. bun template remove now skips pnpm-lock.yaml instead of bun.lock when it lists leftover references.

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 with ERR_MODULE_NOT_FOUND. bun.lock had kept 4.0.0. To keep Bun's resolution, I ran bun install --yarn on main 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, so allowBuilds records a decision for each dependency that has one:

  • electron-winstaller: true. Its install script copies the 7-Zip binary that MakerSquirrel uses for Windows builds.
  • esbuild, msgpackr-extract, and protobufjs are set to false. Their scripts only verify prebuilt binaries, which pnpm already installs as optional dependencies, or print a version warning.

I dropped Bun's electron, @tailwindcss/oxide, and @parcel/watcher entries. Electron 44 downloads its binary on first run, @tailwindcss/oxide has no install script, and @parcel/watcher isn't in the dependency tree. The docs and extension entries were Bun approvals for workspace scripts, and pnpm runs workspace scripts without approval.

Electron Forge and isolated installs

electron-forge package refused pnpm's default isolated installs. Its system check requires node-linker=hoisted or an explicit hoist pattern. pnpm-workspace.yaml now sets hoistPattern: ["*"], which is pnpm's default, so the install layout stays the same. A comment links electron/forge#4188 and says to remove the setting when that issue lands. The packaged app.asar holds 13 entries, all under .vite/ plus package.json, with no node_modules entries, because the Vite plugin bundles the app.

Checks

I ran these on Linux with Node 26.13.0 and pnpm 12.9.0. Bun stayed on PATH for the scripts that still call it.

  • After deleting every node_modules, pnpm install --frozen-lockfile passes. It runs electron-winstaller and the apps/extension postinstall, and it reports no ignored builds.
  • The installed [email protected] has the patch applied, and react, react-dom, sharp, @types/react, and @types/react-dom resolve to their override versions.
  • pnpm run codegen passes all 10 tasks. pnpm run check, pnpm run analyze, and pnpm run boundaries pass. knip's two configuration hints also appear on main.
  • pnpm test passes all 23 tasks.
  • pnpm template doctor passes, including build. It failed on desktop#build before the hoistPattern change.
  • I did not run the packaged desktop app, the iOS or Android builds, or the template recipes. The stacked PR covers those.

Refs #278

🤖 Created with Claude Opus 5.5 in T3 Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


Note

High Risk
This rewires how dependencies are resolved, patched, and installed across the monorepo; lockfile and CI behavior change even though versions are meant to stay aligned with the old Bun lockfile.

Overview
Moves workspace and install policy from Bun (bunfig.toml, root package.json workspaces/overrides/patches/trusted deps) into pnpm-workspace.yaml, and sets packageManager to [email protected].

package.json no longer declares workspaces, dependency overrides, patchedDependencies, trustedDependencies, or the template bun-create hook; those concerns live under pnpm (saveExact, overrides, patchedDependencies, and allowBuilds for native/postinstall scripts). A hoistPattern: ["*"] entry keeps Electron Forge packaging happy with pnpm’s layout.

Template maintenance scripts are adjusted for the switch: bun template doctor stops flagging a leftover bun-create field, setup no longer strips bun-create during cleanup, and remove ignores pnpm-lock.yaml instead of bun.lock when scanning references. Root scripts and template flows still invoke bun for installs/runs; CI that expects bun.lock is expected to fail until the follow-up PR.

Reviewed by Cursor Bugbot for commit 444b669. Configure here.

@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 Error Error Nov 12, 2026 5:41pm UTC
v1-docs Error Error Nov 12, 2026 5:41pm 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.

Caution

This migration cannot be merged independently: the existing installation and CI paths still require the removed Bun configuration.

Reviewed changes

  • Package management: Moves workspace discovery, overrides, patches, and build approvals to pnpm and replaces the lockfile.
  • Template commands: Removes the obsolete bun-create cleanup and updates the lockfile reference filter.

🚨 The package manager migration is incomplete at the merge boundary

As the PR description notes, CI still runs bun install --frozen-lockfile after bun.lock is removed. Template setup also still runs bun install after modifying the workspace selection, so this commit is not a usable standalone state for scaffolded projects.

Technical details
# Complete the migration before it reaches main

## Affected sites
- `.github/workflows/adamantite.yml:54` and other workflows — installation still expects the removed Bun lockfile.
- `scripts/template/setup.ts:357` — setup still installs with Bun after workspace pruning.
- `package.json:53` and `pnpm-workspace.yaml` — package management has already moved to pnpm.

## Required outcome
- Land the follow-up package manager migration atomically with this change, so CI and scaffolded project setup work at every published merge boundary.

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

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 444b669. Configure here.

Comment thread pnpm-workspace.yaml
electron-winstaller: true
esbuild: false
msgpackr-extract: false
protobufjs: false

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Sentry recipe writes stale build approvals

Medium Severity

Install-script approvals moved to allowBuilds, but the Sentry recipe still writes trustedDependencies on the root package.json, which pnpm ignores. Adding Sentry to mobile still relies on @sentry/cli's install script to fetch its binary, so source-map uploads can fail after the recipe reports success.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 444b669. Configure here.

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]>

@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.

Caution

The previously reported incomplete migration still prevents this PR from being merged independently.

Reviewed changes since the prior Pullfrog review:

  • Updated lockfiles: Added the @sanely/try importer entry to the lockfile changes.

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

@adelrodriguez

Copy link
Copy Markdown
Collaborator Author

Note

🤖 Claude Opus 5.5 (on behalf of Adel Rodríguez)

Closing in favor of #301. #300 can't build alone, because CI, setup, and the template recipes still call bun after the config moves to pnpm. #301 now targets main, and it includes this PR's commit as b0fa260a, so the whole migration lands in one PR.

This branch had an error being deployed

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

1 participant