Skip to content

feat(build): base44 build + build step in deploy (ask / --build / --no-build) - #581

Closed
davidsu wants to merge 1 commit into
mainfrom
feat/base44-build
Closed

feat(build): base44 build + build step in deploy (ask / --build / --no-build)#581
davidsu wants to merge 1 commit into
mainfrom
feat/base44-build

Conversation

@davidsu

@davidsu davidsu commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Note

Description

Adds a first-class build step to the CLI. A new base44 build command runs the project's configured site.buildCommand with VITE_BASE44_APP_ID injected, so built bundles always carry the linked app's id instead of relying on a manually maintained .env. Both base44 deploy and base44 site deploy can now run that build immediately before uploading — interactive runs prompt for it, and --build / --no-build pre-answer the prompt for scripts and CI.

Related Issue

None

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

  • New base44 build command (cli/commands/project/build.ts), registered in program.ts. Requires a linked local project and throws ConfigInvalidError otherwise.
  • New shared site-build.ts module with two helpers:
    • runSiteBuild() — executes site.buildCommand via execa (shell, cwd = project root) with VITE_BASE44_APP_ID set to the linked app id, wrapped in runTask() for spinner/success/error messaging. Throws ConfigNotFoundError with a hint when no buildCommand is configured.
    • shouldBuildBeforeDeploy() — resolution order: no buildCommand → never build; explicit --build/--no-build wins; non-interactive without a flag → don't build; otherwise prompt via @clack/prompts confirm (a cancelled prompt means don't build).
  • base44 deploy: added --build / --no-build flags; builds before deploying resources when the project has a site.outputDirectory and an app is linked. deployAction now takes the full CLIContext so it can pass it to runSiteBuild.
  • base44 site deploy: same --build / --no-build flags and build-before-upload behaviour.
  • base44 eject: passes build: false to its internal deployAction call so ejecting never triggers an unexpected build.
  • Tests: new tests/cli/build.spec.ts covering build success with the app id injected, missing buildCommand, running outside a project, deploy --build / --no-build / flag-absent-in-non-interactive, site deploy --build, and a failing build aborting the deploy. Two new fixtures (with-buildable-site, with-failing-build) whose build commands write/inspect VITE_BASE44_APP_ID.
  • CHANGELOG.md: documented both additions under Unreleased → Added.
  • package.json: @biomejs/biome removed from root devDependencies.

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (`npm 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 `docs/` (AGENTS.md) if I made architectural changes

Additional Notes

  • Please double-check the `@biomejs/biome` removal from root `package.json`. The root `lint` / `lint:fix` scripts still invoke `biome check`, and the package is not declared in `packages/cli/package.json` either, so `bun run lint` will fail on a clean install unless this is restored (or biome is resolved another way).
  • Env var is Vite-specific (`VITE_BASE44_APP_ID`); non-Vite build tooling won't pick it up.
  • The build step is skipped in non-interactive mode unless `--build` is passed, so existing CI `deploy --yes` pipelines keep their current behaviour.
  • `docs/` was not updated — worth adding a short note to the commands/resources guides if the build step is considered part of the documented deploy flow.

🤖 Generated by Claude | 2026-07-30 07:33 UTC | 421f370

base44 build runs site.buildCommand with VITE_BASE44_APP_ID injected —
the CLI-blessed way to produce a bundle that knows its app. A bare
npm run build has no id source (the template no longer bakes it and the
vite-plugin carries no fallbacks), so the deployed site dead-ends on
/api/apps/null/... (observed live).

base44 deploy and base44 site deploy now offer that build: interactive
runs ask, --build / --no-build pre-answer, non-interactive default
stays upload-only. eject keeps its own build and opts out explicitly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidsu

davidsu commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

Unified into #580 per David's directive (2026-07-30: one cli PR for the whole local-dev rescope). The branch feat/base44-build was merged into feat/dev-remote-vite-plugin-template verbatim — all 8 build/deploy specs and the QA verdicts transfer. Nothing here is dropped.

@davidsu davidsu closed this Jul 30, 2026
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.

1 participant