fix(deploy): ship worker builds through the deployments API without the env gate - #639
Open
netanelgilad wants to merge 1 commit into
Open
netanelgilad wants to merge 1 commit into
netanelgilad wants to merge 1 commit into
Conversation
…he env gate A build that emits a worker (`.wrangler/deploy/config.json`, e.g. TanStack Start via Nitro's cloudflare_module preset) could only be shipped with the internal BASE44_DEPLOYMENTS_API=1 gate on. `base44 deploy` and an ungated `base44 site deploy` took the legacy tar.gz upload, which cannot carry a worker, and failed on the `./dist` the build never wrote — so the command the TanStack template README documents did not work. Route on the artifact instead of the gate: `hasWorkerBuild()` sends a worker build down the deployments lane from both commands, addressed by `--git-hash` when the gate registers it and by the checkout's HEAD otherwise. The gate now decides the transport for static output only, so a build with no worker behaves exactly as before. `base44 deploy` resolves the commit before pushing any resource, so a checkout with no commit fails whole rather than half-deployed, counts a worker build as a site with no `site.outputDirectory`, and prints the deployment id in place of an app URL (what production serves is still decided by the builder publish). Verified against production with the built CLI: `base44 deploy -y` on a TanStack Start app with the gate off created deployment `<app>-git-43b290fc4d4a` and the commit host served the SSR page and its `/api/time` server route. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DZyhGxySR6qtgBF6TPfCt3
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.18-pr.639.a559cb8Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.18-pr.639.a559cb8"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.18-pr.639.a559cb8"
}
}
Preview published to npm registry — try new features instantly! |
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
A build that emits a Cloudflare worker (
.wrangler/deploy/config.json, e.g. TanStack Start via Nitro'scloudflare_modulepreset) could only ship with the internalBASE44_DEPLOYMENTS_API=1gate on.base44 deployand an ungatedbase44 site deploytook the legacy tar.gz upload, which cannot carry a worker, and failed on the./distthe build never wrote — so the command the TanStack template README documents did not work. This PR routes on the artifact instead of the env gate:hasWorkerBuild()sends a worker build down the deployments-API lane from both commands, while the gate now decides the transport for static output only, leaving no-worker builds behaving exactly as before.Related Issue
None
Type of Change
Changes Made
hasWorkerBuild(projectRoot)tocore/site/deployment.ts— a thindetectFullStackArtifact()check — and narroweddeploymentsApiEnabled()'s doc comment to the static-output transport choice it now governs.site deploypicks the transport withworkerBuild || deploymentsApiEnabled(), so a worker build takes the deployments API whatever the env says, and its confirmation prompt no longer namessite.outputDirectory(the worker brings its own assets directory).deployAll()resolves the commit up front (resolveGitHash()) when a worker build is present, before any resource is pushed, so a checkout with no commit fails whole rather than half-deployed; it then ships throughdeployToDeployments()and returns adeployment: { deploymentId, gitHash }instead of anappUrl.hasResourcesToDeploy()takes a{ workerBuild }option and counts a worker build as a site even with nosite.outputDirectory.base44 deploylists- Sitein its summary for a worker build and printsDeployment: <id> (commit <hash>)in place of an app URL — nothing is live until the app is published from the builder.docs/deployments.md(artifact detection,base44 deploybehavior, the env-gate section) and added the invariant: a worker build never takes the tar.gz path.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
Four new integration tests cover both commands: a worker build shipping through the deployments API addressed by HEAD with no gate set, and a worker build with no commit failing before any resource is pushed (asserting zero
deploymentCreateRequests). AgitInitWithCommit()testkit helper turns a copied fixture into a one-commit checkout and returns its HEAD.Verified against production with the built CLI:
base44 deploy -yon a TanStack Start app with the gate off created deployment<app>-git-43b290fc4d4a, and the commit host served the SSR page and its/api/timeserver route. The test suite was not re-run in this environment (the repo usesbun run test, notnpm test) — CI covers it.🤖 Generated by Claude | 2026-09-23 16:15 UTC | a559cb8