@base44-preview/cli 0.0.54-pr.539.1da48ad → 0.0.54-pr.539.4825ad9

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
@@ -253153,26 +253153,24 @@ async function executeCreate({
253153
253153
  }
253154
253154
  async function createAction({ log, runTask: runTask2, isNonInteractive }, name2, options) {
253155
253155
  const existingAppId = process.env.BASE44_APP_ID;
253156
- if (existingAppId) {
253156
+ if (existingAppId && !options.force) {
253157
253157
  if (isNonInteractive) {
253158
253158
  throw new InvalidInputError(`BASE44_APP_ID is set (${existingAppId}) — this environment already has a Base44 app, so \`create\` won't make a new one.`, {
253159
253159
  hints: [
253160
253160
  {
253161
- message: "Run `base44 init` to scaffold a project for the existing app"
253161
+ message: "Run `base44 scaffold` to set up a project for the existing app"
253162
253162
  },
253163
- {
253164
- message: "Or unset BASE44_APP_ID to create a new app with `base44 create`"
253165
- }
253163
+ { message: "Or pass --force to create a new app anyway" }
253166
253164
  ]
253167
253165
  });
253168
253166
  }
253169
253167
  const proceed = await Re({
253170
- message: `BASE44_APP_ID is set (${existingAppId}). This environment already has a Base44 app — \`base44 init\` scaffolds for it, while \`create\` makes a new one. Create a new app anyway?`,
253168
+ message: `BASE44_APP_ID is set (${existingAppId}). This environment already has a Base44 app — \`base44 scaffold\` sets up a project for it, while \`create\` makes a new one. Create a new app anyway?`,
253171
253169
  initialValue: false
253172
253170
  });
253173
253171
  if (Ct(proceed) || !proceed) {
253174
253172
  return {
253175
- outroMessage: "Run `base44 init` to scaffold a project for the existing app"
253173
+ outroMessage: "Run `base44 scaffold` to set up a project for the existing app"
253176
253174
  };
253177
253175
  }
253178
253176
  }
@@ -253199,7 +253197,7 @@ function getCreateCommand() {
253199
253197
  return new Base44Command("create", {
253200
253198
  requireAppConfig: false,
253201
253199
  fullBanner: true
253202
- }).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").addHelpText("after", `
253200
+ }).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").option("--force", "Create a new app even when BASE44_APP_ID is set in the environment").addHelpText("after", `
253203
253201
  Examples:
253204
253202
  $ base44 create my-app Creates a base44 project at ./my-app
253205
253203
  $ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
@@ -253299,63 +253297,6 @@ function printStripeResult(r, log) {
253299
253297
  log.info(` Connectors dashboard: ${theme.colors.links(getConnectorsUrl())}`);
253300
253298
  }
253301
253299
 
253302
- // src/cli/commands/project/init.ts
253303
- import { basename as basename4, resolve as resolve6 } from "node:path";
253304
- function resolveAppId(options) {
253305
- const appId = options.appId ?? process.env.BASE44_APP_ID;
253306
- if (!appId) {
253307
- throw new InvalidInputError("No app ID found. `base44 init` scaffolds a local project for an existing Base44 app.", {
253308
- hints: [
253309
- { message: "Pass it explicitly with --app-id <id>" },
253310
- {
253311
- message: "Or set the BASE44_APP_ID environment variable (e.g. via .env)"
253312
- }
253313
- ]
253314
- });
253315
- }
253316
- return appId;
253317
- }
253318
- async function initAction({ log, runTask: runTask2 }, name2, options) {
253319
- const appId = resolveAppId(options);
253320
- const resolvedPath = resolve6("./");
253321
- const projectName = (name2 ?? basename4(resolvedPath)).trim();
253322
- const template2 = await getTemplateById("backend-only");
253323
- log.info(`Initializing project at ${resolvedPath}`);
253324
- const { projectId, skippedFiles } = await runTask2("Setting up your project...", async () => {
253325
- return await initProjectFiles({
253326
- name: projectName,
253327
- path: resolvedPath,
253328
- template: template2,
253329
- appId
253330
- });
253331
- }, {
253332
- successMessage: theme.colors.base44Orange("Project created successfully"),
253333
- errorMessage: "Failed to create project"
253334
- });
253335
- if (skippedFiles.length > 0) {
253336
- log.info(`Kept existing file${skippedFiles.length > 1 ? "s" : ""}: ${skippedFiles.join(", ")}`);
253337
- }
253338
- setAppConfig({ id: projectId, projectRoot: resolvedPath });
253339
- return await completeProjectSetup({
253340
- projectId,
253341
- name: projectName,
253342
- resolvedPath,
253343
- deploy: false,
253344
- skills: options.skills,
253345
- isInteractive: false
253346
- }, { log, runTask: runTask2 });
253347
- }
253348
- function getInitCommand() {
253349
- return new Base44Command("init", {
253350
- requireAppConfig: false,
253351
- fullBanner: true
253352
- }).description("Scaffold a local project for an existing Base44 app").addArgument(new Argument("name", "Project name").argOptional()).option("--app-id <id>", "Existing Base44 app ID (defaults to the BASE44_APP_ID environment variable)").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
253353
- Examples:
253354
- $ base44 init Scaffolds the current dir for $BASE44_APP_ID
253355
- $ base44 init --app-id app_123 Scaffolds the current dir for the given app
253356
- $ base44 init my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(initAction);
253357
- }
253358
-
253359
253300
  // src/cli/commands/project/link.ts
253360
253301
  function validateNonInteractiveFlags2(command2) {
253361
253302
  const { create: create4, name: name2, projectId } = command2.opts();
@@ -253625,6 +253566,63 @@ function getLogsCommand() {
253625
253566
  return new Base44Command("logs").description("Fetch function logs for this app").option("--function <names>", "Filter by function name(s), comma-separated. If omitted, fetches logs for all project functions").option("--since <datetime>", "Show logs from this time (ISO format)", normalizeDatetime).option("--until <datetime>", "Show logs until this time (ISO format)", normalizeDatetime).addOption(new Option("--level <level>", "Filter by log level").choices([...LogLevelSchema.options]).hideHelp()).option("-n, --limit <n>", "Results per page (1-1000, default: 50)").addOption(new Option("--order <order>", "Sort order").choices(["asc", "desc"])).action(logsAction);
253626
253567
  }
253627
253568
 
253569
+ // src/cli/commands/project/scaffold.ts
253570
+ import { basename as basename4, resolve as resolve6 } from "node:path";
253571
+ function resolveAppId(options) {
253572
+ const appId = options.appId ?? process.env.BASE44_APP_ID;
253573
+ if (!appId) {
253574
+ throw new InvalidInputError("No app ID found. `base44 scaffold` sets up a local project for an existing Base44 app.", {
253575
+ hints: [
253576
+ { message: "Pass it explicitly with --app-id <id>" },
253577
+ {
253578
+ message: "Or set the BASE44_APP_ID environment variable (e.g. via .env)"
253579
+ }
253580
+ ]
253581
+ });
253582
+ }
253583
+ return appId;
253584
+ }
253585
+ async function scaffoldAction({ log, runTask: runTask2 }, name2, options) {
253586
+ const appId = resolveAppId(options);
253587
+ const resolvedPath = resolve6("./");
253588
+ const projectName = (name2 ?? basename4(resolvedPath)).trim();
253589
+ const template2 = await getTemplateById("backend-only");
253590
+ log.info(`Scaffolding project at ${resolvedPath}`);
253591
+ const { projectId, skippedFiles } = await runTask2("Setting up your project...", async () => {
253592
+ return await initProjectFiles({
253593
+ name: projectName,
253594
+ path: resolvedPath,
253595
+ template: template2,
253596
+ appId
253597
+ });
253598
+ }, {
253599
+ successMessage: theme.colors.base44Orange("Project created successfully"),
253600
+ errorMessage: "Failed to create project"
253601
+ });
253602
+ if (skippedFiles.length > 0) {
253603
+ log.info(`Kept existing file${skippedFiles.length > 1 ? "s" : ""}: ${skippedFiles.join(", ")}`);
253604
+ }
253605
+ setAppConfig({ id: projectId, projectRoot: resolvedPath });
253606
+ return await completeProjectSetup({
253607
+ projectId,
253608
+ name: projectName,
253609
+ resolvedPath,
253610
+ deploy: false,
253611
+ skills: options.skills,
253612
+ isInteractive: false
253613
+ }, { log, runTask: runTask2 });
253614
+ }
253615
+ function getScaffoldCommand() {
253616
+ return new Base44Command("scaffold", {
253617
+ requireAppConfig: false,
253618
+ fullBanner: true
253619
+ }).description("Scaffold a local project for an existing Base44 app").addArgument(new Argument("name", "Project name").argOptional()).option("--app-id <id>", "Existing Base44 app ID (defaults to the BASE44_APP_ID environment variable)").option("--no-skills", "Skip AI agent skills installation").addHelpText("after", `
253620
+ Examples:
253621
+ $ base44 scaffold Scaffolds the current dir for $BASE44_APP_ID
253622
+ $ base44 scaffold --app-id app_123 Scaffolds the current dir for the given app
253623
+ $ base44 scaffold my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(scaffoldAction);
253624
+ }
253625
+
253628
253626
  // src/cli/commands/secrets/delete.ts
253629
253627
  async function deleteSecretAction({ runTask: runTask2 }, key) {
253630
253628
  await runTask2(`Deleting secret "${key}"`, async () => {
@@ -257519,7 +257517,7 @@ function createProgram(context) {
257519
257517
  program2.addCommand(getWhoamiCommand());
257520
257518
  program2.addCommand(getLogoutCommand());
257521
257519
  program2.addCommand(getCreateCommand());
257522
- program2.addCommand(getInitCommand());
257520
+ program2.addCommand(getScaffoldCommand());
257523
257521
  program2.addCommand(getDashboardCommand());
257524
257522
  program2.addCommand(getDeployCommand2());
257525
257523
  program2.addCommand(getLinkCommand());
@@ -261780,4 +261778,4 @@ export {
261780
261778
  CLIExitError
261781
261779
  };
261782
261780
 
261783
- //# debugId=C659EAC64DBB54EC64756E2164756E21
261781
+ //# debugId=F9E7F25C4BCCD31164756E2164756E21