Skip to content

Conversation

@kfirstri
Copy link
Contributor

@kfirstri kfirstri commented Feb 2, 2026

Note

Description

This PR migrates the project from npm+ESLint to Bun+Biome for local development. Bun now handles package management, runs TypeScript directly without transpilation, and provides native bundling for the build process. Biome replaces ESLint for faster linting and formatting. The production package remains unchanged (still distributed as a zero-dependency npm package). This improves developer experience with faster install times, instant TypeScript execution, simpler build tooling, and unified linting/formatting.

Related Issue

Resolves #180

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Replaced npm with Bun for local development (install, dev, test, build commands)
  • Replaced ESLint with Biome for linting and formatting
    • Removed eslint.config.mjs and ESLint dependencies
    • Added biome.json with comprehensive linting rules (correctness, style, complexity, performance, suspicious patterns)
    • New commands: bun run lint, bun run lint:fix
    • Biome auto-organizes imports and enforces consistent code style
  • Replaced tsdown with native Bun bundler for production builds
    • Build script now uses bun build src/cli/index.ts --outdir dist --target node --format esm --sourcemap=inline
    • Removed tsdown.config.mjs and tsdown dependency
    • Simplified build process with built-in bundling
  • Replaced tsx with Bun for dev entry point
    • Changed bin/dev.ts shebang from #!/usr/bin/env tsx to #!/usr/bin/env bun
    • Bun runs TypeScript directly without transpilation for instant startup
  • Updated CI/CD workflows to use Bun
    • Lint, test, typecheck workflows now use oven-sh/setup-bun@v2
    • Publish workflows install Bun alongside npm (npm still needed for publishing to registry)
    • All workflows use bun install --frozen-lockfile for deterministic installs
  • Updated AGENTS.md documentation to reflect new tooling and commands
  • Code formatting changes across codebase from Biome auto-formatting
    • Import statement organization and sorting
    • Consistent quote style (double quotes) and semicolons
    • Trailing commas in multiline structures
    • Minor whitespace and style fixes
  • Cleanup
    • Removed bunfig.toml (using defaults)
    • Removed package-lock.json (using bun.lock instead)
    • Cleaned up unnecessary configuration files

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (bun run test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

Breaking changes for contributors:

  • Contributors must now install Bun (https://bun.sh/install) for local development
  • All development commands now use bun instead of npm:
    • bun install (instead of npm ci or npm install)
    • bun run dev (instead of npm run dev)
    • bun run test (instead of npm test)
    • bun run build (instead of npm run build)
  • ESLint IDE plugins will no longer work; install Biome IDE extensions instead

No changes for end users:

  • The published npm package remains identical
  • Still distributed as a zero-dependency package with bundled code
  • Production builds still target Node.js >= 20.19.0
  • Users install with npm install base44 as before
  • No runtime dependencies on Bun

Performance improvements:

  • Faster dependency installation (Bun is 2-10x faster than npm)
  • Instant TypeScript execution in dev mode (no transpilation step)
  • Faster linting (Biome is 10-100x faster than ESLint)
  • Simpler build pipeline (single tool instead of tsdown/Rolldown)

🤖 Generated by Claude | 2026-02-02 15:07 UTC

@kfirstri kfirstri self-assigned this Feb 2, 2026
@claude
Copy link

claude bot commented Feb 2, 2026

Code Review

Found 1 issue that needs attention:

Documentation incorrectly states build uses tsdown (CLAUDE.md lines 673-674)

Issue: The build command documentation claims tsdown is used and mentions a non-existent build:watch script.

Current documentation (CLAUDE.md:673-674):

bun run build      # tsdown - bundles to dist/index.js + copies templates
bun run build:watch # tsdown in watch mode - rebuilds on file changes

Actual implementation (package.json:14):

"build": "rm -rf dist && bun build src/cli/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp -r templates dist/"

Problems:

  1. Documentation says tsdown is used, but the script uses native bun build
  2. Documentation mentions build:watch script, but this script does NOT exist in package.json
  3. The PR deletes tsdown.config.mjs and removes tsdown from dependencies, confirming the migration away from tsdown

CLAUDE.md Rule #10 (line 660): "Keep AGENTS.md updated - Update this file when architecture changes"

Suggested fix:

  • Line 673: Change comment to # Bun native bundler - bundles to dist/index.js + copies templates
  • Line 674: Either remove this line (if watch mode not needed) or add the build:watch script to package.json

Reference: https://github.com/base44/cli/blob/c8a82045a79b08c372d8a92771b7b93803239539/CLAUDE.md#L671-L674

@claude
Copy link

claude bot commented Feb 2, 2026

Code review

Found 1 issue that needs attention:

Documentation Inaccuracy in AGENTS.md

File: AGENTS.md lines 673-674 (and line 16)

Issue: The documentation incorrectly states that tsdown is used for building, but this PR actually replaced tsdown with native bun build. Additionally, the documentation references a non-existent build:watch script.

Current (incorrect) documentation:

bun run build      # tsdown - bundles to dist/index.js + copies templates
bun run build:watch # tsdown in watch mode - rebuilds on file changes

Actual build script in package.json:

"build": "rm -rf dist && bun build src/cli/index.ts --outdir dist --target node --format esm --sourcemap=inline && cp -r templates dist/"

CLAUDE.md Rule Violated:

"10. Keep AGENTS.md updated - Update this file when architecture changes"

Reference:

cli/AGENTS.md

Line 660 in c8a8204

10. **Keep AGENTS.md updated** - Update this file when architecture changes

Suggested fix:

  1. Update line 673 to reflect the actual build process:

    bun run build      # bun build - bundles to dist/index.js + copies templates
    
  2. Remove line 674 since the build:watch script doesn't exist in package.json

  3. Update line 16 in the Project Overview to remove or clarify the tsdown reference (it's listed as a tool but isn't actually used after this PR)

@claude
Copy link

claude bot commented Feb 2, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@kfirstri kfirstri merged commit 5ef59f8 into main Feb 2, 2026
5 of 6 checks passed
@kfirstri kfirstri deleted the use-bun branch February 2, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to use bun for local dev

2 participants