Repository navigation
feat(deploy): ship every site through the deployments API, and publish it - #643
Draft
netanelgilad wants to merge 6 commits into
Draft
netanelgilad wants to merge 6 commits into
netanelgilad wants to merge 6 commits into
Conversation
base44 dev now serves the whole app on one origin. /api/apps stays with the local backend; everything else — the app's own /api routes included — is forwarded to its dev server carrying Base44-App-Id, Base44-Api-Url and a service-role credential, with the caller's copies of the platform-owned headers dropped first. Full-stack apps can build a client with createClientFromRequest locally, the way they do in production, instead of 500ing on every SSR loader and server function. The dev server's port is read off the URL it announces at startup (the front door's own port skipped, since the Vite plugin logs it as its proxy target), and a request that comes back marked as forwarded answers 508 naming the Vite proxy rather than looping. Websocket upgrades follow the same split, so HMR reaches the app and the entity-events socket stays local. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
…h it `BASE44_DEPLOYMENTS_API` is gone. The lane it gated is now the only transport `site deploy` has, and `--git-hash` / `--concurrency` are always registered rather than appearing only when an env var was set. Setting the variable does nothing; the sandbox that sets it needs no change. `base44 deploy` ships its site through the same lane instead of the archive upload, so a full-stack project's worker is no longer silently dropped, and a build carries the commit it was made at. Because that lane only builds, the deploy then publishes what it deployed (`--no-publish` opts out) — the archive upload it replaces always left the app live, and a deploy that quietly stopped doing so would be a worse default than a flag. `site deploy` deliberately does NOT publish, and gains `--publish` instead: the platform's own build step runs it against builder-managed apps and repoints production itself, so publishing there would fail exactly those apps. When the server does refuse a publish for that reason (`app_publishes_from_builder`), the deploy reports it and still succeeds — its resources and its build did land. The archive upload keeps the two callers that have no commit to be addressed by: `base44 create`'s scaffold deploy, and a `base44 deploy` in a project with no git history, which warns and falls back. A worker build has no archive form, so there a missing commit is fatal. Depends on base44-dev/apper#26921 for the publish endpoint. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
…on-55ncqj # Conflicts: # CHANGELOG.md # docs/deployments.md # packages/cli/src/cli/dev/serve-command-runner.ts
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.32-pr.643.d9f6a73Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.32-pr.643.d9f6a73"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.32-pr.643.d9f6a73"
}
}
Preview published to npm registry — try new features instantly! |
…ards them too The compiled binary answered every HMR upgrade with an error: under Bun, bytes written to the socket a node:http `upgrade` listener receives never reach the wire, so neither http-proxy's tunnel nor a raw-socket pipe can complete a handshake from it. `ws` is the one path Bun maps onto its native websockets — it is how Socket.IO's realtime socket already worked there — so the front door now accepts the browser's socket with it and relays frames to a `ws` client connected to the dev server, carrying the same SDK headers the HTTP path does. The two paths now share one `sdkHeaders()` definition. The HMR test asserted only that the socket opened, which a relay satisfies on its own, so it now waits for the dev server's own frame and checks what that frame says the upgrade arrived with. The fixture also tolerates a reset socket, as a real dev server does: Bun's client resets rather than closing, and the unhandled error killed the fixture and with it the dev environment. Adds `ws` (8.21.0, already locked through miniflare) and `@types/ws` as devDependencies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
Resolves site/deploy.ts against #649's defaulted site block: siteOutputDir() now always returns a path, so the "No site configuration found" guard this branch had re-added is unreachable and goes. The output directory is resolved before the commit, so a defaulted block is reported before anything can fail; #649's own test passes --git-hash so it still fails on the missing ./dist it was written for. bun.lock is main's plus this branch's ws / @types/ws. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
The dev-server front door and its tests now live in #659. This branch keeps only the deploy routing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tmb4PCrrV2SLRpBjkGAgXJ
netanelgilad
marked this pull request as draft
October 11, 2026 12:23
Contributor
Author
|
Parking this as a draft.
Generated by Claude Code |
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
base44 deploynow ships a project's site through the deployments API — the same lanebase44 site deployuses — instead of the legacy tar.gz archive upload, so a full-stack build's worker is no longer silently dropped by the unified deploy. Because deploying and publishing are separate acts server-side,deployfollows its deployment withPOST deployments/{git_hash}/publish(what the archive upload did implicitly), whilesite deploydeliberately does not — the platform's own build step calls it against builder-managed apps, which are published from the builder. TheBASE44_DEPLOYMENTS_APIenv gate is removed: every site deploy takes the lane, and--git-hash/--concurrencyare always available.Related Issue
None
Type of Change
Changes Made
publishDeployment()(core/site/api.ts, plusPublishDeploymentResponseSchemainschema.ts): a second call,POST deployments/{git_hash}/publish, addressed by the full commit hash rather than the derived deployment id.base44 deployships the site through the deployments lane (core/project/deploy.ts):deployProjectSite()resolves the commit, runsdeployToDeployments(), then publishes. New--git-hash <hash>(validated as 7–64 hex chars, defaults to the checkout's HEAD) and--no-publishflags; no--concurrency, since the caller uploading at scale issite deploy. Asset and warning progress is surfaced through a newonSiteProgresscallback.site.outputDirectoryand no git history warns and falls back todeploySite(), which publishes as it always did. A worker build has no archive form, so a missing commit stays fatal there. The only other caller left isbase44 create's scaffold deploy.extra_data.code === "app_publishes_from_builder"is reported as "production was left where it was" and the command still succeeds — its resources and its build did deploy. Any other publish error still fails.hasResourcesToDeploy()is now async and counts a detected full-stack artifact as a site, so a worker build with nosite.outputDirectoryis no longer reported as "No resources found to deploy".deploymentsApiEnabled()deleted fromcore/site/deployment.ts;site deployalways takes the lane, always registers--git-hash/--concurrency, and gains an opt-in--publishthat prints the app URL. Its--jsondocument now carriespublished.cli/commands/site/deploy.ts(deployTarball), and the output directory is resolved before the git hash so a defaultedsiteblock is reported before anything else can fail.deployfor publish-by-default,--no-publish, the builder-managed case, a hard publish failure, and the no-commit archive fallback;site deploytests for not publishing and for--publish; allBASE44_DEPLOYMENTS_APIsetup removed from the deployment specs. Testkit gainsmockDeploymentPublish(),mockDeploymentPublishError(), apublishedCommitsrecorder, andmockSiteDeployError()renamed tomockDeploymentCreateError().docs/deployments.mdrewritten around "deploying and publishing are separate acts", the per-command publish rules, and what is left of the archive upload; two CHANGELOG entries added.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Worth calling out for automated callers:
BASE44_DEPLOYMENTS_APInow does nothing (setting it is harmless), andbase44 deployin a git checkout no longer usesdeploy-dist— it creates a deployment and publishes it. The platform build sandbox'sbase44 site deploy -y --json --git-hash <commit>invocation is unchanged and still does not publish.🤖 Generated by Claude | 2026-10-11 12:24 UTC | d9f6a73