@base44-preview/cli 0.0.15-pr.19.d9072f9 → 0.0.15-pr.87.c55c15e
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/{program.js → cli/index.js} +335 -208
- package/package.json +8 -14
- package/bin/dev.cmd +0 -2
- package/bin/dev.js +0 -20
- package/bin/run.cmd +0 -2
- package/bin/run.js +0 -20
- /package/dist/{templates → cli/templates}/backend-and-client/.nvmrc +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/README.md +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/base44/entities/task.jsonc +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/components.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/index.html +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/jsconfig.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/package.json +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/postcss.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/App.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/api/base44Client.js.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/Base44Logo.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/button.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/checkbox.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/components/ui/input.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/index.css +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/src/main.jsx +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/tailwind.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-and-client/vite.config.js +0 -0
- /package/dist/{templates → cli/templates}/backend-only/base44/app.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/backend-only/base44/config.jsonc.ejs +0 -0
- /package/dist/{templates → cli/templates}/templates.json +0 -0
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
1
2
|
import { createRequire } from "node:module";
|
|
2
3
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
3
4
|
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
4
5
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
5
6
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
6
|
-
import
|
|
7
|
+
import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
7
8
|
import { aborted, callbackify, debuglog, inspect, promisify, stripVTControlCharacters } from "node:util";
|
|
8
9
|
import * as g from "node:readline";
|
|
9
10
|
import O from "node:readline";
|
|
@@ -893,7 +894,7 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
893
894
|
const childProcess$1 = __require("node:child_process");
|
|
894
895
|
const path$15 = __require("node:path");
|
|
895
896
|
const fs$10 = __require("node:fs");
|
|
896
|
-
const process$
|
|
897
|
+
const process$3 = __require("node:process");
|
|
897
898
|
const { Argument, humanReadableArgName } = require_argument();
|
|
898
899
|
const { CommanderError } = require_error$1();
|
|
899
900
|
const { Help } = require_help();
|
|
@@ -944,10 +945,10 @@ var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
944
945
|
this._showHelpAfterError = false;
|
|
945
946
|
this._showSuggestionAfterError = true;
|
|
946
947
|
this._outputConfiguration = {
|
|
947
|
-
writeOut: (str) => process$
|
|
948
|
-
writeErr: (str) => process$
|
|
949
|
-
getOutHelpWidth: () => process$
|
|
950
|
-
getErrHelpWidth: () => process$
|
|
948
|
+
writeOut: (str) => process$3.stdout.write(str),
|
|
949
|
+
writeErr: (str) => process$3.stderr.write(str),
|
|
950
|
+
getOutHelpWidth: () => process$3.stdout.isTTY ? process$3.stdout.columns : void 0,
|
|
951
|
+
getErrHelpWidth: () => process$3.stderr.isTTY ? process$3.stderr.columns : void 0,
|
|
951
952
|
outputError: (str, write) => write(str)
|
|
952
953
|
};
|
|
953
954
|
this._hidden = false;
|
|
@@ -1301,7 +1302,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1301
1302
|
*/
|
|
1302
1303
|
_exit(exitCode, code$1, message) {
|
|
1303
1304
|
if (this._exitCallback) this._exitCallback(new CommanderError(exitCode, code$1, message));
|
|
1304
|
-
process$
|
|
1305
|
+
process$3.exit(exitCode);
|
|
1305
1306
|
}
|
|
1306
1307
|
/**
|
|
1307
1308
|
* Register callback `fn` for the command.
|
|
@@ -1640,11 +1641,11 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1640
1641
|
if (argv !== void 0 && !Array.isArray(argv)) throw new Error("first parameter to parse must be array or undefined");
|
|
1641
1642
|
parseOptions = parseOptions || {};
|
|
1642
1643
|
if (argv === void 0 && parseOptions.from === void 0) {
|
|
1643
|
-
if (process$
|
|
1644
|
-
const execArgv$1 = process$
|
|
1644
|
+
if (process$3.versions?.electron) parseOptions.from = "electron";
|
|
1645
|
+
const execArgv$1 = process$3.execArgv ?? [];
|
|
1645
1646
|
if (execArgv$1.includes("-e") || execArgv$1.includes("--eval") || execArgv$1.includes("-p") || execArgv$1.includes("--print")) parseOptions.from = "eval";
|
|
1646
1647
|
}
|
|
1647
|
-
if (argv === void 0) argv = process$
|
|
1648
|
+
if (argv === void 0) argv = process$3.argv;
|
|
1648
1649
|
this.rawArgs = argv.slice();
|
|
1649
1650
|
let userArgs;
|
|
1650
1651
|
switch (parseOptions.from) {
|
|
@@ -1654,7 +1655,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1654
1655
|
userArgs = argv.slice(2);
|
|
1655
1656
|
break;
|
|
1656
1657
|
case "electron":
|
|
1657
|
-
if (process$
|
|
1658
|
+
if (process$3.defaultApp) {
|
|
1658
1659
|
this._scriptPath = argv[1];
|
|
1659
1660
|
userArgs = argv.slice(2);
|
|
1660
1661
|
} else userArgs = argv.slice(1);
|
|
@@ -1768,15 +1769,15 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1768
1769
|
}
|
|
1769
1770
|
launchWithNode = sourceExt.includes(path$15.extname(executableFile));
|
|
1770
1771
|
let proc$1;
|
|
1771
|
-
if (process$
|
|
1772
|
+
if (process$3.platform !== "win32") if (launchWithNode) {
|
|
1772
1773
|
args.unshift(executableFile);
|
|
1773
|
-
args = incrementNodeInspectorPort(process$
|
|
1774
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1774
|
+
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1775
|
+
proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
|
|
1775
1776
|
} else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
|
|
1776
1777
|
else {
|
|
1777
1778
|
args.unshift(executableFile);
|
|
1778
|
-
args = incrementNodeInspectorPort(process$
|
|
1779
|
-
proc$1 = childProcess$1.spawn(process$
|
|
1779
|
+
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1780
|
+
proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
|
|
1780
1781
|
}
|
|
1781
1782
|
if (!proc$1.killed) [
|
|
1782
1783
|
"SIGUSR1",
|
|
@@ -1785,14 +1786,14 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1785
1786
|
"SIGINT",
|
|
1786
1787
|
"SIGHUP"
|
|
1787
1788
|
].forEach((signal) => {
|
|
1788
|
-
process$
|
|
1789
|
+
process$3.on(signal, () => {
|
|
1789
1790
|
if (proc$1.killed === false && proc$1.exitCode === null) proc$1.kill(signal);
|
|
1790
1791
|
});
|
|
1791
1792
|
});
|
|
1792
1793
|
const exitCallback = this._exitCallback;
|
|
1793
1794
|
proc$1.on("close", (code$1) => {
|
|
1794
1795
|
code$1 = code$1 ?? 1;
|
|
1795
|
-
if (!exitCallback) process$
|
|
1796
|
+
if (!exitCallback) process$3.exit(code$1);
|
|
1796
1797
|
else exitCallback(new CommanderError(code$1, "commander.executeSubCommandAsync", "(close)"));
|
|
1797
1798
|
});
|
|
1798
1799
|
proc$1.on("error", (err) => {
|
|
@@ -1804,7 +1805,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1804
1805
|
- ${executableDirMessage}`;
|
|
1805
1806
|
throw new Error(executableMissing);
|
|
1806
1807
|
} else if (err.code === "EACCES") throw new Error(`'${executableFile}' not executable`);
|
|
1807
|
-
if (!exitCallback) process$
|
|
1808
|
+
if (!exitCallback) process$3.exit(1);
|
|
1808
1809
|
else {
|
|
1809
1810
|
const wrappedError = new CommanderError(1, "commander.executeSubCommandAsync", "(error)");
|
|
1810
1811
|
wrappedError.nestedError = err;
|
|
@@ -2210,13 +2211,13 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2210
2211
|
*/
|
|
2211
2212
|
_parseOptionsEnv() {
|
|
2212
2213
|
this.options.forEach((option) => {
|
|
2213
|
-
if (option.envVar && option.envVar in process$
|
|
2214
|
+
if (option.envVar && option.envVar in process$3.env) {
|
|
2214
2215
|
const optionKey = option.attributeName();
|
|
2215
2216
|
if (this.getOptionValue(optionKey) === void 0 || [
|
|
2216
2217
|
"default",
|
|
2217
2218
|
"config",
|
|
2218
2219
|
"env"
|
|
2219
|
-
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$
|
|
2220
|
+
].includes(this.getOptionValueSource(optionKey))) if (option.required || option.optional) this.emit(`optionEnv:${option.name()}`, process$3.env[option.envVar]);
|
|
2220
2221
|
else this.emit(`optionEnv:${option.name()}`);
|
|
2221
2222
|
}
|
|
2222
2223
|
});
|
|
@@ -2595,7 +2596,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
2595
2596
|
*/
|
|
2596
2597
|
help(contextOptions) {
|
|
2597
2598
|
this.outputHelp(contextOptions);
|
|
2598
|
-
let exitCode = process$
|
|
2599
|
+
let exitCode = process$3.exitCode || 0;
|
|
2599
2600
|
if (exitCode === 0 && contextOptions && typeof contextOptions !== "function" && contextOptions.error) exitCode = 1;
|
|
2600
2601
|
this._exit(exitCode, "commander.help", "(outputHelp)");
|
|
2601
2602
|
}
|
|
@@ -2711,16 +2712,16 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2711
2712
|
const CSI = `${ESC}[`;
|
|
2712
2713
|
const beep = "\x07";
|
|
2713
2714
|
const cursor = {
|
|
2714
|
-
to(x$2, y$
|
|
2715
|
-
if (!y$
|
|
2716
|
-
return `${CSI}${y$
|
|
2715
|
+
to(x$2, y$2) {
|
|
2716
|
+
if (!y$2) return `${CSI}${x$2 + 1}G`;
|
|
2717
|
+
return `${CSI}${y$2 + 1};${x$2 + 1}H`;
|
|
2717
2718
|
},
|
|
2718
|
-
move(x$2, y$
|
|
2719
|
+
move(x$2, y$2) {
|
|
2719
2720
|
let ret = "";
|
|
2720
2721
|
if (x$2 < 0) ret += `${CSI}${-x$2}D`;
|
|
2721
2722
|
else if (x$2 > 0) ret += `${CSI}${x$2}C`;
|
|
2722
|
-
if (y$
|
|
2723
|
-
else if (y$
|
|
2723
|
+
if (y$2 < 0) ret += `${CSI}${-y$2}A`;
|
|
2724
|
+
else if (y$2 > 0) ret += `${CSI}${y$2}B`;
|
|
2724
2725
|
return ret;
|
|
2725
2726
|
},
|
|
2726
2727
|
up: (count$1 = 1) => `${CSI}${count$1}A`,
|
|
@@ -3030,13 +3031,13 @@ function rD() {
|
|
|
3030
3031
|
}
|
|
3031
3032
|
}), r;
|
|
3032
3033
|
}
|
|
3033
|
-
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
|
|
3034
|
+
const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y$1 = "\x07", V$1 = "[", nD = "]", G$1 = "m", _$1 = `${nD}8;;`, z = (e$1) => `${d$1.values().next().value}${V$1}${e$1}${G$1}`, K$1 = (e$1) => `${d$1.values().next().value}${_$1}${e$1}${y$1}`, aD = (e$1) => e$1.split(" ").map((u$2) => p(u$2)), k$1 = (e$1, u$2, t) => {
|
|
3034
3035
|
const F$1 = [...u$2];
|
|
3035
3036
|
let s = !1, i$1 = !1, D$1 = p(P$1(e$1[e$1.length - 1]));
|
|
3036
3037
|
for (const [C$1, n$1] of F$1.entries()) {
|
|
3037
3038
|
const E = p(n$1);
|
|
3038
3039
|
if (D$1 + E <= t ? e$1[e$1.length - 1] += n$1 : (e$1.push(n$1), D$1 = 0), d$1.has(n$1) && (s = !0, i$1 = F$1.slice(C$1 + 1).join("").startsWith(_$1)), s) {
|
|
3039
|
-
i$1 ? n$1 === y && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3040
|
+
i$1 ? n$1 === y$1 && (s = !1, i$1 = !1) : n$1 === G$1 && (s = !1);
|
|
3040
3041
|
continue;
|
|
3041
3042
|
}
|
|
3042
3043
|
D$1 += E, D$1 === t && C$1 < F$1.length - 1 && (e$1.push(""), D$1 = 0);
|
|
@@ -3078,7 +3079,7 @@ const ED = rD(), d$1 = new Set(["\x1B", ""]), oD = 39, y = "\x07", V$1 = "[",
|
|
|
3078
3079
|
`)];
|
|
3079
3080
|
for (const [E, a$1] of n$1.entries()) {
|
|
3080
3081
|
if (F$1 += a$1, d$1.has(a$1)) {
|
|
3081
|
-
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3082
|
+
const { groups: c$1 } = (/* @__PURE__ */ new RegExp(`(?:\\${V$1}(?<code>\\d+)m|\\${_$1}(?<uri>.*)${y$1})`)).exec(n$1.slice(E).join("")) || { groups: {} };
|
|
3082
3083
|
if (c$1.code !== void 0) {
|
|
3083
3084
|
const f = Number.parseFloat(c$1.code);
|
|
3084
3085
|
s = f === oD ? void 0 : f;
|
|
@@ -3479,7 +3480,7 @@ var RD = class extends x$1 {
|
|
|
3479
3480
|
//#endregion
|
|
3480
3481
|
//#region node_modules/@clack/prompts/dist/index.mjs
|
|
3481
3482
|
function ce() {
|
|
3482
|
-
return
|
|
3483
|
+
return y.platform !== "win32" ? y.env.TERM !== "linux" : !!y.env.CI || !!y.env.WT_SESSION || !!y.env.TERMINUS_SUBLIME || y.env.ConEmuTask === "{cmd::Cmder}" || y.env.TERM_PROGRAM === "Terminus-Sublime" || y.env.TERM_PROGRAM === "vscode" || y.env.TERM === "xterm-256color" || y.env.TERM === "alacritty" || y.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
3483
3484
|
}
|
|
3484
3485
|
const V = ce(), u$1 = (t, n$1) => V ? t : n$1, le = u$1("◆", "*"), L = u$1("■", "x"), W = u$1("▲", "x"), C = u$1("◇", "o"), ue = u$1("┌", "T"), o$1 = u$1("│", "|"), d = u$1("└", "—"), k = u$1("●", ">"), P = u$1("○", " "), A = u$1("◻", "[•]"), T = u$1("◼", "[+]"), F = u$1("◻", "[ ]"), $e = u$1("▪", "•"), _ = u$1("─", "-"), me = u$1("╮", "+"), de = u$1("├", "+"), pe = u$1("╯", "+"), q = u$1("●", "•"), D = u$1("◆", "*"), U = u$1("▲", "!"), K = u$1("■", "x"), b = (t) => {
|
|
3485
3486
|
switch (t) {
|
|
@@ -6627,7 +6628,7 @@ function initializeContext(params) {
|
|
|
6627
6628
|
external: params?.external ?? void 0
|
|
6628
6629
|
};
|
|
6629
6630
|
}
|
|
6630
|
-
function process$
|
|
6631
|
+
function process$2(schema, ctx, _params = {
|
|
6631
6632
|
path: [],
|
|
6632
6633
|
schemaPath: []
|
|
6633
6634
|
}) {
|
|
@@ -6664,7 +6665,7 @@ function process$3(schema, ctx, _params = {
|
|
|
6664
6665
|
const parent = schema._zod.parent;
|
|
6665
6666
|
if (parent) {
|
|
6666
6667
|
if (!result.ref) result.ref = parent;
|
|
6667
|
-
process$
|
|
6668
|
+
process$2(parent, ctx, params);
|
|
6668
6669
|
ctx.seen.get(parent).isParent = true;
|
|
6669
6670
|
}
|
|
6670
6671
|
}
|
|
@@ -6876,7 +6877,7 @@ const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {
|
|
|
6876
6877
|
...params,
|
|
6877
6878
|
processors
|
|
6878
6879
|
});
|
|
6879
|
-
process$
|
|
6880
|
+
process$2(schema, ctx);
|
|
6880
6881
|
extractDefs(ctx, schema);
|
|
6881
6882
|
return finalize(ctx, schema);
|
|
6882
6883
|
};
|
|
@@ -6888,7 +6889,7 @@ const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params)
|
|
|
6888
6889
|
io,
|
|
6889
6890
|
processors
|
|
6890
6891
|
});
|
|
6891
|
-
process$
|
|
6892
|
+
process$2(schema, ctx);
|
|
6892
6893
|
extractDefs(ctx, schema);
|
|
6893
6894
|
return finalize(ctx, schema);
|
|
6894
6895
|
};
|
|
@@ -6972,7 +6973,7 @@ const arrayProcessor = (schema, ctx, _json, params) => {
|
|
|
6972
6973
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
6973
6974
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
6974
6975
|
json.type = "array";
|
|
6975
|
-
json.items = process$
|
|
6976
|
+
json.items = process$2(def.element, ctx, {
|
|
6976
6977
|
...params,
|
|
6977
6978
|
path: [...params.path, "items"]
|
|
6978
6979
|
});
|
|
@@ -6983,7 +6984,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
6983
6984
|
json.type = "object";
|
|
6984
6985
|
json.properties = {};
|
|
6985
6986
|
const shape = def.shape;
|
|
6986
|
-
for (const key in shape) json.properties[key] = process$
|
|
6987
|
+
for (const key in shape) json.properties[key] = process$2(shape[key], ctx, {
|
|
6987
6988
|
...params,
|
|
6988
6989
|
path: [
|
|
6989
6990
|
...params.path,
|
|
@@ -7001,7 +7002,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7001
7002
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
7002
7003
|
else if (!def.catchall) {
|
|
7003
7004
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
7004
|
-
} else if (def.catchall) json.additionalProperties = process$
|
|
7005
|
+
} else if (def.catchall) json.additionalProperties = process$2(def.catchall, ctx, {
|
|
7005
7006
|
...params,
|
|
7006
7007
|
path: [...params.path, "additionalProperties"]
|
|
7007
7008
|
});
|
|
@@ -7009,7 +7010,7 @@ const objectProcessor = (schema, ctx, _json, params) => {
|
|
|
7009
7010
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
7010
7011
|
const def = schema._zod.def;
|
|
7011
7012
|
const isExclusive = def.inclusive === false;
|
|
7012
|
-
const options = def.options.map((x$2, i$1) => process$
|
|
7013
|
+
const options = def.options.map((x$2, i$1) => process$2(x$2, ctx, {
|
|
7013
7014
|
...params,
|
|
7014
7015
|
path: [
|
|
7015
7016
|
...params.path,
|
|
@@ -7022,7 +7023,7 @@ const unionProcessor = (schema, ctx, json, params) => {
|
|
|
7022
7023
|
};
|
|
7023
7024
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
7024
7025
|
const def = schema._zod.def;
|
|
7025
|
-
const a$1 = process$
|
|
7026
|
+
const a$1 = process$2(def.left, ctx, {
|
|
7026
7027
|
...params,
|
|
7027
7028
|
path: [
|
|
7028
7029
|
...params.path,
|
|
@@ -7030,7 +7031,7 @@ const intersectionProcessor = (schema, ctx, json, params) => {
|
|
|
7030
7031
|
0
|
|
7031
7032
|
]
|
|
7032
7033
|
});
|
|
7033
|
-
const b$2 = process$
|
|
7034
|
+
const b$2 = process$2(def.right, ctx, {
|
|
7034
7035
|
...params,
|
|
7035
7036
|
path: [
|
|
7036
7037
|
...params.path,
|
|
@@ -7047,7 +7048,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7047
7048
|
json.type = "array";
|
|
7048
7049
|
const prefixPath$1 = ctx.target === "draft-2020-12" ? "prefixItems" : "items";
|
|
7049
7050
|
const restPath = ctx.target === "draft-2020-12" ? "items" : ctx.target === "openapi-3.0" ? "items" : "additionalItems";
|
|
7050
|
-
const prefixItems = def.items.map((x$2, i$1) => process$
|
|
7051
|
+
const prefixItems = def.items.map((x$2, i$1) => process$2(x$2, ctx, {
|
|
7051
7052
|
...params,
|
|
7052
7053
|
path: [
|
|
7053
7054
|
...params.path,
|
|
@@ -7055,7 +7056,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7055
7056
|
i$1
|
|
7056
7057
|
]
|
|
7057
7058
|
}));
|
|
7058
|
-
const rest = def.rest ? process$
|
|
7059
|
+
const rest = def.rest ? process$2(def.rest, ctx, {
|
|
7059
7060
|
...params,
|
|
7060
7061
|
path: [
|
|
7061
7062
|
...params.path,
|
|
@@ -7081,7 +7082,7 @@ const tupleProcessor = (schema, ctx, _json, params) => {
|
|
|
7081
7082
|
};
|
|
7082
7083
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
7083
7084
|
const def = schema._zod.def;
|
|
7084
|
-
const inner = process$
|
|
7085
|
+
const inner = process$2(def.innerType, ctx, params);
|
|
7085
7086
|
const seen = ctx.seen.get(schema);
|
|
7086
7087
|
if (ctx.target === "openapi-3.0") {
|
|
7087
7088
|
seen.ref = def.innerType;
|
|
@@ -7090,27 +7091,27 @@ const nullableProcessor = (schema, ctx, json, params) => {
|
|
|
7090
7091
|
};
|
|
7091
7092
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
7092
7093
|
const def = schema._zod.def;
|
|
7093
|
-
process$
|
|
7094
|
+
process$2(def.innerType, ctx, params);
|
|
7094
7095
|
const seen = ctx.seen.get(schema);
|
|
7095
7096
|
seen.ref = def.innerType;
|
|
7096
7097
|
};
|
|
7097
7098
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
7098
7099
|
const def = schema._zod.def;
|
|
7099
|
-
process$
|
|
7100
|
+
process$2(def.innerType, ctx, params);
|
|
7100
7101
|
const seen = ctx.seen.get(schema);
|
|
7101
7102
|
seen.ref = def.innerType;
|
|
7102
7103
|
json.default = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7103
7104
|
};
|
|
7104
7105
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
7105
7106
|
const def = schema._zod.def;
|
|
7106
|
-
process$
|
|
7107
|
+
process$2(def.innerType, ctx, params);
|
|
7107
7108
|
const seen = ctx.seen.get(schema);
|
|
7108
7109
|
seen.ref = def.innerType;
|
|
7109
7110
|
if (ctx.io === "input") json._prefault = JSON.parse(JSON.stringify(def.defaultValue));
|
|
7110
7111
|
};
|
|
7111
7112
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
7112
7113
|
const def = schema._zod.def;
|
|
7113
|
-
process$
|
|
7114
|
+
process$2(def.innerType, ctx, params);
|
|
7114
7115
|
const seen = ctx.seen.get(schema);
|
|
7115
7116
|
seen.ref = def.innerType;
|
|
7116
7117
|
let catchValue;
|
|
@@ -7124,20 +7125,20 @@ const catchProcessor = (schema, ctx, json, params) => {
|
|
|
7124
7125
|
const pipeProcessor = (schema, ctx, _json, params) => {
|
|
7125
7126
|
const def = schema._zod.def;
|
|
7126
7127
|
const innerType = ctx.io === "input" ? def.in._zod.def.type === "transform" ? def.out : def.in : def.out;
|
|
7127
|
-
process$
|
|
7128
|
+
process$2(innerType, ctx, params);
|
|
7128
7129
|
const seen = ctx.seen.get(schema);
|
|
7129
7130
|
seen.ref = innerType;
|
|
7130
7131
|
};
|
|
7131
7132
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
7132
7133
|
const def = schema._zod.def;
|
|
7133
|
-
process$
|
|
7134
|
+
process$2(def.innerType, ctx, params);
|
|
7134
7135
|
const seen = ctx.seen.get(schema);
|
|
7135
7136
|
seen.ref = def.innerType;
|
|
7136
7137
|
json.readOnly = true;
|
|
7137
7138
|
};
|
|
7138
7139
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
7139
7140
|
const def = schema._zod.def;
|
|
7140
|
-
process$
|
|
7141
|
+
process$2(def.innerType, ctx, params);
|
|
7141
7142
|
const seen = ctx.seen.get(schema);
|
|
7142
7143
|
seen.ref = def.innerType;
|
|
7143
7144
|
};
|
|
@@ -16155,7 +16156,7 @@ const createIgnorePredicate = (patterns, cwd, baseDir) => {
|
|
|
16155
16156
|
};
|
|
16156
16157
|
const normalizeOptions$2 = (options = {}) => {
|
|
16157
16158
|
const ignoreOption = options.ignore ? Array.isArray(options.ignore) ? options.ignore : [options.ignore] : [];
|
|
16158
|
-
const cwd = toPath$1(options.cwd) ??
|
|
16159
|
+
const cwd = toPath$1(options.cwd) ?? y.cwd();
|
|
16159
16160
|
const deep = typeof options.deep === "number" ? Math.max(0, options.deep) + 1 : Number.POSITIVE_INFINITY;
|
|
16160
16161
|
return {
|
|
16161
16162
|
cwd,
|
|
@@ -16252,7 +16253,7 @@ const getDirectoryGlob = ({ directoryPath, files, extensions }) => {
|
|
|
16252
16253
|
const extensionGlob = extensions?.length > 0 ? `.${extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0]}` : "";
|
|
16253
16254
|
return files ? files.map((file) => path.posix.join(directoryPath, `**/${path.extname(file) ? file : `${file}${extensionGlob}`}`)) : [path.posix.join(directoryPath, `**${extensionGlob ? `/*${extensionGlob}` : ""}`)];
|
|
16254
16255
|
};
|
|
16255
|
-
const directoryToGlob = async (directoryPaths, { cwd =
|
|
16256
|
+
const directoryToGlob = async (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => {
|
|
16256
16257
|
return (await Promise.all(directoryPaths.map(async (directoryPath) => {
|
|
16257
16258
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16258
16259
|
directoryPath,
|
|
@@ -16266,7 +16267,7 @@ const directoryToGlob = async (directoryPaths, { cwd = process$1.cwd(), files, e
|
|
|
16266
16267
|
}) : directoryPath;
|
|
16267
16268
|
}))).flat();
|
|
16268
16269
|
};
|
|
16269
|
-
const directoryToGlobSync = (directoryPaths, { cwd =
|
|
16270
|
+
const directoryToGlobSync = (directoryPaths, { cwd = y.cwd(), files, extensions, fs: fsImplementation } = {}) => directoryPaths.flatMap((directoryPath) => {
|
|
16270
16271
|
if (shouldExpandGlobstarDirectory(isNegativePattern(directoryPath) ? directoryPath.slice(1) : directoryPath)) return getDirectoryGlob({
|
|
16271
16272
|
directoryPath,
|
|
16272
16273
|
files,
|
|
@@ -16362,7 +16363,7 @@ const applyIgnoreFilesAndGetFilterSync = (options) => {
|
|
|
16362
16363
|
};
|
|
16363
16364
|
const createFilterFunction = (isIgnored, cwd) => {
|
|
16364
16365
|
const seen = /* @__PURE__ */ new Set();
|
|
16365
|
-
const basePath = cwd ||
|
|
16366
|
+
const basePath = cwd || y.cwd();
|
|
16366
16367
|
const pathCache = /* @__PURE__ */ new Map();
|
|
16367
16368
|
return (fastGlobResult) => {
|
|
16368
16369
|
const pathKey$1 = path.normalize(fastGlobResult.path ?? fastGlobResult);
|
|
@@ -30351,31 +30352,11 @@ async function deployAll(projectData) {
|
|
|
30351
30352
|
//#region src/core/project/app-config.ts
|
|
30352
30353
|
let cache = null;
|
|
30353
30354
|
/**
|
|
30354
|
-
* Load app config from BASE44_CLI_TEST_OVERRIDES env var.
|
|
30355
|
-
* @returns true if override was applied, false otherwise
|
|
30356
|
-
*/
|
|
30357
|
-
function loadFromTestOverrides() {
|
|
30358
|
-
const overrides = process.env.BASE44_CLI_TEST_OVERRIDES;
|
|
30359
|
-
if (!overrides) return false;
|
|
30360
|
-
try {
|
|
30361
|
-
const data = JSON.parse(overrides);
|
|
30362
|
-
if (data.appConfig?.id && data.appConfig?.projectRoot) {
|
|
30363
|
-
cache = {
|
|
30364
|
-
id: data.appConfig.id,
|
|
30365
|
-
projectRoot: data.appConfig.projectRoot
|
|
30366
|
-
};
|
|
30367
|
-
return true;
|
|
30368
|
-
}
|
|
30369
|
-
} catch {}
|
|
30370
|
-
return false;
|
|
30371
|
-
}
|
|
30372
|
-
/**
|
|
30373
30355
|
* Initialize app config by reading from .app.jsonc.
|
|
30374
30356
|
* Must be called before using getAppConfig().
|
|
30375
30357
|
* @throws Error if no project found or .app.jsonc missing
|
|
30376
30358
|
*/
|
|
30377
30359
|
async function initAppConfig() {
|
|
30378
|
-
if (loadFromTestOverrides()) return;
|
|
30379
30360
|
if (cache) return;
|
|
30380
30361
|
const projectRoot = await findProjectRoot();
|
|
30381
30362
|
if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
|
|
@@ -30722,13 +30703,13 @@ var ansi_styles_default = ansiStyles;
|
|
|
30722
30703
|
|
|
30723
30704
|
//#endregion
|
|
30724
30705
|
//#region node_modules/chalk/source/vendor/supports-color/index.js
|
|
30725
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
30706
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : y.argv) {
|
|
30726
30707
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
30727
30708
|
const position = argv.indexOf(prefix + flag);
|
|
30728
30709
|
const terminatorPosition = argv.indexOf("--");
|
|
30729
30710
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
30730
30711
|
}
|
|
30731
|
-
const { env } =
|
|
30712
|
+
const { env } = y;
|
|
30732
30713
|
let flagForceColor;
|
|
30733
30714
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) flagForceColor = 0;
|
|
30734
30715
|
else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) flagForceColor = 1;
|
|
@@ -30761,7 +30742,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
30761
30742
|
if (haveStream && !streamIsTTY && forceColor === void 0) return 0;
|
|
30762
30743
|
const min = forceColor || 0;
|
|
30763
30744
|
if (env.TERM === "dumb") return min;
|
|
30764
|
-
if (
|
|
30745
|
+
if (y.platform === "win32") {
|
|
30765
30746
|
const osRelease = os.release().split(".");
|
|
30766
30747
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
30767
30748
|
return 1;
|
|
@@ -31069,6 +31050,58 @@ async function printBanner() {
|
|
|
31069
31050
|
else console.log(theme.colors.base44Orange(BANNER_LINES.join("\n")));
|
|
31070
31051
|
}
|
|
31071
31052
|
|
|
31053
|
+
//#endregion
|
|
31054
|
+
//#region src/cli/utils/json.ts
|
|
31055
|
+
/**
|
|
31056
|
+
* JSON output utilities for CLI commands.
|
|
31057
|
+
*
|
|
31058
|
+
* These utilities support the `--json` flag which outputs machine-readable JSON
|
|
31059
|
+
* instead of human-friendly formatted output.
|
|
31060
|
+
*/
|
|
31061
|
+
let jsonModeEnabled = false;
|
|
31062
|
+
/**
|
|
31063
|
+
* Enable JSON output mode. Called by runCommand when --json flag is detected.
|
|
31064
|
+
*/
|
|
31065
|
+
function setJsonMode(enabled) {
|
|
31066
|
+
jsonModeEnabled = enabled;
|
|
31067
|
+
}
|
|
31068
|
+
/**
|
|
31069
|
+
* Check if JSON output mode is currently active.
|
|
31070
|
+
*/
|
|
31071
|
+
function isJsonMode() {
|
|
31072
|
+
return jsonModeEnabled;
|
|
31073
|
+
}
|
|
31074
|
+
/**
|
|
31075
|
+
* Output a success JSON response to stdout.
|
|
31076
|
+
* Only outputs if JSON mode is enabled.
|
|
31077
|
+
*/
|
|
31078
|
+
function outputJson(data) {
|
|
31079
|
+
if (!jsonModeEnabled) return;
|
|
31080
|
+
const response = {
|
|
31081
|
+
success: true,
|
|
31082
|
+
data
|
|
31083
|
+
};
|
|
31084
|
+
console.log(JSON.stringify(response, null, 2));
|
|
31085
|
+
}
|
|
31086
|
+
/**
|
|
31087
|
+
* Output an error JSON response to stderr.
|
|
31088
|
+
* Only outputs if JSON mode is enabled.
|
|
31089
|
+
*
|
|
31090
|
+
* @param error - The error to output
|
|
31091
|
+
* @param code - Optional error code
|
|
31092
|
+
*/
|
|
31093
|
+
function outputJsonError(error, code$1) {
|
|
31094
|
+
if (!jsonModeEnabled) return;
|
|
31095
|
+
const response = {
|
|
31096
|
+
success: false,
|
|
31097
|
+
error: {
|
|
31098
|
+
message: error instanceof Error ? error.message : error,
|
|
31099
|
+
...code$1 && { code: code$1 }
|
|
31100
|
+
}
|
|
31101
|
+
};
|
|
31102
|
+
console.error(JSON.stringify(response, null, 2));
|
|
31103
|
+
}
|
|
31104
|
+
|
|
31072
31105
|
//#endregion
|
|
31073
31106
|
//#region src/cli/utils/runCommand.ts
|
|
31074
31107
|
/**
|
|
@@ -31102,25 +31135,35 @@ async function printBanner() {
|
|
|
31102
31135
|
* });
|
|
31103
31136
|
*/
|
|
31104
31137
|
async function runCommand(commandFn, options) {
|
|
31105
|
-
|
|
31106
|
-
if (
|
|
31107
|
-
|
|
31108
|
-
|
|
31109
|
-
|
|
31138
|
+
const jsonMode = isJsonMode();
|
|
31139
|
+
if (!jsonMode) {
|
|
31140
|
+
console.log();
|
|
31141
|
+
if (options?.fullBanner) {
|
|
31142
|
+
await printBanner();
|
|
31143
|
+
Ie("");
|
|
31144
|
+
} else Ie(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
31145
|
+
}
|
|
31110
31146
|
try {
|
|
31111
31147
|
if (options?.requireAuth) {
|
|
31112
31148
|
if (!await isLoggedIn()) {
|
|
31149
|
+
if (jsonMode) throw new Error("Authentication required. Please run 'base44 login' first.");
|
|
31113
31150
|
M.info("You need to login first to continue.");
|
|
31114
31151
|
await login();
|
|
31115
31152
|
}
|
|
31116
31153
|
}
|
|
31117
31154
|
if (options?.requireAppConfig !== false) await initAppConfig();
|
|
31118
|
-
const { outroMessage } = await commandFn();
|
|
31119
|
-
|
|
31155
|
+
const { outroMessage, data } = await commandFn();
|
|
31156
|
+
if (jsonMode) outputJson(data ?? {});
|
|
31157
|
+
else Se(outroMessage || "");
|
|
31120
31158
|
} catch (e$1) {
|
|
31121
|
-
if (
|
|
31122
|
-
|
|
31123
|
-
|
|
31159
|
+
if (jsonMode) {
|
|
31160
|
+
outputJsonError(e$1 instanceof Error ? e$1 : String(e$1));
|
|
31161
|
+
process.exit(1);
|
|
31162
|
+
} else {
|
|
31163
|
+
if (e$1 instanceof Error) M.error(e$1.stack ?? e$1.message);
|
|
31164
|
+
else M.error(String(e$1));
|
|
31165
|
+
process.exit(1);
|
|
31166
|
+
}
|
|
31124
31167
|
}
|
|
31125
31168
|
}
|
|
31126
31169
|
|
|
@@ -31130,6 +31173,8 @@ async function runCommand(commandFn, options) {
|
|
|
31130
31173
|
* Wraps an async operation with automatic spinner management.
|
|
31131
31174
|
* The spinner is automatically started, and stopped on both success and error.
|
|
31132
31175
|
*
|
|
31176
|
+
* In JSON mode, the spinner is suppressed and the operation runs silently.
|
|
31177
|
+
*
|
|
31133
31178
|
* @param startMessage - Message to show when spinner starts
|
|
31134
31179
|
* @param operation - The async operation to execute. Receives an updateMessage function
|
|
31135
31180
|
* to update the spinner text during long-running operations.
|
|
@@ -31165,6 +31210,10 @@ async function runCommand(commandFn, options) {
|
|
|
31165
31210
|
* );
|
|
31166
31211
|
*/
|
|
31167
31212
|
async function runTask(startMessage, operation, options) {
|
|
31213
|
+
if (isJsonMode()) {
|
|
31214
|
+
const noopUpdateMessage = () => {};
|
|
31215
|
+
return await operation(noopUpdateMessage);
|
|
31216
|
+
}
|
|
31168
31217
|
const s = Y();
|
|
31169
31218
|
s.start(startMessage);
|
|
31170
31219
|
const updateMessage = (message) => s.message(message);
|
|
@@ -31205,6 +31254,10 @@ function getDashboardUrl(projectId) {
|
|
|
31205
31254
|
|
|
31206
31255
|
//#endregion
|
|
31207
31256
|
//#region src/cli/commands/auth/login.ts
|
|
31257
|
+
/**
|
|
31258
|
+
* Login command does not support --json output.
|
|
31259
|
+
* It requires interactive browser authentication via device code flow.
|
|
31260
|
+
*/
|
|
31208
31261
|
async function generateAndDisplayDeviceCode() {
|
|
31209
31262
|
const deviceCodeResponse = await runTask("Generating device code...", async () => {
|
|
31210
31263
|
return await generateDeviceCode();
|
|
@@ -31266,7 +31319,13 @@ const loginCommand = new Command("login").description("Authenticate with Base44"
|
|
|
31266
31319
|
//#region src/cli/commands/auth/whoami.ts
|
|
31267
31320
|
async function whoami() {
|
|
31268
31321
|
const auth = await readAuth();
|
|
31269
|
-
return {
|
|
31322
|
+
return {
|
|
31323
|
+
outroMessage: `Logged in as: ${theme.styles.bold(auth.email)}`,
|
|
31324
|
+
data: {
|
|
31325
|
+
email: auth.email,
|
|
31326
|
+
name: auth.name
|
|
31327
|
+
}
|
|
31328
|
+
};
|
|
31270
31329
|
}
|
|
31271
31330
|
const whoamiCommand = new Command("whoami").description("Display current authenticated user").action(async () => {
|
|
31272
31331
|
await runCommand(whoami, {
|
|
@@ -31277,6 +31336,10 @@ const whoamiCommand = new Command("whoami").description("Display current authent
|
|
|
31277
31336
|
|
|
31278
31337
|
//#endregion
|
|
31279
31338
|
//#region src/cli/commands/auth/logout.ts
|
|
31339
|
+
/**
|
|
31340
|
+
* Logout command does not support --json output.
|
|
31341
|
+
* It is a user-facing auth command that is rarely scripted.
|
|
31342
|
+
*/
|
|
31280
31343
|
async function logout() {
|
|
31281
31344
|
await deleteAuth();
|
|
31282
31345
|
return { outroMessage: "Logged out successfully" };
|
|
@@ -31289,19 +31352,31 @@ const logoutCommand = new Command("logout").description("Logout from current dev
|
|
|
31289
31352
|
//#region src/cli/commands/entities/push.ts
|
|
31290
31353
|
async function pushEntitiesAction() {
|
|
31291
31354
|
const { entities } = await readProjectConfig();
|
|
31292
|
-
if (entities.length === 0) return {
|
|
31293
|
-
|
|
31294
|
-
|
|
31355
|
+
if (entities.length === 0) return {
|
|
31356
|
+
outroMessage: "No entities found in project",
|
|
31357
|
+
data: {
|
|
31358
|
+
created: [],
|
|
31359
|
+
updated: [],
|
|
31360
|
+
deleted: []
|
|
31361
|
+
}
|
|
31362
|
+
};
|
|
31363
|
+
if (!isJsonMode()) M.info(`Found ${entities.length} entities to push`);
|
|
31295
31364
|
const result = await runTask("Pushing entities to Base44", async () => {
|
|
31296
31365
|
return await pushEntities(entities);
|
|
31297
31366
|
}, {
|
|
31298
31367
|
successMessage: "Entities pushed successfully",
|
|
31299
31368
|
errorMessage: "Failed to push entities"
|
|
31300
31369
|
});
|
|
31301
|
-
if (
|
|
31302
|
-
|
|
31303
|
-
|
|
31304
|
-
|
|
31370
|
+
if (!isJsonMode()) {
|
|
31371
|
+
if (result.created.length > 0) M.success(`Created: ${result.created.join(", ")}`);
|
|
31372
|
+
if (result.updated.length > 0) M.success(`Updated: ${result.updated.join(", ")}`);
|
|
31373
|
+
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31374
|
+
}
|
|
31375
|
+
return { data: {
|
|
31376
|
+
created: result.created,
|
|
31377
|
+
updated: result.updated,
|
|
31378
|
+
deleted: result.deleted
|
|
31379
|
+
} };
|
|
31305
31380
|
}
|
|
31306
31381
|
const entitiesPushCommand = new Command("entities").description("Manage project entities").addCommand(new Command("push").description("Push local entities to Base44").action(async () => {
|
|
31307
31382
|
await runCommand(pushEntitiesAction, { requireAuth: true });
|
|
@@ -31311,21 +31386,32 @@ const entitiesPushCommand = new Command("entities").description("Manage project
|
|
|
31311
31386
|
//#region src/cli/commands/functions/deploy.ts
|
|
31312
31387
|
async function deployFunctionsAction() {
|
|
31313
31388
|
const { functions } = await readProjectConfig();
|
|
31314
|
-
if (functions.length === 0) return {
|
|
31315
|
-
|
|
31389
|
+
if (functions.length === 0) return {
|
|
31390
|
+
outroMessage: "No functions found. Create functions in the 'functions' directory.",
|
|
31391
|
+
data: {
|
|
31392
|
+
deployed: [],
|
|
31393
|
+
deleted: []
|
|
31394
|
+
}
|
|
31395
|
+
};
|
|
31396
|
+
if (!isJsonMode()) M.info(`Found ${functions.length} ${functions.length === 1 ? "function" : "functions"} to deploy`);
|
|
31316
31397
|
const result = await runTask("Deploying functions to Base44", async () => {
|
|
31317
31398
|
return await pushFunctions(functions);
|
|
31318
31399
|
}, {
|
|
31319
31400
|
successMessage: "Functions deployed successfully",
|
|
31320
31401
|
errorMessage: "Failed to deploy functions"
|
|
31321
31402
|
});
|
|
31322
|
-
if (
|
|
31323
|
-
|
|
31403
|
+
if (!isJsonMode()) {
|
|
31404
|
+
if (result.deployed.length > 0) M.success(`Deployed: ${result.deployed.join(", ")}`);
|
|
31405
|
+
if (result.deleted.length > 0) M.warn(`Deleted: ${result.deleted.join(", ")}`);
|
|
31406
|
+
}
|
|
31324
31407
|
if (result.errors && result.errors.length > 0) {
|
|
31325
31408
|
const errorMessages = result.errors.map((e$1) => `'${e$1.name}' function: ${e$1.message}`).join("\n");
|
|
31326
31409
|
throw new Error(`Function deployment errors:\n${errorMessages}`);
|
|
31327
31410
|
}
|
|
31328
|
-
return {
|
|
31411
|
+
return { data: {
|
|
31412
|
+
deployed: result.deployed,
|
|
31413
|
+
deleted: result.deleted
|
|
31414
|
+
} };
|
|
31329
31415
|
}
|
|
31330
31416
|
const functionsDeployCommand = new Command("functions").description("Manage project functions").addCommand(new Command("deploy").description("Deploy local functions to Base44").action(async () => {
|
|
31331
31417
|
await runCommand(deployFunctionsAction, { requireAuth: true });
|
|
@@ -31501,9 +31587,9 @@ const getSubprocessResult = ({ stdout: stdout$1 }) => {
|
|
|
31501
31587
|
//#region node_modules/execa/lib/utils/standard-stream.js
|
|
31502
31588
|
const isStandardStream = (stream) => STANDARD_STREAMS.includes(stream);
|
|
31503
31589
|
const STANDARD_STREAMS = [
|
|
31504
|
-
|
|
31505
|
-
|
|
31506
|
-
|
|
31590
|
+
y.stdin,
|
|
31591
|
+
y.stdout,
|
|
31592
|
+
y.stderr
|
|
31507
31593
|
];
|
|
31508
31594
|
const STANDARD_STREAMS_ALIASES = [
|
|
31509
31595
|
"stdin",
|
|
@@ -31628,9 +31714,9 @@ const NO_ESCAPE_REGEXP = /^[\w./-]+$/;
|
|
|
31628
31714
|
//#endregion
|
|
31629
31715
|
//#region node_modules/is-unicode-supported/index.js
|
|
31630
31716
|
function isUnicodeSupported() {
|
|
31631
|
-
const { env: env$1 } =
|
|
31717
|
+
const { env: env$1 } = y;
|
|
31632
31718
|
const { TERM, TERM_PROGRAM } = env$1;
|
|
31633
|
-
if (
|
|
31719
|
+
if (y.platform !== "win32") return TERM !== "linux";
|
|
31634
31720
|
return Boolean(env$1.WT_SESSION) || Boolean(env$1.TERMINUS_SUBLIME) || env$1.ConEmuTask === "{cmd::Cmder}" || TERM_PROGRAM === "Terminus-Sublime" || TERM_PROGRAM === "vscode" || TERM === "xterm-256color" || TERM === "alacritty" || TERM === "rxvt-unicode" || TERM === "rxvt-unicode-256color" || env$1.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
31635
31721
|
}
|
|
31636
31722
|
|
|
@@ -32557,7 +32643,7 @@ const TEN_MEGABYTES_IN_BYTES = 10 * 1024 * 1024;
|
|
|
32557
32643
|
|
|
32558
32644
|
//#endregion
|
|
32559
32645
|
//#region node_modules/npm-run-path/index.js
|
|
32560
|
-
const npmRunPath = ({ cwd =
|
|
32646
|
+
const npmRunPath = ({ cwd = y.cwd(), path: pathOption = y.env[pathKey()], preferLocal = true, execPath: execPath$1 = y.execPath, addExecPath = true } = {}) => {
|
|
32561
32647
|
const cwdPath = path.resolve(toPath(cwd));
|
|
32562
32648
|
const result = [];
|
|
32563
32649
|
const pathParts = pathOption.split(path.delimiter);
|
|
@@ -32575,7 +32661,7 @@ const applyExecPath = (result, pathParts, execPath$1, cwdPath) => {
|
|
|
32575
32661
|
const pathPart = path.resolve(cwdPath, toPath(execPath$1), "..");
|
|
32576
32662
|
if (!pathParts.includes(pathPart)) result.push(pathPart);
|
|
32577
32663
|
};
|
|
32578
|
-
const npmRunPathEnv = ({ env: env$1 =
|
|
32664
|
+
const npmRunPathEnv = ({ env: env$1 = y.env, ...options } = {}) => {
|
|
32579
32665
|
env$1 = { ...env$1 };
|
|
32580
32666
|
const pathName = pathKey({ env: env$1 });
|
|
32581
32667
|
options.path = env$1[pathName];
|
|
@@ -33710,7 +33796,7 @@ const normalizeCwd = (cwd = getDefaultCwd()) => {
|
|
|
33710
33796
|
};
|
|
33711
33797
|
const getDefaultCwd = () => {
|
|
33712
33798
|
try {
|
|
33713
|
-
return
|
|
33799
|
+
return y.cwd();
|
|
33714
33800
|
} catch (error) {
|
|
33715
33801
|
error.message = `The current directory does not exist.\n${error.message}`;
|
|
33716
33802
|
throw error;
|
|
@@ -33745,7 +33831,7 @@ const normalizeOptions = (filePath, rawArguments, rawOptions) => {
|
|
|
33745
33831
|
options.killSignal = normalizeKillSignal(options.killSignal);
|
|
33746
33832
|
options.forceKillAfterDelay = normalizeForceKillAfterDelay(options.forceKillAfterDelay);
|
|
33747
33833
|
options.lines = options.lines.map((lines, fdNumber) => lines && !BINARY_ENCODINGS.has(options.encoding) && options.buffer[fdNumber]);
|
|
33748
|
-
if (
|
|
33834
|
+
if (y.platform === "win32" && path.basename(file, ".exe") === "cmd") commandArguments.unshift("/q");
|
|
33749
33835
|
return {
|
|
33750
33836
|
file,
|
|
33751
33837
|
commandArguments,
|
|
@@ -33772,7 +33858,7 @@ const addDefaultOptions = ({ extendEnv = true, preferLocal = false, cwd, localDi
|
|
|
33772
33858
|
});
|
|
33773
33859
|
const getEnv = ({ env: envOption, extendEnv, preferLocal, node, localDirectory, nodePath }) => {
|
|
33774
33860
|
const env$1 = extendEnv ? {
|
|
33775
|
-
...
|
|
33861
|
+
...y.env,
|
|
33776
33862
|
...envOption
|
|
33777
33863
|
} : envOption;
|
|
33778
33864
|
if (preferLocal || node) return npmRunPathEnv({
|
|
@@ -34772,12 +34858,12 @@ const guessStreamDirection = {
|
|
|
34772
34858
|
}
|
|
34773
34859
|
};
|
|
34774
34860
|
const getStandardStreamDirection = (value) => {
|
|
34775
|
-
if ([0,
|
|
34861
|
+
if ([0, y.stdin].includes(value)) return "input";
|
|
34776
34862
|
if ([
|
|
34777
34863
|
1,
|
|
34778
34864
|
2,
|
|
34779
|
-
|
|
34780
|
-
|
|
34865
|
+
y.stdout,
|
|
34866
|
+
y.stderr
|
|
34781
34867
|
].includes(value)) return "output";
|
|
34782
34868
|
};
|
|
34783
34869
|
const DEFAULT_DIRECTION = "output";
|
|
@@ -35841,9 +35927,9 @@ const addIpcMethods = (subprocess, { ipc }) => {
|
|
|
35841
35927
|
Object.assign(subprocess, getIpcMethods(subprocess, false, ipc));
|
|
35842
35928
|
};
|
|
35843
35929
|
const getIpcExport = () => {
|
|
35844
|
-
const anyProcess =
|
|
35930
|
+
const anyProcess = y;
|
|
35845
35931
|
const isSubprocess = true;
|
|
35846
|
-
const ipc =
|
|
35932
|
+
const ipc = y.channel !== void 0;
|
|
35847
35933
|
return {
|
|
35848
35934
|
...getIpcMethods(anyProcess, isSubprocess, ipc),
|
|
35849
35935
|
getCancelSignal: getCancelSignal$1.bind(void 0, {
|
|
@@ -36085,7 +36171,7 @@ if (process.platform === "linux") signals.push("SIGIO", "SIGPOLL", "SIGPWR", "SI
|
|
|
36085
36171
|
|
|
36086
36172
|
//#endregion
|
|
36087
36173
|
//#region node_modules/signal-exit/dist/mjs/index.js
|
|
36088
|
-
const processOk = (process$
|
|
36174
|
+
const processOk = (process$4) => !!process$4 && typeof process$4 === "object" && typeof process$4.removeListener === "function" && typeof process$4.emit === "function" && typeof process$4.reallyExit === "function" && typeof process$4.listeners === "function" && typeof process$4.kill === "function" && typeof process$4.pid === "number" && typeof process$4.on === "function";
|
|
36089
36175
|
const kExitEmitter = Symbol.for("signal-exit emitter");
|
|
36090
36176
|
const global$1 = globalThis;
|
|
36091
36177
|
const ObjectDefineProperty = Object.defineProperty.bind(Object);
|
|
@@ -36153,7 +36239,7 @@ var SignalExitFallback = class extends SignalExitBase {
|
|
|
36153
36239
|
};
|
|
36154
36240
|
var SignalExit = class extends SignalExitBase {
|
|
36155
36241
|
/* c8 ignore start */
|
|
36156
|
-
#hupSig = process$
|
|
36242
|
+
#hupSig = process$1.platform === "win32" ? "SIGINT" : "SIGHUP";
|
|
36157
36243
|
/* c8 ignore stop */
|
|
36158
36244
|
#emitter = new Emitter();
|
|
36159
36245
|
#process;
|
|
@@ -36161,15 +36247,15 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36161
36247
|
#originalProcessReallyExit;
|
|
36162
36248
|
#sigListeners = {};
|
|
36163
36249
|
#loaded = false;
|
|
36164
|
-
constructor(process$
|
|
36250
|
+
constructor(process$4) {
|
|
36165
36251
|
super();
|
|
36166
|
-
this.#process = process$
|
|
36252
|
+
this.#process = process$4;
|
|
36167
36253
|
this.#sigListeners = {};
|
|
36168
36254
|
for (const sig of signals) this.#sigListeners[sig] = () => {
|
|
36169
36255
|
const listeners = this.#process.listeners(sig);
|
|
36170
36256
|
let { count: count$1 } = this.#emitter;
|
|
36171
36257
|
/* c8 ignore start */
|
|
36172
|
-
const p$1 = process$
|
|
36258
|
+
const p$1 = process$4;
|
|
36173
36259
|
if (typeof p$1.__signal_exit_emitter__ === "object" && typeof p$1.__signal_exit_emitter__.count === "number") count$1 += p$1.__signal_exit_emitter__.count;
|
|
36174
36260
|
/* c8 ignore stop */
|
|
36175
36261
|
if (listeners.length === count$1) {
|
|
@@ -36177,11 +36263,11 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36177
36263
|
const ret = this.#emitter.emit("exit", null, sig);
|
|
36178
36264
|
/* c8 ignore start */
|
|
36179
36265
|
const s = sig === "SIGHUP" ? this.#hupSig : sig;
|
|
36180
|
-
if (!ret) process$
|
|
36266
|
+
if (!ret) process$4.kill(process$4.pid, s);
|
|
36181
36267
|
}
|
|
36182
36268
|
};
|
|
36183
|
-
this.#originalProcessReallyExit = process$
|
|
36184
|
-
this.#originalProcessEmit = process$
|
|
36269
|
+
this.#originalProcessReallyExit = process$4.reallyExit;
|
|
36270
|
+
this.#originalProcessEmit = process$4.emit;
|
|
36185
36271
|
}
|
|
36186
36272
|
onExit(cb, opts) {
|
|
36187
36273
|
/* c8 ignore start */
|
|
@@ -36248,8 +36334,8 @@ var SignalExit = class extends SignalExitBase {
|
|
|
36248
36334
|
} else return og.call(this.#process, ev, ...args);
|
|
36249
36335
|
}
|
|
36250
36336
|
};
|
|
36251
|
-
const process$
|
|
36252
|
-
const { onExit, load, unload } = signalExitWrap(processOk(process$
|
|
36337
|
+
const process$1 = globalThis.process;
|
|
36338
|
+
const { onExit, load, unload } = signalExitWrap(processOk(process$1) ? new SignalExit(process$1) : new SignalExitFallback());
|
|
36253
36339
|
|
|
36254
36340
|
//#endregion
|
|
36255
36341
|
//#region node_modules/execa/lib/terminate/cleanup.js
|
|
@@ -38009,9 +38095,10 @@ async function getTemplateById(templateId) {
|
|
|
38009
38095
|
}
|
|
38010
38096
|
return template;
|
|
38011
38097
|
}
|
|
38012
|
-
function validateNonInteractiveFlags$
|
|
38013
|
-
const { name: name$1, path: path$16 } = command.
|
|
38098
|
+
function validateNonInteractiveFlags$2(command) {
|
|
38099
|
+
const { name: name$1, path: path$16, json } = command.optsWithGlobals();
|
|
38014
38100
|
const providedCount = [name$1, path$16].filter(Boolean).length;
|
|
38101
|
+
if (json && providedCount < 2) command.error("JSON mode requires all flags: --name, --path");
|
|
38015
38102
|
if (providedCount > 0 && providedCount < 2) command.error("Non-interactive mode requires all flags: --name, --path");
|
|
38016
38103
|
}
|
|
38017
38104
|
async function chooseCreate(options) {
|
|
@@ -38135,12 +38222,23 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38135
38222
|
finalAppUrl = appUrl;
|
|
38136
38223
|
}
|
|
38137
38224
|
}
|
|
38138
|
-
|
|
38139
|
-
|
|
38140
|
-
|
|
38141
|
-
|
|
38225
|
+
const dashboardUrl = getDashboardUrl(projectId);
|
|
38226
|
+
if (!isJsonMode()) {
|
|
38227
|
+
M.message(`${theme.styles.header("Project")}: ${theme.colors.base44Orange(name$1)}`);
|
|
38228
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38229
|
+
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38230
|
+
}
|
|
38231
|
+
return {
|
|
38232
|
+
outroMessage: "Your project is set up and ready to use",
|
|
38233
|
+
data: {
|
|
38234
|
+
projectId,
|
|
38235
|
+
path: resolvedPath,
|
|
38236
|
+
dashboardUrl,
|
|
38237
|
+
...finalAppUrl && { appUrl: finalAppUrl }
|
|
38238
|
+
}
|
|
38239
|
+
};
|
|
38142
38240
|
}
|
|
38143
|
-
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$
|
|
38241
|
+
const createCommand = new Command("create").description("Create a new Base44 project").option("-n, --name <name>", "Project name").option("-d, --description <description>", "Project description").option("-p, --path <path>", "Path where to create the project").option("-t, --template <id>", "Template ID (e.g., backend-only, backend-and-client)").option("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$2).action(async (options) => {
|
|
38144
38242
|
await chooseCreate(options);
|
|
38145
38243
|
});
|
|
38146
38244
|
|
|
@@ -38186,7 +38284,7 @@ function isInsideContainer() {
|
|
|
38186
38284
|
//#endregion
|
|
38187
38285
|
//#region node_modules/is-wsl/index.js
|
|
38188
38286
|
const isWsl = () => {
|
|
38189
|
-
if (
|
|
38287
|
+
if (y.platform !== "linux") return false;
|
|
38190
38288
|
if (os.release().toLowerCase().includes("microsoft")) {
|
|
38191
38289
|
if (isInsideContainer()) return false;
|
|
38192
38290
|
return true;
|
|
@@ -38197,12 +38295,12 @@ const isWsl = () => {
|
|
|
38197
38295
|
return false;
|
|
38198
38296
|
}
|
|
38199
38297
|
};
|
|
38200
|
-
var is_wsl_default =
|
|
38298
|
+
var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
38201
38299
|
|
|
38202
38300
|
//#endregion
|
|
38203
38301
|
//#region node_modules/powershell-utils/index.js
|
|
38204
38302
|
const execFile$2 = promisify(childProcess.execFile);
|
|
38205
|
-
const powerShellPath$1 = () => `${
|
|
38303
|
+
const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
38206
38304
|
const executePowerShell = async (command, options = {}) => {
|
|
38207
38305
|
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
38208
38306
|
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
@@ -38313,7 +38411,7 @@ function defineLazyProperty(object$1, propertyName, valueGetter) {
|
|
|
38313
38411
|
//#region node_modules/default-browser-id/index.js
|
|
38314
38412
|
const execFileAsync$3 = promisify(execFile);
|
|
38315
38413
|
async function defaultBrowserId() {
|
|
38316
|
-
if (
|
|
38414
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38317
38415
|
const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
|
|
38318
38416
|
"read",
|
|
38319
38417
|
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
@@ -38328,7 +38426,7 @@ async function defaultBrowserId() {
|
|
|
38328
38426
|
//#region node_modules/run-applescript/index.js
|
|
38329
38427
|
const execFileAsync$2 = promisify(execFile);
|
|
38330
38428
|
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
38331
|
-
if (
|
|
38429
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38332
38430
|
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
38333
38431
|
const execOptions = {};
|
|
38334
38432
|
if (signal) execOptions.signal = signal;
|
|
@@ -38437,14 +38535,14 @@ async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
|
38437
38535
|
const execFileAsync = promisify(execFile);
|
|
38438
38536
|
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
|
|
38439
38537
|
async function defaultBrowser() {
|
|
38440
|
-
if (
|
|
38538
|
+
if (y.platform === "darwin") {
|
|
38441
38539
|
const id = await defaultBrowserId();
|
|
38442
38540
|
return {
|
|
38443
38541
|
name: await bundleName(id),
|
|
38444
38542
|
id
|
|
38445
38543
|
};
|
|
38446
38544
|
}
|
|
38447
|
-
if (
|
|
38545
|
+
if (y.platform === "linux") {
|
|
38448
38546
|
const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
|
|
38449
38547
|
"query",
|
|
38450
38548
|
"default",
|
|
@@ -38456,13 +38554,13 @@ async function defaultBrowser() {
|
|
|
38456
38554
|
id
|
|
38457
38555
|
};
|
|
38458
38556
|
}
|
|
38459
|
-
if (
|
|
38557
|
+
if (y.platform === "win32") return defaultBrowser$1();
|
|
38460
38558
|
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
38461
38559
|
}
|
|
38462
38560
|
|
|
38463
38561
|
//#endregion
|
|
38464
38562
|
//#region node_modules/is-in-ssh/index.js
|
|
38465
|
-
const isInSsh = Boolean(
|
|
38563
|
+
const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
|
|
38466
38564
|
var is_in_ssh_default = isInSsh;
|
|
38467
38565
|
|
|
38468
38566
|
//#endregion
|
|
@@ -38470,7 +38568,7 @@ var is_in_ssh_default = isInSsh;
|
|
|
38470
38568
|
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
38471
38569
|
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
38472
38570
|
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
38473
|
-
const { platform: platform$1, arch } =
|
|
38571
|
+
const { platform: platform$1, arch } = y;
|
|
38474
38572
|
const tryEachApp = async (apps$1, opener) => {
|
|
38475
38573
|
if (apps$1.length === 0) return;
|
|
38476
38574
|
const errors = [];
|
|
@@ -38583,7 +38681,7 @@ const baseOpen = async (options) => {
|
|
|
38583
38681
|
await fs$1.access(localXdgOpenPath, constants$1.X_OK);
|
|
38584
38682
|
exeLocalXdgOpen = true;
|
|
38585
38683
|
} catch {}
|
|
38586
|
-
command =
|
|
38684
|
+
command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
38587
38685
|
}
|
|
38588
38686
|
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
38589
38687
|
if (!options.wait) {
|
|
@@ -38685,20 +38783,36 @@ var open_default = open;
|
|
|
38685
38783
|
|
|
38686
38784
|
//#endregion
|
|
38687
38785
|
//#region src/cli/commands/project/dashboard.ts
|
|
38688
|
-
async function openDashboard() {
|
|
38786
|
+
async function openDashboard(options) {
|
|
38689
38787
|
const dashboardUrl = getDashboardUrl();
|
|
38690
|
-
|
|
38691
|
-
|
|
38788
|
+
const shouldOpen = !isJsonMode() && options.open !== false;
|
|
38789
|
+
if (shouldOpen) await open_default(dashboardUrl);
|
|
38790
|
+
return {
|
|
38791
|
+
outroMessage: shouldOpen ? `Dashboard opened at ${dashboardUrl}` : `Dashboard URL: ${dashboardUrl}`,
|
|
38792
|
+
data: { dashboardUrl }
|
|
38793
|
+
};
|
|
38692
38794
|
}
|
|
38693
|
-
const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").action(async () => {
|
|
38694
|
-
await runCommand(openDashboard, { requireAuth: true });
|
|
38795
|
+
const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").option("--no-open", "Print the URL without opening the browser").action(async (options) => {
|
|
38796
|
+
await runCommand(() => openDashboard(options), { requireAuth: true });
|
|
38695
38797
|
});
|
|
38696
38798
|
|
|
38697
38799
|
//#endregion
|
|
38698
38800
|
//#region src/cli/commands/project/deploy.ts
|
|
38801
|
+
function validateNonInteractiveFlags$1(command) {
|
|
38802
|
+
const opts = command.optsWithGlobals();
|
|
38803
|
+
if (opts.json && !opts.yes) command.error("JSON mode requires: --yes (-y) to skip confirmation");
|
|
38804
|
+
}
|
|
38699
38805
|
async function deployAction$1(options) {
|
|
38700
38806
|
const projectData = await readProjectConfig();
|
|
38701
|
-
if (!hasResourcesToDeploy(projectData)) return {
|
|
38807
|
+
if (!hasResourcesToDeploy(projectData)) return {
|
|
38808
|
+
outroMessage: "No resources found to deploy",
|
|
38809
|
+
data: {
|
|
38810
|
+
dashboardUrl: getDashboardUrl(),
|
|
38811
|
+
entitiesCount: 0,
|
|
38812
|
+
functionsCount: 0,
|
|
38813
|
+
siteDeployed: false
|
|
38814
|
+
}
|
|
38815
|
+
};
|
|
38702
38816
|
const { project, entities, functions } = projectData;
|
|
38703
38817
|
const summaryLines = [];
|
|
38704
38818
|
if (entities.length > 0) summaryLines.push(` - ${entities.length} ${entities.length === 1 ? "entity" : "entities"}`);
|
|
@@ -38707,26 +38821,48 @@ async function deployAction$1(options) {
|
|
|
38707
38821
|
if (!options.yes) {
|
|
38708
38822
|
M.warn(`This will update your Base44 app with:\n${summaryLines.join("\n")}`);
|
|
38709
38823
|
const shouldDeploy = await ye({ message: "Are you sure you want to continue?" });
|
|
38710
|
-
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38711
|
-
|
|
38824
|
+
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38825
|
+
outroMessage: "Deployment cancelled",
|
|
38826
|
+
data: {
|
|
38827
|
+
dashboardUrl: getDashboardUrl(),
|
|
38828
|
+
entitiesCount: entities.length,
|
|
38829
|
+
functionsCount: functions.length,
|
|
38830
|
+
siteDeployed: false,
|
|
38831
|
+
cancelled: true
|
|
38832
|
+
}
|
|
38833
|
+
};
|
|
38834
|
+
} else if (!isJsonMode()) M.info(`Deploying:\n${summaryLines.join("\n")}`);
|
|
38712
38835
|
const result = await runTask("Deploying your app...", async () => {
|
|
38713
38836
|
return await deployAll(projectData);
|
|
38714
38837
|
}, {
|
|
38715
38838
|
successMessage: theme.colors.base44Orange("Deployment completed"),
|
|
38716
38839
|
errorMessage: "Deployment failed"
|
|
38717
38840
|
});
|
|
38718
|
-
|
|
38719
|
-
if (
|
|
38720
|
-
|
|
38841
|
+
const dashboardUrl = getDashboardUrl();
|
|
38842
|
+
if (!isJsonMode()) {
|
|
38843
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38844
|
+
if (result.appUrl) M.message(`${theme.styles.header("App URL")}: ${theme.colors.links(result.appUrl)}`);
|
|
38845
|
+
}
|
|
38846
|
+
return {
|
|
38847
|
+
outroMessage: "App deployed successfully",
|
|
38848
|
+
data: {
|
|
38849
|
+
dashboardUrl,
|
|
38850
|
+
appUrl: result.appUrl,
|
|
38851
|
+
entitiesCount: entities.length,
|
|
38852
|
+
functionsCount: functions.length,
|
|
38853
|
+
siteDeployed: !!project.site?.outputDirectory
|
|
38854
|
+
}
|
|
38855
|
+
};
|
|
38721
38856
|
}
|
|
38722
|
-
const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
38857
|
+
const deployCommand = new Command("deploy").description("Deploy all project resources (entities, functions, and site)").option("-y, --yes", "Skip confirmation prompt").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38723
38858
|
await runCommand(() => deployAction$1(options), { requireAuth: true });
|
|
38724
38859
|
});
|
|
38725
38860
|
|
|
38726
38861
|
//#endregion
|
|
38727
38862
|
//#region src/cli/commands/project/link.ts
|
|
38728
38863
|
function validateNonInteractiveFlags(command) {
|
|
38729
|
-
const { create: create$1, name: name$1 } = command.
|
|
38864
|
+
const { create: create$1, name: name$1, json } = command.optsWithGlobals();
|
|
38865
|
+
if (json && (!create$1 || !name$1)) command.error("JSON mode requires flags: --create, --name");
|
|
38730
38866
|
if (create$1 && !name$1) command.error("--name is required when using --create");
|
|
38731
38867
|
}
|
|
38732
38868
|
async function promptForProjectDetails() {
|
|
@@ -38778,8 +38914,15 @@ async function link(options) {
|
|
|
38778
38914
|
id: projectId,
|
|
38779
38915
|
projectRoot: projectRoot.root
|
|
38780
38916
|
});
|
|
38781
|
-
|
|
38782
|
-
|
|
38917
|
+
const dashboardUrl = getDashboardUrl(projectId);
|
|
38918
|
+
if (!isJsonMode()) M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38919
|
+
return {
|
|
38920
|
+
outroMessage: "Project linked",
|
|
38921
|
+
data: {
|
|
38922
|
+
projectId,
|
|
38923
|
+
dashboardUrl
|
|
38924
|
+
}
|
|
38925
|
+
};
|
|
38783
38926
|
}
|
|
38784
38927
|
const linkCommand = new Command("link").description("Link a local project to a Base44 project").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").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
|
|
38785
38928
|
await runCommand(() => link(options), {
|
|
@@ -38794,16 +38937,23 @@ async function deployAction(options) {
|
|
|
38794
38937
|
const { project } = await readProjectConfig();
|
|
38795
38938
|
if (!project.site?.outputDirectory) throw new Error("No site configuration found. Please add 'site.outputDirectory' to your config.jsonc");
|
|
38796
38939
|
const outputDir = resolve(project.root, project.site.outputDirectory);
|
|
38797
|
-
if (!options.yes) {
|
|
38940
|
+
if (!options.yes && !isJsonMode()) {
|
|
38798
38941
|
const shouldDeploy = await ye({ message: `Deploy site from ${project.site.outputDirectory}?` });
|
|
38799
|
-
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38942
|
+
if (pD(shouldDeploy) || !shouldDeploy) return {
|
|
38943
|
+
outroMessage: "Deployment cancelled",
|
|
38944
|
+
data: { cancelled: true }
|
|
38945
|
+
};
|
|
38800
38946
|
}
|
|
38801
|
-
|
|
38947
|
+
const result = await runTask("Creating archive and deploying site...", async () => {
|
|
38802
38948
|
return await deploySite(outputDir);
|
|
38803
38949
|
}, {
|
|
38804
38950
|
successMessage: "Site deployed successfully",
|
|
38805
38951
|
errorMessage: "Deployment failed"
|
|
38806
|
-
})
|
|
38952
|
+
});
|
|
38953
|
+
return {
|
|
38954
|
+
outroMessage: `Visit your site at: ${result.appUrl}`,
|
|
38955
|
+
data: { appUrl: result.appUrl }
|
|
38956
|
+
};
|
|
38807
38957
|
}
|
|
38808
38958
|
const siteDeployCommand = new Command("site").description("Manage site deployments").addCommand(new Command("deploy").description("Deploy built site files to Base44 hosting").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
38809
38959
|
await runCommand(() => deployAction(options), { requireAuth: true });
|
|
@@ -38814,47 +38964,24 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38814
38964
|
var version = "0.0.15";
|
|
38815
38965
|
|
|
38816
38966
|
//#endregion
|
|
38817
|
-
//#region src/cli/
|
|
38818
|
-
|
|
38819
|
-
|
|
38820
|
-
|
|
38821
|
-
|
|
38822
|
-
|
|
38823
|
-
|
|
38824
|
-
|
|
38825
|
-
|
|
38826
|
-
|
|
38827
|
-
|
|
38828
|
-
|
|
38829
|
-
|
|
38830
|
-
|
|
38831
|
-
|
|
38832
|
-
|
|
38833
|
-
|
|
38834
|
-
|
|
38835
|
-
|
|
38836
|
-
|
|
38837
|
-
|
|
38838
|
-
program$2.exitOverride((err) => {
|
|
38839
|
-
throw err;
|
|
38840
|
-
});
|
|
38841
|
-
program$2.configureOutput({
|
|
38842
|
-
writeOut: (str) => process.stdout.write(str),
|
|
38843
|
-
writeErr: (str) => process.stderr.write(str)
|
|
38844
|
-
});
|
|
38845
|
-
program$2.addCommand(loginCommand);
|
|
38846
|
-
program$2.addCommand(whoamiCommand);
|
|
38847
|
-
program$2.addCommand(logoutCommand);
|
|
38848
|
-
program$2.addCommand(createCommand);
|
|
38849
|
-
program$2.addCommand(dashboardCommand);
|
|
38850
|
-
program$2.addCommand(deployCommand);
|
|
38851
|
-
program$2.addCommand(linkCommand);
|
|
38852
|
-
program$2.addCommand(entitiesPushCommand);
|
|
38853
|
-
program$2.addCommand(functionsDeployCommand);
|
|
38854
|
-
program$2.addCommand(siteDeployCommand);
|
|
38855
|
-
return program$2;
|
|
38856
|
-
}
|
|
38857
|
-
const program = createProgram();
|
|
38858
|
-
|
|
38859
|
-
//#endregion
|
|
38860
|
-
export { CLIExitError, createProgram, program };
|
|
38967
|
+
//#region src/cli/index.ts
|
|
38968
|
+
const program = new Command();
|
|
38969
|
+
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(version).option("--json", "Output results as JSON (for scripting)");
|
|
38970
|
+
program.hook("preAction", (thisCommand) => {
|
|
38971
|
+
if (thisCommand.optsWithGlobals().json) setJsonMode(true);
|
|
38972
|
+
});
|
|
38973
|
+
program.configureHelp({ sortSubcommands: true });
|
|
38974
|
+
program.addCommand(loginCommand);
|
|
38975
|
+
program.addCommand(whoamiCommand);
|
|
38976
|
+
program.addCommand(logoutCommand);
|
|
38977
|
+
program.addCommand(createCommand);
|
|
38978
|
+
program.addCommand(dashboardCommand);
|
|
38979
|
+
program.addCommand(deployCommand);
|
|
38980
|
+
program.addCommand(linkCommand);
|
|
38981
|
+
program.addCommand(entitiesPushCommand);
|
|
38982
|
+
program.addCommand(functionsDeployCommand);
|
|
38983
|
+
program.addCommand(siteDeployCommand);
|
|
38984
|
+
program.parse();
|
|
38985
|
+
|
|
38986
|
+
//#endregion
|
|
38987
|
+
export { };
|