@base44-preview/cli 0.0.37-pr.365.600b1d5 → 0.0.38-pr.330.d128357
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 +609 -286
- package/dist/cli/index.js.map +25 -20
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -8933,10 +8933,10 @@ var require_ejs = __commonJS((exports) => {
|
|
|
8933
8933
|
exports.localsName = _DEFAULT_LOCALS_NAME;
|
|
8934
8934
|
exports.promiseImpl = new Function("return this;")().Promise;
|
|
8935
8935
|
exports.resolveInclude = function(name2, filename, isDir) {
|
|
8936
|
-
var
|
|
8936
|
+
var dirname7 = path11.dirname;
|
|
8937
8937
|
var extname = path11.extname;
|
|
8938
8938
|
var resolve = path11.resolve;
|
|
8939
|
-
var includePath = resolve(isDir ? filename :
|
|
8939
|
+
var includePath = resolve(isDir ? filename : dirname7(filename), name2);
|
|
8940
8940
|
var ext = extname(name2);
|
|
8941
8941
|
if (!ext) {
|
|
8942
8942
|
includePath += ".ejs";
|
|
@@ -12652,8 +12652,8 @@ var require_main = __commonJS((exports, module) => {
|
|
|
12652
12652
|
const shortPaths = [];
|
|
12653
12653
|
for (const filePath of optionPaths) {
|
|
12654
12654
|
try {
|
|
12655
|
-
const
|
|
12656
|
-
shortPaths.push(
|
|
12655
|
+
const relative3 = path11.relative(process.cwd(), filePath);
|
|
12656
|
+
shortPaths.push(relative3);
|
|
12657
12657
|
} catch (e2) {
|
|
12658
12658
|
if (debug) {
|
|
12659
12659
|
_debug(`Failed to load ${filePath} ${e2.message}`);
|
|
@@ -18040,7 +18040,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18040
18040
|
}
|
|
18041
18041
|
return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : [];
|
|
18042
18042
|
});
|
|
18043
|
-
function
|
|
18043
|
+
function join14(array2, separator) {
|
|
18044
18044
|
return array2 == null ? "" : nativeJoin.call(array2, separator);
|
|
18045
18045
|
}
|
|
18046
18046
|
function last(array2) {
|
|
@@ -18062,7 +18062,7 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
18062
18062
|
function nth(array2, n2) {
|
|
18063
18063
|
return array2 && array2.length ? baseNth(array2, toInteger(n2)) : undefined2;
|
|
18064
18064
|
}
|
|
18065
|
-
var
|
|
18065
|
+
var pull2 = baseRest(pullAll);
|
|
18066
18066
|
function pullAll(array2, values2) {
|
|
18067
18067
|
return array2 && array2.length && values2 && values2.length ? basePullAll(array2, values2) : array2;
|
|
18068
18068
|
}
|
|
@@ -19827,7 +19827,7 @@ __p += '`;
|
|
|
19827
19827
|
lodash.pickBy = pickBy;
|
|
19828
19828
|
lodash.property = property;
|
|
19829
19829
|
lodash.propertyOf = propertyOf;
|
|
19830
|
-
lodash.pull =
|
|
19830
|
+
lodash.pull = pull2;
|
|
19831
19831
|
lodash.pullAll = pullAll;
|
|
19832
19832
|
lodash.pullAllBy = pullAllBy;
|
|
19833
19833
|
lodash.pullAllWith = pullAllWith;
|
|
@@ -19972,7 +19972,7 @@ __p += '`;
|
|
|
19972
19972
|
lodash.isUndefined = isUndefined;
|
|
19973
19973
|
lodash.isWeakMap = isWeakMap;
|
|
19974
19974
|
lodash.isWeakSet = isWeakSet;
|
|
19975
|
-
lodash.join =
|
|
19975
|
+
lodash.join = join14;
|
|
19976
19976
|
lodash.kebabCase = kebabCase2;
|
|
19977
19977
|
lodash.last = last;
|
|
19978
19978
|
lodash.lastIndexOf = lastIndexOf;
|
|
@@ -20601,7 +20601,7 @@ function cleanDoc(doc2) {
|
|
|
20601
20601
|
return mapDoc(doc2, (currentDoc) => cleanDocFn(currentDoc));
|
|
20602
20602
|
}
|
|
20603
20603
|
function replaceEndOfLine(doc2, replacement = literalline) {
|
|
20604
|
-
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
20604
|
+
return mapDoc(doc2, (currentDoc) => typeof currentDoc === "string" ? join14(replacement, currentDoc.split(`
|
|
20605
20605
|
`)) : currentDoc);
|
|
20606
20606
|
}
|
|
20607
20607
|
function canBreakFn(doc2) {
|
|
@@ -20681,7 +20681,7 @@ function indentIfBreak(contents, options) {
|
|
|
20681
20681
|
negate: options.negate
|
|
20682
20682
|
};
|
|
20683
20683
|
}
|
|
20684
|
-
function
|
|
20684
|
+
function join14(separator, docs) {
|
|
20685
20685
|
assertDoc(separator);
|
|
20686
20686
|
assertDocArray(docs);
|
|
20687
20687
|
const parts = [];
|
|
@@ -21392,7 +21392,7 @@ var init_doc = __esm(() => {
|
|
|
21392
21392
|
MODE_FLAT = Symbol("MODE_FLAT");
|
|
21393
21393
|
DOC_FILL_PRINTED_LENGTH = Symbol("DOC_FILL_PRINTED_LENGTH");
|
|
21394
21394
|
builders = {
|
|
21395
|
-
join:
|
|
21395
|
+
join: join14,
|
|
21396
21396
|
line,
|
|
21397
21397
|
softline,
|
|
21398
21398
|
hardline,
|
|
@@ -110477,9 +110477,9 @@ function getMessage2(key2, parameters, self2) {
|
|
|
110477
110477
|
assert22.ok(message.length <= parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
|
|
110478
110478
|
return Reflect.apply(message, self2, parameters);
|
|
110479
110479
|
}
|
|
110480
|
-
const
|
|
110480
|
+
const regex = /%[dfijoOs]/g;
|
|
110481
110481
|
let expectedLength = 0;
|
|
110482
|
-
while (
|
|
110482
|
+
while (regex.exec(message) !== null)
|
|
110483
110483
|
expectedLength++;
|
|
110484
110484
|
assert22.ok(expectedLength === parameters.length, `Code: ${key2}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
|
|
110485
110485
|
if (parameters.length === 0)
|
|
@@ -111380,9 +111380,9 @@ function convertEndOfLineOptionToCharacter2(endOfLineOption) {
|
|
|
111380
111380
|
return endOfLineOption === OPTION_CR2 ? CHARACTER_CR2 : endOfLineOption === OPTION_CRLF2 ? CHARACTER_CRLF2 : DEFAULT_EOL2;
|
|
111381
111381
|
}
|
|
111382
111382
|
function countEndOfLineCharacters(text, endOfLineCharacter) {
|
|
111383
|
-
const
|
|
111383
|
+
const regex = regexps.get(endOfLineCharacter);
|
|
111384
111384
|
if (false) {}
|
|
111385
|
-
return text.match(
|
|
111385
|
+
return text.match(regex)?.length ?? 0;
|
|
111386
111386
|
}
|
|
111387
111387
|
function normalizeEndOfLine(text) {
|
|
111388
111388
|
return method_replace_all_default2(0, text, END_OF_LINE_REGEXP, CHARACTER_LF2);
|
|
@@ -113584,8 +113584,8 @@ function legacyIsNextLineEmpty(text, node, locEnd) {
|
|
|
113584
113584
|
}
|
|
113585
113585
|
function makeString(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
113586
113586
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
113587
|
-
const
|
|
113588
|
-
const raw2 = method_replace_all_default2(0, rawText,
|
|
113587
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
113588
|
+
const raw2 = method_replace_all_default2(0, rawText, regex, (match, escaped, quote) => {
|
|
113589
113589
|
if (escaped === otherQuote) {
|
|
113590
113590
|
return escaped;
|
|
113591
113591
|
}
|
|
@@ -117006,17 +117006,17 @@ var init_prettier = __esm(() => {
|
|
|
117006
117006
|
}
|
|
117007
117007
|
const opts = options8 || {};
|
|
117008
117008
|
const posix = utils3.isWindows(options8);
|
|
117009
|
-
const
|
|
117010
|
-
const state =
|
|
117011
|
-
delete
|
|
117009
|
+
const regex = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
|
|
117010
|
+
const state = regex.state;
|
|
117011
|
+
delete regex.state;
|
|
117012
117012
|
let isIgnored2 = () => false;
|
|
117013
117013
|
if (opts.ignore) {
|
|
117014
117014
|
const ignoreOpts = { ...options8, ignore: null, onMatch: null, onResult: null };
|
|
117015
117015
|
isIgnored2 = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
117016
117016
|
}
|
|
117017
117017
|
const matcher = (input, returnObject = false) => {
|
|
117018
|
-
const { isMatch, match, output } = picomatch.test(input,
|
|
117019
|
-
const result = { glob, state, regex
|
|
117018
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options8, { glob, posix });
|
|
117019
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
117020
117020
|
if (typeof opts.onResult === "function") {
|
|
117021
117021
|
opts.onResult(result);
|
|
117022
117022
|
}
|
|
@@ -117041,7 +117041,7 @@ var init_prettier = __esm(() => {
|
|
|
117041
117041
|
}
|
|
117042
117042
|
return matcher;
|
|
117043
117043
|
};
|
|
117044
|
-
picomatch.test = (input,
|
|
117044
|
+
picomatch.test = (input, regex, options8, { glob, posix } = {}) => {
|
|
117045
117045
|
if (typeof input !== "string") {
|
|
117046
117046
|
throw new TypeError("Expected input to be a string");
|
|
117047
117047
|
}
|
|
@@ -117058,16 +117058,16 @@ var init_prettier = __esm(() => {
|
|
|
117058
117058
|
}
|
|
117059
117059
|
if (match === false || opts.capture === true) {
|
|
117060
117060
|
if (opts.matchBase === true || opts.basename === true) {
|
|
117061
|
-
match = picomatch.matchBase(input,
|
|
117061
|
+
match = picomatch.matchBase(input, regex, options8, posix);
|
|
117062
117062
|
} else {
|
|
117063
|
-
match =
|
|
117063
|
+
match = regex.exec(output);
|
|
117064
117064
|
}
|
|
117065
117065
|
}
|
|
117066
117066
|
return { isMatch: Boolean(match), match, output };
|
|
117067
117067
|
};
|
|
117068
117068
|
picomatch.matchBase = (input, glob, options8, posix = utils3.isWindows(options8)) => {
|
|
117069
|
-
const
|
|
117070
|
-
return
|
|
117069
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
|
|
117070
|
+
return regex.test(path152.basename(input));
|
|
117071
117071
|
};
|
|
117072
117072
|
picomatch.isMatch = (str, patterns, options8) => picomatch(patterns, options8)(str);
|
|
117073
117073
|
picomatch.parse = (pattern, options8) => {
|
|
@@ -117087,11 +117087,11 @@ var init_prettier = __esm(() => {
|
|
|
117087
117087
|
if (state && state.negated === true) {
|
|
117088
117088
|
source2 = `^(?!${source2}).*$`;
|
|
117089
117089
|
}
|
|
117090
|
-
const
|
|
117090
|
+
const regex = picomatch.toRegex(source2, options8);
|
|
117091
117091
|
if (returnState === true) {
|
|
117092
|
-
|
|
117092
|
+
regex.state = state;
|
|
117093
117093
|
}
|
|
117094
|
-
return
|
|
117094
|
+
return regex;
|
|
117095
117095
|
};
|
|
117096
117096
|
picomatch.makeRe = (input, options8 = {}, returnOutput = false, returnState = false) => {
|
|
117097
117097
|
if (!input || typeof input !== "string") {
|
|
@@ -117255,8 +117255,8 @@ var init_prettier = __esm(() => {
|
|
|
117255
117255
|
};
|
|
117256
117256
|
micromatch2.capture = (glob, input, options8) => {
|
|
117257
117257
|
let posix = utils3.isWindows(options8);
|
|
117258
|
-
let
|
|
117259
|
-
let match =
|
|
117258
|
+
let regex = picomatch.makeRe(String(glob), { ...options8, capture: true });
|
|
117259
|
+
let match = regex.exec(posix ? utils3.toPosixSlashes(input) : input);
|
|
117260
117260
|
if (match) {
|
|
117261
117261
|
return match.slice(1).map((v10) => v10 === undefined ? "" : v10);
|
|
117262
117262
|
}
|
|
@@ -117434,15 +117434,15 @@ var init_prettier = __esm(() => {
|
|
|
117434
117434
|
exports.removeDuplicateSlashes = removeDuplicateSlashes;
|
|
117435
117435
|
function partitionAbsoluteAndRelative(patterns) {
|
|
117436
117436
|
const absolute = [];
|
|
117437
|
-
const
|
|
117437
|
+
const relative22 = [];
|
|
117438
117438
|
for (const pattern of patterns) {
|
|
117439
117439
|
if (isAbsolute2(pattern)) {
|
|
117440
117440
|
absolute.push(pattern);
|
|
117441
117441
|
} else {
|
|
117442
|
-
|
|
117442
|
+
relative22.push(pattern);
|
|
117443
117443
|
}
|
|
117444
117444
|
}
|
|
117445
|
-
return [absolute,
|
|
117445
|
+
return [absolute, relative22];
|
|
117446
117446
|
}
|
|
117447
117447
|
exports.partitionAbsoluteAndRelative = partitionAbsoluteAndRelative;
|
|
117448
117448
|
function isAbsolute2(pattern) {
|
|
@@ -121695,7 +121695,7 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121695
121695
|
};
|
|
121696
121696
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
121697
121697
|
var fs42 = __importStar(__require2("fs"));
|
|
121698
|
-
var
|
|
121698
|
+
var regex = {
|
|
121699
121699
|
section: /^\s*\[(([^#;]|\\#|\\;)+)\]\s*([#;].*)?$/,
|
|
121700
121700
|
param: /^\s*([\w\.\-\_]+)\s*[=:]\s*(.*?)\s*([#;].*)?$/,
|
|
121701
121701
|
comment: /^\s*[#;].*$/
|
|
@@ -121727,14 +121727,14 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
121727
121727
|
var lines = data.split(/\r\n|\r|\n/);
|
|
121728
121728
|
lines.forEach(function(line3) {
|
|
121729
121729
|
var match;
|
|
121730
|
-
if (
|
|
121730
|
+
if (regex.comment.test(line3)) {
|
|
121731
121731
|
return;
|
|
121732
121732
|
}
|
|
121733
|
-
if (
|
|
121734
|
-
match = line3.match(
|
|
121733
|
+
if (regex.param.test(line3)) {
|
|
121734
|
+
match = line3.match(regex.param);
|
|
121735
121735
|
sectionBody[match[1]] = match[2];
|
|
121736
|
-
} else if (
|
|
121737
|
-
match = line3.match(
|
|
121736
|
+
} else if (regex.section.test(line3)) {
|
|
121737
|
+
match = line3.match(regex.section);
|
|
121738
121738
|
sectionName = match[1];
|
|
121739
121739
|
sectionBody = {};
|
|
121740
121740
|
value.push([sectionName, sectionBody]);
|
|
@@ -122820,8 +122820,8 @@ globstar while`, file2, fr10, pattern, pr8, swallowee);
|
|
|
122820
122820
|
}
|
|
122821
122821
|
_make(mode, key2) {
|
|
122822
122822
|
const str = this.regexPrefix.replace(REGEX_REPLACE_TRAILING_WILDCARD, TRAILING_WILD_CARD_REPLACERS[mode]);
|
|
122823
|
-
const
|
|
122824
|
-
return define2(this, key2,
|
|
122823
|
+
const regex = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
122824
|
+
return define2(this, key2, regex);
|
|
122825
122825
|
}
|
|
122826
122826
|
};
|
|
122827
122827
|
var createRule = ({
|
|
@@ -126306,7 +126306,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
126306
126306
|
return mapDoc2(doc2, (currentDoc) => cleanDocFn2(currentDoc));
|
|
126307
126307
|
}
|
|
126308
126308
|
function replaceEndOfLine2(doc2, replacement = literalline2) {
|
|
126309
|
-
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ?
|
|
126309
|
+
return mapDoc2(doc2, (currentDoc) => typeof currentDoc === "string" ? join16(replacement, currentDoc.split(`
|
|
126310
126310
|
`)) : currentDoc);
|
|
126311
126311
|
}
|
|
126312
126312
|
function canBreakFn2(doc2) {
|
|
@@ -126392,7 +126392,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
126392
126392
|
negate: options8.negate
|
|
126393
126393
|
};
|
|
126394
126394
|
}
|
|
126395
|
-
function
|
|
126395
|
+
function join16(separator, docs) {
|
|
126396
126396
|
assertDoc2(separator);
|
|
126397
126397
|
assertDocArray2(docs);
|
|
126398
126398
|
const parts = [];
|
|
@@ -127057,7 +127057,7 @@ Expected it to be ${EXPECTED_TYPE_VALUES}.`;
|
|
|
127057
127057
|
}
|
|
127058
127058
|
}
|
|
127059
127059
|
var builders2 = {
|
|
127060
|
-
join:
|
|
127060
|
+
join: join16,
|
|
127061
127061
|
line: line3,
|
|
127062
127062
|
softline: softline2,
|
|
127063
127063
|
hardline: hardline4,
|
|
@@ -127617,8 +127617,8 @@ var require_prettier = __commonJS((exports, module) => {
|
|
|
127617
127617
|
}
|
|
127618
127618
|
function makeString2(rawText, enclosingQuote, unescapeUnnecessaryEscapes) {
|
|
127619
127619
|
const otherQuote = enclosingQuote === '"' ? "'" : '"';
|
|
127620
|
-
const
|
|
127621
|
-
const raw2 = method_replace_all_default3(0, rawText,
|
|
127620
|
+
const regex = /\\(.)|(["'])/gsu;
|
|
127621
|
+
const raw2 = method_replace_all_default3(0, rawText, regex, (match, escaped, quote) => {
|
|
127622
127622
|
if (escaped === otherQuote) {
|
|
127623
127623
|
return escaped;
|
|
127624
127624
|
}
|
|
@@ -132397,7 +132397,7 @@ var require_url = __commonJS((exports) => {
|
|
|
132397
132397
|
exports.fromFileSystemPath = fromFileSystemPath;
|
|
132398
132398
|
exports.toFileSystemPath = toFileSystemPath;
|
|
132399
132399
|
exports.safePointerToPath = safePointerToPath;
|
|
132400
|
-
exports.relative =
|
|
132400
|
+
exports.relative = relative4;
|
|
132401
132401
|
var convert_path_to_posix_1 = __importDefault(require_convert_path_to_posix());
|
|
132402
132402
|
var path_1 = __importStar(__require("path"));
|
|
132403
132403
|
var forwardSlashPattern = /\//g;
|
|
@@ -132547,7 +132547,7 @@ var require_url = __commonJS((exports) => {
|
|
|
132547
132547
|
return decodeURIComponent(value).replace(jsonPointerSlash, "/").replace(jsonPointerTilde, "~");
|
|
132548
132548
|
});
|
|
132549
132549
|
}
|
|
132550
|
-
function
|
|
132550
|
+
function relative4(from, to5) {
|
|
132551
132551
|
if (!isFileSystemPath(from) || !isFileSystemPath(to5)) {
|
|
132552
132552
|
return resolve6(from, to5);
|
|
132553
132553
|
}
|
|
@@ -138614,7 +138614,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
138614
138614
|
* Copyright(c) 2014-2018 Douglas Christopher Wilson
|
|
138615
138615
|
* MIT Licensed
|
|
138616
138616
|
*/
|
|
138617
|
-
var
|
|
138617
|
+
var relative4 = __require("path").relative;
|
|
138618
138618
|
module.exports = depd;
|
|
138619
138619
|
var basePath = process.cwd();
|
|
138620
138620
|
function containsNamespace(str, namespace) {
|
|
@@ -138810,7 +138810,7 @@ var require_depd = __commonJS((exports, module) => {
|
|
|
138810
138810
|
return formatted;
|
|
138811
138811
|
}
|
|
138812
138812
|
function formatLocation(callSite) {
|
|
138813
|
-
return
|
|
138813
|
+
return relative4(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
|
|
138814
138814
|
}
|
|
138815
138815
|
function getStack() {
|
|
138816
138816
|
var limit = Error.stackTraceLimit;
|
|
@@ -156272,10 +156272,10 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156272
156272
|
var debug = require_src4()("express:view");
|
|
156273
156273
|
var path18 = __require("node:path");
|
|
156274
156274
|
var fs28 = __require("node:fs");
|
|
156275
|
-
var
|
|
156275
|
+
var dirname13 = path18.dirname;
|
|
156276
156276
|
var basename4 = path18.basename;
|
|
156277
156277
|
var extname2 = path18.extname;
|
|
156278
|
-
var
|
|
156278
|
+
var join17 = path18.join;
|
|
156279
156279
|
var resolve6 = path18.resolve;
|
|
156280
156280
|
module.exports = View;
|
|
156281
156281
|
function View(name2, options8) {
|
|
@@ -156311,7 +156311,7 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156311
156311
|
for (var i5 = 0;i5 < roots.length && !path19; i5++) {
|
|
156312
156312
|
var root2 = roots[i5];
|
|
156313
156313
|
var loc = resolve6(root2, name2);
|
|
156314
|
-
var dir =
|
|
156314
|
+
var dir = dirname13(loc);
|
|
156315
156315
|
var file2 = basename4(loc);
|
|
156316
156316
|
path19 = this.resolve(dir, file2);
|
|
156317
156317
|
}
|
|
@@ -156337,12 +156337,12 @@ var require_view = __commonJS((exports, module) => {
|
|
|
156337
156337
|
};
|
|
156338
156338
|
View.prototype.resolve = function resolve7(dir, file2) {
|
|
156339
156339
|
var ext = this.ext;
|
|
156340
|
-
var path19 =
|
|
156340
|
+
var path19 = join17(dir, file2);
|
|
156341
156341
|
var stat2 = tryStat(path19);
|
|
156342
156342
|
if (stat2 && stat2.isFile()) {
|
|
156343
156343
|
return path19;
|
|
156344
156344
|
}
|
|
156345
|
-
path19 =
|
|
156345
|
+
path19 = join17(dir, basename4(file2, ext), "index" + ext);
|
|
156346
156346
|
stat2 = tryStat(path19);
|
|
156347
156347
|
if (stat2 && stat2.isFile()) {
|
|
156348
156348
|
return path19;
|
|
@@ -156661,12 +156661,12 @@ var require_ipaddr = __commonJS((exports, module) => {
|
|
|
156661
156661
|
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
|
|
156662
156662
|
};
|
|
156663
156663
|
IPv6.prototype.toRFC5952String = function() {
|
|
156664
|
-
var bestMatchIndex, bestMatchLength, match,
|
|
156665
|
-
|
|
156664
|
+
var bestMatchIndex, bestMatchLength, match, regex, string4;
|
|
156665
|
+
regex = /((^|:)(0(:|$)){2,})/g;
|
|
156666
156666
|
string4 = this.toNormalizedString();
|
|
156667
156667
|
bestMatchIndex = 0;
|
|
156668
156668
|
bestMatchLength = -1;
|
|
156669
|
-
while (match =
|
|
156669
|
+
while (match = regex.exec(string4)) {
|
|
156670
156670
|
if (match[0].length > bestMatchLength) {
|
|
156671
156671
|
bestMatchIndex = match.index;
|
|
156672
156672
|
bestMatchLength = match[0].length;
|
|
@@ -160037,7 +160037,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160037
160037
|
var Stream2 = __require("stream");
|
|
160038
160038
|
var util2 = __require("util");
|
|
160039
160039
|
var extname2 = path18.extname;
|
|
160040
|
-
var
|
|
160040
|
+
var join17 = path18.join;
|
|
160041
160041
|
var normalize = path18.normalize;
|
|
160042
160042
|
var resolve6 = path18.resolve;
|
|
160043
160043
|
var sep = path18.sep;
|
|
@@ -160209,7 +160209,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160209
160209
|
return res;
|
|
160210
160210
|
}
|
|
160211
160211
|
parts = path19.split(sep);
|
|
160212
|
-
path19 = normalize(
|
|
160212
|
+
path19 = normalize(join17(root2, path19));
|
|
160213
160213
|
} else {
|
|
160214
160214
|
if (UP_PATH_REGEXP.test(path19)) {
|
|
160215
160215
|
debug('malicious path "%s"', path19);
|
|
@@ -160349,7 +160349,7 @@ var require_send = __commonJS((exports, module) => {
|
|
|
160349
160349
|
return self2.onStatError(err);
|
|
160350
160350
|
return self2.error(404);
|
|
160351
160351
|
}
|
|
160352
|
-
var p4 =
|
|
160352
|
+
var p4 = join17(path19, self2._index[i5]);
|
|
160353
160353
|
debug('stat "%s"', p4);
|
|
160354
160354
|
fs28.stat(p4, function(err2, stat2) {
|
|
160355
160355
|
if (err2)
|
|
@@ -161958,8 +161958,8 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
161958
161958
|
}
|
|
161959
161959
|
return parsed;
|
|
161960
161960
|
}
|
|
161961
|
-
function resolveUrl(
|
|
161962
|
-
return useNativeURL ? new URL2(
|
|
161961
|
+
function resolveUrl(relative4, base) {
|
|
161962
|
+
return useNativeURL ? new URL2(relative4, base) : parseUrl(url3.resolve(base, relative4));
|
|
161963
161963
|
}
|
|
161964
161964
|
function validateUrl(input) {
|
|
161965
161965
|
if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
|
|
@@ -161984,10 +161984,10 @@ var require_follow_redirects = __commonJS((exports, module) => {
|
|
|
161984
161984
|
spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
|
|
161985
161985
|
return spread;
|
|
161986
161986
|
}
|
|
161987
|
-
function removeMatchingHeaders(
|
|
161987
|
+
function removeMatchingHeaders(regex, headers) {
|
|
161988
161988
|
var lastValue;
|
|
161989
161989
|
for (var header2 in headers) {
|
|
161990
|
-
if (
|
|
161990
|
+
if (regex.test(header2)) {
|
|
161991
161991
|
lastValue = headers[header2];
|
|
161992
161992
|
delete headers[header2];
|
|
161993
161993
|
}
|
|
@@ -193547,9 +193547,9 @@ var require_dist4 = __commonJS((exports, module) => {
|
|
|
193547
193547
|
name2 = "/" + name2;
|
|
193548
193548
|
let nsp = this._nsps.get(name2);
|
|
193549
193549
|
if (!nsp) {
|
|
193550
|
-
for (const [
|
|
193551
|
-
if (
|
|
193552
|
-
debug("attaching namespace %s to parent namespace %s", name2,
|
|
193550
|
+
for (const [regex, parentNamespace] of this.parentNamespacesFromRegExp) {
|
|
193551
|
+
if (regex.test(name2)) {
|
|
193552
|
+
debug("attaching namespace %s to parent namespace %s", name2, regex);
|
|
193553
193553
|
return parentNamespace.createChild(name2);
|
|
193554
193554
|
}
|
|
193555
193555
|
}
|
|
@@ -206944,7 +206944,7 @@ var require_buffer_list = __commonJS((exports, module) => {
|
|
|
206944
206944
|
}
|
|
206945
206945
|
}, {
|
|
206946
206946
|
key: "join",
|
|
206947
|
-
value: function
|
|
206947
|
+
value: function join18(s5) {
|
|
206948
206948
|
if (this.length === 0)
|
|
206949
206949
|
return "";
|
|
206950
206950
|
var p4 = this.head;
|
|
@@ -210671,7 +210671,7 @@ var {
|
|
|
210671
210671
|
} = import__.default;
|
|
210672
210672
|
|
|
210673
210673
|
// src/cli/commands/agents/pull.ts
|
|
210674
|
-
import { dirname as
|
|
210674
|
+
import { dirname as dirname8, join as join10 } from "node:path";
|
|
210675
210675
|
|
|
210676
210676
|
// node_modules/@clack/core/dist/index.mjs
|
|
210677
210677
|
var import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -226141,7 +226141,9 @@ import { fileURLToPath } from "node:url";
|
|
|
226141
226141
|
var PROJECT_SUBDIR = "base44";
|
|
226142
226142
|
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
226143
226143
|
var CONFIG_FILE_EXTENSION_GLOB = "{json,jsonc}";
|
|
226144
|
-
var
|
|
226144
|
+
var FUNCTION_CONFIG_GLOB = `**/function.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
226145
|
+
var ENTRY_FILE_GLOB = "**/entry.{js,ts}";
|
|
226146
|
+
var ENTRY_IGNORE_DOT_PATHS = ["**/*.*/**"];
|
|
226145
226147
|
var APP_CONFIG_PATTERN = `**/.app.${CONFIG_FILE_EXTENSION_GLOB}`;
|
|
226146
226148
|
var PROJECT_CONFIG_PATTERNS = [
|
|
226147
226149
|
`${PROJECT_SUBDIR}/config.${CONFIG_FILE_EXTENSION_GLOB}`,
|
|
@@ -233170,7 +233172,7 @@ var generateGlobTasks = normalizeArguments(generateTasks);
|
|
|
233170
233172
|
var generateGlobTasksSync = normalizeArgumentsSync(generateTasksSync);
|
|
233171
233173
|
|
|
233172
233174
|
// src/core/project/config.ts
|
|
233173
|
-
import { dirname as
|
|
233175
|
+
import { dirname as dirname6, join as join7 } from "node:path";
|
|
233174
233176
|
|
|
233175
233177
|
// src/core/resources/agent/schema.ts
|
|
233176
233178
|
var EntityOperationSchema = exports_external.enum(["create", "update", "delete", "read"]);
|
|
@@ -233900,11 +233902,23 @@ var BackendFunctionSchema = FunctionConfigSchema.extend({
|
|
|
233900
233902
|
entryPath: exports_external.string().min(1, "Entry path cannot be empty"),
|
|
233901
233903
|
filePaths: exports_external.array(exports_external.string()).min(1, "Function must have at least one file")
|
|
233902
233904
|
});
|
|
233903
|
-
var
|
|
233904
|
-
|
|
233905
|
-
|
|
233906
|
-
|
|
233907
|
-
|
|
233905
|
+
var DeploySingleFunctionResponseSchema = exports_external.object({
|
|
233906
|
+
status: exports_external.enum(["deployed", "unchanged"])
|
|
233907
|
+
});
|
|
233908
|
+
var FunctionAutomationInfoSchema = exports_external.object({
|
|
233909
|
+
name: exports_external.string(),
|
|
233910
|
+
type: exports_external.string(),
|
|
233911
|
+
is_active: exports_external.boolean()
|
|
233912
|
+
});
|
|
233913
|
+
var FunctionInfoSchema = exports_external.object({
|
|
233914
|
+
name: exports_external.string(),
|
|
233915
|
+
deployment_id: exports_external.string(),
|
|
233916
|
+
entry: exports_external.string(),
|
|
233917
|
+
files: exports_external.array(FunctionFileSchema),
|
|
233918
|
+
automations: exports_external.array(FunctionAutomationInfoSchema)
|
|
233919
|
+
});
|
|
233920
|
+
var ListFunctionsResponseSchema = exports_external.object({
|
|
233921
|
+
functions: exports_external.array(FunctionInfoSchema)
|
|
233908
233922
|
});
|
|
233909
233923
|
var LogLevelSchema = exports_external.enum(["info", "warning", "error", "debug"]);
|
|
233910
233924
|
var FunctionLogEntrySchema = exports_external.object({
|
|
@@ -233915,29 +233929,37 @@ var FunctionLogEntrySchema = exports_external.object({
|
|
|
233915
233929
|
var FunctionLogsResponseSchema = exports_external.array(FunctionLogEntrySchema);
|
|
233916
233930
|
|
|
233917
233931
|
// src/core/resources/function/api.ts
|
|
233918
|
-
function
|
|
233919
|
-
|
|
233920
|
-
|
|
233921
|
-
|
|
233922
|
-
|
|
233923
|
-
|
|
233924
|
-
|
|
233932
|
+
async function deploySingleFunction(name2, payload) {
|
|
233933
|
+
const appClient = getAppClient();
|
|
233934
|
+
let response;
|
|
233935
|
+
try {
|
|
233936
|
+
response = await appClient.put(`backend-functions/${encodeURIComponent(name2)}`, { json: payload, timeout: false });
|
|
233937
|
+
} catch (error48) {
|
|
233938
|
+
throw await ApiError.fromHttpError(error48, `deploying function "${name2}"`);
|
|
233939
|
+
}
|
|
233940
|
+
const result = DeploySingleFunctionResponseSchema.safeParse(await response.json());
|
|
233941
|
+
if (!result.success) {
|
|
233942
|
+
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233943
|
+
}
|
|
233944
|
+
return result.data;
|
|
233925
233945
|
}
|
|
233926
|
-
async function
|
|
233946
|
+
async function deleteSingleFunction(name2) {
|
|
233947
|
+
const appClient = getAppClient();
|
|
233948
|
+
try {
|
|
233949
|
+
await appClient.delete(`backend-functions/${encodeURIComponent(name2)}`, { timeout: 60000 });
|
|
233950
|
+
} catch (error48) {
|
|
233951
|
+
throw await ApiError.fromHttpError(error48, `deleting function "${name2}"`);
|
|
233952
|
+
}
|
|
233953
|
+
}
|
|
233954
|
+
async function listDeployedFunctions() {
|
|
233927
233955
|
const appClient = getAppClient();
|
|
233928
|
-
const payload = {
|
|
233929
|
-
functions: functions.map(toDeployPayloadItem)
|
|
233930
|
-
};
|
|
233931
233956
|
let response;
|
|
233932
233957
|
try {
|
|
233933
|
-
response = await appClient.
|
|
233934
|
-
json: payload,
|
|
233935
|
-
timeout: false
|
|
233936
|
-
});
|
|
233958
|
+
response = await appClient.get("backend-functions", { timeout: 30000 });
|
|
233937
233959
|
} catch (error48) {
|
|
233938
|
-
throw await ApiError.fromHttpError(error48, "
|
|
233960
|
+
throw await ApiError.fromHttpError(error48, "listing deployed functions");
|
|
233939
233961
|
}
|
|
233940
|
-
const result =
|
|
233962
|
+
const result = ListFunctionsResponseSchema.safeParse(await response.json());
|
|
233941
233963
|
if (!result.success) {
|
|
233942
233964
|
throw new SchemaValidationError("Invalid response from server", result.error);
|
|
233943
233965
|
}
|
|
@@ -233980,7 +234002,7 @@ async function fetchFunctionLogs(functionName, filters = {}) {
|
|
|
233980
234002
|
return result.data;
|
|
233981
234003
|
}
|
|
233982
234004
|
// src/core/resources/function/config.ts
|
|
233983
|
-
import { dirname as dirname4, join as join5 } from "node:path";
|
|
234005
|
+
import { basename as basename2, dirname as dirname4, join as join5, relative } from "node:path";
|
|
233984
234006
|
async function readFunctionConfig(configPath) {
|
|
233985
234007
|
const parsed = await readJsonFile(configPath);
|
|
233986
234008
|
const result = FunctionConfigSchema.safeParse(parsed);
|
|
@@ -233998,7 +234020,7 @@ async function readFunction(configPath) {
|
|
|
233998
234020
|
hints: [{ message: "Check the 'entry' field in your function config" }]
|
|
233999
234021
|
});
|
|
234000
234022
|
}
|
|
234001
|
-
const filePaths = await globby("
|
|
234023
|
+
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
234002
234024
|
cwd: functionDir,
|
|
234003
234025
|
absolute: true
|
|
234004
234026
|
});
|
|
@@ -234009,40 +234031,182 @@ async function readAllFunctions(functionsDir) {
|
|
|
234009
234031
|
if (!await pathExists(functionsDir)) {
|
|
234010
234032
|
return [];
|
|
234011
234033
|
}
|
|
234012
|
-
const configFiles = await globby(
|
|
234034
|
+
const configFiles = await globby(FUNCTION_CONFIG_GLOB, {
|
|
234013
234035
|
cwd: functionsDir,
|
|
234014
234036
|
absolute: true
|
|
234015
234037
|
});
|
|
234016
|
-
const
|
|
234038
|
+
const entryFiles = await globby(ENTRY_FILE_GLOB, {
|
|
234039
|
+
cwd: functionsDir,
|
|
234040
|
+
absolute: true,
|
|
234041
|
+
ignore: ENTRY_IGNORE_DOT_PATHS
|
|
234042
|
+
});
|
|
234043
|
+
const configFilesDirs = new Set(configFiles.map((f) => dirname4(f)));
|
|
234044
|
+
const entryFilesWithoutConfig = entryFiles.filter((entryFile) => !configFilesDirs.has(dirname4(entryFile)));
|
|
234045
|
+
const functionsFromConfig = await Promise.all(configFiles.map((configPath) => readFunction(configPath)));
|
|
234046
|
+
const functionsWithoutConfig = await Promise.all(entryFilesWithoutConfig.map(async (entryFile) => {
|
|
234047
|
+
const functionDir = dirname4(entryFile);
|
|
234048
|
+
const filePaths = await globby("**/*.{js,ts,json}", {
|
|
234049
|
+
cwd: functionDir,
|
|
234050
|
+
absolute: true
|
|
234051
|
+
});
|
|
234052
|
+
const name2 = relative(functionsDir, functionDir).split(/[/\\]/).join("/");
|
|
234053
|
+
if (!name2) {
|
|
234054
|
+
throw new InvalidInputError("entry.ts found directly in the functions directory — it must be inside a named subfolder", {
|
|
234055
|
+
hints: [
|
|
234056
|
+
{
|
|
234057
|
+
message: `Move ${entryFile} into a subfolder (e.g. functions/myFunc/entry.ts)`
|
|
234058
|
+
}
|
|
234059
|
+
]
|
|
234060
|
+
});
|
|
234061
|
+
}
|
|
234062
|
+
const entry = basename2(entryFile);
|
|
234063
|
+
return { name: name2, entry, entryPath: entryFile, filePaths };
|
|
234064
|
+
}));
|
|
234065
|
+
const functions = [...functionsFromConfig, ...functionsWithoutConfig];
|
|
234017
234066
|
const names = new Set;
|
|
234018
234067
|
for (const fn of functions) {
|
|
234019
234068
|
if (names.has(fn.name)) {
|
|
234020
|
-
throw new
|
|
234069
|
+
throw new InvalidInputError(`Duplicate function name "${fn.name}"`, {
|
|
234070
|
+
hints: [
|
|
234071
|
+
{
|
|
234072
|
+
message: "Ensure each function has a unique name (or path for zero-config functions)."
|
|
234073
|
+
}
|
|
234074
|
+
]
|
|
234075
|
+
});
|
|
234021
234076
|
}
|
|
234022
234077
|
names.add(fn.name);
|
|
234023
234078
|
}
|
|
234024
234079
|
return functions;
|
|
234025
234080
|
}
|
|
234026
234081
|
// src/core/resources/function/deploy.ts
|
|
234027
|
-
import {
|
|
234082
|
+
import { dirname as dirname5, relative as relative2 } from "node:path";
|
|
234028
234083
|
async function loadFunctionCode(fn) {
|
|
234029
|
-
const
|
|
234084
|
+
const functionDir = dirname5(fn.entryPath);
|
|
234085
|
+
const resolvedFiles = await Promise.all(fn.filePaths.map(async (filePath) => {
|
|
234030
234086
|
const content = await readTextFile(filePath);
|
|
234031
|
-
|
|
234087
|
+
const path11 = relative2(functionDir, filePath).split(/[/\\]/).join("/");
|
|
234088
|
+
return { path: path11, content };
|
|
234032
234089
|
}));
|
|
234033
|
-
return { ...fn, files:
|
|
234090
|
+
return { ...fn, files: resolvedFiles };
|
|
234034
234091
|
}
|
|
234035
|
-
async function
|
|
234036
|
-
|
|
234037
|
-
|
|
234092
|
+
async function deployOne(fn) {
|
|
234093
|
+
const start = Date.now();
|
|
234094
|
+
try {
|
|
234095
|
+
const functionWithCode = await loadFunctionCode(fn);
|
|
234096
|
+
const response = await deploySingleFunction(functionWithCode.name, {
|
|
234097
|
+
entry: functionWithCode.entry,
|
|
234098
|
+
files: functionWithCode.files,
|
|
234099
|
+
automations: functionWithCode.automations
|
|
234100
|
+
});
|
|
234101
|
+
return {
|
|
234102
|
+
name: functionWithCode.name,
|
|
234103
|
+
status: response.status,
|
|
234104
|
+
durationMs: Date.now() - start
|
|
234105
|
+
};
|
|
234106
|
+
} catch (error48) {
|
|
234107
|
+
return {
|
|
234108
|
+
name: fn.name,
|
|
234109
|
+
status: "error",
|
|
234110
|
+
error: error48 instanceof Error ? error48.message : String(error48)
|
|
234111
|
+
};
|
|
234112
|
+
}
|
|
234113
|
+
}
|
|
234114
|
+
async function deployFunctionsSequentially(functions, options) {
|
|
234115
|
+
if (functions.length === 0)
|
|
234116
|
+
return [];
|
|
234117
|
+
const results = [];
|
|
234118
|
+
for (const fn of functions) {
|
|
234119
|
+
options?.onStart?.([fn.name]);
|
|
234120
|
+
const result = await deployOne(fn);
|
|
234121
|
+
results.push(result);
|
|
234122
|
+
options?.onResult?.(result);
|
|
234123
|
+
}
|
|
234124
|
+
return results;
|
|
234125
|
+
}
|
|
234126
|
+
async function pruneRemovedFunctions(localFunctionNames) {
|
|
234127
|
+
const remote = await listDeployedFunctions();
|
|
234128
|
+
const localSet = new Set(localFunctionNames);
|
|
234129
|
+
const toDelete = remote.functions.filter((f) => !localSet.has(f.name));
|
|
234130
|
+
const results = [];
|
|
234131
|
+
for (const fn of toDelete) {
|
|
234132
|
+
try {
|
|
234133
|
+
await deleteSingleFunction(fn.name);
|
|
234134
|
+
results.push({ name: fn.name, deleted: true });
|
|
234135
|
+
} catch (error48) {
|
|
234136
|
+
results.push({
|
|
234137
|
+
name: fn.name,
|
|
234138
|
+
deleted: false,
|
|
234139
|
+
error: error48 instanceof Error ? error48.message : String(error48)
|
|
234140
|
+
});
|
|
234141
|
+
}
|
|
234142
|
+
}
|
|
234143
|
+
return results;
|
|
234144
|
+
}
|
|
234145
|
+
// src/core/resources/function/pull.ts
|
|
234146
|
+
import { join as join6 } from "node:path";
|
|
234147
|
+
async function writeFunctions(functionsDir, functions) {
|
|
234148
|
+
const written = [];
|
|
234149
|
+
const skipped = [];
|
|
234150
|
+
for (const fn of functions) {
|
|
234151
|
+
const functionDir = join6(functionsDir, fn.name);
|
|
234152
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
234153
|
+
if (await isFunctionUnchanged(functionDir, fn)) {
|
|
234154
|
+
skipped.push(fn.name);
|
|
234155
|
+
continue;
|
|
234156
|
+
}
|
|
234157
|
+
const config5 = {
|
|
234158
|
+
name: fn.name,
|
|
234159
|
+
entry: fn.entry
|
|
234160
|
+
};
|
|
234161
|
+
if (fn.automations.length > 0) {
|
|
234162
|
+
config5.automations = fn.automations;
|
|
234163
|
+
}
|
|
234164
|
+
await writeJsonFile(configPath, config5);
|
|
234165
|
+
for (const file2 of fn.files) {
|
|
234166
|
+
await writeFile(join6(functionDir, file2.path), file2.content);
|
|
234167
|
+
}
|
|
234168
|
+
written.push(fn.name);
|
|
234169
|
+
}
|
|
234170
|
+
return { written, skipped };
|
|
234171
|
+
}
|
|
234172
|
+
async function isFunctionUnchanged(functionDir, fn) {
|
|
234173
|
+
if (!await pathExists(functionDir)) {
|
|
234174
|
+
return false;
|
|
234175
|
+
}
|
|
234176
|
+
const configPath = join6(functionDir, "function.jsonc");
|
|
234177
|
+
try {
|
|
234178
|
+
const localConfig = await readJsonFile(configPath);
|
|
234179
|
+
if (localConfig.entry !== fn.entry) {
|
|
234180
|
+
return false;
|
|
234181
|
+
}
|
|
234182
|
+
const localAuto = JSON.stringify(localConfig.automations ?? []);
|
|
234183
|
+
const remoteAuto = JSON.stringify(fn.automations);
|
|
234184
|
+
if (localAuto !== remoteAuto) {
|
|
234185
|
+
return false;
|
|
234186
|
+
}
|
|
234187
|
+
} catch {
|
|
234188
|
+
return false;
|
|
234189
|
+
}
|
|
234190
|
+
for (const file2 of fn.files) {
|
|
234191
|
+
const filePath = join6(functionDir, file2.path);
|
|
234192
|
+
if (!await pathExists(filePath)) {
|
|
234193
|
+
return false;
|
|
234194
|
+
}
|
|
234195
|
+
try {
|
|
234196
|
+
const localContent = await readTextFile(filePath);
|
|
234197
|
+
if (localContent !== file2.content) {
|
|
234198
|
+
return false;
|
|
234199
|
+
}
|
|
234200
|
+
} catch {
|
|
234201
|
+
return false;
|
|
234202
|
+
}
|
|
234038
234203
|
}
|
|
234039
|
-
|
|
234040
|
-
return deployFunctions(functionsWithCode);
|
|
234204
|
+
return true;
|
|
234041
234205
|
}
|
|
234042
234206
|
// src/core/resources/function/resource.ts
|
|
234043
234207
|
var functionResource = {
|
|
234044
234208
|
readAll: readAllFunctions,
|
|
234045
|
-
push:
|
|
234209
|
+
push: (functions) => deployFunctionsSequentially(functions)
|
|
234046
234210
|
};
|
|
234047
234211
|
// src/core/project/config.ts
|
|
234048
234212
|
async function findConfigInDir(dir) {
|
|
@@ -234054,12 +234218,12 @@ async function findConfigInDir(dir) {
|
|
|
234054
234218
|
}
|
|
234055
234219
|
async function findProjectRoot(startPath) {
|
|
234056
234220
|
let current = startPath || process.cwd();
|
|
234057
|
-
while (current !==
|
|
234221
|
+
while (current !== dirname6(current)) {
|
|
234058
234222
|
const configPath = await findConfigInDir(current);
|
|
234059
234223
|
if (configPath) {
|
|
234060
234224
|
return { root: current, configPath };
|
|
234061
234225
|
}
|
|
234062
|
-
current =
|
|
234226
|
+
current = dirname6(current);
|
|
234063
234227
|
}
|
|
234064
234228
|
return null;
|
|
234065
234229
|
}
|
|
@@ -234081,12 +234245,12 @@ async function readProjectConfig(projectRoot) {
|
|
|
234081
234245
|
throw new SchemaValidationError("Invalid project configuration", result.error, configPath);
|
|
234082
234246
|
}
|
|
234083
234247
|
const project = result.data;
|
|
234084
|
-
const configDir =
|
|
234248
|
+
const configDir = dirname6(configPath);
|
|
234085
234249
|
const [entities, functions, agents, connectors] = await Promise.all([
|
|
234086
|
-
entityResource.readAll(
|
|
234087
|
-
functionResource.readAll(
|
|
234088
|
-
agentResource.readAll(
|
|
234089
|
-
connectorResource.readAll(
|
|
234250
|
+
entityResource.readAll(join7(configDir, project.entitiesDir)),
|
|
234251
|
+
functionResource.readAll(join7(configDir, project.functionsDir)),
|
|
234252
|
+
agentResource.readAll(join7(configDir, project.agentsDir)),
|
|
234253
|
+
connectorResource.readAll(join7(configDir, project.connectorsDir))
|
|
234090
234254
|
]);
|
|
234091
234255
|
return {
|
|
234092
234256
|
project: { ...project, root, configPath },
|
|
@@ -234183,7 +234347,7 @@ async function readAppConfig(projectRoot) {
|
|
|
234183
234347
|
// src/core/project/template.ts
|
|
234184
234348
|
var import_ejs = __toESM(require_ejs(), 1);
|
|
234185
234349
|
var import_front_matter = __toESM(require_front_matter(), 1);
|
|
234186
|
-
import { dirname as
|
|
234350
|
+
import { dirname as dirname7, join as join8 } from "node:path";
|
|
234187
234351
|
async function listTemplates() {
|
|
234188
234352
|
const parsed = await readJsonFile(getTemplatesIndexPath());
|
|
234189
234353
|
const result = TemplatesConfigSchema.safeParse(parsed);
|
|
@@ -234193,23 +234357,23 @@ async function listTemplates() {
|
|
|
234193
234357
|
return result.data.templates;
|
|
234194
234358
|
}
|
|
234195
234359
|
async function renderTemplate(template, destPath, data) {
|
|
234196
|
-
const templateDir =
|
|
234360
|
+
const templateDir = join8(getTemplatesDir(), template.path);
|
|
234197
234361
|
const files = await globby("**/*", {
|
|
234198
234362
|
cwd: templateDir,
|
|
234199
234363
|
dot: true,
|
|
234200
234364
|
onlyFiles: true
|
|
234201
234365
|
});
|
|
234202
234366
|
for (const file2 of files) {
|
|
234203
|
-
const srcPath =
|
|
234367
|
+
const srcPath = join8(templateDir, file2);
|
|
234204
234368
|
try {
|
|
234205
234369
|
if (file2.endsWith(".ejs")) {
|
|
234206
234370
|
const rendered = await import_ejs.default.renderFile(srcPath, data);
|
|
234207
234371
|
const { attributes, body } = import_front_matter.default(rendered);
|
|
234208
|
-
const destFile = attributes.outputFileName ?
|
|
234209
|
-
const destFilePath =
|
|
234372
|
+
const destFile = attributes.outputFileName ? join8(dirname7(file2), attributes.outputFileName) : file2.replace(/\.ejs$/, "");
|
|
234373
|
+
const destFilePath = join8(destPath, destFile);
|
|
234210
234374
|
await writeFile(destFilePath, body);
|
|
234211
234375
|
} else {
|
|
234212
|
-
const destFilePath =
|
|
234376
|
+
const destFilePath = join8(destPath, file2);
|
|
234213
234377
|
await copyFile(srcPath, destFilePath);
|
|
234214
234378
|
}
|
|
234215
234379
|
} catch (error48) {
|
|
@@ -234312,7 +234476,7 @@ async function getSiteFilePaths(outputDir) {
|
|
|
234312
234476
|
// src/core/site/deploy.ts
|
|
234313
234477
|
import { randomUUID } from "node:crypto";
|
|
234314
234478
|
import { tmpdir } from "node:os";
|
|
234315
|
-
import { join as
|
|
234479
|
+
import { join as join9 } from "node:path";
|
|
234316
234480
|
async function deploySite(siteOutputDir) {
|
|
234317
234481
|
if (!await pathExists(siteOutputDir)) {
|
|
234318
234482
|
throw new InvalidInputError(`Output directory does not exist: ${siteOutputDir}. Make sure to build your project first.`, {
|
|
@@ -234329,7 +234493,7 @@ async function deploySite(siteOutputDir) {
|
|
|
234329
234493
|
]
|
|
234330
234494
|
});
|
|
234331
234495
|
}
|
|
234332
|
-
const archivePath =
|
|
234496
|
+
const archivePath = join9(tmpdir(), `base44-site-${randomUUID()}.tar.gz`);
|
|
234333
234497
|
try {
|
|
234334
234498
|
await createArchive(siteOutputDir, archivePath);
|
|
234335
234499
|
return await uploadSite(archivePath);
|
|
@@ -234354,10 +234518,13 @@ function hasResourcesToDeploy(projectData) {
|
|
|
234354
234518
|
const hasConnectors = connectors.length > 0;
|
|
234355
234519
|
return hasEntities || hasFunctions || hasAgents || hasConnectors || hasSite;
|
|
234356
234520
|
}
|
|
234357
|
-
async function deployAll(projectData) {
|
|
234521
|
+
async function deployAll(projectData, options) {
|
|
234358
234522
|
const { project, entities, functions, agents, connectors } = projectData;
|
|
234359
234523
|
await entityResource.push(entities);
|
|
234360
|
-
await
|
|
234524
|
+
await deployFunctionsSequentially(functions, {
|
|
234525
|
+
onStart: options?.onFunctionStart,
|
|
234526
|
+
onResult: options?.onFunctionResult
|
|
234527
|
+
});
|
|
234361
234528
|
await agentResource.push(agents);
|
|
234362
234529
|
const { results: connectorResults } = await pushConnectors(connectors);
|
|
234363
234530
|
if (project.site?.outputDirectory) {
|
|
@@ -235383,24 +235550,6 @@ async function login() {
|
|
|
235383
235550
|
};
|
|
235384
235551
|
}
|
|
235385
235552
|
|
|
235386
|
-
// node_modules/ansi-regex/index.js
|
|
235387
|
-
function ansiRegex({ onlyFirst = false } = {}) {
|
|
235388
|
-
const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
|
|
235389
|
-
const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
|
|
235390
|
-
const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
|
|
235391
|
-
const pattern = `${osc}|${csi}`;
|
|
235392
|
-
return new RegExp(pattern, onlyFirst ? undefined : "g");
|
|
235393
|
-
}
|
|
235394
|
-
|
|
235395
|
-
// node_modules/strip-ansi/index.js
|
|
235396
|
-
var regex = ansiRegex();
|
|
235397
|
-
function stripAnsi(string4) {
|
|
235398
|
-
if (typeof string4 !== "string") {
|
|
235399
|
-
throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
|
|
235400
|
-
}
|
|
235401
|
-
return string4.replace(regex, "");
|
|
235402
|
-
}
|
|
235403
|
-
|
|
235404
235553
|
// node_modules/is-plain-obj/index.js
|
|
235405
235554
|
function isPlainObject2(value) {
|
|
235406
235555
|
if (typeof value !== "object" || value === null) {
|
|
@@ -241899,7 +242048,7 @@ var {
|
|
|
241899
242048
|
// package.json
|
|
241900
242049
|
var package_default = {
|
|
241901
242050
|
name: "base44",
|
|
241902
|
-
version: "0.0.
|
|
242051
|
+
version: "0.0.38",
|
|
241903
242052
|
description: "Base44 CLI - Unified interface for managing Base44 applications",
|
|
241904
242053
|
type: "module",
|
|
241905
242054
|
bin: {
|
|
@@ -242017,35 +242166,16 @@ async function checkForUpgrade() {
|
|
|
242017
242166
|
}
|
|
242018
242167
|
|
|
242019
242168
|
// src/cli/utils/upgradeNotification.ts
|
|
242020
|
-
|
|
242021
|
-
function formatUpgradeBox(info) {
|
|
242169
|
+
function formatUpgradeMessage(info) {
|
|
242022
242170
|
const { shinyOrange } = theme.colors;
|
|
242023
242171
|
const { bold: bold2 } = theme.styles;
|
|
242024
|
-
|
|
242025
|
-
shinyOrange(`Update available! ${info.currentVersion} → ${bold2(info.latestVersion)}`),
|
|
242026
|
-
shinyOrange(`Run: ${bold2(UPGRADE_COMMAND)}`)
|
|
242027
|
-
];
|
|
242028
|
-
const maxVisualWidth = Math.max(...lines.map((l) => stripAnsi(l).length));
|
|
242029
|
-
const pad = (line) => {
|
|
242030
|
-
const visual = stripAnsi(line).length;
|
|
242031
|
-
return `${line}${" ".repeat(maxVisualWidth - visual)}`;
|
|
242032
|
-
};
|
|
242033
|
-
const top = `┌${"─".repeat(maxVisualWidth + 2)}┐`;
|
|
242034
|
-
const bottom = `└${"─".repeat(maxVisualWidth + 2)}┘`;
|
|
242035
|
-
const body = lines.map((l) => `│ ${pad(l)} │`).join(`
|
|
242036
|
-
`);
|
|
242037
|
-
return `${top}
|
|
242038
|
-
${body}
|
|
242039
|
-
${bottom}`;
|
|
242040
|
-
}
|
|
242041
|
-
function startUpgradeCheck() {
|
|
242042
|
-
return checkForUpgrade().catch(() => null);
|
|
242172
|
+
return `${shinyOrange("Update available!")} ${shinyOrange(`${info.currentVersion} → ${info.latestVersion}`)} ${shinyOrange("Run:")} ${bold2(shinyOrange("npm install -g base44@latest"))}`;
|
|
242043
242173
|
}
|
|
242044
|
-
async function
|
|
242174
|
+
async function printUpgradeNotificationIfAvailable() {
|
|
242045
242175
|
try {
|
|
242046
|
-
const upgradeInfo = await
|
|
242176
|
+
const upgradeInfo = await checkForUpgrade();
|
|
242047
242177
|
if (upgradeInfo) {
|
|
242048
|
-
R2.
|
|
242178
|
+
R2.message(formatUpgradeMessage(upgradeInfo));
|
|
242049
242179
|
}
|
|
242050
242180
|
} catch {}
|
|
242051
242181
|
}
|
|
@@ -242058,7 +242188,7 @@ async function runCommand(commandFn, options, context) {
|
|
|
242058
242188
|
} else {
|
|
242059
242189
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
242060
242190
|
}
|
|
242061
|
-
|
|
242191
|
+
await printUpgradeNotificationIfAvailable();
|
|
242062
242192
|
try {
|
|
242063
242193
|
if (options?.requireAuth) {
|
|
242064
242194
|
const loggedIn = await isLoggedIn();
|
|
@@ -242078,14 +242208,12 @@ async function runCommand(commandFn, options, context) {
|
|
|
242078
242208
|
context.errorReporter.setContext({ appId: appConfig.id });
|
|
242079
242209
|
}
|
|
242080
242210
|
const result = await commandFn();
|
|
242081
|
-
await printUpgradeNotification(upgradeCheckPromise);
|
|
242082
242211
|
Le(result.outroMessage || "");
|
|
242083
242212
|
if (result.stdout) {
|
|
242084
242213
|
process.stdout.write(result.stdout);
|
|
242085
242214
|
}
|
|
242086
242215
|
} catch (error48) {
|
|
242087
242216
|
displayError(error48);
|
|
242088
|
-
await printUpgradeNotification(upgradeCheckPromise);
|
|
242089
242217
|
const errorContext = context.errorReporter.getErrorContext();
|
|
242090
242218
|
Le(theme.format.errorContext(errorContext));
|
|
242091
242219
|
throw error48;
|
|
@@ -242129,8 +242257,8 @@ function getDashboardUrl(projectId) {
|
|
|
242129
242257
|
// src/cli/commands/agents/pull.ts
|
|
242130
242258
|
async function pullAgentsAction() {
|
|
242131
242259
|
const { project: project2 } = await readProjectConfig();
|
|
242132
|
-
const configDir =
|
|
242133
|
-
const agentsDir =
|
|
242260
|
+
const configDir = dirname8(project2.configPath);
|
|
242261
|
+
const agentsDir = join10(configDir, project2.agentsDir);
|
|
242134
242262
|
const remoteAgents = await runTask("Fetching agents from Base44", async () => {
|
|
242135
242263
|
return await fetchAgents();
|
|
242136
242264
|
}, {
|
|
@@ -242224,11 +242352,11 @@ function getWhoamiCommand(context) {
|
|
|
242224
242352
|
}
|
|
242225
242353
|
|
|
242226
242354
|
// src/cli/commands/connectors/pull.ts
|
|
242227
|
-
import { dirname as
|
|
242355
|
+
import { dirname as dirname9, join as join11 } from "node:path";
|
|
242228
242356
|
async function pullConnectorsAction() {
|
|
242229
242357
|
const { project: project2 } = await readProjectConfig();
|
|
242230
|
-
const configDir =
|
|
242231
|
-
const connectorsDir =
|
|
242358
|
+
const configDir = dirname9(project2.configPath);
|
|
242359
|
+
const connectorsDir = join11(configDir, project2.connectorsDir);
|
|
242232
242360
|
const remoteConnectors = await runTask("Fetching connectors from Base44", async () => {
|
|
242233
242361
|
return await listConnectors();
|
|
242234
242362
|
}, {
|
|
@@ -243076,46 +243204,225 @@ function getEntitiesPushCommand(context) {
|
|
|
243076
243204
|
}));
|
|
243077
243205
|
}
|
|
243078
243206
|
|
|
243207
|
+
// src/cli/utils/parseNames.ts
|
|
243208
|
+
function parseNames(args) {
|
|
243209
|
+
return args.flatMap((arg) => arg.split(",")).map((n2) => n2.trim()).filter(Boolean);
|
|
243210
|
+
}
|
|
243211
|
+
|
|
243212
|
+
// src/cli/commands/functions/delete.ts
|
|
243213
|
+
async function deleteFunctionsAction(names) {
|
|
243214
|
+
let deleted = 0;
|
|
243215
|
+
let notFound = 0;
|
|
243216
|
+
let errors4 = 0;
|
|
243217
|
+
let completed = 0;
|
|
243218
|
+
const total = names.length;
|
|
243219
|
+
for (const name2 of names) {
|
|
243220
|
+
R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deleting ${name2}...`));
|
|
243221
|
+
try {
|
|
243222
|
+
await deleteSingleFunction(name2);
|
|
243223
|
+
R2.success(`${name2.padEnd(25)} deleted`);
|
|
243224
|
+
deleted++;
|
|
243225
|
+
} catch (error48) {
|
|
243226
|
+
if (error48 instanceof ApiError && error48.statusCode === 404) {
|
|
243227
|
+
R2.warn(`${name2.padEnd(25)} not found`);
|
|
243228
|
+
notFound++;
|
|
243229
|
+
} else {
|
|
243230
|
+
R2.error(`${name2.padEnd(25)} error: ${error48 instanceof Error ? error48.message : String(error48)}`);
|
|
243231
|
+
errors4++;
|
|
243232
|
+
}
|
|
243233
|
+
}
|
|
243234
|
+
completed++;
|
|
243235
|
+
}
|
|
243236
|
+
if (names.length === 1) {
|
|
243237
|
+
if (deleted)
|
|
243238
|
+
return { outroMessage: `Function "${names[0]}" deleted` };
|
|
243239
|
+
if (notFound)
|
|
243240
|
+
return { outroMessage: `Function "${names[0]}" not found` };
|
|
243241
|
+
return { outroMessage: `Failed to delete "${names[0]}"` };
|
|
243242
|
+
}
|
|
243243
|
+
const parts = [];
|
|
243244
|
+
if (deleted > 0)
|
|
243245
|
+
parts.push(`${deleted}/${total} deleted`);
|
|
243246
|
+
if (notFound > 0)
|
|
243247
|
+
parts.push(`${notFound} not found`);
|
|
243248
|
+
if (errors4 > 0)
|
|
243249
|
+
parts.push(`${errors4} error${errors4 !== 1 ? "s" : ""}`);
|
|
243250
|
+
return { outroMessage: parts.join(", ") };
|
|
243251
|
+
}
|
|
243252
|
+
function getDeleteCommand(context) {
|
|
243253
|
+
return new Command("delete").description("Delete deployed functions").argument("<names...>", "Function names to delete").action(async (rawNames) => {
|
|
243254
|
+
await runCommand(() => {
|
|
243255
|
+
const names = parseNames(rawNames);
|
|
243256
|
+
if (names.length === 0) {
|
|
243257
|
+
throw new InvalidInputError("At least one function name is required");
|
|
243258
|
+
}
|
|
243259
|
+
return deleteFunctionsAction(names);
|
|
243260
|
+
}, { requireAuth: true }, context);
|
|
243261
|
+
});
|
|
243262
|
+
}
|
|
243263
|
+
|
|
243264
|
+
// src/cli/utils/formatDeployResult.ts
|
|
243265
|
+
function formatDuration(ms) {
|
|
243266
|
+
return `${(ms / 1000).toFixed(1)}s`;
|
|
243267
|
+
}
|
|
243268
|
+
function formatDeployResult(result) {
|
|
243269
|
+
const label = result.name.padEnd(25);
|
|
243270
|
+
if (result.status === "deployed") {
|
|
243271
|
+
const timing = result.durationMs ? theme.styles.dim(` (${formatDuration(result.durationMs)})`) : "";
|
|
243272
|
+
R2.success(`${label} deployed${timing}`);
|
|
243273
|
+
} else if (result.status === "unchanged") {
|
|
243274
|
+
R2.success(`${label} unchanged`);
|
|
243275
|
+
} else {
|
|
243276
|
+
R2.error(`${label} error: ${result.error}`);
|
|
243277
|
+
}
|
|
243278
|
+
}
|
|
243279
|
+
|
|
243079
243280
|
// src/cli/commands/functions/deploy.ts
|
|
243080
|
-
|
|
243281
|
+
function resolveFunctionsToDeploy(names, allFunctions) {
|
|
243282
|
+
if (names.length === 0)
|
|
243283
|
+
return allFunctions;
|
|
243284
|
+
const notFound = names.filter((n2) => !allFunctions.some((f) => f.name === n2));
|
|
243285
|
+
if (notFound.length > 0) {
|
|
243286
|
+
throw new InvalidInputError(`Function${notFound.length > 1 ? "s" : ""} not found in project: ${notFound.join(", ")}`);
|
|
243287
|
+
}
|
|
243288
|
+
return allFunctions.filter((f) => names.includes(f.name));
|
|
243289
|
+
}
|
|
243290
|
+
function formatPruneResults(pruneResults) {
|
|
243291
|
+
for (const pruneResult of pruneResults) {
|
|
243292
|
+
if (pruneResult.deleted) {
|
|
243293
|
+
R2.success(`${pruneResult.name.padEnd(25)} deleted`);
|
|
243294
|
+
} else {
|
|
243295
|
+
R2.error(`${pruneResult.name.padEnd(25)} error: ${pruneResult.error}`);
|
|
243296
|
+
}
|
|
243297
|
+
}
|
|
243298
|
+
if (pruneResults.length > 0) {
|
|
243299
|
+
const pruned = pruneResults.filter((r) => r.deleted).length;
|
|
243300
|
+
R2.info(`${pruned} function${pruned !== 1 ? "s" : ""} removed`);
|
|
243301
|
+
}
|
|
243302
|
+
}
|
|
243303
|
+
function buildDeploySummary(results) {
|
|
243304
|
+
const deployed = results.filter((r) => r.status !== "error").length;
|
|
243305
|
+
const failed = results.filter((r) => r.status === "error").length;
|
|
243306
|
+
const parts = [];
|
|
243307
|
+
if (deployed > 0)
|
|
243308
|
+
parts.push(`${deployed}/${results.length} deployed`);
|
|
243309
|
+
if (failed > 0)
|
|
243310
|
+
parts.push(`${failed} error${failed !== 1 ? "s" : ""}`);
|
|
243311
|
+
return parts.join(", ") || "No functions deployed";
|
|
243312
|
+
}
|
|
243313
|
+
async function deployFunctionsAction(names, options) {
|
|
243314
|
+
if (options.force && names.length > 0) {
|
|
243315
|
+
throw new InvalidInputError("--force cannot be used when specifying function names");
|
|
243316
|
+
}
|
|
243081
243317
|
const { functions } = await readProjectConfig();
|
|
243082
|
-
|
|
243318
|
+
const toDeploy = resolveFunctionsToDeploy(names, functions);
|
|
243319
|
+
if (toDeploy.length === 0) {
|
|
243083
243320
|
return {
|
|
243084
243321
|
outroMessage: "No functions found. Create functions in the 'functions' directory."
|
|
243085
243322
|
};
|
|
243086
243323
|
}
|
|
243087
|
-
R2.info(`Found ${
|
|
243088
|
-
|
|
243089
|
-
|
|
243324
|
+
R2.info(`Found ${toDeploy.length} ${toDeploy.length === 1 ? "function" : "functions"} to deploy`);
|
|
243325
|
+
let completed = 0;
|
|
243326
|
+
const total = toDeploy.length;
|
|
243327
|
+
const results = await deployFunctionsSequentially(toDeploy, {
|
|
243328
|
+
onStart: (startNames) => {
|
|
243329
|
+
const label = startNames.length === 1 ? startNames[0] : `${startNames.length} functions`;
|
|
243330
|
+
R2.step(theme.styles.dim(`[${completed + 1}/${total}] Deploying ${label}...`));
|
|
243331
|
+
},
|
|
243332
|
+
onResult: (result) => {
|
|
243333
|
+
completed++;
|
|
243334
|
+
formatDeployResult(result);
|
|
243335
|
+
}
|
|
243336
|
+
});
|
|
243337
|
+
if (options.force) {
|
|
243338
|
+
R2.info("Removing remote functions not found locally...");
|
|
243339
|
+
const allLocalNames = functions.map((f) => f.name);
|
|
243340
|
+
const pruneResults = await pruneRemovedFunctions(allLocalNames);
|
|
243341
|
+
formatPruneResults(pruneResults);
|
|
243342
|
+
}
|
|
243343
|
+
return { outroMessage: buildDeploySummary(results) };
|
|
243344
|
+
}
|
|
243345
|
+
function getDeployCommand(context) {
|
|
243346
|
+
return new Command("deploy").description("Deploy functions to Base44").argument("[names...]", "Function names to deploy (deploys all if omitted)").option("--force", "Delete remote functions not found locally").action(async (rawNames, options) => {
|
|
243347
|
+
await runCommand(() => {
|
|
243348
|
+
const names = parseNames(rawNames);
|
|
243349
|
+
return deployFunctionsAction(names, options);
|
|
243350
|
+
}, { requireAuth: true }, context);
|
|
243351
|
+
});
|
|
243352
|
+
}
|
|
243353
|
+
|
|
243354
|
+
// src/cli/commands/functions/list.ts
|
|
243355
|
+
async function listFunctionsAction() {
|
|
243356
|
+
const { functions } = await listDeployedFunctions();
|
|
243357
|
+
if (functions.length === 0) {
|
|
243358
|
+
return { outroMessage: "No functions on remote" };
|
|
243359
|
+
}
|
|
243360
|
+
for (const fn of functions) {
|
|
243361
|
+
const autoCount = fn.automations.length;
|
|
243362
|
+
const autoLabel = autoCount > 0 ? theme.styles.dim(` (${autoCount} automation${autoCount > 1 ? "s" : ""})`) : "";
|
|
243363
|
+
R2.message(` ${fn.name}${autoLabel}`);
|
|
243364
|
+
}
|
|
243365
|
+
return {
|
|
243366
|
+
outroMessage: `${functions.length} function${functions.length !== 1 ? "s" : ""} on remote`
|
|
243367
|
+
};
|
|
243368
|
+
}
|
|
243369
|
+
function getListCommand(context) {
|
|
243370
|
+
return new Command("list").description("List all deployed functions").action(async () => {
|
|
243371
|
+
await runCommand(listFunctionsAction, { requireAuth: true }, context);
|
|
243372
|
+
});
|
|
243373
|
+
}
|
|
243374
|
+
|
|
243375
|
+
// src/cli/commands/functions/pull.ts
|
|
243376
|
+
import { dirname as dirname10, join as join12 } from "node:path";
|
|
243377
|
+
async function pullFunctionsAction(name2) {
|
|
243378
|
+
const { project: project2 } = await readProjectConfig();
|
|
243379
|
+
const configDir = dirname10(project2.configPath);
|
|
243380
|
+
const functionsDir = join12(configDir, project2.functionsDir);
|
|
243381
|
+
const remoteFunctions = await runTask("Fetching functions from Base44", async () => {
|
|
243382
|
+
const { functions } = await listDeployedFunctions();
|
|
243383
|
+
return functions;
|
|
243090
243384
|
}, {
|
|
243091
|
-
successMessage: "Functions
|
|
243092
|
-
errorMessage: "Failed to
|
|
243385
|
+
successMessage: "Functions fetched successfully",
|
|
243386
|
+
errorMessage: "Failed to fetch functions"
|
|
243093
243387
|
});
|
|
243094
|
-
|
|
243095
|
-
|
|
243388
|
+
const toPull = name2 ? remoteFunctions.filter((f) => f.name === name2) : remoteFunctions;
|
|
243389
|
+
if (name2 && toPull.length === 0) {
|
|
243390
|
+
return {
|
|
243391
|
+
outroMessage: `Function "${name2}" not found on remote`
|
|
243392
|
+
};
|
|
243096
243393
|
}
|
|
243097
|
-
if (
|
|
243098
|
-
|
|
243394
|
+
if (toPull.length === 0) {
|
|
243395
|
+
return { outroMessage: "No functions found on remote" };
|
|
243099
243396
|
}
|
|
243100
|
-
|
|
243101
|
-
|
|
243102
|
-
|
|
243103
|
-
|
|
243104
|
-
|
|
243105
|
-
|
|
243106
|
-
|
|
243107
|
-
});
|
|
243397
|
+
const { written, skipped } = await runTask("Writing function files", async () => {
|
|
243398
|
+
return await writeFunctions(functionsDir, toPull);
|
|
243399
|
+
}, {
|
|
243400
|
+
successMessage: "Function files written successfully",
|
|
243401
|
+
errorMessage: "Failed to write function files"
|
|
243402
|
+
});
|
|
243403
|
+
for (const name3 of written) {
|
|
243404
|
+
R2.success(`${name3.padEnd(25)} written`);
|
|
243405
|
+
}
|
|
243406
|
+
for (const name3 of skipped) {
|
|
243407
|
+
R2.info(`${name3.padEnd(25)} unchanged`);
|
|
243108
243408
|
}
|
|
243109
|
-
return {
|
|
243409
|
+
return {
|
|
243410
|
+
outroMessage: `Pulled ${toPull.length} function${toPull.length !== 1 ? "s" : ""} to ${functionsDir}`
|
|
243411
|
+
};
|
|
243110
243412
|
}
|
|
243111
|
-
function
|
|
243112
|
-
return new Command("
|
|
243113
|
-
await runCommand(
|
|
243114
|
-
})
|
|
243413
|
+
function getPullCommand(context) {
|
|
243414
|
+
return new Command("pull").description("Pull deployed functions from Base44").argument("[name]", "Pull a single function by name").action(async (name2) => {
|
|
243415
|
+
await runCommand(() => pullFunctionsAction(name2), { requireAuth: true }, context);
|
|
243416
|
+
});
|
|
243417
|
+
}
|
|
243418
|
+
|
|
243419
|
+
// src/cli/commands/functions/index.ts
|
|
243420
|
+
function getFunctionsCommand(context) {
|
|
243421
|
+
return new Command("functions").description("Manage backend functions").addCommand(getDeployCommand(context)).addCommand(getPullCommand(context)).addCommand(getListCommand(context)).addCommand(getDeleteCommand(context));
|
|
243115
243422
|
}
|
|
243116
243423
|
|
|
243117
243424
|
// src/cli/commands/project/create.ts
|
|
243118
|
-
import { basename as basename3, join as
|
|
243425
|
+
import { basename as basename3, join as join13, resolve as resolve2 } from "node:path";
|
|
243119
243426
|
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
243120
243427
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
243121
243428
|
async function getTemplateById(templateId) {
|
|
@@ -243251,7 +243558,7 @@ async function executeCreate({
|
|
|
243251
243558
|
updateMessage("Building project...");
|
|
243252
243559
|
await execa({ cwd: resolvedPath, shell: true })`${buildCommand}`;
|
|
243253
243560
|
updateMessage("Deploying site...");
|
|
243254
|
-
return await deploySite(
|
|
243561
|
+
return await deploySite(join13(resolvedPath, outputDirectory));
|
|
243255
243562
|
}, {
|
|
243256
243563
|
successMessage: theme.colors.base44Orange("Site deployed successfully"),
|
|
243257
243564
|
errorMessage: "Failed to deploy site"
|
|
@@ -243331,11 +243638,17 @@ ${summaryLines.join(`
|
|
|
243331
243638
|
${summaryLines.join(`
|
|
243332
243639
|
`)}`);
|
|
243333
243640
|
}
|
|
243334
|
-
|
|
243335
|
-
|
|
243336
|
-
|
|
243337
|
-
|
|
243338
|
-
|
|
243641
|
+
let functionCompleted = 0;
|
|
243642
|
+
const functionTotal = functions.length;
|
|
243643
|
+
const result = await deployAll(projectData, {
|
|
243644
|
+
onFunctionStart: (names) => {
|
|
243645
|
+
const label = names.length === 1 ? names[0] : `${names.length} functions`;
|
|
243646
|
+
R2.step(theme.styles.dim(`[${functionCompleted + 1}/${functionTotal}] Deploying ${label}...`));
|
|
243647
|
+
},
|
|
243648
|
+
onFunctionResult: (r) => {
|
|
243649
|
+
functionCompleted++;
|
|
243650
|
+
formatDeployResult(r);
|
|
243651
|
+
}
|
|
243339
243652
|
});
|
|
243340
243653
|
const needsOAuth = filterPendingOAuth(result.connectorResults ?? []);
|
|
243341
243654
|
if (needsOAuth.length > 0) {
|
|
@@ -243353,7 +243666,7 @@ ${summaryLines.join(`
|
|
|
243353
243666
|
}
|
|
243354
243667
|
return { outroMessage: "App deployed successfully" };
|
|
243355
243668
|
}
|
|
243356
|
-
function
|
|
243669
|
+
function getDeployCommand2(context) {
|
|
243357
243670
|
return new Command("deploy").description("Deploy all project resources (entities, functions, agents, connectors, and site)").option("-y, --yes", "Skip confirmation prompt").action(async (options) => {
|
|
243358
243671
|
await runCommand(() => deployAction({
|
|
243359
243672
|
...options,
|
|
@@ -243877,10 +244190,10 @@ function toPascalCase(name2) {
|
|
|
243877
244190
|
return name2.split(/[-_\s]+/).map((w8) => w8.charAt(0).toUpperCase() + w8.slice(1)).join("");
|
|
243878
244191
|
}
|
|
243879
244192
|
// src/core/types/update-project.ts
|
|
243880
|
-
import { join as
|
|
244193
|
+
import { join as join16 } from "node:path";
|
|
243881
244194
|
var TYPES_INCLUDE_PATH = `${PROJECT_SUBDIR}/${TYPES_OUTPUT_SUBDIR}/*.d.ts`;
|
|
243882
244195
|
async function updateProjectConfig(projectRoot) {
|
|
243883
|
-
const tsconfigPath =
|
|
244196
|
+
const tsconfigPath = join16(projectRoot, "tsconfig.json");
|
|
243884
244197
|
if (!await pathExists(tsconfigPath)) {
|
|
243885
244198
|
return false;
|
|
243886
244199
|
}
|
|
@@ -243923,7 +244236,7 @@ function getTypesCommand(context) {
|
|
|
243923
244236
|
}
|
|
243924
244237
|
|
|
243925
244238
|
// src/cli/dev/dev-server/main.ts
|
|
243926
|
-
import { dirname as
|
|
244239
|
+
import { dirname as dirname16, join as join20 } from "node:path";
|
|
243927
244240
|
var import_cors = __toESM(require_lib4(), 1);
|
|
243928
244241
|
var import_express4 = __toESM(require_express(), 1);
|
|
243929
244242
|
|
|
@@ -244082,10 +244395,10 @@ function createDevLogger() {
|
|
|
244082
244395
|
|
|
244083
244396
|
// src/cli/dev/dev-server/function-manager.ts
|
|
244084
244397
|
import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
244085
|
-
import { dirname as
|
|
244398
|
+
import { dirname as dirname13, join as join17 } from "node:path";
|
|
244086
244399
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
244087
|
-
var __dirname5 =
|
|
244088
|
-
var WRAPPER_PATH =
|
|
244400
|
+
var __dirname5 = dirname13(fileURLToPath7(import.meta.url));
|
|
244401
|
+
var WRAPPER_PATH = join17(__dirname5, "../deno-runtime/main.js");
|
|
244089
244402
|
var READY_TIMEOUT = 30000;
|
|
244090
244403
|
|
|
244091
244404
|
class FunctionManager {
|
|
@@ -244286,9 +244599,8 @@ function createFunctionRouter(manager, logger) {
|
|
|
244286
244599
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
244287
244600
|
|
|
244288
244601
|
class Database {
|
|
244289
|
-
collections;
|
|
244290
|
-
|
|
244291
|
-
this.collections = new Map;
|
|
244602
|
+
collections = new Map;
|
|
244603
|
+
load(entities) {
|
|
244292
244604
|
for (const entity2 of entities) {
|
|
244293
244605
|
this.collections.set(entity2.name, new import_nedb.default);
|
|
244294
244606
|
}
|
|
@@ -244299,6 +244611,12 @@ class Database {
|
|
|
244299
244611
|
getCollectionNames() {
|
|
244300
244612
|
return Array.from(this.collections.keys());
|
|
244301
244613
|
}
|
|
244614
|
+
dropAll() {
|
|
244615
|
+
for (const collection of this.collections.values()) {
|
|
244616
|
+
collection.remove({}, { multi: true });
|
|
244617
|
+
}
|
|
244618
|
+
this.collections.clear();
|
|
244619
|
+
}
|
|
244302
244620
|
}
|
|
244303
244621
|
|
|
244304
244622
|
// node_modules/socket.io/wrapper.mjs
|
|
@@ -244654,7 +244972,7 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
244654
244972
|
|
|
244655
244973
|
// src/cli/dev/dev-server/watcher.ts
|
|
244656
244974
|
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
244657
|
-
import { relative as
|
|
244975
|
+
import { relative as relative6 } from "node:path";
|
|
244658
244976
|
|
|
244659
244977
|
// node_modules/chokidar/index.js
|
|
244660
244978
|
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
@@ -245384,9 +245702,9 @@ class NodeFsHandler {
|
|
|
245384
245702
|
if (this.fsw.closed) {
|
|
245385
245703
|
return;
|
|
245386
245704
|
}
|
|
245387
|
-
const
|
|
245705
|
+
const dirname15 = sp2.dirname(file2);
|
|
245388
245706
|
const basename5 = sp2.basename(file2);
|
|
245389
|
-
const parent = this.fsw._getWatchedDir(
|
|
245707
|
+
const parent = this.fsw._getWatchedDir(dirname15);
|
|
245390
245708
|
let prevStats = stats;
|
|
245391
245709
|
if (parent.has(basename5))
|
|
245392
245710
|
return;
|
|
@@ -245413,7 +245731,7 @@ class NodeFsHandler {
|
|
|
245413
245731
|
prevStats = newStats2;
|
|
245414
245732
|
}
|
|
245415
245733
|
} catch (error48) {
|
|
245416
|
-
this.fsw._remove(
|
|
245734
|
+
this.fsw._remove(dirname15, basename5);
|
|
245417
245735
|
}
|
|
245418
245736
|
} else if (parent.has(basename5)) {
|
|
245419
245737
|
const at13 = newStats.atimeMs;
|
|
@@ -245636,11 +245954,11 @@ function createPattern(matcher) {
|
|
|
245636
245954
|
if (matcher.path === string4)
|
|
245637
245955
|
return true;
|
|
245638
245956
|
if (matcher.recursive) {
|
|
245639
|
-
const
|
|
245640
|
-
if (!
|
|
245957
|
+
const relative6 = sp3.relative(matcher.path, string4);
|
|
245958
|
+
if (!relative6) {
|
|
245641
245959
|
return false;
|
|
245642
245960
|
}
|
|
245643
|
-
return !
|
|
245961
|
+
return !relative6.startsWith("..") && !sp3.isAbsolute(relative6);
|
|
245644
245962
|
}
|
|
245645
245963
|
return false;
|
|
245646
245964
|
};
|
|
@@ -246275,79 +246593,74 @@ var WATCH_QUEUE_DELAY_MS = 500;
|
|
|
246275
246593
|
class WatchBase44 extends EventEmitter4 {
|
|
246276
246594
|
itemsToWatch;
|
|
246277
246595
|
logger;
|
|
246278
|
-
|
|
246279
|
-
|
|
246596
|
+
entryNames;
|
|
246597
|
+
watchers = new Map;
|
|
246280
246598
|
queueWaitForCreationTimeout = null;
|
|
246281
246599
|
constructor(itemsToWatch, logger) {
|
|
246282
246600
|
super();
|
|
246283
246601
|
this.itemsToWatch = itemsToWatch;
|
|
246284
246602
|
this.logger = logger;
|
|
246603
|
+
this.entryNames = Object.keys(itemsToWatch);
|
|
246285
246604
|
}
|
|
246286
246605
|
async start() {
|
|
246287
|
-
if (this.watchers.
|
|
246606
|
+
if (this.watchers.size > 0) {
|
|
246288
246607
|
return;
|
|
246289
246608
|
}
|
|
246290
|
-
for (const
|
|
246291
|
-
|
|
246292
|
-
|
|
246293
|
-
|
|
246294
|
-
this.queueWaitForCreation.push(item);
|
|
246609
|
+
for (const name2 of this.entryNames) {
|
|
246610
|
+
const targetPath = this.itemsToWatch[name2];
|
|
246611
|
+
if (await pathExists(targetPath)) {
|
|
246612
|
+
this.watchers.set(name2, this.watchTarget(name2, targetPath));
|
|
246295
246613
|
}
|
|
246296
246614
|
}
|
|
246297
|
-
this.
|
|
246615
|
+
this.watchEntries();
|
|
246298
246616
|
}
|
|
246299
246617
|
async close() {
|
|
246300
246618
|
if (this.queueWaitForCreationTimeout) {
|
|
246301
246619
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246302
246620
|
this.queueWaitForCreationTimeout = null;
|
|
246303
246621
|
}
|
|
246304
|
-
for (const watcher of this.watchers) {
|
|
246622
|
+
for (const watcher of this.watchers.values()) {
|
|
246305
246623
|
await watcher.close();
|
|
246306
246624
|
}
|
|
246307
|
-
this.watchers
|
|
246308
|
-
this.queueWaitForCreation = [];
|
|
246625
|
+
this.watchers.clear();
|
|
246309
246626
|
}
|
|
246310
|
-
|
|
246627
|
+
watchEntries() {
|
|
246311
246628
|
if (this.queueWaitForCreationTimeout) {
|
|
246312
246629
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246313
246630
|
}
|
|
246314
246631
|
this.queueWaitForCreationTimeout = setTimeout(async () => {
|
|
246315
|
-
const
|
|
246316
|
-
|
|
246317
|
-
|
|
246318
|
-
|
|
246319
|
-
|
|
246632
|
+
for (const name2 of this.entryNames) {
|
|
246633
|
+
const path19 = this.itemsToWatch[name2];
|
|
246634
|
+
const watchItem = this.watchers.get(name2);
|
|
246635
|
+
const exists = await pathExists(path19);
|
|
246636
|
+
if (!watchItem && exists) {
|
|
246637
|
+
this.emit("change", name2, path19);
|
|
246638
|
+
this.watchers.set(name2, this.watchTarget(name2, path19));
|
|
246639
|
+
} else if (watchItem && !exists) {
|
|
246640
|
+
await watchItem.close();
|
|
246641
|
+
this.emit("change", name2, path19);
|
|
246642
|
+
setTimeout(() => {
|
|
246643
|
+
this.watchers.forEach((watcher, watcherName) => {
|
|
246644
|
+
if (watcher.closed) {
|
|
246645
|
+
this.watchers.delete(watcherName);
|
|
246646
|
+
}
|
|
246647
|
+
});
|
|
246648
|
+
});
|
|
246320
246649
|
}
|
|
246321
246650
|
}
|
|
246322
|
-
this.
|
|
246323
|
-
|
|
246324
|
-
this.watchCreationQueue();
|
|
246325
|
-
} else {
|
|
246326
|
-
this.queueWaitForCreationTimeout = null;
|
|
246327
|
-
}
|
|
246651
|
+
this.queueWaitForCreationTimeout = null;
|
|
246652
|
+
this.watchEntries();
|
|
246328
246653
|
}, WATCH_QUEUE_DELAY_MS);
|
|
246329
246654
|
}
|
|
246330
|
-
watchTarget(
|
|
246331
|
-
const
|
|
246332
|
-
this.emit("change", item.name, relative4(item.path, path19));
|
|
246333
|
-
}, WATCH_DEBOUNCE_MS);
|
|
246334
|
-
const watcher = watch(item.path, {
|
|
246655
|
+
watchTarget(name2, targetPath) {
|
|
246656
|
+
const watcher = watch(targetPath, {
|
|
246335
246657
|
ignoreInitial: true
|
|
246336
246658
|
});
|
|
246337
|
-
watcher.on("all",
|
|
246338
|
-
|
|
246339
|
-
|
|
246340
|
-
return;
|
|
246341
|
-
}
|
|
246342
|
-
await watcher.close();
|
|
246343
|
-
this.queueWaitForCreation.push(item);
|
|
246344
|
-
this.watchCreationQueue();
|
|
246345
|
-
setTimeout(() => {
|
|
246346
|
-
this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
|
|
246347
|
-
});
|
|
246348
|
-
});
|
|
246659
|
+
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
246660
|
+
this.emit("change", name2, relative6(targetPath, path19));
|
|
246661
|
+
}, WATCH_DEBOUNCE_MS));
|
|
246349
246662
|
watcher.on("error", (err) => {
|
|
246350
|
-
this.logger.error(`Watch handler failed for ${
|
|
246663
|
+
this.logger.error(`Watch handler failed for ${targetPath}`, err instanceof Error ? err : undefined);
|
|
246351
246664
|
});
|
|
246352
246665
|
return watcher;
|
|
246353
246666
|
}
|
|
@@ -246385,7 +246698,8 @@ async function createDevServer(options8) {
|
|
|
246385
246698
|
if (functionManager.getFunctionNames().length > 0) {
|
|
246386
246699
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
246387
246700
|
}
|
|
246388
|
-
const db2 = new Database
|
|
246701
|
+
const db2 = new Database;
|
|
246702
|
+
db2.load(entities);
|
|
246389
246703
|
if (db2.getCollectionNames().length > 0) {
|
|
246390
246704
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246391
246705
|
}
|
|
@@ -246419,16 +246733,14 @@ async function createDevServer(options8) {
|
|
|
246419
246733
|
emitEntityEvent = (appId, entityName, event) => {
|
|
246420
246734
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246421
246735
|
};
|
|
246422
|
-
const base44ConfigWatcher = new WatchBase44(
|
|
246423
|
-
|
|
246424
|
-
|
|
246425
|
-
|
|
246426
|
-
}
|
|
246427
|
-
], devLogger);
|
|
246736
|
+
const base44ConfigWatcher = new WatchBase44({
|
|
246737
|
+
functions: join20(dirname16(project2.configPath), project2.functionsDir),
|
|
246738
|
+
entities: join20(dirname16(project2.configPath), project2.entitiesDir)
|
|
246739
|
+
}, devLogger);
|
|
246428
246740
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246429
246741
|
try {
|
|
246742
|
+
const { functions: functions2, entities: entities2 } = await options8.loadResources();
|
|
246430
246743
|
if (name2 === "functions") {
|
|
246431
|
-
const { functions: functions2 } = await options8.loadResources();
|
|
246432
246744
|
const previousFunctionCount = functionManager.getFunctionNames().length;
|
|
246433
246745
|
functionManager.reload(functions2);
|
|
246434
246746
|
const names = functionManager.getFunctionNames();
|
|
@@ -246438,6 +246750,17 @@ async function createDevServer(options8) {
|
|
|
246438
246750
|
devLogger.log("All functions removed");
|
|
246439
246751
|
}
|
|
246440
246752
|
}
|
|
246753
|
+
if (name2 === "entities") {
|
|
246754
|
+
const previousEntityCount = db2.getCollectionNames().length;
|
|
246755
|
+
db2.dropAll();
|
|
246756
|
+
if (previousEntityCount > 0) {
|
|
246757
|
+
devLogger.log("Entities directory changed, clearing data...");
|
|
246758
|
+
}
|
|
246759
|
+
db2.load(entities2);
|
|
246760
|
+
if (db2.getCollectionNames().length > 0) {
|
|
246761
|
+
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246762
|
+
}
|
|
246763
|
+
}
|
|
246441
246764
|
} catch (error48) {
|
|
246442
246765
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246443
246766
|
devLogger.error(errorMessage);
|
|
@@ -246581,13 +246904,13 @@ function createProgram(context) {
|
|
|
246581
246904
|
program2.addCommand(getLogoutCommand(context));
|
|
246582
246905
|
program2.addCommand(getCreateCommand(context));
|
|
246583
246906
|
program2.addCommand(getDashboardCommand(context));
|
|
246584
|
-
program2.addCommand(
|
|
246907
|
+
program2.addCommand(getDeployCommand2(context));
|
|
246585
246908
|
program2.addCommand(getLinkCommand(context));
|
|
246586
246909
|
program2.addCommand(getEjectCommand(context));
|
|
246587
246910
|
program2.addCommand(getEntitiesPushCommand(context));
|
|
246588
246911
|
program2.addCommand(getAgentsCommand(context));
|
|
246589
246912
|
program2.addCommand(getConnectorsCommand(context));
|
|
246590
|
-
program2.addCommand(
|
|
246913
|
+
program2.addCommand(getFunctionsCommand(context));
|
|
246591
246914
|
program2.addCommand(getSecretsCommand(context));
|
|
246592
246915
|
program2.addCommand(getSiteCommand(context));
|
|
246593
246916
|
program2.addCommand(getTypesCommand(context));
|
|
@@ -246601,7 +246924,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
246601
246924
|
import { release, type } from "node:os";
|
|
246602
246925
|
|
|
246603
246926
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
246604
|
-
import { dirname as
|
|
246927
|
+
import { dirname as dirname17, posix, sep } from "path";
|
|
246605
246928
|
function createModulerModifier() {
|
|
246606
246929
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
246607
246930
|
return async (frames) => {
|
|
@@ -246610,7 +246933,7 @@ function createModulerModifier() {
|
|
|
246610
246933
|
return frames;
|
|
246611
246934
|
};
|
|
246612
246935
|
}
|
|
246613
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
246936
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname17(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246614
246937
|
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
246615
246938
|
return (filename) => {
|
|
246616
246939
|
if (!filename)
|
|
@@ -249814,9 +250137,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
|
|
|
249814
250137
|
throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
|
|
249815
250138
|
return propertyGroupType === "AND";
|
|
249816
250139
|
}
|
|
249817
|
-
function isValidRegex(
|
|
250140
|
+
function isValidRegex(regex) {
|
|
249818
250141
|
try {
|
|
249819
|
-
new RegExp(
|
|
250142
|
+
new RegExp(regex);
|
|
249820
250143
|
return true;
|
|
249821
250144
|
} catch (err) {
|
|
249822
250145
|
return false;
|
|
@@ -249834,8 +250157,8 @@ function convertToDateTime(value) {
|
|
|
249834
250157
|
throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
|
|
249835
250158
|
}
|
|
249836
250159
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
249837
|
-
const
|
|
249838
|
-
const match = value.match(
|
|
250160
|
+
const regex = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
250161
|
+
const match = value.match(regex);
|
|
249839
250162
|
const parsedDt = new Date(new Date().toISOString());
|
|
249840
250163
|
if (!match)
|
|
249841
250164
|
return null;
|
|
@@ -250828,4 +251151,4 @@ export {
|
|
|
250828
251151
|
CLIExitError
|
|
250829
251152
|
};
|
|
250830
251153
|
|
|
250831
|
-
//# debugId=
|
|
251154
|
+
//# debugId=0324A58C26AC18BA64756E2164756E21
|