@base44-preview/cli 0.1.17-pr.638.76ba6a7 → 0.1.18-pr.639.a559cb8

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
@@ -239251,7 +239251,7 @@ import { join as join13 } from "node:path";
239251
239251
  // package.json
239252
239252
  var package_default = {
239253
239253
  name: "base44",
239254
- version: "0.1.17",
239254
+ version: "0.1.18",
239255
239255
  description: "Base44 CLI - Unified interface for managing Base44 applications",
239256
239256
  type: "module",
239257
239257
  bin: {
@@ -240108,6 +240108,9 @@ function deploymentsApiEnabled(env = process.env) {
240108
240108
  const value = env[DEPLOYMENTS_API_ENV];
240109
240109
  return value === "1" || value === "true";
240110
240110
  }
240111
+ async function hasWorkerBuild(projectRoot) {
240112
+ return await detectFullStackArtifact(projectRoot) !== null;
240113
+ }
240111
240114
  async function deployToDeployments(options) {
240112
240115
  const { projectRoot, outputDir, gitHash, concurrency, progress } = options;
240113
240116
  const worker = await resolveWorkerBuild(projectRoot, progress);
@@ -246707,7 +246710,7 @@ async function gitHead(projectRoot) {
246707
246710
  }
246708
246711
  }
246709
246712
  // src/core/project/deploy.ts
246710
- function hasResourcesToDeploy(projectData) {
246713
+ function hasResourcesToDeploy(projectData, options = {}) {
246711
246714
  const {
246712
246715
  project,
246713
246716
  entities,
@@ -246718,7 +246721,7 @@ function hasResourcesToDeploy(projectData) {
246718
246721
  connectors,
246719
246722
  authConfig
246720
246723
  } = projectData;
246721
- const hasSite = Boolean(project.site?.outputDirectory);
246724
+ const hasSite = Boolean(project.site?.outputDirectory) || Boolean(options.workerBuild);
246722
246725
  const hasEntities = entities.length > 0;
246723
246726
  const hasFunctions = functions.length > 0;
246724
246727
  const hasActors = actors.length > 0;
@@ -246740,6 +246743,7 @@ async function deployAll(projectData, options) {
246740
246743
  connectors,
246741
246744
  authConfig
246742
246745
  } = projectData;
246746
+ const workerGitHash = await hasWorkerBuild(project.root) ? await resolveGitHash(project.root) : null;
246743
246747
  await setAppVisibility(project.visibility);
246744
246748
  if (project.visibility) {
246745
246749
  options?.onVisibilitySet?.(project.visibility);
@@ -246777,8 +246781,19 @@ async function deployAll(projectData, options) {
246777
246781
  await authConfigResource.push(authConfig);
246778
246782
  const skipConnectorSync = connectors.length === 0 && hasWorkspaceApiKeyAuth();
246779
246783
  const connectorResults = skipConnectorSync ? [] : (await pushConnectors(connectors)).results;
246780
- if (project.site?.outputDirectory) {
246781
- const outputDir = resolve5(project.root, project.site.outputDirectory);
246784
+ const outputDir = project.site?.outputDirectory ? resolve5(project.root, project.site.outputDirectory) : null;
246785
+ if (workerGitHash) {
246786
+ const { deploymentId } = await deployToDeployments({
246787
+ projectRoot: project.root,
246788
+ outputDir,
246789
+ gitHash: workerGitHash
246790
+ });
246791
+ return {
246792
+ deployment: { deploymentId, gitHash: workerGitHash },
246793
+ connectorResults
246794
+ };
246795
+ }
246796
+ if (outputDir) {
246782
246797
  const { appUrl } = await deploySite(outputDir);
246783
246798
  return { appUrl, connectorResults };
246784
246799
  }
@@ -249889,7 +249904,8 @@ async function deployAction(ctx, options = {}) {
249889
249904
  throw new InvalidInputError("--yes is required in non-interactive mode");
249890
249905
  }
249891
249906
  const projectData = await readProjectConfig(options.projectRoot);
249892
- if (!hasResourcesToDeploy(projectData)) {
249907
+ const workerBuild = await hasWorkerBuild(projectData.project.root);
249908
+ if (!hasResourcesToDeploy(projectData, { workerBuild })) {
249893
249909
  return {
249894
249910
  outroMessage: "No resources found to deploy"
249895
249911
  };
@@ -249925,7 +249941,9 @@ async function deployAction(ctx, options = {}) {
249925
249941
  if (project.visibility) {
249926
249942
  summaryLines.push(` - Visibility: ${project.visibility}`);
249927
249943
  }
249928
- if (project.site?.outputDirectory) {
249944
+ if (workerBuild) {
249945
+ summaryLines.push(" - Site");
249946
+ } else if (project.site?.outputDirectory) {
249929
249947
  summaryLines.push(` - Site from ${project.site.outputDirectory}`);
249930
249948
  }
249931
249949
  if (!options.yes) {
@@ -249980,6 +249998,10 @@ ${summaryLines.join(`
249980
249998
  if (result.appUrl) {
249981
249999
  log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
249982
250000
  }
250001
+ if (result.deployment) {
250002
+ const { deploymentId, gitHash } = result.deployment;
250003
+ log.message(`${theme.styles.header("Deployment")}: ${deploymentId} (commit ${gitHash.slice(0, 12)})`);
250004
+ }
249983
250005
  return { outroMessage: "App deployed successfully" };
249984
250006
  }
249985
250007
  function getDeployCommand3() {
@@ -250990,16 +251012,17 @@ async function deployAction2(ctx, options) {
250990
251012
  }
250991
251013
  const project = await readProjectSettings();
250992
251014
  await maybeBuildBeforeDeploy(ctx, project, options.build);
251015
+ const workerBuild = await hasWorkerBuild(project.root);
250993
251016
  if (!options.yes) {
250994
251017
  const outputDirectory = project.site?.outputDirectory;
250995
251018
  const shouldDeploy = await Re({
250996
- message: outputDirectory ? `Deploy site from ${outputDirectory}?` : "Deploy site?"
251019
+ message: outputDirectory && !workerBuild ? `Deploy site from ${outputDirectory}?` : "Deploy site?"
250997
251020
  });
250998
251021
  if (Ct(shouldDeploy) || !shouldDeploy) {
250999
251022
  return { outroMessage: "Deployment cancelled" };
251000
251023
  }
251001
251024
  }
251002
- return deploymentsApiEnabled() ? await deployToDeploymentsApi(ctx, project, options) : await deployTarball(ctx, project);
251025
+ return workerBuild || deploymentsApiEnabled() ? await deployToDeploymentsApi(ctx, project, options) : await deployTarball(ctx, project);
251003
251026
  }
251004
251027
  async function deployToDeploymentsApi(ctx, project, options) {
251005
251028
  const { runTask, log, jsonMode } = ctx;
@@ -259961,4 +259984,4 @@ export {
259961
259984
  runCLI
259962
259985
  };
259963
259986
 
259964
- //# debugId=815732FBC7D9653064756E2164756E21
259987
+ //# debugId=752874D903B2231464756E2164756E21