@base44-preview/cli 0.1.15-pr.630.a207c26 → 0.1.15-pr.630.a6f9272

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
@@ -269546,7 +269546,7 @@ function getModelCommand() {
269546
269546
 
269547
269547
  // src/cli/commands/app/shared.ts
269548
269548
  import { mkdir as mkdir3, writeFile as writeFile2 } from "node:fs/promises";
269549
- import { basename as basename6, join as join21, relative as relative6, resolve as resolve6 } from "node:path";
269549
+ import { join as join21 } from "node:path";
269550
269550
 
269551
269551
  // src/cli/commands/code/render.ts
269552
269552
  var TOOL_ALIASES = {
@@ -269983,17 +269983,11 @@ async function createAndLinkApp(options) {
269983
269983
  if (options.name && !APP_NAME_RE.test(options.name)) {
269984
269984
  throw new InvalidInputError("The name becomes a directory — letters, digits, dots, dashes and underscores only.");
269985
269985
  }
269986
- const cwd = process.cwd();
269987
- const fallbackName = () => options.importRepo ? repoBasename(options.importRepo) : inventAppName(options.prompt);
269988
- const chosenDir = options.path ? resolve6(cwd, options.path) : await isDirEmpty(cwd) ? cwd : undefined;
269989
- const dirBase = chosenDir ? basename6(chosenDir) : undefined;
269990
- const name = options.name ?? (dirBase && APP_NAME_RE.test(dirBase) ? dirBase : fallbackName());
269991
- const targetDir = chosenDir ?? join21(cwd, name);
269992
- const here = targetDir === cwd;
269993
- const dirName = here ? "." : relative6(cwd, targetDir) || name;
269986
+ const name = options.name ?? (options.importRepo ? repoBasename(options.importRepo) : inventAppName(options.prompt));
269987
+ const targetDir = join21(process.cwd(), name);
269994
269988
  await mkdir3(targetDir, { recursive: true });
269995
269989
  if (await appConfigExists(targetDir)) {
269996
- throw new InvalidInputError(here ? "This directory is already linked to a Base44 app. Run `base44 code` here to keep building it, or pass --path for a new one." : `./${dirName} is already linked to a Base44 app. Pick another name or --path.`);
269990
+ throw new InvalidInputError(`./${name} is already linked to a Base44 app. Pick another name.`);
269997
269991
  }
269998
269992
  const created = options.importRepo ? await createImportedApp({
269999
269993
  appName: name,
@@ -270017,19 +270011,16 @@ async function createAndLinkApp(options) {
270017
270011
  id: created.id,
270018
270012
  editorUrl: `${getBase44ApiUrl()}/apps/${created.id}/editor/preview`,
270019
270013
  repoUrl: created.imported_repo_url ?? undefined,
270020
- dirName,
270021
- targetDir,
270022
- here
270014
+ dirName: name,
270015
+ targetDir
270023
270016
  };
270024
270017
  }
270025
270018
  function nextStepsLines(app) {
270026
- const cd = app.here ? "" : `cd ${app.dirName} && `;
270027
270019
  return [
270028
270020
  "",
270029
- `${source_default.bold("Your app lives in")} ${app.here ? "./ (this directory)" : `./${app.dirName}`}`,
270030
- source_default.dim(` ${cd}base44 code # keep building with the agent`),
270031
- source_default.dim(` ${cd}base44 app send "…" # one non-interactive turn`),
270032
- source_default.dim(` files live remotely — ${cd}base44 sandbox ls to look, base44 eject for a copy`)
270021
+ `${source_default.bold("Your app lives in")} ./${app.dirName}`,
270022
+ source_default.dim(` cd ${app.dirName} && base44 code # keep building with the agent`),
270023
+ source_default.dim(` cd ${app.dirName} && base44 app send "…" # one non-interactive turn`)
270033
270024
  ];
270034
270025
  }
270035
270026
  async function githubReauthLines(error) {
@@ -270262,8 +270253,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270262
270253
  importRepo: options.import,
270263
270254
  mode: options.mode,
270264
270255
  repoName: options.repoName,
270265
- fromBranch: options.fromBranch,
270266
- path: options.path
270256
+ fromBranch: options.fromBranch
270267
270257
  }));
270268
270258
  } catch (error) {
270269
270259
  for (const line of await githubReauthLines(error) ?? [])
@@ -270274,7 +270264,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270274
270264
  if (app.repoUrl)
270275
270265
  log.message(source_default.dim(`repo ${app.repoUrl}`));
270276
270266
  log.message(source_default.dim(`editor ${app.editorUrl}`));
270277
- log.message(source_default.dim(`linked ${app.here ? "./ (this directory)" : `./${app.dirName}`}`));
270267
+ log.message(source_default.dim(`linked ./${app.dirName}`));
270278
270268
  }
270279
270269
  let finalState;
270280
270270
  let previewUrl;
@@ -270333,7 +270323,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
270333
270323
  }
