@base44-preview/cli 0.0.54-pr.538.77dd117 → 0.0.54-pr.538.8d085e6
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 +18 -84
- package/dist/cli/index.js.map +8 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -253291,22 +253291,15 @@ function resolveAppId(options) {
|
|
|
253291
253291
|
}
|
|
253292
253292
|
return appId;
|
|
253293
253293
|
}
|
|
253294
|
-
async function
|
|
253295
|
-
|
|
253296
|
-
|
|
253297
|
-
|
|
253298
|
-
|
|
253299
|
-
|
|
253300
|
-
deploy: deploy5,
|
|
253301
|
-
skills,
|
|
253302
|
-
isInteractive
|
|
253303
|
-
}, { log, runTask: runTask2 }) {
|
|
253304
|
-
const name2 = rawName.trim();
|
|
253305
|
-
const resolvedPath = resolve6(projectPath);
|
|
253294
|
+
async function initAction({ log, runTask: runTask2 }, name2, options) {
|
|
253295
|
+
const appId = resolveAppId(options);
|
|
253296
|
+
const resolvedPath = resolve6("./");
|
|
253297
|
+
const projectName = (name2 ?? basename4(resolvedPath)).trim();
|
|
253298
|
+
const template2 = await getTemplateById("backend-only");
|
|
253299
|
+
log.info(`Initializing project at ${resolvedPath}`);
|
|
253306
253300
|
const { projectId, skippedFiles } = await runTask2("Setting up your project...", async () => {
|
|
253307
253301
|
return await initProjectFiles({
|
|
253308
|
-
name:
|
|
253309
|
-
description: description?.trim(),
|
|
253302
|
+
name: projectName,
|
|
253310
253303
|
path: resolvedPath,
|
|
253311
253304
|
template: template2,
|
|
253312
253305
|
appId
|
|
@@ -253319,83 +253312,24 @@ async function executeInit({
|
|
|
253319
253312
|
log.info(`Kept existing file${skippedFiles.length > 1 ? "s" : ""}: ${skippedFiles.join(", ")}`);
|
|
253320
253313
|
}
|
|
253321
253314
|
setAppConfig({ id: projectId, projectRoot: resolvedPath });
|
|
253322
|
-
return await completeProjectSetup({
|
|
253323
|
-
|
|
253324
|
-
|
|
253325
|
-
|
|
253326
|
-
|
|
253327
|
-
value: t,
|
|
253328
|
-
label: t.name,
|
|
253329
|
-
hint: t.description
|
|
253330
|
-
}));
|
|
253331
|
-
const result = await Oe({
|
|
253332
|
-
template: () => Je({
|
|
253333
|
-
message: "Pick an option",
|
|
253334
|
-
options: templateOptions
|
|
253335
|
-
}),
|
|
253336
|
-
name: () => {
|
|
253337
|
-
return options.name ? Promise.resolve(options.name) : Ze({
|
|
253338
|
-
message: "What is the name of your project?",
|
|
253339
|
-
placeholder: basename4(process.cwd()),
|
|
253340
|
-
initialValue: basename4(process.cwd()),
|
|
253341
|
-
validate: (value) => {
|
|
253342
|
-
if (!value || value.trim().length === 0) {
|
|
253343
|
-
return "Every project deserves a name";
|
|
253344
|
-
}
|
|
253345
|
-
}
|
|
253346
|
-
});
|
|
253347
|
-
},
|
|
253348
|
-
projectPath: () => Ze({
|
|
253349
|
-
message: "Where should we set up your project?",
|
|
253350
|
-
placeholder: "./",
|
|
253351
|
-
initialValue: options.path ?? "./"
|
|
253352
|
-
})
|
|
253353
|
-
}, {
|
|
253354
|
-
onCancel: onPromptCancel
|
|
253355
|
-
});
|
|
253356
|
-
return await executeInit({
|
|
253357
|
-
template: result.template,
|
|
253358
|
-
name: result.name,
|
|
253359
|
-
appId,
|
|
253360
|
-
projectPath: result.projectPath,
|
|
253361
|
-
deploy: options.deploy,
|
|
253362
|
-
skills: options.skills,
|
|
253363
|
-
isInteractive: true
|
|
253364
|
-
}, ctx);
|
|
253365
|
-
}
|
|
253366
|
-
async function initNonInteractive(appId, options, ctx) {
|
|
253367
|
-
const projectPath = options.path ?? "./";
|
|
253368
|
-
const name2 = options.name ?? basename4(resolve6(projectPath));
|
|
253369
|
-
ctx.log.info(`Initializing project at ${resolve6(projectPath)}`);
|
|
253370
|
-
const template2 = await getTemplateById(options.template ?? DEFAULT_TEMPLATE_ID);
|
|
253371
|
-
return await executeInit({
|
|
253372
|
-
template: template2,
|
|
253373
|
-
name: name2,
|
|
253374
|
-
appId,
|
|
253375
|
-
projectPath,
|
|
253376
|
-
deploy: options.deploy,
|
|
253315
|
+
return await completeProjectSetup({
|
|
253316
|
+
projectId,
|
|
253317
|
+
name: projectName,
|
|
253318
|
+
resolvedPath,
|
|
253319
|
+
deploy: false,
|
|
253377
253320
|
skills: options.skills,
|
|
253378
253321
|
isInteractive: false
|
|
253379
|
-
},
|
|
253380
|
-
}
|
|
253381
|
-
async function initAction({ log, runTask: runTask2, isNonInteractive }, name2, options) {
|
|
253382
|
-
const appId = resolveAppId(options);
|
|
253383
|
-
const opts = { ...options, name: options.name ?? name2 };
|
|
253384
|
-
const ctx = { log, runTask: runTask2 };
|
|
253385
|
-
if (isNonInteractive) {
|
|
253386
|
-
return await initNonInteractive(appId, opts, ctx);
|
|
253387
|
-
}
|
|
253388
|
-
return await initInteractive(appId, opts, ctx);
|
|
253322
|
+
}, { log, runTask: runTask2 });
|
|
253389
253323
|
}
|
|
253390
253324
|
function getInitCommand() {
|
|
253391
253325
|
return new Base44Command("init", {
|
|
253392
253326
|
requireAppConfig: false,
|
|
253393
253327
|
fullBanner: true
|
|
253394
|
-
}).description("Scaffold a local project for an existing Base44 app (e.g. one provisioned by the Stripe Projects CLI)").addArgument(new Argument("name", "Project name").argOptional()).option("--app-id <id>", "Existing Base44 app ID (defaults to the BASE44_APP_ID environment variable)").option("
|
|
253328
|
+
}).description("Scaffold a local project for an existing Base44 app (e.g. one provisioned by the Stripe Projects CLI)").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", `
|
|
253395
253329
|
Examples:
|
|
253396
|
-
$ base44 init
|
|
253397
|
-
$ base44 init --app-id app_123
|
|
253398
|
-
$ base44 init my-app --app-id app_123
|
|
253330
|
+
$ base44 init Scaffolds the current dir for $BASE44_APP_ID
|
|
253331
|
+
$ base44 init --app-id app_123 Scaffolds the current dir for the given app
|
|
253332
|
+
$ base44 init my-app --app-id app_123 Scaffolds the current dir, named "my-app"`).action(initAction);
|
|
253399
253333
|
}
|
|
253400
253334
|
|
|
253401
253335
|
// src/cli/commands/project/link.ts
|
|
@@ -261822,4 +261756,4 @@ export {
|
|
|
261822
261756
|
CLIExitError
|
|
261823
261757
|
};
|
|
261824
261758
|
|
|
261825
|
-
//# debugId=
|
|
261759
|
+
//# debugId=4D45D70DBF552F3964756E2164756E21
|