feat: Bun is the package manager, in the docs and in this repo - #3
Open
dmitriyzhuk wants to merge 1 commit into
Open
dmitriyzhuk wants to merge 1 commit into
dmitriyzhuk wants to merge 1 commit into
Conversation
Every setup document in the corpus told the reader — and every agent that
reads it — to run `npm install`. The Dockerfile here ran `npm ci`. Meanwhile
the starter kit already built with Bun, so the documentation and the thing it
documents had drifted apart, and an agent following the docs produced a
project with two lockfiles.
The corpus now says `bun install`, `bun add`, `bun run` and `bunx` throughout,
and `02-standards/bun.md` states the rule once with the command map, the
lockfile policy and the two things that surprise people:
- Pre-scripts still run. `bun run dev` runs `predev` — verified on Bun 1.3,
and the whole CleanSlice dev flow (docker, prisma-import, migrate,
boundary check) hangs off that hook.
- Build in a NODE image with the Bun binary copied in, never in `oven/bun`.
That image ships a shim named `node`, so `nest build` runs under Bun and
Nest's tsconfig-paths hook stops rewriting `#mcp` to a relative path. The
image builds clean and the server dies on boot with
`Cannot find module '#mcp'` — which is exactly what the first version of
this Dockerfile did, before the builder was moved to `node:20-alpine`.
`bun.lock` was generated by running `bun install` WITH `package-lock.json`
still in place, so Bun carried the resolved versions across instead of
re-resolving them; deleting it first pulled in a zod major and broke the build
on three type errors.
Verified: `bun install`, `bun run build`, `docker build`, and the image booted
with `/health` returning 200 and the docs indexed.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
What
Bun is the package manager — in the documentation corpus this server ships, and in this repo's own tooling.
Companion PRs (same change, other repos):
Why
Every setup document here told the reader — and every agent that reads them — to run
npm install,npm run dev,npx prisma. The starter kit those documents describe already builds with Bun. So an agent that followed the docs produced a project with two lockfiles and a CI that installs something different from what the developer ran.The corpus
npm install→bun install,npm install -D→bun add -d,npm run→bun run,npx→bunx, and the twopnpmlines that had crept in. 16 documents.New:
docs/02-standards/bun.md— the rule stated once, with the command map, the lockfile policy, and the gotchas below. It is indexed like any other standard, sosearchfinds it on "package manager", "bun install", "lockfile".Hand-written rather than replaced, because a blind swap would have been wrong:
nest new --package-manager npmhas no Bun value →--skip-install, thenbun install.oven/bun-free builders (see below) andCMD ["bun", "run", "start"].This repo
Dockerfile— installs and builds with Bun;bun.lockreplacespackage-lock.json.package.json—"dev": "bun run start:dev".bun install,bun run dev.Two things that cost time here, now written down
Build in a Node image with the Bun binary copied in, never in
oven/bun. That image ships a shim namednode, sonest buildruns under Bun, and Nest's tsconfig-paths hook stops rewriting#mcpto a relative path. The image builds without a warning and the server dies on boot:Same source, same lockfile, same command —
require("#mcp")insideoven/bun,require("../mcp")with a real Node under the build. (bunxalso needs an explicit symlink: it is a symlink to the same binary in the oven image.)Migrate the lockfile, don't regenerate it.
bun installrun whilepackage-lock.jsonis still present carries the resolved versions across. Deleting it first re-resolved every range, pulled a newerzod/MCP SDK, and broke the build on three type errors.Verified
bun install,bun run build— clean.docker build— clean./health→200 {"status":"ok"}, Nest started, GitHub docs indexed (44 documents).Not done
get-startedreturns an empty document today: the gateway looks for a quickstart doc whose path or name contains "rules", and00-quickstart/get-started.mdmatches neither (it only carries arulestag). Pre-existing, untouched here — but it means the corpus's front door is blank, so the Bun rule is stated in the standards doc and repeated in every setup page instead.🤖 Generated with Claude Code