feat: full-stack deployments — deploy/promote/rollback/logs for Workers-based apps#559
Open
netanelgilad wants to merge 5 commits into
Open
feat: full-stack deployments — deploy/promote/rollback/logs for Workers-based apps#559netanelgilad wants to merge 5 commits into
netanelgilad wants to merge 5 commits into
Conversation
…rs-based apps
Add first-class full-stack (Cloudflare Workers) deployments to the CLI,
targeting the new app-scoped deployments API:
- core/deployments/: wrangler config resolution (.wrangler/deploy/config.json
redirect + root wrangler.jsonc fallback, toml rejected, no_bundle required,
binding policing), app-id-salted asset manifest hashing (sha256, 32 hex
chars, .assetsignore support, 25 MiB/100k caps), module collection from
rules globs (sourcemaps, 40 MB cap), direct bucket uploads (concurrency 3,
retry with backoff, 401 session-expired handling), and the create/finalize/
list/get/promote/rollback/logs API surface with Zod-validated responses.
- deploy command: detects a full-stack artifact after the resource pushes and
routes it through the deployments API instead of the legacy site tar.gz;
--prod/--build/--prebuilt flags; wrangler-style progress; --json emits
{deploymentId, target, urls}. Legacy behavior unchanged otherwise.
- new commands: deployments list/get, promote <id>, rollback [-y].
- logs --deployment <id|production> with all existing filters + --follow.
- testkit mocks (create/asset-upload/finalize/list/get/promote/rollback/logs)
with request capture, fullstack-project fixture, 25 unit + 25 CLI tests.
- docs/deployments.md topic guide, linked from AGENTS.md.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.1-pr.559.d9cc6f9Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.1-pr.559.d9cc6f9"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.1-pr.559.d9cc6f9"
}
}
Preview published to npm registry — try new features instantly! |
…, prerender redirect field) Two corrections from live testing against real framework output: - Warn when the resolved wrangler config lacks the nodejs_compat compatibility flag (Astro 6 can generate an empty compatibility_flags); the flag is not injected since the fix belongs in the framework's adapter settings. Surfaced via a new onWarning progress callback. - Document + pin with a test that extra redirect-file fields (auxiliaryWorkers, Astro 6's prerenderWorkerConfigPath) are ignored (the redirect schema is a looseObject). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
Add a `base44 domains` command family for connecting custom domains to deployed full-stack apps (Cloudflare-for-SaaS custom hostnames), part of the full-stack hosting POC. core/domains: - addDomain / listDomains / removeDomain via the app client with Zod snake→camel transforms and ApiError.fromHttpError. - waitForDomainActive: polls listDomains until the hostname + SSL are active; TimeoutError (new UserError) when it never activates. cli/commands/domains: - `domains add <hostname>` prints the exact DNS record (CNAME <hostname> → <cname-target>) and current status; `--wait` polls until the domain and its TLS cert are active with a spinner. - `domains list` (padded table), `domains remove <hostname>` (confirm, -y in non-interactive). All honor the global --json contract. Registered getDomainsCommand() in program.ts. Added testkit mocks (mockDomainAdd/List/Remove + error variants) and domains.spec.ts in the Given/When/Then style. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
… binary charset - Drop unused exports flagged by knip (WaitForDomainOptions, DomainVerification, mockDomainListError). - Pin test fixtures to LF via .gitattributes: the deploy tests hash fixture bytes, and autocrlf checkout on Windows changed the bytes so the manifest hashes never matched the mocked upload buckets. - Accept the charset suffix Bun's compiled binary adds to multipart part content types (text/html;charset=utf-8). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
Add a `base44 slug` command family for the app's URL slug — its public
subdomain (`<slug>.base44.app`), which the production URL follows.
core/slug:
- getSlug reads the slug from the app document (GET api/apps/{id});
updateSlug PATCHes api/apps/{id}/metadata/slug ({slug} or {slug: null}
to reset to the auto-generated slug), both Zod-validated.
- When a requested slug is already in use, the API's 400 body includes
alternative suggestions — surfaced as a hint on the thrown ApiError.
cli/commands/slug:
- `slug` (default action) shows the current slug + app URL (via the
existing published-url endpoint); `slug set <slug>` prints old → new
slug and the resulting production URL; `slug reset` prints the newly
auto-generated slug. All honor the global --json contract.
- allowExcessArguments(false) so a mistyped subcommand errors instead
of silently showing the current slug.
Registered getSlugCommand() in program.ts. Added testkit support for
PATCH routes plus mockAppGet/mockSlugUpdate(+Error) mocks, and
slug.spec.ts in the Given/When/Then style (show/set/reset, invalid
format 400, taken slug with suggestions, server error).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DvhQfqxACcq25XAQRpoSh9
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
This PR adds first-class support for full-stack deployments — hosting framework builds (React Router 7, TanStack Start, Astro 6, vinext, anything built with
@cloudflare/vite-plugin) as Cloudflare Workers on Base44. It introduces a newsrc/core/deployments/module that detects the wrangler artifact, hashes and uploads static assets, collects Worker modules, and drives the create → upload → finalize API flow. Thebase44 deploycommand now automatically prefers this Workers path over the legacy site tar.gz upload when an artifact is present, and newdeployments,promote,rollback, anddomainscommands round out the lifecycle. It also adds custom domain management (base44 domains add/list/remove) and extendsbase44 logsto stream deployment logs.Related Issue
None
Type of Change
Changes Made
Full-stack deployments (
src/core/deployments/)wrangler-config.ts— detects the deploy artifact via.wrangler/deploy/config.jsonredirect, rootwrangler.json(c), or errors on unsupportedwrangler.toml; validatesno_bundle: trueand rejects unsupported bindings while passingvarsthrough. Handles Astro 6 quirks (emptycompatibility_flags, extra redirect-file fields).manifest.ts— walks the assets directory, applies.assetsignore, and hashes files assha256(app_id || bytes)(app-id-salted to prevent cross-tenant cache poisoning), with 25 MiB per-file and 100k file caps.modules.ts— collects Worker modules per the wranglerrulesglobs, including source maps, capped at 40 MB.upload.ts— uploads asset buckets directly to the signedupload_url(base64 multipart, bearer JWT, concurrency 3 with retries/backoff).api.ts/deploy.ts/schema.ts— the create → bucket upload → finalize flow, plus list/get/promote/rollback/logs API calls with Zod schemas.CLI commands
base44 deploywith--prod,--build, and--prebuiltflags; builds when configured and routes to the full-stack path when an artifact exists (legacy behavior unchanged otherwise).base44 deployments list/get <id>,base44 promote <id>, andbase44 rollback [-y].base44 domains add/list/remove(src/core/domains/) with live status polling for connecting custom domains.base44 logswith--deployment <id|production>and live--followstreaming.program.ts; added error classes incore/errors.ts.Docs & tests
docs/deployments.mdtopic guide; updateddocs/AGENTS.md,docs/resources.md,docs/testing.md.TestAPIServertestkit with deployment/asset-upload/finalize/promote/rollback/logs mocks and afullstack-projectfixture.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Full-stack support is limited to
no_bundle: trueoutputs with no non-varsbindings;wrangler.tomland bundled outputs fail fast with clear errors. The legacy site tar.gz deploy path is preserved unchanged for apps without a full-stack artifact. A follow-up commit greens CI (knip dead exports, Windows fixture line-endings, Bun binary charset).🤖 Generated by Claude | 2026-07-06 14:37 UTC | 1712ae1