Repository navigation
build: run the apps, scripts, and tests on Node instead of Bun - #296
Merged
Merged
Conversation
…un template commands Node's ESM resolver does not try extensions or index files the way Bun does, so `node scripts/index.ts` failed with ERR_UNSUPPORTED_DIR_IMPORT. scripts/codemods/add-import-extensions.ts rewrites the 20 imports, and the root tsconfig now allows importing .ts extensions. Co-Authored-By: Claude Opus 5.5 <[email protected]>
- apps/api runs `node --import @oxc-node/core/register`, because the email templates it imports from @v1/email use JSX. tsx would compile them with the classic transform, since it ignores the tsconfig of imported workspace packages (privatenumber/tsx#696). - apps/worker, the database scripts, the backend schema script, and the template commands run TypeScript directly with `node`. - apps/app builds with the Nitro node-server preset and starts with node. - Every workspace uses @types/node in place of @types/bun, so a new `Bun.*` call fails `bun run check`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The bull-board recipe serves its UI with `serveStatic` from `@hono/node-server/serve-static` in place of `hono/bun`, and the connect-backend skill runs its one-off commands with `node --eval`. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contributor
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes across the Node runtime migration, workspace types, template commands, and supporting tooling.
- Application runtimes: API uses the OXC loader for email JSX, worker runs TypeScript directly, and app SSR targets Nitro’s Node server.
- Scripts and generators: Database, backend, mobile codegen, and template commands use Node-compatible execution and imports.
- Types and tests: Node types replace Bun types, with explicit values for test synchronization promises.
- Tooling and recipes: Desktop Knip entries, bull-board static serving, documentation, and backend-connection instructions reflect the migration.
Validated on Node 26.13.1: full bun template doctor, uncached tests (23/23 Turbo tasks), email JSX rendering through the API loader, and production SSR redirect/sign-in responses.
gpt-6-astra | 𝕏
adelrodriguez
added a commit
that referenced
this pull request
Nov 12, 2026
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]>
adelrodriguez
added a commit
that referenced
this pull request
Nov 12, 2026
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]>
adelrodriguez
added a commit
that referenced
this pull request
Nov 12, 2026
* build: move the package manager config from Bun to pnpm 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]> * build: run workspace scripts with pnpm 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]> * build: run template commands and recipes with pnpm 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]> * ci: set up Node and pnpm with pnpm/setup 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]> * ci: install the Vercel previews with pnpm and run them on Node 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]> * fix(turbo): deny core-js's install script when the PostHog recipe adds 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]> * build(mobile): regenerate the native iOS project with pnpm paths 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]> * test(turbo): cover pnpm flag values before a Turbo call in remote-cache `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]> * fix(turbo): find Turbo after pnpm flags that take a value 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]> * build: let the maintainer's own packages skip pnpm's release-age wait 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]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

