@base44-preview/cli 0.0.37-pr.362.d9c1e3b → 0.0.37-pr.364.15494ed
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 +2242 -152
- package/dist/cli/index.js.map +41 -10
- package/package.json +4 -4
package/dist/cli/index.js
CHANGED
|
@@ -13211,58 +13211,34 @@ var require_cross_spawn = __commonJS((exports, module) => {
|
|
|
13211
13211
|
module.exports._enoent = enoent;
|
|
13212
13212
|
});
|
|
13213
13213
|
|
|
13214
|
-
// node_modules/lodash
|
|
13215
|
-
var
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
var
|
|
13242
|
-
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
13243
|
-
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
13244
|
-
var rsUpper = "[" + rsUpperRange + "]";
|
|
13245
|
-
var rsZWJ = "\\u200d";
|
|
13246
|
-
var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")";
|
|
13247
|
-
var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")";
|
|
13248
|
-
var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
|
|
13249
|
-
var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
|
|
13250
|
-
var reOptMod = rsModifier + "?";
|
|
13251
|
-
var rsOptVar = "[" + rsVarRange + "]?";
|
|
13252
|
-
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
13253
|
-
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
13254
|
-
var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
|
|
13255
|
-
var reApos = RegExp(rsApos, "g");
|
|
13256
|
-
var reComboMark = RegExp(rsCombo, "g");
|
|
13257
|
-
var reUnicodeWord = RegExp([
|
|
13258
|
-
rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
13259
|
-
rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")",
|
|
13260
|
-
rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr,
|
|
13261
|
-
rsUpper + "+" + rsOptUpperContr,
|
|
13262
|
-
rsDigits,
|
|
13263
|
-
rsEmoji
|
|
13264
|
-
].join("|"), "g");
|
|
13265
|
-
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
13214
|
+
// node_modules/lodash/_arrayReduce.js
|
|
13215
|
+
var require__arrayReduce = __commonJS((exports, module) => {
|
|
13216
|
+
function arrayReduce(array2, iteratee, accumulator, initAccum) {
|
|
13217
|
+
var index = -1, length = array2 == null ? 0 : array2.length;
|
|
13218
|
+
if (initAccum && length) {
|
|
13219
|
+
accumulator = array2[++index];
|
|
13220
|
+
}
|
|
13221
|
+
while (++index < length) {
|
|
13222
|
+
accumulator = iteratee(accumulator, array2[index], index, array2);
|
|
13223
|
+
}
|
|
13224
|
+
return accumulator;
|
|
13225
|
+
}
|
|
13226
|
+
module.exports = arrayReduce;
|
|
13227
|
+
});
|
|
13228
|
+
|
|
13229
|
+
// node_modules/lodash/_basePropertyOf.js
|
|
13230
|
+
var require__basePropertyOf = __commonJS((exports, module) => {
|
|
13231
|
+
function basePropertyOf(object2) {
|
|
13232
|
+
return function(key) {
|
|
13233
|
+
return object2 == null ? undefined : object2[key];
|
|
13234
|
+
};
|
|
13235
|
+
}
|
|
13236
|
+
module.exports = basePropertyOf;
|
|
13237
|
+
});
|
|
13238
|
+
|
|
13239
|
+
// node_modules/lodash/_deburrLetter.js
|
|
13240
|
+
var require__deburrLetter = __commonJS((exports, module) => {
|
|
13241
|
+
var basePropertyOf = require__basePropertyOf();
|
|
13266
13242
|
var deburredLetters = {
|
|
13267
13243
|
"À": "A",
|
|
13268
13244
|
"Á": "A",
|
|
@@ -13453,72 +13429,256 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
13453
13429
|
"Œ": "Oe",
|
|
13454
13430
|
"œ": "oe",
|
|
13455
13431
|
"ʼn": "'n",
|
|
13456
|
-
"ſ": "
|
|
13432
|
+
"ſ": "s"
|
|
13457
13433
|
};
|
|
13434
|
+
var deburrLetter = basePropertyOf(deburredLetters);
|
|
13435
|
+
module.exports = deburrLetter;
|
|
13436
|
+
});
|
|
13437
|
+
|
|
13438
|
+
// node_modules/lodash/_freeGlobal.js
|
|
13439
|
+
var require__freeGlobal = __commonJS((exports, module) => {
|
|
13458
13440
|
var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
|
|
13441
|
+
module.exports = freeGlobal;
|
|
13442
|
+
});
|
|
13443
|
+
|
|
13444
|
+
// node_modules/lodash/_root.js
|
|
13445
|
+
var require__root = __commonJS((exports, module) => {
|
|
13446
|
+
var freeGlobal = require__freeGlobal();
|
|
13459
13447
|
var freeSelf = typeof self == "object" && self && self.Object === Object && self;
|
|
13460
13448
|
var root = freeGlobal || freeSelf || Function("return this")();
|
|
13461
|
-
|
|
13462
|
-
|
|
13463
|
-
|
|
13464
|
-
|
|
13465
|
-
|
|
13449
|
+
module.exports = root;
|
|
13450
|
+
});
|
|
13451
|
+
|
|
13452
|
+
// node_modules/lodash/_Symbol.js
|
|
13453
|
+
var require__Symbol = __commonJS((exports, module) => {
|
|
13454
|
+
var root = require__root();
|
|
13455
|
+
var Symbol2 = root.Symbol;
|
|
13456
|
+
module.exports = Symbol2;
|
|
13457
|
+
});
|
|
13458
|
+
|
|
13459
|
+
// node_modules/lodash/_arrayMap.js
|
|
13460
|
+
var require__arrayMap = __commonJS((exports, module) => {
|
|
13461
|
+
function arrayMap(array2, iteratee) {
|
|
13462
|
+
var index = -1, length = array2 == null ? 0 : array2.length, result = Array(length);
|
|
13466
13463
|
while (++index < length) {
|
|
13467
|
-
|
|
13464
|
+
result[index] = iteratee(array2[index], index, array2);
|
|
13468
13465
|
}
|
|
13469
|
-
return
|
|
13466
|
+
return result;
|
|
13470
13467
|
}
|
|
13471
|
-
|
|
13472
|
-
|
|
13468
|
+
module.exports = arrayMap;
|
|
13469
|
+
});
|
|
13470
|
+
|
|
13471
|
+
// node_modules/lodash/isArray.js
|
|
13472
|
+
var require_isArray = __commonJS((exports, module) => {
|
|
13473
|
+
var isArray = Array.isArray;
|
|
13474
|
+
module.exports = isArray;
|
|
13475
|
+
});
|
|
13476
|
+
|
|
13477
|
+
// node_modules/lodash/_getRawTag.js
|
|
13478
|
+
var require__getRawTag = __commonJS((exports, module) => {
|
|
13479
|
+
var Symbol2 = require__Symbol();
|
|
13480
|
+
var objectProto = Object.prototype;
|
|
13481
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
13482
|
+
var nativeObjectToString = objectProto.toString;
|
|
13483
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
|
|
13484
|
+
function getRawTag(value) {
|
|
13485
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag), tag = value[symToStringTag];
|
|
13486
|
+
try {
|
|
13487
|
+
value[symToStringTag] = undefined;
|
|
13488
|
+
var unmasked = true;
|
|
13489
|
+
} catch (e2) {}
|
|
13490
|
+
var result = nativeObjectToString.call(value);
|
|
13491
|
+
if (unmasked) {
|
|
13492
|
+
if (isOwn) {
|
|
13493
|
+
value[symToStringTag] = tag;
|
|
13494
|
+
} else {
|
|
13495
|
+
delete value[symToStringTag];
|
|
13496
|
+
}
|
|
13497
|
+
}
|
|
13498
|
+
return result;
|
|
13473
13499
|
}
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13500
|
+
module.exports = getRawTag;
|
|
13501
|
+
});
|
|
13502
|
+
|
|
13503
|
+
// node_modules/lodash/_objectToString.js
|
|
13504
|
+
var require__objectToString = __commonJS((exports, module) => {
|
|
13505
|
+
var objectProto = Object.prototype;
|
|
13506
|
+
var nativeObjectToString = objectProto.toString;
|
|
13507
|
+
function objectToString3(value) {
|
|
13508
|
+
return nativeObjectToString.call(value);
|
|
13478
13509
|
}
|
|
13479
|
-
|
|
13480
|
-
|
|
13481
|
-
|
|
13510
|
+
module.exports = objectToString3;
|
|
13511
|
+
});
|
|
13512
|
+
|
|
13513
|
+
// node_modules/lodash/_baseGetTag.js
|
|
13514
|
+
var require__baseGetTag = __commonJS((exports, module) => {
|
|
13515
|
+
var Symbol2 = require__Symbol();
|
|
13516
|
+
var getRawTag = require__getRawTag();
|
|
13517
|
+
var objectToString3 = require__objectToString();
|
|
13518
|
+
var nullTag = "[object Null]";
|
|
13519
|
+
var undefinedTag = "[object Undefined]";
|
|
13520
|
+
var symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined;
|
|
13521
|
+
function baseGetTag(value) {
|
|
13522
|
+
if (value == null) {
|
|
13523
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
13524
|
+
}
|
|
13525
|
+
return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString3(value);
|
|
13482
13526
|
}
|
|
13483
|
-
|
|
13484
|
-
|
|
13527
|
+
module.exports = baseGetTag;
|
|
13528
|
+
});
|
|
13529
|
+
|
|
13530
|
+
// node_modules/lodash/isObjectLike.js
|
|
13531
|
+
var require_isObjectLike = __commonJS((exports, module) => {
|
|
13532
|
+
function isObjectLike(value) {
|
|
13533
|
+
return value != null && typeof value == "object";
|
|
13485
13534
|
}
|
|
13486
|
-
|
|
13487
|
-
|
|
13488
|
-
|
|
13535
|
+
module.exports = isObjectLike;
|
|
13536
|
+
});
|
|
13537
|
+
|
|
13538
|
+
// node_modules/lodash/isSymbol.js
|
|
13539
|
+
var require_isSymbol = __commonJS((exports, module) => {
|
|
13540
|
+
var baseGetTag = require__baseGetTag();
|
|
13541
|
+
var isObjectLike = require_isObjectLike();
|
|
13542
|
+
var symbolTag = "[object Symbol]";
|
|
13543
|
+
function isSymbol(value) {
|
|
13544
|
+
return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag;
|
|
13545
|
+
}
|
|
13546
|
+
module.exports = isSymbol;
|
|
13547
|
+
});
|
|
13548
|
+
|
|
13549
|
+
// node_modules/lodash/_baseToString.js
|
|
13550
|
+
var require__baseToString = __commonJS((exports, module) => {
|
|
13551
|
+
var Symbol2 = require__Symbol();
|
|
13552
|
+
var arrayMap = require__arrayMap();
|
|
13553
|
+
var isArray = require_isArray();
|
|
13554
|
+
var isSymbol = require_isSymbol();
|
|
13555
|
+
var INFINITY = 1 / 0;
|
|
13489
13556
|
var symbolProto = Symbol2 ? Symbol2.prototype : undefined;
|
|
13490
13557
|
var symbolToString = symbolProto ? symbolProto.toString : undefined;
|
|
13491
13558
|
function baseToString(value) {
|
|
13492
13559
|
if (typeof value == "string") {
|
|
13493
13560
|
return value;
|
|
13494
13561
|
}
|
|
13562
|
+
if (isArray(value)) {
|
|
13563
|
+
return arrayMap(value, baseToString) + "";
|
|
13564
|
+
}
|
|
13495
13565
|
if (isSymbol(value)) {
|
|
13496
13566
|
return symbolToString ? symbolToString.call(value) : "";
|
|
13497
13567
|
}
|
|
13498
13568
|
var result = value + "";
|
|
13499
13569
|
return result == "0" && 1 / value == -INFINITY ? "-0" : result;
|
|
13500
13570
|
}
|
|
13501
|
-
|
|
13502
|
-
|
|
13503
|
-
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
|
|
13507
|
-
return !!value && typeof value == "object";
|
|
13508
|
-
}
|
|
13509
|
-
function isSymbol(value) {
|
|
13510
|
-
return typeof value == "symbol" || isObjectLike(value) && objectToString3.call(value) == symbolTag;
|
|
13511
|
-
}
|
|
13571
|
+
module.exports = baseToString;
|
|
13572
|
+
});
|
|
13573
|
+
|
|
13574
|
+
// node_modules/lodash/toString.js
|
|
13575
|
+
var require_toString = __commonJS((exports, module) => {
|
|
13576
|
+
var baseToString = require__baseToString();
|
|
13512
13577
|
function toString2(value) {
|
|
13513
13578
|
return value == null ? "" : baseToString(value);
|
|
13514
13579
|
}
|
|
13580
|
+
module.exports = toString2;
|
|
13581
|
+
});
|
|
13582
|
+
|
|
13583
|
+
// node_modules/lodash/deburr.js
|
|
13584
|
+
var require_deburr = __commonJS((exports, module) => {
|
|
13585
|
+
var deburrLetter = require__deburrLetter();
|
|
13586
|
+
var toString2 = require_toString();
|
|
13587
|
+
var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;
|
|
13588
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
13589
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
13590
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
13591
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
13592
|
+
var rsCombo = "[" + rsComboRange + "]";
|
|
13593
|
+
var reComboMark = RegExp(rsCombo, "g");
|
|
13515
13594
|
function deburr(string4) {
|
|
13516
13595
|
string4 = toString2(string4);
|
|
13517
13596
|
return string4 && string4.replace(reLatin, deburrLetter).replace(reComboMark, "");
|
|
13518
13597
|
}
|
|
13519
|
-
|
|
13520
|
-
|
|
13521
|
-
|
|
13598
|
+
module.exports = deburr;
|
|
13599
|
+
});
|
|
13600
|
+
|
|
13601
|
+
// node_modules/lodash/_asciiWords.js
|
|
13602
|
+
var require__asciiWords = __commonJS((exports, module) => {
|
|
13603
|
+
var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;
|
|
13604
|
+
function asciiWords(string4) {
|
|
13605
|
+
return string4.match(reAsciiWord) || [];
|
|
13606
|
+
}
|
|
13607
|
+
module.exports = asciiWords;
|
|
13608
|
+
});
|
|
13609
|
+
|
|
13610
|
+
// node_modules/lodash/_hasUnicodeWord.js
|
|
13611
|
+
var require__hasUnicodeWord = __commonJS((exports, module) => {
|
|
13612
|
+
var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;
|
|
13613
|
+
function hasUnicodeWord(string4) {
|
|
13614
|
+
return reHasUnicodeWord.test(string4);
|
|
13615
|
+
}
|
|
13616
|
+
module.exports = hasUnicodeWord;
|
|
13617
|
+
});
|
|
13618
|
+
|
|
13619
|
+
// node_modules/lodash/_unicodeWords.js
|
|
13620
|
+
var require__unicodeWords = __commonJS((exports, module) => {
|
|
13621
|
+
var rsAstralRange = "\\ud800-\\udfff";
|
|
13622
|
+
var rsComboMarksRange = "\\u0300-\\u036f";
|
|
13623
|
+
var reComboHalfMarksRange = "\\ufe20-\\ufe2f";
|
|
13624
|
+
var rsComboSymbolsRange = "\\u20d0-\\u20ff";
|
|
13625
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
|
13626
|
+
var rsDingbatRange = "\\u2700-\\u27bf";
|
|
13627
|
+
var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff";
|
|
13628
|
+
var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7";
|
|
13629
|
+
var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf";
|
|
13630
|
+
var rsPunctuationRange = "\\u2000-\\u206f";
|
|
13631
|
+
var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000";
|
|
13632
|
+
var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde";
|
|
13633
|
+
var rsVarRange = "\\ufe0e\\ufe0f";
|
|
13634
|
+
var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;
|
|
13635
|
+
var rsApos = "['’]";
|
|
13636
|
+
var rsBreak = "[" + rsBreakRange + "]";
|
|
13637
|
+
var rsCombo = "[" + rsComboRange + "]";
|
|
13638
|
+
var rsDigits = "\\d+";
|
|
13639
|
+
var rsDingbat = "[" + rsDingbatRange + "]";
|
|
13640
|
+
var rsLower = "[" + rsLowerRange + "]";
|
|
13641
|
+
var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]";
|
|
13642
|
+
var rsFitz = "\\ud83c[\\udffb-\\udfff]";
|
|
13643
|
+
var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")";
|
|
13644
|
+
var rsNonAstral = "[^" + rsAstralRange + "]";
|
|
13645
|
+
var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}";
|
|
13646
|
+
var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]";
|
|
13647
|
+
var rsUpper = "[" + rsUpperRange + "]";
|
|
13648
|
+
var rsZWJ = "\\u200d";
|
|
13649
|
+
var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")";
|
|
13650
|
+
var rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")";
|
|
13651
|
+
var rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?";
|
|
13652
|
+
var rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?";
|
|
13653
|
+
var reOptMod = rsModifier + "?";
|
|
13654
|
+
var rsOptVar = "[" + rsVarRange + "]?";
|
|
13655
|
+
var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*";
|
|
13656
|
+
var rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])";
|
|
13657
|
+
var rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])";
|
|
13658
|
+
var rsSeq = rsOptVar + reOptMod + rsOptJoin;
|
|
13659
|
+
var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq;
|
|
13660
|
+
var reUnicodeWord = RegExp([
|
|
13661
|
+
rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")",
|
|
13662
|
+
rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")",
|
|
13663
|
+
rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower,
|
|
13664
|
+
rsUpper + "+" + rsOptContrUpper,
|
|
13665
|
+
rsOrdUpper,
|
|
13666
|
+
rsOrdLower,
|
|
13667
|
+
rsDigits,
|
|
13668
|
+
rsEmoji
|
|
13669
|
+
].join("|"), "g");
|
|
13670
|
+
function unicodeWords(string4) {
|
|
13671
|
+
return string4.match(reUnicodeWord) || [];
|
|
13672
|
+
}
|
|
13673
|
+
module.exports = unicodeWords;
|
|
13674
|
+
});
|
|
13675
|
+
|
|
13676
|
+
// node_modules/lodash/words.js
|
|
13677
|
+
var require_words = __commonJS((exports, module) => {
|
|
13678
|
+
var asciiWords = require__asciiWords();
|
|
13679
|
+
var hasUnicodeWord = require__hasUnicodeWord();
|
|
13680
|
+
var toString2 = require_toString();
|
|
13681
|
+
var unicodeWords = require__unicodeWords();
|
|
13522
13682
|
function words(string4, pattern, guard) {
|
|
13523
13683
|
string4 = toString2(string4);
|
|
13524
13684
|
pattern = guard ? undefined : pattern;
|
|
@@ -13527,6 +13687,30 @@ var require_lodash = __commonJS((exports, module) => {
|
|
|
13527
13687
|
}
|
|
13528
13688
|
return string4.match(pattern) || [];
|
|
13529
13689
|
}
|
|
13690
|
+
module.exports = words;
|
|
13691
|
+
});
|
|
13692
|
+
|
|
13693
|
+
// node_modules/lodash/_createCompounder.js
|
|
13694
|
+
var require__createCompounder = __commonJS((exports, module) => {
|
|
13695
|
+
var arrayReduce = require__arrayReduce();
|
|
13696
|
+
var deburr = require_deburr();
|
|
13697
|
+
var words = require_words();
|
|
13698
|
+
var rsApos = "['’]";
|
|
13699
|
+
var reApos = RegExp(rsApos, "g");
|
|
13700
|
+
function createCompounder(callback) {
|
|
13701
|
+
return function(string4) {
|
|
13702
|
+
return arrayReduce(words(deburr(string4).replace(reApos, "")), callback, "");
|
|
13703
|
+
};
|
|
13704
|
+
}
|
|
13705
|
+
module.exports = createCompounder;
|
|
13706
|
+
});
|
|
13707
|
+
|
|
13708
|
+
// node_modules/lodash/kebabCase.js
|
|
13709
|
+
var require_kebabCase = __commonJS((exports, module) => {
|
|
13710
|
+
var createCompounder = require__createCompounder();
|
|
13711
|
+
var kebabCase = createCompounder(function(result, word, index) {
|
|
13712
|
+
return result + (index ? "-" : "") + word.toLowerCase();
|
|
13713
|
+
});
|
|
13530
13714
|
module.exports = kebabCase;
|
|
13531
13715
|
});
|
|
13532
13716
|
|
|
@@ -14609,7 +14793,7 @@ var require_lib2 = __commonJS((exports) => {
|
|
|
14609
14793
|
});
|
|
14610
14794
|
|
|
14611
14795
|
// node_modules/lodash/lodash.js
|
|
14612
|
-
var
|
|
14796
|
+
var require_lodash = __commonJS((exports, module) => {
|
|
14613
14797
|
(function() {
|
|
14614
14798
|
var undefined2;
|
|
14615
14799
|
var VERSION = "4.17.23";
|
|
@@ -127599,7 +127783,7 @@ var require_AST = __commonJS((exports) => {
|
|
|
127599
127783
|
var require_JSONSchema = __commonJS((exports) => {
|
|
127600
127784
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
127601
127785
|
exports.isCompound = exports.isPrimitive = exports.isBoolean = exports.getRootSchema = exports.Intersection = exports.Types = exports.Parent = undefined;
|
|
127602
|
-
var lodash_1 =
|
|
127786
|
+
var lodash_1 = require_lodash();
|
|
127603
127787
|
exports.Parent = Symbol("Parent");
|
|
127604
127788
|
exports.Types = Symbol("Types");
|
|
127605
127789
|
exports.Intersection = Symbol("Intersection");
|
|
@@ -130406,7 +130590,7 @@ var require_utils7 = __commonJS((exports) => {
|
|
|
130406
130590
|
};
|
|
130407
130591
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
130408
130592
|
exports.parseFileAsJSONSchema = exports.isSchemaLike = exports.appendToDescription = exports.maybeStripDefault = exports.pathTransform = exports.escapeBlockComment = exports.log = exports.error = exports.generateName = exports.toSafeString = exports.stripExtension = exports.justName = exports.traverse = exports.Try = undefined;
|
|
130409
|
-
var lodash_1 =
|
|
130593
|
+
var lodash_1 = require_lodash();
|
|
130410
130594
|
var path_1 = __require("path");
|
|
130411
130595
|
var JSONSchema_1 = require_JSONSchema();
|
|
130412
130596
|
var js_yaml_1 = __importDefault(require_js_yaml3());
|
|
@@ -130737,7 +130921,7 @@ ${values.join(`
|
|
|
130737
130921
|
var require_generator = __commonJS((exports) => {
|
|
130738
130922
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
130739
130923
|
exports.generateType = exports.generate = undefined;
|
|
130740
|
-
var lodash_1 =
|
|
130924
|
+
var lodash_1 = require_lodash();
|
|
130741
130925
|
var index_1 = require_src3();
|
|
130742
130926
|
var AST_1 = require_AST();
|
|
130743
130927
|
var utils_1 = require_utils7();
|
|
@@ -131000,7 +131184,7 @@ var require_generator = __commonJS((exports) => {
|
|
|
131000
131184
|
var require_typesOfSchema = __commonJS((exports) => {
|
|
131001
131185
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
131002
131186
|
exports.typesOfSchema = undefined;
|
|
131003
|
-
var lodash_1 =
|
|
131187
|
+
var lodash_1 = require_lodash();
|
|
131004
131188
|
var JSONSchema_1 = require_JSONSchema();
|
|
131005
131189
|
function typesOfSchema(schema9) {
|
|
131006
131190
|
if (schema9.tsType) {
|
|
@@ -131359,7 +131543,7 @@ var require_normalizer = __commonJS((exports) => {
|
|
|
131359
131543
|
var require_optimizer = __commonJS((exports) => {
|
|
131360
131544
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
131361
131545
|
exports.optimize = undefined;
|
|
131362
|
-
var lodash_1 =
|
|
131546
|
+
var lodash_1 = require_lodash();
|
|
131363
131547
|
var generator_1 = require_generator();
|
|
131364
131548
|
var AST_1 = require_AST();
|
|
131365
131549
|
var utils_1 = require_utils7();
|
|
@@ -131425,7 +131609,7 @@ var require_optimizer = __commonJS((exports) => {
|
|
|
131425
131609
|
var require_parser = __commonJS((exports) => {
|
|
131426
131610
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
131427
131611
|
exports.parse = undefined;
|
|
131428
|
-
var lodash_1 =
|
|
131612
|
+
var lodash_1 = require_lodash();
|
|
131429
131613
|
var util_1 = __require("util");
|
|
131430
131614
|
var applySchemaTyping_1 = require_applySchemaTyping();
|
|
131431
131615
|
var AST_1 = require_AST();
|
|
@@ -137278,7 +137462,7 @@ var require_linker = __commonJS((exports) => {
|
|
|
137278
137462
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
137279
137463
|
exports.link = undefined;
|
|
137280
137464
|
var JSONSchema_1 = require_JSONSchema();
|
|
137281
|
-
var lodash_1 =
|
|
137465
|
+
var lodash_1 = require_lodash();
|
|
137282
137466
|
function link2(schema9, parent = null) {
|
|
137283
137467
|
if (!Array.isArray(schema9) && !(0, lodash_1.isPlainObject)(schema9)) {
|
|
137284
137468
|
return schema9;
|
|
@@ -137346,7 +137530,7 @@ var require_src3 = __commonJS((exports) => {
|
|
|
137346
137530
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
137347
137531
|
exports.ValidationError = exports.compile = exports.compileFromFile = exports.DEFAULT_OPTIONS = undefined;
|
|
137348
137532
|
var fs_1 = __require("fs");
|
|
137349
|
-
var lodash_1 =
|
|
137533
|
+
var lodash_1 = require_lodash();
|
|
137350
137534
|
var path_1 = __require("path");
|
|
137351
137535
|
var formatter_1 = require_formatter();
|
|
137352
137536
|
var generator_1 = require_generator();
|
|
@@ -210218,6 +210402,168 @@ var require_multer = __commonJS((exports, module) => {
|
|
|
210218
210402
|
module.exports.MulterError = MulterError;
|
|
210219
210403
|
});
|
|
210220
210404
|
|
|
210405
|
+
// node_modules/lodash/isObject.js
|
|
210406
|
+
var require_isObject = __commonJS((exports, module) => {
|
|
210407
|
+
function isObject5(value) {
|
|
210408
|
+
var type = typeof value;
|
|
210409
|
+
return value != null && (type == "object" || type == "function");
|
|
210410
|
+
}
|
|
210411
|
+
module.exports = isObject5;
|
|
210412
|
+
});
|
|
210413
|
+
|
|
210414
|
+
// node_modules/lodash/now.js
|
|
210415
|
+
var require_now = __commonJS((exports, module) => {
|
|
210416
|
+
var root2 = require__root();
|
|
210417
|
+
var now = function() {
|
|
210418
|
+
return root2.Date.now();
|
|
210419
|
+
};
|
|
210420
|
+
module.exports = now;
|
|
210421
|
+
});
|
|
210422
|
+
|
|
210423
|
+
// node_modules/lodash/_trimmedEndIndex.js
|
|
210424
|
+
var require__trimmedEndIndex = __commonJS((exports, module) => {
|
|
210425
|
+
var reWhitespace = /\s/;
|
|
210426
|
+
function trimmedEndIndex(string4) {
|
|
210427
|
+
var index = string4.length;
|
|
210428
|
+
while (index-- && reWhitespace.test(string4.charAt(index))) {}
|
|
210429
|
+
return index;
|
|
210430
|
+
}
|
|
210431
|
+
module.exports = trimmedEndIndex;
|
|
210432
|
+
});
|
|
210433
|
+
|
|
210434
|
+
// node_modules/lodash/_baseTrim.js
|
|
210435
|
+
var require__baseTrim = __commonJS((exports, module) => {
|
|
210436
|
+
var trimmedEndIndex = require__trimmedEndIndex();
|
|
210437
|
+
var reTrimStart = /^\s+/;
|
|
210438
|
+
function baseTrim(string4) {
|
|
210439
|
+
return string4 ? string4.slice(0, trimmedEndIndex(string4) + 1).replace(reTrimStart, "") : string4;
|
|
210440
|
+
}
|
|
210441
|
+
module.exports = baseTrim;
|
|
210442
|
+
});
|
|
210443
|
+
|
|
210444
|
+
// node_modules/lodash/toNumber.js
|
|
210445
|
+
var require_toNumber = __commonJS((exports, module) => {
|
|
210446
|
+
var baseTrim = require__baseTrim();
|
|
210447
|
+
var isObject5 = require_isObject();
|
|
210448
|
+
var isSymbol = require_isSymbol();
|
|
210449
|
+
var NAN = 0 / 0;
|
|
210450
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
210451
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
210452
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
210453
|
+
var freeParseInt = parseInt;
|
|
210454
|
+
function toNumber(value) {
|
|
210455
|
+
if (typeof value == "number") {
|
|
210456
|
+
return value;
|
|
210457
|
+
}
|
|
210458
|
+
if (isSymbol(value)) {
|
|
210459
|
+
return NAN;
|
|
210460
|
+
}
|
|
210461
|
+
if (isObject5(value)) {
|
|
210462
|
+
var other = typeof value.valueOf == "function" ? value.valueOf() : value;
|
|
210463
|
+
value = isObject5(other) ? other + "" : other;
|
|
210464
|
+
}
|
|
210465
|
+
if (typeof value != "string") {
|
|
210466
|
+
return value === 0 ? value : +value;
|
|
210467
|
+
}
|
|
210468
|
+
value = baseTrim(value);
|
|
210469
|
+
var isBinary = reIsBinary.test(value);
|
|
210470
|
+
return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value;
|
|
210471
|
+
}
|
|
210472
|
+
module.exports = toNumber;
|
|
210473
|
+
});
|
|
210474
|
+
|
|
210475
|
+
// node_modules/lodash/debounce.js
|
|
210476
|
+
var require_debounce = __commonJS((exports, module) => {
|
|
210477
|
+
var isObject5 = require_isObject();
|
|
210478
|
+
var now = require_now();
|
|
210479
|
+
var toNumber = require_toNumber();
|
|
210480
|
+
var FUNC_ERROR_TEXT = "Expected a function";
|
|
210481
|
+
var nativeMax = Math.max;
|
|
210482
|
+
var nativeMin = Math.min;
|
|
210483
|
+
function debounce(func, wait, options8) {
|
|
210484
|
+
var lastArgs, lastThis, maxWait, result, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true;
|
|
210485
|
+
if (typeof func != "function") {
|
|
210486
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
210487
|
+
}
|
|
210488
|
+
wait = toNumber(wait) || 0;
|
|
210489
|
+
if (isObject5(options8)) {
|
|
210490
|
+
leading = !!options8.leading;
|
|
210491
|
+
maxing = "maxWait" in options8;
|
|
210492
|
+
maxWait = maxing ? nativeMax(toNumber(options8.maxWait) || 0, wait) : maxWait;
|
|
210493
|
+
trailing = "trailing" in options8 ? !!options8.trailing : trailing;
|
|
210494
|
+
}
|
|
210495
|
+
function invokeFunc(time3) {
|
|
210496
|
+
var args = lastArgs, thisArg = lastThis;
|
|
210497
|
+
lastArgs = lastThis = undefined;
|
|
210498
|
+
lastInvokeTime = time3;
|
|
210499
|
+
result = func.apply(thisArg, args);
|
|
210500
|
+
return result;
|
|
210501
|
+
}
|
|
210502
|
+
function leadingEdge(time3) {
|
|
210503
|
+
lastInvokeTime = time3;
|
|
210504
|
+
timerId = setTimeout(timerExpired, wait);
|
|
210505
|
+
return leading ? invokeFunc(time3) : result;
|
|
210506
|
+
}
|
|
210507
|
+
function remainingWait(time3) {
|
|
210508
|
+
var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime, timeWaiting = wait - timeSinceLastCall;
|
|
210509
|
+
return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting;
|
|
210510
|
+
}
|
|
210511
|
+
function shouldInvoke(time3) {
|
|
210512
|
+
var timeSinceLastCall = time3 - lastCallTime, timeSinceLastInvoke = time3 - lastInvokeTime;
|
|
210513
|
+
return lastCallTime === undefined || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait;
|
|
210514
|
+
}
|
|
210515
|
+
function timerExpired() {
|
|
210516
|
+
var time3 = now();
|
|
210517
|
+
if (shouldInvoke(time3)) {
|
|
210518
|
+
return trailingEdge(time3);
|
|
210519
|
+
}
|
|
210520
|
+
timerId = setTimeout(timerExpired, remainingWait(time3));
|
|
210521
|
+
}
|
|
210522
|
+
function trailingEdge(time3) {
|
|
210523
|
+
timerId = undefined;
|
|
210524
|
+
if (trailing && lastArgs) {
|
|
210525
|
+
return invokeFunc(time3);
|
|
210526
|
+
}
|
|
210527
|
+
lastArgs = lastThis = undefined;
|
|
210528
|
+
return result;
|
|
210529
|
+
}
|
|
210530
|
+
function cancel() {
|
|
210531
|
+
if (timerId !== undefined) {
|
|
210532
|
+
clearTimeout(timerId);
|
|
210533
|
+
}
|
|
210534
|
+
lastInvokeTime = 0;
|
|
210535
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
210536
|
+
}
|
|
210537
|
+
function flush() {
|
|
210538
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
210539
|
+
}
|
|
210540
|
+
function debounced() {
|
|
210541
|
+
var time3 = now(), isInvoking = shouldInvoke(time3);
|
|
210542
|
+
lastArgs = arguments;
|
|
210543
|
+
lastThis = this;
|
|
210544
|
+
lastCallTime = time3;
|
|
210545
|
+
if (isInvoking) {
|
|
210546
|
+
if (timerId === undefined) {
|
|
210547
|
+
return leadingEdge(lastCallTime);
|
|
210548
|
+
}
|
|
210549
|
+
if (maxing) {
|
|
210550
|
+
clearTimeout(timerId);
|
|
210551
|
+
timerId = setTimeout(timerExpired, wait);
|
|
210552
|
+
return invokeFunc(lastCallTime);
|
|
210553
|
+
}
|
|
210554
|
+
}
|
|
210555
|
+
if (timerId === undefined) {
|
|
210556
|
+
timerId = setTimeout(timerExpired, wait);
|
|
210557
|
+
}
|
|
210558
|
+
return result;
|
|
210559
|
+
}
|
|
210560
|
+
debounced.cancel = cancel;
|
|
210561
|
+
debounced.flush = flush;
|
|
210562
|
+
return debounced;
|
|
210563
|
+
}
|
|
210564
|
+
module.exports = debounce;
|
|
210565
|
+
});
|
|
210566
|
+
|
|
210221
210567
|
// node_modules/@vercel/detect-agent/dist/index.js
|
|
210222
210568
|
var require_dist5 = __commonJS((exports, module) => {
|
|
210223
210569
|
var __defProp4 = Object.defineProperty;
|
|
@@ -210243,8 +210589,8 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210243
210589
|
determineAgent: () => determineAgent
|
|
210244
210590
|
});
|
|
210245
210591
|
module.exports = __toCommonJS(src_exports);
|
|
210246
|
-
var
|
|
210247
|
-
var
|
|
210592
|
+
var import_promises22 = __require("node:fs/promises");
|
|
210593
|
+
var import_node_fs21 = __require("node:fs");
|
|
210248
210594
|
var DEVIN_LOCAL_PATH = "/opt/.devin";
|
|
210249
210595
|
var CURSOR2 = "cursor";
|
|
210250
210596
|
var CURSOR_CLI = "cursor-cli";
|
|
@@ -210301,7 +210647,7 @@ var require_dist5 = __commonJS((exports, module) => {
|
|
|
210301
210647
|
return { isAgent: true, agent: { name: REPLIT } };
|
|
210302
210648
|
}
|
|
210303
210649
|
try {
|
|
210304
|
-
await (0,
|
|
210650
|
+
await (0, import_promises22.access)(DEVIN_LOCAL_PATH, import_node_fs21.constants.F_OK);
|
|
210305
210651
|
return { isAgent: true, agent: { name: DEVIN } };
|
|
210306
210652
|
} catch (error48) {}
|
|
210307
210653
|
return { isAgent: false, agent: undefined };
|
|
@@ -225867,8 +226213,6 @@ function getAuthFilePath() {
|
|
|
225867
226213
|
return join(getBase44GlobalDir(), "auth", "auth.json");
|
|
225868
226214
|
}
|
|
225869
226215
|
function getTemplatesDir() {
|
|
225870
|
-
if (globalThis.__BASE44_TEMPLATES_DIR)
|
|
225871
|
-
return globalThis.__BASE44_TEMPLATES_DIR;
|
|
225872
226216
|
return join(__dirname2, "../templates");
|
|
225873
226217
|
}
|
|
225874
226218
|
function getTemplatesIndexPath() {
|
|
@@ -241558,7 +241902,6 @@ var package_default = {
|
|
|
241558
241902
|
"lint:fix": "biome check --write src tests",
|
|
241559
241903
|
test: "vitest run",
|
|
241560
241904
|
"test:watch": "vitest",
|
|
241561
|
-
"build:binaries": "bun run infra/build-binaries.ts",
|
|
241562
241905
|
knip: "knip",
|
|
241563
241906
|
"knip:fix": "knip --fix"
|
|
241564
241907
|
},
|
|
@@ -241584,11 +241927,12 @@ var package_default = {
|
|
|
241584
241927
|
"@types/ejs": "^3.1.5",
|
|
241585
241928
|
"@types/express": "^5.0.6",
|
|
241586
241929
|
"@types/json-schema": "^7.0.15",
|
|
241587
|
-
"@types/lodash
|
|
241588
|
-
"@types/node": "^22.10.5",
|
|
241930
|
+
"@types/lodash": "^4.17.24",
|
|
241589
241931
|
"@types/multer": "^2.0.0",
|
|
241932
|
+
"@types/node": "^22.10.5",
|
|
241590
241933
|
"@vercel/detect-agent": "^1.1.0",
|
|
241591
241934
|
chalk: "^5.6.2",
|
|
241935
|
+
chokidar: "^5.0.0",
|
|
241592
241936
|
commander: "^12.1.0",
|
|
241593
241937
|
"common-tags": "^1.8.2",
|
|
241594
241938
|
cors: "^2.8.5",
|
|
@@ -241604,9 +241948,9 @@ var package_default = {
|
|
|
241604
241948
|
json5: "^2.2.3",
|
|
241605
241949
|
knip: "^5.83.1",
|
|
241606
241950
|
ky: "^1.14.2",
|
|
241607
|
-
|
|
241608
|
-
multer: "^2.0.0",
|
|
241951
|
+
lodash: "^4.17.23",
|
|
241609
241952
|
msw: "^2.12.10",
|
|
241953
|
+
multer: "^2.0.0",
|
|
241610
241954
|
nanoid: "^5.1.6",
|
|
241611
241955
|
open: "^11.0.0",
|
|
241612
241956
|
"p-wait-for": "^6.0.0",
|
|
@@ -242733,7 +243077,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
242733
243077
|
|
|
242734
243078
|
// src/cli/commands/project/create.ts
|
|
242735
243079
|
import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
|
|
242736
|
-
var
|
|
243080
|
+
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
242737
243081
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
242738
243082
|
async function getTemplateById(templateId) {
|
|
242739
243083
|
const templates = await listTemplates();
|
|
@@ -242777,7 +243121,7 @@ async function createInteractive(options) {
|
|
|
242777
243121
|
});
|
|
242778
243122
|
},
|
|
242779
243123
|
projectPath: async ({ results }) => {
|
|
242780
|
-
const suggestedPath = await isDirEmpty() ? "./" : `./${
|
|
243124
|
+
const suggestedPath = await isDirEmpty() ? "./" : `./${import_kebabCase.default(results.name)}`;
|
|
242781
243125
|
return Ze({
|
|
242782
243126
|
message: "Where should we create your project?",
|
|
242783
243127
|
placeholder: suggestedPath,
|
|
@@ -243540,6 +243884,7 @@ function getTypesCommand(context) {
|
|
|
243540
243884
|
}
|
|
243541
243885
|
|
|
243542
243886
|
// src/cli/dev/dev-server/main.ts
|
|
243887
|
+
import { dirname as dirname14, join as join18 } from "node:path";
|
|
243543
243888
|
var import_cors = __toESM(require_lib4(), 1);
|
|
243544
243889
|
var import_express4 = __toESM(require_express(), 1);
|
|
243545
243890
|
|
|
@@ -243701,7 +244046,7 @@ import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
|
243701
244046
|
import { dirname as dirname11, join as join15 } from "node:path";
|
|
243702
244047
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
243703
244048
|
var __dirname5 = dirname11(fileURLToPath7(import.meta.url));
|
|
243704
|
-
var WRAPPER_PATH =
|
|
244049
|
+
var WRAPPER_PATH = join15(__dirname5, "../deno-runtime/main.js");
|
|
243705
244050
|
var READY_TIMEOUT = 30000;
|
|
243706
244051
|
|
|
243707
244052
|
class FunctionManager {
|
|
@@ -243747,6 +244092,10 @@ class FunctionManager {
|
|
|
243747
244092
|
try {
|
|
243748
244093
|
return await promise2;
|
|
243749
244094
|
} finally {
|
|
244095
|
+
if (!this.starting.has(name2) && this.running.has(name2)) {
|
|
244096
|
+
this.running.get(name2)?.process.kill();
|
|
244097
|
+
this.running.delete(name2);
|
|
244098
|
+
}
|
|
243750
244099
|
this.starting.delete(name2);
|
|
243751
244100
|
}
|
|
243752
244101
|
}
|
|
@@ -243762,9 +244111,13 @@ class FunctionManager {
|
|
|
243762
244111
|
this.setupProcessHandlers(name2, process21);
|
|
243763
244112
|
return this.waitForReady(name2, runningFunc);
|
|
243764
244113
|
}
|
|
244114
|
+
reload(functions) {
|
|
244115
|
+
this.stopAll();
|
|
244116
|
+
this.functions = new Map(functions.map((f7) => [f7.name, f7]));
|
|
244117
|
+
}
|
|
243765
244118
|
stopAll() {
|
|
243766
244119
|
for (const [name2, { process: process21 }] of this.running) {
|
|
243767
|
-
this.logger.log(`
|
|
244120
|
+
this.logger.log(`Stopping function: ${name2}`);
|
|
243768
244121
|
process21.kill();
|
|
243769
244122
|
}
|
|
243770
244123
|
this.running.clear();
|
|
@@ -243775,7 +244128,7 @@ class FunctionManager {
|
|
|
243775
244128
|
return getPorts({ exclude: usedPorts });
|
|
243776
244129
|
}
|
|
243777
244130
|
spawnFunction(func, port) {
|
|
243778
|
-
this.logger.log(`
|
|
244131
|
+
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
243779
244132
|
const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
|
|
243780
244133
|
env: {
|
|
243781
244134
|
...globalThis.process.env,
|
|
@@ -243803,11 +244156,13 @@ class FunctionManager {
|
|
|
243803
244156
|
}
|
|
243804
244157
|
});
|
|
243805
244158
|
process21.on("exit", (code2) => {
|
|
243806
|
-
|
|
244159
|
+
if (code2 !== null) {
|
|
244160
|
+
this.logger.log(`Function "${name2}" exited with code ${code2}`);
|
|
244161
|
+
}
|
|
243807
244162
|
this.running.delete(name2);
|
|
243808
244163
|
});
|
|
243809
244164
|
process21.on("error", (error48) => {
|
|
243810
|
-
this.logger.error(`
|
|
244165
|
+
this.logger.error(`Function "${name2}" error:`, error48);
|
|
243811
244166
|
this.running.delete(name2);
|
|
243812
244167
|
});
|
|
243813
244168
|
}
|
|
@@ -243892,9 +244247,8 @@ function createFunctionRouter(manager, logger) {
|
|
|
243892
244247
|
var import_nedb = __toESM(require_nedb(), 1);
|
|
243893
244248
|
|
|
243894
244249
|
class Database {
|
|
243895
|
-
collections;
|
|
243896
|
-
|
|
243897
|
-
this.collections = new Map;
|
|
244250
|
+
collections = new Map;
|
|
244251
|
+
load(entities) {
|
|
243898
244252
|
for (const entity2 of entities) {
|
|
243899
244253
|
this.collections.set(entity2.name, new import_nedb.default);
|
|
243900
244254
|
}
|
|
@@ -243905,6 +244259,12 @@ class Database {
|
|
|
243905
244259
|
getCollectionNames() {
|
|
243906
244260
|
return Array.from(this.collections.keys());
|
|
243907
244261
|
}
|
|
244262
|
+
dropAll() {
|
|
244263
|
+
for (const collection of this.collections.values()) {
|
|
244264
|
+
collection.remove({}, { multi: true });
|
|
244265
|
+
}
|
|
244266
|
+
this.collections.clear();
|
|
244267
|
+
}
|
|
243908
244268
|
}
|
|
243909
244269
|
|
|
243910
244270
|
// node_modules/socket.io/wrapper.mjs
|
|
@@ -244258,6 +244618,1702 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
244258
244618
|
return router;
|
|
244259
244619
|
}
|
|
244260
244620
|
|
|
244621
|
+
// src/cli/dev/dev-server/watcher.ts
|
|
244622
|
+
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
244623
|
+
import { relative as relative4 } from "node:path";
|
|
244624
|
+
|
|
244625
|
+
// node_modules/chokidar/index.js
|
|
244626
|
+
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
244627
|
+
import { stat as statcb, Stats } from "node:fs";
|
|
244628
|
+
import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
|
|
244629
|
+
import * as sp3 from "node:path";
|
|
244630
|
+
|
|
244631
|
+
// node_modules/readdirp/index.js
|
|
244632
|
+
import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
|
|
244633
|
+
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
244634
|
+
import { Readable as Readable6 } from "node:stream";
|
|
244635
|
+
var EntryTypes = {
|
|
244636
|
+
FILE_TYPE: "files",
|
|
244637
|
+
DIR_TYPE: "directories",
|
|
244638
|
+
FILE_DIR_TYPE: "files_directories",
|
|
244639
|
+
EVERYTHING_TYPE: "all"
|
|
244640
|
+
};
|
|
244641
|
+
var defaultOptions = {
|
|
244642
|
+
root: ".",
|
|
244643
|
+
fileFilter: (_entryInfo) => true,
|
|
244644
|
+
directoryFilter: (_entryInfo) => true,
|
|
244645
|
+
type: EntryTypes.FILE_TYPE,
|
|
244646
|
+
lstat: false,
|
|
244647
|
+
depth: 2147483648,
|
|
244648
|
+
alwaysStat: false,
|
|
244649
|
+
highWaterMark: 4096
|
|
244650
|
+
};
|
|
244651
|
+
Object.freeze(defaultOptions);
|
|
244652
|
+
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
244653
|
+
var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
244654
|
+
var ALL_TYPES = [
|
|
244655
|
+
EntryTypes.DIR_TYPE,
|
|
244656
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244657
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
244658
|
+
EntryTypes.FILE_TYPE
|
|
244659
|
+
];
|
|
244660
|
+
var DIR_TYPES = new Set([
|
|
244661
|
+
EntryTypes.DIR_TYPE,
|
|
244662
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244663
|
+
EntryTypes.FILE_DIR_TYPE
|
|
244664
|
+
]);
|
|
244665
|
+
var FILE_TYPES2 = new Set([
|
|
244666
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244667
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
244668
|
+
EntryTypes.FILE_TYPE
|
|
244669
|
+
]);
|
|
244670
|
+
var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
|
|
244671
|
+
var wantBigintFsStats = process.platform === "win32";
|
|
244672
|
+
var emptyFn = (_entryInfo) => true;
|
|
244673
|
+
var normalizeFilter = (filter2) => {
|
|
244674
|
+
if (filter2 === undefined)
|
|
244675
|
+
return emptyFn;
|
|
244676
|
+
if (typeof filter2 === "function")
|
|
244677
|
+
return filter2;
|
|
244678
|
+
if (typeof filter2 === "string") {
|
|
244679
|
+
const fl6 = filter2.trim();
|
|
244680
|
+
return (entry) => entry.basename === fl6;
|
|
244681
|
+
}
|
|
244682
|
+
if (Array.isArray(filter2)) {
|
|
244683
|
+
const trItems = filter2.map((item) => item.trim());
|
|
244684
|
+
return (entry) => trItems.some((f7) => entry.basename === f7);
|
|
244685
|
+
}
|
|
244686
|
+
return emptyFn;
|
|
244687
|
+
};
|
|
244688
|
+
|
|
244689
|
+
class ReaddirpStream extends Readable6 {
|
|
244690
|
+
parents;
|
|
244691
|
+
reading;
|
|
244692
|
+
parent;
|
|
244693
|
+
_stat;
|
|
244694
|
+
_maxDepth;
|
|
244695
|
+
_wantsDir;
|
|
244696
|
+
_wantsFile;
|
|
244697
|
+
_wantsEverything;
|
|
244698
|
+
_root;
|
|
244699
|
+
_isDirent;
|
|
244700
|
+
_statsProp;
|
|
244701
|
+
_rdOptions;
|
|
244702
|
+
_fileFilter;
|
|
244703
|
+
_directoryFilter;
|
|
244704
|
+
constructor(options8 = {}) {
|
|
244705
|
+
super({
|
|
244706
|
+
objectMode: true,
|
|
244707
|
+
autoDestroy: true,
|
|
244708
|
+
highWaterMark: options8.highWaterMark
|
|
244709
|
+
});
|
|
244710
|
+
const opts = { ...defaultOptions, ...options8 };
|
|
244711
|
+
const { root: root2, type } = opts;
|
|
244712
|
+
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
244713
|
+
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
244714
|
+
const statMethod = opts.lstat ? lstat2 : stat2;
|
|
244715
|
+
if (wantBigintFsStats) {
|
|
244716
|
+
this._stat = (path19) => statMethod(path19, { bigint: true });
|
|
244717
|
+
} else {
|
|
244718
|
+
this._stat = statMethod;
|
|
244719
|
+
}
|
|
244720
|
+
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
244721
|
+
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
244722
|
+
this._wantsFile = type ? FILE_TYPES2.has(type) : false;
|
|
244723
|
+
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
244724
|
+
this._root = presolve(root2);
|
|
244725
|
+
this._isDirent = !opts.alwaysStat;
|
|
244726
|
+
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
244727
|
+
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
244728
|
+
this.parents = [this._exploreDir(root2, 1)];
|
|
244729
|
+
this.reading = false;
|
|
244730
|
+
this.parent = undefined;
|
|
244731
|
+
}
|
|
244732
|
+
async _read(batch) {
|
|
244733
|
+
if (this.reading)
|
|
244734
|
+
return;
|
|
244735
|
+
this.reading = true;
|
|
244736
|
+
try {
|
|
244737
|
+
while (!this.destroyed && batch > 0) {
|
|
244738
|
+
const par = this.parent;
|
|
244739
|
+
const fil = par && par.files;
|
|
244740
|
+
if (fil && fil.length > 0) {
|
|
244741
|
+
const { path: path19, depth } = par;
|
|
244742
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path19));
|
|
244743
|
+
const awaited = await Promise.all(slice);
|
|
244744
|
+
for (const entry of awaited) {
|
|
244745
|
+
if (!entry)
|
|
244746
|
+
continue;
|
|
244747
|
+
if (this.destroyed)
|
|
244748
|
+
return;
|
|
244749
|
+
const entryType = await this._getEntryType(entry);
|
|
244750
|
+
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
244751
|
+
if (depth <= this._maxDepth) {
|
|
244752
|
+
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
|
|
244753
|
+
}
|
|
244754
|
+
if (this._wantsDir) {
|
|
244755
|
+
this.push(entry);
|
|
244756
|
+
batch--;
|
|
244757
|
+
}
|
|
244758
|
+
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
244759
|
+
if (this._wantsFile) {
|
|
244760
|
+
this.push(entry);
|
|
244761
|
+
batch--;
|
|
244762
|
+
}
|
|
244763
|
+
}
|
|
244764
|
+
}
|
|
244765
|
+
} else {
|
|
244766
|
+
const parent = this.parents.pop();
|
|
244767
|
+
if (!parent) {
|
|
244768
|
+
this.push(null);
|
|
244769
|
+
break;
|
|
244770
|
+
}
|
|
244771
|
+
this.parent = await parent;
|
|
244772
|
+
if (this.destroyed)
|
|
244773
|
+
return;
|
|
244774
|
+
}
|
|
244775
|
+
}
|
|
244776
|
+
} catch (error48) {
|
|
244777
|
+
this.destroy(error48);
|
|
244778
|
+
} finally {
|
|
244779
|
+
this.reading = false;
|
|
244780
|
+
}
|
|
244781
|
+
}
|
|
244782
|
+
async _exploreDir(path19, depth) {
|
|
244783
|
+
let files;
|
|
244784
|
+
try {
|
|
244785
|
+
files = await readdir2(path19, this._rdOptions);
|
|
244786
|
+
} catch (error48) {
|
|
244787
|
+
this._onError(error48);
|
|
244788
|
+
}
|
|
244789
|
+
return { files, depth, path: path19 };
|
|
244790
|
+
}
|
|
244791
|
+
async _formatEntry(dirent, path19) {
|
|
244792
|
+
let entry;
|
|
244793
|
+
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
244794
|
+
try {
|
|
244795
|
+
const fullPath = presolve(pjoin(path19, basename4));
|
|
244796
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
|
|
244797
|
+
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
244798
|
+
} catch (err) {
|
|
244799
|
+
this._onError(err);
|
|
244800
|
+
return;
|
|
244801
|
+
}
|
|
244802
|
+
return entry;
|
|
244803
|
+
}
|
|
244804
|
+
_onError(err) {
|
|
244805
|
+
if (isNormalFlowError(err) && !this.destroyed) {
|
|
244806
|
+
this.emit("warn", err);
|
|
244807
|
+
} else {
|
|
244808
|
+
this.destroy(err);
|
|
244809
|
+
}
|
|
244810
|
+
}
|
|
244811
|
+
async _getEntryType(entry) {
|
|
244812
|
+
if (!entry && this._statsProp in entry) {
|
|
244813
|
+
return "";
|
|
244814
|
+
}
|
|
244815
|
+
const stats = entry[this._statsProp];
|
|
244816
|
+
if (stats.isFile())
|
|
244817
|
+
return "file";
|
|
244818
|
+
if (stats.isDirectory())
|
|
244819
|
+
return "directory";
|
|
244820
|
+
if (stats && stats.isSymbolicLink()) {
|
|
244821
|
+
const full = entry.fullPath;
|
|
244822
|
+
try {
|
|
244823
|
+
const entryRealPath = await realpath(full);
|
|
244824
|
+
const entryRealPathStats = await lstat2(entryRealPath);
|
|
244825
|
+
if (entryRealPathStats.isFile()) {
|
|
244826
|
+
return "file";
|
|
244827
|
+
}
|
|
244828
|
+
if (entryRealPathStats.isDirectory()) {
|
|
244829
|
+
const len = entryRealPath.length;
|
|
244830
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
|
|
244831
|
+
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
244832
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
244833
|
+
return this._onError(recursiveError);
|
|
244834
|
+
}
|
|
244835
|
+
return "directory";
|
|
244836
|
+
}
|
|
244837
|
+
} catch (error48) {
|
|
244838
|
+
this._onError(error48);
|
|
244839
|
+
return "";
|
|
244840
|
+
}
|
|
244841
|
+
}
|
|
244842
|
+
}
|
|
244843
|
+
_includeAsFile(entry) {
|
|
244844
|
+
const stats = entry && entry[this._statsProp];
|
|
244845
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
244846
|
+
}
|
|
244847
|
+
}
|
|
244848
|
+
function readdirp(root2, options8 = {}) {
|
|
244849
|
+
let type = options8.entryType || options8.type;
|
|
244850
|
+
if (type === "both")
|
|
244851
|
+
type = EntryTypes.FILE_DIR_TYPE;
|
|
244852
|
+
if (type)
|
|
244853
|
+
options8.type = type;
|
|
244854
|
+
if (!root2) {
|
|
244855
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
244856
|
+
} else if (typeof root2 !== "string") {
|
|
244857
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
244858
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
244859
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
244860
|
+
}
|
|
244861
|
+
options8.root = root2;
|
|
244862
|
+
return new ReaddirpStream(options8);
|
|
244863
|
+
}
|
|
244864
|
+
|
|
244865
|
+
// node_modules/chokidar/handler.js
|
|
244866
|
+
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
244867
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
|
|
244868
|
+
import { type as osType } from "node:os";
|
|
244869
|
+
import * as sp2 from "node:path";
|
|
244870
|
+
var STR_DATA = "data";
|
|
244871
|
+
var STR_END = "end";
|
|
244872
|
+
var STR_CLOSE = "close";
|
|
244873
|
+
var EMPTY_FN = () => {};
|
|
244874
|
+
var pl6 = process.platform;
|
|
244875
|
+
var isWindows4 = pl6 === "win32";
|
|
244876
|
+
var isMacos = pl6 === "darwin";
|
|
244877
|
+
var isLinux = pl6 === "linux";
|
|
244878
|
+
var isFreeBSD = pl6 === "freebsd";
|
|
244879
|
+
var isIBMi = osType() === "OS400";
|
|
244880
|
+
var EVENTS = {
|
|
244881
|
+
ALL: "all",
|
|
244882
|
+
READY: "ready",
|
|
244883
|
+
ADD: "add",
|
|
244884
|
+
CHANGE: "change",
|
|
244885
|
+
ADD_DIR: "addDir",
|
|
244886
|
+
UNLINK: "unlink",
|
|
244887
|
+
UNLINK_DIR: "unlinkDir",
|
|
244888
|
+
RAW: "raw",
|
|
244889
|
+
ERROR: "error"
|
|
244890
|
+
};
|
|
244891
|
+
var EV = EVENTS;
|
|
244892
|
+
var THROTTLE_MODE_WATCH = "watch";
|
|
244893
|
+
var statMethods = { lstat: lstat3, stat: stat3 };
|
|
244894
|
+
var KEY_LISTENERS = "listeners";
|
|
244895
|
+
var KEY_ERR = "errHandlers";
|
|
244896
|
+
var KEY_RAW = "rawEmitters";
|
|
244897
|
+
var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
|
|
244898
|
+
var binaryExtensions = new Set([
|
|
244899
|
+
"3dm",
|
|
244900
|
+
"3ds",
|
|
244901
|
+
"3g2",
|
|
244902
|
+
"3gp",
|
|
244903
|
+
"7z",
|
|
244904
|
+
"a",
|
|
244905
|
+
"aac",
|
|
244906
|
+
"adp",
|
|
244907
|
+
"afdesign",
|
|
244908
|
+
"afphoto",
|
|
244909
|
+
"afpub",
|
|
244910
|
+
"ai",
|
|
244911
|
+
"aif",
|
|
244912
|
+
"aiff",
|
|
244913
|
+
"alz",
|
|
244914
|
+
"ape",
|
|
244915
|
+
"apk",
|
|
244916
|
+
"appimage",
|
|
244917
|
+
"ar",
|
|
244918
|
+
"arj",
|
|
244919
|
+
"asf",
|
|
244920
|
+
"au",
|
|
244921
|
+
"avi",
|
|
244922
|
+
"bak",
|
|
244923
|
+
"baml",
|
|
244924
|
+
"bh",
|
|
244925
|
+
"bin",
|
|
244926
|
+
"bk",
|
|
244927
|
+
"bmp",
|
|
244928
|
+
"btif",
|
|
244929
|
+
"bz2",
|
|
244930
|
+
"bzip2",
|
|
244931
|
+
"cab",
|
|
244932
|
+
"caf",
|
|
244933
|
+
"cgm",
|
|
244934
|
+
"class",
|
|
244935
|
+
"cmx",
|
|
244936
|
+
"cpio",
|
|
244937
|
+
"cr2",
|
|
244938
|
+
"cur",
|
|
244939
|
+
"dat",
|
|
244940
|
+
"dcm",
|
|
244941
|
+
"deb",
|
|
244942
|
+
"dex",
|
|
244943
|
+
"djvu",
|
|
244944
|
+
"dll",
|
|
244945
|
+
"dmg",
|
|
244946
|
+
"dng",
|
|
244947
|
+
"doc",
|
|
244948
|
+
"docm",
|
|
244949
|
+
"docx",
|
|
244950
|
+
"dot",
|
|
244951
|
+
"dotm",
|
|
244952
|
+
"dra",
|
|
244953
|
+
"DS_Store",
|
|
244954
|
+
"dsk",
|
|
244955
|
+
"dts",
|
|
244956
|
+
"dtshd",
|
|
244957
|
+
"dvb",
|
|
244958
|
+
"dwg",
|
|
244959
|
+
"dxf",
|
|
244960
|
+
"ecelp4800",
|
|
244961
|
+
"ecelp7470",
|
|
244962
|
+
"ecelp9600",
|
|
244963
|
+
"egg",
|
|
244964
|
+
"eol",
|
|
244965
|
+
"eot",
|
|
244966
|
+
"epub",
|
|
244967
|
+
"exe",
|
|
244968
|
+
"f4v",
|
|
244969
|
+
"fbs",
|
|
244970
|
+
"fh",
|
|
244971
|
+
"fla",
|
|
244972
|
+
"flac",
|
|
244973
|
+
"flatpak",
|
|
244974
|
+
"fli",
|
|
244975
|
+
"flv",
|
|
244976
|
+
"fpx",
|
|
244977
|
+
"fst",
|
|
244978
|
+
"fvt",
|
|
244979
|
+
"g3",
|
|
244980
|
+
"gh",
|
|
244981
|
+
"gif",
|
|
244982
|
+
"graffle",
|
|
244983
|
+
"gz",
|
|
244984
|
+
"gzip",
|
|
244985
|
+
"h261",
|
|
244986
|
+
"h263",
|
|
244987
|
+
"h264",
|
|
244988
|
+
"icns",
|
|
244989
|
+
"ico",
|
|
244990
|
+
"ief",
|
|
244991
|
+
"img",
|
|
244992
|
+
"ipa",
|
|
244993
|
+
"iso",
|
|
244994
|
+
"jar",
|
|
244995
|
+
"jpeg",
|
|
244996
|
+
"jpg",
|
|
244997
|
+
"jpgv",
|
|
244998
|
+
"jpm",
|
|
244999
|
+
"jxr",
|
|
245000
|
+
"key",
|
|
245001
|
+
"ktx",
|
|
245002
|
+
"lha",
|
|
245003
|
+
"lib",
|
|
245004
|
+
"lvp",
|
|
245005
|
+
"lz",
|
|
245006
|
+
"lzh",
|
|
245007
|
+
"lzma",
|
|
245008
|
+
"lzo",
|
|
245009
|
+
"m3u",
|
|
245010
|
+
"m4a",
|
|
245011
|
+
"m4v",
|
|
245012
|
+
"mar",
|
|
245013
|
+
"mdi",
|
|
245014
|
+
"mht",
|
|
245015
|
+
"mid",
|
|
245016
|
+
"midi",
|
|
245017
|
+
"mj2",
|
|
245018
|
+
"mka",
|
|
245019
|
+
"mkv",
|
|
245020
|
+
"mmr",
|
|
245021
|
+
"mng",
|
|
245022
|
+
"mobi",
|
|
245023
|
+
"mov",
|
|
245024
|
+
"movie",
|
|
245025
|
+
"mp3",
|
|
245026
|
+
"mp4",
|
|
245027
|
+
"mp4a",
|
|
245028
|
+
"mpeg",
|
|
245029
|
+
"mpg",
|
|
245030
|
+
"mpga",
|
|
245031
|
+
"mxu",
|
|
245032
|
+
"nef",
|
|
245033
|
+
"npx",
|
|
245034
|
+
"numbers",
|
|
245035
|
+
"nupkg",
|
|
245036
|
+
"o",
|
|
245037
|
+
"odp",
|
|
245038
|
+
"ods",
|
|
245039
|
+
"odt",
|
|
245040
|
+
"oga",
|
|
245041
|
+
"ogg",
|
|
245042
|
+
"ogv",
|
|
245043
|
+
"otf",
|
|
245044
|
+
"ott",
|
|
245045
|
+
"pages",
|
|
245046
|
+
"pbm",
|
|
245047
|
+
"pcx",
|
|
245048
|
+
"pdb",
|
|
245049
|
+
"pdf",
|
|
245050
|
+
"pea",
|
|
245051
|
+
"pgm",
|
|
245052
|
+
"pic",
|
|
245053
|
+
"png",
|
|
245054
|
+
"pnm",
|
|
245055
|
+
"pot",
|
|
245056
|
+
"potm",
|
|
245057
|
+
"potx",
|
|
245058
|
+
"ppa",
|
|
245059
|
+
"ppam",
|
|
245060
|
+
"ppm",
|
|
245061
|
+
"pps",
|
|
245062
|
+
"ppsm",
|
|
245063
|
+
"ppsx",
|
|
245064
|
+
"ppt",
|
|
245065
|
+
"pptm",
|
|
245066
|
+
"pptx",
|
|
245067
|
+
"psd",
|
|
245068
|
+
"pya",
|
|
245069
|
+
"pyc",
|
|
245070
|
+
"pyo",
|
|
245071
|
+
"pyv",
|
|
245072
|
+
"qt",
|
|
245073
|
+
"rar",
|
|
245074
|
+
"ras",
|
|
245075
|
+
"raw",
|
|
245076
|
+
"resources",
|
|
245077
|
+
"rgb",
|
|
245078
|
+
"rip",
|
|
245079
|
+
"rlc",
|
|
245080
|
+
"rmf",
|
|
245081
|
+
"rmvb",
|
|
245082
|
+
"rpm",
|
|
245083
|
+
"rtf",
|
|
245084
|
+
"rz",
|
|
245085
|
+
"s3m",
|
|
245086
|
+
"s7z",
|
|
245087
|
+
"scpt",
|
|
245088
|
+
"sgi",
|
|
245089
|
+
"shar",
|
|
245090
|
+
"snap",
|
|
245091
|
+
"sil",
|
|
245092
|
+
"sketch",
|
|
245093
|
+
"slk",
|
|
245094
|
+
"smv",
|
|
245095
|
+
"snk",
|
|
245096
|
+
"so",
|
|
245097
|
+
"stl",
|
|
245098
|
+
"suo",
|
|
245099
|
+
"sub",
|
|
245100
|
+
"swf",
|
|
245101
|
+
"tar",
|
|
245102
|
+
"tbz",
|
|
245103
|
+
"tbz2",
|
|
245104
|
+
"tga",
|
|
245105
|
+
"tgz",
|
|
245106
|
+
"thmx",
|
|
245107
|
+
"tif",
|
|
245108
|
+
"tiff",
|
|
245109
|
+
"tlz",
|
|
245110
|
+
"ttc",
|
|
245111
|
+
"ttf",
|
|
245112
|
+
"txz",
|
|
245113
|
+
"udf",
|
|
245114
|
+
"uvh",
|
|
245115
|
+
"uvi",
|
|
245116
|
+
"uvm",
|
|
245117
|
+
"uvp",
|
|
245118
|
+
"uvs",
|
|
245119
|
+
"uvu",
|
|
245120
|
+
"viv",
|
|
245121
|
+
"vob",
|
|
245122
|
+
"war",
|
|
245123
|
+
"wav",
|
|
245124
|
+
"wax",
|
|
245125
|
+
"wbmp",
|
|
245126
|
+
"wdp",
|
|
245127
|
+
"weba",
|
|
245128
|
+
"webm",
|
|
245129
|
+
"webp",
|
|
245130
|
+
"whl",
|
|
245131
|
+
"wim",
|
|
245132
|
+
"wm",
|
|
245133
|
+
"wma",
|
|
245134
|
+
"wmv",
|
|
245135
|
+
"wmx",
|
|
245136
|
+
"woff",
|
|
245137
|
+
"woff2",
|
|
245138
|
+
"wrm",
|
|
245139
|
+
"wvx",
|
|
245140
|
+
"xbm",
|
|
245141
|
+
"xif",
|
|
245142
|
+
"xla",
|
|
245143
|
+
"xlam",
|
|
245144
|
+
"xls",
|
|
245145
|
+
"xlsb",
|
|
245146
|
+
"xlsm",
|
|
245147
|
+
"xlsx",
|
|
245148
|
+
"xlt",
|
|
245149
|
+
"xltm",
|
|
245150
|
+
"xltx",
|
|
245151
|
+
"xm",
|
|
245152
|
+
"xmind",
|
|
245153
|
+
"xpi",
|
|
245154
|
+
"xpm",
|
|
245155
|
+
"xwd",
|
|
245156
|
+
"xz",
|
|
245157
|
+
"z",
|
|
245158
|
+
"zip",
|
|
245159
|
+
"zipx"
|
|
245160
|
+
]);
|
|
245161
|
+
var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
|
|
245162
|
+
var foreach = (val, fn9) => {
|
|
245163
|
+
if (val instanceof Set) {
|
|
245164
|
+
val.forEach(fn9);
|
|
245165
|
+
} else {
|
|
245166
|
+
fn9(val);
|
|
245167
|
+
}
|
|
245168
|
+
};
|
|
245169
|
+
var addAndConvert = (main, prop, item) => {
|
|
245170
|
+
let container = main[prop];
|
|
245171
|
+
if (!(container instanceof Set)) {
|
|
245172
|
+
main[prop] = container = new Set([container]);
|
|
245173
|
+
}
|
|
245174
|
+
container.add(item);
|
|
245175
|
+
};
|
|
245176
|
+
var clearItem = (cont) => (key2) => {
|
|
245177
|
+
const set2 = cont[key2];
|
|
245178
|
+
if (set2 instanceof Set) {
|
|
245179
|
+
set2.clear();
|
|
245180
|
+
} else {
|
|
245181
|
+
delete cont[key2];
|
|
245182
|
+
}
|
|
245183
|
+
};
|
|
245184
|
+
var delFromSet = (main, prop, item) => {
|
|
245185
|
+
const container = main[prop];
|
|
245186
|
+
if (container instanceof Set) {
|
|
245187
|
+
container.delete(item);
|
|
245188
|
+
} else if (container === item) {
|
|
245189
|
+
delete main[prop];
|
|
245190
|
+
}
|
|
245191
|
+
};
|
|
245192
|
+
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
245193
|
+
var FsWatchInstances = new Map;
|
|
245194
|
+
function createFsWatchInstance(path19, options8, listener, errHandler, emitRaw) {
|
|
245195
|
+
const handleEvent = (rawEvent, evPath) => {
|
|
245196
|
+
listener(path19);
|
|
245197
|
+
emitRaw(rawEvent, evPath, { watchedPath: path19 });
|
|
245198
|
+
if (evPath && path19 !== evPath) {
|
|
245199
|
+
fsWatchBroadcast(sp2.resolve(path19, evPath), KEY_LISTENERS, sp2.join(path19, evPath));
|
|
245200
|
+
}
|
|
245201
|
+
};
|
|
245202
|
+
try {
|
|
245203
|
+
return fs_watch(path19, {
|
|
245204
|
+
persistent: options8.persistent
|
|
245205
|
+
}, handleEvent);
|
|
245206
|
+
} catch (error48) {
|
|
245207
|
+
errHandler(error48);
|
|
245208
|
+
return;
|
|
245209
|
+
}
|
|
245210
|
+
}
|
|
245211
|
+
var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
245212
|
+
const cont = FsWatchInstances.get(fullPath);
|
|
245213
|
+
if (!cont)
|
|
245214
|
+
return;
|
|
245215
|
+
foreach(cont[listenerType], (listener) => {
|
|
245216
|
+
listener(val1, val2, val3);
|
|
245217
|
+
});
|
|
245218
|
+
};
|
|
245219
|
+
var setFsWatchListener = (path19, fullPath, options8, handlers) => {
|
|
245220
|
+
const { listener, errHandler, rawEmitter } = handlers;
|
|
245221
|
+
let cont = FsWatchInstances.get(fullPath);
|
|
245222
|
+
let watcher;
|
|
245223
|
+
if (!options8.persistent) {
|
|
245224
|
+
watcher = createFsWatchInstance(path19, options8, listener, errHandler, rawEmitter);
|
|
245225
|
+
if (!watcher)
|
|
245226
|
+
return;
|
|
245227
|
+
return watcher.close.bind(watcher);
|
|
245228
|
+
}
|
|
245229
|
+
if (cont) {
|
|
245230
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
245231
|
+
addAndConvert(cont, KEY_ERR, errHandler);
|
|
245232
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
245233
|
+
} else {
|
|
245234
|
+
watcher = createFsWatchInstance(path19, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
|
|
245235
|
+
if (!watcher)
|
|
245236
|
+
return;
|
|
245237
|
+
watcher.on(EV.ERROR, async (error48) => {
|
|
245238
|
+
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
245239
|
+
if (cont)
|
|
245240
|
+
cont.watcherUnusable = true;
|
|
245241
|
+
if (isWindows4 && error48.code === "EPERM") {
|
|
245242
|
+
try {
|
|
245243
|
+
const fd = await open2(path19, "r");
|
|
245244
|
+
await fd.close();
|
|
245245
|
+
broadcastErr(error48);
|
|
245246
|
+
} catch (err) {}
|
|
245247
|
+
} else {
|
|
245248
|
+
broadcastErr(error48);
|
|
245249
|
+
}
|
|
245250
|
+
});
|
|
245251
|
+
cont = {
|
|
245252
|
+
listeners: listener,
|
|
245253
|
+
errHandlers: errHandler,
|
|
245254
|
+
rawEmitters: rawEmitter,
|
|
245255
|
+
watcher
|
|
245256
|
+
};
|
|
245257
|
+
FsWatchInstances.set(fullPath, cont);
|
|
245258
|
+
}
|
|
245259
|
+
return () => {
|
|
245260
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
245261
|
+
delFromSet(cont, KEY_ERR, errHandler);
|
|
245262
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
245263
|
+
if (isEmptySet(cont.listeners)) {
|
|
245264
|
+
cont.watcher.close();
|
|
245265
|
+
FsWatchInstances.delete(fullPath);
|
|
245266
|
+
HANDLER_KEYS2.forEach(clearItem(cont));
|
|
245267
|
+
cont.watcher = undefined;
|
|
245268
|
+
Object.freeze(cont);
|
|
245269
|
+
}
|
|
245270
|
+
};
|
|
245271
|
+
};
|
|
245272
|
+
var FsWatchFileInstances = new Map;
|
|
245273
|
+
var setFsWatchFileListener = (path19, fullPath, options8, handlers) => {
|
|
245274
|
+
const { listener, rawEmitter } = handlers;
|
|
245275
|
+
let cont = FsWatchFileInstances.get(fullPath);
|
|
245276
|
+
const copts = cont && cont.options;
|
|
245277
|
+
if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
|
|
245278
|
+
unwatchFile(fullPath);
|
|
245279
|
+
cont = undefined;
|
|
245280
|
+
}
|
|
245281
|
+
if (cont) {
|
|
245282
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
245283
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
245284
|
+
} else {
|
|
245285
|
+
cont = {
|
|
245286
|
+
listeners: listener,
|
|
245287
|
+
rawEmitters: rawEmitter,
|
|
245288
|
+
options: options8,
|
|
245289
|
+
watcher: watchFile(fullPath, options8, (curr, prev) => {
|
|
245290
|
+
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
245291
|
+
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
245292
|
+
});
|
|
245293
|
+
const currmtime = curr.mtimeMs;
|
|
245294
|
+
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
245295
|
+
foreach(cont.listeners, (listener2) => listener2(path19, curr));
|
|
245296
|
+
}
|
|
245297
|
+
})
|
|
245298
|
+
};
|
|
245299
|
+
FsWatchFileInstances.set(fullPath, cont);
|
|
245300
|
+
}
|
|
245301
|
+
return () => {
|
|
245302
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
245303
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
245304
|
+
if (isEmptySet(cont.listeners)) {
|
|
245305
|
+
FsWatchFileInstances.delete(fullPath);
|
|
245306
|
+
unwatchFile(fullPath);
|
|
245307
|
+
cont.options = cont.watcher = undefined;
|
|
245308
|
+
Object.freeze(cont);
|
|
245309
|
+
}
|
|
245310
|
+
};
|
|
245311
|
+
};
|
|
245312
|
+
|
|
245313
|
+
class NodeFsHandler {
|
|
245314
|
+
fsw;
|
|
245315
|
+
_boundHandleError;
|
|
245316
|
+
constructor(fsW) {
|
|
245317
|
+
this.fsw = fsW;
|
|
245318
|
+
this._boundHandleError = (error48) => fsW._handleError(error48);
|
|
245319
|
+
}
|
|
245320
|
+
_watchWithNodeFs(path19, listener) {
|
|
245321
|
+
const opts = this.fsw.options;
|
|
245322
|
+
const directory = sp2.dirname(path19);
|
|
245323
|
+
const basename5 = sp2.basename(path19);
|
|
245324
|
+
const parent = this.fsw._getWatchedDir(directory);
|
|
245325
|
+
parent.add(basename5);
|
|
245326
|
+
const absolutePath = sp2.resolve(path19);
|
|
245327
|
+
const options8 = {
|
|
245328
|
+
persistent: opts.persistent
|
|
245329
|
+
};
|
|
245330
|
+
if (!listener)
|
|
245331
|
+
listener = EMPTY_FN;
|
|
245332
|
+
let closer;
|
|
245333
|
+
if (opts.usePolling) {
|
|
245334
|
+
const enableBin = opts.interval !== opts.binaryInterval;
|
|
245335
|
+
options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
|
|
245336
|
+
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
245337
|
+
listener,
|
|
245338
|
+
rawEmitter: this.fsw._emitRaw
|
|
245339
|
+
});
|
|
245340
|
+
} else {
|
|
245341
|
+
closer = setFsWatchListener(path19, absolutePath, options8, {
|
|
245342
|
+
listener,
|
|
245343
|
+
errHandler: this._boundHandleError,
|
|
245344
|
+
rawEmitter: this.fsw._emitRaw
|
|
245345
|
+
});
|
|
245346
|
+
}
|
|
245347
|
+
return closer;
|
|
245348
|
+
}
|
|
245349
|
+
_handleFile(file2, stats, initialAdd) {
|
|
245350
|
+
if (this.fsw.closed) {
|
|
245351
|
+
return;
|
|
245352
|
+
}
|
|
245353
|
+
const dirname13 = sp2.dirname(file2);
|
|
245354
|
+
const basename5 = sp2.basename(file2);
|
|
245355
|
+
const parent = this.fsw._getWatchedDir(dirname13);
|
|
245356
|
+
let prevStats = stats;
|
|
245357
|
+
if (parent.has(basename5))
|
|
245358
|
+
return;
|
|
245359
|
+
const listener = async (path19, newStats) => {
|
|
245360
|
+
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
245361
|
+
return;
|
|
245362
|
+
if (!newStats || newStats.mtimeMs === 0) {
|
|
245363
|
+
try {
|
|
245364
|
+
const newStats2 = await stat3(file2);
|
|
245365
|
+
if (this.fsw.closed)
|
|
245366
|
+
return;
|
|
245367
|
+
const at13 = newStats2.atimeMs;
|
|
245368
|
+
const mt12 = newStats2.mtimeMs;
|
|
245369
|
+
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
245370
|
+
this.fsw._emit(EV.CHANGE, file2, newStats2);
|
|
245371
|
+
}
|
|
245372
|
+
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
245373
|
+
this.fsw._closeFile(path19);
|
|
245374
|
+
prevStats = newStats2;
|
|
245375
|
+
const closer2 = this._watchWithNodeFs(file2, listener);
|
|
245376
|
+
if (closer2)
|
|
245377
|
+
this.fsw._addPathCloser(path19, closer2);
|
|
245378
|
+
} else {
|
|
245379
|
+
prevStats = newStats2;
|
|
245380
|
+
}
|
|
245381
|
+
} catch (error48) {
|
|
245382
|
+
this.fsw._remove(dirname13, basename5);
|
|
245383
|
+
}
|
|
245384
|
+
} else if (parent.has(basename5)) {
|
|
245385
|
+
const at13 = newStats.atimeMs;
|
|
245386
|
+
const mt12 = newStats.mtimeMs;
|
|
245387
|
+
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
245388
|
+
this.fsw._emit(EV.CHANGE, file2, newStats);
|
|
245389
|
+
}
|
|
245390
|
+
prevStats = newStats;
|
|
245391
|
+
}
|
|
245392
|
+
};
|
|
245393
|
+
const closer = this._watchWithNodeFs(file2, listener);
|
|
245394
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
|
|
245395
|
+
if (!this.fsw._throttle(EV.ADD, file2, 0))
|
|
245396
|
+
return;
|
|
245397
|
+
this.fsw._emit(EV.ADD, file2, stats);
|
|
245398
|
+
}
|
|
245399
|
+
return closer;
|
|
245400
|
+
}
|
|
245401
|
+
async _handleSymlink(entry, directory, path19, item) {
|
|
245402
|
+
if (this.fsw.closed) {
|
|
245403
|
+
return;
|
|
245404
|
+
}
|
|
245405
|
+
const full = entry.fullPath;
|
|
245406
|
+
const dir = this.fsw._getWatchedDir(directory);
|
|
245407
|
+
if (!this.fsw.options.followSymlinks) {
|
|
245408
|
+
this.fsw._incrReadyCount();
|
|
245409
|
+
let linkPath;
|
|
245410
|
+
try {
|
|
245411
|
+
linkPath = await fsrealpath(path19);
|
|
245412
|
+
} catch (e8) {
|
|
245413
|
+
this.fsw._emitReady();
|
|
245414
|
+
return true;
|
|
245415
|
+
}
|
|
245416
|
+
if (this.fsw.closed)
|
|
245417
|
+
return;
|
|
245418
|
+
if (dir.has(item)) {
|
|
245419
|
+
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
245420
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
245421
|
+
this.fsw._emit(EV.CHANGE, path19, entry.stats);
|
|
245422
|
+
}
|
|
245423
|
+
} else {
|
|
245424
|
+
dir.add(item);
|
|
245425
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
245426
|
+
this.fsw._emit(EV.ADD, path19, entry.stats);
|
|
245427
|
+
}
|
|
245428
|
+
this.fsw._emitReady();
|
|
245429
|
+
return true;
|
|
245430
|
+
}
|
|
245431
|
+
if (this.fsw._symlinkPaths.has(full)) {
|
|
245432
|
+
return true;
|
|
245433
|
+
}
|
|
245434
|
+
this.fsw._symlinkPaths.set(full, true);
|
|
245435
|
+
}
|
|
245436
|
+
_handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
|
|
245437
|
+
directory = sp2.join(directory, "");
|
|
245438
|
+
const throttleKey = target ? `${directory}:${target}` : directory;
|
|
245439
|
+
throttler = this.fsw._throttle("readdir", throttleKey, 1000);
|
|
245440
|
+
if (!throttler)
|
|
245441
|
+
return;
|
|
245442
|
+
const previous = this.fsw._getWatchedDir(wh2.path);
|
|
245443
|
+
const current = new Set;
|
|
245444
|
+
let stream = this.fsw._readdirp(directory, {
|
|
245445
|
+
fileFilter: (entry) => wh2.filterPath(entry),
|
|
245446
|
+
directoryFilter: (entry) => wh2.filterDir(entry)
|
|
245447
|
+
});
|
|
245448
|
+
if (!stream)
|
|
245449
|
+
return;
|
|
245450
|
+
stream.on(STR_DATA, async (entry) => {
|
|
245451
|
+
if (this.fsw.closed) {
|
|
245452
|
+
stream = undefined;
|
|
245453
|
+
return;
|
|
245454
|
+
}
|
|
245455
|
+
const item = entry.path;
|
|
245456
|
+
let path19 = sp2.join(directory, item);
|
|
245457
|
+
current.add(item);
|
|
245458
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path19, item)) {
|
|
245459
|
+
return;
|
|
245460
|
+
}
|
|
245461
|
+
if (this.fsw.closed) {
|
|
245462
|
+
stream = undefined;
|
|
245463
|
+
return;
|
|
245464
|
+
}
|
|
245465
|
+
if (item === target || !target && !previous.has(item)) {
|
|
245466
|
+
this.fsw._incrReadyCount();
|
|
245467
|
+
path19 = sp2.join(dir, sp2.relative(dir, path19));
|
|
245468
|
+
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
245469
|
+
}
|
|
245470
|
+
}).on(EV.ERROR, this._boundHandleError);
|
|
245471
|
+
return new Promise((resolve7, reject) => {
|
|
245472
|
+
if (!stream)
|
|
245473
|
+
return reject();
|
|
245474
|
+
stream.once(STR_END, () => {
|
|
245475
|
+
if (this.fsw.closed) {
|
|
245476
|
+
stream = undefined;
|
|
245477
|
+
return;
|
|
245478
|
+
}
|
|
245479
|
+
const wasThrottled = throttler ? throttler.clear() : false;
|
|
245480
|
+
resolve7(undefined);
|
|
245481
|
+
previous.getChildren().filter((item) => {
|
|
245482
|
+
return item !== directory && !current.has(item);
|
|
245483
|
+
}).forEach((item) => {
|
|
245484
|
+
this.fsw._remove(directory, item);
|
|
245485
|
+
});
|
|
245486
|
+
stream = undefined;
|
|
245487
|
+
if (wasThrottled)
|
|
245488
|
+
this._handleRead(directory, false, wh2, target, dir, depth, throttler);
|
|
245489
|
+
});
|
|
245490
|
+
});
|
|
245491
|
+
}
|
|
245492
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
|
|
245493
|
+
const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
|
|
245494
|
+
const tracked = parentDir.has(sp2.basename(dir));
|
|
245495
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
245496
|
+
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
245497
|
+
}
|
|
245498
|
+
parentDir.add(sp2.basename(dir));
|
|
245499
|
+
this.fsw._getWatchedDir(dir);
|
|
245500
|
+
let throttler;
|
|
245501
|
+
let closer;
|
|
245502
|
+
const oDepth = this.fsw.options.depth;
|
|
245503
|
+
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
|
|
245504
|
+
if (!target) {
|
|
245505
|
+
await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
|
|
245506
|
+
if (this.fsw.closed)
|
|
245507
|
+
return;
|
|
245508
|
+
}
|
|
245509
|
+
closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
|
|
245510
|
+
if (stats2 && stats2.mtimeMs === 0)
|
|
245511
|
+
return;
|
|
245512
|
+
this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
|
|
245513
|
+
});
|
|
245514
|
+
}
|
|
245515
|
+
return closer;
|
|
245516
|
+
}
|
|
245517
|
+
async _addToNodeFs(path19, initialAdd, priorWh, depth, target) {
|
|
245518
|
+
const ready = this.fsw._emitReady;
|
|
245519
|
+
if (this.fsw._isIgnored(path19) || this.fsw.closed) {
|
|
245520
|
+
ready();
|
|
245521
|
+
return false;
|
|
245522
|
+
}
|
|
245523
|
+
const wh2 = this.fsw._getWatchHelpers(path19);
|
|
245524
|
+
if (priorWh) {
|
|
245525
|
+
wh2.filterPath = (entry) => priorWh.filterPath(entry);
|
|
245526
|
+
wh2.filterDir = (entry) => priorWh.filterDir(entry);
|
|
245527
|
+
}
|
|
245528
|
+
try {
|
|
245529
|
+
const stats = await statMethods[wh2.statMethod](wh2.watchPath);
|
|
245530
|
+
if (this.fsw.closed)
|
|
245531
|
+
return;
|
|
245532
|
+
if (this.fsw._isIgnored(wh2.watchPath, stats)) {
|
|
245533
|
+
ready();
|
|
245534
|
+
return false;
|
|
245535
|
+
}
|
|
245536
|
+
const follow = this.fsw.options.followSymlinks;
|
|
245537
|
+
let closer;
|
|
245538
|
+
if (stats.isDirectory()) {
|
|
245539
|
+
const absPath = sp2.resolve(path19);
|
|
245540
|
+
const targetPath = follow ? await fsrealpath(path19) : path19;
|
|
245541
|
+
if (this.fsw.closed)
|
|
245542
|
+
return;
|
|
245543
|
+
closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
|
|
245544
|
+
if (this.fsw.closed)
|
|
245545
|
+
return;
|
|
245546
|
+
if (absPath !== targetPath && targetPath !== undefined) {
|
|
245547
|
+
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
245548
|
+
}
|
|
245549
|
+
} else if (stats.isSymbolicLink()) {
|
|
245550
|
+
const targetPath = follow ? await fsrealpath(path19) : path19;
|
|
245551
|
+
if (this.fsw.closed)
|
|
245552
|
+
return;
|
|
245553
|
+
const parent = sp2.dirname(wh2.watchPath);
|
|
245554
|
+
this.fsw._getWatchedDir(parent).add(wh2.watchPath);
|
|
245555
|
+
this.fsw._emit(EV.ADD, wh2.watchPath, stats);
|
|
245556
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path19, wh2, targetPath);
|
|
245557
|
+
if (this.fsw.closed)
|
|
245558
|
+
return;
|
|
245559
|
+
if (targetPath !== undefined) {
|
|
245560
|
+
this.fsw._symlinkPaths.set(sp2.resolve(path19), targetPath);
|
|
245561
|
+
}
|
|
245562
|
+
} else {
|
|
245563
|
+
closer = this._handleFile(wh2.watchPath, stats, initialAdd);
|
|
245564
|
+
}
|
|
245565
|
+
ready();
|
|
245566
|
+
if (closer)
|
|
245567
|
+
this.fsw._addPathCloser(path19, closer);
|
|
245568
|
+
return false;
|
|
245569
|
+
} catch (error48) {
|
|
245570
|
+
if (this.fsw._handleError(error48)) {
|
|
245571
|
+
ready();
|
|
245572
|
+
return path19;
|
|
245573
|
+
}
|
|
245574
|
+
}
|
|
245575
|
+
}
|
|
245576
|
+
}
|
|
245577
|
+
|
|
245578
|
+
// node_modules/chokidar/index.js
|
|
245579
|
+
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
245580
|
+
var SLASH = "/";
|
|
245581
|
+
var SLASH_SLASH = "//";
|
|
245582
|
+
var ONE_DOT = ".";
|
|
245583
|
+
var TWO_DOTS = "..";
|
|
245584
|
+
var STRING_TYPE = "string";
|
|
245585
|
+
var BACK_SLASH_RE = /\\/g;
|
|
245586
|
+
var DOUBLE_SLASH_RE = /\/\//g;
|
|
245587
|
+
var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
245588
|
+
var REPLACER_RE = /^\.[/\\]/;
|
|
245589
|
+
function arrify(item) {
|
|
245590
|
+
return Array.isArray(item) ? item : [item];
|
|
245591
|
+
}
|
|
245592
|
+
var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
245593
|
+
function createPattern(matcher) {
|
|
245594
|
+
if (typeof matcher === "function")
|
|
245595
|
+
return matcher;
|
|
245596
|
+
if (typeof matcher === "string")
|
|
245597
|
+
return (string4) => matcher === string4;
|
|
245598
|
+
if (matcher instanceof RegExp)
|
|
245599
|
+
return (string4) => matcher.test(string4);
|
|
245600
|
+
if (typeof matcher === "object" && matcher !== null) {
|
|
245601
|
+
return (string4) => {
|
|
245602
|
+
if (matcher.path === string4)
|
|
245603
|
+
return true;
|
|
245604
|
+
if (matcher.recursive) {
|
|
245605
|
+
const relative4 = sp3.relative(matcher.path, string4);
|
|
245606
|
+
if (!relative4) {
|
|
245607
|
+
return false;
|
|
245608
|
+
}
|
|
245609
|
+
return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
|
|
245610
|
+
}
|
|
245611
|
+
return false;
|
|
245612
|
+
};
|
|
245613
|
+
}
|
|
245614
|
+
return () => false;
|
|
245615
|
+
}
|
|
245616
|
+
function normalizePath(path19) {
|
|
245617
|
+
if (typeof path19 !== "string")
|
|
245618
|
+
throw new Error("string expected");
|
|
245619
|
+
path19 = sp3.normalize(path19);
|
|
245620
|
+
path19 = path19.replace(/\\/g, "/");
|
|
245621
|
+
let prepend = false;
|
|
245622
|
+
if (path19.startsWith("//"))
|
|
245623
|
+
prepend = true;
|
|
245624
|
+
path19 = path19.replace(DOUBLE_SLASH_RE, "/");
|
|
245625
|
+
if (prepend)
|
|
245626
|
+
path19 = "/" + path19;
|
|
245627
|
+
return path19;
|
|
245628
|
+
}
|
|
245629
|
+
function matchPatterns(patterns, testString, stats) {
|
|
245630
|
+
const path19 = normalizePath(testString);
|
|
245631
|
+
for (let index = 0;index < patterns.length; index++) {
|
|
245632
|
+
const pattern = patterns[index];
|
|
245633
|
+
if (pattern(path19, stats)) {
|
|
245634
|
+
return true;
|
|
245635
|
+
}
|
|
245636
|
+
}
|
|
245637
|
+
return false;
|
|
245638
|
+
}
|
|
245639
|
+
function anymatch(matchers, testString) {
|
|
245640
|
+
if (matchers == null) {
|
|
245641
|
+
throw new TypeError("anymatch: specify first argument");
|
|
245642
|
+
}
|
|
245643
|
+
const matchersArray = arrify(matchers);
|
|
245644
|
+
const patterns = matchersArray.map((matcher) => createPattern(matcher));
|
|
245645
|
+
if (testString == null) {
|
|
245646
|
+
return (testString2, stats) => {
|
|
245647
|
+
return matchPatterns(patterns, testString2, stats);
|
|
245648
|
+
};
|
|
245649
|
+
}
|
|
245650
|
+
return matchPatterns(patterns, testString);
|
|
245651
|
+
}
|
|
245652
|
+
var unifyPaths = (paths_) => {
|
|
245653
|
+
const paths = arrify(paths_).flat();
|
|
245654
|
+
if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
|
|
245655
|
+
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
245656
|
+
}
|
|
245657
|
+
return paths.map(normalizePathToUnix);
|
|
245658
|
+
};
|
|
245659
|
+
var toUnix = (string4) => {
|
|
245660
|
+
let str = string4.replace(BACK_SLASH_RE, SLASH);
|
|
245661
|
+
let prepend = false;
|
|
245662
|
+
if (str.startsWith(SLASH_SLASH)) {
|
|
245663
|
+
prepend = true;
|
|
245664
|
+
}
|
|
245665
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
245666
|
+
if (prepend) {
|
|
245667
|
+
str = SLASH + str;
|
|
245668
|
+
}
|
|
245669
|
+
return str;
|
|
245670
|
+
};
|
|
245671
|
+
var normalizePathToUnix = (path19) => toUnix(sp3.normalize(toUnix(path19)));
|
|
245672
|
+
var normalizeIgnored = (cwd = "") => (path19) => {
|
|
245673
|
+
if (typeof path19 === "string") {
|
|
245674
|
+
return normalizePathToUnix(sp3.isAbsolute(path19) ? path19 : sp3.join(cwd, path19));
|
|
245675
|
+
} else {
|
|
245676
|
+
return path19;
|
|
245677
|
+
}
|
|
245678
|
+
};
|
|
245679
|
+
var getAbsolutePath = (path19, cwd) => {
|
|
245680
|
+
if (sp3.isAbsolute(path19)) {
|
|
245681
|
+
return path19;
|
|
245682
|
+
}
|
|
245683
|
+
return sp3.join(cwd, path19);
|
|
245684
|
+
};
|
|
245685
|
+
var EMPTY_SET = Object.freeze(new Set);
|
|
245686
|
+
|
|
245687
|
+
class DirEntry {
|
|
245688
|
+
path;
|
|
245689
|
+
_removeWatcher;
|
|
245690
|
+
items;
|
|
245691
|
+
constructor(dir, removeWatcher) {
|
|
245692
|
+
this.path = dir;
|
|
245693
|
+
this._removeWatcher = removeWatcher;
|
|
245694
|
+
this.items = new Set;
|
|
245695
|
+
}
|
|
245696
|
+
add(item) {
|
|
245697
|
+
const { items } = this;
|
|
245698
|
+
if (!items)
|
|
245699
|
+
return;
|
|
245700
|
+
if (item !== ONE_DOT && item !== TWO_DOTS)
|
|
245701
|
+
items.add(item);
|
|
245702
|
+
}
|
|
245703
|
+
async remove(item) {
|
|
245704
|
+
const { items } = this;
|
|
245705
|
+
if (!items)
|
|
245706
|
+
return;
|
|
245707
|
+
items.delete(item);
|
|
245708
|
+
if (items.size > 0)
|
|
245709
|
+
return;
|
|
245710
|
+
const dir = this.path;
|
|
245711
|
+
try {
|
|
245712
|
+
await readdir3(dir);
|
|
245713
|
+
} catch (err) {
|
|
245714
|
+
if (this._removeWatcher) {
|
|
245715
|
+
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
245716
|
+
}
|
|
245717
|
+
}
|
|
245718
|
+
}
|
|
245719
|
+
has(item) {
|
|
245720
|
+
const { items } = this;
|
|
245721
|
+
if (!items)
|
|
245722
|
+
return;
|
|
245723
|
+
return items.has(item);
|
|
245724
|
+
}
|
|
245725
|
+
getChildren() {
|
|
245726
|
+
const { items } = this;
|
|
245727
|
+
if (!items)
|
|
245728
|
+
return [];
|
|
245729
|
+
return [...items.values()];
|
|
245730
|
+
}
|
|
245731
|
+
dispose() {
|
|
245732
|
+
this.items.clear();
|
|
245733
|
+
this.path = "";
|
|
245734
|
+
this._removeWatcher = EMPTY_FN;
|
|
245735
|
+
this.items = EMPTY_SET;
|
|
245736
|
+
Object.freeze(this);
|
|
245737
|
+
}
|
|
245738
|
+
}
|
|
245739
|
+
var STAT_METHOD_F = "stat";
|
|
245740
|
+
var STAT_METHOD_L = "lstat";
|
|
245741
|
+
|
|
245742
|
+
class WatchHelper {
|
|
245743
|
+
fsw;
|
|
245744
|
+
path;
|
|
245745
|
+
watchPath;
|
|
245746
|
+
fullWatchPath;
|
|
245747
|
+
dirParts;
|
|
245748
|
+
followSymlinks;
|
|
245749
|
+
statMethod;
|
|
245750
|
+
constructor(path19, follow, fsw) {
|
|
245751
|
+
this.fsw = fsw;
|
|
245752
|
+
const watchPath = path19;
|
|
245753
|
+
this.path = path19 = path19.replace(REPLACER_RE, "");
|
|
245754
|
+
this.watchPath = watchPath;
|
|
245755
|
+
this.fullWatchPath = sp3.resolve(watchPath);
|
|
245756
|
+
this.dirParts = [];
|
|
245757
|
+
this.dirParts.forEach((parts) => {
|
|
245758
|
+
if (parts.length > 1)
|
|
245759
|
+
parts.pop();
|
|
245760
|
+
});
|
|
245761
|
+
this.followSymlinks = follow;
|
|
245762
|
+
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
245763
|
+
}
|
|
245764
|
+
entryPath(entry) {
|
|
245765
|
+
return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
|
|
245766
|
+
}
|
|
245767
|
+
filterPath(entry) {
|
|
245768
|
+
const { stats } = entry;
|
|
245769
|
+
if (stats && stats.isSymbolicLink())
|
|
245770
|
+
return this.filterDir(entry);
|
|
245771
|
+
const resolvedPath = this.entryPath(entry);
|
|
245772
|
+
return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
|
|
245773
|
+
}
|
|
245774
|
+
filterDir(entry) {
|
|
245775
|
+
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
245776
|
+
}
|
|
245777
|
+
}
|
|
245778
|
+
|
|
245779
|
+
class FSWatcher extends EventEmitter3 {
|
|
245780
|
+
closed;
|
|
245781
|
+
options;
|
|
245782
|
+
_closers;
|
|
245783
|
+
_ignoredPaths;
|
|
245784
|
+
_throttled;
|
|
245785
|
+
_streams;
|
|
245786
|
+
_symlinkPaths;
|
|
245787
|
+
_watched;
|
|
245788
|
+
_pendingWrites;
|
|
245789
|
+
_pendingUnlinks;
|
|
245790
|
+
_readyCount;
|
|
245791
|
+
_emitReady;
|
|
245792
|
+
_closePromise;
|
|
245793
|
+
_userIgnored;
|
|
245794
|
+
_readyEmitted;
|
|
245795
|
+
_emitRaw;
|
|
245796
|
+
_boundRemove;
|
|
245797
|
+
_nodeFsHandler;
|
|
245798
|
+
constructor(_opts = {}) {
|
|
245799
|
+
super();
|
|
245800
|
+
this.closed = false;
|
|
245801
|
+
this._closers = new Map;
|
|
245802
|
+
this._ignoredPaths = new Set;
|
|
245803
|
+
this._throttled = new Map;
|
|
245804
|
+
this._streams = new Set;
|
|
245805
|
+
this._symlinkPaths = new Map;
|
|
245806
|
+
this._watched = new Map;
|
|
245807
|
+
this._pendingWrites = new Map;
|
|
245808
|
+
this._pendingUnlinks = new Map;
|
|
245809
|
+
this._readyCount = 0;
|
|
245810
|
+
this._readyEmitted = false;
|
|
245811
|
+
const awf = _opts.awaitWriteFinish;
|
|
245812
|
+
const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
|
|
245813
|
+
const opts = {
|
|
245814
|
+
persistent: true,
|
|
245815
|
+
ignoreInitial: false,
|
|
245816
|
+
ignorePermissionErrors: false,
|
|
245817
|
+
interval: 100,
|
|
245818
|
+
binaryInterval: 300,
|
|
245819
|
+
followSymlinks: true,
|
|
245820
|
+
usePolling: false,
|
|
245821
|
+
atomic: true,
|
|
245822
|
+
..._opts,
|
|
245823
|
+
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
245824
|
+
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
|
|
245825
|
+
};
|
|
245826
|
+
if (isIBMi)
|
|
245827
|
+
opts.usePolling = true;
|
|
245828
|
+
if (opts.atomic === undefined)
|
|
245829
|
+
opts.atomic = !opts.usePolling;
|
|
245830
|
+
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
245831
|
+
if (envPoll !== undefined) {
|
|
245832
|
+
const envLower = envPoll.toLowerCase();
|
|
245833
|
+
if (envLower === "false" || envLower === "0")
|
|
245834
|
+
opts.usePolling = false;
|
|
245835
|
+
else if (envLower === "true" || envLower === "1")
|
|
245836
|
+
opts.usePolling = true;
|
|
245837
|
+
else
|
|
245838
|
+
opts.usePolling = !!envLower;
|
|
245839
|
+
}
|
|
245840
|
+
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
|
245841
|
+
if (envInterval)
|
|
245842
|
+
opts.interval = Number.parseInt(envInterval, 10);
|
|
245843
|
+
let readyCalls = 0;
|
|
245844
|
+
this._emitReady = () => {
|
|
245845
|
+
readyCalls++;
|
|
245846
|
+
if (readyCalls >= this._readyCount) {
|
|
245847
|
+
this._emitReady = EMPTY_FN;
|
|
245848
|
+
this._readyEmitted = true;
|
|
245849
|
+
process.nextTick(() => this.emit(EVENTS.READY));
|
|
245850
|
+
}
|
|
245851
|
+
};
|
|
245852
|
+
this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
|
|
245853
|
+
this._boundRemove = this._remove.bind(this);
|
|
245854
|
+
this.options = opts;
|
|
245855
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
245856
|
+
Object.freeze(opts);
|
|
245857
|
+
}
|
|
245858
|
+
_addIgnoredPath(matcher) {
|
|
245859
|
+
if (isMatcherObject(matcher)) {
|
|
245860
|
+
for (const ignored of this._ignoredPaths) {
|
|
245861
|
+
if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
|
|
245862
|
+
return;
|
|
245863
|
+
}
|
|
245864
|
+
}
|
|
245865
|
+
}
|
|
245866
|
+
this._ignoredPaths.add(matcher);
|
|
245867
|
+
}
|
|
245868
|
+
_removeIgnoredPath(matcher) {
|
|
245869
|
+
this._ignoredPaths.delete(matcher);
|
|
245870
|
+
if (typeof matcher === "string") {
|
|
245871
|
+
for (const ignored of this._ignoredPaths) {
|
|
245872
|
+
if (isMatcherObject(ignored) && ignored.path === matcher) {
|
|
245873
|
+
this._ignoredPaths.delete(ignored);
|
|
245874
|
+
}
|
|
245875
|
+
}
|
|
245876
|
+
}
|
|
245877
|
+
}
|
|
245878
|
+
add(paths_, _origAdd, _internal) {
|
|
245879
|
+
const { cwd } = this.options;
|
|
245880
|
+
this.closed = false;
|
|
245881
|
+
this._closePromise = undefined;
|
|
245882
|
+
let paths = unifyPaths(paths_);
|
|
245883
|
+
if (cwd) {
|
|
245884
|
+
paths = paths.map((path19) => {
|
|
245885
|
+
const absPath = getAbsolutePath(path19, cwd);
|
|
245886
|
+
return absPath;
|
|
245887
|
+
});
|
|
245888
|
+
}
|
|
245889
|
+
paths.forEach((path19) => {
|
|
245890
|
+
this._removeIgnoredPath(path19);
|
|
245891
|
+
});
|
|
245892
|
+
this._userIgnored = undefined;
|
|
245893
|
+
if (!this._readyCount)
|
|
245894
|
+
this._readyCount = 0;
|
|
245895
|
+
this._readyCount += paths.length;
|
|
245896
|
+
Promise.all(paths.map(async (path19) => {
|
|
245897
|
+
const res = await this._nodeFsHandler._addToNodeFs(path19, !_internal, undefined, 0, _origAdd);
|
|
245898
|
+
if (res)
|
|
245899
|
+
this._emitReady();
|
|
245900
|
+
return res;
|
|
245901
|
+
})).then((results) => {
|
|
245902
|
+
if (this.closed)
|
|
245903
|
+
return;
|
|
245904
|
+
results.forEach((item) => {
|
|
245905
|
+
if (item)
|
|
245906
|
+
this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
|
|
245907
|
+
});
|
|
245908
|
+
});
|
|
245909
|
+
return this;
|
|
245910
|
+
}
|
|
245911
|
+
unwatch(paths_) {
|
|
245912
|
+
if (this.closed)
|
|
245913
|
+
return this;
|
|
245914
|
+
const paths = unifyPaths(paths_);
|
|
245915
|
+
const { cwd } = this.options;
|
|
245916
|
+
paths.forEach((path19) => {
|
|
245917
|
+
if (!sp3.isAbsolute(path19) && !this._closers.has(path19)) {
|
|
245918
|
+
if (cwd)
|
|
245919
|
+
path19 = sp3.join(cwd, path19);
|
|
245920
|
+
path19 = sp3.resolve(path19);
|
|
245921
|
+
}
|
|
245922
|
+
this._closePath(path19);
|
|
245923
|
+
this._addIgnoredPath(path19);
|
|
245924
|
+
if (this._watched.has(path19)) {
|
|
245925
|
+
this._addIgnoredPath({
|
|
245926
|
+
path: path19,
|
|
245927
|
+
recursive: true
|
|
245928
|
+
});
|
|
245929
|
+
}
|
|
245930
|
+
this._userIgnored = undefined;
|
|
245931
|
+
});
|
|
245932
|
+
return this;
|
|
245933
|
+
}
|
|
245934
|
+
close() {
|
|
245935
|
+
if (this._closePromise) {
|
|
245936
|
+
return this._closePromise;
|
|
245937
|
+
}
|
|
245938
|
+
this.closed = true;
|
|
245939
|
+
this.removeAllListeners();
|
|
245940
|
+
const closers = [];
|
|
245941
|
+
this._closers.forEach((closerList) => closerList.forEach((closer) => {
|
|
245942
|
+
const promise2 = closer();
|
|
245943
|
+
if (promise2 instanceof Promise)
|
|
245944
|
+
closers.push(promise2);
|
|
245945
|
+
}));
|
|
245946
|
+
this._streams.forEach((stream) => stream.destroy());
|
|
245947
|
+
this._userIgnored = undefined;
|
|
245948
|
+
this._readyCount = 0;
|
|
245949
|
+
this._readyEmitted = false;
|
|
245950
|
+
this._watched.forEach((dirent) => dirent.dispose());
|
|
245951
|
+
this._closers.clear();
|
|
245952
|
+
this._watched.clear();
|
|
245953
|
+
this._streams.clear();
|
|
245954
|
+
this._symlinkPaths.clear();
|
|
245955
|
+
this._throttled.clear();
|
|
245956
|
+
this._closePromise = closers.length ? Promise.all(closers).then(() => {
|
|
245957
|
+
return;
|
|
245958
|
+
}) : Promise.resolve();
|
|
245959
|
+
return this._closePromise;
|
|
245960
|
+
}
|
|
245961
|
+
getWatched() {
|
|
245962
|
+
const watchList = {};
|
|
245963
|
+
this._watched.forEach((entry, dir) => {
|
|
245964
|
+
const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
|
|
245965
|
+
const index = key2 || ONE_DOT;
|
|
245966
|
+
watchList[index] = entry.getChildren().sort();
|
|
245967
|
+
});
|
|
245968
|
+
return watchList;
|
|
245969
|
+
}
|
|
245970
|
+
emitWithAll(event, args) {
|
|
245971
|
+
this.emit(event, ...args);
|
|
245972
|
+
if (event !== EVENTS.ERROR)
|
|
245973
|
+
this.emit(EVENTS.ALL, event, ...args);
|
|
245974
|
+
}
|
|
245975
|
+
async _emit(event, path19, stats) {
|
|
245976
|
+
if (this.closed)
|
|
245977
|
+
return;
|
|
245978
|
+
const opts = this.options;
|
|
245979
|
+
if (isWindows4)
|
|
245980
|
+
path19 = sp3.normalize(path19);
|
|
245981
|
+
if (opts.cwd)
|
|
245982
|
+
path19 = sp3.relative(opts.cwd, path19);
|
|
245983
|
+
const args = [path19];
|
|
245984
|
+
if (stats != null)
|
|
245985
|
+
args.push(stats);
|
|
245986
|
+
const awf = opts.awaitWriteFinish;
|
|
245987
|
+
let pw;
|
|
245988
|
+
if (awf && (pw = this._pendingWrites.get(path19))) {
|
|
245989
|
+
pw.lastChange = new Date;
|
|
245990
|
+
return this;
|
|
245991
|
+
}
|
|
245992
|
+
if (opts.atomic) {
|
|
245993
|
+
if (event === EVENTS.UNLINK) {
|
|
245994
|
+
this._pendingUnlinks.set(path19, [event, ...args]);
|
|
245995
|
+
setTimeout(() => {
|
|
245996
|
+
this._pendingUnlinks.forEach((entry, path20) => {
|
|
245997
|
+
this.emit(...entry);
|
|
245998
|
+
this.emit(EVENTS.ALL, ...entry);
|
|
245999
|
+
this._pendingUnlinks.delete(path20);
|
|
246000
|
+
});
|
|
246001
|
+
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
246002
|
+
return this;
|
|
246003
|
+
}
|
|
246004
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path19)) {
|
|
246005
|
+
event = EVENTS.CHANGE;
|
|
246006
|
+
this._pendingUnlinks.delete(path19);
|
|
246007
|
+
}
|
|
246008
|
+
}
|
|
246009
|
+
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
246010
|
+
const awfEmit = (err, stats2) => {
|
|
246011
|
+
if (err) {
|
|
246012
|
+
event = EVENTS.ERROR;
|
|
246013
|
+
args[0] = err;
|
|
246014
|
+
this.emitWithAll(event, args);
|
|
246015
|
+
} else if (stats2) {
|
|
246016
|
+
if (args.length > 1) {
|
|
246017
|
+
args[1] = stats2;
|
|
246018
|
+
} else {
|
|
246019
|
+
args.push(stats2);
|
|
246020
|
+
}
|
|
246021
|
+
this.emitWithAll(event, args);
|
|
246022
|
+
}
|
|
246023
|
+
};
|
|
246024
|
+
this._awaitWriteFinish(path19, awf.stabilityThreshold, event, awfEmit);
|
|
246025
|
+
return this;
|
|
246026
|
+
}
|
|
246027
|
+
if (event === EVENTS.CHANGE) {
|
|
246028
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path19, 50);
|
|
246029
|
+
if (isThrottled)
|
|
246030
|
+
return this;
|
|
246031
|
+
}
|
|
246032
|
+
if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
246033
|
+
const fullPath = opts.cwd ? sp3.join(opts.cwd, path19) : path19;
|
|
246034
|
+
let stats2;
|
|
246035
|
+
try {
|
|
246036
|
+
stats2 = await stat4(fullPath);
|
|
246037
|
+
} catch (err) {}
|
|
246038
|
+
if (!stats2 || this.closed)
|
|
246039
|
+
return;
|
|
246040
|
+
args.push(stats2);
|
|
246041
|
+
}
|
|
246042
|
+
this.emitWithAll(event, args);
|
|
246043
|
+
return this;
|
|
246044
|
+
}
|
|
246045
|
+
_handleError(error48) {
|
|
246046
|
+
const code2 = error48 && error48.code;
|
|
246047
|
+
if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
|
|
246048
|
+
this.emit(EVENTS.ERROR, error48);
|
|
246049
|
+
}
|
|
246050
|
+
return error48 || this.closed;
|
|
246051
|
+
}
|
|
246052
|
+
_throttle(actionType, path19, timeout3) {
|
|
246053
|
+
if (!this._throttled.has(actionType)) {
|
|
246054
|
+
this._throttled.set(actionType, new Map);
|
|
246055
|
+
}
|
|
246056
|
+
const action = this._throttled.get(actionType);
|
|
246057
|
+
if (!action)
|
|
246058
|
+
throw new Error("invalid throttle");
|
|
246059
|
+
const actionPath = action.get(path19);
|
|
246060
|
+
if (actionPath) {
|
|
246061
|
+
actionPath.count++;
|
|
246062
|
+
return false;
|
|
246063
|
+
}
|
|
246064
|
+
let timeoutObject;
|
|
246065
|
+
const clear = () => {
|
|
246066
|
+
const item = action.get(path19);
|
|
246067
|
+
const count2 = item ? item.count : 0;
|
|
246068
|
+
action.delete(path19);
|
|
246069
|
+
clearTimeout(timeoutObject);
|
|
246070
|
+
if (item)
|
|
246071
|
+
clearTimeout(item.timeoutObject);
|
|
246072
|
+
return count2;
|
|
246073
|
+
};
|
|
246074
|
+
timeoutObject = setTimeout(clear, timeout3);
|
|
246075
|
+
const thr = { timeoutObject, clear, count: 0 };
|
|
246076
|
+
action.set(path19, thr);
|
|
246077
|
+
return thr;
|
|
246078
|
+
}
|
|
246079
|
+
_incrReadyCount() {
|
|
246080
|
+
return this._readyCount++;
|
|
246081
|
+
}
|
|
246082
|
+
_awaitWriteFinish(path19, threshold, event, awfEmit) {
|
|
246083
|
+
const awf = this.options.awaitWriteFinish;
|
|
246084
|
+
if (typeof awf !== "object")
|
|
246085
|
+
return;
|
|
246086
|
+
const pollInterval = awf.pollInterval;
|
|
246087
|
+
let timeoutHandler;
|
|
246088
|
+
let fullPath = path19;
|
|
246089
|
+
if (this.options.cwd && !sp3.isAbsolute(path19)) {
|
|
246090
|
+
fullPath = sp3.join(this.options.cwd, path19);
|
|
246091
|
+
}
|
|
246092
|
+
const now = new Date;
|
|
246093
|
+
const writes = this._pendingWrites;
|
|
246094
|
+
function awaitWriteFinishFn(prevStat) {
|
|
246095
|
+
statcb(fullPath, (err, curStat) => {
|
|
246096
|
+
if (err || !writes.has(path19)) {
|
|
246097
|
+
if (err && err.code !== "ENOENT")
|
|
246098
|
+
awfEmit(err);
|
|
246099
|
+
return;
|
|
246100
|
+
}
|
|
246101
|
+
const now2 = Number(new Date);
|
|
246102
|
+
if (prevStat && curStat.size !== prevStat.size) {
|
|
246103
|
+
writes.get(path19).lastChange = now2;
|
|
246104
|
+
}
|
|
246105
|
+
const pw = writes.get(path19);
|
|
246106
|
+
const df3 = now2 - pw.lastChange;
|
|
246107
|
+
if (df3 >= threshold) {
|
|
246108
|
+
writes.delete(path19);
|
|
246109
|
+
awfEmit(undefined, curStat);
|
|
246110
|
+
} else {
|
|
246111
|
+
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
246112
|
+
}
|
|
246113
|
+
});
|
|
246114
|
+
}
|
|
246115
|
+
if (!writes.has(path19)) {
|
|
246116
|
+
writes.set(path19, {
|
|
246117
|
+
lastChange: now,
|
|
246118
|
+
cancelWait: () => {
|
|
246119
|
+
writes.delete(path19);
|
|
246120
|
+
clearTimeout(timeoutHandler);
|
|
246121
|
+
return event;
|
|
246122
|
+
}
|
|
246123
|
+
});
|
|
246124
|
+
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
|
|
246125
|
+
}
|
|
246126
|
+
}
|
|
246127
|
+
_isIgnored(path19, stats) {
|
|
246128
|
+
if (this.options.atomic && DOT_RE.test(path19))
|
|
246129
|
+
return true;
|
|
246130
|
+
if (!this._userIgnored) {
|
|
246131
|
+
const { cwd } = this.options;
|
|
246132
|
+
const ign = this.options.ignored;
|
|
246133
|
+
const ignored = (ign || []).map(normalizeIgnored(cwd));
|
|
246134
|
+
const ignoredPaths = [...this._ignoredPaths];
|
|
246135
|
+
const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
246136
|
+
this._userIgnored = anymatch(list3, undefined);
|
|
246137
|
+
}
|
|
246138
|
+
return this._userIgnored(path19, stats);
|
|
246139
|
+
}
|
|
246140
|
+
_isntIgnored(path19, stat5) {
|
|
246141
|
+
return !this._isIgnored(path19, stat5);
|
|
246142
|
+
}
|
|
246143
|
+
_getWatchHelpers(path19) {
|
|
246144
|
+
return new WatchHelper(path19, this.options.followSymlinks, this);
|
|
246145
|
+
}
|
|
246146
|
+
_getWatchedDir(directory) {
|
|
246147
|
+
const dir = sp3.resolve(directory);
|
|
246148
|
+
if (!this._watched.has(dir))
|
|
246149
|
+
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
246150
|
+
return this._watched.get(dir);
|
|
246151
|
+
}
|
|
246152
|
+
_hasReadPermissions(stats) {
|
|
246153
|
+
if (this.options.ignorePermissionErrors)
|
|
246154
|
+
return true;
|
|
246155
|
+
return Boolean(Number(stats.mode) & 256);
|
|
246156
|
+
}
|
|
246157
|
+
_remove(directory, item, isDirectory3) {
|
|
246158
|
+
const path19 = sp3.join(directory, item);
|
|
246159
|
+
const fullPath = sp3.resolve(path19);
|
|
246160
|
+
isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path19) || this._watched.has(fullPath);
|
|
246161
|
+
if (!this._throttle("remove", path19, 100))
|
|
246162
|
+
return;
|
|
246163
|
+
if (!isDirectory3 && this._watched.size === 1) {
|
|
246164
|
+
this.add(directory, item, true);
|
|
246165
|
+
}
|
|
246166
|
+
const wp5 = this._getWatchedDir(path19);
|
|
246167
|
+
const nestedDirectoryChildren = wp5.getChildren();
|
|
246168
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path19, nested));
|
|
246169
|
+
const parent = this._getWatchedDir(directory);
|
|
246170
|
+
const wasTracked = parent.has(item);
|
|
246171
|
+
parent.remove(item);
|
|
246172
|
+
if (this._symlinkPaths.has(fullPath)) {
|
|
246173
|
+
this._symlinkPaths.delete(fullPath);
|
|
246174
|
+
}
|
|
246175
|
+
let relPath = path19;
|
|
246176
|
+
if (this.options.cwd)
|
|
246177
|
+
relPath = sp3.relative(this.options.cwd, path19);
|
|
246178
|
+
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
246179
|
+
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
246180
|
+
if (event === EVENTS.ADD)
|
|
246181
|
+
return;
|
|
246182
|
+
}
|
|
246183
|
+
this._watched.delete(path19);
|
|
246184
|
+
this._watched.delete(fullPath);
|
|
246185
|
+
const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
246186
|
+
if (wasTracked && !this._isIgnored(path19))
|
|
246187
|
+
this._emit(eventName, path19);
|
|
246188
|
+
this._closePath(path19);
|
|
246189
|
+
}
|
|
246190
|
+
_closePath(path19) {
|
|
246191
|
+
this._closeFile(path19);
|
|
246192
|
+
const dir = sp3.dirname(path19);
|
|
246193
|
+
this._getWatchedDir(dir).remove(sp3.basename(path19));
|
|
246194
|
+
}
|
|
246195
|
+
_closeFile(path19) {
|
|
246196
|
+
const closers = this._closers.get(path19);
|
|
246197
|
+
if (!closers)
|
|
246198
|
+
return;
|
|
246199
|
+
closers.forEach((closer) => closer());
|
|
246200
|
+
this._closers.delete(path19);
|
|
246201
|
+
}
|
|
246202
|
+
_addPathCloser(path19, closer) {
|
|
246203
|
+
if (!closer)
|
|
246204
|
+
return;
|
|
246205
|
+
let list3 = this._closers.get(path19);
|
|
246206
|
+
if (!list3) {
|
|
246207
|
+
list3 = [];
|
|
246208
|
+
this._closers.set(path19, list3);
|
|
246209
|
+
}
|
|
246210
|
+
list3.push(closer);
|
|
246211
|
+
}
|
|
246212
|
+
_readdirp(root2, opts) {
|
|
246213
|
+
if (this.closed)
|
|
246214
|
+
return;
|
|
246215
|
+
const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
246216
|
+
let stream = readdirp(root2, options8);
|
|
246217
|
+
this._streams.add(stream);
|
|
246218
|
+
stream.once(STR_CLOSE, () => {
|
|
246219
|
+
stream = undefined;
|
|
246220
|
+
});
|
|
246221
|
+
stream.once(STR_END, () => {
|
|
246222
|
+
if (stream) {
|
|
246223
|
+
this._streams.delete(stream);
|
|
246224
|
+
stream = undefined;
|
|
246225
|
+
}
|
|
246226
|
+
});
|
|
246227
|
+
return stream;
|
|
246228
|
+
}
|
|
246229
|
+
}
|
|
246230
|
+
function watch(paths, options8 = {}) {
|
|
246231
|
+
const watcher = new FSWatcher(options8);
|
|
246232
|
+
watcher.add(paths);
|
|
246233
|
+
return watcher;
|
|
246234
|
+
}
|
|
246235
|
+
|
|
246236
|
+
// src/cli/dev/dev-server/watcher.ts
|
|
246237
|
+
var import_debounce = __toESM(require_debounce(), 1);
|
|
246238
|
+
var WATCH_DEBOUNCE_MS = 300;
|
|
246239
|
+
var WATCH_QUEUE_DELAY_MS = 500;
|
|
246240
|
+
|
|
246241
|
+
class WatchBase44 extends EventEmitter4 {
|
|
246242
|
+
itemsToWatch;
|
|
246243
|
+
logger;
|
|
246244
|
+
entryNames;
|
|
246245
|
+
watchers = new Map;
|
|
246246
|
+
queueWaitForCreationTimeout = null;
|
|
246247
|
+
constructor(itemsToWatch, logger) {
|
|
246248
|
+
super();
|
|
246249
|
+
this.itemsToWatch = itemsToWatch;
|
|
246250
|
+
this.logger = logger;
|
|
246251
|
+
this.entryNames = Object.keys(itemsToWatch);
|
|
246252
|
+
}
|
|
246253
|
+
async start() {
|
|
246254
|
+
if (this.watchers.size > 0) {
|
|
246255
|
+
return;
|
|
246256
|
+
}
|
|
246257
|
+
for (const name2 of this.entryNames) {
|
|
246258
|
+
const targetPath = this.itemsToWatch[name2];
|
|
246259
|
+
if (await pathExists(targetPath)) {
|
|
246260
|
+
this.watchers.set(name2, this.watchTarget(name2, targetPath));
|
|
246261
|
+
}
|
|
246262
|
+
}
|
|
246263
|
+
this.watchEntries();
|
|
246264
|
+
}
|
|
246265
|
+
async close() {
|
|
246266
|
+
if (this.queueWaitForCreationTimeout) {
|
|
246267
|
+
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246268
|
+
this.queueWaitForCreationTimeout = null;
|
|
246269
|
+
}
|
|
246270
|
+
for (const watcher of this.watchers.values()) {
|
|
246271
|
+
await watcher.close();
|
|
246272
|
+
}
|
|
246273
|
+
this.watchers.clear();
|
|
246274
|
+
}
|
|
246275
|
+
watchEntries() {
|
|
246276
|
+
if (this.queueWaitForCreationTimeout) {
|
|
246277
|
+
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246278
|
+
}
|
|
246279
|
+
this.queueWaitForCreationTimeout = setTimeout(async () => {
|
|
246280
|
+
for (const name2 of this.entryNames) {
|
|
246281
|
+
const path19 = this.itemsToWatch[name2];
|
|
246282
|
+
const watchItem = this.watchers.get(name2);
|
|
246283
|
+
const exists = await pathExists(path19);
|
|
246284
|
+
if (!watchItem && exists) {
|
|
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
|
+
});
|
|
246297
|
+
}
|
|
246298
|
+
}
|
|
246299
|
+
this.queueWaitForCreationTimeout = null;
|
|
246300
|
+
this.watchEntries();
|
|
246301
|
+
}, WATCH_QUEUE_DELAY_MS);
|
|
246302
|
+
}
|
|
246303
|
+
watchTarget(name2, targetPath) {
|
|
246304
|
+
const watcher = watch(targetPath, {
|
|
246305
|
+
ignoreInitial: true
|
|
246306
|
+
});
|
|
246307
|
+
watcher.on("all", import_debounce.default(async (_event, path19) => {
|
|
246308
|
+
this.emit("change", name2, relative4(targetPath, path19));
|
|
246309
|
+
}, WATCH_DEBOUNCE_MS));
|
|
246310
|
+
watcher.on("error", (err) => {
|
|
246311
|
+
this.logger.error(`Watch handler failed for ${targetPath}`, err instanceof Error ? err : undefined);
|
|
246312
|
+
});
|
|
246313
|
+
return watcher;
|
|
246314
|
+
}
|
|
246315
|
+
}
|
|
246316
|
+
|
|
244261
246317
|
// src/cli/dev/dev-server/main.ts
|
|
244262
246318
|
var DEFAULT_PORT = 4400;
|
|
244263
246319
|
var BASE44_APP_URL = "https://base44.app";
|
|
@@ -244265,7 +246321,7 @@ async function createDevServer(options8) {
|
|
|
244265
246321
|
const { port: userPort } = options8;
|
|
244266
246322
|
const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
|
|
244267
246323
|
const baseUrl = `http://localhost:${port}`;
|
|
244268
|
-
const { functions, entities } = await options8.loadResources();
|
|
246324
|
+
const { functions, entities, project: project2 } = await options8.loadResources();
|
|
244269
246325
|
const app = import_express4.default();
|
|
244270
246326
|
const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
|
|
244271
246327
|
target: BASE44_APP_URL,
|
|
@@ -244285,12 +246341,13 @@ async function createDevServer(options8) {
|
|
|
244285
246341
|
});
|
|
244286
246342
|
const devLogger = createDevLogger();
|
|
244287
246343
|
const functionManager = new FunctionManager(functions, devLogger);
|
|
246344
|
+
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
246345
|
+
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
244288
246346
|
if (functionManager.getFunctionNames().length > 0) {
|
|
244289
246347
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
244290
|
-
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
244291
|
-
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
244292
246348
|
}
|
|
244293
|
-
const db2 = new Database
|
|
246349
|
+
const db2 = new Database;
|
|
246350
|
+
db2.load(entities);
|
|
244294
246351
|
if (db2.getCollectionNames().length > 0) {
|
|
244295
246352
|
R2.info(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
244296
246353
|
}
|
|
@@ -244307,8 +246364,8 @@ async function createDevServer(options8) {
|
|
|
244307
246364
|
devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
244308
246365
|
remoteProxy(req, res, next);
|
|
244309
246366
|
});
|
|
244310
|
-
|
|
244311
|
-
const
|
|
246367
|
+
const server = await new Promise((resolve8, reject) => {
|
|
246368
|
+
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
244312
246369
|
if (err) {
|
|
244313
246370
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
244314
246371
|
reject(new Error(`Port ${port} is already in use. Stop the other process and try again.`));
|
|
@@ -244316,24 +246373,57 @@ async function createDevServer(options8) {
|
|
|
244316
246373
|
reject(err);
|
|
244317
246374
|
}
|
|
244318
246375
|
} else {
|
|
244319
|
-
|
|
244320
|
-
emitEntityEvent = (appId, entityName, event) => {
|
|
244321
|
-
broadcastEntityEvent(io6, appId, entityName, event);
|
|
244322
|
-
};
|
|
244323
|
-
const shutdown = () => {
|
|
244324
|
-
io6.close();
|
|
244325
|
-
functionManager.stopAll();
|
|
244326
|
-
server.close();
|
|
244327
|
-
};
|
|
244328
|
-
process.on("SIGINT", shutdown);
|
|
244329
|
-
process.on("SIGTERM", shutdown);
|
|
244330
|
-
resolve6({
|
|
244331
|
-
port,
|
|
244332
|
-
server
|
|
244333
|
-
});
|
|
246376
|
+
resolve8(s5);
|
|
244334
246377
|
}
|
|
244335
246378
|
});
|
|
244336
246379
|
});
|
|
246380
|
+
const io6 = createRealtimeServer(server);
|
|
246381
|
+
emitEntityEvent = (appId, entityName, event) => {
|
|
246382
|
+
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246383
|
+
};
|
|
246384
|
+
const base44ConfigWatcher = new WatchBase44({
|
|
246385
|
+
functions: join18(dirname14(project2.configPath), project2.functionsDir),
|
|
246386
|
+
entities: join18(dirname14(project2.configPath), project2.entitiesDir)
|
|
246387
|
+
}, devLogger);
|
|
246388
|
+
base44ConfigWatcher.on("change", async (name2) => {
|
|
246389
|
+
try {
|
|
246390
|
+
const { functions: functions2, entities: entities2 } = await options8.loadResources();
|
|
246391
|
+
if (name2 === "functions") {
|
|
246392
|
+
const previousFunctionCount = functionManager.getFunctionNames().length;
|
|
246393
|
+
functionManager.reload(functions2);
|
|
246394
|
+
const names = functionManager.getFunctionNames();
|
|
246395
|
+
if (names.length > 0) {
|
|
246396
|
+
devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
|
|
246397
|
+
} else if (previousFunctionCount > 0) {
|
|
246398
|
+
devLogger.log("All functions removed");
|
|
246399
|
+
}
|
|
246400
|
+
}
|
|
246401
|
+
if (name2 === "entities") {
|
|
246402
|
+
const previousEntityCount = db2.getCollectionNames().length;
|
|
246403
|
+
db2.dropAll();
|
|
246404
|
+
if (previousEntityCount > 0) {
|
|
246405
|
+
devLogger.log("Entities directory changed, clearing data...");
|
|
246406
|
+
}
|
|
246407
|
+
db2.load(entities2);
|
|
246408
|
+
if (db2.getCollectionNames().length > 0) {
|
|
246409
|
+
devLogger.log(`Loaded entities: ${db2.getCollectionNames().join(", ")}`);
|
|
246410
|
+
}
|
|
246411
|
+
}
|
|
246412
|
+
} catch (error48) {
|
|
246413
|
+
const errorMessage = error48 instanceof Error ? error48.message : String(error48);
|
|
246414
|
+
devLogger.error(errorMessage);
|
|
246415
|
+
}
|
|
246416
|
+
});
|
|
246417
|
+
await base44ConfigWatcher.start();
|
|
246418
|
+
const shutdown = () => {
|
|
246419
|
+
base44ConfigWatcher.close();
|
|
246420
|
+
io6.close();
|
|
246421
|
+
functionManager.stopAll();
|
|
246422
|
+
server.close();
|
|
246423
|
+
};
|
|
246424
|
+
process.on("SIGINT", shutdown);
|
|
246425
|
+
process.on("SIGTERM", shutdown);
|
|
246426
|
+
return { port, server };
|
|
244337
246427
|
}
|
|
244338
246428
|
|
|
244339
246429
|
// src/cli/commands/dev.ts
|
|
@@ -244357,8 +246447,8 @@ function getDevCommand(context) {
|
|
|
244357
246447
|
}
|
|
244358
246448
|
|
|
244359
246449
|
// src/cli/commands/project/eject.ts
|
|
244360
|
-
import { resolve as
|
|
244361
|
-
var
|
|
246450
|
+
import { resolve as resolve8 } from "node:path";
|
|
246451
|
+
var import_kebabCase2 = __toESM(require_kebabCase(), 1);
|
|
244362
246452
|
async function eject(options8) {
|
|
244363
246453
|
const projects = await listProjects();
|
|
244364
246454
|
const ejectableProjects = projects.filter((p4) => p4.isManagedSourceCode !== false);
|
|
@@ -244396,7 +246486,7 @@ async function eject(options8) {
|
|
|
244396
246486
|
selectedProject = selected;
|
|
244397
246487
|
}
|
|
244398
246488
|
const projectId = selectedProject.id;
|
|
244399
|
-
const suggestedPath = await isDirEmpty() ? `./` : `./${
|
|
246489
|
+
const suggestedPath = await isDirEmpty() ? `./` : `./${import_kebabCase2.default(selectedProject.name)}`;
|
|
244400
246490
|
const selectedPath = options8.path ?? await Ze({
|
|
244401
246491
|
message: "Where should we create your project?",
|
|
244402
246492
|
placeholder: suggestedPath,
|
|
@@ -244406,7 +246496,7 @@ async function eject(options8) {
|
|
|
244406
246496
|
Ne("Operation cancelled.");
|
|
244407
246497
|
throw new CLIExitError(0);
|
|
244408
246498
|
}
|
|
244409
|
-
const resolvedPath =
|
|
246499
|
+
const resolvedPath = resolve8(selectedPath);
|
|
244410
246500
|
await runTask("Downloading your project's code...", async (updateMessage) => {
|
|
244411
246501
|
await createProjectFilesForExistingProject({
|
|
244412
246502
|
projectId,
|
|
@@ -244482,7 +246572,7 @@ var import_detect_agent = __toESM(require_dist5(), 1);
|
|
|
244482
246572
|
import { release, type } from "node:os";
|
|
244483
246573
|
|
|
244484
246574
|
// node_modules/posthog-node/dist/extensions/error-tracking/modifiers/module.node.mjs
|
|
244485
|
-
import { dirname as
|
|
246575
|
+
import { dirname as dirname15, posix, sep } from "path";
|
|
244486
246576
|
function createModulerModifier() {
|
|
244487
246577
|
const getModuleFromFileName = createGetModuleFromFilename();
|
|
244488
246578
|
return async (frames) => {
|
|
@@ -244491,12 +246581,12 @@ function createModulerModifier() {
|
|
|
244491
246581
|
return frames;
|
|
244492
246582
|
};
|
|
244493
246583
|
}
|
|
244494
|
-
function createGetModuleFromFilename(basePath = process.argv[1] ?
|
|
244495
|
-
const normalizedBase =
|
|
246584
|
+
function createGetModuleFromFilename(basePath = process.argv[1] ? dirname15(process.argv[1]) : process.cwd(), isWindows5 = sep === "\\") {
|
|
246585
|
+
const normalizedBase = isWindows5 ? normalizeWindowsPath2(basePath) : basePath;
|
|
244496
246586
|
return (filename) => {
|
|
244497
246587
|
if (!filename)
|
|
244498
246588
|
return;
|
|
244499
|
-
const normalizedFilename =
|
|
246589
|
+
const normalizedFilename = isWindows5 ? normalizeWindowsPath2(filename) : filename;
|
|
244500
246590
|
let { dir, base: file2, ext } = posix.parse(normalizedFilename);
|
|
244501
246591
|
if (ext === ".js" || ext === ".mjs" || ext === ".cjs")
|
|
244502
246592
|
file2 = file2.slice(0, -1 * ext.length);
|
|
@@ -246769,14 +248859,14 @@ async function addSourceContext(frames) {
|
|
|
246769
248859
|
return frames;
|
|
246770
248860
|
}
|
|
246771
248861
|
function getContextLinesFromFile(path19, ranges, output) {
|
|
246772
|
-
return new Promise((
|
|
248862
|
+
return new Promise((resolve9) => {
|
|
246773
248863
|
const stream = createReadStream2(path19);
|
|
246774
248864
|
const lineReaded = createInterface2({
|
|
246775
248865
|
input: stream
|
|
246776
248866
|
});
|
|
246777
248867
|
function destroyStreamAndResolve() {
|
|
246778
248868
|
stream.destroy();
|
|
246779
|
-
|
|
248869
|
+
resolve9();
|
|
246780
248870
|
}
|
|
246781
248871
|
let lineNumber = 0;
|
|
246782
248872
|
let currentRangeIndex = 0;
|
|
@@ -247888,15 +249978,15 @@ class PostHogBackendClient extends PostHogCoreStateless {
|
|
|
247888
249978
|
return true;
|
|
247889
249979
|
if (this.featureFlagsPoller === undefined)
|
|
247890
249980
|
return false;
|
|
247891
|
-
return new Promise((
|
|
249981
|
+
return new Promise((resolve9) => {
|
|
247892
249982
|
const timeout3 = setTimeout(() => {
|
|
247893
249983
|
cleanup();
|
|
247894
|
-
|
|
249984
|
+
resolve9(false);
|
|
247895
249985
|
}, timeoutMs);
|
|
247896
249986
|
const cleanup = this._events.on("localEvaluationFlagsLoaded", (count2) => {
|
|
247897
249987
|
clearTimeout(timeout3);
|
|
247898
249988
|
cleanup();
|
|
247899
|
-
|
|
249989
|
+
resolve9(count2 > 0);
|
|
247900
249990
|
});
|
|
247901
249991
|
});
|
|
247902
249992
|
}
|
|
@@ -248709,4 +250799,4 @@ export {
|
|
|
248709
250799
|
CLIExitError
|
|
248710
250800
|
};
|
|
248711
250801
|
|
|
248712
|
-
//# debugId=
|
|
250802
|
+
//# debugId=1F612090E5DA7F5064756E2164756E21
|