Skip to content

feat(dev): base44 dev --remote — local frontend against the production backend - #588

Merged
davidsu merged 1 commit into
mainfrom
feat/dev-remote
Aug 4, 2026
Merged

feat(dev): base44 dev --remote — local frontend against the production backend#588
davidsu merged 1 commit into
mainfrom
feat/dev-remote

Conversation

@davidsu

@davidsu davidsu commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Note

Description

Adds a --remote flag to base44 dev that runs the project's site.serveCommand locally while pointing it at the app's published backend instead of spinning up a local dev server. This lets you iterate on the frontend against real production data without running a local backend. The flag is mutually exclusive with --port, and the command fails fast when the project has no site.serveCommand or the app has no published URL.

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 --remote flag on base44 dev (packages/cli/src/cli/commands/dev.ts): resolves the app's published site URL via getSiteUrl() and starts site.serveCommand with VITE_BASE44_APP_ID and VITE_BASE44_APP_BASE_URL pointing at the live app, skipping createDevServer() entirely.
  • Validation: validateDevOptions now rejects --remote --port with "--port applies to the local backend, which --remote does not start."; --remote without a site.serveCommand throws a ConfigInvalidError explaining the requirement.
  • Outro message warns that the frontend targets the live app and "every write hits your live app".
  • Refactor of dev.ts: split the old devAction into localDevAction / remoteDevAction behind a thin dispatcher; replaced createConfiguredServeRunner with a config-only resolveConfiguredSite helper (returning a ConfiguredSite pick of the runner options) so both paths share config resolution but construct their own runner; extracted stopRunnerOnProcessSignals for the shared SIGINT/SIGTERM teardown.
  • Export ServeCommandRunnerOptions from serve-command-runner.ts so dev.ts can derive ConfiguredSite from it.
  • Tests (packages/cli/tests/cli/dev.spec.ts): 5 new cases covering the happy path (serve command receives the published URL, no local backend started), missing published URL, --remote + --port rejection, missing site.serveCommand, and non-zero exit when the frontend exits.
  • CHANGELOG entry under Added.

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

  • No docs/ changes were needed: the guides under docs/ are architectural topic guides, and the command factory / runCommand patterns are unchanged. User-facing behavior is captured in the CHANGELOG.
  • The remote path calls process.exit(code ?? 1) in runner.onExit to mirror the frontend's exit code, matching the existing local-path teardown behavior in startServeCommand.
  • Existing (non---remote) base44 dev behavior is untouched — the refactor is behavior-preserving for the local path.
  • The test suite was not executed in this environment (bun run typecheck / bun run test were not permitted here), so the two verification boxes above are left unchecked.

🤖 Generated by Claude | 2026-08-03 13:20 UTC | 7702fbb

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.7-pr.588.7702fbb

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.7-pr.588.7702fbb"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.7-pr.588.7702fbb"
  }
}

Preview published to npm registry — try new features instantly!

…ction backend

--remote runs site.serveCommand with VITE_BASE44_APP_ID and
VITE_BASE44_APP_BASE_URL pointing at the app's own published URL, without
starting the local backend. It reuses the serveCommand runner local dev
uses; the only differences are the URL and that nothing else starts.
Config errors beat network errors: a missing site.serveCommand is
reported before the published URL is fetched, and an unpublished app
fails rather than falling back to the shared host. --port is rejected —
it configures the local backend, which --remote does not start.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@davidsu
davidsu merged commit 10ad141 into main Aug 4, 2026
13 checks passed
@davidsu
davidsu deleted the feat/dev-remote branch August 4, 2026 11: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.

2 participants