@base44-preview/cli 0.1.14-pr.626.1f4a29d → 0.1.14-pr.626.28bcbc7

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
@@ -249480,6 +249480,12 @@ async function collectResources(configDir, dirs) {
249480
249480
  ]);
249481
249481
  return { entities, agents };
249482
249482
  }
249483
+ // src/core/version/gate.ts
249484
+ var VERSIONS_API_ENV = "BASE44_VERSIONS_API";
249485
+ function versionsApiEnabled(env = process.env) {
249486
+ const value = env[VERSIONS_API_ENV];
249487
+ return value === "1" || value === "true";
249488
+ }
249483
249489
  // src/core/version/project.ts
249484
249490
  import { dirname as dirname19, join as join27, resolve as resolve10 } from "node:path";
249485
249491
  var DEFAULT_BUILD_COMMAND = "npm run build";
@@ -250444,6 +250450,31 @@ function getVisibilityCommand() {
250444
250450
  ])).action(setVisibility);
250445
250451
  }
250446
250452
 
250453
+ // src/cli/commands/versions/options.ts
250454
+ function outputDirOption() {
250455
+ return new Option2("--output-dir <dir>", "Build output directory (defaults to the project's, else dist)");
250456
+ }
250457
+ function targetOption() {
250458
+ return new Option2("--target <name>", "Environment to serve the version at");
250459
+ }
250460
+ function gitHashOption() {
250461
+ return new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser((value) => {
250462
+ if (!isGitCommitHash(value)) {
250463
+ throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
250464
+ }
250465
+ return value;
250466
+ });
250467
+ }
250468
+ function concurrencyOption() {
250469
+ return new Option2("--concurrency <n>", "Parallel file uploads").default(DEFAULT_VERSION_UPLOAD_CONCURRENCY).argParser((value) => {
250470
+ const parsed = Number(value);
250471
+ if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_VERSION_UPLOAD_CONCURRENCY) {
250472
+ throw new InvalidArgumentError2(`Expected a whole number between 1 and ${MAX_VERSION_UPLOAD_CONCURRENCY}.`);
250473
+ }
250474
+ return parsed;
250475
+ });
250476
+ }
250477
+
250447
250478
  // src/cli/commands/publish.ts
250448
250479
  async function publishAction(ctx, options) {
250449
250480
  const { runTask, log, jsonMode, app } = ctx;
@@ -250484,20 +250515,7 @@ async function publishAction(ctx, options) {
250484
250515
  };
250485
250516
  }
250486
250517
  function getPublishCommand() {
250487
- return new Base44Command("publish").description("Build the app, record it as a version, and serve that version").option("--no-build", "Publish the existing build output without rebuilding").option("--output-dir <dir>", "Build output directory (defaults to the project's, else dist)").option("--target <name>", "Environment to serve the version at").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 file uploads").default(DEFAULT_VERSION_UPLOAD_CONCURRENCY).argParser(parseConcurrency)).action(publishAction);
250488
- }
250489
- function parseGitHash(value) {
250490
- if (!isGitCommitHash(value)) {
250491
- throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
250492
- }
250493
- return value;
250494
- }
250495
- function parseConcurrency(value) {
250496
- const parsed = Number(value);
250497
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_VERSION_UPLOAD_CONCURRENCY) {
250498
- throw new InvalidArgumentError2(`Expected a whole number between 1 and ${MAX_VERSION_UPLOAD_CONCURRENCY}.`);
250499
- }
250500
- return parsed;
250518
+ return new Base44Command("publish").description("Build the app, record it as a version, and serve that version").option("--no-build", "Publish the existing build output without rebuilding").addOption(outputDirOption()).addOption(targetOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(publishAction);
250501
250519
  }
250502
250520
 
250503
250521
  // src/core/resources/sandbox/schema.ts
@@ -251012,18 +251030,18 @@ function siteOutputDir(project) {
251012
251030
  function getSiteDeployCommand() {
251013
251031
  const command = 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)");
251014
251032
  if (deploymentsApiEnabled()) {
251015
- command.addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash2));
251016
- command.addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency2));
251033
+ command.addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser(parseGitHash));
251034
+ command.addOption(new Option2("--concurrency <n>", "Parallel asset uploads").default(DEFAULT_UPLOAD_CONCURRENCY).argParser(parseConcurrency));
251017
251035
  }
