Bun
Bun runtime and package management conventions
Package Manager
- Only
bun— yarn/npm/npx/pnpm forbidden bun fixmust always pass- Never
bun update— it replaces"latest"with resolved versions - Always
bun clean && bun ito update deps - All deps use
"latest"tag — no pinned versions unless necessary - For deps that must be pinned, pin major version only (e.g.
"eslint": "9") - No lockfile committed (
bun.lockin.gitignore)
Bun APIs
- Always
import { X } from 'bun'— never useBun.Xglobal (triggersnoUndeclaredVariablesin biome) import { $, file, write, Glob, spawn } from 'bun'
Scripts
sh clean.sh— nuke all artifacts (node_modules, lockfile, caches, dist, .next)sh up.sh— clean + install + fix + check (the universal maintenance cycle)- Scripts: silent on success, verbose on failure
- Never use
git clean— it deletes.envand uncommitted files. Use explicitrm -rf.