@base44-preview/cli 0.1.7-pr.586.967fb6f → 0.1.7-pr.587.23e6e24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli/index.js CHANGED
@@ -256660,6 +256660,25 @@ async function runSiteBuild({ runTask: runTask2 }, { root, buildCommand, appId }
256660
256660
  errorMessage: "Build failed"
256661
256661
  });
256662
256662
  }
256663
+ async function shouldBuildBeforeDeploy({
256664
+ build,
256665
+ isNonInteractive,
256666
+ buildCommand
256667
+ }) {
256668
+ if (!buildCommand) {
256669
+ return false;
256670
+ }
256671
+ if (build !== undefined) {
256672
+ return build;
256673
+ }
256674
+ if (isNonInteractive) {
256675
+ return false;
256676
+ }
256677
+ const answer = await Re({
256678
+ message: `Build the site first? (runs '${buildCommand}' with your app id)`
256679
+ });
256680
+ return !Ct(answer) && answer;
256681
+ }
256663
256682
 
256664
256683
  // src/cli/commands/project/build.ts
256665
256684
  async function buildAction(ctx) {
@@ -256949,7 +256968,8 @@ Examples:
256949
256968
  }
256950
256969
 
256951
256970
  // src/cli/commands/project/deploy.ts
256952
- async function deployAction({ isNonInteractive, log }, options = {}) {
256971
+ async function deployAction(ctx, options = {}) {
256972
+ const { isNonInteractive, log } = ctx;
256953
256973
  if (isNonInteractive && !options.yes) {
256954
256974
  throw new InvalidInputError("--yes is required in non-interactive mode");
256955
256975
  }
@@ -256997,6 +257017,20 @@ ${summaryLines.join(`
256997
257017
  ${summaryLines.join(`
256998
257018
  `)}`);
256999
257019
  }
257020
+ if (ctx.app && project2.site?.outputDirectory) {
257021
+ const shouldBuild = await shouldBuildBeforeDeploy({
257022
+ build: options.build,
257023
+ isNonInteractive,
257024
+ buildCommand: project2.site.buildCommand
257025
+ });
257026
+ if (shouldBuild) {
257027
+ await runSiteBuild(ctx, {
257028
+ root: project2.root,
257029
+ buildCommand: project2.site.buildCommand,
257030
+ appId: ctx.app.id
257031
+ });
257032
+ }
257033
+ }
257000
257034
  let functionCompleted = 0;
257001
257035
  const functionTotal = functions.length;
257002
257036
  const result = await deployAll(projectData, {
@@ -257025,7 +257059,7 @@ ${summaryLines.join(`
257025
257059
  return { outroMessage: "App deployed successfully" };
257026
257060
  }
257027
257061
  function getDeployCommand2() {
257028
- return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(deployAction);
257062
+ return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction);
257029
257063
  }
257030
257064
  async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
257031
257065
  const needsOAuth = filterPendingOAuth(connectorResults);
@@ -257891,7 +257925,8 @@ function getSecretsCommand() {
257891
257925
 
257892
257926
  // src/cli/commands/site/deploy.ts
257893
257927
  import { resolve as resolve11 } from "node:path";
257894
- async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
257928
+ async function deployAction2(ctx, options) {
257929
+ const { isNonInteractive, runTask: runTask2 } = ctx;
257895
257930
  if (isNonInteractive && !options.yes) {
257896
257931
  throw new InvalidInputError("--yes is required in non-interactive mode");
257897
257932
  }
@@ -257914,6 +257949,20 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
257914
257949
  return { outroMessage: "Deployment cancelled" };
257915
257950
  }
257916
257951
  }
257952
+ if (ctx.app && project2.site?.outputDirectory) {
257953
+ const shouldBuild = await shouldBuildBeforeDeploy({
257954
+ build: options.build,
257955
+ isNonInteractive,
257956
+ buildCommand: project2.site.buildCommand
257957
+ });
257958
+ if (shouldBuild) {
257959
+ await runSiteBuild(ctx, {
257960
+ root: project2.root,
257961
+ buildCommand: project2.site.buildCommand,
257962
+ appId: ctx.app.id
257963
+ });
257964
+ }
257965
+ }
257917
257966
  const result = await runTask2("Creating archive and deploying site...", async () => {
257918
257967
  return await deploySite(outputDir);
257919
257968
  }, {
@@ -257923,7 +257972,7 @@ async function deployAction2({ isNonInteractive, runTask: runTask2 }, options) {
257923
257972
  return { outroMessage: `Visit your site at: ${result.appUrl}` };
257924
257973
  }
257925
257974
  function getSiteDeployCommand() {
257926
- return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(deployAction2);
257975
+ return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").option("--build", "Build the site before deploying (skips the prompt)").option("--no-build", "Deploy without building (skips the prompt)").action(deployAction2);
257927
257976
  }
257928
257977
 
257929
257978
  // src/cli/commands/site/open.ts
@@ -262418,7 +262467,11 @@ async function eject(ctx, options8, command2) {
262418
262467
  successMessage: theme.colors.base44Orange("Project built successfully"),
262419
262468
  errorMessage: "Failed to build project"
262420
262469
  });
262421
- await deployAction(ctx, { yes: true, projectRoot: resolvedPath });
262470
+ await deployAction(ctx, {
262471
+ yes: true,
262472
+ build: false,
262473
+ projectRoot: resolvedPath
262474
+ });
262422
262475
  }
262423
262476
  }
262424
262477
  return { outroMessage: "Your new project is set and ready to use" };
@@ -266713,4 +266766,4 @@ export {
266713
266766
  CLIExitError
266714
266767
  };
266715
266768
 
266716
- //# debugId=3CB9814E7E611A3164756E2164756E21
266769
+ //# debugId=1FB40B1345DFA60B64756E2164756E21