Skip to content

feat: add runtime-bun module #13

@ronak-create

Description

@ronak-create

Summary

Add Bun as an optional runtime target. When selected, generated projects use Bun-specific APIs and config rather than Node.js defaults.

Why

Bun is a drop-in Node.js alternative with a built-in test runner, bundler, package manager, and SQLite driver.
It changes several generated files:

  • package.json scripts use bun instead of node / npm
  • bunfig.toml replaces some config
  • the SQLite module can use Bun's native bun:sqlite instead of better-sqlite3

Design consideration

This is the first runtime category module.

The question "which runtime?" logically precedes backend and database choices:

  • Bun's native SQLite affects database-sqlite
  • Bun's HTTP server affects backend-express and backend-hono

Consider where in the prompt graph this question should live.


Files to generate

  • bunfig.toml — Bun config
  • Patched package.json scripts (bun dev, bun run build, etc.)
  • When database-sqlite is also selected:
    • swap better-sqlite3bun:sqlite in src/db/client.ts

Implementation hints

  • Primary surface:

    • configPatches (rewriting scripts)
    • onAfterTemplate hooks (swapping SQLite driver)
  • Installer behavior:

    • detect Bun and call bun install instead of npm install
    • check if packages/core/src/installer/ already has runtime detection
  • compatibility.advisory (not hard conflict):

    • backend-django
    • backend-fastapi
      → Bun does not run Python

Contributor guidance

Refer to CONTRIBUTING.md → "Adding a New Module"


Acceptance criteria

  • When Bun is selected, package.json scripts use bun throughout
  • bunfig.toml is present and valid
  • database-sqlite + Bun uses bun:sqlite instead of better-sqlite3
  • Installer invokes bun install instead of npm install
  • Snapshot tests for Bun + Express and Bun + Hono combinations

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestnew-modulebuild something here

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions