Skip to content

fix(deploy): ship worker builds through the deployments API without the env gate - #639

Open
netanelgilad wants to merge 1 commit into
mainfrom
claude/tanstack-app-template-plan-92e8t5
Open

netanelgilad wants to merge 1 commit into
mainfrom
claude/tanstack-app-template-plan-92e8t5

Conversation

@netanelgilad

@netanelgilad netanelgilad commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Note

Description

A build that emits a Cloudflare worker (.wrangler/deploy/config.json, e.g. TanStack Start via Nitro's cloudflare_module preset) could only ship 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. 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

  • 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

  • Added hasWorkerBuild(projectRoot) to core/site/deployment.ts — a thin detectFullStackArtifact() check — and narrowed deploymentsApiEnabled()'s doc comment to the static-output transport choice it now governs.
  • site deploy picks the transport with workerBuild || deploymentsApiEnabled(), so a worker build takes the deployments API whatever the env says, and its confirmation prompt no longer names site.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 through deployToDeployments() and returns a deployment: { deploymentId, gitHash } instead of an appUrl.
  • hasResourcesToDeploy() takes a { workerBuild } option and counts a worker build as a site even with no site.outputDirectory.
  • base44 deploy lists - Site in its summary for a worker build and prints Deployment: <id> (commit <hash>) in place of an app URL — nothing is live until the app is published from the builder.
  • Updated docs/deployments.md (artifact detection, base44 deploy behavior, the env-gate section) and added the invariant: a worker build never takes the tar.gz path.

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

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). A gitInitWithCommit() testkit helper turns a copied fixture into a one-commit checkout and returns its HEAD.

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. The test suite was not re-run in this environment (the repo uses bun run test, not npm test) — CI covers it.


🤖 Generated by Claude | 2026-09-23 16:15 UTC | a559cb8

…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
@netanelgilad netanelgilad self-assigned this Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.18-pr.639.a559cb8

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.18-pr.639.a559cb8"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.18-pr.639.a559cb8"
  }
}

Preview published to npm registry — try new features instantly!

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.

1 participant