refactor(config): migrate runtime and build flows to bun#1602
refactor(config): migrate runtime and build flows to bun#1602tyler-dane merged 1 commit intomainfrom
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 3 potential issues.
Bugbot Autofix is ON, but it could not run because the branch was deleted or merged before autofix could start.
Reviewed by Cursor Bugbot for commit a2ed39b. Configure here.
| }): { exitCode: number }; | ||
| }; | ||
|
|
||
| const bunRuntime = (globalThis as unknown as { Bun: BunRuntime }).Bun; |
There was a problem hiding this comment.
BunRuntime type duplicated across three new files
Low Severity
The BunRuntime type and the bunRuntime constant extraction from globalThis are copy-pasted across three new files (build.ts, build.util.ts, run.ts). The definitions are slightly inconsistent—build.util.ts omits the env property while the others include it. A single shared type and accessor would reduce maintenance burden and prevent drift.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit a2ed39b. Configure here.
| } | ||
|
|
||
| process.env["BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD"] = "true"; | ||
| } |
There was a problem hiding this comment.
assertBackendEnvFile silently ignores missing file
Low Severity
assertBackendEnvFile doesn't assert anything—it silently returns when the env file is missing, and when the file exists it only sets the unrelated BUN_CONFIG_NO_CLEAR_TERMINAL_ON_RELOAD env var. The function name strongly implies it validates the file's existence, but no warning, error, or env-loading takes place when the file is absent.
Reviewed by Cursor Bugbot for commit a2ed39b. Configure here.
|
|
||
| if (requestedProject) { | ||
| runProject(requestedProject); | ||
| return; |
There was a problem hiding this comment.
No validation of requested project name argument
Low Severity
process.argv[2] is as-cast to keyof typeof TEST_PROJECTS without validating it's actually a known key. If an invalid project name is passed, TEST_PROJECTS[projectName] yields undefined, and the subsequent .cmd access in runProject throws an unhelpful TypeError instead of a descriptive error message.
Reviewed by Cursor Bugbot for commit a2ed39b. Configure here.


Summary
Testing
bun run cli --helpbun run test:corebun run test:web./node_modules/.bin/eslint packages/backend/src/app.ts packages/backend/src/init.ts packages/scripts/src/commands/build.ts packages/scripts/src/commands/build.util.ts packages/scripts/src/testing/run.ts packages/scripts/src/testing/core.preload.ts packages/scripts/src/testing/core.jest-compat.tsbunx tsc --noEmit --pretty false(fails due to pre-existing repo type errors)bun run test:backend(not verified in sandbox; mongodb-memory-server port binding is restricted)bun run test:scripts(not verified in sandbox; mongodb-memory-server port binding is restricted)Note
Medium Risk
Moderate risk because it rewires core developer workflows (CLI, dev servers, tests, and build packaging) and changes the build-time module-alias behavior, which could cause CI/dev regressions if any edge cases differ under Bun.
Overview
Moves the repo to a Bun-first workflow by switching root scripts for
cli,dev:web,dev:backend,test:*,type-check, andtest:e2eto Bun-managed entrypoints and removingcross-env,ts-node, andts-node-devusage.Introduces a Bun-based test dispatcher (
packages/scripts/src/testing/run.ts) with a hybrid strategy:coreruns viabun testwith a small Jest-compat preload, whileweb/backend/scriptscontinue running in the existing Jest harness; CI is updated to callbun run test:<project>.Updates build packaging to run compilation and webpack via
Bun.spawnSync, installs production deps inbuild/nodeviabun install --production, and adjusts backend startup/shutdown for Bun watch mode while keeping Node build output working via conditionalmodule-aliassetup. Documentation is refreshed to reflect the new commands and test strategy, and Jest config is tightened to only search underpackages.Reviewed by Cursor Bugbot for commit a2ed39b. Bugbot is set up for automated code reviews on this repo. Configure here.