@base44-preview/cli 0.1.33-pr.643.ff0b86e → 0.2.0-pr.671.556605b

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
@@ -239376,7 +239376,7 @@ import { join as join13 } from "node:path";
239376
239376
  // package.json
239377
239377
  var package_default = {
239378
239378
  name: "base44",
239379
- version: "0.1.33",
239379
+ version: "0.2.0",
239380
239380
  description: "Base44 CLI - Unified interface for managing Base44 applications",
239381
239381
  type: "module",
239382
239382
  bin: {
@@ -239691,7 +239691,10 @@ async function publishDeployment(gitHash) {
239691
239691
  } catch (error) {
239692
239692
  throw await ApiError.fromHttpError(error, "publishing deployment");
239693
239693
  }
239694
- return { gitHash, appUrl: await getSiteUrl() };
239694
+ const appUrl = await getSiteUrl().catch(() => {
239695
+ return;
239696
+ });
239697
+ return { gitHash, appUrl };
239695
239698
  }
239696
239699
  // src/core/site/config.ts
239697
239700
  async function getSiteFilePaths(outputDir) {
@@ -246850,22 +246853,21 @@ function isGitCommitHash(value) {
246850
246853
  }
246851
246854
 
246852
246855
  // src/core/site/git-hash.ts
246853
- async function resolveGitHash(projectRoot, explicit) {
246854
- const hash = explicit ?? await gitHead(projectRoot);
246855
- if (!hash || !isGitCommitHash(hash)) {
246856
- throw new InvalidInputError(explicit ? `'${explicit}' is not a git commit hash.` : "Deployments are addressed by the commit that produced the build, and no git commit was found.", {
246857
- hints: [
246858
- {
246859
- message: "Run the deploy from a git checkout, or pass the commit explicitly with --git-hash."
246860
- }
246861
- ]
246862
- });
246863
- }
246864
- return hash;
246856
+ function workerBuildNeedsGitHashError() {
246857
+ return new InvalidInputError("A full-stack build deploys by the commit that produced it, and none was given.", {
246858
+ hints: [
246859
+ {
246860
+ message: "Pass it with --git-hash, e.g. --git-hash $(git rev-parse HEAD)."
246861
+ }
246862
+ ]
246863
+ });
246865
246864
  }
246866
246865
  async function resolveProvenanceCommit(projectRoot, explicit) {
246867
246866
  if (explicit) {
246868
- return await resolveGitHash(projectRoot, explicit);
246867
+ if (!isGitCommitHash(explicit)) {
246868
+ throw new InvalidInputError(`'${explicit}' is not a git commit hash.`);
246869
+ }
246870
+ return explicit;
246869
246871
  }
246870
246872
  const hash = await gitHead(projectRoot);
246871
246873
  return hash && isGitCommitHash(hash) ? hash : undefined;
@@ -246914,6 +246916,9 @@ async function deployAll(projectData, options) {
246914
246916
  connectors,
246915
246917
  authConfig
246916
246918
  } = projectData;
246919
+ if (!options?.gitHash && await detectFullStackArtifact(project.root)) {
246920
+ throw workerBuildNeedsGitHashError();
246921
+ }
246917
246922
  await setAppVisibility(project.visibility);
246918
246923
  if (project.visibility) {
246919
246924
  options?.onVisibilitySet?.(project.visibility);
@@ -246957,22 +246962,15 @@ async function deployAll(projectData, options) {
246957
246962
  async function deployProjectSite(project, options) {
246958
246963
  const outputDirectory = project.site?.outputDirectory;
246959
246964
  const outputDir = outputDirectory ? resolve5(project.root, outputDirectory) : null;
246960
- if (!outputDir) {
246961
- if (!await detectFullStackArtifact(project.root)) {
246962
- return;
246963
- }
246964
- const gitHash = await resolveGitHash(project.root, options?.gitHash);
246965
- return shipCommit(project.root, null, gitHash, options);
246965
+ const gitHash = options?.gitHash;
246966
+ if (gitHash && (outputDir || await detectFullStackArtifact(project.root))) {
246967
+ return shipCommit(project.root, outputDir, gitHash, options);
246966
246968
  }
246967
- const gitHash = await resolveGitHash(project.root, options?.gitHash).catch(() => {
246969
+ if (!outputDir) {
246968
246970
  return;
246969
- });
246970
- if (!gitHash) {
246971
- options?.onSiteProgress?.("No commit found for this build, so it was deployed without one. Commit your work to address deployments by it.");
246972
- const { appUrl } = await deploySite(outputDir);
246973
- return appUrl;
246974
246971
  }
246975
- return shipCommit(project.root, outputDir, gitHash, options);
246972
+ const { appUrl } = await deploySite(outputDir);
246973
+ return appUrl;
246976
246974
  }
246977
246975
  async function shipCommit(projectRoot, outputDir, gitHash, options) {
246978
246976
  await deployToDeployments({
@@ -252098,7 +252096,7 @@ ${summaryLines.join(`
252098
252096
  return { outroMessage: "App deployed successfully" };
252099
252097
  }
252100
252098
  function getDeployCommand3() {
252101
- return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, 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)").addOption(new Option2("--git-hash <hash>", "Commit the built site came from (defaults to the checkout's HEAD)").argParser(parseGitHash)).action(deployAction);
252099
+ return new Base44Command("deploy").description("Deploy all project resources (entities, functions, actors, 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)").addOption(new Option2("--git-hash <hash>", "Deploy by the commit the build came from, through the deployments API").argParser(parseGitHash)).action(deployAction);
252102
252100
  }
252103
252101
  async function handleOAuthConnectors(connectorResults, isNonInteractive, options, log) {
252104
252102
  const needsOAuth = filterPendingOAuth(connectorResults);
@@ -264801,12 +264799,11 @@ async function deployToDeploymentsApi(ctx, project, options) {
264801
264799
  const { runTask, log, jsonMode } = ctx;
264802
264800
  const projectRoot = project.root;
264803
264801
  const outputDir = siteOutputDir(project);
264804
- const gitHash = await resolveGitHash(projectRoot, options.gitHash).catch(async (error) => {
264805
- if (await detectFullStackArtifact(projectRoot))
264806
- throw error;
264807
- return;
264808
- });
264802
+ const gitHash = options.gitHash;
264809
264803
  if (!gitHash) {
264804
+ if (await detectFullStackArtifact(projectRoot)) {
264805
+ throw workerBuildNeedsGitHashError();
264806
+ }
264810
264807
  return deployArchive(ctx, outputDir);
264811
264808
  }
264812
264809
  const progressLines = [];
@@ -264840,9 +264837,9 @@ async function deployToDeploymentsApi(ctx, project, options) {
264840
264837
  log.warn(warning);
264841
264838
  }
264842
264839
  const published = options.publish ? await runTask("Publishing site...", async () => await publishDeployment(gitHash), { successMessage: "Site published", errorMessage: "Publish failed" }) : undefined;
264843
- if (published) {
264840
+ if (published?.appUrl) {
264844
264841
  log.message(`${theme.styles.header("App URL")}: ${theme.colors.links(published.appUrl)}`);
264845
- } else {
264842
+ } else if (!published) {
264846
264843
  log.info("Not published: production still serves its previous build. Run again with --publish to serve this one.");
264847
264844
  }
264848
264845
  return {
@@ -264851,12 +264848,11 @@ async function deployToDeploymentsApi(ctx, project, options) {
264851
264848
  ` : undefined
264852
264849
  };
264853
264850
  }
264854
- async function deployArchive({ runTask, log, jsonMode }, outputDir) {
264851
+ async function deployArchive({ runTask, jsonMode }, outputDir) {
264855
264852
  const { appUrl } = await runTask("Creating archive and deploying site...", async () => await deploySite(outputDir), {
264856
264853
  successMessage: "Site deployed successfully",
264857
264854
  errorMessage: "Deployment failed"
264858
264855
  });
264859
- log.warn("No commit found for this build, so it was deployed and published without one. Commit your work to address deployments by it.");
264860
264856
  return {
264861
264857
  outroMessage: `Visit your site at: ${appUrl}`,
264862
264858
  stdout: jsonMode ? `${JSON.stringify({ appUrl, published: true }, null, 2)}
@@ -264868,7 +264864,7 @@ function siteOutputDir(project) {
264868
264864
  return resolve16(project.root, outputDirectory);
264869
264865
  }
264870
264866
  function getSiteDeployCommand() {
264871
- 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)").option("--publish", "Serve this build in production once it is deployed").addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash)).addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency)).action(deployAction2);
264867
+ 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)").option("--publish", "Serve this build in production once it is deployed").addOption(new Option2("--git-hash <hash>", "Deploy by the commit the build came from, through the deployments API").argParser(parseGitHash)).addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency)).action(deployAction2);
264872
264868
  }
264873
264869
  function parseConcurrency(value) {
264874
264870
  const parsed = Number(value);
@@ -274013,4 +274009,4 @@ export {
274013
274009
  runCLI
274014
274010
  };
274015
274011
 
274016
- //# debugId=CFF726A044F3411C64756E2164756E21
274012
+ //# debugId=B539C7BB9AAE429D64756E2164756E21