Skip to content

feat: local-dev rescope — base44 dev --remote, template on vite-plugin, base44 build, deploy --build - #580

Open
davidsu wants to merge 3 commits into
mainfrom
feat/dev-remote-vite-plugin-template
Open

feat: local-dev rescope — base44 dev --remote, template on vite-plugin, base44 build, deploy --build#580
davidsu wants to merge 3 commits into
mainfrom
feat/dev-remote-vite-plugin-template

Conversation

@davidsu

@davidsu davidsu commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Note

Description

This PR rescopes local development so the Base44 app id is injected by the CLI at serve/build time instead of being baked into scaffolded source. It adds a base44 build command, an opt-in build step for base44 deploy / base44 site deploy (--build / --no-build), and base44 dev --remote for running the local frontend against the production backend. The backend-and-client template moves onto the same client convention editor-created apps use (@base44/vite-plugin + src/lib/app-params.js, SDK client on same-origin /api).

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 runs the project's site.buildCommand with VITE_BASE44_APP_ID set to the linked app id; requires a linked project (ConfigInvalidError otherwise). Registered in program.ts.
  • New cli/commands/project/site-build.ts holds the shared helpers: runSiteBuild() (runs the command through execa inside runTask, throws ConfigNotFoundError with a config hint when site.buildCommand is missing) and shouldBuildBeforeDeploy() (explicit flag > non-interactive default of false > confirm prompt).

Build before deploy

  • base44 deploy and base44 site deploy gain --build / --no-build; interactive runs prompt, non-interactive runs default to not building. Project deploy only offers it when site.outputDirectory is configured.
  • eject passes build: false so its internal deploy keeps its current behaviour.
  • scaffold-shared.ts injects VITE_BASE44_APP_ID into the post-create build.
  • core/site/deploy.ts missing-output hints now point at base44 build instead of a bare npm run build.

base44 dev --remote

  • Runs only site.serveCommand, with VITE_BASE44_APP_ID and VITE_BASE44_APP_BASE_URL pointed at the app's published URL from getSiteUrl(); no local backend is started.
  • Fails when the app has no published URL, when the project has no site.serveCommand, or when --port is combined with --remote.
  • dev.ts split into remoteDevAction / localDevAction with shared helpers resolveConfiguredSite() and stopRunnerOnProcessSignals(); the remote runner exits with the frontend's exit code. ServeCommandRunnerOptions is now exported so the new ConfiguredSite type can be a Pick of it.

Template (backend-and-client)

  • vite.config.js now uses @base44/vite-plugin (which supplies the @ alias and proxies /api to the local dev backend) alongside @vitejs/plugin-react.
  • src/api/base44Client.js.ejs (app id hardcoded at scaffold time) replaced by a static src/api/base44Client.js that reads from the new src/lib/app-params.js, with serverUrl: '' for same-origin API calls.
  • Bumped @base44/sdk to ^0.8.40 and added @base44/vite-plugin ^1.0.30.

Tests & changelog

  • New tests/cli/build.spec.ts: build happy path and failure modes, deploy --build / --no-build / default, site deploy --build, and build-failure propagation. New fixtures with-buildable-site and with-failing-build.
  • New dev --remote cases in tests/cli/dev.spec.ts (published-URL injection, missing URL, --port rejection, missing serveCommand, exit propagation) and a create case asserting the new template convention.
  • CHANGELOG.md updated under Added / Changed.

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

The template change affects newly scaffolded projects only; existing projects with a hardcoded appId keep working. Since the app id now comes from VITE_BASE44_APP_ID, a bare npm run build no longer produces a correctly configured bundle — use base44 build (or base44 deploy --build), which is why the missing-output deploy hint was reworded.

Not done here: docs/ was not updated for the new build command or the --remote / --build flags, and the test suite was not executed in this environment (no node_modules/dist present), so the 'tested locally' and 'all tests pass' boxes are left unchecked.


🤖 Generated by Claude | 2026-07-30 13:52 UTC | b42a66a

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.6-pr.580.b42a66a

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.1.6-pr.580.b42a66a"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.6-pr.580.b42a66a"
  }
}

Preview published to npm registry — try new features instantly!

@chimamark199713-dev

Copy link
Copy Markdown

Cryptoease

@davidsu davidsu changed the title feat(dev): base44 dev --remote + template scaffolds the vite-plugin convention feat: local-dev rescope — base44 dev --remote, template on vite-plugin, base44 build, deploy --build Jul 30, 2026
davidsu added a commit that referenced this pull request Jul 30, 2026
…44 build, deploy --build

The full #580 feature set, rebuilt on top of the decoupled serveCommand
runner (#582). dev --remote is now just: resolve the configured
serveCommand (or fail), resolve the app's published URL (or fail), run
the same runner local dev uses — no backend, no parallel implementation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidsu
davidsu force-pushed the feat/dev-remote-vite-plugin-template branch from 2253db8 to bee958d Compare July 30, 2026 13:01
@davidsu
davidsu changed the base branch from main to refactor/decouple-serve-command July 30, 2026 13:01
Base automatically changed from refactor/decouple-serve-command to main July 30, 2026 13:08
…44 build, deploy --build

The full #580 feature set, rebuilt on top of the decoupled serveCommand
runner (#582). dev --remote is now just: resolve the configured
serveCommand (or fail), resolve the app's published URL (or fail), run
the same runner local dev uses — no backend, no parallel implementation.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidsu
davidsu force-pushed the feat/dev-remote-vite-plugin-template branch from bee958d to 474fd00 Compare July 30, 2026 13:09
davidsu and others added 2 commits July 30, 2026 16:38
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.

2 participants