base44 0.0.11 → 0.0.12
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 +736 -97
- package/package.json +3 -2
package/dist/cli/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { EventEmitter, addAbortListener, on, once, setMaxListeners } from "node:events";
|
|
4
|
-
import { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
4
|
+
import childProcess, { ChildProcess, execFile, spawn, spawnSync } from "node:child_process";
|
|
5
5
|
import path, { basename, dirname, join, posix, resolve, win32 } from "node:path";
|
|
6
6
|
import fs, { appendFileSync, createReadStream, createWriteStream, readFileSync, statSync, writeFileSync } from "node:fs";
|
|
7
7
|
import y, { execArgv, execPath, hrtime, platform, stdin, stdout } from "node:process";
|
|
@@ -15,7 +15,7 @@ import fs$1 from "fs";
|
|
|
15
15
|
import path$1, { dirname as dirname$1, parse } from "path";
|
|
16
16
|
import { finished } from "node:stream/promises";
|
|
17
17
|
import EE, { EventEmitter as EventEmitter$1 } from "events";
|
|
18
|
-
import
|
|
18
|
+
import fs$2, { access, constants as constants$1, copyFile, mkdir, readFile, unlink, writeFile } from "node:fs/promises";
|
|
19
19
|
import { Buffer as Buffer$1 } from "buffer";
|
|
20
20
|
import tty from "node:tty";
|
|
21
21
|
import { randomBytes, randomUUID } from "node:crypto";
|
|
@@ -891,9 +891,9 @@ var require_suggestSimilar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
891
891
|
//#region node_modules/commander/lib/command.js
|
|
892
892
|
var require_command = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
893
893
|
const EventEmitter$2 = __require("node:events").EventEmitter;
|
|
894
|
-
const childProcess = __require("node:child_process");
|
|
894
|
+
const childProcess$1 = __require("node:child_process");
|
|
895
895
|
const path$16 = __require("node:path");
|
|
896
|
-
const fs$
|
|
896
|
+
const fs$11 = __require("node:fs");
|
|
897
897
|
const process$3 = __require("node:process");
|
|
898
898
|
const { Argument, humanReadableArgName } = require_argument();
|
|
899
899
|
const { CommanderError } = require_error$1();
|
|
@@ -1741,9 +1741,9 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1741
1741
|
];
|
|
1742
1742
|
function findFile(baseDir, baseName) {
|
|
1743
1743
|
const localBin = path$16.resolve(baseDir, baseName);
|
|
1744
|
-
if (fs$
|
|
1744
|
+
if (fs$11.existsSync(localBin)) return localBin;
|
|
1745
1745
|
if (sourceExt.includes(path$16.extname(baseName))) return void 0;
|
|
1746
|
-
const foundExt = sourceExt.find((ext) => fs$
|
|
1746
|
+
const foundExt = sourceExt.find((ext) => fs$11.existsSync(`${localBin}${ext}`));
|
|
1747
1747
|
if (foundExt) return `${localBin}${foundExt}`;
|
|
1748
1748
|
}
|
|
1749
1749
|
this._checkForMissingMandatoryOptions();
|
|
@@ -1753,7 +1753,7 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1753
1753
|
if (this._scriptPath) {
|
|
1754
1754
|
let resolvedScriptPath;
|
|
1755
1755
|
try {
|
|
1756
|
-
resolvedScriptPath = fs$
|
|
1756
|
+
resolvedScriptPath = fs$11.realpathSync(this._scriptPath);
|
|
1757
1757
|
} catch (err) {
|
|
1758
1758
|
resolvedScriptPath = this._scriptPath;
|
|
1759
1759
|
}
|
|
@@ -1772,12 +1772,12 @@ Expecting one of '${allowedValues.join("', '")}'`);
|
|
|
1772
1772
|
if (process$3.platform !== "win32") if (launchWithNode) {
|
|
1773
1773
|
args.unshift(executableFile);
|
|
1774
1774
|
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1775
|
-
proc$1 = childProcess.spawn(process$3.argv[0], args, { stdio: "inherit" });
|
|
1776
|
-
} else proc$1 = childProcess.spawn(executableFile, args, { stdio: "inherit" });
|
|
1775
|
+
proc$1 = childProcess$1.spawn(process$3.argv[0], args, { stdio: "inherit" });
|
|
1776
|
+
} else proc$1 = childProcess$1.spawn(executableFile, args, { stdio: "inherit" });
|
|
1777
1777
|
else {
|
|
1778
1778
|
args.unshift(executableFile);
|
|
1779
1779
|
args = incrementNodeInspectorPort(process$3.execArgv).concat(args);
|
|
1780
|
-
proc$1 = childProcess.spawn(process$3.execPath, args, { stdio: "inherit" });
|
|
1780
|
+
proc$1 = childProcess$1.spawn(process$3.execPath, args, { stdio: "inherit" });
|
|
1781
1781
|
}
|
|
1782
1782
|
if (!proc$1.killed) [
|
|
1783
1783
|
"SIGUSR1",
|
|
@@ -2767,9 +2767,9 @@ var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2767
2767
|
var require_picocolors = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2768
2768
|
let p = process || {}, argv = p.argv || [], env = p.env || {};
|
|
2769
2769
|
let isColorSupported = !(!!env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || p.platform === "win32" || (p.stdout || {}).isTTY && env.TERM !== "dumb" || !!env.CI);
|
|
2770
|
-
let formatter = (open, close, replace$1 = open) => (input) => {
|
|
2771
|
-
let string$2 = "" + input, index = string$2.indexOf(close, open.length);
|
|
2772
|
-
return ~index ? open + replaceClose(string$2, close, replace$1, index) + close : open + string$2 + close;
|
|
2770
|
+
let formatter = (open$1, close, replace$1 = open$1) => (input) => {
|
|
2771
|
+
let string$2 = "" + input, index = string$2.indexOf(close, open$1.length);
|
|
2772
|
+
return ~index ? open$1 + replaceClose(string$2, close, replace$1, index) + close : open$1 + string$2 + close;
|
|
2773
2773
|
};
|
|
2774
2774
|
let replaceClose = (string$2, close, replace$1, index) => {
|
|
2775
2775
|
let result = "", cursor = 0;
|
|
@@ -8770,7 +8770,7 @@ var require_package$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8770
8770
|
//#endregion
|
|
8771
8771
|
//#region node_modules/dotenv/lib/main.js
|
|
8772
8772
|
var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
8773
|
-
const fs$
|
|
8773
|
+
const fs$10 = __require("fs");
|
|
8774
8774
|
const path$15 = __require("path");
|
|
8775
8775
|
const os$3 = __require("os");
|
|
8776
8776
|
const crypto = __require("crypto");
|
|
@@ -8907,10 +8907,10 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8907
8907
|
function _vaultPath(options) {
|
|
8908
8908
|
let possibleVaultPath = null;
|
|
8909
8909
|
if (options && options.path && options.path.length > 0) if (Array.isArray(options.path)) {
|
|
8910
|
-
for (const filepath of options.path) if (fs$
|
|
8910
|
+
for (const filepath of options.path) if (fs$10.existsSync(filepath)) possibleVaultPath = filepath.endsWith(".vault") ? filepath : `${filepath}.vault`;
|
|
8911
8911
|
} else possibleVaultPath = options.path.endsWith(".vault") ? options.path : `${options.path}.vault`;
|
|
8912
8912
|
else possibleVaultPath = path$15.resolve(process.cwd(), ".env.vault");
|
|
8913
|
-
if (fs$
|
|
8913
|
+
if (fs$10.existsSync(possibleVaultPath)) return possibleVaultPath;
|
|
8914
8914
|
return null;
|
|
8915
8915
|
}
|
|
8916
8916
|
function _resolveHome(envPath) {
|
|
@@ -8944,7 +8944,7 @@ var require_main = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
8944
8944
|
let lastError;
|
|
8945
8945
|
const parsedAll = {};
|
|
8946
8946
|
for (const path$17 of optionPaths) try {
|
|
8947
|
-
const parsed = DotenvModule.parse(fs$
|
|
8947
|
+
const parsed = DotenvModule.parse(fs$10.readFileSync(path$17, { encoding }));
|
|
8948
8948
|
DotenvModule.populate(parsedAll, parsed, options);
|
|
8949
8949
|
} catch (e$1) {
|
|
8950
8950
|
if (debug) _debug(`Failed to load ${path$17} ${e$1.message}`);
|
|
@@ -9414,9 +9414,9 @@ var require_is_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9414
9414
|
}
|
|
9415
9415
|
}
|
|
9416
9416
|
if (str[index] === "\\") {
|
|
9417
|
-
var open = str[index + 1];
|
|
9417
|
+
var open$1 = str[index + 1];
|
|
9418
9418
|
index += 2;
|
|
9419
|
-
var close = chars[open];
|
|
9419
|
+
var close = chars[open$1];
|
|
9420
9420
|
if (close) {
|
|
9421
9421
|
var n$1 = str.indexOf(close, index);
|
|
9422
9422
|
if (n$1 !== -1) index = n$1 + 1;
|
|
@@ -9432,9 +9432,9 @@ var require_is_glob = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9432
9432
|
while (index < str.length) {
|
|
9433
9433
|
if (/[*?{}()[\]]/.test(str[index])) return true;
|
|
9434
9434
|
if (str[index] === "\\") {
|
|
9435
|
-
var open = str[index + 1];
|
|
9435
|
+
var open$1 = str[index + 1];
|
|
9436
9436
|
index += 2;
|
|
9437
|
-
var close = chars[open];
|
|
9437
|
+
var close = chars[open$1];
|
|
9438
9438
|
if (close) {
|
|
9439
9439
|
var n$1 = str.indexOf(close, index);
|
|
9440
9440
|
if (n$1 !== -1) index = n$1 + 1;
|
|
@@ -10286,7 +10286,7 @@ var require_parse$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10286
10286
|
* Quotes: '|"|`
|
|
10287
10287
|
*/
|
|
10288
10288
|
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
|
|
10289
|
-
const open = value;
|
|
10289
|
+
const open$1 = value;
|
|
10290
10290
|
let next;
|
|
10291
10291
|
if (options.keepQuotes !== true) value = "";
|
|
10292
10292
|
while (index < length && (next = advance())) {
|
|
@@ -10294,7 +10294,7 @@ var require_parse$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10294
10294
|
value += next + advance();
|
|
10295
10295
|
continue;
|
|
10296
10296
|
}
|
|
10297
|
-
if (next === open) {
|
|
10297
|
+
if (next === open$1) {
|
|
10298
10298
|
if (options.keepQuotes === true) value += next;
|
|
10299
10299
|
break;
|
|
10300
10300
|
}
|
|
@@ -10356,8 +10356,8 @@ var require_parse$3 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10356
10356
|
if (value === CHAR_COMMA && depth > 0) {
|
|
10357
10357
|
if (block.ranges > 0) {
|
|
10358
10358
|
block.ranges = 0;
|
|
10359
|
-
const open = block.nodes.shift();
|
|
10360
|
-
block.nodes = [open, {
|
|
10359
|
+
const open$1 = block.nodes.shift();
|
|
10360
|
+
block.nodes = [open$1, {
|
|
10361
10361
|
type: "text",
|
|
10362
10362
|
value: stringify(block)
|
|
10363
10363
|
}];
|
|
@@ -11462,15 +11462,15 @@ var require_parse$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
11462
11462
|
*/
|
|
11463
11463
|
if (value === "{" && opts.nobrace !== true) {
|
|
11464
11464
|
increment$1("braces");
|
|
11465
|
-
const open = {
|
|
11465
|
+
const open$1 = {
|
|
11466
11466
|
type: "brace",
|
|
11467
11467
|
value,
|
|
11468
11468
|
output: "(",
|
|
11469
11469
|
outputIndex: state.output.length,
|
|
11470
11470
|
tokensIndex: state.tokens.length
|
|
11471
11471
|
};
|
|
11472
|
-
braces.push(open);
|
|
11473
|
-
push$1(open);
|
|
11472
|
+
braces.push(open$1);
|
|
11473
|
+
push$1(open$1);
|
|
11474
11474
|
continue;
|
|
11475
11475
|
}
|
|
11476
11476
|
if (value === "}") {
|
|
@@ -13110,12 +13110,12 @@ var require_sync$5 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13110
13110
|
var require_fs$2 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13111
13111
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13112
13112
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
13113
|
-
const fs$
|
|
13113
|
+
const fs$9 = __require("fs");
|
|
13114
13114
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
13115
|
-
lstat: fs$
|
|
13116
|
-
stat: fs$
|
|
13117
|
-
lstatSync: fs$
|
|
13118
|
-
statSync: fs$
|
|
13115
|
+
lstat: fs$9.lstat,
|
|
13116
|
+
stat: fs$9.stat,
|
|
13117
|
+
lstatSync: fs$9.lstatSync,
|
|
13118
|
+
statSync: fs$9.statSync
|
|
13119
13119
|
};
|
|
13120
13120
|
function createFileSystemAdapter(fsMethods) {
|
|
13121
13121
|
if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
|
|
@@ -13448,14 +13448,14 @@ var require_sync$4 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
13448
13448
|
var require_fs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13449
13449
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13450
13450
|
exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
|
|
13451
|
-
const fs$
|
|
13451
|
+
const fs$8 = __require("fs");
|
|
13452
13452
|
exports.FILE_SYSTEM_ADAPTER = {
|
|
13453
|
-
lstat: fs$
|
|
13454
|
-
stat: fs$
|
|
13455
|
-
lstatSync: fs$
|
|
13456
|
-
statSync: fs$
|
|
13457
|
-
readdir: fs$
|
|
13458
|
-
readdirSync: fs$
|
|
13453
|
+
lstat: fs$8.lstat,
|
|
13454
|
+
stat: fs$8.stat,
|
|
13455
|
+
lstatSync: fs$8.lstatSync,
|
|
13456
|
+
statSync: fs$8.statSync,
|
|
13457
|
+
readdir: fs$8.readdir,
|
|
13458
|
+
readdirSync: fs$8.readdirSync
|
|
13459
13459
|
};
|
|
13460
13460
|
function createFileSystemAdapter(fsMethods) {
|
|
13461
13461
|
if (fsMethods === void 0) return exports.FILE_SYSTEM_ADAPTER;
|
|
@@ -14677,7 +14677,7 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14677
14677
|
var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
14678
14678
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14679
14679
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
|
|
14680
|
-
const fs$
|
|
14680
|
+
const fs$7 = __require("fs");
|
|
14681
14681
|
const os$1 = __require("os");
|
|
14682
14682
|
/**
|
|
14683
14683
|
* The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
|
|
@@ -14685,12 +14685,12 @@ var require_settings = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
14685
14685
|
*/
|
|
14686
14686
|
const CPU_COUNT = Math.max(os$1.cpus().length, 1);
|
|
14687
14687
|
exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
|
|
14688
|
-
lstat: fs$
|
|
14689
|
-
lstatSync: fs$
|
|
14690
|
-
stat: fs$
|
|
14691
|
-
statSync: fs$
|
|
14692
|
-
readdir: fs$
|
|
14693
|
-
readdirSync: fs$
|
|
14688
|
+
lstat: fs$7.lstat,
|
|
14689
|
+
lstatSync: fs$7.lstatSync,
|
|
14690
|
+
stat: fs$7.stat,
|
|
14691
|
+
statSync: fs$7.statSync,
|
|
14692
|
+
readdir: fs$7.readdir,
|
|
14693
|
+
readdirSync: fs$7.readdirSync
|
|
14694
14694
|
};
|
|
14695
14695
|
var Settings = class {
|
|
14696
14696
|
constructor(_options = {}) {
|
|
@@ -15269,7 +15269,7 @@ const ignoreFilesGlobOptions = {
|
|
|
15269
15269
|
dot: true
|
|
15270
15270
|
};
|
|
15271
15271
|
const GITIGNORE_FILES_PATTERN = "**/.gitignore";
|
|
15272
|
-
const getReadFileMethod = (fsImplementation) => bindFsMethod(fsImplementation?.promises, "readFile") ?? bindFsMethod(
|
|
15272
|
+
const getReadFileMethod = (fsImplementation) => bindFsMethod(fsImplementation?.promises, "readFile") ?? bindFsMethod(fs$2, "readFile") ?? promisifyFsMethod(fsImplementation, "readFile");
|
|
15273
15273
|
const getReadFileSyncMethod = (fsImplementation) => bindFsMethod(fsImplementation, "readFileSync") ?? bindFsMethod(fs, "readFileSync");
|
|
15274
15274
|
const shouldSkipIgnoreFileError = (error, suppressErrors) => {
|
|
15275
15275
|
if (!error) return Boolean(suppressErrors);
|
|
@@ -16832,7 +16832,7 @@ async function deployFunctions(functions) {
|
|
|
16832
16832
|
const payload = { functions: functions.map(toDeployPayloadItem) };
|
|
16833
16833
|
const response = await appClient.put("backend-functions", {
|
|
16834
16834
|
json: payload,
|
|
16835
|
-
timeout:
|
|
16835
|
+
timeout: 12e4
|
|
16836
16836
|
});
|
|
16837
16837
|
return DeployFunctionsResponseSchema.parse(await response.json());
|
|
16838
16838
|
}
|
|
@@ -17207,7 +17207,7 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17207
17207
|
* @module ejs
|
|
17208
17208
|
* @public
|
|
17209
17209
|
*/
|
|
17210
|
-
var fs$
|
|
17210
|
+
var fs$6 = __require("fs");
|
|
17211
17211
|
var path$5 = __require("path");
|
|
17212
17212
|
var utils = require_utils();
|
|
17213
17213
|
var scopeOptionWarned = false;
|
|
@@ -17249,7 +17249,7 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17249
17249
|
*
|
|
17250
17250
|
* @type {fileLoader}
|
|
17251
17251
|
*/
|
|
17252
|
-
exports.fileLoader = fs$
|
|
17252
|
+
exports.fileLoader = fs$6.readFileSync;
|
|
17253
17253
|
/**
|
|
17254
17254
|
* Name of the object containing the locals.
|
|
17255
17255
|
*
|
|
@@ -17296,7 +17296,7 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17296
17296
|
var filePath;
|
|
17297
17297
|
if (paths.some(function(v$1) {
|
|
17298
17298
|
filePath = exports.resolveInclude(name$1, v$1, true);
|
|
17299
|
-
return fs$
|
|
17299
|
+
return fs$6.existsSync(filePath);
|
|
17300
17300
|
})) return filePath;
|
|
17301
17301
|
}
|
|
17302
17302
|
/**
|
|
@@ -17318,7 +17318,7 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17318
17318
|
} else {
|
|
17319
17319
|
if (options.filename) {
|
|
17320
17320
|
filePath = exports.resolveInclude(path$17, options.filename);
|
|
17321
|
-
if (fs$
|
|
17321
|
+
if (fs$6.existsSync(filePath)) includePath = filePath;
|
|
17322
17322
|
}
|
|
17323
17323
|
if (!includePath && Array.isArray(views)) includePath = resolvePaths(path$17, views);
|
|
17324
17324
|
if (!includePath && typeof options.includer !== "function") throw new Error("Could not find the include file \"" + options.escapeFunction(path$17) + "\"");
|
|
@@ -17591,9 +17591,9 @@ var require_ejs = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
17591
17591
|
createRegex: function() {
|
|
17592
17592
|
var str = _REGEX_STRING;
|
|
17593
17593
|
var delim = utils.escapeRegExpChars(this.opts.delimiter);
|
|
17594
|
-
var open = utils.escapeRegExpChars(this.opts.openDelimiter);
|
|
17594
|
+
var open$1 = utils.escapeRegExpChars(this.opts.openDelimiter);
|
|
17595
17595
|
var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
|
|
17596
|
-
str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
|
|
17596
|
+
str = str.replace(/%/g, delim).replace(/</g, open$1).replace(/>/g, close);
|
|
17597
17597
|
return new RegExp(str);
|
|
17598
17598
|
},
|
|
17599
17599
|
compile: function() {
|
|
@@ -25532,9 +25532,30 @@ async function createProjectFiles(options) {
|
|
|
25532
25532
|
};
|
|
25533
25533
|
}
|
|
25534
25534
|
|
|
25535
|
+
//#endregion
|
|
25536
|
+
//#region src/core/project/env.ts
|
|
25537
|
+
const ENV_LOCAL_TEMPLATE = `# Base44 Project Environment Variables
|
|
25538
|
+
# This file contains environment-specific configuration for your Base44 project.
|
|
25539
|
+
# Do not commit this file to version control if it contains sensitive data.
|
|
25540
|
+
|
|
25541
|
+
# Your Base44 Application ID
|
|
25542
|
+
BASE44_CLIENT_ID={{projectId}}
|
|
25543
|
+
`;
|
|
25544
|
+
function generateEnvLocalContent(projectId) {
|
|
25545
|
+
return ENV_LOCAL_TEMPLATE.replace("{{projectId}}", projectId);
|
|
25546
|
+
}
|
|
25547
|
+
async function writeEnvLocal(projectRoot, projectId) {
|
|
25548
|
+
const envPath = getProjectEnvPath(projectRoot);
|
|
25549
|
+
await writeFile$1(envPath, generateEnvLocalContent(projectId));
|
|
25550
|
+
return envPath;
|
|
25551
|
+
}
|
|
25552
|
+
async function envLocalExists(projectRoot) {
|
|
25553
|
+
return pathExists(getProjectEnvPath(projectRoot));
|
|
25554
|
+
}
|
|
25555
|
+
|
|
25535
25556
|
//#endregion
|
|
25536
25557
|
//#region src/core/config.ts
|
|
25537
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
25558
|
+
const __dirname$1 = dirname(fileURLToPath(import.meta.url));
|
|
25538
25559
|
function getBase44GlobalDir() {
|
|
25539
25560
|
return join(homedir(), ".base44");
|
|
25540
25561
|
}
|
|
@@ -25542,11 +25563,14 @@ function getAuthFilePath() {
|
|
|
25542
25563
|
return join(getBase44GlobalDir(), "auth", "auth.json");
|
|
25543
25564
|
}
|
|
25544
25565
|
function getTemplatesDir() {
|
|
25545
|
-
return join(__dirname, "templates");
|
|
25566
|
+
return join(__dirname$1, "templates");
|
|
25546
25567
|
}
|
|
25547
25568
|
function getTemplatesIndexPath() {
|
|
25548
25569
|
return join(getTemplatesDir(), "templates.json");
|
|
25549
25570
|
}
|
|
25571
|
+
function getProjectEnvPath(projectRoot) {
|
|
25572
|
+
return join(projectRoot, PROJECT_SUBDIR, ".env.local");
|
|
25573
|
+
}
|
|
25550
25574
|
/**
|
|
25551
25575
|
* Load .env.local from the project root if it exists.
|
|
25552
25576
|
* Values won't override existing process.env variables.
|
|
@@ -25555,7 +25579,7 @@ async function loadProjectEnv(projectRoot) {
|
|
|
25555
25579
|
const found = projectRoot ? { root: projectRoot } : await findProjectRoot();
|
|
25556
25580
|
if (!found) return;
|
|
25557
25581
|
(0, import_main.config)({
|
|
25558
|
-
path:
|
|
25582
|
+
path: getProjectEnvPath(found.root),
|
|
25559
25583
|
override: false,
|
|
25560
25584
|
quiet: true
|
|
25561
25585
|
});
|
|
@@ -26155,18 +26179,18 @@ const proto = Object.defineProperties(() => {}, {
|
|
|
26155
26179
|
}
|
|
26156
26180
|
}
|
|
26157
26181
|
});
|
|
26158
|
-
const createStyler = (open, close, parent) => {
|
|
26182
|
+
const createStyler = (open$1, close, parent) => {
|
|
26159
26183
|
let openAll;
|
|
26160
26184
|
let closeAll;
|
|
26161
26185
|
if (parent === void 0) {
|
|
26162
|
-
openAll = open;
|
|
26186
|
+
openAll = open$1;
|
|
26163
26187
|
closeAll = close;
|
|
26164
26188
|
} else {
|
|
26165
|
-
openAll = parent.openAll + open;
|
|
26189
|
+
openAll = parent.openAll + open$1;
|
|
26166
26190
|
closeAll = close + parent.closeAll;
|
|
26167
26191
|
}
|
|
26168
26192
|
return {
|
|
26169
|
-
open,
|
|
26193
|
+
open: open$1,
|
|
26170
26194
|
close,
|
|
26171
26195
|
openAll,
|
|
26172
26196
|
closeAll,
|
|
@@ -27792,7 +27816,7 @@ const makeCommand = (syncFile, asyncFile, syncNoFile, asyncNoFile, validate$1) =
|
|
|
27792
27816
|
/* c8 ignore start */
|
|
27793
27817
|
const realZlibConstants = realZlib.constants || { ZLIB_VERNUM: 4736 };
|
|
27794
27818
|
/* c8 ignore stop */
|
|
27795
|
-
const constants$
|
|
27819
|
+
const constants$2 = Object.freeze(Object.assign(Object.create(null), {
|
|
27796
27820
|
Z_NO_FLUSH: 0,
|
|
27797
27821
|
Z_PARTIAL_FLUSH: 1,
|
|
27798
27822
|
Z_SYNC_FLUSH: 2,
|
|
@@ -28054,9 +28078,9 @@ var Zlib = class extends ZlibBase {
|
|
|
28054
28078
|
#strategy;
|
|
28055
28079
|
constructor(opts, mode) {
|
|
28056
28080
|
opts = opts || {};
|
|
28057
|
-
opts.flush = opts.flush || constants$
|
|
28058
|
-
opts.finishFlush = opts.finishFlush || constants$
|
|
28059
|
-
opts.fullFlushFlag = constants$
|
|
28081
|
+
opts.flush = opts.flush || constants$2.Z_NO_FLUSH;
|
|
28082
|
+
opts.finishFlush = opts.finishFlush || constants$2.Z_FINISH;
|
|
28083
|
+
opts.fullFlushFlag = constants$2.Z_FULL_FLUSH;
|
|
28060
28084
|
super(opts, mode);
|
|
28061
28085
|
this.#level = opts.level;
|
|
28062
28086
|
this.#strategy = opts.strategy;
|
|
@@ -28068,7 +28092,7 @@ var Zlib = class extends ZlibBase {
|
|
|
28068
28092
|
if (!this.handle.params) throw new Error("not supported in this implementation");
|
|
28069
28093
|
/* c8 ignore stop */
|
|
28070
28094
|
if (this.#level !== level || this.#strategy !== strategy) {
|
|
28071
|
-
this.flush(constants$
|
|
28095
|
+
this.flush(constants$2.Z_SYNC_FLUSH);
|
|
28072
28096
|
assert(this.handle, "zlib binding closed");
|
|
28073
28097
|
const origFlush = this.handle.flush;
|
|
28074
28098
|
this.handle.flush = (flushFlag, cb) => {
|
|
@@ -28115,9 +28139,9 @@ var Unzip = class extends Zlib {
|
|
|
28115
28139
|
var Brotli = class extends ZlibBase {
|
|
28116
28140
|
constructor(opts, mode) {
|
|
28117
28141
|
opts = opts || {};
|
|
28118
|
-
opts.flush = opts.flush || constants$
|
|
28119
|
-
opts.finishFlush = opts.finishFlush || constants$
|
|
28120
|
-
opts.fullFlushFlag = constants$
|
|
28142
|
+
opts.flush = opts.flush || constants$2.BROTLI_OPERATION_PROCESS;
|
|
28143
|
+
opts.finishFlush = opts.finishFlush || constants$2.BROTLI_OPERATION_FINISH;
|
|
28144
|
+
opts.fullFlushFlag = constants$2.BROTLI_OPERATION_FLUSH;
|
|
28121
28145
|
super(opts, mode);
|
|
28122
28146
|
}
|
|
28123
28147
|
};
|
|
@@ -28134,9 +28158,9 @@ var BrotliDecompress = class extends Brotli {
|
|
|
28134
28158
|
var Zstd = class extends ZlibBase {
|
|
28135
28159
|
constructor(opts, mode) {
|
|
28136
28160
|
opts = opts || {};
|
|
28137
|
-
opts.flush = opts.flush || constants$
|
|
28138
|
-
opts.finishFlush = opts.finishFlush || constants$
|
|
28139
|
-
opts.fullFlushFlag = constants$
|
|
28161
|
+
opts.flush = opts.flush || constants$2.ZSTD_e_continue;
|
|
28162
|
+
opts.finishFlush = opts.finishFlush || constants$2.ZSTD_e_end;
|
|
28163
|
+
opts.fullFlushFlag = constants$2.ZSTD_e_flush;
|
|
28140
28164
|
super(opts, mode);
|
|
28141
28165
|
}
|
|
28142
28166
|
};
|
|
@@ -28522,8 +28546,8 @@ const parseKVLine = (set, line) => {
|
|
|
28522
28546
|
|
|
28523
28547
|
//#endregion
|
|
28524
28548
|
//#region node_modules/tar/dist/esm/normalize-windows-path.js
|
|
28525
|
-
const platform$
|
|
28526
|
-
const normalizeWindowsPath = platform$
|
|
28549
|
+
const platform$2 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
|
|
28550
|
+
const normalizeWindowsPath = platform$2 !== "win32" ? (p$1) => p$1 : (p$1) => p$1 && p$1.replace(/\\/g, "/");
|
|
28527
28551
|
|
|
28528
28552
|
//#endregion
|
|
28529
28553
|
//#region node_modules/tar/dist/esm/read-entry.js
|
|
@@ -30487,7 +30511,7 @@ const mkdir$1 = (dir, opt, cb) => {
|
|
|
30487
30511
|
else cb();
|
|
30488
30512
|
};
|
|
30489
30513
|
if (dir === cwd) return checkCwd(dir, done);
|
|
30490
|
-
if (preserve) return
|
|
30514
|
+
if (preserve) return fs$2.mkdir(dir, {
|
|
30491
30515
|
mode,
|
|
30492
30516
|
recursive: true
|
|
30493
30517
|
}).then((made) => done(null, made ?? void 0), done);
|
|
@@ -31120,8 +31144,8 @@ var Unpack = class extends Parser {
|
|
|
31120
31144
|
case "GNUDumpDir": return this[DIRECTORY](entry, done);
|
|
31121
31145
|
}
|
|
31122
31146
|
}
|
|
31123
|
-
[LINK](entry, linkpath, link, done) {
|
|
31124
|
-
fs[link](linkpath, String(entry.absolute), (er) => {
|
|
31147
|
+
[LINK](entry, linkpath, link$1, done) {
|
|
31148
|
+
fs[link$1](linkpath, String(entry.absolute), (er) => {
|
|
31125
31149
|
if (er) this[ONERROR](er, entry);
|
|
31126
31150
|
else {
|
|
31127
31151
|
this[UNPEND]();
|
|
@@ -31268,8 +31292,8 @@ var UnpackSync = class extends Unpack {
|
|
|
31268
31292
|
return er;
|
|
31269
31293
|
}
|
|
31270
31294
|
}
|
|
31271
|
-
[LINK](entry, linkpath, link, done) {
|
|
31272
|
-
const ls = `${link}Sync`;
|
|
31295
|
+
[LINK](entry, linkpath, link$1, done) {
|
|
31296
|
+
const ls = `${link$1}Sync`;
|
|
31273
31297
|
try {
|
|
31274
31298
|
fs[ls](linkpath, String(entry.absolute));
|
|
31275
31299
|
done();
|
|
@@ -32128,9 +32152,9 @@ const replacements = Object.entries(specialMainSymbols);
|
|
|
32128
32152
|
//#endregion
|
|
32129
32153
|
//#region node_modules/yoctocolors/base.js
|
|
32130
32154
|
const hasColors = tty?.WriteStream?.prototype?.hasColors?.() ?? false;
|
|
32131
|
-
const format = (open, close) => {
|
|
32155
|
+
const format = (open$1, close) => {
|
|
32132
32156
|
if (!hasColors) return (input) => input;
|
|
32133
|
-
const openCode = `\u001B[${open}m`;
|
|
32157
|
+
const openCode = `\u001B[${open$1}m`;
|
|
32134
32158
|
const closeCode = `\u001B[${close}m`;
|
|
32135
32159
|
return (input) => {
|
|
32136
32160
|
const string$2 = input + "";
|
|
@@ -32331,7 +32355,7 @@ const handleCommand = (filePath, rawArguments, rawOptions) => {
|
|
|
32331
32355
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32332
32356
|
module.exports = isexe;
|
|
32333
32357
|
isexe.sync = sync;
|
|
32334
|
-
var fs$
|
|
32358
|
+
var fs$5 = __require("fs");
|
|
32335
32359
|
function checkPathExt(path$17, options) {
|
|
32336
32360
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
32337
32361
|
if (!pathext) return true;
|
|
@@ -32348,12 +32372,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32348
32372
|
return checkPathExt(path$17, options);
|
|
32349
32373
|
}
|
|
32350
32374
|
function isexe(path$17, options, cb) {
|
|
32351
|
-
fs$
|
|
32375
|
+
fs$5.stat(path$17, function(er, stat) {
|
|
32352
32376
|
cb(er, er ? false : checkStat(stat, path$17, options));
|
|
32353
32377
|
});
|
|
32354
32378
|
}
|
|
32355
32379
|
function sync(path$17, options) {
|
|
32356
|
-
return checkStat(fs$
|
|
32380
|
+
return checkStat(fs$5.statSync(path$17), path$17, options);
|
|
32357
32381
|
}
|
|
32358
32382
|
}));
|
|
32359
32383
|
|
|
@@ -32362,14 +32386,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32362
32386
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32363
32387
|
module.exports = isexe;
|
|
32364
32388
|
isexe.sync = sync;
|
|
32365
|
-
var fs$
|
|
32389
|
+
var fs$4 = __require("fs");
|
|
32366
32390
|
function isexe(path$17, options, cb) {
|
|
32367
|
-
fs$
|
|
32391
|
+
fs$4.stat(path$17, function(er, stat) {
|
|
32368
32392
|
cb(er, er ? false : checkStat(stat, options));
|
|
32369
32393
|
});
|
|
32370
32394
|
}
|
|
32371
32395
|
function sync(path$17, options) {
|
|
32372
|
-
return checkStat(fs$
|
|
32396
|
+
return checkStat(fs$4.statSync(path$17), options);
|
|
32373
32397
|
}
|
|
32374
32398
|
function checkStat(stat, options) {
|
|
32375
32399
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -32592,16 +32616,16 @@ var require_shebang_command = /* @__PURE__ */ __commonJSMin(((exports, module) =
|
|
|
32592
32616
|
//#endregion
|
|
32593
32617
|
//#region node_modules/cross-spawn/lib/util/readShebang.js
|
|
32594
32618
|
var require_readShebang = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
32595
|
-
const fs$
|
|
32619
|
+
const fs$3 = __require("fs");
|
|
32596
32620
|
const shebangCommand = require_shebang_command();
|
|
32597
32621
|
function readShebang(command) {
|
|
32598
32622
|
const size = 150;
|
|
32599
32623
|
const buffer = Buffer.alloc(size);
|
|
32600
32624
|
let fd;
|
|
32601
32625
|
try {
|
|
32602
|
-
fd = fs$
|
|
32603
|
-
fs$
|
|
32604
|
-
fs$
|
|
32626
|
+
fd = fs$3.openSync(command, "r");
|
|
32627
|
+
fs$3.readSync(fd, buffer, 0, size, 0);
|
|
32628
|
+
fs$3.closeSync(fd);
|
|
32605
32629
|
} catch (e$1) {}
|
|
32606
32630
|
return shebangCommand(buffer.toString());
|
|
32607
32631
|
}
|
|
@@ -32739,8 +32763,8 @@ var require_cross_spawn = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
32739
32763
|
//#region node_modules/npm-run-path/node_modules/path-key/index.js
|
|
32740
32764
|
var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
|
|
32741
32765
|
function pathKey(options = {}) {
|
|
32742
|
-
const { env: env$1 = process.env, platform: platform$
|
|
32743
|
-
if (platform$
|
|
32766
|
+
const { env: env$1 = process.env, platform: platform$3 = process.platform } = options;
|
|
32767
|
+
if (platform$3 !== "win32") return "PATH";
|
|
32744
32768
|
return Object.keys(env$1).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
|
32745
32769
|
}
|
|
32746
32770
|
|
|
@@ -38213,7 +38237,7 @@ async function getDefaultTemplate() {
|
|
|
38213
38237
|
if (!template) throw new Error(`Default template "${DEFAULT_TEMPLATE_ID}" not found`);
|
|
38214
38238
|
return template;
|
|
38215
38239
|
}
|
|
38216
|
-
function validateNonInteractiveFlags(command) {
|
|
38240
|
+
function validateNonInteractiveFlags$1(command) {
|
|
38217
38241
|
const { name: name$1, path: path$17 } = command.opts();
|
|
38218
38242
|
const providedCount = [name$1, path$17].filter(Boolean).length;
|
|
38219
38243
|
if (providedCount > 0 && providedCount < 2) command.error("Non-interactive mode requires all flags: --name, --path");
|
|
@@ -38338,10 +38362,622 @@ async function executeCreate({ template, name: rawName, description, projectPath
|
|
|
38338
38362
|
if (finalAppUrl) M.message(`${theme.styles.header("Site")}: ${theme.colors.links(finalAppUrl)}`);
|
|
38339
38363
|
return { outroMessage: "Your project is set up and ready to use" };
|
|
38340
38364
|
}
|
|
38341
|
-
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("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags).action(async (options) => {
|
|
38365
|
+
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("--deploy", "Build and deploy the site").hook("preAction", validateNonInteractiveFlags$1).action(async (options) => {
|
|
38342
38366
|
await chooseCreate(options);
|
|
38343
38367
|
});
|
|
38344
38368
|
|
|
38369
|
+
//#endregion
|
|
38370
|
+
//#region node_modules/is-docker/index.js
|
|
38371
|
+
let isDockerCached;
|
|
38372
|
+
function hasDockerEnv() {
|
|
38373
|
+
try {
|
|
38374
|
+
fs.statSync("/.dockerenv");
|
|
38375
|
+
return true;
|
|
38376
|
+
} catch {
|
|
38377
|
+
return false;
|
|
38378
|
+
}
|
|
38379
|
+
}
|
|
38380
|
+
function hasDockerCGroup() {
|
|
38381
|
+
try {
|
|
38382
|
+
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
38383
|
+
} catch {
|
|
38384
|
+
return false;
|
|
38385
|
+
}
|
|
38386
|
+
}
|
|
38387
|
+
function isDocker() {
|
|
38388
|
+
if (isDockerCached === void 0) isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
38389
|
+
return isDockerCached;
|
|
38390
|
+
}
|
|
38391
|
+
|
|
38392
|
+
//#endregion
|
|
38393
|
+
//#region node_modules/is-inside-container/index.js
|
|
38394
|
+
let cachedResult;
|
|
38395
|
+
const hasContainerEnv = () => {
|
|
38396
|
+
try {
|
|
38397
|
+
fs.statSync("/run/.containerenv");
|
|
38398
|
+
return true;
|
|
38399
|
+
} catch {
|
|
38400
|
+
return false;
|
|
38401
|
+
}
|
|
38402
|
+
};
|
|
38403
|
+
function isInsideContainer() {
|
|
38404
|
+
if (cachedResult === void 0) cachedResult = hasContainerEnv() || isDocker();
|
|
38405
|
+
return cachedResult;
|
|
38406
|
+
}
|
|
38407
|
+
|
|
38408
|
+
//#endregion
|
|
38409
|
+
//#region node_modules/is-wsl/index.js
|
|
38410
|
+
const isWsl = () => {
|
|
38411
|
+
if (y.platform !== "linux") return false;
|
|
38412
|
+
if (os.release().toLowerCase().includes("microsoft")) {
|
|
38413
|
+
if (isInsideContainer()) return false;
|
|
38414
|
+
return true;
|
|
38415
|
+
}
|
|
38416
|
+
try {
|
|
38417
|
+
return fs.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft") ? !isInsideContainer() : false;
|
|
38418
|
+
} catch {
|
|
38419
|
+
return false;
|
|
38420
|
+
}
|
|
38421
|
+
};
|
|
38422
|
+
var is_wsl_default = y.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
38423
|
+
|
|
38424
|
+
//#endregion
|
|
38425
|
+
//#region node_modules/powershell-utils/index.js
|
|
38426
|
+
const execFile$2 = promisify(childProcess.execFile);
|
|
38427
|
+
const powerShellPath$1 = () => `${y.env.SYSTEMROOT || y.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`;
|
|
38428
|
+
const executePowerShell = async (command, options = {}) => {
|
|
38429
|
+
const { powerShellPath: psPath, ...execFileOptions } = options;
|
|
38430
|
+
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
38431
|
+
return execFile$2(psPath ?? powerShellPath$1(), [...executePowerShell.argumentsPrefix, encodedCommand], {
|
|
38432
|
+
encoding: "utf8",
|
|
38433
|
+
...execFileOptions
|
|
38434
|
+
});
|
|
38435
|
+
};
|
|
38436
|
+
executePowerShell.argumentsPrefix = [
|
|
38437
|
+
"-NoProfile",
|
|
38438
|
+
"-NonInteractive",
|
|
38439
|
+
"-ExecutionPolicy",
|
|
38440
|
+
"Bypass",
|
|
38441
|
+
"-EncodedCommand"
|
|
38442
|
+
];
|
|
38443
|
+
executePowerShell.encodeCommand = (command) => Buffer$2.from(command, "utf16le").toString("base64");
|
|
38444
|
+
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
38445
|
+
|
|
38446
|
+
//#endregion
|
|
38447
|
+
//#region node_modules/wsl-utils/utilities.js
|
|
38448
|
+
function parseMountPointFromConfig(content) {
|
|
38449
|
+
for (const line of content.split("\n")) {
|
|
38450
|
+
if (/^\s*#/.test(line)) continue;
|
|
38451
|
+
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
38452
|
+
if (!match) continue;
|
|
38453
|
+
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
38454
|
+
}
|
|
38455
|
+
}
|
|
38456
|
+
|
|
38457
|
+
//#endregion
|
|
38458
|
+
//#region node_modules/wsl-utils/index.js
|
|
38459
|
+
const execFile$1 = promisify(childProcess.execFile);
|
|
38460
|
+
const wslDrivesMountPoint = (() => {
|
|
38461
|
+
const defaultMountPoint = "/mnt/";
|
|
38462
|
+
let mountPoint;
|
|
38463
|
+
return async function() {
|
|
38464
|
+
if (mountPoint) return mountPoint;
|
|
38465
|
+
const configFilePath = "/etc/wsl.conf";
|
|
38466
|
+
let isConfigFileExists = false;
|
|
38467
|
+
try {
|
|
38468
|
+
await fs$2.access(configFilePath, constants$1.F_OK);
|
|
38469
|
+
isConfigFileExists = true;
|
|
38470
|
+
} catch {}
|
|
38471
|
+
if (!isConfigFileExists) return defaultMountPoint;
|
|
38472
|
+
const parsedMountPoint = parseMountPointFromConfig(await fs$2.readFile(configFilePath, { encoding: "utf8" }));
|
|
38473
|
+
if (parsedMountPoint === void 0) return defaultMountPoint;
|
|
38474
|
+
mountPoint = parsedMountPoint;
|
|
38475
|
+
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
38476
|
+
return mountPoint;
|
|
38477
|
+
};
|
|
38478
|
+
})();
|
|
38479
|
+
const powerShellPathFromWsl = async () => {
|
|
38480
|
+
return `${await wslDrivesMountPoint()}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
38481
|
+
};
|
|
38482
|
+
const powerShellPath = is_wsl_default ? powerShellPathFromWsl : powerShellPath$1;
|
|
38483
|
+
let canAccessPowerShellPromise;
|
|
38484
|
+
const canAccessPowerShell = async () => {
|
|
38485
|
+
canAccessPowerShellPromise ??= (async () => {
|
|
38486
|
+
try {
|
|
38487
|
+
const psPath = await powerShellPath();
|
|
38488
|
+
await fs$2.access(psPath, constants$1.X_OK);
|
|
38489
|
+
return true;
|
|
38490
|
+
} catch {
|
|
38491
|
+
return false;
|
|
38492
|
+
}
|
|
38493
|
+
})();
|
|
38494
|
+
return canAccessPowerShellPromise;
|
|
38495
|
+
};
|
|
38496
|
+
const wslDefaultBrowser = async () => {
|
|
38497
|
+
const psPath = await powerShellPath();
|
|
38498
|
+
const { stdout: stdout$1 } = await executePowerShell(String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`, { powerShellPath: psPath });
|
|
38499
|
+
return stdout$1.trim();
|
|
38500
|
+
};
|
|
38501
|
+
const convertWslPathToWindows = async (path$17) => {
|
|
38502
|
+
if (/^[a-z]+:\/\//i.test(path$17)) return path$17;
|
|
38503
|
+
try {
|
|
38504
|
+
const { stdout: stdout$1 } = await execFile$1("wslpath", ["-aw", path$17], { encoding: "utf8" });
|
|
38505
|
+
return stdout$1.trim();
|
|
38506
|
+
} catch {
|
|
38507
|
+
return path$17;
|
|
38508
|
+
}
|
|
38509
|
+
};
|
|
38510
|
+
|
|
38511
|
+
//#endregion
|
|
38512
|
+
//#region node_modules/define-lazy-prop/index.js
|
|
38513
|
+
function defineLazyProperty(object$1, propertyName, valueGetter) {
|
|
38514
|
+
const define$1 = (value) => Object.defineProperty(object$1, propertyName, {
|
|
38515
|
+
value,
|
|
38516
|
+
enumerable: true,
|
|
38517
|
+
writable: true
|
|
38518
|
+
});
|
|
38519
|
+
Object.defineProperty(object$1, propertyName, {
|
|
38520
|
+
configurable: true,
|
|
38521
|
+
enumerable: true,
|
|
38522
|
+
get() {
|
|
38523
|
+
const result = valueGetter();
|
|
38524
|
+
define$1(result);
|
|
38525
|
+
return result;
|
|
38526
|
+
},
|
|
38527
|
+
set(value) {
|
|
38528
|
+
define$1(value);
|
|
38529
|
+
}
|
|
38530
|
+
});
|
|
38531
|
+
return object$1;
|
|
38532
|
+
}
|
|
38533
|
+
|
|
38534
|
+
//#endregion
|
|
38535
|
+
//#region node_modules/default-browser-id/index.js
|
|
38536
|
+
const execFileAsync$3 = promisify(execFile);
|
|
38537
|
+
async function defaultBrowserId() {
|
|
38538
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38539
|
+
const { stdout: stdout$1 } = await execFileAsync$3("defaults", [
|
|
38540
|
+
"read",
|
|
38541
|
+
"com.apple.LaunchServices/com.apple.launchservices.secure",
|
|
38542
|
+
"LSHandlers"
|
|
38543
|
+
]);
|
|
38544
|
+
const browserId = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout$1)?.groups.id ?? "com.apple.Safari";
|
|
38545
|
+
if (browserId === "com.apple.safari") return "com.apple.Safari";
|
|
38546
|
+
return browserId;
|
|
38547
|
+
}
|
|
38548
|
+
|
|
38549
|
+
//#endregion
|
|
38550
|
+
//#region node_modules/run-applescript/index.js
|
|
38551
|
+
const execFileAsync$2 = promisify(execFile);
|
|
38552
|
+
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
38553
|
+
if (y.platform !== "darwin") throw new Error("macOS only");
|
|
38554
|
+
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
38555
|
+
const execOptions = {};
|
|
38556
|
+
if (signal) execOptions.signal = signal;
|
|
38557
|
+
const { stdout: stdout$1 } = await execFileAsync$2("osascript", [
|
|
38558
|
+
"-e",
|
|
38559
|
+
script,
|
|
38560
|
+
outputArguments
|
|
38561
|
+
], execOptions);
|
|
38562
|
+
return stdout$1.trim();
|
|
38563
|
+
}
|
|
38564
|
+
|
|
38565
|
+
//#endregion
|
|
38566
|
+
//#region node_modules/bundle-name/index.js
|
|
38567
|
+
async function bundleName(bundleId) {
|
|
38568
|
+
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string\ntell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
38569
|
+
}
|
|
38570
|
+
|
|
38571
|
+
//#endregion
|
|
38572
|
+
//#region node_modules/default-browser/windows.js
|
|
38573
|
+
const execFileAsync$1 = promisify(execFile);
|
|
38574
|
+
const windowsBrowserProgIds = {
|
|
38575
|
+
MSEdgeHTM: {
|
|
38576
|
+
name: "Edge",
|
|
38577
|
+
id: "com.microsoft.edge"
|
|
38578
|
+
},
|
|
38579
|
+
MSEdgeBHTML: {
|
|
38580
|
+
name: "Edge Beta",
|
|
38581
|
+
id: "com.microsoft.edge.beta"
|
|
38582
|
+
},
|
|
38583
|
+
MSEdgeDHTML: {
|
|
38584
|
+
name: "Edge Dev",
|
|
38585
|
+
id: "com.microsoft.edge.dev"
|
|
38586
|
+
},
|
|
38587
|
+
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: {
|
|
38588
|
+
name: "Edge",
|
|
38589
|
+
id: "com.microsoft.edge.old"
|
|
38590
|
+
},
|
|
38591
|
+
ChromeHTML: {
|
|
38592
|
+
name: "Chrome",
|
|
38593
|
+
id: "com.google.chrome"
|
|
38594
|
+
},
|
|
38595
|
+
ChromeBHTML: {
|
|
38596
|
+
name: "Chrome Beta",
|
|
38597
|
+
id: "com.google.chrome.beta"
|
|
38598
|
+
},
|
|
38599
|
+
ChromeDHTML: {
|
|
38600
|
+
name: "Chrome Dev",
|
|
38601
|
+
id: "com.google.chrome.dev"
|
|
38602
|
+
},
|
|
38603
|
+
ChromiumHTM: {
|
|
38604
|
+
name: "Chromium",
|
|
38605
|
+
id: "org.chromium.Chromium"
|
|
38606
|
+
},
|
|
38607
|
+
BraveHTML: {
|
|
38608
|
+
name: "Brave",
|
|
38609
|
+
id: "com.brave.Browser"
|
|
38610
|
+
},
|
|
38611
|
+
BraveBHTML: {
|
|
38612
|
+
name: "Brave Beta",
|
|
38613
|
+
id: "com.brave.Browser.beta"
|
|
38614
|
+
},
|
|
38615
|
+
BraveDHTML: {
|
|
38616
|
+
name: "Brave Dev",
|
|
38617
|
+
id: "com.brave.Browser.dev"
|
|
38618
|
+
},
|
|
38619
|
+
BraveSSHTM: {
|
|
38620
|
+
name: "Brave Nightly",
|
|
38621
|
+
id: "com.brave.Browser.nightly"
|
|
38622
|
+
},
|
|
38623
|
+
FirefoxURL: {
|
|
38624
|
+
name: "Firefox",
|
|
38625
|
+
id: "org.mozilla.firefox"
|
|
38626
|
+
},
|
|
38627
|
+
OperaStable: {
|
|
38628
|
+
name: "Opera",
|
|
38629
|
+
id: "com.operasoftware.Opera"
|
|
38630
|
+
},
|
|
38631
|
+
VivaldiHTM: {
|
|
38632
|
+
name: "Vivaldi",
|
|
38633
|
+
id: "com.vivaldi.Vivaldi"
|
|
38634
|
+
},
|
|
38635
|
+
"IE.HTTP": {
|
|
38636
|
+
name: "Internet Explorer",
|
|
38637
|
+
id: "com.microsoft.ie"
|
|
38638
|
+
}
|
|
38639
|
+
};
|
|
38640
|
+
const _windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
38641
|
+
var UnknownBrowserError = class extends Error {};
|
|
38642
|
+
async function defaultBrowser$1(_execFileAsync = execFileAsync$1) {
|
|
38643
|
+
const { stdout: stdout$1 } = await _execFileAsync("reg", [
|
|
38644
|
+
"QUERY",
|
|
38645
|
+
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
38646
|
+
"/v",
|
|
38647
|
+
"ProgId"
|
|
38648
|
+
]);
|
|
38649
|
+
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout$1);
|
|
38650
|
+
if (!match) throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout$1)}`);
|
|
38651
|
+
const { id } = match.groups;
|
|
38652
|
+
const browser = windowsBrowserProgIds[id];
|
|
38653
|
+
if (!browser) throw new UnknownBrowserError(`Unknown browser ID: ${id}`);
|
|
38654
|
+
return browser;
|
|
38655
|
+
}
|
|
38656
|
+
|
|
38657
|
+
//#endregion
|
|
38658
|
+
//#region node_modules/default-browser/index.js
|
|
38659
|
+
const execFileAsync = promisify(execFile);
|
|
38660
|
+
const titleize = (string$2) => string$2.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x$2) => x$2.toUpperCase());
|
|
38661
|
+
async function defaultBrowser() {
|
|
38662
|
+
if (y.platform === "darwin") {
|
|
38663
|
+
const id = await defaultBrowserId();
|
|
38664
|
+
return {
|
|
38665
|
+
name: await bundleName(id),
|
|
38666
|
+
id
|
|
38667
|
+
};
|
|
38668
|
+
}
|
|
38669
|
+
if (y.platform === "linux") {
|
|
38670
|
+
const { stdout: stdout$1 } = await execFileAsync("xdg-mime", [
|
|
38671
|
+
"query",
|
|
38672
|
+
"default",
|
|
38673
|
+
"x-scheme-handler/http"
|
|
38674
|
+
]);
|
|
38675
|
+
const id = stdout$1.trim();
|
|
38676
|
+
return {
|
|
38677
|
+
name: titleize(id.replace(/.desktop$/, "").replace("-", " ")),
|
|
38678
|
+
id
|
|
38679
|
+
};
|
|
38680
|
+
}
|
|
38681
|
+
if (y.platform === "win32") return defaultBrowser$1();
|
|
38682
|
+
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
38683
|
+
}
|
|
38684
|
+
|
|
38685
|
+
//#endregion
|
|
38686
|
+
//#region node_modules/is-in-ssh/index.js
|
|
38687
|
+
const isInSsh = Boolean(y.env.SSH_CONNECTION || y.env.SSH_CLIENT || y.env.SSH_TTY);
|
|
38688
|
+
var is_in_ssh_default = isInSsh;
|
|
38689
|
+
|
|
38690
|
+
//#endregion
|
|
38691
|
+
//#region node_modules/open/index.js
|
|
38692
|
+
const fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
38693
|
+
const __dirname = import.meta.url ? path.dirname(fileURLToPath(import.meta.url)) : "";
|
|
38694
|
+
const localXdgOpenPath = path.join(__dirname, "xdg-open");
|
|
38695
|
+
const { platform: platform$1, arch } = y;
|
|
38696
|
+
const tryEachApp = async (apps$1, opener) => {
|
|
38697
|
+
if (apps$1.length === 0) return;
|
|
38698
|
+
const errors = [];
|
|
38699
|
+
for (const app of apps$1) try {
|
|
38700
|
+
return await opener(app);
|
|
38701
|
+
} catch (error) {
|
|
38702
|
+
errors.push(error);
|
|
38703
|
+
}
|
|
38704
|
+
throw new AggregateError(errors, "Failed to open in all supported apps");
|
|
38705
|
+
};
|
|
38706
|
+
const baseOpen = async (options) => {
|
|
38707
|
+
options = {
|
|
38708
|
+
wait: false,
|
|
38709
|
+
background: false,
|
|
38710
|
+
newInstance: false,
|
|
38711
|
+
allowNonzeroExitCode: false,
|
|
38712
|
+
...options
|
|
38713
|
+
};
|
|
38714
|
+
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
38715
|
+
delete options[fallbackAttemptSymbol];
|
|
38716
|
+
if (Array.isArray(options.app)) return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
38717
|
+
...options,
|
|
38718
|
+
app: singleApp,
|
|
38719
|
+
[fallbackAttemptSymbol]: true
|
|
38720
|
+
}));
|
|
38721
|
+
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
38722
|
+
appArguments = [...appArguments];
|
|
38723
|
+
if (Array.isArray(app)) return tryEachApp(app, (appName) => baseOpen({
|
|
38724
|
+
...options,
|
|
38725
|
+
app: {
|
|
38726
|
+
name: appName,
|
|
38727
|
+
arguments: appArguments
|
|
38728
|
+
},
|
|
38729
|
+
[fallbackAttemptSymbol]: true
|
|
38730
|
+
}));
|
|
38731
|
+
if (app === "browser" || app === "browserPrivate") {
|
|
38732
|
+
const ids = {
|
|
38733
|
+
"com.google.chrome": "chrome",
|
|
38734
|
+
"google-chrome.desktop": "chrome",
|
|
38735
|
+
"com.brave.browser": "brave",
|
|
38736
|
+
"org.mozilla.firefox": "firefox",
|
|
38737
|
+
"firefox.desktop": "firefox",
|
|
38738
|
+
"com.microsoft.msedge": "edge",
|
|
38739
|
+
"com.microsoft.edge": "edge",
|
|
38740
|
+
"com.microsoft.edgemac": "edge",
|
|
38741
|
+
"microsoft-edge.desktop": "edge",
|
|
38742
|
+
"com.apple.safari": "safari"
|
|
38743
|
+
};
|
|
38744
|
+
const flags = {
|
|
38745
|
+
chrome: "--incognito",
|
|
38746
|
+
brave: "--incognito",
|
|
38747
|
+
firefox: "--private-window",
|
|
38748
|
+
edge: "--inPrivate"
|
|
38749
|
+
};
|
|
38750
|
+
let browser;
|
|
38751
|
+
if (is_wsl_default) {
|
|
38752
|
+
const progId = await wslDefaultBrowser();
|
|
38753
|
+
browser = _windowsBrowserProgIdMap.get(progId) ?? {};
|
|
38754
|
+
} else browser = await defaultBrowser();
|
|
38755
|
+
if (browser.id in ids) {
|
|
38756
|
+
const browserName = ids[browser.id.toLowerCase()];
|
|
38757
|
+
if (app === "browserPrivate") {
|
|
38758
|
+
if (browserName === "safari") throw new Error("Safari doesn't support opening in private mode via command line");
|
|
38759
|
+
appArguments.push(flags[browserName]);
|
|
38760
|
+
}
|
|
38761
|
+
return baseOpen({
|
|
38762
|
+
...options,
|
|
38763
|
+
app: {
|
|
38764
|
+
name: apps[browserName],
|
|
38765
|
+
arguments: appArguments
|
|
38766
|
+
}
|
|
38767
|
+
});
|
|
38768
|
+
}
|
|
38769
|
+
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
38770
|
+
}
|
|
38771
|
+
let command;
|
|
38772
|
+
const cliArguments = [];
|
|
38773
|
+
const childProcessOptions = {};
|
|
38774
|
+
let shouldUseWindowsInWsl = false;
|
|
38775
|
+
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
38776
|
+
if (platform$1 === "darwin") {
|
|
38777
|
+
command = "open";
|
|
38778
|
+
if (options.wait) cliArguments.push("--wait-apps");
|
|
38779
|
+
if (options.background) cliArguments.push("--background");
|
|
38780
|
+
if (options.newInstance) cliArguments.push("--new");
|
|
38781
|
+
if (app) cliArguments.push("-a", app);
|
|
38782
|
+
} else if (platform$1 === "win32" || shouldUseWindowsInWsl) {
|
|
38783
|
+
command = await powerShellPath();
|
|
38784
|
+
cliArguments.push(...executePowerShell.argumentsPrefix);
|
|
38785
|
+
if (!is_wsl_default) childProcessOptions.windowsVerbatimArguments = true;
|
|
38786
|
+
if (is_wsl_default && options.target) options.target = await convertWslPathToWindows(options.target);
|
|
38787
|
+
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
38788
|
+
if (options.wait) encodedArguments.push("-Wait");
|
|
38789
|
+
if (app) {
|
|
38790
|
+
encodedArguments.push(executePowerShell.escapeArgument(app));
|
|
38791
|
+
if (options.target) appArguments.push(options.target);
|
|
38792
|
+
} else if (options.target) encodedArguments.push(executePowerShell.escapeArgument(options.target));
|
|
38793
|
+
if (appArguments.length > 0) {
|
|
38794
|
+
appArguments = appArguments.map((argument) => executePowerShell.escapeArgument(argument));
|
|
38795
|
+
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
38796
|
+
}
|
|
38797
|
+
options.target = executePowerShell.encodeCommand(encodedArguments.join(" "));
|
|
38798
|
+
if (!options.wait) childProcessOptions.stdio = "ignore";
|
|
38799
|
+
} else {
|
|
38800
|
+
if (app) command = app;
|
|
38801
|
+
else {
|
|
38802
|
+
const isBundled = !__dirname || __dirname === "/";
|
|
38803
|
+
let exeLocalXdgOpen = false;
|
|
38804
|
+
try {
|
|
38805
|
+
await fs$2.access(localXdgOpenPath, constants$1.X_OK);
|
|
38806
|
+
exeLocalXdgOpen = true;
|
|
38807
|
+
} catch {}
|
|
38808
|
+
command = y.versions.electron ?? (platform$1 === "android" || isBundled || !exeLocalXdgOpen) ? "xdg-open" : localXdgOpenPath;
|
|
38809
|
+
}
|
|
38810
|
+
if (appArguments.length > 0) cliArguments.push(...appArguments);
|
|
38811
|
+
if (!options.wait) {
|
|
38812
|
+
childProcessOptions.stdio = "ignore";
|
|
38813
|
+
childProcessOptions.detached = true;
|
|
38814
|
+
}
|
|
38815
|
+
}
|
|
38816
|
+
if (platform$1 === "darwin" && appArguments.length > 0) cliArguments.push("--args", ...appArguments);
|
|
38817
|
+
if (options.target) cliArguments.push(options.target);
|
|
38818
|
+
const subprocess = childProcess.spawn(command, cliArguments, childProcessOptions);
|
|
38819
|
+
if (options.wait) return new Promise((resolve$1, reject) => {
|
|
38820
|
+
subprocess.once("error", reject);
|
|
38821
|
+
subprocess.once("close", (exitCode) => {
|
|
38822
|
+
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
38823
|
+
reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
|
|
38824
|
+
return;
|
|
38825
|
+
}
|
|
38826
|
+
resolve$1(subprocess);
|
|
38827
|
+
});
|
|
38828
|
+
});
|
|
38829
|
+
if (isFallbackAttempt) return new Promise((resolve$1, reject) => {
|
|
38830
|
+
subprocess.once("error", reject);
|
|
38831
|
+
subprocess.once("spawn", () => {
|
|
38832
|
+
subprocess.once("close", (exitCode) => {
|
|
38833
|
+
subprocess.off("error", reject);
|
|
38834
|
+
if (exitCode !== 0) {
|
|
38835
|
+
reject(/* @__PURE__ */ new Error(`Exited with code ${exitCode}`));
|
|
38836
|
+
return;
|
|
38837
|
+
}
|
|
38838
|
+
subprocess.unref();
|
|
38839
|
+
resolve$1(subprocess);
|
|
38840
|
+
});
|
|
38841
|
+
});
|
|
38842
|
+
});
|
|
38843
|
+
subprocess.unref();
|
|
38844
|
+
return new Promise((resolve$1, reject) => {
|
|
38845
|
+
subprocess.once("error", reject);
|
|
38846
|
+
subprocess.once("spawn", () => {
|
|
38847
|
+
subprocess.off("error", reject);
|
|
38848
|
+
resolve$1(subprocess);
|
|
38849
|
+
});
|
|
38850
|
+
});
|
|
38851
|
+
};
|
|
38852
|
+
const open = (target, options) => {
|
|
38853
|
+
if (typeof target !== "string") throw new TypeError("Expected a `target`");
|
|
38854
|
+
return baseOpen({
|
|
38855
|
+
...options,
|
|
38856
|
+
target
|
|
38857
|
+
});
|
|
38858
|
+
};
|
|
38859
|
+
function detectArchBinary(binary) {
|
|
38860
|
+
if (typeof binary === "string" || Array.isArray(binary)) return binary;
|
|
38861
|
+
const { [arch]: archBinary } = binary;
|
|
38862
|
+
if (!archBinary) throw new Error(`${arch} is not supported`);
|
|
38863
|
+
return archBinary;
|
|
38864
|
+
}
|
|
38865
|
+
function detectPlatformBinary({ [platform$1]: platformBinary }, { wsl } = {}) {
|
|
38866
|
+
if (wsl && is_wsl_default) return detectArchBinary(wsl);
|
|
38867
|
+
if (!platformBinary) throw new Error(`${platform$1} is not supported`);
|
|
38868
|
+
return detectArchBinary(platformBinary);
|
|
38869
|
+
}
|
|
38870
|
+
const apps = {
|
|
38871
|
+
browser: "browser",
|
|
38872
|
+
browserPrivate: "browserPrivate"
|
|
38873
|
+
};
|
|
38874
|
+
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
38875
|
+
darwin: "google chrome",
|
|
38876
|
+
win32: "chrome",
|
|
38877
|
+
linux: [
|
|
38878
|
+
"google-chrome",
|
|
38879
|
+
"google-chrome-stable",
|
|
38880
|
+
"chromium",
|
|
38881
|
+
"chromium-browser"
|
|
38882
|
+
]
|
|
38883
|
+
}, { wsl: {
|
|
38884
|
+
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
38885
|
+
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
38886
|
+
} }));
|
|
38887
|
+
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
38888
|
+
darwin: "brave browser",
|
|
38889
|
+
win32: "brave",
|
|
38890
|
+
linux: ["brave-browser", "brave"]
|
|
38891
|
+
}, { wsl: {
|
|
38892
|
+
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
38893
|
+
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
38894
|
+
} }));
|
|
38895
|
+
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
38896
|
+
darwin: "firefox",
|
|
38897
|
+
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
38898
|
+
linux: "firefox"
|
|
38899
|
+
}, { wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe" }));
|
|
38900
|
+
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
38901
|
+
darwin: "microsoft edge",
|
|
38902
|
+
win32: "msedge",
|
|
38903
|
+
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
38904
|
+
}, { wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe" }));
|
|
38905
|
+
defineLazyProperty(apps, "safari", () => detectPlatformBinary({ darwin: "Safari" }));
|
|
38906
|
+
var open_default = open;
|
|
38907
|
+
|
|
38908
|
+
//#endregion
|
|
38909
|
+
//#region src/cli/commands/project/dashboard.ts
|
|
38910
|
+
async function openDashboard() {
|
|
38911
|
+
await loadProjectEnv();
|
|
38912
|
+
const projectId = getBase44ClientId();
|
|
38913
|
+
if (!projectId) throw new Error("App not configured. BASE44_CLIENT_ID environment variable is required. Set it in your .env.local file.");
|
|
38914
|
+
const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/workspace/overview`;
|
|
38915
|
+
await open_default(dashboardUrl);
|
|
38916
|
+
return { outroMessage: `Dashboard opened at ${dashboardUrl}` };
|
|
38917
|
+
}
|
|
38918
|
+
const dashboardCommand = new Command("dashboard").description("Open the app dashboard in your browser").action(async () => {
|
|
38919
|
+
await runCommand(openDashboard, { requireAuth: true });
|
|
38920
|
+
});
|
|
38921
|
+
|
|
38922
|
+
//#endregion
|
|
38923
|
+
//#region src/cli/commands/project/link.ts
|
|
38924
|
+
function validateNonInteractiveFlags(command) {
|
|
38925
|
+
const { create: create$1, name: name$1 } = command.opts();
|
|
38926
|
+
if (create$1 && !name$1) command.error("--name is required when using --create");
|
|
38927
|
+
}
|
|
38928
|
+
async function promptForProjectDetails() {
|
|
38929
|
+
const actionOptions = [{
|
|
38930
|
+
value: "create",
|
|
38931
|
+
label: "Create a new project",
|
|
38932
|
+
hint: "Create a new Base44 project and link it"
|
|
38933
|
+
}];
|
|
38934
|
+
const result = await Ce({
|
|
38935
|
+
action: () => ve({
|
|
38936
|
+
message: "How would you like to link this project?",
|
|
38937
|
+
options: actionOptions
|
|
38938
|
+
}),
|
|
38939
|
+
name: () => {
|
|
38940
|
+
return he({
|
|
38941
|
+
message: "What is the name of your project?",
|
|
38942
|
+
placeholder: "my-app",
|
|
38943
|
+
validate: (value) => {
|
|
38944
|
+
if (!value || value.trim().length === 0) return "Project name is required";
|
|
38945
|
+
}
|
|
38946
|
+
});
|
|
38947
|
+
},
|
|
38948
|
+
description: () => he({
|
|
38949
|
+
message: "Description (optional)",
|
|
38950
|
+
placeholder: "A brief description of your project"
|
|
38951
|
+
})
|
|
38952
|
+
}, { onCancel: onPromptCancel });
|
|
38953
|
+
return {
|
|
38954
|
+
name: result.name.trim(),
|
|
38955
|
+
description: result.description ? result.description.trim() : void 0
|
|
38956
|
+
};
|
|
38957
|
+
}
|
|
38958
|
+
async function link(options) {
|
|
38959
|
+
const projectRoot = await findProjectRoot();
|
|
38960
|
+
if (!projectRoot) throw new Error("No Base44 project found. Run this command from a project directory with a config.jsonc file.");
|
|
38961
|
+
if (await envLocalExists(projectRoot.root)) throw new Error("Project is already linked. A .env.local file with BASE44_CLIENT_ID already exists.");
|
|
38962
|
+
const { name: name$1, description } = options.create ? {
|
|
38963
|
+
name: options.name.trim(),
|
|
38964
|
+
description: options.description?.trim()
|
|
38965
|
+
} : await promptForProjectDetails();
|
|
38966
|
+
const { projectId } = await runTask("Creating project on Base44...", async () => {
|
|
38967
|
+
return await createProject(name$1, description);
|
|
38968
|
+
}, {
|
|
38969
|
+
successMessage: "Project created successfully",
|
|
38970
|
+
errorMessage: "Failed to create project"
|
|
38971
|
+
});
|
|
38972
|
+
await writeEnvLocal(projectRoot.root, projectId);
|
|
38973
|
+
const dashboardUrl = `${getBase44ApiUrl()}/apps/${projectId}/editor/workspace/overview`;
|
|
38974
|
+
M.message(`${theme.styles.header("Dashboard")}: ${theme.colors.links(dashboardUrl)}`);
|
|
38975
|
+
return { outroMessage: "Project linked" };
|
|
38976
|
+
}
|
|
38977
|
+
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) => {
|
|
38978
|
+
await runCommand(() => link(options), { requireAuth: true });
|
|
38979
|
+
});
|
|
38980
|
+
|
|
38345
38981
|
//#endregion
|
|
38346
38982
|
//#region src/cli/commands/site/deploy.ts
|
|
38347
38983
|
async function deployAction(options) {
|
|
@@ -38365,16 +39001,19 @@ const siteDeployCommand = new Command("site").description("Manage site deploymen
|
|
|
38365
39001
|
|
|
38366
39002
|
//#endregion
|
|
38367
39003
|
//#region package.json
|
|
38368
|
-
var version = "0.0.
|
|
39004
|
+
var version = "0.0.12";
|
|
38369
39005
|
|
|
38370
39006
|
//#endregion
|
|
38371
39007
|
//#region src/cli/index.ts
|
|
38372
39008
|
const program = new Command();
|
|
38373
39009
|
program.name("base44").description("Base44 CLI - Unified interface for managing Base44 applications").version(version);
|
|
39010
|
+
program.configureHelp({ sortSubcommands: true });
|
|
38374
39011
|
program.addCommand(loginCommand);
|
|
38375
39012
|
program.addCommand(whoamiCommand);
|
|
38376
39013
|
program.addCommand(logoutCommand);
|
|
38377
39014
|
program.addCommand(createCommand);
|
|
39015
|
+
program.addCommand(dashboardCommand);
|
|
39016
|
+
program.addCommand(linkCommand);
|
|
38378
39017
|
program.addCommand(entitiesPushCommand);
|
|
38379
39018
|
program.addCommand(functionsDeployCommand);
|
|
38380
39019
|
program.addCommand(siteDeployCommand);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "base44",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.12",
|
|
4
4
|
"description": "Base44 CLI - Unified interface for managing Base44 applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/cli/index.js",
|
|
@@ -61,7 +61,8 @@
|
|
|
61
61
|
"typescript": "^5.7.2",
|
|
62
62
|
"typescript-eslint": "^8.52.0",
|
|
63
63
|
"vitest": "^4.0.16",
|
|
64
|
-
"zod": "^4.3.5"
|
|
64
|
+
"zod": "^4.3.5",
|
|
65
|
+
"open": "^11.0.0"
|
|
65
66
|
},
|
|
66
67
|
"engines": {
|
|
67
68
|
"node": ">=20.19.0"
|