@base44-preview/cli 0.0.45-pr.420.c43b7e8 → 0.0.45-pr.420.ddd6169
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 +68 -33
- package/dist/cli/index.js.map +32 -32
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -167116,8 +167116,8 @@ var require_factory = __commonJS((exports) => {
|
|
|
167116
167116
|
exports.createProxyMiddleware = createProxyMiddleware;
|
|
167117
167117
|
var http_proxy_middleware_1 = require_http_proxy_middleware();
|
|
167118
167118
|
function createProxyMiddleware(options8) {
|
|
167119
|
-
const { middleware
|
|
167120
|
-
return
|
|
167119
|
+
const { middleware } = new http_proxy_middleware_1.HttpProxyMiddleware(options8);
|
|
167120
|
+
return middleware;
|
|
167121
167121
|
}
|
|
167122
167122
|
});
|
|
167123
167123
|
|
|
@@ -216497,13 +216497,8 @@ var BANNER_LINES = [
|
|
|
216497
216497
|
"██████╔╝██║ ██║███████║███████╗ ██║ ██║",
|
|
216498
216498
|
"╚═════╝ ╚═╝ ╚═╝╚══════╝╚══════╝ ╚═╝ ╚═╝"
|
|
216499
216499
|
];
|
|
216500
|
-
async function printBanner(
|
|
216501
|
-
|
|
216502
|
-
console.log(theme.colors.base44Orange(BANNER_LINES.join(`
|
|
216503
|
-
`)));
|
|
216504
|
-
} else {
|
|
216505
|
-
await printAnimatedLines(BANNER_LINES);
|
|
216506
|
-
}
|
|
216500
|
+
async function printBanner() {
|
|
216501
|
+
await printAnimatedLines(BANNER_LINES);
|
|
216507
216502
|
}
|
|
216508
216503
|
// ../../node_modules/is-plain-obj/index.js
|
|
216509
216504
|
function isPlainObject(value) {
|
|
@@ -237007,6 +237002,10 @@ function formatUpgradeMessage(info, distribution) {
|
|
|
237007
237002
|
].join(`
|
|
237008
237003
|
`);
|
|
237009
237004
|
}
|
|
237005
|
+
function formatPlainUpgradeMessage(info, distribution) {
|
|
237006
|
+
const instruction = getUpgradeInstruction(detectInstallMethod(distribution));
|
|
237007
|
+
return `Update available: ${info.currentVersion} → ${info.latestVersion}. ${instruction}`;
|
|
237008
|
+
}
|
|
237010
237009
|
async function printUpgradeNotification(upgradeCheckPromise, distribution) {
|
|
237011
237010
|
try {
|
|
237012
237011
|
const upgradeInfo = await upgradeCheckPromise;
|
|
@@ -238132,31 +238131,22 @@ function isUserError(error48) {
|
|
|
238132
238131
|
}
|
|
238133
238132
|
|
|
238134
238133
|
// src/cli/utils/command/display.ts
|
|
238135
|
-
async function
|
|
238134
|
+
async function showCommandStart(fullBanner) {
|
|
238136
238135
|
if (fullBanner) {
|
|
238137
|
-
await printBanner(
|
|
238136
|
+
await printBanner();
|
|
238138
238137
|
We("");
|
|
238139
238138
|
} else {
|
|
238140
238139
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
238141
238140
|
}
|
|
238142
238141
|
}
|
|
238143
|
-
async function
|
|
238142
|
+
async function showCommandEnd(result, upgradeCheckPromise, distribution) {
|
|
238144
238143
|
await printUpgradeNotification(upgradeCheckPromise, distribution);
|
|
238145
238144
|
Le(result.outroMessage || "");
|
|
238146
238145
|
if (result.stdout) {
|
|
238147
238146
|
process.stdout.write(result.stdout);
|
|
238148
238147
|
}
|
|
238149
238148
|
}
|
|
238150
|
-
function
|
|
238151
|
-
if (quiet) {
|
|
238152
|
-
showPlainError(error48);
|
|
238153
|
-
} else {
|
|
238154
|
-
showThemedError(error48);
|
|
238155
|
-
const errorContext = context.errorReporter.getErrorContext();
|
|
238156
|
-
Le(theme.format.errorContext(errorContext));
|
|
238157
|
-
}
|
|
238158
|
-
}
|
|
238159
|
-
function showThemedError(error48) {
|
|
238149
|
+
function showThemedError(error48, context) {
|
|
238160
238150
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
238161
238151
|
R2.error(errorMessage);
|
|
238162
238152
|
if (isCLIError(error48)) {
|
|
@@ -238171,6 +238161,8 @@ function showThemedError(error48) {
|
|
|
238171
238161
|
if (process.env.DEBUG === "1" && error48 instanceof Error && error48.stack) {
|
|
238172
238162
|
R2.error(theme.styles.dim(error48.stack));
|
|
238173
238163
|
}
|
|
238164
|
+
const errorContext = context.errorReporter.getErrorContext();
|
|
238165
|
+
Le(theme.format.errorContext(errorContext));
|
|
238174
238166
|
}
|
|
238175
238167
|
function showPlainError(error48) {
|
|
238176
238168
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
@@ -246628,7 +246620,7 @@ class Base44Command extends Command {
|
|
|
246628
246620
|
return super.action(async (...args) => {
|
|
246629
246621
|
const quiet = this.context.isNonInteractive;
|
|
246630
246622
|
if (!quiet) {
|
|
246631
|
-
await
|
|
246623
|
+
await showCommandStart(this._commandOptions.fullBanner);
|
|
246632
246624
|
}
|
|
246633
246625
|
const upgradeCheckPromise = startUpgradeCheck();
|
|
246634
246626
|
try {
|
|
@@ -246640,12 +246632,27 @@ class Base44Command extends Command {
|
|
|
246640
246632
|
}
|
|
246641
246633
|
const result = await fn(...args) ?? {};
|
|
246642
246634
|
if (!quiet) {
|
|
246643
|
-
await
|
|
246644
|
-
} else
|
|
246645
|
-
|
|
246635
|
+
await showCommandEnd(result, upgradeCheckPromise, this.context.distribution);
|
|
246636
|
+
} else {
|
|
246637
|
+
if (result.outroMessage) {
|
|
246638
|
+
process.stdout.write(`${result.outroMessage}
|
|
246639
|
+
`);
|
|
246640
|
+
}
|
|
246641
|
+
if (result.stdout) {
|
|
246642
|
+
process.stdout.write(result.stdout);
|
|
246643
|
+
}
|
|
246644
|
+
const upgradeInfo = await upgradeCheckPromise;
|
|
246645
|
+
if (upgradeInfo) {
|
|
246646
|
+
process.stderr.write(`${formatPlainUpgradeMessage(upgradeInfo, this.context.distribution)}
|
|
246647
|
+
`);
|
|
246648
|
+
}
|
|
246646
246649
|
}
|
|
246647
246650
|
} catch (error48) {
|
|
246648
|
-
|
|
246651
|
+
if (quiet) {
|
|
246652
|
+
showPlainError(error48);
|
|
246653
|
+
} else {
|
|
246654
|
+
showThemedError(error48, this.context);
|
|
246655
|
+
}
|
|
246649
246656
|
throw error48;
|
|
246650
246657
|
}
|
|
246651
246658
|
});
|
|
@@ -246894,7 +246901,10 @@ async function logout() {
|
|
|
246894
246901
|
return { outroMessage: "Logged out successfully" };
|
|
246895
246902
|
}
|
|
246896
246903
|
function getLogoutCommand() {
|
|
246897
|
-
return new Base44Command("logout", {
|
|
246904
|
+
return new Base44Command("logout", {
|
|
246905
|
+
requireAuth: false,
|
|
246906
|
+
requireAppConfig: false
|
|
246907
|
+
}).description("Logout from current device").action(logout);
|
|
246898
246908
|
}
|
|
246899
246909
|
|
|
246900
246910
|
// src/cli/commands/auth/whoami.ts
|
|
@@ -248207,12 +248217,21 @@ function getCreateCommand() {
|
|
|
248207
248217
|
Examples:
|
|
248208
248218
|
$ base44 create my-app Creates a base44 project at ./my-app
|
|
248209
248219
|
$ base44 create my-todo-app --template backend-and-client Creates a base44 backend-and-client project at ./my-todo-app
|
|
248210
|
-
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options) => {
|
|
248220
|
+
$ base44 create my-app --path ./projects/my-app --deploy Creates a base44 project at ./project/my-app and deploys it`).hook("preAction", validateNonInteractiveFlags).action(async (name2, options, command2) => {
|
|
248211
248221
|
if (name2 && !options.path) {
|
|
248212
248222
|
options.path = `./${import_kebabCase.default(name2)}`;
|
|
248213
248223
|
}
|
|
248214
|
-
const
|
|
248215
|
-
if (isNonInteractive) {
|
|
248224
|
+
const skipPrompts = !!(options.name ?? name2) && !!options.path;
|
|
248225
|
+
if (!skipPrompts && command2.isNonInteractive) {
|
|
248226
|
+
throw new InvalidInputError("Project name and --path are required in non-interactive mode", {
|
|
248227
|
+
hints: [
|
|
248228
|
+
{
|
|
248229
|
+
message: "Usage: base44 create <name> --path <path>"
|
|
248230
|
+
}
|
|
248231
|
+
]
|
|
248232
|
+
});
|
|
248233
|
+
}
|
|
248234
|
+
if (skipPrompts) {
|
|
248216
248235
|
return await createNonInteractive({
|
|
248217
248236
|
name: options.name ?? name2,
|
|
248218
248237
|
...options
|
|
@@ -248288,6 +248307,9 @@ ${summaryLines.join(`
|
|
|
248288
248307
|
}
|
|
248289
248308
|
function getDeployCommand2() {
|
|
248290
248309
|
return new Base44Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
|
|
248310
|
+
if (command2.isNonInteractive && !options.yes) {
|
|
248311
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248312
|
+
}
|
|
248291
248313
|
return await deployAction({
|
|
248292
248314
|
...options,
|
|
248293
248315
|
isNonInteractive: command2.isNonInteractive
|
|
@@ -248455,7 +248477,11 @@ async function link(options) {
|
|
|
248455
248477
|
return { outroMessage: "Project linked" };
|
|
248456
248478
|
}
|
|
248457
248479
|
function getLinkCommand() {
|
|
248458
|
-
return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options) => {
|
|
248480
|
+
return new Base44Command("link", { requireAppConfig: false }).description("Link a local project to a Base44 project (create new or link existing)").option("-c, --create", "Create a new project (skip selection prompt)").option("-n, --name <name>", "Project name (required when --create is used)").option("-d, --description <description>", "Project description").option("-p, --projectId <id>", "Project ID to link to an existing project (skips selection prompt)").hook("preAction", validateNonInteractiveFlags2).action(async (options, command2) => {
|
|
248481
|
+
const skipPrompts = !!options.create || !!options.projectId;
|
|
248482
|
+
if (!skipPrompts && command2.isNonInteractive) {
|
|
248483
|
+
throw new InvalidInputError("Either --create --name <name> or --projectId <id> is required in non-interactive mode");
|
|
248484
|
+
}
|
|
248459
248485
|
return await link(options);
|
|
248460
248486
|
});
|
|
248461
248487
|
}
|
|
@@ -248717,6 +248743,9 @@ async function deployAction2(options) {
|
|
|
248717
248743
|
}
|
|
248718
248744
|
function getSiteDeployCommand() {
|
|
248719
248745
|
return new Base44Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options, command2) => {
|
|
248746
|
+
if (command2.isNonInteractive && !options.yes) {
|
|
248747
|
+
throw new InvalidInputError("--yes is required in non-interactive mode");
|
|
248748
|
+
}
|
|
248720
248749
|
return await deployAction2({
|
|
248721
248750
|
...options,
|
|
248722
248751
|
isNonInteractive: command2.isNonInteractive
|
|
@@ -251747,6 +251776,12 @@ async function eject(options8) {
|
|
|
251747
251776
|
}
|
|
251748
251777
|
function getEjectCommand() {
|
|
251749
251778
|
return new Base44Command("eject", { requireAppConfig: false }).description("Download the code for an existing Base44 project").option("-p, --path <path>", "Path where to write the project").option("--project-id <id>", "Project ID to eject (skips interactive selection)").option("-y, --yes", "Skip confirmation prompts").action(async (options8, command2) => {
|
|
251779
|
+
if (command2.isNonInteractive && !options8.projectId) {
|
|
251780
|
+
throw new InvalidInputError("--project-id is required in non-interactive mode");
|
|
251781
|
+
}
|
|
251782
|
+
if (command2.isNonInteractive && !options8.path) {
|
|
251783
|
+
throw new InvalidInputError("--path is required in non-interactive mode");
|
|
251784
|
+
}
|
|
251750
251785
|
return await eject({
|
|
251751
251786
|
...options8,
|
|
251752
251787
|
isNonInteractive: command2.isNonInteractive
|
|
@@ -256024,4 +256059,4 @@ export {
|
|
|
256024
256059
|
CLIExitError
|
|
256025
256060
|
};
|
|
256026
256061
|
|
|
256027
|
-
//# debugId=
|
|
256062
|
+
//# debugId=2D0E39CBC399CC0964756E2164756E21
|