251018
251036
  return command.action(deployAction2);
251019
251037
  }
251020
- function parseGitHash2(value) {
251038
+ function parseGitHash(value) {
251021
251039
  if (!isGitCommitHash(value)) {
251022
251040
  throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
251023
251041
  }
251024
251042
  return value;
251025
251043
  }
251026
- function parseConcurrency2(value) {
251044
+ function parseConcurrency(value) {
251027
251045
  const parsed = Number(value);
251028
251046
  if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_UPLOAD_CONCURRENCY) {
251029
251047
  throw new InvalidArgumentError2(`Expected a whole number between 1 and ${MAX_UPLOAD_CONCURRENCY}.`);
@@ -251213,18 +251231,7 @@ async function createAction2({ runTask, jsonMode, app }, options) {
251213
251231
  };
251214
251232
  }
251215
251233
  function getVersionCreateCommand() {
251216
- return new Base44Command("create").description("Record the built output as a version, without deploying it").option("--output-dir <dir>", "Build output directory (defaults to the project's, else dist)").addOption(new Option2("--git-hash <hash>", "Commit the build came from (defaults to the checkout's HEAD)").argParser((value) => {
251217
- if (!isGitCommitHash(value)) {
251218
- throw new InvalidArgumentError2("Expected a git commit hash (7-64 hex chars).");
251219
- }
251220
- return value;
251221
- })).addOption(new Option2("--concurrency <n>", "Parallel file uploads").default(DEFAULT_VERSION_UPLOAD_CONCURRENCY).argParser((value) => {
251222
- const parsed = Number(value);
251223
- if (!Number.isInteger(parsed) || parsed < 1 || parsed > MAX_VERSION_UPLOAD_CONCURRENCY) {
251224
- throw new InvalidArgumentError2(`Expected a whole number between 1 and ${MAX_VERSION_UPLOAD_CONCURRENCY}.`);
251225
- }
251226
- return parsed;
251227
- })).action(createAction2);
251234
+ return new Base44Command("create").description("Record the built output as a version, without deploying it").addOption(outputDirOption()).addOption(gitHashOption()).addOption(concurrencyOption()).action(createAction2);
251228
251235
  }
251229
251236
 
251230
251237
  // src/cli/commands/versions/deploy.ts
@@ -251241,7 +251248,7 @@ async function deployAction3({ runTask, jsonMode }, versionId, options) {
251241
251248
  };
251242
251249
  }
251243
251250
  function getVersionDeployCommand() {
251244
- return new Base44Command("deploy").description("Serve an already-recorded version (also how a rollback is done)").argument("<version-id>", "The version to serve").option("--target <name>", "Environment to serve the version at").action(deployAction3);
251251
+ return new Base44Command("deploy").description("Serve an already-recorded version (also how a rollback is done)").argument("<version-id>", "The version to serve").addOption(targetOption()).action(deployAction3);
251245
251252
  }
251246
251253
 
251247
251254
  // src/cli/commands/versions/index.ts
@@ -255904,8 +255911,10 @@ function createProgram(context) {
255904
255911
  program.addCommand(getBranchesCommand());
255905
255912
  program.addCommand(getAuthCommand());
255906
255913
  program.addCommand(getSiteCommand());
255907
- program.addCommand(getPublishCommand());
255908
- program.addCommand(getVersionsCommand());
255914
+ if (versionsApiEnabled()) {
255915
+ program.addCommand(getPublishCommand());
255916
+ program.addCommand(getVersionsCommand());
255917
+ }
255909
255918
  program.addCommand(getTypesCommand());
255910
255919
  program.addCommand(getExecCommand());
255911
255920
  program.addCommand(getDevCommand());
@@ -259957,4 +259966,4 @@ export {
259957
259966
  runCLI
259958
259967
  };
259959
259968
 
259960
- //# debugId=2D9E75E3489C289064756E2164756E21
259969
+ //# debugId=444A926116EBC8F264756E2164756E21