@meld-ts/create-bun
v1.1.1
Published
A modern Bun project template with TypeScript, Biome, and first-class support for lib, app, and react project modes.
Maintainers
Readme
@meld-ts/create-bun
A modern Bun project scaffold with TypeScript support and three project types: lib, app, and react-app.
Usage
bun create @meld-ts/bunInteractive prompts will guide you through:
- Project name —
my-appor@org/my-lib - Project type —
lib|app|react-app - Lint & format —
Biome|oxc(orNonefor lib/app) - Add-ons — varies by project type
Then:
cd my-project
bun run devNon-interactive mode
Skip prompts by passing flags (useful for CI and scripts):
bun create @meld-ts/bun my-app \
--type react-app \
--lint biome \
--addons tailwindcss,tsgo \
--no-install| Flag | Description |
|------|-------------|
| --type | lib | app | react-app |
| --lint | none | biome | oxc |
| --addons | Comma-separated: tsgo, bunup, tailwindcss, tanstack-router |
| --dir | Output directory (scoped packages default to org-name flat layout) |
| --no-install | Skip bun install and post-install hooks |
| --rm | Overwrite existing directory |
| --cwd | Parent directory for the project |
| --template-root | Path to templates (for local dev) |
With --no-install, run bun install manually, then any addon post-install steps (e.g. bunx biome migrate --write, bun scripts/gen-routes.ts).
Project types
| Type | Entry | Build | HMR | Description |
|------|-------|-------|-----|-------------|
| lib | src/index.ts | bunup (optional) | — | TypeScript library — ESM + CJS + .d.ts |
| app | src/index.ts | bunup (optional) | --hot | Node.js / Bun application |
| react-app | src/index.html | bun build (fixed) | --hot serve | React SPA — file-based routing optional |
Add-ons
All project types
| Add-on | Description |
|--------|-------------|
| Biome | All-in-one linter + formatter |
| oxc | oxlint + oxfmt (faster, 660+ rules) |
| tsgo | Native TypeScript compiler (typescript 7+ includes tsgo) |
lib / app only
| Add-on | Description | |--------|-------------| | bunup | Build tool for Bun libraries |
react-app only
| Add-on | Description |
|--------|-------------|
| tailwindcss | Tailwind CSS v4 + tailwindcss-bun-plugin |
| tanstack-router | File-based type-safe router with devtools |
bunup is not available for react-app — it only supports
.ts/.tsxentry points, notindex.html. React apps use Bun's native bundler.
Add-on layers
Add-ons are applied in order:
lint (order=1) → styling (order=2) → structural (order=3) → extra (order=4)- Same-layer add-ons are mutually exclusive (Biome or oxc, not both)
- Higher layers override lower layers for source files
- JSON configs are deep-merged — each add-on contributes only its own section
This means you can freely combine: biome + tailwindcss + tanstack-router or oxc + tailwindcss + tanstack-router.
Available scripts
bun run fmt # format with Biome / oxfmt (if selected)
bun run lint # lint (warnings as errors)
bun run ts-check # type check with tsgo / tsc
bun run test # run tests + coverage
bun run dev # dev server / hot reload
bun run build # production build
bun run generate-routes # regenerate route tree (tanstack-router only)Template structure
template-bun/ # lib / app base
├── src/
│ ├── index.ts
│ └── index.test.ts
├── tsconfig.json
└── package.json
template-react-app/ # react-app base
├── src/
│ ├── index.html
│ ├── main.tsx
│ ├── global.css
│ ├── global.d.ts
│ ├── assets/react.svg
│ └── app/App.tsx
├── scripts/
│ ├── dev-serve.ts
│ └── build.ts
├── bunfig.toml
├── tsconfig.json
└── package.json
addons/
├── biome/ # lint layer (order=1)
│ ├── template/biome.json
│ └── package.json
├── oxc/ # lint layer (order=1)
│ ├── template/.oxlintrc.json, .oxfmtrc.json
│ └── package.json
├── tailwindcss/ # styling layer (order=2)
│ ├── merge/biome.json
│ └── template/ (bunfig.toml, build.ts, global.css)
├── tanstack-router/ # structural layer (order=3)
│ ├── merge/biome.json
│ └── template/ (dev-serve.ts, gen-routes.ts, App.tsx, router.tsx, routes/*)
├── tsgo/ # extra layer (order=4)
└── bunup/ # extra layer (order=4)