@base44-preview/cli 0.1.15-pr.630.f6b9987 → 0.1.15-pr.630.f8ef122
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 +46 -55
- package/dist/cli/index.js.map +6 -6
- package/package.json +1 -1
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 {
|
|
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
|
|
269987
|
-
const
|
|
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(
|
|
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,18 +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")}
|
|
270030
|
-
source_default.dim(` ${
|
|
270031
|
-
source_default.dim(` ${
|
|
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`)
|
|
270032
270024
|
];
|
|
270033
270025
|
}
|
|
270034
270026
|
async function githubReauthLines(error) {
|
|
@@ -270261,8 +270253,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270261
270253
|
importRepo: options.import,
|
|
270262
270254
|
mode: options.mode,
|
|
270263
270255
|
repoName: options.repoName,
|
|
270264
|
-
fromBranch: options.fromBranch
|
|
270265
|
-
path: options.path
|
|
270256
|
+
fromBranch: options.fromBranch
|
|
270266
270257
|
}));
|
|
270267
270258
|
} catch (error) {
|
|
270268
270259
|
for (const line of await githubReauthLines(error) ?? [])
|
|
@@ -270273,7 +270264,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270273
270264
|
if (app.repoUrl)
|
|
270274
270265
|
log.message(source_default.dim(`repo ${app.repoUrl}`));
|
|
270275
270266
|
log.message(source_default.dim(`editor ${app.editorUrl}`));
|
|
270276
|
-
log.message(source_default.dim(`linked
|
|
270267
|
+
log.message(source_default.dim(`linked ./${app.dirName}`));
|
|
270277
270268
|
}
|
|
270278
270269
|
let finalState;
|
|
270279
270270
|
let previewUrl;
|
|
@@ -270332,7 +270323,7 @@ async function newAction({ log, runTask, jsonMode }, prompt, options) {
|
|
|
270332
270323
|
}
|
|
270333
270324
|
function getNewCommand() {
|
|
270334
270325
|
const command = new Base44Command("new", { requireAppContext: false });
|
|
270335
|
-
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("--
|
|
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);
|
|
270336
270327
|
return command;
|
|
270337
270328
|
}
|
|
270338
270329
|
|
|
@@ -270542,7 +270533,7 @@ function getAuthPushCommand() {
|
|
|
270542
270533
|
}
|
|
270543
270534
|
|
|
270544
270535
|
// src/cli/commands/auth/social-login.ts
|
|
270545
|
-
import { dirname as dirname17, join as join24, resolve as
|
|
270536
|
+
import { dirname as dirname17, join as join24, resolve as resolve6 } from "node:path";
|
|
270546
270537
|
var PROVIDER_LABELS = {
|
|
270547
270538
|
google: "Google",
|
|
270548
270539
|
microsoft: "Microsoft",
|
|
@@ -270582,7 +270573,7 @@ async function socialLoginAction({ log, isNonInteractive, runTask }, provider, a
|
|
|
270582
270573
|
let clientSecret;
|
|
270583
270574
|
if (useCustomOAuth && oauth && oauthCli && hasSecretOptions(options)) {
|
|
270584
270575
|
if (options.envFile) {
|
|
270585
|
-
const secrets = await parseEnvFile(
|
|
270576
|
+
const secrets = await parseEnvFile(resolve6(options.envFile));
|
|
270586
270577
|
const value = secrets[oauthCli.envVar];
|
|
270587
270578
|
if (!value) {
|
|
270588
270579
|
throw new InvalidInputError(`Key "${oauthCli.envVar}" not found in ${options.envFile}.`);
|
|
@@ -270638,7 +270629,7 @@ function getSocialLoginCommand() {
|
|
|
270638
270629
|
}
|
|
270639
270630
|
|
|
270640
270631
|
// src/cli/commands/auth/sso.ts
|
|
270641
|
-
import { dirname as dirname18, join as join25, resolve as
|
|
270632
|
+
import { dirname as dirname18, join as join25, resolve as resolve7 } from "node:path";
|
|
270642
270633
|
var SSOConfigFileSchema = object({
|
|
270643
270634
|
provider: _enum(Object.values(KNOWN_SSO_PROVIDERS)),
|
|
270644
270635
|
clientId: string2(),
|
|
@@ -270654,7 +270645,7 @@ var SSOConfigFileSchema = object({
|
|
|
270654
270645
|
ssoName: string2().optional()
|
|
270655
270646
|
});
|
|
270656
270647
|
async function loadSSOConfigFile(filePath) {
|
|
270657
|
-
const resolved =
|
|
270648
|
+
const resolved = resolve7(filePath);
|
|
270658
270649
|
const raw = await readJsonFile(resolved);
|
|
270659
270650
|
const result = SSOConfigFileSchema.safeParse(raw);
|
|
270660
270651
|
if (!result.success) {
|
|
@@ -270742,7 +270733,7 @@ async function ssoEnableAction({ isNonInteractive, runTask }, options) {
|
|
|
270742
270733
|
}
|
|
270743
270734
|
let clientSecret;
|
|
270744
270735
|
if (merged.envFile && !merged.clientSecret) {
|
|
270745
|
-
const secrets = await parseEnvFile(
|
|
270736
|
+
const secrets = await parseEnvFile(resolve7(merged.envFile));
|
|
270746
270737
|
const value = secrets.sso_client_secret;
|
|
270747
270738
|
if (!value) {
|
|
270748
270739
|
throw new InvalidInputError(`Key "sso_client_secret" not found in ${merged.envFile}.`);
|
|
@@ -276607,21 +276598,21 @@ async function runGenesisSession(options) {
|
|
|
276607
276598
|
|
|
276608
276599
|
// src/cli/commands/code/index.ts
|
|
276609
276600
|
var BRAND_ORANGE2 = "#E86B3C";
|
|
276610
|
-
async function bootstrapApp(prompt, footer, emit, onCreated, importRepo
|
|
276601
|
+
async function bootstrapApp(prompt, footer, emit, onCreated, importRepo) {
|
|
276611
276602
|
let app;
|
|
276612
276603
|
try {
|
|
276613
|
-
app = await createAndLinkApp({ prompt, importRepo
|
|
276604
|
+
app = await createAndLinkApp({ prompt, importRepo });
|
|
276614
276605
|
} catch (error) {
|
|
276615
276606
|
for (const line of await githubReauthLines(error) ?? [])
|
|
276616
276607
|
emit(line);
|
|
276617
276608
|
throw error;
|
|
276618
276609
|
}
|
|
276619
276610
|
onCreated(app);
|
|
276620
|
-
footer.push(source_default.dim(`dir
|
|
276611
|
+
footer.push(source_default.dim(`dir ./${app.dirName}`));
|
|
276621
276612
|
if (app.repoUrl)
|
|
276622
276613
|
footer.push(terminalLink("repo", app.repoUrl));
|
|
276623
276614
|
footer.push(terminalLink("editor", app.editorUrl));
|
|
276624
|
-
emit(source_default.dim(
|
|
276615
|
+
emit(source_default.dim(`linked ./${app.dirName} (cd ${app.dirName} after the session)`));
|
|
276625
276616
|
const branchId = await resolveActiveBranchId().catch(() => {
|
|
276626
276617
|
return;
|
|
276627
276618
|
});
|
|
@@ -276655,8 +276646,8 @@ async function codeAction({ log }, options) {
|
|
|
276655
276646
|
linked = true;
|
|
276656
276647
|
} catch {}
|
|
276657
276648
|
if (linked) {
|
|
276658
|
-
if (options.import
|
|
276659
|
-
throw new InvalidInputError("--import
|
|
276649
|
+
if (options.import) {
|
|
276650
|
+
throw new InvalidInputError("--import creates a new app; run it outside a linked project.");
|
|
276660
276651
|
}
|
|
276661
276652
|
const branchId = await resolveActiveBranchId().catch(() => {
|
|
276662
276653
|
return;
|
|
@@ -276684,7 +276675,7 @@ async function codeAction({ log }, options) {
|
|
|
276684
276675
|
footer,
|
|
276685
276676
|
createApp: (prompt, emit) => bootstrapApp(prompt, footer, emit, (app) => {
|
|
276686
276677
|
created = app;
|
|
276687
|
-
}, options.import
|
|
276678
|
+
}, options.import)
|
|
276688
276679
|
});
|
|
276689
276680
|
if (!created) {
|
|
276690
276681
|
return { outroMessage: "Session closed. No app was created." };
|
|
@@ -276696,7 +276687,7 @@ async function codeAction({ log }, options) {
|
|
|
276696
276687
|
}
|
|
276697
276688
|
function getCodeCommand() {
|
|
276698
276689
|
const command = new Base44Command("code", { requireAppContext: false });
|
|
276699
|
-
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").
|
|
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);
|
|
276700
276691
|
return command;
|
|
276701
276692
|
}
|
|
276702
276693
|
|
|
@@ -277494,10 +277485,10 @@ function getConnectorsListAvailableCommand() {
|
|
|
277494
277485
|
}
|
|
277495
277486
|
|
|
277496
277487
|
// src/cli/commands/connectors/pull.ts
|
|
277497
|
-
import { dirname as dirname19, join as join27, resolve as
|
|
277488
|
+
import { dirname as dirname19, join as join27, resolve as resolve8 } from "node:path";
|
|
277498
277489
|
async function resolveConnectorsDir(options) {
|
|
277499
277490
|
if (!getAppContext().projectRoot) {
|
|
277500
|
-
return
|
|
277491
|
+
return resolve8(options.dir ?? "connectors");
|
|
277501
277492
|
}
|
|
277502
277493
|
const { project } = await readProjectConfig();
|
|
277503
277494
|
return join27(dirname19(project.configPath), project.connectorsDir);
|
|
@@ -277541,10 +277532,10 @@ function getConnectorsPullCommand() {
|
|
|
277541
277532
|
}
|
|
277542
277533
|
|
|
277543
277534
|
// src/cli/commands/connectors/push.ts
|
|
277544
|
-
import { resolve as
|
|
277535
|
+
import { resolve as resolve9 } from "node:path";
|
|
277545
277536
|
async function readConnectorsToPush(options) {
|
|
277546
277537
|
if (!getAppContext().projectRoot) {
|
|
277547
|
-
return readAllConnectors(
|
|
277538
|
+
return readAllConnectors(resolve9(options.dir ?? "connectors"));
|
|
277548
277539
|
}
|
|
277549
277540
|
const { connectors } = await readProjectConfig();
|
|
277550
277541
|
return connectors;
|
|
@@ -278013,7 +278004,7 @@ function getBuildCommand() {
|
|
|
278013
278004
|
}
|
|
278014
278005
|
|
|
278015
278006
|
// src/cli/commands/project/create.ts
|
|
278016
|
-
import { basename as
|
|
278007
|
+
import { basename as basename6, resolve as resolve10 } from "node:path";
|
|
278017
278008
|
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
278018
278009
|
|
|
278019
278010
|
// src/cli/commands/project/scaffold-shared.ts
|
|
@@ -278178,8 +278169,8 @@ async function createInteractive(options, ctx) {
|
|
|
278178
278169
|
name: () => {
|
|
278179
278170
|
return options.name ? Promise.resolve(options.name) : Ze({
|
|
278180
278171
|
message: "What is the name of your project?",
|
|
278181
|
-
placeholder:
|
|
278182
|
-
initialValue:
|
|
278172
|
+
placeholder: basename6(process.cwd()),
|
|
278173
|
+
initialValue: basename6(process.cwd()),
|
|
278183
278174
|
validate: (value) => {
|
|
278184
278175
|
if (!value || value.trim().length === 0) {
|
|
278185
278176
|
return "Every project deserves a name";
|
|
@@ -278209,7 +278200,7 @@ async function createInteractive(options, ctx) {
|
|
|
278209
278200
|
}, ctx);
|
|
278210
278201
|
}
|
|
278211
278202
|
async function createNonInteractive(options, ctx) {
|
|
278212
|
-
ctx.log.info(`Creating a new project at ${
|
|
278203
|
+
ctx.log.info(`Creating a new project at ${resolve10(options.path)}`);
|
|
278213
278204
|
const template = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
278214
278205
|
return await executeCreate({
|
|
278215
278206
|
template,
|
|
@@ -278233,7 +278224,7 @@ async function executeCreate({
|
|
|
278233
278224
|
}, ctx) {
|
|
278234
278225
|
const { log, runTask } = ctx;
|
|
278235
278226
|
const name = rawName.trim();
|
|
278236
|
-
const resolvedPath =
|
|
278227
|
+
const resolvedPath = resolve10(projectPath);
|
|
278237
278228
|
const organizationId = await resolveWorkspaceId(ctx, flagWorkspaceId, isInteractive);
|
|
278238
278229
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
278239
278230
|
return await createProjectFiles({
|
|
@@ -278874,7 +278865,7 @@ function getLogsCommand() {
|
|
|
278874
278865
|
}
|
|
278875
278866
|
|
|
278876
278867
|
// src/cli/commands/project/scaffold.ts
|
|
278877
|
-
import { basename as
|
|
278868
|
+
import { basename as basename7, resolve as resolve11 } from "node:path";
|
|
278878
278869
|
function resolveAppId(options) {
|
|
278879
278870
|
const appId = options.appId;
|
|
278880
278871
|
if (!appId) {
|
|
@@ -278890,8 +278881,8 @@ function resolveAppId(options) {
|
|
|
278890
278881
|
async function scaffoldAction(ctx, name, options, command) {
|
|
278891
278882
|
const { log, runTask } = ctx;
|
|
278892
278883
|
const appId = resolveAppId(command.optsWithGlobals());
|
|
278893
|
-
const resolvedPath =
|
|
278894
|
-
const projectName = (name ??
|
|
278884
|
+
const resolvedPath = resolve11("./");
|
|
278885
|
+
const projectName = (name ?? basename7(resolvedPath)).trim();
|
|
278895
278886
|
const template = await getTemplateById("backend-only");
|
|
278896
278887
|
log.info(`Scaffolding project at ${resolvedPath}`);
|
|
278897
278888
|
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
@@ -279307,7 +279298,7 @@ function getSecretsListCommand() {
|
|
|
279307
279298
|
}
|
|
279308
279299
|
|
|
279309
279300
|
// src/cli/commands/secrets/set.ts
|
|
279310
|
-
import { resolve as
|
|
279301
|
+
import { resolve as resolve12 } from "node:path";
|
|
279311
279302
|
function parseEntries(entries) {
|
|
279312
279303
|
const secrets = {};
|
|
279313
279304
|
for (const entry of entries) {
|
|
@@ -279338,7 +279329,7 @@ async function setSecretsAction({ log, runTask }, entries, options) {
|
|
|
279338
279329
|
validateInput(entries, options);
|
|
279339
279330
|
let secrets;
|
|
279340
279331
|
if (options.envFile) {
|
|
279341
|
-
secrets = await parseEnvFile(
|
|
279332
|
+
secrets = await parseEnvFile(resolve12(options.envFile));
|
|
279342
279333
|
if (Object.keys(secrets).length === 0) {
|
|
279343
279334
|
throw new InvalidInputError("The env file contains no valid KEY=VALUE entries.");
|
|
279344
279335
|
}
|
|
@@ -279367,7 +279358,7 @@ function getSecretsCommand() {
|
|
|
279367
279358
|
}
|
|
279368
279359
|
|
|
279369
279360
|
// src/cli/commands/site/deploy.ts
|
|
279370
|
-
import { resolve as
|
|
279361
|
+
import { resolve as resolve13 } from "node:path";
|
|
279371
279362
|
async function deployAction2(ctx, options) {
|
|
279372
279363
|
const { isNonInteractive } = ctx;
|
|
279373
279364
|
if (isNonInteractive && !options.yes) {
|
|
@@ -279445,7 +279436,7 @@ async function deployTarball({ runTask }, project) {
|
|
|
279445
279436
|
}
|
|
279446
279437
|
function siteOutputDir(project) {
|
|
279447
279438
|
const outputDirectory = project.site?.outputDirectory;
|
|
279448
|
-
return outputDirectory ?
|
|
279439
|
+
return outputDirectory ? resolve13(project.root, outputDirectory) : null;
|
|
279449
279440
|
}
|
|
279450
279441
|
function getSiteDeployCommand() {
|
|
279451
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)");
|
|
@@ -281947,7 +281938,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
281947
281938
|
|
|
281948
281939
|
// src/cli/dev/dev-server/watcher.ts
|
|
281949
281940
|
import { EventEmitter as EventEmitter6 } from "node:events";
|
|
281950
|
-
import { relative as
|
|
281941
|
+
import { relative as relative9 } from "node:path";
|
|
281951
281942
|
|
|
281952
281943
|
// ../../node_modules/chokidar/index.js
|
|
281953
281944
|
import { EventEmitter as EventEmitter5 } from "node:events";
|
|
@@ -283632,7 +283623,7 @@ class WatchBase44 extends EventEmitter6 {
|
|
|
283632
283623
|
ignoreInitial: true
|
|
283633
283624
|
});
|
|
283634
283625
|
watcher.on("all", import_debounce4.default(async (_event, path) => {
|
|
283635
|
-
this.emit("change", name,
|
|
283626
|
+
this.emit("change", name, relative9(targetPath, path));
|
|
283636
283627
|
}, WATCH_DEBOUNCE_MS));
|
|
283637
283628
|
watcher.on("error", (err) => {
|
|
283638
283629
|
this.logger.error(`Watch handler failed for ${targetPath}`, err);
|
|
@@ -284142,7 +284133,7 @@ Examples:
|
|
|
284142
284133
|
}
|
|
284143
284134
|
|
|
284144
284135
|
// src/cli/commands/project/eject.ts
|
|
284145
|
-
import { resolve as
|
|
284136
|
+
import { resolve as resolve17 } from "node:path";
|
|
284146
284137
|
var import_kebabCase3 = __toESM(require_kebabCase(), 1);
|
|
284147
284138
|
async function eject(ctx, options, command) {
|
|
284148
284139
|
const { log, runTask, isNonInteractive } = ctx;
|
|
@@ -284206,7 +284197,7 @@ async function eject(ctx, options, command) {
|
|
|
284206
284197
|
Ne("Operation cancelled.");
|
|
284207
284198
|
throw new CLIExitError(0);
|
|
284208
284199
|
}
|
|
284209
|
-
const resolvedPath =
|
|
284200
|
+
const resolvedPath = resolve17(selectedPath);
|
|
284210
284201
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
284211
284202
|
await createProjectFilesForExistingProject({
|
|
284212
284203
|
projectId,
|
|
@@ -288343,4 +288334,4 @@ export {
|
|
|
288343
288334
|
runCLI
|
|
288344
288335
|
};
|
|
288345
288336
|
|
|
288346
|
-
//# debugId=
|
|
288337
|
+
//# debugId=72FC25F5FAAAB35A64756E2164756E21
|