The template still ran every application, script, and test on Bun, even though no code calls a Bun API anymore. This PR switches the runtime to Node 26. Bun stays the package manager until #278, so
bun installandbun rundon't change.Closes #287
What changed
apps/worker, theseedandresetscripts inpackages/database,packages/backend/scripts/generate-schema.ts, and the template commands run asnode <file>.ts. drizzle-kit andturbo generatedropbun --bun.apps/apiloads through@oxc-node/core. The email templates thatapps/apiimports from@v1/emailuse JSX, and Node doesn't compile JSX. The scripts arenode --import @oxc-node/core/register --watch src/index.tsfordevand the same without--watchforstart.tsxfirst, which Hono's Node starter uses. It compiledpassword-reset.tsxwith the classic transform, so the password reset email failed withReact is not defined. tsx ignores the tsconfig of imported workspace packages (privatenumber/tsx#696). oxc-node compiles each file with the tsconfig of the workspace that owns it.packages/email/tsconfig.jsonnow sets"jsx": "react-jsx". The sharedinternal-package.jsonkeepspreservefor the packages that bundlers compile.apps/appuses the Nitronode-serverpreset.startrunsnode .output/server/index.mjs. I removed the leftoveroptimizeDeps.exclude: ["bun"].@types/nodein place of@types/bun, and every tsconfig sets"types": ["node"]. Bun's types allowed callingresolve()fromPromise.withResolvers<undefined>()without an argument, and Node's types don't, so four tests now signal withwithResolvers<boolean>()andresolve(true), aspackages/storagealready does.indexfiles when it resolves imports.scripts/codemods/add-import-extensions.tsadds them to the 20 extensionless imports inscripts/, and the root tsconfig allows.tsimports.apps/mobile.scripts/codegen.tsis nowcodegen.mts, because the workspace stays CommonJS for Expo, and Node warned on every run otherwise.bun --bun, Knip recognizesvite build --config vite.renderer.config.tsin theenv:scan:buildscript ofapps/desktop. It then loads that config from the repository root, where Varlock can't findPORT.apps/desktopnow setsvite: false, likeapps/app, and listssrc/renderer/main.tsxas an entry.serveStaticfrom@hono/node-server/serve-static, like bull-board's Hono example. The docs describe Node as the runtime, and the connect-backend skill runs its commands withnode --eval.Verification
I ran these checks against the Docker Compose services. Anything that writes rows ran against a scratch database.
bun run check,bun run analyze,bun run build, andbun template doctorpass.bun run test --forcepasses 23 of 23 tasks with none cached.Bun.file("x")failsbun run checkwithCannot find name 'Bun'.apps/api:startserves requests. After a sign-up, a password reset request delivered "Reset your v1 password" to Mailpit with the rendered HTML and the reset link.devrunning, touchingpassword-reset.tsxrestarted the server.apps/worker:devandstartlogWorker started, and both exit cleanly when SIGTERM reaches the Node process.apps/app:devserves the app.buildwrites anode-serveroutput.startredirects/to/sign-in, which returns 200.preview --port 3001serves the app too.packages/database:migrate,generate,seed,reset, and Studio run.generate:authregeneratesschema.generated.tswith no diff. Mobilecodegen:i18nruns without the module-type warning, and desktopenv:scan:buildpasses.package.jsonscript starts a process withbun --bun,bun --watch, orbun <file>, and no workspace lists@types/bun.I haven't run the bull-board recipe end to end, and I haven't seen CI run on this branch yet.
bun run previewinapps/appserves on port 3000 whileBASE_URLpoints at 3001, so server-side requests fail and the page returns 500.maindoes the same with the Bun preset, so I'll file it separately.🤖 Created with Claude Opus 5.5 in Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Note
Medium Risk
Broad runtime swap across API, app SSR, worker, and database scripts affects local dev and deployment; the API’s oxc-node JSX loader is a new dependency on correct email rendering at runtime.
Overview
Switches the monorepo runtime from Bun to Node 26 while Bun stays the package manager (
bun install,bun run). Application and workerdev/startscripts now invokenodeinstead ofbun --bunorbun --watch.Server and app targets:
apps/apiandapps/workerrun TypeScript entrypoints under Node; the API loads through@oxc-node/core/registerso JSX email templates from@v1/emailcompile (withjsx: react-jsxon that package).apps/appdrops the Bun Nitro preset fornode-server, uses plainvitefor build/dev, and starts production output withnode .output/server/index.mjs.Types and tooling: Workspaces replace
@types/bunwith@types/nodeand set"types": ["node"]in tsconfigs. Root andscripts/gain explicit.tsimport paths plusallowImportingTsExtensions, with a newadd-import-extensionscodemod. Several tests changePromise.withResolvers<undefined>()tobooleanresolvers so they type-check under Node.Other script and config updates: Database/backend/template scripts and root
scripts/templatecommands run vianode. Mobilecodegen:i18nbecomescodegen.mts. Knip treatsapps/desktoplike other apps (vite: false, renderer entry). Docs, connect-backend skill examples, and the bull-board generator recipe are updated for Node (serveStaticfrom@hono/node-server,node --evalwhere applicable).Reviewed by Cursor Bugbot for commit fe36f93. Configure here.