@base44-preview/cli 0.0.36-pr.342.1919b84 → 0.0.36-pr.342.fee5fdf

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
@@ -224515,6 +224515,9 @@ async function runCommand(commandFn, options, context) {
224515
224515
  let savedStdoutWrite;
224516
224516
  try {
224517
224517
  if (json2) {
224518
+ if (options?.interactive) {
224519
+ throw new InvalidInputError("This command requires interactive input and cannot be used with --json");
224520
+ }
224518
224521
  savedStdoutWrite = process.stdout.write.bind(process.stdout);
224519
224522
  process.stdout.write = () => true;
224520
224523
  }
@@ -225620,19 +225623,11 @@ async function getTemplateById(templateId) {
225620
225623
  }
225621
225624
  return template2;
225622
225625
  }
225623
- function validateFlags(context) {
225624
- return (command) => {
225625
- const opts = command.opts();
225626
- const name2 = command.args[0];
225627
- if (opts.path && !(opts.name ?? name2)) {
225628
- command.error("Non-interactive mode requires all flags: --name, --path");
225629
- }
225630
- if (context.isJsonMode || context.isNonInteractive) {
225631
- if (!(opts.name ?? name2) || !opts.path) {
225632
- command.error("Non-interactive mode requires: <name> and --path <path>");
225633
- }
225634
- }
225635
- };
225626
+ function validateNonInteractiveFlags(command) {
225627
+ const { path: path17 } = command.opts();
225628
+ if (path17 && !command.args.length) {
225629
+ command.error("Non-interactive mode requires all flags: --name, --path");
225630
+ }
225636
225631
  }
225637
225632
  async function createInteractive(options) {
225638
225633
  const templates = await listTemplates();
@@ -225780,7 +225775,7 @@ async function executeCreate({
225780
225775
  return { outroMessage: "Your project is set up and ready to use" };
225781
225776
  }
225782
225777
  function getCreateCommand(context) {
225783
- return new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").hook("preAction", validateFlags(context)).action(async (name2, options) => {
225778
+ return new Command("create").description("Create a new Base44 project").addArgument(new Argument("name", "Project name").argOptional()).option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").option("--no-skills", "Skip AI agent skills installation").hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
225784
225779
  const isNonInteractive = !!(options.name ?? name2) && !!options.path;
225785
225780
  if (isNonInteractive) {
225786
225781
  await runCommand(() => createNonInteractive({ name: options.name ?? name2, ...options }), { requireAuth: true, requireAppConfig: false }, context);
@@ -225788,7 +225783,8 @@ function getCreateCommand(context) {
225788
225783
  await runCommand(() => createInteractive({ name: name2, ...options }), {
225789
225784
  fullBanner: true,
225790
225785
  requireAuth: true,
225791
- requireAppConfig: false
225786
+ requireAppConfig: false,
225787
+ interactive: true
225792
225788
  }, context);
225793
225789
  }
225794
225790
  });
@@ -225856,17 +225852,8 @@ ${summaryLines.join(`
225856
225852
  }
225857
225853
  return { outroMessage: "App deployed successfully" };
225858
225854
  }
225859
- function validateNonInteractiveMode(context) {
225860
- return (command) => {
225861
- if (!context.isJsonMode && !context.isNonInteractive)
225862
- return;
225863
- if (!command.opts().yes) {
225864
- command.error("Non-interactive mode requires: --yes");
225865
- }
225866
- };
225867
- }
225868
225855
  function getDeployCommand(context) {
225869
- return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").hook("preAction", validateNonInteractiveMode(context)).action(async (options) => {
225856
+ return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
225870
225857
  await runCommand(() => deployAction({
225871
225858
  ...options,
225872
225859
  isNonInteractive: context.isNonInteractive
@@ -225875,21 +225862,14 @@ function getDeployCommand(context) {
225875
225862
  }
225876
225863
 
225877
225864
  // src/cli/commands/project/link.ts
225878
- function validateFlags2(context) {
225879
- return (command) => {
225880
- const { create: create4, name: name2, projectId } = command.opts();
225881
- if (create4 && projectId) {
225882
- command.error("--create and --projectId cannot be used together");
225883
- }
225884
- if (create4 && !name2) {
225885
- command.error("--name is required when using --create");
225886
- }
225887
- if (context.isJsonMode || context.isNonInteractive) {
225888
- if (!projectId && !create4) {
225889
- command.error("Non-interactive mode requires --projectId <id> or --create --name <name>");
225890
- }
225891
- }
225892
- };
225865
+ function validateNonInteractiveFlags2(command) {
225866
+ const { create: create4, name: name2, projectId } = command.opts();
225867
+ if (create4 && projectId) {
225868
+ command.error("--create and --projectId cannot be used together");
225869
+ }
225870
+ if (create4 && !name2) {
225871
+ command.error("--name is required when using --create");
225872
+ }
225893
225873
  }
225894
225874
  async function promptForLinkAction() {
225895
225875
  const actionOptions = [
@@ -226022,8 +226002,8 @@ async function link(options) {
226022
226002
  return { outroMessage: "Project linked" };
226023
226003
  }
226024
226004
  function getLinkCommand(context) {
226025
- return new Command("link").description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateFlags2(context)).action(async (options) => {
226026
- await runCommand(() => link(options), { requireAuth: true, requireAppConfig: false }, context);
226005
+ return new Command("link").description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options) => {
226006
+ await runCommand(() => link(options), { requireAuth: true, requireAppConfig: false, interactive: true }, context);
226027
226007
  });
226028
226008
  }
226029
226009
 
@@ -226284,21 +226264,12 @@ async function deployAction2(options) {
226284
226264
  });
226285
226265
  return { outroMessage: `Visit your site at: ${result.appUrl}` };
226286
226266
  }
226287
- function validateNonInteractiveMode2(context) {
226288
- return (command) => {
226289
- if (!context.isJsonMode && !context.isNonInteractive)
226290
- return;
226291
- if (!command.opts().yes) {
226292
- command.error("Non-interactive mode requires: --yes");
226293
- }
226294
- };
226295
- }
226296
226267
  function getSiteDeployCommand(context) {
226297
- return new Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").hook("preAction", validateNonInteractiveMode2(context)).action(async (options) => {
226268
+ return new Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
226298
226269
  await runCommand(() => deployAction2({
226299
226270
  ...options,
226300
226271
  isNonInteractive: context.isNonInteractive
226301
- }), { requireAuth: true }, context);
226272
+ }), { requireAuth: true, interactive: !options.yes }, context);
226302
226273
  });
226303
226274
  }
226304
226275
 
@@ -227269,24 +227240,9 @@ async function eject(options8) {
227269
227240
  }
227270
227241
  return { outroMessage: "Your new project is set and ready to use" };
227271
227242
  }
227272
- function validateNonInteractiveMode3(context) {
227273
- return (command) => {
227274
- if (!context.isJsonMode && !context.isNonInteractive)
227275
- return;
227276
- const opts = command.opts();
227277
- const missing = [];
227278
- if (!opts.projectId)
227279
- missing.push("--project-id <id>");
227280
- if (!opts.path)
227281
- missing.push("--path <path>");
227282
- if (missing.length > 0) {
227283
- command.error(`Non-interactive mode requires: ${missing.join(", ")}`);
227284
- }
227285
- };
227286
- }
227287
227243
  function getEjectCommand(context) {
227288
- return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").hook("preAction", validateNonInteractiveMode3(context)).action(async (options8) => {
227289
- await runCommand(() => eject({ ...options8, isNonInteractive: context.isNonInteractive }), { requireAuth: true, requireAppConfig: false }, context);
227244
+ return new Command("eject").description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8) => {
227245
+ await runCommand(() => eject({ ...options8, isNonInteractive: context.isNonInteractive }), { requireAuth: true, requireAppConfig: false, interactive: true }, context);
227290
227246
  });
227291
227247
  }
227292
227248
 
@@ -231558,4 +231514,4 @@ export {
231558
231514
  CLIExitError
231559
231515
  };
231560
231516
 
231561
- //# debugId=5A5283F370A6542E64756E2164756E21
231517
+ //# debugId=0508D45B9716256264756E2164756E21