@base44-preview/cli 0.0.37-pr.364.f1afd32 → 0.0.37-pr.365.290ff33
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 +144 -113
- package/dist/cli/index.js.map +10 -8
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -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 regex2 = /%[dfijoOs]/g;
|
|
110481
110481
|
let expectedLength = 0;
|
|
110482
|
-
while (
|
|
110482
|
+
while (regex2.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 regex2 = regexps.get(endOfLineCharacter);
|
|
111384
111384
|
if (false) {}
|
|
111385
|
-
return text.match(
|
|
111385
|
+
return text.match(regex2)?.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 regex2 = /\\(.)|(["'])/gsu;
|
|
113588
|
+
const raw2 = method_replace_all_default2(0, rawText, regex2, (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 regex2 = isState ? picomatch.compileRe(glob, options8) : picomatch.makeRe(glob, options8, false, true);
|
|
117010
|
+
const state = regex2.state;
|
|
117011
|
+
delete regex2.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, posix, input, output, match, isMatch };
|
|
117018
|
+
const { isMatch, match, output } = picomatch.test(input, regex2, options8, { glob, posix });
|
|
117019
|
+
const result = { glob, state, regex: regex2, 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, regex2, 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, regex2, options8, posix);
|
|
117062
117062
|
} else {
|
|
117063
|
-
match =
|
|
117063
|
+
match = regex2.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 regex2 = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options8);
|
|
117070
|
+
return regex2.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 regex2 = picomatch.toRegex(source2, options8);
|
|
117091
117091
|
if (returnState === true) {
|
|
117092
|
-
|
|
117092
|
+
regex2.state = state;
|
|
117093
117093
|
}
|
|
117094
|
-
return
|
|
117094
|
+
return regex2;
|
|
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 regex2 = picomatch.makeRe(String(glob), { ...options8, capture: true });
|
|
117259
|
+
let match = regex2.exec(posix ? utils3.toPosixSlashes(input) : input);
|
|
117260
117260
|
if (match) {
|
|
117261
117261
|
return match.slice(1).map((v10) => v10 === undefined ? "" : v10);
|
|
117262
117262
|
}
|
|
@@ -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 regex2 = {
|
|
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 (regex2.comment.test(line3)) {
|
|
121731
121731
|
return;
|
|
121732
121732
|
}
|
|
121733
|
-
if (
|
|
121734
|
-
match = line3.match(
|
|
121733
|
+
if (regex2.param.test(line3)) {
|
|
121734
|
+
match = line3.match(regex2.param);
|
|
121735
121735
|
sectionBody[match[1]] = match[2];
|
|
121736
|
-
} else if (
|
|
121737
|
-
match = line3.match(
|
|
121736
|
+
} else if (regex2.section.test(line3)) {
|
|
121737
|
+
match = line3.match(regex2.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 regex2 = this.ignoreCase ? new RegExp(str, "i") : new RegExp(str);
|
|
122824
|
+
return define2(this, key2, regex2);
|
|
122825
122825
|
}
|
|
122826
122826
|
};
|
|
122827
122827
|
var createRule = ({
|
|
@@ -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 regex2 = /\\(.)|(["'])/gsu;
|
|
127621
|
+
const raw2 = method_replace_all_default3(0, rawText, regex2, (match, escaped, quote) => {
|
|
127622
127622
|
if (escaped === otherQuote) {
|
|
127623
127623
|
return escaped;
|
|
127624
127624
|
}
|
|
@@ -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, regex2, string4;
|
|
156665
|
+
regex2 = /((^|:)(0(:|$)){2,})/g;
|
|
156666
156666
|
string4 = this.toNormalizedString();
|
|
156667
156667
|
bestMatchIndex = 0;
|
|
156668
156668
|
bestMatchLength = -1;
|
|
156669
|
-
while (match =
|
|
156669
|
+
while (match = regex2.exec(string4)) {
|
|
156670
156670
|
if (match[0].length > bestMatchLength) {
|
|
156671
156671
|
bestMatchIndex = match.index;
|
|
156672
156672
|
bestMatchLength = match[0].length;
|
|
@@ -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(regex2, headers) {
|
|
161988
161988
|
var lastValue;
|
|
161989
161989
|
for (var header2 in headers) {
|
|
161990
|
-
if (
|
|
161990
|
+
if (regex2.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 [regex2, parentNamespace] of this.parentNamespacesFromRegExp) {
|
|
193551
|
+
if (regex2.test(name2)) {
|
|
193552
|
+
debug("attaching namespace %s to parent namespace %s", name2, regex2);
|
|
193553
193553
|
return parentNamespace.createChild(name2);
|
|
193554
193554
|
}
|
|
193555
193555
|
}
|
|
@@ -235383,6 +235383,24 @@ async function login() {
|
|
|
235383
235383
|
};
|
|
235384
235384
|
}
|
|
235385
235385
|
|
|
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
|
+
|
|
235386
235404
|
// node_modules/is-plain-obj/index.js
|
|
235387
235405
|
function isPlainObject2(value) {
|
|
235388
235406
|
if (typeof value !== "object" || value === null) {
|
|
@@ -241999,16 +242017,38 @@ async function checkForUpgrade() {
|
|
|
241999
242017
|
}
|
|
242000
242018
|
|
|
242001
242019
|
// src/cli/utils/upgradeNotification.ts
|
|
242002
|
-
|
|
242020
|
+
var UPGRADE_COMMAND = "npm install -g base44@latest";
|
|
242021
|
+
function formatUpgradeBox(info) {
|
|
242003
242022
|
const { shinyOrange } = theme.colors;
|
|
242004
242023
|
const { bold: bold2 } = theme.styles;
|
|
242005
|
-
|
|
242024
|
+
const lines = [
|
|
242025
|
+
shinyOrange(`Update available! ${info.currentVersion} → ${bold2(info.latestVersion)}`),
|
|
242026
|
+
shinyOrange(`Run: ${bold2(UPGRADE_COMMAND)}`),
|
|
242027
|
+
"",
|
|
242028
|
+
"[Agent Hints]",
|
|
242029
|
+
` Run: ${UPGRADE_COMMAND}`
|
|
242030
|
+
];
|
|
242031
|
+
const maxVisualWidth = Math.max(...lines.map((l) => stripAnsi(l).length));
|
|
242032
|
+
const pad = (line) => {
|
|
242033
|
+
const visual = stripAnsi(line).length;
|
|
242034
|
+
return `${line}${" ".repeat(maxVisualWidth - visual)}`;
|
|
242035
|
+
};
|
|
242036
|
+
const top = `┌${"─".repeat(maxVisualWidth + 2)}┐`;
|
|
242037
|
+
const bottom = `└${"─".repeat(maxVisualWidth + 2)}┘`;
|
|
242038
|
+
const body = lines.map((l) => `│ ${pad(l)} │`).join(`
|
|
242039
|
+
`);
|
|
242040
|
+
return `${top}
|
|
242041
|
+
${body}
|
|
242042
|
+
${bottom}`;
|
|
242043
|
+
}
|
|
242044
|
+
function startUpgradeCheck() {
|
|
242045
|
+
return checkForUpgrade().catch(() => null);
|
|
242006
242046
|
}
|
|
242007
|
-
async function
|
|
242047
|
+
async function printUpgradeNotification(upgradeCheckPromise) {
|
|
242008
242048
|
try {
|
|
242009
|
-
const upgradeInfo = await
|
|
242049
|
+
const upgradeInfo = await upgradeCheckPromise;
|
|
242010
242050
|
if (upgradeInfo) {
|
|
242011
|
-
R2.
|
|
242051
|
+
R2.warn(formatUpgradeBox(upgradeInfo));
|
|
242012
242052
|
}
|
|
242013
242053
|
} catch {}
|
|
242014
242054
|
}
|
|
@@ -242021,7 +242061,7 @@ async function runCommand(commandFn, options, context) {
|
|
|
242021
242061
|
} else {
|
|
242022
242062
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
242023
242063
|
}
|
|
242024
|
-
|
|
242064
|
+
const upgradeCheckPromise = startUpgradeCheck();
|
|
242025
242065
|
try {
|
|
242026
242066
|
if (options?.requireAuth) {
|
|
242027
242067
|
const loggedIn = await isLoggedIn();
|
|
@@ -242041,12 +242081,14 @@ async function runCommand(commandFn, options, context) {
|
|
|
242041
242081
|
context.errorReporter.setContext({ appId: appConfig.id });
|
|
242042
242082
|
}
|
|
242043
242083
|
const result = await commandFn();
|
|
242084
|
+
await printUpgradeNotification(upgradeCheckPromise);
|
|
242044
242085
|
Le(result.outroMessage || "");
|
|
242045
242086
|
if (result.stdout) {
|
|
242046
242087
|
process.stdout.write(result.stdout);
|
|
242047
242088
|
}
|
|
242048
242089
|
} catch (error48) {
|
|
242049
242090
|
displayError(error48);
|
|
242091
|
+
await printUpgradeNotification(upgradeCheckPromise);
|
|
242050
242092
|
const errorContext = context.errorReporter.getErrorContext();
|
|
242051
242093
|
Le(theme.format.errorContext(errorContext));
|
|
242052
242094
|
throw error48;
|
|
@@ -244247,8 +244289,9 @@ function createFunctionRouter(manager, logger) {
|
|
|
244247
244289
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
244248
244290
|
|
|
244249
244291
|
class Database {
|
|
244250
|
-
collections
|
|
244251
|
-
|
|
244292
|
+
collections;
|
|
244293
|
+
constructor(entities) {
|
|
244294
|
+
this.collections = new Map;
|
|
244252
244295
|
for (const entity2 of entities) {
|
|
244253
244296
|
this.collections.set(entity2.name, new import_nedb.default);
|
|
244254
244297
|
}
|
|
@@ -244259,12 +244302,6 @@ class Database {
|
|
|
244259
244302
|
getCollectionNames() {
|
|
244260
244303
|
return Array.from(this.collections.keys());
|
|
244261
244304
|
}
|
|
244262
|
-
dropAll() {
|
|
244263
|
-
for (const collection of this.collections.values()) {
|
|
244264
|
-
collection.remove({}, { multi: true });
|
|
244265
|
-
}
|
|
244266
|
-
this.collections.clear();
|
|
244267
|
-
}
|
|
244268
244305
|
}
|
|
244269
244306
|
|
|
244270
244307
|
// node_modules/socket.io/wrapper.mjs
|
|
@@ -246241,74 +246278,79 @@ var WATCH_QUEUE_DELAY_MS = 500;
|
|
|
246241
246278
|
class WatchBase44 extends EventEmitter4 {
|
|
246242
246279
|
itemsToWatch;
|
|
246243
246280
|
logger;
|
|
246244
|
-
|
|
246245
|
-
|
|
246281
|
+
watchers = [];
|
|
246282
|
+
queueWaitForCreation = [];
|
|
246246
246283
|
queueWaitForCreationTimeout = null;
|
|
246247
246284
|
constructor(itemsToWatch, logger) {
|
|
246248
246285
|
super();
|
|
246249
246286
|
this.itemsToWatch = itemsToWatch;
|
|
246250
246287
|
this.logger = logger;
|
|
246251
|
-
this.entryNames = Object.keys(itemsToWatch);
|
|
246252
246288
|
}
|
|
246253
246289
|
async start() {
|
|
246254
|
-
if (this.watchers.
|
|
246290
|
+
if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
|
|
246255
246291
|
return;
|
|
246256
246292
|
}
|
|
246257
|
-
for (const
|
|
246258
|
-
|
|
246259
|
-
|
|
246260
|
-
|
|
246293
|
+
for (const item of this.itemsToWatch) {
|
|
246294
|
+
if (await pathExists(item.path)) {
|
|
246295
|
+
this.watchers.push(this.watchTarget(item));
|
|
246296
|
+
} else {
|
|
246297
|
+
this.queueWaitForCreation.push(item);
|
|
246261
246298
|
}
|
|
246262
246299
|
}
|
|
246263
|
-
this.
|
|
246300
|
+
this.watchCreationQueue();
|
|
246264
246301
|
}
|
|
246265
246302
|
async close() {
|
|
246266
246303
|
if (this.queueWaitForCreationTimeout) {
|
|
246267
246304
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246268
246305
|
this.queueWaitForCreationTimeout = null;
|
|
246269
246306
|
}
|
|
246270
|
-
for (const watcher of this.watchers
|
|
246307
|
+
for (const watcher of this.watchers) {
|
|
246271
246308
|
await watcher.close();
|
|
246272
246309
|
}
|
|
246273
|
-
this.watchers
|
|
246310
|
+
this.watchers = [];
|
|
246311
|
+
this.queueWaitForCreation = [];
|
|
246274
246312
|
}
|
|
246275
|
-
|
|
246313
|
+
watchCreationQueue() {
|
|
246276
246314
|
if (this.queueWaitForCreationTimeout) {
|
|
246277
246315
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246278
246316
|
}
|
|
246279
246317
|
this.queueWaitForCreationTimeout = setTimeout(async () => {
|
|
246280
|
-
|
|
246281
|
-
|
|
246282
|
-
|
|
246283
|
-
|
|
246284
|
-
|
|
246285
|
-
this.emit("change", name2, path19);
|
|
246286
|
-
this.watchers.set(name2, this.watchTarget(name2, path19));
|
|
246287
|
-
} else if (watchItem && !exists) {
|
|
246288
|
-
await watchItem.close();
|
|
246289
|
-
this.emit("change", name2, path19);
|
|
246290
|
-
setTimeout(() => {
|
|
246291
|
-
this.watchers.forEach((watcher, watcherName) => {
|
|
246292
|
-
if (watcher.closed) {
|
|
246293
|
-
this.watchers.delete(watcherName);
|
|
246294
|
-
}
|
|
246295
|
-
});
|
|
246296
|
-
});
|
|
246318
|
+
const toRemove = [];
|
|
246319
|
+
for (const entry of this.queueWaitForCreation) {
|
|
246320
|
+
if (await pathExists(entry.path)) {
|
|
246321
|
+
this.watchers.push(this.watchTarget(entry));
|
|
246322
|
+
toRemove.push(entry);
|
|
246297
246323
|
}
|
|
246298
246324
|
}
|
|
246299
|
-
this.
|
|
246300
|
-
this.
|
|
246325
|
+
this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
|
|
246326
|
+
if (this.queueWaitForCreation.length > 0) {
|
|
246327
|
+
this.watchCreationQueue();
|
|
246328
|
+
} else {
|
|
246329
|
+
this.queueWaitForCreationTimeout = null;
|
|
246330
|
+
}
|
|
246301
246331
|
}, WATCH_QUEUE_DELAY_MS);
|
|
246302
246332
|
}
|
|
246303
|
-
watchTarget(
|
|
246304
|
-
const
|
|
246333
|
+
watchTarget(item) {
|
|
246334
|
+
const handler = import_debounce.default(async (_event, path19) => {
|
|
246335
|
+
this.emit("change", item.name, relative4(item.path, path19));
|
|
246336
|
+
}, WATCH_DEBOUNCE_MS);
|
|
246337
|
+
const watcher = watch(item.path, {
|
|
246305
246338
|
ignoreInitial: true
|
|
246306
246339
|
});
|
|
246307
|
-
watcher.on("all",
|
|
246308
|
-
|
|
246309
|
-
|
|
246340
|
+
watcher.on("all", handler);
|
|
246341
|
+
watcher.on("unlinkDir", async (deletedPath) => {
|
|
246342
|
+
if (deletedPath !== item.path) {
|
|
246343
|
+
return;
|
|
246344
|
+
}
|
|
246345
|
+
await watcher.close();
|
|
246346
|
+
this.queueWaitForCreation.push(item);
|
|
246347
|
+
this.watchCreationQueue();
|
|
246348
|
+
setTimeout(() => {
|
|
246349
|
+
this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
|
|
246350
|
+
});
|
|
246351
|
+
});
|
|
246310
246352
|
watcher.on("error", (err) => {
|
|
246311
|
-
this.logger.error(`
|
|
246353
|
+
this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
|
|
246312
246354
|
});
|
|
246313
246355
|
return watcher;
|
|
246314
246356
|
}
|
|
@@ -246346,8 +246388,7 @@ async function createDevServer(options8) {
|
|
|
246346
246388
|
if (functionManager.getFunctionNames().length > 0) {
|
|
246347
246389
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
246348
246390
|
}
|
|
246349
|
-
const db2 = new Database;
|
|
246350
|
-
db2.load(entities);
|
|
246391
|
+
const db2 = new Database(entities);
|
|
246351
246392
|
if (db2.getCollectionNames().length > 0) {
|
|
246352
246393
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246353
246394
|
}
|
|
@@ -246381,10 +246422,12 @@ async function createDevServer(options8) {
|
|
|
246381
246422
|
emitEntityEvent = (appId, entityName, event) => {
|
|
246382
246423
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246383
246424
|
};
|
|
246384
|
-
const base44ConfigWatcher = new WatchBase44(
|
|
246385
|
-
|
|
246386
|
-
|
|
246387
|
-
|
|
246425
|
+
const base44ConfigWatcher = new WatchBase44([
|
|
246426
|
+
{
|
|
246427
|
+
name: "functions",
|
|
246428
|
+
path: join18(dirname14(project2.configPath), project2.functionsDir)
|
|
246429
|
+
}
|
|
246430
|
+
], devLogger);
|
|
246388
246431
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246389
246432
|
try {
|
|
246390
246433
|
if (name2 === "functions") {
|
|
@@ -246398,18 +246441,6 @@ async function createDevServer(options8) {
|
|
|
246398
246441
|
devLogger.log("All functions removed");
|
|
246399
246442
|
}
|
|
246400
246443
|
}
|
|
246401
|
-
if (name2 === "entities") {
|
|
246402
|
-
const previousEntityCount = db2.getCollectionNames().length;
|
|
246403
|
-
const { entities: entities2 } = await options8.loadResources();
|
|
246404
|
-
db2.dropAll();
|
|
246405
|
-
if (previousEntityCount > 0) {
|
|
246406
|
-
devLogger.log("Entities directory changed, clearing data...");
|
|
246407
|
-
}
|
|
246408
|
-
db2.load(entities2);
|
|
246409
|
-
if (db2.getCollectionNames().length > 0) {
|
|
246410
|
-
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246411
|
-
}
|
|
246412
|
-
}
|
|
246413
246444
|
} catch (error48) {
|
|
246414
246445
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246415
246446
|
devLogger.error(errorMessage);
|
|
@@ -249786,9 +249817,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
|
|
|
249786
249817
|
throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
|
|
249787
249818
|
return propertyGroupType === "AND";
|
|
249788
249819
|
}
|
|
249789
|
-
function isValidRegex(
|
|
249820
|
+
function isValidRegex(regex2) {
|
|
249790
249821
|
try {
|
|
249791
|
-
new RegExp(
|
|
249822
|
+
new RegExp(regex2);
|
|
249792
249823
|
return true;
|
|
249793
249824
|
} catch (err) {
|
|
249794
249825
|
return false;
|
|
@@ -249806,8 +249837,8 @@ function convertToDateTime(value) {
|
|
|
249806
249837
|
throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
|
|
249807
249838
|
}
|
|
249808
249839
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
249809
|
-
const
|
|
249810
|
-
const match = value.match(
|
|
249840
|
+
const regex2 = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
249841
|
+
const match = value.match(regex2);
|
|
249811
249842
|
const parsedDt = new Date(new Date().toISOString());
|
|
249812
249843
|
if (!match)
|
|
249813
249844
|
return null;
|
|
@@ -250800,4 +250831,4 @@ export {
|
|
|
250800
250831
|
CLIExitError
|
|
250801
250832
|
};
|
|
250802
250833
|
|
|
250803
|
-
//# debugId=
|
|
250834
|
+
//# debugId=5F70B466281996DE64756E2164756E21
|