@base44-preview/cli 0.0.37-pr.364.f1afd32 → 0.0.37-pr.365.600b1d5
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 +141 -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,35 @@ 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
|
+
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);
|
|
242006
242043
|
}
|
|
242007
|
-
async function
|
|
242044
|
+
async function printUpgradeNotification(upgradeCheckPromise) {
|
|
242008
242045
|
try {
|
|
242009
|
-
const upgradeInfo = await
|
|
242046
|
+
const upgradeInfo = await upgradeCheckPromise;
|
|
242010
242047
|
if (upgradeInfo) {
|
|
242011
|
-
R2.
|
|
242048
|
+
R2.warn(formatUpgradeBox(upgradeInfo));
|
|
242012
242049
|
}
|
|
242013
242050
|
} catch {}
|
|
242014
242051
|
}
|
|
@@ -242021,7 +242058,7 @@ async function runCommand(commandFn, options, context) {
|
|
|
242021
242058
|
} else {
|
|
242022
242059
|
We(theme.colors.base44OrangeBackground(" Base 44 "));
|
|
242023
242060
|
}
|
|
242024
|
-
|
|
242061
|
+
const upgradeCheckPromise = startUpgradeCheck();
|
|
242025
242062
|
try {
|
|
242026
242063
|
if (options?.requireAuth) {
|
|
242027
242064
|
const loggedIn = await isLoggedIn();
|
|
@@ -242041,12 +242078,14 @@ async function runCommand(commandFn, options, context) {
|
|
|
242041
242078
|
context.errorReporter.setContext({ appId: appConfig.id });
|
|
242042
242079
|
}
|
|
242043
242080
|
const result = await commandFn();
|
|
242081
|
+
await printUpgradeNotification(upgradeCheckPromise);
|
|
242044
242082
|
Le(result.outroMessage || "");
|
|
242045
242083
|
if (result.stdout) {
|
|
242046
242084
|
process.stdout.write(result.stdout);
|
|
242047
242085
|
}
|
|
242048
242086
|
} catch (error48) {
|
|
242049
242087
|
displayError(error48);
|
|
242088
|
+
await printUpgradeNotification(upgradeCheckPromise);
|
|
242050
242089
|
const errorContext = context.errorReporter.getErrorContext();
|
|
242051
242090
|
Le(theme.format.errorContext(errorContext));
|
|
242052
242091
|
throw error48;
|
|
@@ -244247,8 +244286,9 @@ function createFunctionRouter(manager, logger) {
|
|
|
244247
244286
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
244248
244287
|
|
|
244249
244288
|
class Database {
|
|
244250
|
-
collections
|
|
244251
|
-
|
|
244289
|
+
collections;
|
|
244290
|
+
constructor(entities) {
|
|
244291
|
+
this.collections = new Map;
|
|
244252
244292
|
for (const entity2 of entities) {
|
|
244253
244293
|
this.collections.set(entity2.name, new import_nedb.default);
|
|
244254
244294
|
}
|
|
@@ -244259,12 +244299,6 @@ class Database {
|
|
|
244259
244299
|
getCollectionNames() {
|
|
244260
244300
|
return Array.from(this.collections.keys());
|
|
244261
244301
|
}
|
|
244262
|
-
dropAll() {
|
|
244263
|
-
for (const collection of this.collections.values()) {
|
|
244264
|
-
collection.remove({}, { multi: true });
|
|
244265
|
-
}
|
|
244266
|
-
this.collections.clear();
|
|
244267
|
-
}
|
|
244268
244302
|
}
|
|
244269
244303
|
|
|
244270
244304
|
// node_modules/socket.io/wrapper.mjs
|
|
@@ -246241,74 +246275,79 @@ var WATCH_QUEUE_DELAY_MS = 500;
|
|
|
246241
246275
|
class WatchBase44 extends EventEmitter4 {
|
|
246242
246276
|
itemsToWatch;
|
|
246243
246277
|
logger;
|
|
246244
|
-
|
|
246245
|
-
|
|
246278
|
+
watchers = [];
|
|
246279
|
+
queueWaitForCreation = [];
|
|
246246
246280
|
queueWaitForCreationTimeout = null;
|
|
246247
246281
|
constructor(itemsToWatch, logger) {
|
|
246248
246282
|
super();
|
|
246249
246283
|
this.itemsToWatch = itemsToWatch;
|
|
246250
246284
|
this.logger = logger;
|
|
246251
|
-
this.entryNames = Object.keys(itemsToWatch);
|
|
246252
246285
|
}
|
|
246253
246286
|
async start() {
|
|
246254
|
-
if (this.watchers.
|
|
246287
|
+
if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
|
|
246255
246288
|
return;
|
|
246256
246289
|
}
|
|
246257
|
-
for (const
|
|
246258
|
-
|
|
246259
|
-
|
|
246260
|
-
|
|
246290
|
+
for (const item of this.itemsToWatch) {
|
|
246291
|
+
if (await pathExists(item.path)) {
|
|
246292
|
+
this.watchers.push(this.watchTarget(item));
|
|
246293
|
+
} else {
|
|
246294
|
+
this.queueWaitForCreation.push(item);
|
|
246261
246295
|
}
|
|
246262
246296
|
}
|
|
246263
|
-
this.
|
|
246297
|
+
this.watchCreationQueue();
|
|
246264
246298
|
}
|
|
246265
246299
|
async close() {
|
|
246266
246300
|
if (this.queueWaitForCreationTimeout) {
|
|
246267
246301
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246268
246302
|
this.queueWaitForCreationTimeout = null;
|
|
246269
246303
|
}
|
|
246270
|
-
for (const watcher of this.watchers
|
|
246304
|
+
for (const watcher of this.watchers) {
|
|
246271
246305
|
await watcher.close();
|
|
246272
246306
|
}
|
|
246273
|
-
this.watchers
|
|
246307
|
+
this.watchers = [];
|
|
246308
|
+
this.queueWaitForCreation = [];
|
|
246274
246309
|
}
|
|
246275
|
-
|
|
246310
|
+
watchCreationQueue() {
|
|
246276
246311
|
if (this.queueWaitForCreationTimeout) {
|
|
246277
246312
|
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246278
246313
|
}
|
|
246279
246314
|
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
|
-
});
|
|
246315
|
+
const toRemove = [];
|
|
246316
|
+
for (const entry of this.queueWaitForCreation) {
|
|
246317
|
+
if (await pathExists(entry.path)) {
|
|
246318
|
+
this.watchers.push(this.watchTarget(entry));
|
|
246319
|
+
toRemove.push(entry);
|
|
246297
246320
|
}
|
|
246298
246321
|
}
|
|
246299
|
-
this.
|
|
246300
|
-
this.
|
|
246322
|
+
this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
|
|
246323
|
+
if (this.queueWaitForCreation.length > 0) {
|
|
246324
|
+
this.watchCreationQueue();
|
|
246325
|
+
} else {
|
|
246326
|
+
this.queueWaitForCreationTimeout = null;
|
|
246327
|
+
}
|
|
246301
246328
|
}, WATCH_QUEUE_DELAY_MS);
|
|
246302
246329
|
}
|
|
246303
|
-
watchTarget(
|
|
246304
|
-
const
|
|
246330
|
+
watchTarget(item) {
|
|
246331
|
+
const handler = import_debounce.default(async (_event, path19) => {
|
|
246332
|
+
this.emit("change", item.name, relative4(item.path, path19));
|
|
246333
|
+
}, WATCH_DEBOUNCE_MS);
|
|
246334
|
+
const watcher = watch(item.path, {
|
|
246305
246335
|
ignoreInitial: true
|
|
246306
246336
|
});
|
|
246307
|
-
watcher.on("all",
|
|
246308
|
-
|
|
246309
|
-
|
|
246337
|
+
watcher.on("all", handler);
|
|
246338
|
+
watcher.on("unlinkDir", async (deletedPath) => {
|
|
246339
|
+
if (deletedPath !== item.path) {
|
|
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
|
+
});
|
|
246310
246349
|
watcher.on("error", (err) => {
|
|
246311
|
-
this.logger.error(`
|
|
246350
|
+
this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
|
|
246312
246351
|
});
|
|
246313
246352
|
return watcher;
|
|
246314
246353
|
}
|
|
@@ -246346,8 +246385,7 @@ async function createDevServer(options8) {
|
|
|
246346
246385
|
if (functionManager.getFunctionNames().length > 0) {
|
|
246347
246386
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
246348
246387
|
}
|
|
246349
|
-
const db2 = new Database;
|
|
246350
|
-
db2.load(entities);
|
|
246388
|
+
const db2 = new Database(entities);
|
|
246351
246389
|
if (db2.getCollectionNames().length > 0) {
|
|
246352
246390
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246353
246391
|
}
|
|
@@ -246381,10 +246419,12 @@ async function createDevServer(options8) {
|
|
|
246381
246419
|
emitEntityEvent = (appId, entityName, event) => {
|
|
246382
246420
|
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246383
246421
|
};
|
|
246384
|
-
const base44ConfigWatcher = new WatchBase44(
|
|
246385
|
-
|
|
246386
|
-
|
|
246387
|
-
|
|
246422
|
+
const base44ConfigWatcher = new WatchBase44([
|
|
246423
|
+
{
|
|
246424
|
+
name: "functions",
|
|
246425
|
+
path: join18(dirname14(project2.configPath), project2.functionsDir)
|
|
246426
|
+
}
|
|
246427
|
+
], devLogger);
|
|
246388
246428
|
base44ConfigWatcher.on("change", async (name2) => {
|
|
246389
246429
|
try {
|
|
246390
246430
|
if (name2 === "functions") {
|
|
@@ -246398,18 +246438,6 @@ async function createDevServer(options8) {
|
|
|
246398
246438
|
devLogger.log("All functions removed");
|
|
246399
246439
|
}
|
|
246400
246440
|
}
|
|
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
246441
|
} catch (error48) {
|
|
246414
246442
|
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246415
246443
|
devLogger.error(errorMessage);
|
|
@@ -249786,9 +249814,9 @@ function matchPropertyGroup(propertyGroup, propertyValues, cohortProperties, deb
|
|
|
249786
249814
|
throw new InconclusiveMatchError("can't match cohort without a given cohort property value");
|
|
249787
249815
|
return propertyGroupType === "AND";
|
|
249788
249816
|
}
|
|
249789
|
-
function isValidRegex(
|
|
249817
|
+
function isValidRegex(regex2) {
|
|
249790
249818
|
try {
|
|
249791
|
-
new RegExp(
|
|
249819
|
+
new RegExp(regex2);
|
|
249792
249820
|
return true;
|
|
249793
249821
|
} catch (err) {
|
|
249794
249822
|
return false;
|
|
@@ -249806,8 +249834,8 @@ function convertToDateTime(value) {
|
|
|
249806
249834
|
throw new InconclusiveMatchError(`The date provided ${value} must be a string, number, or date object`);
|
|
249807
249835
|
}
|
|
249808
249836
|
function relativeDateParseForFeatureFlagMatching(value) {
|
|
249809
|
-
const
|
|
249810
|
-
const match = value.match(
|
|
249837
|
+
const regex2 = /^-?(?<number>[0-9]+)(?<interval>[a-z])$/;
|
|
249838
|
+
const match = value.match(regex2);
|
|
249811
249839
|
const parsedDt = new Date(new Date().toISOString());
|
|
249812
249840
|
if (!match)
|
|
249813
249841
|
return null;
|
|
@@ -250800,4 +250828,4 @@ export {
|
|
|
250800
250828
|
CLIExitError
|
|
250801
250829
|
};
|
|
250802
250830
|
|
|
250803
|
-
//# debugId=
|
|
250831
|
+
//# debugId=BFC56E0BF807E18264756E2164756E21
|