feat(deploy): opt-in build step — --build / --no-build / interactive ask - #587
Merged
Conversation
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.7-pr.587.7ed9b75Prefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.7-pr.587.7ed9b75"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.7-pr.587.7ed9b75"
}
}
Preview published to npm registry — try new features instantly! |
davidsu
force-pushed
the
feat/deploy-build
branch
from
August 3, 2026 07:43
7d4258a to
3d2b3d9
Compare
base44 deploy and base44 site deploy can build the site before uploading: an interactive run asks, --build / --no-build pre-answer, and non-interactive runs default to upload-only so CI behavior is unchanged. The build logic moves from build.ts into site-build.ts, shared by the command and both deploy call sites (same gate shape in both). eject opts out explicitly — its deploy already follows a fresh build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/deploy-build
branch
from
August 3, 2026 11:29
3d2b3d9 to
1e137fd
Compare
yardend-wix
reviewed
Aug 3, 2026
yardend-wix
reviewed
Aug 3, 2026
yardend-wix
previously approved these changes
Aug 3, 2026
Both deploy call sites carried the identical gate → ask → build block; maybeBuildBeforeDeploy(ctx, project, build) is now the one copy. Review feedback from #587. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…build --build states intent; silently uploading without building betrays it. The flag is now honored before any site-config gate, so a missing site.buildCommand (or a project with no site at all) fails with the existing ConfigNotFoundError instead of no-opping. The silent paths — no flag, --no-build, non-interactive — are unchanged, and the ask still only appears when a buildCommand exists. Review feedback from #587. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
yardend-wix
approved these changes
Aug 3, 2026
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 deployandbase44 site deploycan now run the site'sbuildCommandbefore uploading, so a deploy no longer silently ships a stale bundle. Interactive runs ask "Build the site first?", and the new--build/--no-buildflags pre-answer that prompt (--buildis the only way to opt in non-interactively). The build reuses the samerunSiteBuildhelper asbase44 build, soVITE_BASE44_APP_IDis injected, a failing build aborts the deploy, and an explicit--builderrors out instead of silently doing nothing when nosite.buildCommandis configured.Related Issue
None — follow-up to
base44 build(#586).Type of Change
Changes Made
maybeBuildBeforeDeploy()tocli/commands/project/site-build.ts— a single entry point both deploy commands call. It no-ops when no app is linked; an explicit--buildalways delegates torunSiteBuild(which throwsConfigNotFoundErrorwith a hint whensite.buildCommandis missing, so the flag is never silently ignored); otherwise it only considers building whensite.outputDirectoryis configured and asks viashouldAskToBuild()(no prompt, and no build, when there is nobuildCommand, when non-interactive, or when the prompt is cancelled).project/deploy.ts(after the deploy summary) andsite/deploy.ts(before the archive/upload task).--build/--no-buildon both commands. Commander folds these into onebuildoption, so an absent flag staysundefinedand keeps the interactive prompt.CLIContextinstead of destructuring it, since the helper needsctx.app,ctx.runTask, andctx.isNonInteractive.eject.tspassesbuild: falseto its internal auto-deploy so ejecting never prompts or rebuilds.deploy --buildsuite intests/cli/build.spec.tscovering--build,--no-build, flag-absent-in-non-interactive,site deploy --build, a failing build aborting the deploy, and--buildfailing on projects with nobuildCommand/ nositeconfig.with-buildable-siteandwith-failing-buildgained anoutputDirectoryplus asite-output/index.htmlso the deploy path is reachable.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The build decision lives in the CLI layer because it owns the prompt, matching the existing rule that
core/stays UI-free. Two behaviours worth a reviewer's eye: in non-interactive mode a missing flag means no build, so CI pipelines must pass--buildexplicitly to get one; and--buildis deliberately strict — it fails the deploy when there is nothing to build, rather than falling through to the upload.🤖 Generated by Claude | 2026-08-03 12:23 UTC | 7ed9b75