270334
270324
  function getNewCommand() {
270335
270325
  const command = new Base44Command("new", { requireAppContext: false });
270336
- command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--path <dir>", "Directory to link (default: the current directory when empty, else ./<name>)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").action(newAction);
270326
+ command.description("Create an app and start building: from a prompt (the Base44 template), or over an existing GitHub repo with --import").argument("[prompt]", "What to build; the first agent turn starts immediately").option("--import <repo>", "Build over an existing GitHub repository instead of the template").option("--mode <mode>", "How to import: direct, fork, or copy (default: direct)").option("--name <name>", "Directory and app name (invented when omitted)").option("--repo-name <name>", "Name for the new GitHub repo when forking/copying").option("--from-branch <name>", "Import a specific branch of the repo").action(newAction);
270337
270327
  return command;
270338
270328
  }
270339
270329
 
@@ -270543,7 +270533,7 @@ function getAuthPushCommand() {
270543
270533
  }
270544
270534
 
270545
270535
  // src/cli/commands/auth/social-login.ts
270546
- import { dirname as dirname17, join as join24, resolve as resolve7 } from "node:path";
270536
+ import { dirname as dirname17, join as join24, resolve as resolve6 } from "node:path";
270547
270537
  var PROVIDER_LABELS = {
270548
270538
  google: "Google",
270549
270539
  microsoft: "Microsoft",
@@ -270583,7 +270573,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
270583
270573
  let clientSecret;
270584
270574
  if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
270585
270575
  if (options.envFile) {
270586
- const secrets = await parseEnvFile(resolve7(options.envFile));
270576
+ const secrets = await parseEnvFile(resolve6(options.envFile));
270587
270577
  const value = secrets[oauthCli.envVar];
270588
270578
  if (!value) {
270589
270579
  throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
@@ -270639,7 +270629,7 @@ function getSocialLoginCommand() {
270639
270629
  }
270640
270630
 
270641
270631
  // src/cli/commands/auth/sso.ts
270642
- import { dirname as dirname18, join as join25, resolve as resolve8 } from "node:path";
270632
+ import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
270643
270633
  var SSOConfigFileSchema = object({
270644
270634
  provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
270645
270635
  clientId: string2(),
@@ -270655,7 +270645,7 @@ var SSOConfigFileSchema = object({
270655
270645
  ssoName: string2().optional()
270656
270646
  });
270657
270647
  async function loadSSOConfigFile(filePath) {
270658
- const resolved = resolve8(filePath);
270648
+ const resolved = resolve7(filePath);
270659
270649
  const raw = await readJsonFile(resolved);
270660
270650
  const result = SSOConfigFileSchema.safeParse(raw);
270661
270651
  if (!result.success) {
@@ -270743,7 +270733,7 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
270743
270733
  }
270744
270734
  let clientSecret;
270745
270735
  if (merged.envFile && !merged.clientSecret) {
270746
- const secrets = await parseEnvFile(resolve8(merged.envFile));
270736
+ const secrets = await parseEnvFile(resolve7(merged.envFile));
270747
270737
  const value = secrets.sso_client_secret;
270748
270738
  if (!value) {
270749
270739
  throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
@@ -276608,21 +276598,21 @@ async function runGenesisSession(options) {
276608
276598
 
276609
276599
  // src/cli/commands/code/index.ts
276610
276600
  var BRAND_ORANGE2 = "#E86B3C";
276611
- async function bootstrapApp(prompt, footer, emit, onCreated, importRepo, path) {
276601
+ async function bootstrapApp(prompt, footer, emit, onCreated, importRepo) {
276612
276602
  let app;
276613
276603
  try {
276614
- app = await createAndLinkApp({ prompt, importRepo, path });
276604
+ app = await createAndLinkApp({ prompt, importRepo });
276615
276605
  } catch (error) {
276616
276606
  for (const line of await githubReauthLines(error) ?? [])
276617
276607
  emit(line);
276618
276608
  throw error;
276619
276609
  }
276620
276610
  onCreated(app);
276621
- footer.push(source_default.dim(`dir ${app.here ? "./" : `./${app.dirName}`}`));
276611
+ footer.push(source_default.dim(`dir ./${app.dirName}`));
276622
276612
  if (app.repoUrl)
276623
276613
  footer.push(terminalLink("repo", app.repoUrl));
276624
276614
  footer.push(terminalLink("editor", app.editorUrl));
276625
- emit(source_default.dim(app.here ? "linked ./ (this directory)" : `linked ./${app.dirName} (cd ${app.dirName} after the session)`));
276615
+ emit(source_default.dim(`linked ./${app.dirName} (cd ${app.dirName} after the session)`));
276626
276616
  const branchId = await resolveActiveBranchId().catch(() => {
276627
276617
  return;
276628
276618
  });
@@ -276656,8 +276646,8 @@ async function codeAction({ log }, options) {
276656
276646
  linked = true;
276657
276647
  } catch {}
276658
276648
  if (linked) {
276659
- if (options.import || options.path) {
276660
- throw new InvalidInputError("--import and --path create a new app; run them outside a linked project.");
276649
+ if (options.import) {
276650
+ throw new InvalidInputError("--import creates a new app; run it outside a linked project.");
276661
276651
  }
276662
276652
  const branchId = await resolveActiveBranchId().catch(() => {
276663
276653
  return;
@@ -276685,7 +276675,7 @@ async function codeAction({ log }, options) {
276685
276675
  footer,
276686
276676
  createApp: (prompt, emit) => bootstrapApp(prompt, footer, emit, (app) => {
276687
276677
  created = app;
276688
- }, options.import, options.path)
276678
+ }, options.import)
276689
276679
  });
276690
276680
  if (!created) {
276691
276681
  return { outroMessage: "Session closed. No app was created." };
@@ -276697,7 +276687,7 @@ async function codeAction({ log }, options) {
276697
276687
  }
276698
276688
  function getCodeCommand() {
276699
276689
  const command = new Base44Command("code", { requireAppContext: false });
276700
- command.description("Open Base44 Code: an interactive agent session — in an empty directory your first prompt creates the app (add --import <repo> to build over an existing repository)").option("--import <repo>", "Build over an existing GitHub repository instead of the Base44 template").option("--path <dir>", "Directory to link the new app to (default: the current directory when empty, else ./<name>)").action(codeAction);
276690
+ command.description("Open Base44 Code: an interactive agent session — in an empty directory your first prompt creates the app (add --import <repo> to build over an existing repository)").option("--import <repo>", "Build over an existing GitHub repository instead of the Base44 template").action(codeAction);
276701
276691
  return command;
276702
276692
  }
276703
276693
 
@@ -277495,10 +277485,10 @@ function getConnectorsListAvailableCommand() {
277495
277485
  }
277496
277486
 
277497
277487
  // src/cli/commands/connectors/pull.ts
277498
- import { dirname as dirname19, join as join27, resolve as resolve9 } from "node:path";
277488
+ import { dirname as dirname19, join as join27, resolve as resolve8 } from "node:path";
277499
277489
  async function resolveConnectorsDir(options) {
277500
277490
  if (!getAppContext().projectRoot) {
277501
- return resolve9(options.dir ?? "connectors");
277491
+ return resolve8(options.dir ?? "connectors");
277502
277492
  }
277503
277493
  const { project } = await readProjectConfig();
277504
277494
  return join27(dirname19(project.configPath), project.connectorsDir);
@@ -277542,10 +277532,10 @@ function getConnectorsPullCommand() {
277542
277532
  }
277543
277533
 
277544
277534
  // src/cli/commands/connectors/push.ts
277545
- import { resolve as resolve10 } from "node:path";
277535
+ import { resolve as resolve9 } from "node:path";
277546
277536
  async function readConnectorsToPush(options) {
277547
277537
  if (!getAppContext().projectRoot) {
277548
- return readAllConnectors(resolve10(options.dir ?? "connectors"));
277538
+ return readAllConnectors(resolve9(options.dir ?? "connectors"));
277549
277539
  }
277550
277540
  const { connectors } = await readProjectConfig();
277551
277541
  return connectors;
@@ -278014,7 +278004,7 @@ function getBuildCommand() {
278014
278004
  }
278015
278005
 
278016
278006
  // src/cli/commands/project/create.ts
278017
- import { basename as basename7, resolve as resolve11 } from "node:path";
278007
+ import { basename as basename6, resolve as resolve10 } from "node:path";
278018
278008
  var import_kebabCase2 = __toESM(require_kebabCase(), 1);
278019
278009
 
278020
278010
  // src/cli/commands/project/scaffold-shared.ts
@@ -278179,8 +278169,8 @@ async function createInteractive(options, ctx) {
278179
278169
  name: () => {
278180
278170
  return options.name ? Promise.resolve(options.name) : Ze({
278181
278171
  message: "What is the name of your project?",
278182
- placeholder: basename7(process.cwd()),
278183
- initialValue: basename7(process.cwd()),
278172
+ placeholder: basename6(process.cwd()),
278173
+ initialValue: basename6(process.cwd()),
278184
278174
  validate: (value) => {
278185
278175
  if (!value || value.trim().length === 0) {
278186
278176
  return "Every project deserves a name";
@@ -278210,7 +278200,7 @@ async function createInteractive(options, ctx) {
278210
278200
  }, ctx);
278211
278201
  }
278212
278202
  async function createNonInteractive(options, ctx) {
278213
- ctx.log.info(`Creating a new project at ${resolve11(options.path)}`);
278203
+ ctx.log.info(`Creating a new project at ${resolve10(options.path)}`);
278214
278204
  const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
278215
278205
  return await executeCreate({
278216
278206
  template,
@@ -278234,7 +278224,7 @@ async function executeCreate({
278234
278224
  }, ctx) {
278235
278225
  const { log, runTask } = ctx;
278236
278226
  const name = rawName.trim();
278237
- const resolvedPath = resolve11(projectPath);
278227
+ const resolvedPath = resolve10(projectPath);
278238
278228
  const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
278239
278229
  const { projectId } = await runTask("Setting up your project...", async () => {
278240
278230
  return await createProjectFiles({
@@ -278875,7 +278865,7 @@ function getLogsCommand() {
278875
278865
  }
278876
278866
 
278877
278867
  // src/cli/commands/project/scaffold.ts
278878
- import { basename as basename8, resolve as resolve12 } from "node:path";
278868
+ import { basename as basename7, resolve as resolve11 } from "node:path";
278879
278869
  function resolveAppId(options) {
278880
278870
  const appId = options.appId;
278881
278871
  if (!appId) {
@@ -278891,8 +278881,8 @@ function resolveAppId(options) {
278891
278881
  async function scaffoldAction(ctx, name, options, command) {
278892
278882
  const { log, runTask } = ctx;
278893
278883
  const appId = resolveAppId(command.optsWithGlobals());
278894
- const resolvedPath = resolve12("./");
278895
- const projectName = (name ?? basename8(resolvedPath)).trim();
278884
+ const resolvedPath = resolve11("./");
278885
+ const projectName = (name ?? basename7(resolvedPath)).trim();
278896
278886
  const template = await getTemplateById("backend-only");
278897
278887
  log.info(`Scaffolding project at ${resolvedPath}`);
278898
278888
  const { projectId } = await runTask("Setting up your project...", async () => {
@@ -279308,7 +279298,7 @@ function getSecretsListCommand() {
279308
279298
  }
279309
279299
 
279310
279300
  // src/cli/commands/secrets/set.ts
279311
- import { resolve as resolve13 } from "node:path";
279301
+ import { resolve as resolve12 } from "node:path";
279312
279302
  function parseEntries(entries) {
279313
279303
  const secrets = {};
279314
279304
  for (const entry of entries) {
@@ -279339,7 +279329,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
279339
279329
  validateInput(entries, options);
279340
279330
  let secrets;
279341
279331
  if (options.envFile) {
279342
- secrets = await parseEnvFile(resolve13(options.envFile));
279332
+ secrets = await parseEnvFile(resolve12(options.envFile));
279343
279333
  if (Object.keys(secrets).length === 0) {
279344
279334
  throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
279345
279335
  }
@@ -279368,7 +279358,7 @@ function getSecretsCommand() {
279368
279358
  }
279369
279359
 
279370
279360
  // src/cli/commands/site/deploy.ts
279371
- import { resolve as resolve14 } from "node:path";
279361
+ import { resolve as resolve13 } from "node:path";
279372
279362
  async function deployAction2(ctx, options) {
279373
279363
  const { isNonInteractive } = ctx;
279374
279364
  if (isNonInteractive && !options.yes) {
@@ -279446,7 +279436,7 @@ async function deployTarball({ runTask }, project) {
279446
279436
  }
279447
279437
  function siteOutputDir(project) {
279448
279438
  const outputDirectory = project.site?.outputDirectory;
279449
- return outputDirectory ? resolve14(project.root, outputDirectory) : null;
279439
+ return outputDirectory ? resolve13(project.root, outputDirectory) : null;
279450
279440
  }
279451
279441
  function getSiteDeployCommand() {
279452
279442
  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)");
@@ -281948,7 +281938,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
281948
281938
 
281949
281939
  // src/cli/dev/dev-server/watcher.ts
281950
281940
  import { EventEmitter as EventEmitter6 } from "node:events";
281951
- import { relative as relative10 } from "node:path";
281941
+ import { relative as relative9 } from "node:path";
281952
281942
 
281953
281943
  // ../../node_modules/chokidar/index.js
281954
281944
  import { EventEmitter as EventEmitter5 } from "node:events";
@@ -283633,7 +283623,7 @@ class WatchBase44 extends EventEmitter6 {
283633
283623
  ignoreInitial: true
283634
283624
  });
283635
283625
  watcher.on("all", import_debounce4.default(async (_event, path) => {
283636
- this.emit("change", name, relative10(targetPath, path));
283626
+ this.emit("change", name, relative9(targetPath, path));
283637
283627
  }, WATCH_DEBOUNCE_MS));
283638
283628
  watcher.on("error", (err) => {
283639
283629
  this.logger.error(`Watch handler failed for ${targetPath}`, err);
@@ -284143,7 +284133,7 @@ Examples:
284143
284133
  }
284144
284134
 
284145
284135
  // src/cli/commands/project/eject.ts
284146
- import { resolve as resolve18 } from "node:path";
284136
+ import { resolve as resolve17 } from "node:path";
284147
284137
  var import_kebabCase3 = __toESM(require_kebabCase(), 1);
284148
284138
  async function eject(ctx, options, command) {
284149
284139
  const { log, runTask, isNonInteractive } = ctx;
@@ -284207,7 +284197,7 @@ async function eject(ctx, options, command) {
284207
284197
  Ne("Operation cancelled.");
284208
284198
  throw new CLIExitError(0);
284209
284199
  }
284210
- const resolvedPath = resolve18(selectedPath);
284200
+ const resolvedPath = resolve17(selectedPath);
284211
284201
  await runTask("Downloading your project's code...", async (updateMessage) => {
284212
284202
  await createProjectFilesForExistingProject({
284213
284203
  projectId,
@@ -288344,4 +288334,4 @@ export {
288344
288334
  runCLI
288345
288335
  };
288346
288336
 
288347
- //# debugId=B1E2B3DFB2501EB964756E2164756E21
288337
+ //# debugId=72FC25F5FAAAB35A64756E2164756E21