@base44-preview/cli 0.0.25-pr.156.5ba1704 → 0.0.25-pr.156.9f2fe48
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/index.js +33 -26
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30872,6 +30872,21 @@ async function getUserInfo(accessToken) {
|
|
|
30872
30872
|
return result.data;
|
|
30873
30873
|
}
|
|
30874
30874
|
|
|
30875
|
+
//#endregion
|
|
30876
|
+
//#region src/cli/errors.ts
|
|
30877
|
+
/**
|
|
30878
|
+
* Error thrown to signal a controlled CLI exit with a specific exit code.
|
|
30879
|
+
* This allows proper error propagation without calling process.exit() directly,
|
|
30880
|
+
* making the code more testable and maintaining a single exit point.
|
|
30881
|
+
*/
|
|
30882
|
+
var CLIExitError = class extends Error {
|
|
30883
|
+
constructor(code$1) {
|
|
30884
|
+
super(`CLI exited with code ${code$1}`);
|
|
30885
|
+
this.code = code$1;
|
|
30886
|
+
this.name = "CLIExitError";
|
|
30887
|
+
}
|
|
30888
|
+
};
|
|
30889
|
+
|
|
30875
30890
|
//#endregion
|
|
30876
30891
|
//#region node_modules/nanoid/url-alphabet/index.js
|
|
30877
30892
|
const urlAlphabet = "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";
|
|
@@ -48514,18 +48529,25 @@ async function runCommand(commandFn, options) {
|
|
|
48514
48529
|
await printBanner();
|
|
48515
48530
|
Ie("");
|
|
48516
48531
|
} else Ie(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
48517
|
-
|
|
48518
|
-
if (
|
|
48519
|
-
|
|
48520
|
-
|
|
48532
|
+
try {
|
|
48533
|
+
if (options?.requireAuth) {
|
|
48534
|
+
if (!await isLoggedIn()) {
|
|
48535
|
+
M.info("You need to login first to continue.");
|
|
48536
|
+
await login();
|
|
48537
|
+
}
|
|
48521
48538
|
}
|
|
48539
|
+
if (options?.requireAppConfig !== false) {
|
|
48540
|
+
const appConfig = await initAppConfig();
|
|
48541
|
+
errorReporter.setAppContext(appConfig.id);
|
|
48542
|
+
}
|
|
48543
|
+
const { outroMessage } = await commandFn();
|
|
48544
|
+
Se(outroMessage || "");
|
|
48545
|
+
} catch (e$1) {
|
|
48546
|
+
if (e$1 instanceof CLIExitError) throw e$1;
|
|
48547
|
+
if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
|
|
48548
|
+
else M.error(String(e$1));
|
|
48549
|
+
throw new CLIExitError(1);
|
|
48522
48550
|
}
|
|
48523
|
-
if (options?.requireAppConfig !== false) {
|
|
48524
|
-
const appConfig = await initAppConfig();
|
|
48525
|
-
errorReporter.setAppContext(appConfig.id);
|
|
48526
|
-
}
|
|
48527
|
-
const { outroMessage } = await commandFn();
|
|
48528
|
-
Se(outroMessage || "");
|
|
48529
48551
|
}
|
|
48530
48552
|
|
|
48531
48553
|
//#endregion
|
|
@@ -48582,21 +48604,6 @@ async function runTask(startMessage, operation, options) {
|
|
|
48582
48604
|
}
|
|
48583
48605
|
}
|
|
48584
48606
|
|
|
48585
|
-
//#endregion
|
|
48586
|
-
//#region src/cli/errors.ts
|
|
48587
|
-
/**
|
|
48588
|
-
* Error thrown to signal a controlled CLI exit with a specific exit code.
|
|
48589
|
-
* This allows proper error propagation without calling process.exit() directly,
|
|
48590
|
-
* making the code more testable and maintaining a single exit point.
|
|
48591
|
-
*/
|
|
48592
|
-
var CLIExitError = class extends Error {
|
|
48593
|
-
constructor(code$1) {
|
|
48594
|
-
super(`CLI exited with code ${code$1}`);
|
|
48595
|
-
this.code = code$1;
|
|
48596
|
-
this.name = "CLIExitError";
|
|
48597
|
-
}
|
|
48598
|
-
};
|
|
48599
|
-
|
|
48600
48607
|
//#endregion
|
|
48601
48608
|
//#region src/cli/utils/prompts.ts
|
|
48602
48609
|
/**
|
|
@@ -56384,9 +56391,9 @@ async function runCLI(program$1) {
|
|
|
56384
56391
|
await program$1.parseAsync();
|
|
56385
56392
|
} catch (error) {
|
|
56386
56393
|
if (!(error instanceof CLIExitError)) {
|
|
56387
|
-
console.error(error instanceof Error ? error.stack ?? error.message : String(error));
|
|
56388
56394
|
errorReporter.displayErrorInfo();
|
|
56389
56395
|
await errorReporter.captureException(error instanceof Error ? error : new Error(String(error)));
|
|
56396
|
+
console.error(error);
|
|
56390
56397
|
}
|
|
56391
56398
|
await errorReporter.shutdown();
|
|
56392
56399
|
process.exit(error instanceof CLIExitError ? error.code : 1);
|