@base44-preview/cli 0.0.4-pr.49.389b368 → 0.0.4-pr.53.0ce7d55
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 +104 -23
- package/dist/cli/templates/templates.json +4 -4
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -4300,7 +4300,7 @@ ${J}${i.trimStart()}`), r$1 = 3 + stripVTControlCharacters(i.trimStart()).length
|
|
|
4300
4300
|
//#endregion
|
|
4301
4301
|
//#region node_modules/p-wait-for/index.js
|
|
4302
4302
|
const resolveValue = Symbol("resolveValue");
|
|
4303
|
-
const sleep = (ms, signal) => new Promise((resolve$1, reject) => {
|
|
4303
|
+
const sleep$1 = (ms, signal) => new Promise((resolve$1, reject) => {
|
|
4304
4304
|
if (signal?.aborted) {
|
|
4305
4305
|
reject(signal.reason);
|
|
4306
4306
|
return;
|
|
@@ -4338,14 +4338,14 @@ async function pWaitFor(condition, options = {}) {
|
|
|
4338
4338
|
const timeoutMs = typeof timeout$1 === "number" ? timeout$1 : timeout$1?.milliseconds ?? Number.POSITIVE_INFINITY;
|
|
4339
4339
|
const timeoutSignal = timeoutMs === Number.POSITIVE_INFINITY ? void 0 : AbortSignal.timeout(timeoutMs);
|
|
4340
4340
|
const combinedSignal = timeoutSignal && signal ? AbortSignal.any([timeoutSignal, signal]) : timeoutSignal ?? signal;
|
|
4341
|
-
if (!before) await sleep(interval, combinedSignal);
|
|
4341
|
+
if (!before) await sleep$1(interval, combinedSignal);
|
|
4342
4342
|
if (combinedSignal?.aborted) return handleAbortError(timeoutSignal, timeout$1, signal);
|
|
4343
4343
|
while (true) try {
|
|
4344
4344
|
const value = await condition();
|
|
4345
4345
|
if (typeof value === "object" && value !== null && resolveValue in value) return value[resolveValue];
|
|
4346
4346
|
if (value === true) return;
|
|
4347
4347
|
if (value === false) {
|
|
4348
|
-
await sleep(interval, combinedSignal);
|
|
4348
|
+
await sleep$1(interval, combinedSignal);
|
|
4349
4349
|
continue;
|
|
4350
4350
|
}
|
|
4351
4351
|
throw new TypeError("Expected condition to return a boolean");
|
|
@@ -18565,19 +18565,95 @@ async function getUserInfo(accessToken) {
|
|
|
18565
18565
|
return result.data;
|
|
18566
18566
|
}
|
|
18567
18567
|
|
|
18568
|
+
//#endregion
|
|
18569
|
+
//#region src/cli/utils/animate.ts
|
|
18570
|
+
const orange$2 = source_default.hex("#E86B3C");
|
|
18571
|
+
const gold = source_default.hex("#FFD700");
|
|
18572
|
+
/**
|
|
18573
|
+
* Sleep for a specified number of milliseconds.
|
|
18574
|
+
*/
|
|
18575
|
+
function sleep(ms) {
|
|
18576
|
+
return new Promise((resolve$1) => setTimeout(resolve$1, ms));
|
|
18577
|
+
}
|
|
18578
|
+
/**
|
|
18579
|
+
* Animate a single line with a left-to-right color reveal.
|
|
18580
|
+
*/
|
|
18581
|
+
async function animateLineReveal(line, duration$2) {
|
|
18582
|
+
const steps = 8;
|
|
18583
|
+
const stepDuration = duration$2 / steps;
|
|
18584
|
+
for (let step = 0; step <= steps; step++) {
|
|
18585
|
+
const progress = step / steps;
|
|
18586
|
+
const revealIndex = Math.floor(progress * line.length);
|
|
18587
|
+
let output = "";
|
|
18588
|
+
for (let i = 0; i < line.length; i++) if (i < revealIndex) output += orange$2(line[i]);
|
|
18589
|
+
else if (i === revealIndex) output += gold(line[i]);
|
|
18590
|
+
else output += source_default.dim(line[i]);
|
|
18591
|
+
process.stdout.write(`\r${output}`);
|
|
18592
|
+
await sleep(stepDuration);
|
|
18593
|
+
}
|
|
18594
|
+
process.stdout.write(`\r${orange$2(line)}\n`);
|
|
18595
|
+
}
|
|
18596
|
+
/**
|
|
18597
|
+
* Quick shimmer pass over the entire banner.
|
|
18598
|
+
*/
|
|
18599
|
+
async function shimmerPass(lines, duration$2) {
|
|
18600
|
+
const moveUp = `\x1b[${lines.length}A`;
|
|
18601
|
+
const steps = 12;
|
|
18602
|
+
const stepDuration = duration$2 / steps;
|
|
18603
|
+
const maxWidth = Math.max(...lines.map((l$1) => l$1.length));
|
|
18604
|
+
for (let step = 0; step <= steps; step++) {
|
|
18605
|
+
const shimmerPos = Math.floor(step / steps * (maxWidth + 6));
|
|
18606
|
+
process.stdout.write(moveUp);
|
|
18607
|
+
for (const line of lines) {
|
|
18608
|
+
let output = "";
|
|
18609
|
+
for (let i = 0; i < line.length; i++) {
|
|
18610
|
+
const dist = Math.abs(i - shimmerPos);
|
|
18611
|
+
if (dist < 3) output += dist === 0 ? source_default.white(line[i]) : gold(line[i]);
|
|
18612
|
+
else output += orange$2(line[i]);
|
|
18613
|
+
}
|
|
18614
|
+
console.log(output);
|
|
18615
|
+
}
|
|
18616
|
+
await sleep(stepDuration);
|
|
18617
|
+
}
|
|
18618
|
+
process.stdout.write(moveUp);
|
|
18619
|
+
for (const line of lines) console.log(orange$2(line));
|
|
18620
|
+
}
|
|
18621
|
+
/**
|
|
18622
|
+
* Animate the output with a smooth line-by-line reveal.
|
|
18623
|
+
* Each line fades in with a gradient sweep effect.
|
|
18624
|
+
*
|
|
18625
|
+
* Total duration: ~1.5 seconds for a magical but not slow feel.
|
|
18626
|
+
*/
|
|
18627
|
+
async function printAnimatedLines(lines) {
|
|
18628
|
+
const lineDelay = 1e3 / lines.length;
|
|
18629
|
+
for (let i = 0; i < lines.length; i++) {
|
|
18630
|
+
const line = lines[i];
|
|
18631
|
+
await animateLineReveal(line, 100);
|
|
18632
|
+
if (i < lines.length - 1) await sleep(lineDelay - 100);
|
|
18633
|
+
}
|
|
18634
|
+
await shimmerPass(lines, 200);
|
|
18635
|
+
}
|
|
18636
|
+
|
|
18568
18637
|
//#endregion
|
|
18569
18638
|
//#region src/cli/utils/banner.ts
|
|
18570
|
-
const orange = source_default.hex("#E86B3C");
|
|
18571
|
-
const
|
|
18572
|
-
|
|
18573
|
-
|
|
18574
|
-
|
|
18575
|
-
|
|
18576
|
-
|
|
18577
|
-
|
|
18578
|
-
|
|
18579
|
-
|
|
18580
|
-
|
|
18639
|
+
const orange$1 = source_default.hex("#E86B3C");
|
|
18640
|
+
const BANNER_LINES = [
|
|
18641
|
+
"",
|
|
18642
|
+
"██████╗ █████╗ ███████╗███████╗ ██╗ ██╗██╗ ██╗",
|
|
18643
|
+
"██╔══██╗██╔══██╗██╔════╝██╔════╝ ██║ ██║██║ ██║",
|
|
18644
|
+
"██████╔╝███████║███████╗█████╗ ███████║███████║",
|
|
18645
|
+
"██╔══██╗██╔══██║╚════██║██╔══╝ ╚════██║╚════██║",
|
|
18646
|
+
"██████╔╝██║ ██║███████║███████╗ ██║ ██║",
|
|
18647
|
+
"╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝",
|
|
18648
|
+
""
|
|
18649
|
+
];
|
|
18650
|
+
/**
|
|
18651
|
+
* Print the Base44 banner with smooth animation if supported,
|
|
18652
|
+
* or fall back to static banner.
|
|
18653
|
+
*/
|
|
18654
|
+
async function printBanner() {
|
|
18655
|
+
if (process.stdout.isTTY) await printAnimatedLines(BANNER_LINES);
|
|
18656
|
+
else console.log(orange$1(BANNER_LINES.join("\n")));
|
|
18581
18657
|
}
|
|
18582
18658
|
|
|
18583
18659
|
//#endregion
|
|
@@ -18606,7 +18682,7 @@ const base44Color = source_default.bgHex("#E86B3C");
|
|
|
18606
18682
|
* });
|
|
18607
18683
|
*/
|
|
18608
18684
|
async function runCommand(commandFn, options) {
|
|
18609
|
-
if (options?.fullBanner) printBanner();
|
|
18685
|
+
if (options?.fullBanner) await printBanner();
|
|
18610
18686
|
else Ie(base44Color(" Base 44 "));
|
|
18611
18687
|
await loadProjectEnv();
|
|
18612
18688
|
try {
|
|
@@ -24282,7 +24358,10 @@ var require_lodash = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
24282
24358
|
//#endregion
|
|
24283
24359
|
//#region src/cli/commands/project/create.ts
|
|
24284
24360
|
var import_lodash = /* @__PURE__ */ __toESM(require_lodash(), 1);
|
|
24361
|
+
const orange = source_default.hex("#E86B3C");
|
|
24362
|
+
const cyan = source_default.hex("#00D4FF");
|
|
24285
24363
|
async function create() {
|
|
24364
|
+
Ie("Let's create something amazing!");
|
|
24286
24365
|
const templateOptions = (await listTemplates()).map((t) => ({
|
|
24287
24366
|
value: t,
|
|
24288
24367
|
label: t.name,
|
|
@@ -24290,18 +24369,18 @@ async function create() {
|
|
|
24290
24369
|
}));
|
|
24291
24370
|
const { template, name: name$1, description, projectPath } = await Ce({
|
|
24292
24371
|
template: () => ve({
|
|
24293
|
-
message: "
|
|
24372
|
+
message: "Pick a template",
|
|
24294
24373
|
options: templateOptions
|
|
24295
24374
|
}),
|
|
24296
24375
|
name: () => he({
|
|
24297
24376
|
message: "What is the name of your project?",
|
|
24298
|
-
placeholder: "my-app
|
|
24377
|
+
placeholder: "my-app",
|
|
24299
24378
|
validate: (value) => {
|
|
24300
|
-
if (!value || value.trim().length === 0) return "
|
|
24379
|
+
if (!value || value.trim().length === 0) return "Every project deserves a name";
|
|
24301
24380
|
}
|
|
24302
24381
|
}),
|
|
24303
24382
|
description: () => he({
|
|
24304
|
-
message: "
|
|
24383
|
+
message: "Description (optional)",
|
|
24305
24384
|
placeholder: "A brief description of your project"
|
|
24306
24385
|
}),
|
|
24307
24386
|
projectPath: async ({ results }) => {
|
|
@@ -24314,7 +24393,7 @@ async function create() {
|
|
|
24314
24393
|
}
|
|
24315
24394
|
}, { onCancel: onPromptCancel });
|
|
24316
24395
|
const resolvedPath = resolve(projectPath);
|
|
24317
|
-
const { projectId } = await runTask("
|
|
24396
|
+
const { projectId } = await runTask("Setting up your project...", async () => {
|
|
24318
24397
|
return await createProjectFiles({
|
|
24319
24398
|
name: name$1.trim(),
|
|
24320
24399
|
description: description ? description.trim() : void 0,
|
|
@@ -24322,11 +24401,13 @@ async function create() {
|
|
|
24322
24401
|
template
|
|
24323
24402
|
});
|
|
24324
24403
|
}, {
|
|
24325
|
-
successMessage: "Project created successfully"
|
|
24404
|
+
successMessage: `${orange("✓")} ${source_default.bold("Project created successfully!")}`,
|
|
24326
24405
|
errorMessage: "Failed to create project"
|
|
24327
24406
|
});
|
|
24328
|
-
|
|
24329
|
-
M.
|
|
24407
|
+
const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/preview`;
|
|
24408
|
+
M.message(`${source_default.dim("Project")}: ${orange(name$1.trim())}`);
|
|
24409
|
+
M.message(`${source_default.dim("Dashboard")}: ${cyan(dashboardUrl)}`);
|
|
24410
|
+
Se("All set and ready!");
|
|
24330
24411
|
}
|
|
24331
24412
|
const createCommand = new Command("create").description("Create a new Base44 project").action(async () => {
|
|
24332
24413
|
await runCommand(create, {
|
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
"templates": [
|
|
3
3
|
{
|
|
4
4
|
"id": "backend-only",
|
|
5
|
-
"name": "
|
|
6
|
-
"description": "
|
|
5
|
+
"name": "Backend Only",
|
|
6
|
+
"description": "Create a Base44 backend project with entities, functions, and APIs",
|
|
7
7
|
"path": "backend-only"
|
|
8
8
|
},
|
|
9
9
|
{
|
|
10
10
|
"id": "backend-and-client",
|
|
11
|
-
"name": "
|
|
12
|
-
"description": "Full-stack
|
|
11
|
+
"name": "Backend & Client",
|
|
12
|
+
"description": "Full-stack project with Base44 backend, Vite and a React client application",
|
|
13
13
|
"path": "backend-and-client"
|
|
14
14
|
}
|
|
15
15
|
]
|
package/package.json
CHANGED