bun-package-starter
v1.0.0
Published
Scaffold a publishable Bun + TypeScript npm package with one command. tsup, Biome and CI included.
Downloads
159
Maintainers
Readme
bun-package-starter
create-bun-package my-pkg
|
v
+--------------------------------------------------------------+
| src/index.ts <- your library surface |
| tests/ <- bun test specs |
| tsup.config.ts <- esm + cjs + dts |
| biome.json <- lint + format |
| .github/ <- CI + npm publish on v* tags |
+--------------------------------------------------------------+
|
v
bun run release -> npm publishOne command from empty folder to publishable npm package.
scaffold one
bunx create-bun-package my-pkg
cd my-pkg
bun installYou now own a strict, tooled, publish-ready package.
the parts
| part | role |
| ---- | ---- |
| src/index.ts | what consumers import |
| tests/ | bun test specs |
| tsup.config.ts | builds esm .js, cjs .cjs, plus .d.ts |
| biome.json | lint + format in one tool |
| .github/workflows/ci.yml | validate on push / PR |
| .github/workflows/publish.yml | npm publish with provenance on v* |
day-one flow
bun run release # lint + typecheck + build + test
npm version patch
npm publish # or: push a v* tag, let CI ship itEverything the release needs ships in the template - including the publish
workflow. Add one NPM_TOKEN secret to your repo and npm releases are done
for you.
release checks a scaffolded package passes out of the box
bun run lint biome check
bun run typecheck tsc --noEmit, strict
bun run build tsup esm + cjs + dts
bun test bun testThe starter's own test suite scaffolds a package into a temp dir and runs
its full release pipeline - so the template can't drift.
what's skipped on purpose
- no bundler webpacking - tsup outputs plain esm/cjs
- no test framework download -
bun testis built in - no ts-node/@types/node guessing -
@types/buncovers it - no lock on a Node version - engines allows node >= 18 and bun >= 1.0
development of this package
git clone https://github.com/knownasrazi/bun-package-starter.git
cd bun-package-starter
bun install
bun run releaselicense
from empty folder to published package in one command.
