Repository navigation
Run on Bun: bun install, bun --bun next, standalone server under Bun - #8
Conversation
Moves recipepdfs.com off Node + pnpm onto Bun, following the fleet recipe from the phonenumbers.bot pilot. - Package manager: bun.lock replaces pnpm-lock.yaml; packageManager bun@1.4.0. - Runtime: scripts use `bun --bun next`, so Next builds and serves on Bun. - Image: .nixpacks/Dockerfile (the path dev2's compose builds) is now a hand-written oven/bun:1.4.0-slim multi-stage build running the Next standalone server with `bun server.js` as the non-root bun user. /app and /app/.data are owned by bun so the JSON store and public/uploads stay writable. Port 8080, env and the / health path are unchanged. The nixpacks .nix and build.sh are gone. - Tests: vitest becomes bun test. Imports move to bun:test; the coinpay test drops vi.resetModules (the client reads env per call) and uses spyOn. tsconfig lists types explicitly, since TypeScript 6 no longer picks up @types/* on its own. - CI: new ci workflow (frozen install, typecheck, bun test, build, boot the standalone server under Bun). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ThreatCrush Security Scan0 finding(s) No findings. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
This moves recipepdfs.com off Node + pnpm onto Bun as the package manager, runtime and test runner. It follows the fleet recipe from the phonenumbers.bot pilot (profullstack/phonenumbers.bot#12).
Changes
bun.lockreplacespnpm-lock.yaml, andpackageManageris nowbun@1.4.0.bun --bun next ....next.config.tssetsoutput: "standalone"and pinsoutputFileTracingRoot..nixpacks/Dockerfileis the path dev2's compose builds. It is now a hand-writtenoven/bun:1.4.0-slimmulti-stage build that runsbun server.jsas the non-rootbunuser./appand/app/.dataare owned bybun, so the JSON store (lib/store.ts) andpublic/uploadsstay writable. Port 8080, env and the/health path are unchanged, and dev2's compose file needs no change. The nixpacks.nixandbuild.share removed.bun test, which runs all 73 tests green. Imports now come frombun:test. The coinpay test dropsvi.resetModules, which it never needed because the client reads env on each call.tsconfigliststypesexplicitly, because TypeScript 6 no longer picks up@types/*automatically.ciworkflow runs a frozen install, typecheck,bun testand the build, then boots the standalone server under Bun.Verified locally
I built the image from
git archive HEADthrough a compose file shaped like dev2's (same dockerfile path, env and 1g limit) and compared it with the live site:api/v1/recipesandapi/mcpbodies are byte-identical. The HTML differs only in chunk hashes./assets/*return 200, and Docker reports the container healthy.docker topshowsbun server.js, memory was about 128 MiB after 50 requests, the image is 348 MB (the Node image is 1.87 GB), and SIGTERM stops it in 0.3 s.Pre-existing bug, unchanged here
robots.txt,llms.txt,/pricingand thePOST /api/purchaseredirect build absolute URLs fromrequest.url. Next derives that URL from the server's bind hostname, not the request's Host. Live therefore already serveshttps://localhost:8080/..., and the standalone server will servehttps://0.0.0.0:8080/...instead. Both are wrong. The fix is to useAPP_URL, which is set tohttps://recipepdfs.comon dev2. That belongs in a follow-up PR, not this runtime swap.🤖 Generated with Claude Code