@base44-preview/cli 0.0.37-pr.362.364a428 → 0.0.37-pr.362.a4d74a2
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 +2237 -147
- package/dist/cli/index.js.map +41 -9
- package/package.json +4 -3
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 };
|
|
@@ -225791,6 +226137,12 @@ import { homedir } from "node:os";
|
|
|
225791
226137
|
import { dirname, join } from "node:path";
|
|
225792
226138
|
import { fileURLToPath } from "node:url";
|
|
225793
226139
|
|
|
226140
|
+
// src/core/assets.ts
|
|
226141
|
+
var assetsDir;
|
|
226142
|
+
function getAssetsDir() {
|
|
226143
|
+
return assetsDir;
|
|
226144
|
+
}
|
|
226145
|
+
|
|
225794
226146
|
// src/core/consts.ts
|
|
225795
226147
|
var PROJECT_SUBDIR = "base44";
|
|
225796
226148
|
var CONFIG_FILE_EXTENSION = "jsonc";
|
|
@@ -225867,8 +226219,9 @@ function getAuthFilePath() {
|
|
|
225867
226219
|
return join(getBase44GlobalDir(), "auth", "auth.json");
|
|
225868
226220
|
}
|
|
225869
226221
|
function getTemplatesDir() {
|
|
225870
|
-
|
|
225871
|
-
|
|
226222
|
+
const assets = getAssetsDir();
|
|
226223
|
+
if (assets)
|
|
226224
|
+
return join(assets, "templates");
|
|
225872
226225
|
return join(__dirname2, "../templates");
|
|
225873
226226
|
}
|
|
225874
226227
|
function getTemplatesIndexPath() {
|
|
@@ -241584,11 +241937,12 @@ var package_default = {
|
|
|
241584
241937
|
"@types/ejs": "^3.1.5",
|
|
241585
241938
|
"@types/express": "^5.0.6",
|
|
241586
241939
|
"@types/json-schema": "^7.0.15",
|
|
241587
|
-
"@types/lodash
|
|
241588
|
-
"@types/node": "^22.10.5",
|
|
241940
|
+
"@types/lodash": "^4.17.24",
|
|
241589
241941
|
"@types/multer": "^2.0.0",
|
|
241942
|
+
"@types/node": "^22.10.5",
|
|
241590
241943
|
"@vercel/detect-agent": "^1.1.0",
|
|
241591
241944
|
chalk: "^5.6.2",
|
|
241945
|
+
chokidar: "^5.0.0",
|
|
241592
241946
|
commander: "^12.1.0",
|
|
241593
241947
|
"common-tags": "^1.8.2",
|
|
241594
241948
|
cors: "^2.8.5",
|
|
@@ -241604,9 +241958,9 @@ var package_default = {
|
|
|
241604
241958
|
json5: "^2.2.3",
|
|
241605
241959
|
knip: "^5.83.1",
|
|
241606
241960
|
ky: "^1.14.2",
|
|
241607
|
-
|
|
241608
|
-
multer: "^2.0.0",
|
|
241961
|
+
lodash: "^4.17.23",
|
|
241609
241962
|
msw: "^2.12.10",
|
|
241963
|
+
multer: "^2.0.0",
|
|
241610
241964
|
nanoid: "^5.1.6",
|
|
241611
241965
|
open: "^11.0.0",
|
|
241612
241966
|
"p-wait-for": "^6.0.0",
|
|
@@ -242733,7 +243087,7 @@ function getFunctionsDeployCommand(context) {
|
|
|
242733
243087
|
|
|
242734
243088
|
// src/cli/commands/project/create.ts
|
|
242735
243089
|
import { basename as basename3, join as join11, resolve as resolve2 } from "node:path";
|
|
242736
|
-
var
|
|
243090
|
+
var import_kebabCase = __toESM(require_kebabCase(), 1);
|
|
242737
243091
|
var DEFAULT_TEMPLATE_ID = "backend-only";
|
|
242738
243092
|
async function getTemplateById(templateId) {
|
|
242739
243093
|
const templates = await listTemplates();
|
|
@@ -242777,7 +243131,7 @@ async function createInteractive(options) {
|
|
|
242777
243131
|
});
|
|
242778
243132
|
},
|
|
242779
243133
|
projectPath: async ({ results }) => {
|
|
242780
|
-
const suggestedPath = await isDirEmpty() ? "./" : `./${
|
|
243134
|
+
const suggestedPath = await isDirEmpty() ? "./" : `./${import_kebabCase.default(results.name)}`;
|
|
242781
243135
|
return Ze({
|
|
242782
243136
|
message: "Where should we create your project?",
|
|
242783
243137
|
placeholder: suggestedPath,
|
|
@@ -243540,6 +243894,7 @@ function getTypesCommand(context) {
|
|
|
243540
243894
|
}
|
|
243541
243895
|
|
|
243542
243896
|
// src/cli/dev/dev-server/main.ts
|
|
243897
|
+
import { dirname as dirname14, join as join18 } from "node:path";
|
|
243543
243898
|
var import_cors = __toESM(require_lib4(), 1);
|
|
243544
243899
|
var import_express4 = __toESM(require_express(), 1);
|
|
243545
243900
|
|
|
@@ -243701,7 +244056,7 @@ import { spawn as spawn2, spawnSync as spawnSync2 } from "node:child_process";
|
|
|
243701
244056
|
import { dirname as dirname11, join as join15 } from "node:path";
|
|
243702
244057
|
import { fileURLToPath as fileURLToPath7 } from "node:url";
|
|
243703
244058
|
var __dirname5 = dirname11(fileURLToPath7(import.meta.url));
|
|
243704
|
-
var WRAPPER_PATH =
|
|
244059
|
+
var WRAPPER_PATH = getAssetsDir() ? join15(getAssetsDir(), "deno-runtime", "main.js") : join15(__dirname5, "../deno-runtime/main.js");
|
|
243705
244060
|
var READY_TIMEOUT = 30000;
|
|
243706
244061
|
|
|
243707
244062
|
class FunctionManager {
|
|
@@ -243747,6 +244102,10 @@ class FunctionManager {
|
|
|
243747
244102
|
try {
|
|
243748
244103
|
return await promise2;
|
|
243749
244104
|
} finally {
|
|
244105
|
+
if (!this.starting.has(name2) && this.running.has(name2)) {
|
|
244106
|
+
this.running.get(name2)?.process.kill();
|
|
244107
|
+
this.running.delete(name2);
|
|
244108
|
+
}
|
|
243750
244109
|
this.starting.delete(name2);
|
|
243751
244110
|
}
|
|
243752
244111
|
}
|
|
@@ -243762,9 +244121,13 @@ class FunctionManager {
|
|
|
243762
244121
|
this.setupProcessHandlers(name2, process21);
|
|
243763
244122
|
return this.waitForReady(name2, runningFunc);
|
|
243764
244123
|
}
|
|
244124
|
+
reload(functions) {
|
|
244125
|
+
this.stopAll();
|
|
244126
|
+
this.functions = new Map(functions.map((f7) => [f7.name, f7]));
|
|
244127
|
+
}
|
|
243765
244128
|
stopAll() {
|
|
243766
244129
|
for (const [name2, { process: process21 }] of this.running) {
|
|
243767
|
-
this.logger.log(`
|
|
244130
|
+
this.logger.log(`Stopping function: ${name2}`);
|
|
243768
244131
|
process21.kill();
|
|
243769
244132
|
}
|
|
243770
244133
|
this.running.clear();
|
|
@@ -243775,7 +244138,7 @@ class FunctionManager {
|
|
|
243775
244138
|
return getPorts({ exclude: usedPorts });
|
|
243776
244139
|
}
|
|
243777
244140
|
spawnFunction(func, port) {
|
|
243778
|
-
this.logger.log(`
|
|
244141
|
+
this.logger.log(`Spawning function "${func.name}" on port ${port}`);
|
|
243779
244142
|
const process21 = spawn2("deno", ["run", "--allow-all", WRAPPER_PATH], {
|
|
243780
244143
|
env: {
|
|
243781
244144
|
...globalThis.process.env,
|
|
@@ -243803,11 +244166,13 @@ class FunctionManager {
|
|
|
243803
244166
|
}
|
|
243804
244167
|
});
|
|
243805
244168
|
process21.on("exit", (code2) => {
|
|
243806
|
-
|
|
244169
|
+
if (code2 !== null) {
|
|
244170
|
+
this.logger.log(`Function "${name2}" exited with code ${code2}`);
|
|
244171
|
+
}
|
|
243807
244172
|
this.running.delete(name2);
|
|
243808
244173
|
});
|
|
243809
244174
|
process21.on("error", (error48) => {
|
|
243810
|
-
this.logger.error(`
|
|
244175
|
+
this.logger.error(`Function "${name2}" error:`, error48);
|
|
243811
244176
|
this.running.delete(name2);
|
|
243812
244177
|
});
|
|
243813
244178
|
}
|
|
@@ -244258,6 +244623,1707 @@ function createCustomIntegrationRoutes(remoteProxy, logger) {
|
|
|
244258
244623
|
return router;
|
|
244259
244624
|
}
|
|
244260
244625
|
|
|
244626
|
+
// src/cli/dev/dev-server/watcher.ts
|
|
244627
|
+
import { EventEmitter as EventEmitter4 } from "node:events";
|
|
244628
|
+
import { relative as relative4 } from "node:path";
|
|
244629
|
+
|
|
244630
|
+
// node_modules/chokidar/index.js
|
|
244631
|
+
import { EventEmitter as EventEmitter3 } from "node:events";
|
|
244632
|
+
import { stat as statcb, Stats } from "node:fs";
|
|
244633
|
+
import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
|
|
244634
|
+
import * as sp3 from "node:path";
|
|
244635
|
+
|
|
244636
|
+
// node_modules/readdirp/index.js
|
|
244637
|
+
import { lstat as lstat2, readdir as readdir2, realpath, stat as stat2 } from "node:fs/promises";
|
|
244638
|
+
import { join as pjoin, relative as prelative, resolve as presolve, sep as psep } from "node:path";
|
|
244639
|
+
import { Readable as Readable6 } from "node:stream";
|
|
244640
|
+
var EntryTypes = {
|
|
244641
|
+
FILE_TYPE: "files",
|
|
244642
|
+
DIR_TYPE: "directories",
|
|
244643
|
+
FILE_DIR_TYPE: "files_directories",
|
|
244644
|
+
EVERYTHING_TYPE: "all"
|
|
244645
|
+
};
|
|
244646
|
+
var defaultOptions = {
|
|
244647
|
+
root: ".",
|
|
244648
|
+
fileFilter: (_entryInfo) => true,
|
|
244649
|
+
directoryFilter: (_entryInfo) => true,
|
|
244650
|
+
type: EntryTypes.FILE_TYPE,
|
|
244651
|
+
lstat: false,
|
|
244652
|
+
depth: 2147483648,
|
|
244653
|
+
alwaysStat: false,
|
|
244654
|
+
highWaterMark: 4096
|
|
244655
|
+
};
|
|
244656
|
+
Object.freeze(defaultOptions);
|
|
244657
|
+
var RECURSIVE_ERROR_CODE = "READDIRP_RECURSIVE_ERROR";
|
|
244658
|
+
var NORMAL_FLOW_ERRORS = new Set(["ENOENT", "EPERM", "EACCES", "ELOOP", RECURSIVE_ERROR_CODE]);
|
|
244659
|
+
var ALL_TYPES = [
|
|
244660
|
+
EntryTypes.DIR_TYPE,
|
|
244661
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244662
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
244663
|
+
EntryTypes.FILE_TYPE
|
|
244664
|
+
];
|
|
244665
|
+
var DIR_TYPES = new Set([
|
|
244666
|
+
EntryTypes.DIR_TYPE,
|
|
244667
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244668
|
+
EntryTypes.FILE_DIR_TYPE
|
|
244669
|
+
]);
|
|
244670
|
+
var FILE_TYPES2 = new Set([
|
|
244671
|
+
EntryTypes.EVERYTHING_TYPE,
|
|
244672
|
+
EntryTypes.FILE_DIR_TYPE,
|
|
244673
|
+
EntryTypes.FILE_TYPE
|
|
244674
|
+
]);
|
|
244675
|
+
var isNormalFlowError = (error48) => NORMAL_FLOW_ERRORS.has(error48.code);
|
|
244676
|
+
var wantBigintFsStats = process.platform === "win32";
|
|
244677
|
+
var emptyFn = (_entryInfo) => true;
|
|
244678
|
+
var normalizeFilter = (filter2) => {
|
|
244679
|
+
if (filter2 === undefined)
|
|
244680
|
+
return emptyFn;
|
|
244681
|
+
if (typeof filter2 === "function")
|
|
244682
|
+
return filter2;
|
|
244683
|
+
if (typeof filter2 === "string") {
|
|
244684
|
+
const fl6 = filter2.trim();
|
|
244685
|
+
return (entry) => entry.basename === fl6;
|
|
244686
|
+
}
|
|
244687
|
+
if (Array.isArray(filter2)) {
|
|
244688
|
+
const trItems = filter2.map((item) => item.trim());
|
|
244689
|
+
return (entry) => trItems.some((f7) => entry.basename === f7);
|
|
244690
|
+
}
|
|
244691
|
+
return emptyFn;
|
|
244692
|
+
};
|
|
244693
|
+
|
|
244694
|
+
class ReaddirpStream extends Readable6 {
|
|
244695
|
+
parents;
|
|
244696
|
+
reading;
|
|
244697
|
+
parent;
|
|
244698
|
+
_stat;
|
|
244699
|
+
_maxDepth;
|
|
244700
|
+
_wantsDir;
|
|
244701
|
+
_wantsFile;
|
|
244702
|
+
_wantsEverything;
|
|
244703
|
+
_root;
|
|
244704
|
+
_isDirent;
|
|
244705
|
+
_statsProp;
|
|
244706
|
+
_rdOptions;
|
|
244707
|
+
_fileFilter;
|
|
244708
|
+
_directoryFilter;
|
|
244709
|
+
constructor(options8 = {}) {
|
|
244710
|
+
super({
|
|
244711
|
+
objectMode: true,
|
|
244712
|
+
autoDestroy: true,
|
|
244713
|
+
highWaterMark: options8.highWaterMark
|
|
244714
|
+
});
|
|
244715
|
+
const opts = { ...defaultOptions, ...options8 };
|
|
244716
|
+
const { root: root2, type } = opts;
|
|
244717
|
+
this._fileFilter = normalizeFilter(opts.fileFilter);
|
|
244718
|
+
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
244719
|
+
const statMethod = opts.lstat ? lstat2 : stat2;
|
|
244720
|
+
if (wantBigintFsStats) {
|
|
244721
|
+
this._stat = (path19) => statMethod(path19, { bigint: true });
|
|
244722
|
+
} else {
|
|
244723
|
+
this._stat = statMethod;
|
|
244724
|
+
}
|
|
244725
|
+
this._maxDepth = opts.depth != null && Number.isSafeInteger(opts.depth) ? opts.depth : defaultOptions.depth;
|
|
244726
|
+
this._wantsDir = type ? DIR_TYPES.has(type) : false;
|
|
244727
|
+
this._wantsFile = type ? FILE_TYPES2.has(type) : false;
|
|
244728
|
+
this._wantsEverything = type === EntryTypes.EVERYTHING_TYPE;
|
|
244729
|
+
this._root = presolve(root2);
|
|
244730
|
+
this._isDirent = !opts.alwaysStat;
|
|
244731
|
+
this._statsProp = this._isDirent ? "dirent" : "stats";
|
|
244732
|
+
this._rdOptions = { encoding: "utf8", withFileTypes: this._isDirent };
|
|
244733
|
+
this.parents = [this._exploreDir(root2, 1)];
|
|
244734
|
+
this.reading = false;
|
|
244735
|
+
this.parent = undefined;
|
|
244736
|
+
}
|
|
244737
|
+
async _read(batch) {
|
|
244738
|
+
if (this.reading)
|
|
244739
|
+
return;
|
|
244740
|
+
this.reading = true;
|
|
244741
|
+
try {
|
|
244742
|
+
while (!this.destroyed && batch > 0) {
|
|
244743
|
+
const par = this.parent;
|
|
244744
|
+
const fil = par && par.files;
|
|
244745
|
+
if (fil && fil.length > 0) {
|
|
244746
|
+
const { path: path19, depth } = par;
|
|
244747
|
+
const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path19));
|
|
244748
|
+
const awaited = await Promise.all(slice);
|
|
244749
|
+
for (const entry of awaited) {
|
|
244750
|
+
if (!entry)
|
|
244751
|
+
continue;
|
|
244752
|
+
if (this.destroyed)
|
|
244753
|
+
return;
|
|
244754
|
+
const entryType = await this._getEntryType(entry);
|
|
244755
|
+
if (entryType === "directory" && this._directoryFilter(entry)) {
|
|
244756
|
+
if (depth <= this._maxDepth) {
|
|
244757
|
+
this.parents.push(this._exploreDir(entry.fullPath, depth + 1));
|
|
244758
|
+
}
|
|
244759
|
+
if (this._wantsDir) {
|
|
244760
|
+
this.push(entry);
|
|
244761
|
+
batch--;
|
|
244762
|
+
}
|
|
244763
|
+
} else if ((entryType === "file" || this._includeAsFile(entry)) && this._fileFilter(entry)) {
|
|
244764
|
+
if (this._wantsFile) {
|
|
244765
|
+
this.push(entry);
|
|
244766
|
+
batch--;
|
|
244767
|
+
}
|
|
244768
|
+
}
|
|
244769
|
+
}
|
|
244770
|
+
} else {
|
|
244771
|
+
const parent = this.parents.pop();
|
|
244772
|
+
if (!parent) {
|
|
244773
|
+
this.push(null);
|
|
244774
|
+
break;
|
|
244775
|
+
}
|
|
244776
|
+
this.parent = await parent;
|
|
244777
|
+
if (this.destroyed)
|
|
244778
|
+
return;
|
|
244779
|
+
}
|
|
244780
|
+
}
|
|
244781
|
+
} catch (error48) {
|
|
244782
|
+
this.destroy(error48);
|
|
244783
|
+
} finally {
|
|
244784
|
+
this.reading = false;
|
|
244785
|
+
}
|
|
244786
|
+
}
|
|
244787
|
+
async _exploreDir(path19, depth) {
|
|
244788
|
+
let files;
|
|
244789
|
+
try {
|
|
244790
|
+
files = await readdir2(path19, this._rdOptions);
|
|
244791
|
+
} catch (error48) {
|
|
244792
|
+
this._onError(error48);
|
|
244793
|
+
}
|
|
244794
|
+
return { files, depth, path: path19 };
|
|
244795
|
+
}
|
|
244796
|
+
async _formatEntry(dirent, path19) {
|
|
244797
|
+
let entry;
|
|
244798
|
+
const basename4 = this._isDirent ? dirent.name : dirent;
|
|
244799
|
+
try {
|
|
244800
|
+
const fullPath = presolve(pjoin(path19, basename4));
|
|
244801
|
+
entry = { path: prelative(this._root, fullPath), fullPath, basename: basename4 };
|
|
244802
|
+
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
244803
|
+
} catch (err) {
|
|
244804
|
+
this._onError(err);
|
|
244805
|
+
return;
|
|
244806
|
+
}
|
|
244807
|
+
return entry;
|
|
244808
|
+
}
|
|
244809
|
+
_onError(err) {
|
|
244810
|
+
if (isNormalFlowError(err) && !this.destroyed) {
|
|
244811
|
+
this.emit("warn", err);
|
|
244812
|
+
} else {
|
|
244813
|
+
this.destroy(err);
|
|
244814
|
+
}
|
|
244815
|
+
}
|
|
244816
|
+
async _getEntryType(entry) {
|
|
244817
|
+
if (!entry && this._statsProp in entry) {
|
|
244818
|
+
return "";
|
|
244819
|
+
}
|
|
244820
|
+
const stats = entry[this._statsProp];
|
|
244821
|
+
if (stats.isFile())
|
|
244822
|
+
return "file";
|
|
244823
|
+
if (stats.isDirectory())
|
|
244824
|
+
return "directory";
|
|
244825
|
+
if (stats && stats.isSymbolicLink()) {
|
|
244826
|
+
const full = entry.fullPath;
|
|
244827
|
+
try {
|
|
244828
|
+
const entryRealPath = await realpath(full);
|
|
244829
|
+
const entryRealPathStats = await lstat2(entryRealPath);
|
|
244830
|
+
if (entryRealPathStats.isFile()) {
|
|
244831
|
+
return "file";
|
|
244832
|
+
}
|
|
244833
|
+
if (entryRealPathStats.isDirectory()) {
|
|
244834
|
+
const len = entryRealPath.length;
|
|
244835
|
+
if (full.startsWith(entryRealPath) && full.substr(len, 1) === psep) {
|
|
244836
|
+
const recursiveError = new Error(`Circular symlink detected: "${full}" points to "${entryRealPath}"`);
|
|
244837
|
+
recursiveError.code = RECURSIVE_ERROR_CODE;
|
|
244838
|
+
return this._onError(recursiveError);
|
|
244839
|
+
}
|
|
244840
|
+
return "directory";
|
|
244841
|
+
}
|
|
244842
|
+
} catch (error48) {
|
|
244843
|
+
this._onError(error48);
|
|
244844
|
+
return "";
|
|
244845
|
+
}
|
|
244846
|
+
}
|
|
244847
|
+
}
|
|
244848
|
+
_includeAsFile(entry) {
|
|
244849
|
+
const stats = entry && entry[this._statsProp];
|
|
244850
|
+
return stats && this._wantsEverything && !stats.isDirectory();
|
|
244851
|
+
}
|
|
244852
|
+
}
|
|
244853
|
+
function readdirp(root2, options8 = {}) {
|
|
244854
|
+
let type = options8.entryType || options8.type;
|
|
244855
|
+
if (type === "both")
|
|
244856
|
+
type = EntryTypes.FILE_DIR_TYPE;
|
|
244857
|
+
if (type)
|
|
244858
|
+
options8.type = type;
|
|
244859
|
+
if (!root2) {
|
|
244860
|
+
throw new Error("readdirp: root argument is required. Usage: readdirp(root, options)");
|
|
244861
|
+
} else if (typeof root2 !== "string") {
|
|
244862
|
+
throw new TypeError("readdirp: root argument must be a string. Usage: readdirp(root, options)");
|
|
244863
|
+
} else if (type && !ALL_TYPES.includes(type)) {
|
|
244864
|
+
throw new Error(`readdirp: Invalid type passed. Use one of ${ALL_TYPES.join(", ")}`);
|
|
244865
|
+
}
|
|
244866
|
+
options8.root = root2;
|
|
244867
|
+
return new ReaddirpStream(options8);
|
|
244868
|
+
}
|
|
244869
|
+
|
|
244870
|
+
// node_modules/chokidar/handler.js
|
|
244871
|
+
import { watch as fs_watch, unwatchFile, watchFile } from "node:fs";
|
|
244872
|
+
import { realpath as fsrealpath, lstat as lstat3, open as open2, stat as stat3 } from "node:fs/promises";
|
|
244873
|
+
import { type as osType } from "node:os";
|
|
244874
|
+
import * as sp2 from "node:path";
|
|
244875
|
+
var STR_DATA = "data";
|
|
244876
|
+
var STR_END = "end";
|
|
244877
|
+
var STR_CLOSE = "close";
|
|
244878
|
+
var EMPTY_FN = () => {};
|
|
244879
|
+
var pl6 = process.platform;
|
|
244880
|
+
var isWindows4 = pl6 === "win32";
|
|
244881
|
+
var isMacos = pl6 === "darwin";
|
|
244882
|
+
var isLinux = pl6 === "linux";
|
|
244883
|
+
var isFreeBSD = pl6 === "freebsd";
|
|
244884
|
+
var isIBMi = osType() === "OS400";
|
|
244885
|
+
var EVENTS = {
|
|
244886
|
+
ALL: "all",
|
|
244887
|
+
READY: "ready",
|
|
244888
|
+
ADD: "add",
|
|
244889
|
+
CHANGE: "change",
|
|
244890
|
+
ADD_DIR: "addDir",
|
|
244891
|
+
UNLINK: "unlink",
|
|
244892
|
+
UNLINK_DIR: "unlinkDir",
|
|
244893
|
+
RAW: "raw",
|
|
244894
|
+
ERROR: "error"
|
|
244895
|
+
};
|
|
244896
|
+
var EV = EVENTS;
|
|
244897
|
+
var THROTTLE_MODE_WATCH = "watch";
|
|
244898
|
+
var statMethods = { lstat: lstat3, stat: stat3 };
|
|
244899
|
+
var KEY_LISTENERS = "listeners";
|
|
244900
|
+
var KEY_ERR = "errHandlers";
|
|
244901
|
+
var KEY_RAW = "rawEmitters";
|
|
244902
|
+
var HANDLER_KEYS2 = [KEY_LISTENERS, KEY_ERR, KEY_RAW];
|
|
244903
|
+
var binaryExtensions = new Set([
|
|
244904
|
+
"3dm",
|
|
244905
|
+
"3ds",
|
|
244906
|
+
"3g2",
|
|
244907
|
+
"3gp",
|
|
244908
|
+
"7z",
|
|
244909
|
+
"a",
|
|
244910
|
+
"aac",
|
|
244911
|
+
"adp",
|
|
244912
|
+
"afdesign",
|
|
244913
|
+
"afphoto",
|
|
244914
|
+
"afpub",
|
|
244915
|
+
"ai",
|
|
244916
|
+
"aif",
|
|
244917
|
+
"aiff",
|
|
244918
|
+
"alz",
|
|
244919
|
+
"ape",
|
|
244920
|
+
"apk",
|
|
244921
|
+
"appimage",
|
|
244922
|
+
"ar",
|
|
244923
|
+
"arj",
|
|
244924
|
+
"asf",
|
|
244925
|
+
"au",
|
|
244926
|
+
"avi",
|
|
244927
|
+
"bak",
|
|
244928
|
+
"baml",
|
|
244929
|
+
"bh",
|
|
244930
|
+
"bin",
|
|
244931
|
+
"bk",
|
|
244932
|
+
"bmp",
|
|
244933
|
+
"btif",
|
|
244934
|
+
"bz2",
|
|
244935
|
+
"bzip2",
|
|
244936
|
+
"cab",
|
|
244937
|
+
"caf",
|
|
244938
|
+
"cgm",
|
|
244939
|
+
"class",
|
|
244940
|
+
"cmx",
|
|
244941
|
+
"cpio",
|
|
244942
|
+
"cr2",
|
|
244943
|
+
"cur",
|
|
244944
|
+
"dat",
|
|
244945
|
+
"dcm",
|
|
244946
|
+
"deb",
|
|
244947
|
+
"dex",
|
|
244948
|
+
"djvu",
|
|
244949
|
+
"dll",
|
|
244950
|
+
"dmg",
|
|
244951
|
+
"dng",
|
|
244952
|
+
"doc",
|
|
244953
|
+
"docm",
|
|
244954
|
+
"docx",
|
|
244955
|
+
"dot",
|
|
244956
|
+
"dotm",
|
|
244957
|
+
"dra",
|
|
244958
|
+
"DS_Store",
|
|
244959
|
+
"dsk",
|
|
244960
|
+
"dts",
|
|
244961
|
+
"dtshd",
|
|
244962
|
+
"dvb",
|
|
244963
|
+
"dwg",
|
|
244964
|
+
"dxf",
|
|
244965
|
+
"ecelp4800",
|
|
244966
|
+
"ecelp7470",
|
|
244967
|
+
"ecelp9600",
|
|
244968
|
+
"egg",
|
|
244969
|
+
"eol",
|
|
244970
|
+
"eot",
|
|
244971
|
+
"epub",
|
|
244972
|
+
"exe",
|
|
244973
|
+
"f4v",
|
|
244974
|
+
"fbs",
|
|
244975
|
+
"fh",
|
|
244976
|
+
"fla",
|
|
244977
|
+
"flac",
|
|
244978
|
+
"flatpak",
|
|
244979
|
+
"fli",
|
|
244980
|
+
"flv",
|
|
244981
|
+
"fpx",
|
|
244982
|
+
"fst",
|
|
244983
|
+
"fvt",
|
|
244984
|
+
"g3",
|
|
244985
|
+
"gh",
|
|
244986
|
+
"gif",
|
|
244987
|
+
"graffle",
|
|
244988
|
+
"gz",
|
|
244989
|
+
"gzip",
|
|
244990
|
+
"h261",
|
|
244991
|
+
"h263",
|
|
244992
|
+
"h264",
|
|
244993
|
+
"icns",
|
|
244994
|
+
"ico",
|
|
244995
|
+
"ief",
|
|
244996
|
+
"img",
|
|
244997
|
+
"ipa",
|
|
244998
|
+
"iso",
|
|
244999
|
+
"jar",
|
|
245000
|
+
"jpeg",
|
|
245001
|
+
"jpg",
|
|
245002
|
+
"jpgv",
|
|
245003
|
+
"jpm",
|
|
245004
|
+
"jxr",
|
|
245005
|
+
"key",
|
|
245006
|
+
"ktx",
|
|
245007
|
+
"lha",
|
|
245008
|
+
"lib",
|
|
245009
|
+
"lvp",
|
|
245010
|
+
"lz",
|
|
245011
|
+
"lzh",
|
|
245012
|
+
"lzma",
|
|
245013
|
+
"lzo",
|
|
245014
|
+
"m3u",
|
|
245015
|
+
"m4a",
|
|
245016
|
+
"m4v",
|
|
245017
|
+
"mar",
|
|
245018
|
+
"mdi",
|
|
245019
|
+
"mht",
|
|
245020
|
+
"mid",
|
|
245021
|
+
"midi",
|
|
245022
|
+
"mj2",
|
|
245023
|
+
"mka",
|
|
245024
|
+
"mkv",
|
|
245025
|
+
"mmr",
|
|
245026
|
+
"mng",
|
|
245027
|
+
"mobi",
|
|
245028
|
+
"mov",
|
|
245029
|
+
"movie",
|
|
245030
|
+
"mp3",
|
|
245031
|
+
"mp4",
|
|
245032
|
+
"mp4a",
|
|
245033
|
+
"mpeg",
|
|
245034
|
+
"mpg",
|
|
245035
|
+
"mpga",
|
|
245036
|
+
"mxu",
|
|
245037
|
+
"nef",
|
|
245038
|
+
"npx",
|
|
245039
|
+
"numbers",
|
|
245040
|
+
"nupkg",
|
|
245041
|
+
"o",
|
|
245042
|
+
"odp",
|
|
245043
|
+
"ods",
|
|
245044
|
+
"odt",
|
|
245045
|
+
"oga",
|
|
245046
|
+
"ogg",
|
|
245047
|
+
"ogv",
|
|
245048
|
+
"otf",
|
|
245049
|
+
"ott",
|
|
245050
|
+
"pages",
|
|
245051
|
+
"pbm",
|
|
245052
|
+
"pcx",
|
|
245053
|
+
"pdb",
|
|
245054
|
+
"pdf",
|
|
245055
|
+
"pea",
|
|
245056
|
+
"pgm",
|
|
245057
|
+
"pic",
|
|
245058
|
+
"png",
|
|
245059
|
+
"pnm",
|
|
245060
|
+
"pot",
|
|
245061
|
+
"potm",
|
|
245062
|
+
"potx",
|
|
245063
|
+
"ppa",
|
|
245064
|
+
"ppam",
|
|
245065
|
+
"ppm",
|
|
245066
|
+
"pps",
|
|
245067
|
+
"ppsm",
|
|
245068
|
+
"ppsx",
|
|
245069
|
+
"ppt",
|
|
245070
|
+
"pptm",
|
|
245071
|
+
"pptx",
|
|
245072
|
+
"psd",
|
|
245073
|
+
"pya",
|
|
245074
|
+
"pyc",
|
|
245075
|
+
"pyo",
|
|
245076
|
+
"pyv",
|
|
245077
|
+
"qt",
|
|
245078
|
+
"rar",
|
|
245079
|
+
"ras",
|
|
245080
|
+
"raw",
|
|
245081
|
+
"resources",
|
|
245082
|
+
"rgb",
|
|
245083
|
+
"rip",
|
|
245084
|
+
"rlc",
|
|
245085
|
+
"rmf",
|
|
245086
|
+
"rmvb",
|
|
245087
|
+
"rpm",
|
|
245088
|
+
"rtf",
|
|
245089
|
+
"rz",
|
|
245090
|
+
"s3m",
|
|
245091
|
+
"s7z",
|
|
245092
|
+
"scpt",
|
|
245093
|
+
"sgi",
|
|
245094
|
+
"shar",
|
|
245095
|
+
"snap",
|
|
245096
|
+
"sil",
|
|
245097
|
+
"sketch",
|
|
245098
|
+
"slk",
|
|
245099
|
+
"smv",
|
|
245100
|
+
"snk",
|
|
245101
|
+
"so",
|
|
245102
|
+
"stl",
|
|
245103
|
+
"suo",
|
|
245104
|
+
"sub",
|
|
245105
|
+
"swf",
|
|
245106
|
+
"tar",
|
|
245107
|
+
"tbz",
|
|
245108
|
+
"tbz2",
|
|
245109
|
+
"tga",
|
|
245110
|
+
"tgz",
|
|
245111
|
+
"thmx",
|
|
245112
|
+
"tif",
|
|
245113
|
+
"tiff",
|
|
245114
|
+
"tlz",
|
|
245115
|
+
"ttc",
|
|
245116
|
+
"ttf",
|
|
245117
|
+
"txz",
|
|
245118
|
+
"udf",
|
|
245119
|
+
"uvh",
|
|
245120
|
+
"uvi",
|
|
245121
|
+
"uvm",
|
|
245122
|
+
"uvp",
|
|
245123
|
+
"uvs",
|
|
245124
|
+
"uvu",
|
|
245125
|
+
"viv",
|
|
245126
|
+
"vob",
|
|
245127
|
+
"war",
|
|
245128
|
+
"wav",
|
|
245129
|
+
"wax",
|
|
245130
|
+
"wbmp",
|
|
245131
|
+
"wdp",
|
|
245132
|
+
"weba",
|
|
245133
|
+
"webm",
|
|
245134
|
+
"webp",
|
|
245135
|
+
"whl",
|
|
245136
|
+
"wim",
|
|
245137
|
+
"wm",
|
|
245138
|
+
"wma",
|
|
245139
|
+
"wmv",
|
|
245140
|
+
"wmx",
|
|
245141
|
+
"woff",
|
|
245142
|
+
"woff2",
|
|
245143
|
+
"wrm",
|
|
245144
|
+
"wvx",
|
|
245145
|
+
"xbm",
|
|
245146
|
+
"xif",
|
|
245147
|
+
"xla",
|
|
245148
|
+
"xlam",
|
|
245149
|
+
"xls",
|
|
245150
|
+
"xlsb",
|
|
245151
|
+
"xlsm",
|
|
245152
|
+
"xlsx",
|
|
245153
|
+
"xlt",
|
|
245154
|
+
"xltm",
|
|
245155
|
+
"xltx",
|
|
245156
|
+
"xm",
|
|
245157
|
+
"xmind",
|
|
245158
|
+
"xpi",
|
|
245159
|
+
"xpm",
|
|
245160
|
+
"xwd",
|
|
245161
|
+
"xz",
|
|
245162
|
+
"z",
|
|
245163
|
+
"zip",
|
|
245164
|
+
"zipx"
|
|
245165
|
+
]);
|
|
245166
|
+
var isBinaryPath = (filePath) => binaryExtensions.has(sp2.extname(filePath).slice(1).toLowerCase());
|
|
245167
|
+
var foreach = (val, fn9) => {
|
|
245168
|
+
if (val instanceof Set) {
|
|
245169
|
+
val.forEach(fn9);
|
|
245170
|
+
} else {
|
|
245171
|
+
fn9(val);
|
|
245172
|
+
}
|
|
245173
|
+
};
|
|
245174
|
+
var addAndConvert = (main, prop, item) => {
|
|
245175
|
+
let container = main[prop];
|
|
245176
|
+
if (!(container instanceof Set)) {
|
|
245177
|
+
main[prop] = container = new Set([container]);
|
|
245178
|
+
}
|
|
245179
|
+
container.add(item);
|
|
245180
|
+
};
|
|
245181
|
+
var clearItem = (cont) => (key2) => {
|
|
245182
|
+
const set2 = cont[key2];
|
|
245183
|
+
if (set2 instanceof Set) {
|
|
245184
|
+
set2.clear();
|
|
245185
|
+
} else {
|
|
245186
|
+
delete cont[key2];
|
|
245187
|
+
}
|
|
245188
|
+
};
|
|
245189
|
+
var delFromSet = (main, prop, item) => {
|
|
245190
|
+
const container = main[prop];
|
|
245191
|
+
if (container instanceof Set) {
|
|
245192
|
+
container.delete(item);
|
|
245193
|
+
} else if (container === item) {
|
|
245194
|
+
delete main[prop];
|
|
245195
|
+
}
|
|
245196
|
+
};
|
|
245197
|
+
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
245198
|
+
var FsWatchInstances = new Map;
|
|
245199
|
+
function createFsWatchInstance(path19, options8, listener, errHandler, emitRaw) {
|
|
245200
|
+
const handleEvent = (rawEvent, evPath) => {
|
|
245201
|
+
listener(path19);
|
|
245202
|
+
emitRaw(rawEvent, evPath, { watchedPath: path19 });
|
|
245203
|
+
if (evPath && path19 !== evPath) {
|
|
245204
|
+
fsWatchBroadcast(sp2.resolve(path19, evPath), KEY_LISTENERS, sp2.join(path19, evPath));
|
|
245205
|
+
}
|
|
245206
|
+
};
|
|
245207
|
+
try {
|
|
245208
|
+
return fs_watch(path19, {
|
|
245209
|
+
persistent: options8.persistent
|
|
245210
|
+
}, handleEvent);
|
|
245211
|
+
} catch (error48) {
|
|
245212
|
+
errHandler(error48);
|
|
245213
|
+
return;
|
|
245214
|
+
}
|
|
245215
|
+
}
|
|
245216
|
+
var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
|
|
245217
|
+
const cont = FsWatchInstances.get(fullPath);
|
|
245218
|
+
if (!cont)
|
|
245219
|
+
return;
|
|
245220
|
+
foreach(cont[listenerType], (listener) => {
|
|
245221
|
+
listener(val1, val2, val3);
|
|
245222
|
+
});
|
|
245223
|
+
};
|
|
245224
|
+
var setFsWatchListener = (path19, fullPath, options8, handlers) => {
|
|
245225
|
+
const { listener, errHandler, rawEmitter } = handlers;
|
|
245226
|
+
let cont = FsWatchInstances.get(fullPath);
|
|
245227
|
+
let watcher;
|
|
245228
|
+
if (!options8.persistent) {
|
|
245229
|
+
watcher = createFsWatchInstance(path19, options8, listener, errHandler, rawEmitter);
|
|
245230
|
+
if (!watcher)
|
|
245231
|
+
return;
|
|
245232
|
+
return watcher.close.bind(watcher);
|
|
245233
|
+
}
|
|
245234
|
+
if (cont) {
|
|
245235
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
245236
|
+
addAndConvert(cont, KEY_ERR, errHandler);
|
|
245237
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
245238
|
+
} else {
|
|
245239
|
+
watcher = createFsWatchInstance(path19, options8, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
|
|
245240
|
+
if (!watcher)
|
|
245241
|
+
return;
|
|
245242
|
+
watcher.on(EV.ERROR, async (error48) => {
|
|
245243
|
+
const broadcastErr = fsWatchBroadcast.bind(null, fullPath, KEY_ERR);
|
|
245244
|
+
if (cont)
|
|
245245
|
+
cont.watcherUnusable = true;
|
|
245246
|
+
if (isWindows4 && error48.code === "EPERM") {
|
|
245247
|
+
try {
|
|
245248
|
+
const fd = await open2(path19, "r");
|
|
245249
|
+
await fd.close();
|
|
245250
|
+
broadcastErr(error48);
|
|
245251
|
+
} catch (err) {}
|
|
245252
|
+
} else {
|
|
245253
|
+
broadcastErr(error48);
|
|
245254
|
+
}
|
|
245255
|
+
});
|
|
245256
|
+
cont = {
|
|
245257
|
+
listeners: listener,
|
|
245258
|
+
errHandlers: errHandler,
|
|
245259
|
+
rawEmitters: rawEmitter,
|
|
245260
|
+
watcher
|
|
245261
|
+
};
|
|
245262
|
+
FsWatchInstances.set(fullPath, cont);
|
|
245263
|
+
}
|
|
245264
|
+
return () => {
|
|
245265
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
245266
|
+
delFromSet(cont, KEY_ERR, errHandler);
|
|
245267
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
245268
|
+
if (isEmptySet(cont.listeners)) {
|
|
245269
|
+
cont.watcher.close();
|
|
245270
|
+
FsWatchInstances.delete(fullPath);
|
|
245271
|
+
HANDLER_KEYS2.forEach(clearItem(cont));
|
|
245272
|
+
cont.watcher = undefined;
|
|
245273
|
+
Object.freeze(cont);
|
|
245274
|
+
}
|
|
245275
|
+
};
|
|
245276
|
+
};
|
|
245277
|
+
var FsWatchFileInstances = new Map;
|
|
245278
|
+
var setFsWatchFileListener = (path19, fullPath, options8, handlers) => {
|
|
245279
|
+
const { listener, rawEmitter } = handlers;
|
|
245280
|
+
let cont = FsWatchFileInstances.get(fullPath);
|
|
245281
|
+
const copts = cont && cont.options;
|
|
245282
|
+
if (copts && (copts.persistent < options8.persistent || copts.interval > options8.interval)) {
|
|
245283
|
+
unwatchFile(fullPath);
|
|
245284
|
+
cont = undefined;
|
|
245285
|
+
}
|
|
245286
|
+
if (cont) {
|
|
245287
|
+
addAndConvert(cont, KEY_LISTENERS, listener);
|
|
245288
|
+
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
245289
|
+
} else {
|
|
245290
|
+
cont = {
|
|
245291
|
+
listeners: listener,
|
|
245292
|
+
rawEmitters: rawEmitter,
|
|
245293
|
+
options: options8,
|
|
245294
|
+
watcher: watchFile(fullPath, options8, (curr, prev) => {
|
|
245295
|
+
foreach(cont.rawEmitters, (rawEmitter2) => {
|
|
245296
|
+
rawEmitter2(EV.CHANGE, fullPath, { curr, prev });
|
|
245297
|
+
});
|
|
245298
|
+
const currmtime = curr.mtimeMs;
|
|
245299
|
+
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
245300
|
+
foreach(cont.listeners, (listener2) => listener2(path19, curr));
|
|
245301
|
+
}
|
|
245302
|
+
})
|
|
245303
|
+
};
|
|
245304
|
+
FsWatchFileInstances.set(fullPath, cont);
|
|
245305
|
+
}
|
|
245306
|
+
return () => {
|
|
245307
|
+
delFromSet(cont, KEY_LISTENERS, listener);
|
|
245308
|
+
delFromSet(cont, KEY_RAW, rawEmitter);
|
|
245309
|
+
if (isEmptySet(cont.listeners)) {
|
|
245310
|
+
FsWatchFileInstances.delete(fullPath);
|
|
245311
|
+
unwatchFile(fullPath);
|
|
245312
|
+
cont.options = cont.watcher = undefined;
|
|
245313
|
+
Object.freeze(cont);
|
|
245314
|
+
}
|
|
245315
|
+
};
|
|
245316
|
+
};
|
|
245317
|
+
|
|
245318
|
+
class NodeFsHandler {
|
|
245319
|
+
fsw;
|
|
245320
|
+
_boundHandleError;
|
|
245321
|
+
constructor(fsW) {
|
|
245322
|
+
this.fsw = fsW;
|
|
245323
|
+
this._boundHandleError = (error48) => fsW._handleError(error48);
|
|
245324
|
+
}
|
|
245325
|
+
_watchWithNodeFs(path19, listener) {
|
|
245326
|
+
const opts = this.fsw.options;
|
|
245327
|
+
const directory = sp2.dirname(path19);
|
|
245328
|
+
const basename5 = sp2.basename(path19);
|
|
245329
|
+
const parent = this.fsw._getWatchedDir(directory);
|
|
245330
|
+
parent.add(basename5);
|
|
245331
|
+
const absolutePath = sp2.resolve(path19);
|
|
245332
|
+
const options8 = {
|
|
245333
|
+
persistent: opts.persistent
|
|
245334
|
+
};
|
|
245335
|
+
if (!listener)
|
|
245336
|
+
listener = EMPTY_FN;
|
|
245337
|
+
let closer;
|
|
245338
|
+
if (opts.usePolling) {
|
|
245339
|
+
const enableBin = opts.interval !== opts.binaryInterval;
|
|
245340
|
+
options8.interval = enableBin && isBinaryPath(basename5) ? opts.binaryInterval : opts.interval;
|
|
245341
|
+
closer = setFsWatchFileListener(path19, absolutePath, options8, {
|
|
245342
|
+
listener,
|
|
245343
|
+
rawEmitter: this.fsw._emitRaw
|
|
245344
|
+
});
|
|
245345
|
+
} else {
|
|
245346
|
+
closer = setFsWatchListener(path19, absolutePath, options8, {
|
|
245347
|
+
listener,
|
|
245348
|
+
errHandler: this._boundHandleError,
|
|
245349
|
+
rawEmitter: this.fsw._emitRaw
|
|
245350
|
+
});
|
|
245351
|
+
}
|
|
245352
|
+
return closer;
|
|
245353
|
+
}
|
|
245354
|
+
_handleFile(file2, stats, initialAdd) {
|
|
245355
|
+
if (this.fsw.closed) {
|
|
245356
|
+
return;
|
|
245357
|
+
}
|
|
245358
|
+
const dirname13 = sp2.dirname(file2);
|
|
245359
|
+
const basename5 = sp2.basename(file2);
|
|
245360
|
+
const parent = this.fsw._getWatchedDir(dirname13);
|
|
245361
|
+
let prevStats = stats;
|
|
245362
|
+
if (parent.has(basename5))
|
|
245363
|
+
return;
|
|
245364
|
+
const listener = async (path19, newStats) => {
|
|
245365
|
+
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file2, 5))
|
|
245366
|
+
return;
|
|
245367
|
+
if (!newStats || newStats.mtimeMs === 0) {
|
|
245368
|
+
try {
|
|
245369
|
+
const newStats2 = await stat3(file2);
|
|
245370
|
+
if (this.fsw.closed)
|
|
245371
|
+
return;
|
|
245372
|
+
const at13 = newStats2.atimeMs;
|
|
245373
|
+
const mt12 = newStats2.mtimeMs;
|
|
245374
|
+
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
245375
|
+
this.fsw._emit(EV.CHANGE, file2, newStats2);
|
|
245376
|
+
}
|
|
245377
|
+
if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
|
|
245378
|
+
this.fsw._closeFile(path19);
|
|
245379
|
+
prevStats = newStats2;
|
|
245380
|
+
const closer2 = this._watchWithNodeFs(file2, listener);
|
|
245381
|
+
if (closer2)
|
|
245382
|
+
this.fsw._addPathCloser(path19, closer2);
|
|
245383
|
+
} else {
|
|
245384
|
+
prevStats = newStats2;
|
|
245385
|
+
}
|
|
245386
|
+
} catch (error48) {
|
|
245387
|
+
this.fsw._remove(dirname13, basename5);
|
|
245388
|
+
}
|
|
245389
|
+
} else if (parent.has(basename5)) {
|
|
245390
|
+
const at13 = newStats.atimeMs;
|
|
245391
|
+
const mt12 = newStats.mtimeMs;
|
|
245392
|
+
if (!at13 || at13 <= mt12 || mt12 !== prevStats.mtimeMs) {
|
|
245393
|
+
this.fsw._emit(EV.CHANGE, file2, newStats);
|
|
245394
|
+
}
|
|
245395
|
+
prevStats = newStats;
|
|
245396
|
+
}
|
|
245397
|
+
};
|
|
245398
|
+
const closer = this._watchWithNodeFs(file2, listener);
|
|
245399
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && this.fsw._isntIgnored(file2)) {
|
|
245400
|
+
if (!this.fsw._throttle(EV.ADD, file2, 0))
|
|
245401
|
+
return;
|
|
245402
|
+
this.fsw._emit(EV.ADD, file2, stats);
|
|
245403
|
+
}
|
|
245404
|
+
return closer;
|
|
245405
|
+
}
|
|
245406
|
+
async _handleSymlink(entry, directory, path19, item) {
|
|
245407
|
+
if (this.fsw.closed) {
|
|
245408
|
+
return;
|
|
245409
|
+
}
|
|
245410
|
+
const full = entry.fullPath;
|
|
245411
|
+
const dir = this.fsw._getWatchedDir(directory);
|
|
245412
|
+
if (!this.fsw.options.followSymlinks) {
|
|
245413
|
+
this.fsw._incrReadyCount();
|
|
245414
|
+
let linkPath;
|
|
245415
|
+
try {
|
|
245416
|
+
linkPath = await fsrealpath(path19);
|
|
245417
|
+
} catch (e8) {
|
|
245418
|
+
this.fsw._emitReady();
|
|
245419
|
+
return true;
|
|
245420
|
+
}
|
|
245421
|
+
if (this.fsw.closed)
|
|
245422
|
+
return;
|
|
245423
|
+
if (dir.has(item)) {
|
|
245424
|
+
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
245425
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
245426
|
+
this.fsw._emit(EV.CHANGE, path19, entry.stats);
|
|
245427
|
+
}
|
|
245428
|
+
} else {
|
|
245429
|
+
dir.add(item);
|
|
245430
|
+
this.fsw._symlinkPaths.set(full, linkPath);
|
|
245431
|
+
this.fsw._emit(EV.ADD, path19, entry.stats);
|
|
245432
|
+
}
|
|
245433
|
+
this.fsw._emitReady();
|
|
245434
|
+
return true;
|
|
245435
|
+
}
|
|
245436
|
+
if (this.fsw._symlinkPaths.has(full)) {
|
|
245437
|
+
return true;
|
|
245438
|
+
}
|
|
245439
|
+
this.fsw._symlinkPaths.set(full, true);
|
|
245440
|
+
}
|
|
245441
|
+
_handleRead(directory, initialAdd, wh2, target, dir, depth, throttler) {
|
|
245442
|
+
directory = sp2.join(directory, "");
|
|
245443
|
+
const throttleKey = target ? `${directory}:${target}` : directory;
|
|
245444
|
+
throttler = this.fsw._throttle("readdir", throttleKey, 1000);
|
|
245445
|
+
if (!throttler)
|
|
245446
|
+
return;
|
|
245447
|
+
const previous = this.fsw._getWatchedDir(wh2.path);
|
|
245448
|
+
const current = new Set;
|
|
245449
|
+
let stream = this.fsw._readdirp(directory, {
|
|
245450
|
+
fileFilter: (entry) => wh2.filterPath(entry),
|
|
245451
|
+
directoryFilter: (entry) => wh2.filterDir(entry)
|
|
245452
|
+
});
|
|
245453
|
+
if (!stream)
|
|
245454
|
+
return;
|
|
245455
|
+
stream.on(STR_DATA, async (entry) => {
|
|
245456
|
+
if (this.fsw.closed) {
|
|
245457
|
+
stream = undefined;
|
|
245458
|
+
return;
|
|
245459
|
+
}
|
|
245460
|
+
const item = entry.path;
|
|
245461
|
+
let path19 = sp2.join(directory, item);
|
|
245462
|
+
current.add(item);
|
|
245463
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path19, item)) {
|
|
245464
|
+
return;
|
|
245465
|
+
}
|
|
245466
|
+
if (this.fsw.closed) {
|
|
245467
|
+
stream = undefined;
|
|
245468
|
+
return;
|
|
245469
|
+
}
|
|
245470
|
+
if (item === target || !target && !previous.has(item)) {
|
|
245471
|
+
this.fsw._incrReadyCount();
|
|
245472
|
+
path19 = sp2.join(dir, sp2.relative(dir, path19));
|
|
245473
|
+
this._addToNodeFs(path19, initialAdd, wh2, depth + 1);
|
|
245474
|
+
}
|
|
245475
|
+
}).on(EV.ERROR, this._boundHandleError);
|
|
245476
|
+
return new Promise((resolve7, reject) => {
|
|
245477
|
+
if (!stream)
|
|
245478
|
+
return reject();
|
|
245479
|
+
stream.once(STR_END, () => {
|
|
245480
|
+
if (this.fsw.closed) {
|
|
245481
|
+
stream = undefined;
|
|
245482
|
+
return;
|
|
245483
|
+
}
|
|
245484
|
+
const wasThrottled = throttler ? throttler.clear() : false;
|
|
245485
|
+
resolve7(undefined);
|
|
245486
|
+
previous.getChildren().filter((item) => {
|
|
245487
|
+
return item !== directory && !current.has(item);
|
|
245488
|
+
}).forEach((item) => {
|
|
245489
|
+
this.fsw._remove(directory, item);
|
|
245490
|
+
});
|
|
245491
|
+
stream = undefined;
|
|
245492
|
+
if (wasThrottled)
|
|
245493
|
+
this._handleRead(directory, false, wh2, target, dir, depth, throttler);
|
|
245494
|
+
});
|
|
245495
|
+
});
|
|
245496
|
+
}
|
|
245497
|
+
async _handleDir(dir, stats, initialAdd, depth, target, wh2, realpath2) {
|
|
245498
|
+
const parentDir = this.fsw._getWatchedDir(sp2.dirname(dir));
|
|
245499
|
+
const tracked = parentDir.has(sp2.basename(dir));
|
|
245500
|
+
if (!(initialAdd && this.fsw.options.ignoreInitial) && !target && !tracked) {
|
|
245501
|
+
this.fsw._emit(EV.ADD_DIR, dir, stats);
|
|
245502
|
+
}
|
|
245503
|
+
parentDir.add(sp2.basename(dir));
|
|
245504
|
+
this.fsw._getWatchedDir(dir);
|
|
245505
|
+
let throttler;
|
|
245506
|
+
let closer;
|
|
245507
|
+
const oDepth = this.fsw.options.depth;
|
|
245508
|
+
if ((oDepth == null || depth <= oDepth) && !this.fsw._symlinkPaths.has(realpath2)) {
|
|
245509
|
+
if (!target) {
|
|
245510
|
+
await this._handleRead(dir, initialAdd, wh2, target, dir, depth, throttler);
|
|
245511
|
+
if (this.fsw.closed)
|
|
245512
|
+
return;
|
|
245513
|
+
}
|
|
245514
|
+
closer = this._watchWithNodeFs(dir, (dirPath, stats2) => {
|
|
245515
|
+
if (stats2 && stats2.mtimeMs === 0)
|
|
245516
|
+
return;
|
|
245517
|
+
this._handleRead(dirPath, false, wh2, target, dir, depth, throttler);
|
|
245518
|
+
});
|
|
245519
|
+
}
|
|
245520
|
+
return closer;
|
|
245521
|
+
}
|
|
245522
|
+
async _addToNodeFs(path19, initialAdd, priorWh, depth, target) {
|
|
245523
|
+
const ready = this.fsw._emitReady;
|
|
245524
|
+
if (this.fsw._isIgnored(path19) || this.fsw.closed) {
|
|
245525
|
+
ready();
|
|
245526
|
+
return false;
|
|
245527
|
+
}
|
|
245528
|
+
const wh2 = this.fsw._getWatchHelpers(path19);
|
|
245529
|
+
if (priorWh) {
|
|
245530
|
+
wh2.filterPath = (entry) => priorWh.filterPath(entry);
|
|
245531
|
+
wh2.filterDir = (entry) => priorWh.filterDir(entry);
|
|
245532
|
+
}
|
|
245533
|
+
try {
|
|
245534
|
+
const stats = await statMethods[wh2.statMethod](wh2.watchPath);
|
|
245535
|
+
if (this.fsw.closed)
|
|
245536
|
+
return;
|
|
245537
|
+
if (this.fsw._isIgnored(wh2.watchPath, stats)) {
|
|
245538
|
+
ready();
|
|
245539
|
+
return false;
|
|
245540
|
+
}
|
|
245541
|
+
const follow = this.fsw.options.followSymlinks;
|
|
245542
|
+
let closer;
|
|
245543
|
+
if (stats.isDirectory()) {
|
|
245544
|
+
const absPath = sp2.resolve(path19);
|
|
245545
|
+
const targetPath = follow ? await fsrealpath(path19) : path19;
|
|
245546
|
+
if (this.fsw.closed)
|
|
245547
|
+
return;
|
|
245548
|
+
closer = await this._handleDir(wh2.watchPath, stats, initialAdd, depth, target, wh2, targetPath);
|
|
245549
|
+
if (this.fsw.closed)
|
|
245550
|
+
return;
|
|
245551
|
+
if (absPath !== targetPath && targetPath !== undefined) {
|
|
245552
|
+
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
245553
|
+
}
|
|
245554
|
+
} else if (stats.isSymbolicLink()) {
|
|
245555
|
+
const targetPath = follow ? await fsrealpath(path19) : path19;
|
|
245556
|
+
if (this.fsw.closed)
|
|
245557
|
+
return;
|
|
245558
|
+
const parent = sp2.dirname(wh2.watchPath);
|
|
245559
|
+
this.fsw._getWatchedDir(parent).add(wh2.watchPath);
|
|
245560
|
+
this.fsw._emit(EV.ADD, wh2.watchPath, stats);
|
|
245561
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path19, wh2, targetPath);
|
|
245562
|
+
if (this.fsw.closed)
|
|
245563
|
+
return;
|
|
245564
|
+
if (targetPath !== undefined) {
|
|
245565
|
+
this.fsw._symlinkPaths.set(sp2.resolve(path19), targetPath);
|
|
245566
|
+
}
|
|
245567
|
+
} else {
|
|
245568
|
+
closer = this._handleFile(wh2.watchPath, stats, initialAdd);
|
|
245569
|
+
}
|
|
245570
|
+
ready();
|
|
245571
|
+
if (closer)
|
|
245572
|
+
this.fsw._addPathCloser(path19, closer);
|
|
245573
|
+
return false;
|
|
245574
|
+
} catch (error48) {
|
|
245575
|
+
if (this.fsw._handleError(error48)) {
|
|
245576
|
+
ready();
|
|
245577
|
+
return path19;
|
|
245578
|
+
}
|
|
245579
|
+
}
|
|
245580
|
+
}
|
|
245581
|
+
}
|
|
245582
|
+
|
|
245583
|
+
// node_modules/chokidar/index.js
|
|
245584
|
+
/*! chokidar - MIT License (c) 2012 Paul Miller (paulmillr.com) */
|
|
245585
|
+
var SLASH = "/";
|
|
245586
|
+
var SLASH_SLASH = "//";
|
|
245587
|
+
var ONE_DOT = ".";
|
|
245588
|
+
var TWO_DOTS = "..";
|
|
245589
|
+
var STRING_TYPE = "string";
|
|
245590
|
+
var BACK_SLASH_RE = /\\/g;
|
|
245591
|
+
var DOUBLE_SLASH_RE = /\/\//g;
|
|
245592
|
+
var DOT_RE = /\..*\.(sw[px])$|~$|\.subl.*\.tmp/;
|
|
245593
|
+
var REPLACER_RE = /^\.[/\\]/;
|
|
245594
|
+
function arrify(item) {
|
|
245595
|
+
return Array.isArray(item) ? item : [item];
|
|
245596
|
+
}
|
|
245597
|
+
var isMatcherObject = (matcher) => typeof matcher === "object" && matcher !== null && !(matcher instanceof RegExp);
|
|
245598
|
+
function createPattern(matcher) {
|
|
245599
|
+
if (typeof matcher === "function")
|
|
245600
|
+
return matcher;
|
|
245601
|
+
if (typeof matcher === "string")
|
|
245602
|
+
return (string4) => matcher === string4;
|
|
245603
|
+
if (matcher instanceof RegExp)
|
|
245604
|
+
return (string4) => matcher.test(string4);
|
|
245605
|
+
if (typeof matcher === "object" && matcher !== null) {
|
|
245606
|
+
return (string4) => {
|
|
245607
|
+
if (matcher.path === string4)
|
|
245608
|
+
return true;
|
|
245609
|
+
if (matcher.recursive) {
|
|
245610
|
+
const relative4 = sp3.relative(matcher.path, string4);
|
|
245611
|
+
if (!relative4) {
|
|
245612
|
+
return false;
|
|
245613
|
+
}
|
|
245614
|
+
return !relative4.startsWith("..") && !sp3.isAbsolute(relative4);
|
|
245615
|
+
}
|
|
245616
|
+
return false;
|
|
245617
|
+
};
|
|
245618
|
+
}
|
|
245619
|
+
return () => false;
|
|
245620
|
+
}
|
|
245621
|
+
function normalizePath(path19) {
|
|
245622
|
+
if (typeof path19 !== "string")
|
|
245623
|
+
throw new Error("string expected");
|
|
245624
|
+
path19 = sp3.normalize(path19);
|
|
245625
|
+
path19 = path19.replace(/\\/g, "/");
|
|
245626
|
+
let prepend = false;
|
|
245627
|
+
if (path19.startsWith("//"))
|
|
245628
|
+
prepend = true;
|
|
245629
|
+
path19 = path19.replace(DOUBLE_SLASH_RE, "/");
|
|
245630
|
+
if (prepend)
|
|
245631
|
+
path19 = "/" + path19;
|
|
245632
|
+
return path19;
|
|
245633
|
+
}
|
|
245634
|
+
function matchPatterns(patterns, testString, stats) {
|
|
245635
|
+
const path19 = normalizePath(testString);
|
|
245636
|
+
for (let index = 0;index < patterns.length; index++) {
|
|
245637
|
+
const pattern = patterns[index];
|
|
245638
|
+
if (pattern(path19, stats)) {
|
|
245639
|
+
return true;
|
|
245640
|
+
}
|
|
245641
|
+
}
|
|
245642
|
+
return false;
|
|
245643
|
+
}
|
|
245644
|
+
function anymatch(matchers, testString) {
|
|
245645
|
+
if (matchers == null) {
|
|
245646
|
+
throw new TypeError("anymatch: specify first argument");
|
|
245647
|
+
}
|
|
245648
|
+
const matchersArray = arrify(matchers);
|
|
245649
|
+
const patterns = matchersArray.map((matcher) => createPattern(matcher));
|
|
245650
|
+
if (testString == null) {
|
|
245651
|
+
return (testString2, stats) => {
|
|
245652
|
+
return matchPatterns(patterns, testString2, stats);
|
|
245653
|
+
};
|
|
245654
|
+
}
|
|
245655
|
+
return matchPatterns(patterns, testString);
|
|
245656
|
+
}
|
|
245657
|
+
var unifyPaths = (paths_) => {
|
|
245658
|
+
const paths = arrify(paths_).flat();
|
|
245659
|
+
if (!paths.every((p4) => typeof p4 === STRING_TYPE)) {
|
|
245660
|
+
throw new TypeError(`Non-string provided as watch path: ${paths}`);
|
|
245661
|
+
}
|
|
245662
|
+
return paths.map(normalizePathToUnix);
|
|
245663
|
+
};
|
|
245664
|
+
var toUnix = (string4) => {
|
|
245665
|
+
let str = string4.replace(BACK_SLASH_RE, SLASH);
|
|
245666
|
+
let prepend = false;
|
|
245667
|
+
if (str.startsWith(SLASH_SLASH)) {
|
|
245668
|
+
prepend = true;
|
|
245669
|
+
}
|
|
245670
|
+
str = str.replace(DOUBLE_SLASH_RE, SLASH);
|
|
245671
|
+
if (prepend) {
|
|
245672
|
+
str = SLASH + str;
|
|
245673
|
+
}
|
|
245674
|
+
return str;
|
|
245675
|
+
};
|
|
245676
|
+
var normalizePathToUnix = (path19) => toUnix(sp3.normalize(toUnix(path19)));
|
|
245677
|
+
var normalizeIgnored = (cwd = "") => (path19) => {
|
|
245678
|
+
if (typeof path19 === "string") {
|
|
245679
|
+
return normalizePathToUnix(sp3.isAbsolute(path19) ? path19 : sp3.join(cwd, path19));
|
|
245680
|
+
} else {
|
|
245681
|
+
return path19;
|
|
245682
|
+
}
|
|
245683
|
+
};
|
|
245684
|
+
var getAbsolutePath = (path19, cwd) => {
|
|
245685
|
+
if (sp3.isAbsolute(path19)) {
|
|
245686
|
+
return path19;
|
|
245687
|
+
}
|
|
245688
|
+
return sp3.join(cwd, path19);
|
|
245689
|
+
};
|
|
245690
|
+
var EMPTY_SET = Object.freeze(new Set);
|
|
245691
|
+
|
|
245692
|
+
class DirEntry {
|
|
245693
|
+
path;
|
|
245694
|
+
_removeWatcher;
|
|
245695
|
+
items;
|
|
245696
|
+
constructor(dir, removeWatcher) {
|
|
245697
|
+
this.path = dir;
|
|
245698
|
+
this._removeWatcher = removeWatcher;
|
|
245699
|
+
this.items = new Set;
|
|
245700
|
+
}
|
|
245701
|
+
add(item) {
|
|
245702
|
+
const { items } = this;
|
|
245703
|
+
if (!items)
|
|
245704
|
+
return;
|
|
245705
|
+
if (item !== ONE_DOT && item !== TWO_DOTS)
|
|
245706
|
+
items.add(item);
|
|
245707
|
+
}
|
|
245708
|
+
async remove(item) {
|
|
245709
|
+
const { items } = this;
|
|
245710
|
+
if (!items)
|
|
245711
|
+
return;
|
|
245712
|
+
items.delete(item);
|
|
245713
|
+
if (items.size > 0)
|
|
245714
|
+
return;
|
|
245715
|
+
const dir = this.path;
|
|
245716
|
+
try {
|
|
245717
|
+
await readdir3(dir);
|
|
245718
|
+
} catch (err) {
|
|
245719
|
+
if (this._removeWatcher) {
|
|
245720
|
+
this._removeWatcher(sp3.dirname(dir), sp3.basename(dir));
|
|
245721
|
+
}
|
|
245722
|
+
}
|
|
245723
|
+
}
|
|
245724
|
+
has(item) {
|
|
245725
|
+
const { items } = this;
|
|
245726
|
+
if (!items)
|
|
245727
|
+
return;
|
|
245728
|
+
return items.has(item);
|
|
245729
|
+
}
|
|
245730
|
+
getChildren() {
|
|
245731
|
+
const { items } = this;
|
|
245732
|
+
if (!items)
|
|
245733
|
+
return [];
|
|
245734
|
+
return [...items.values()];
|
|
245735
|
+
}
|
|
245736
|
+
dispose() {
|
|
245737
|
+
this.items.clear();
|
|
245738
|
+
this.path = "";
|
|
245739
|
+
this._removeWatcher = EMPTY_FN;
|
|
245740
|
+
this.items = EMPTY_SET;
|
|
245741
|
+
Object.freeze(this);
|
|
245742
|
+
}
|
|
245743
|
+
}
|
|
245744
|
+
var STAT_METHOD_F = "stat";
|
|
245745
|
+
var STAT_METHOD_L = "lstat";
|
|
245746
|
+
|
|
245747
|
+
class WatchHelper {
|
|
245748
|
+
fsw;
|
|
245749
|
+
path;
|
|
245750
|
+
watchPath;
|
|
245751
|
+
fullWatchPath;
|
|
245752
|
+
dirParts;
|
|
245753
|
+
followSymlinks;
|
|
245754
|
+
statMethod;
|
|
245755
|
+
constructor(path19, follow, fsw) {
|
|
245756
|
+
this.fsw = fsw;
|
|
245757
|
+
const watchPath = path19;
|
|
245758
|
+
this.path = path19 = path19.replace(REPLACER_RE, "");
|
|
245759
|
+
this.watchPath = watchPath;
|
|
245760
|
+
this.fullWatchPath = sp3.resolve(watchPath);
|
|
245761
|
+
this.dirParts = [];
|
|
245762
|
+
this.dirParts.forEach((parts) => {
|
|
245763
|
+
if (parts.length > 1)
|
|
245764
|
+
parts.pop();
|
|
245765
|
+
});
|
|
245766
|
+
this.followSymlinks = follow;
|
|
245767
|
+
this.statMethod = follow ? STAT_METHOD_F : STAT_METHOD_L;
|
|
245768
|
+
}
|
|
245769
|
+
entryPath(entry) {
|
|
245770
|
+
return sp3.join(this.watchPath, sp3.relative(this.watchPath, entry.fullPath));
|
|
245771
|
+
}
|
|
245772
|
+
filterPath(entry) {
|
|
245773
|
+
const { stats } = entry;
|
|
245774
|
+
if (stats && stats.isSymbolicLink())
|
|
245775
|
+
return this.filterDir(entry);
|
|
245776
|
+
const resolvedPath = this.entryPath(entry);
|
|
245777
|
+
return this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
|
|
245778
|
+
}
|
|
245779
|
+
filterDir(entry) {
|
|
245780
|
+
return this.fsw._isntIgnored(this.entryPath(entry), entry.stats);
|
|
245781
|
+
}
|
|
245782
|
+
}
|
|
245783
|
+
|
|
245784
|
+
class FSWatcher extends EventEmitter3 {
|
|
245785
|
+
closed;
|
|
245786
|
+
options;
|
|
245787
|
+
_closers;
|
|
245788
|
+
_ignoredPaths;
|
|
245789
|
+
_throttled;
|
|
245790
|
+
_streams;
|
|
245791
|
+
_symlinkPaths;
|
|
245792
|
+
_watched;
|
|
245793
|
+
_pendingWrites;
|
|
245794
|
+
_pendingUnlinks;
|
|
245795
|
+
_readyCount;
|
|
245796
|
+
_emitReady;
|
|
245797
|
+
_closePromise;
|
|
245798
|
+
_userIgnored;
|
|
245799
|
+
_readyEmitted;
|
|
245800
|
+
_emitRaw;
|
|
245801
|
+
_boundRemove;
|
|
245802
|
+
_nodeFsHandler;
|
|
245803
|
+
constructor(_opts = {}) {
|
|
245804
|
+
super();
|
|
245805
|
+
this.closed = false;
|
|
245806
|
+
this._closers = new Map;
|
|
245807
|
+
this._ignoredPaths = new Set;
|
|
245808
|
+
this._throttled = new Map;
|
|
245809
|
+
this._streams = new Set;
|
|
245810
|
+
this._symlinkPaths = new Map;
|
|
245811
|
+
this._watched = new Map;
|
|
245812
|
+
this._pendingWrites = new Map;
|
|
245813
|
+
this._pendingUnlinks = new Map;
|
|
245814
|
+
this._readyCount = 0;
|
|
245815
|
+
this._readyEmitted = false;
|
|
245816
|
+
const awf = _opts.awaitWriteFinish;
|
|
245817
|
+
const DEF_AWF = { stabilityThreshold: 2000, pollInterval: 100 };
|
|
245818
|
+
const opts = {
|
|
245819
|
+
persistent: true,
|
|
245820
|
+
ignoreInitial: false,
|
|
245821
|
+
ignorePermissionErrors: false,
|
|
245822
|
+
interval: 100,
|
|
245823
|
+
binaryInterval: 300,
|
|
245824
|
+
followSymlinks: true,
|
|
245825
|
+
usePolling: false,
|
|
245826
|
+
atomic: true,
|
|
245827
|
+
..._opts,
|
|
245828
|
+
ignored: _opts.ignored ? arrify(_opts.ignored) : arrify([]),
|
|
245829
|
+
awaitWriteFinish: awf === true ? DEF_AWF : typeof awf === "object" ? { ...DEF_AWF, ...awf } : false
|
|
245830
|
+
};
|
|
245831
|
+
if (isIBMi)
|
|
245832
|
+
opts.usePolling = true;
|
|
245833
|
+
if (opts.atomic === undefined)
|
|
245834
|
+
opts.atomic = !opts.usePolling;
|
|
245835
|
+
const envPoll = process.env.CHOKIDAR_USEPOLLING;
|
|
245836
|
+
if (envPoll !== undefined) {
|
|
245837
|
+
const envLower = envPoll.toLowerCase();
|
|
245838
|
+
if (envLower === "false" || envLower === "0")
|
|
245839
|
+
opts.usePolling = false;
|
|
245840
|
+
else if (envLower === "true" || envLower === "1")
|
|
245841
|
+
opts.usePolling = true;
|
|
245842
|
+
else
|
|
245843
|
+
opts.usePolling = !!envLower;
|
|
245844
|
+
}
|
|
245845
|
+
const envInterval = process.env.CHOKIDAR_INTERVAL;
|
|
245846
|
+
if (envInterval)
|
|
245847
|
+
opts.interval = Number.parseInt(envInterval, 10);
|
|
245848
|
+
let readyCalls = 0;
|
|
245849
|
+
this._emitReady = () => {
|
|
245850
|
+
readyCalls++;
|
|
245851
|
+
if (readyCalls >= this._readyCount) {
|
|
245852
|
+
this._emitReady = EMPTY_FN;
|
|
245853
|
+
this._readyEmitted = true;
|
|
245854
|
+
process.nextTick(() => this.emit(EVENTS.READY));
|
|
245855
|
+
}
|
|
245856
|
+
};
|
|
245857
|
+
this._emitRaw = (...args) => this.emit(EVENTS.RAW, ...args);
|
|
245858
|
+
this._boundRemove = this._remove.bind(this);
|
|
245859
|
+
this.options = opts;
|
|
245860
|
+
this._nodeFsHandler = new NodeFsHandler(this);
|
|
245861
|
+
Object.freeze(opts);
|
|
245862
|
+
}
|
|
245863
|
+
_addIgnoredPath(matcher) {
|
|
245864
|
+
if (isMatcherObject(matcher)) {
|
|
245865
|
+
for (const ignored of this._ignoredPaths) {
|
|
245866
|
+
if (isMatcherObject(ignored) && ignored.path === matcher.path && ignored.recursive === matcher.recursive) {
|
|
245867
|
+
return;
|
|
245868
|
+
}
|
|
245869
|
+
}
|
|
245870
|
+
}
|
|
245871
|
+
this._ignoredPaths.add(matcher);
|
|
245872
|
+
}
|
|
245873
|
+
_removeIgnoredPath(matcher) {
|
|
245874
|
+
this._ignoredPaths.delete(matcher);
|
|
245875
|
+
if (typeof matcher === "string") {
|
|
245876
|
+
for (const ignored of this._ignoredPaths) {
|
|
245877
|
+
if (isMatcherObject(ignored) && ignored.path === matcher) {
|
|
245878
|
+
this._ignoredPaths.delete(ignored);
|
|
245879
|
+
}
|
|
245880
|
+
}
|
|
245881
|
+
}
|
|
245882
|
+
}
|
|
245883
|
+
add(paths_, _origAdd, _internal) {
|
|
245884
|
+
const { cwd } = this.options;
|
|
245885
|
+
this.closed = false;
|
|
245886
|
+
this._closePromise = undefined;
|
|
245887
|
+
let paths = unifyPaths(paths_);
|
|
245888
|
+
if (cwd) {
|
|
245889
|
+
paths = paths.map((path19) => {
|
|
245890
|
+
const absPath = getAbsolutePath(path19, cwd);
|
|
245891
|
+
return absPath;
|
|
245892
|
+
});
|
|
245893
|
+
}
|
|
245894
|
+
paths.forEach((path19) => {
|
|
245895
|
+
this._removeIgnoredPath(path19);
|
|
245896
|
+
});
|
|
245897
|
+
this._userIgnored = undefined;
|
|
245898
|
+
if (!this._readyCount)
|
|
245899
|
+
this._readyCount = 0;
|
|
245900
|
+
this._readyCount += paths.length;
|
|
245901
|
+
Promise.all(paths.map(async (path19) => {
|
|
245902
|
+
const res = await this._nodeFsHandler._addToNodeFs(path19, !_internal, undefined, 0, _origAdd);
|
|
245903
|
+
if (res)
|
|
245904
|
+
this._emitReady();
|
|
245905
|
+
return res;
|
|
245906
|
+
})).then((results) => {
|
|
245907
|
+
if (this.closed)
|
|
245908
|
+
return;
|
|
245909
|
+
results.forEach((item) => {
|
|
245910
|
+
if (item)
|
|
245911
|
+
this.add(sp3.dirname(item), sp3.basename(_origAdd || item));
|
|
245912
|
+
});
|
|
245913
|
+
});
|
|
245914
|
+
return this;
|
|
245915
|
+
}
|
|
245916
|
+
unwatch(paths_) {
|
|
245917
|
+
if (this.closed)
|
|
245918
|
+
return this;
|
|
245919
|
+
const paths = unifyPaths(paths_);
|
|
245920
|
+
const { cwd } = this.options;
|
|
245921
|
+
paths.forEach((path19) => {
|
|
245922
|
+
if (!sp3.isAbsolute(path19) && !this._closers.has(path19)) {
|
|
245923
|
+
if (cwd)
|
|
245924
|
+
path19 = sp3.join(cwd, path19);
|
|
245925
|
+
path19 = sp3.resolve(path19);
|
|
245926
|
+
}
|
|
245927
|
+
this._closePath(path19);
|
|
245928
|
+
this._addIgnoredPath(path19);
|
|
245929
|
+
if (this._watched.has(path19)) {
|
|
245930
|
+
this._addIgnoredPath({
|
|
245931
|
+
path: path19,
|
|
245932
|
+
recursive: true
|
|
245933
|
+
});
|
|
245934
|
+
}
|
|
245935
|
+
this._userIgnored = undefined;
|
|
245936
|
+
});
|
|
245937
|
+
return this;
|
|
245938
|
+
}
|
|
245939
|
+
close() {
|
|
245940
|
+
if (this._closePromise) {
|
|
245941
|
+
return this._closePromise;
|
|
245942
|
+
}
|
|
245943
|
+
this.closed = true;
|
|
245944
|
+
this.removeAllListeners();
|
|
245945
|
+
const closers = [];
|
|
245946
|
+
this._closers.forEach((closerList) => closerList.forEach((closer) => {
|
|
245947
|
+
const promise2 = closer();
|
|
245948
|
+
if (promise2 instanceof Promise)
|
|
245949
|
+
closers.push(promise2);
|
|
245950
|
+
}));
|
|
245951
|
+
this._streams.forEach((stream) => stream.destroy());
|
|
245952
|
+
this._userIgnored = undefined;
|
|
245953
|
+
this._readyCount = 0;
|
|
245954
|
+
this._readyEmitted = false;
|
|
245955
|
+
this._watched.forEach((dirent) => dirent.dispose());
|
|
245956
|
+
this._closers.clear();
|
|
245957
|
+
this._watched.clear();
|
|
245958
|
+
this._streams.clear();
|
|
245959
|
+
this._symlinkPaths.clear();
|
|
245960
|
+
this._throttled.clear();
|
|
245961
|
+
this._closePromise = closers.length ? Promise.all(closers).then(() => {
|
|
245962
|
+
return;
|
|
245963
|
+
}) : Promise.resolve();
|
|
245964
|
+
return this._closePromise;
|
|
245965
|
+
}
|
|
245966
|
+
getWatched() {
|
|
245967
|
+
const watchList = {};
|
|
245968
|
+
this._watched.forEach((entry, dir) => {
|
|
245969
|
+
const key2 = this.options.cwd ? sp3.relative(this.options.cwd, dir) : dir;
|
|
245970
|
+
const index = key2 || ONE_DOT;
|
|
245971
|
+
watchList[index] = entry.getChildren().sort();
|
|
245972
|
+
});
|
|
245973
|
+
return watchList;
|
|
245974
|
+
}
|
|
245975
|
+
emitWithAll(event, args) {
|
|
245976
|
+
this.emit(event, ...args);
|
|
245977
|
+
if (event !== EVENTS.ERROR)
|
|
245978
|
+
this.emit(EVENTS.ALL, event, ...args);
|
|
245979
|
+
}
|
|
245980
|
+
async _emit(event, path19, stats) {
|
|
245981
|
+
if (this.closed)
|
|
245982
|
+
return;
|
|
245983
|
+
const opts = this.options;
|
|
245984
|
+
if (isWindows4)
|
|
245985
|
+
path19 = sp3.normalize(path19);
|
|
245986
|
+
if (opts.cwd)
|
|
245987
|
+
path19 = sp3.relative(opts.cwd, path19);
|
|
245988
|
+
const args = [path19];
|
|
245989
|
+
if (stats != null)
|
|
245990
|
+
args.push(stats);
|
|
245991
|
+
const awf = opts.awaitWriteFinish;
|
|
245992
|
+
let pw;
|
|
245993
|
+
if (awf && (pw = this._pendingWrites.get(path19))) {
|
|
245994
|
+
pw.lastChange = new Date;
|
|
245995
|
+
return this;
|
|
245996
|
+
}
|
|
245997
|
+
if (opts.atomic) {
|
|
245998
|
+
if (event === EVENTS.UNLINK) {
|
|
245999
|
+
this._pendingUnlinks.set(path19, [event, ...args]);
|
|
246000
|
+
setTimeout(() => {
|
|
246001
|
+
this._pendingUnlinks.forEach((entry, path20) => {
|
|
246002
|
+
this.emit(...entry);
|
|
246003
|
+
this.emit(EVENTS.ALL, ...entry);
|
|
246004
|
+
this._pendingUnlinks.delete(path20);
|
|
246005
|
+
});
|
|
246006
|
+
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
246007
|
+
return this;
|
|
246008
|
+
}
|
|
246009
|
+
if (event === EVENTS.ADD && this._pendingUnlinks.has(path19)) {
|
|
246010
|
+
event = EVENTS.CHANGE;
|
|
246011
|
+
this._pendingUnlinks.delete(path19);
|
|
246012
|
+
}
|
|
246013
|
+
}
|
|
246014
|
+
if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
|
|
246015
|
+
const awfEmit = (err, stats2) => {
|
|
246016
|
+
if (err) {
|
|
246017
|
+
event = EVENTS.ERROR;
|
|
246018
|
+
args[0] = err;
|
|
246019
|
+
this.emitWithAll(event, args);
|
|
246020
|
+
} else if (stats2) {
|
|
246021
|
+
if (args.length > 1) {
|
|
246022
|
+
args[1] = stats2;
|
|
246023
|
+
} else {
|
|
246024
|
+
args.push(stats2);
|
|
246025
|
+
}
|
|
246026
|
+
this.emitWithAll(event, args);
|
|
246027
|
+
}
|
|
246028
|
+
};
|
|
246029
|
+
this._awaitWriteFinish(path19, awf.stabilityThreshold, event, awfEmit);
|
|
246030
|
+
return this;
|
|
246031
|
+
}
|
|
246032
|
+
if (event === EVENTS.CHANGE) {
|
|
246033
|
+
const isThrottled = !this._throttle(EVENTS.CHANGE, path19, 50);
|
|
246034
|
+
if (isThrottled)
|
|
246035
|
+
return this;
|
|
246036
|
+
}
|
|
246037
|
+
if (opts.alwaysStat && stats === undefined && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
|
|
246038
|
+
const fullPath = opts.cwd ? sp3.join(opts.cwd, path19) : path19;
|
|
246039
|
+
let stats2;
|
|
246040
|
+
try {
|
|
246041
|
+
stats2 = await stat4(fullPath);
|
|
246042
|
+
} catch (err) {}
|
|
246043
|
+
if (!stats2 || this.closed)
|
|
246044
|
+
return;
|
|
246045
|
+
args.push(stats2);
|
|
246046
|
+
}
|
|
246047
|
+
this.emitWithAll(event, args);
|
|
246048
|
+
return this;
|
|
246049
|
+
}
|
|
246050
|
+
_handleError(error48) {
|
|
246051
|
+
const code2 = error48 && error48.code;
|
|
246052
|
+
if (error48 && code2 !== "ENOENT" && code2 !== "ENOTDIR" && (!this.options.ignorePermissionErrors || code2 !== "EPERM" && code2 !== "EACCES")) {
|
|
246053
|
+
this.emit(EVENTS.ERROR, error48);
|
|
246054
|
+
}
|
|
246055
|
+
return error48 || this.closed;
|
|
246056
|
+
}
|
|
246057
|
+
_throttle(actionType, path19, timeout3) {
|
|
246058
|
+
if (!this._throttled.has(actionType)) {
|
|
246059
|
+
this._throttled.set(actionType, new Map);
|
|
246060
|
+
}
|
|
246061
|
+
const action = this._throttled.get(actionType);
|
|
246062
|
+
if (!action)
|
|
246063
|
+
throw new Error("invalid throttle");
|
|
246064
|
+
const actionPath = action.get(path19);
|
|
246065
|
+
if (actionPath) {
|
|
246066
|
+
actionPath.count++;
|
|
246067
|
+
return false;
|
|
246068
|
+
}
|
|
246069
|
+
let timeoutObject;
|
|
246070
|
+
const clear = () => {
|
|
246071
|
+
const item = action.get(path19);
|
|
246072
|
+
const count2 = item ? item.count : 0;
|
|
246073
|
+
action.delete(path19);
|
|
246074
|
+
clearTimeout(timeoutObject);
|
|
246075
|
+
if (item)
|
|
246076
|
+
clearTimeout(item.timeoutObject);
|
|
246077
|
+
return count2;
|
|
246078
|
+
};
|
|
246079
|
+
timeoutObject = setTimeout(clear, timeout3);
|
|
246080
|
+
const thr = { timeoutObject, clear, count: 0 };
|
|
246081
|
+
action.set(path19, thr);
|
|
246082
|
+
return thr;
|
|
246083
|
+
}
|
|
246084
|
+
_incrReadyCount() {
|
|
246085
|
+
return this._readyCount++;
|
|
246086
|
+
}
|
|
246087
|
+
_awaitWriteFinish(path19, threshold, event, awfEmit) {
|
|
246088
|
+
const awf = this.options.awaitWriteFinish;
|
|
246089
|
+
if (typeof awf !== "object")
|
|
246090
|
+
return;
|
|
246091
|
+
const pollInterval = awf.pollInterval;
|
|
246092
|
+
let timeoutHandler;
|
|
246093
|
+
let fullPath = path19;
|
|
246094
|
+
if (this.options.cwd && !sp3.isAbsolute(path19)) {
|
|
246095
|
+
fullPath = sp3.join(this.options.cwd, path19);
|
|
246096
|
+
}
|
|
246097
|
+
const now = new Date;
|
|
246098
|
+
const writes = this._pendingWrites;
|
|
246099
|
+
function awaitWriteFinishFn(prevStat) {
|
|
246100
|
+
statcb(fullPath, (err, curStat) => {
|
|
246101
|
+
if (err || !writes.has(path19)) {
|
|
246102
|
+
if (err && err.code !== "ENOENT")
|
|
246103
|
+
awfEmit(err);
|
|
246104
|
+
return;
|
|
246105
|
+
}
|
|
246106
|
+
const now2 = Number(new Date);
|
|
246107
|
+
if (prevStat && curStat.size !== prevStat.size) {
|
|
246108
|
+
writes.get(path19).lastChange = now2;
|
|
246109
|
+
}
|
|
246110
|
+
const pw = writes.get(path19);
|
|
246111
|
+
const df3 = now2 - pw.lastChange;
|
|
246112
|
+
if (df3 >= threshold) {
|
|
246113
|
+
writes.delete(path19);
|
|
246114
|
+
awfEmit(undefined, curStat);
|
|
246115
|
+
} else {
|
|
246116
|
+
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
|
|
246117
|
+
}
|
|
246118
|
+
});
|
|
246119
|
+
}
|
|
246120
|
+
if (!writes.has(path19)) {
|
|
246121
|
+
writes.set(path19, {
|
|
246122
|
+
lastChange: now,
|
|
246123
|
+
cancelWait: () => {
|
|
246124
|
+
writes.delete(path19);
|
|
246125
|
+
clearTimeout(timeoutHandler);
|
|
246126
|
+
return event;
|
|
246127
|
+
}
|
|
246128
|
+
});
|
|
246129
|
+
timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval);
|
|
246130
|
+
}
|
|
246131
|
+
}
|
|
246132
|
+
_isIgnored(path19, stats) {
|
|
246133
|
+
if (this.options.atomic && DOT_RE.test(path19))
|
|
246134
|
+
return true;
|
|
246135
|
+
if (!this._userIgnored) {
|
|
246136
|
+
const { cwd } = this.options;
|
|
246137
|
+
const ign = this.options.ignored;
|
|
246138
|
+
const ignored = (ign || []).map(normalizeIgnored(cwd));
|
|
246139
|
+
const ignoredPaths = [...this._ignoredPaths];
|
|
246140
|
+
const list3 = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
|
|
246141
|
+
this._userIgnored = anymatch(list3, undefined);
|
|
246142
|
+
}
|
|
246143
|
+
return this._userIgnored(path19, stats);
|
|
246144
|
+
}
|
|
246145
|
+
_isntIgnored(path19, stat5) {
|
|
246146
|
+
return !this._isIgnored(path19, stat5);
|
|
246147
|
+
}
|
|
246148
|
+
_getWatchHelpers(path19) {
|
|
246149
|
+
return new WatchHelper(path19, this.options.followSymlinks, this);
|
|
246150
|
+
}
|
|
246151
|
+
_getWatchedDir(directory) {
|
|
246152
|
+
const dir = sp3.resolve(directory);
|
|
246153
|
+
if (!this._watched.has(dir))
|
|
246154
|
+
this._watched.set(dir, new DirEntry(dir, this._boundRemove));
|
|
246155
|
+
return this._watched.get(dir);
|
|
246156
|
+
}
|
|
246157
|
+
_hasReadPermissions(stats) {
|
|
246158
|
+
if (this.options.ignorePermissionErrors)
|
|
246159
|
+
return true;
|
|
246160
|
+
return Boolean(Number(stats.mode) & 256);
|
|
246161
|
+
}
|
|
246162
|
+
_remove(directory, item, isDirectory3) {
|
|
246163
|
+
const path19 = sp3.join(directory, item);
|
|
246164
|
+
const fullPath = sp3.resolve(path19);
|
|
246165
|
+
isDirectory3 = isDirectory3 != null ? isDirectory3 : this._watched.has(path19) || this._watched.has(fullPath);
|
|
246166
|
+
if (!this._throttle("remove", path19, 100))
|
|
246167
|
+
return;
|
|
246168
|
+
if (!isDirectory3 && this._watched.size === 1) {
|
|
246169
|
+
this.add(directory, item, true);
|
|
246170
|
+
}
|
|
246171
|
+
const wp5 = this._getWatchedDir(path19);
|
|
246172
|
+
const nestedDirectoryChildren = wp5.getChildren();
|
|
246173
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path19, nested));
|
|
246174
|
+
const parent = this._getWatchedDir(directory);
|
|
246175
|
+
const wasTracked = parent.has(item);
|
|
246176
|
+
parent.remove(item);
|
|
246177
|
+
if (this._symlinkPaths.has(fullPath)) {
|
|
246178
|
+
this._symlinkPaths.delete(fullPath);
|
|
246179
|
+
}
|
|
246180
|
+
let relPath = path19;
|
|
246181
|
+
if (this.options.cwd)
|
|
246182
|
+
relPath = sp3.relative(this.options.cwd, path19);
|
|
246183
|
+
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
246184
|
+
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
246185
|
+
if (event === EVENTS.ADD)
|
|
246186
|
+
return;
|
|
246187
|
+
}
|
|
246188
|
+
this._watched.delete(path19);
|
|
246189
|
+
this._watched.delete(fullPath);
|
|
246190
|
+
const eventName = isDirectory3 ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
|
|
246191
|
+
if (wasTracked && !this._isIgnored(path19))
|
|
246192
|
+
this._emit(eventName, path19);
|
|
246193
|
+
this._closePath(path19);
|
|
246194
|
+
}
|
|
246195
|
+
_closePath(path19) {
|
|
246196
|
+
this._closeFile(path19);
|
|
246197
|
+
const dir = sp3.dirname(path19);
|
|
246198
|
+
this._getWatchedDir(dir).remove(sp3.basename(path19));
|
|
246199
|
+
}
|
|
246200
|
+
_closeFile(path19) {
|
|
246201
|
+
const closers = this._closers.get(path19);
|
|
246202
|
+
if (!closers)
|
|
246203
|
+
return;
|
|
246204
|
+
closers.forEach((closer) => closer());
|
|
246205
|
+
this._closers.delete(path19);
|
|
246206
|
+
}
|
|
246207
|
+
_addPathCloser(path19, closer) {
|
|
246208
|
+
if (!closer)
|
|
246209
|
+
return;
|
|
246210
|
+
let list3 = this._closers.get(path19);
|
|
246211
|
+
if (!list3) {
|
|
246212
|
+
list3 = [];
|
|
246213
|
+
this._closers.set(path19, list3);
|
|
246214
|
+
}
|
|
246215
|
+
list3.push(closer);
|
|
246216
|
+
}
|
|
246217
|
+
_readdirp(root2, opts) {
|
|
246218
|
+
if (this.closed)
|
|
246219
|
+
return;
|
|
246220
|
+
const options8 = { type: EVENTS.ALL, alwaysStat: true, lstat: true, ...opts, depth: 0 };
|
|
246221
|
+
let stream = readdirp(root2, options8);
|
|
246222
|
+
this._streams.add(stream);
|
|
246223
|
+
stream.once(STR_CLOSE, () => {
|
|
246224
|
+
stream = undefined;
|
|
246225
|
+
});
|
|
246226
|
+
stream.once(STR_END, () => {
|
|
246227
|
+
if (stream) {
|
|
246228
|
+
this._streams.delete(stream);
|
|
246229
|
+
stream = undefined;
|
|
246230
|
+
}
|
|
246231
|
+
});
|
|
246232
|
+
return stream;
|
|
246233
|
+
}
|
|
246234
|
+
}
|
|
246235
|
+
function watch(paths, options8 = {}) {
|
|
246236
|
+
const watcher = new FSWatcher(options8);
|
|
246237
|
+
watcher.add(paths);
|
|
246238
|
+
return watcher;
|
|
246239
|
+
}
|
|
246240
|
+
|
|
246241
|
+
// src/cli/dev/dev-server/watcher.ts
|
|
246242
|
+
var import_debounce = __toESM(require_debounce(), 1);
|
|
246243
|
+
var WATCH_DEBOUNCE_MS = 300;
|
|
246244
|
+
var WATCH_QUEUE_DELAY_MS = 500;
|
|
246245
|
+
|
|
246246
|
+
class WatchBase44 extends EventEmitter4 {
|
|
246247
|
+
itemsToWatch;
|
|
246248
|
+
logger;
|
|
246249
|
+
watchers = [];
|
|
246250
|
+
queueWaitForCreation = [];
|
|
246251
|
+
queueWaitForCreationTimeout = null;
|
|
246252
|
+
constructor(itemsToWatch, logger) {
|
|
246253
|
+
super();
|
|
246254
|
+
this.itemsToWatch = itemsToWatch;
|
|
246255
|
+
this.logger = logger;
|
|
246256
|
+
}
|
|
246257
|
+
async start() {
|
|
246258
|
+
if (this.watchers.length > 0 || this.queueWaitForCreation.length > 0) {
|
|
246259
|
+
return;
|
|
246260
|
+
}
|
|
246261
|
+
for (const item of this.itemsToWatch) {
|
|
246262
|
+
if (await pathExists(item.path)) {
|
|
246263
|
+
this.watchers.push(this.watchTarget(item));
|
|
246264
|
+
} else {
|
|
246265
|
+
this.queueWaitForCreation.push(item);
|
|
246266
|
+
}
|
|
246267
|
+
}
|
|
246268
|
+
this.watchCreationQueue();
|
|
246269
|
+
}
|
|
246270
|
+
async close() {
|
|
246271
|
+
if (this.queueWaitForCreationTimeout) {
|
|
246272
|
+
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246273
|
+
this.queueWaitForCreationTimeout = null;
|
|
246274
|
+
}
|
|
246275
|
+
for (const watcher of this.watchers) {
|
|
246276
|
+
await watcher.close();
|
|
246277
|
+
}
|
|
246278
|
+
this.watchers = [];
|
|
246279
|
+
this.queueWaitForCreation = [];
|
|
246280
|
+
}
|
|
246281
|
+
watchCreationQueue() {
|
|
246282
|
+
if (this.queueWaitForCreationTimeout) {
|
|
246283
|
+
clearTimeout(this.queueWaitForCreationTimeout);
|
|
246284
|
+
}
|
|
246285
|
+
this.queueWaitForCreationTimeout = setTimeout(async () => {
|
|
246286
|
+
const toRemove = [];
|
|
246287
|
+
for (const entry of this.queueWaitForCreation) {
|
|
246288
|
+
if (await pathExists(entry.path)) {
|
|
246289
|
+
this.watchers.push(this.watchTarget(entry));
|
|
246290
|
+
toRemove.push(entry);
|
|
246291
|
+
}
|
|
246292
|
+
}
|
|
246293
|
+
this.queueWaitForCreation = this.queueWaitForCreation.filter((entry) => !toRemove.includes(entry));
|
|
246294
|
+
if (this.queueWaitForCreation.length > 0) {
|
|
246295
|
+
this.watchCreationQueue();
|
|
246296
|
+
} else {
|
|
246297
|
+
this.queueWaitForCreationTimeout = null;
|
|
246298
|
+
}
|
|
246299
|
+
}, WATCH_QUEUE_DELAY_MS);
|
|
246300
|
+
}
|
|
246301
|
+
watchTarget(item) {
|
|
246302
|
+
const handler = import_debounce.default(async (_event, path19) => {
|
|
246303
|
+
this.emit("change", item.name, relative4(item.path, path19));
|
|
246304
|
+
}, WATCH_DEBOUNCE_MS);
|
|
246305
|
+
const watcher = watch(item.path, {
|
|
246306
|
+
ignoreInitial: true
|
|
246307
|
+
});
|
|
246308
|
+
watcher.on("all", handler);
|
|
246309
|
+
watcher.on("unlinkDir", async (deletedPath) => {
|
|
246310
|
+
if (deletedPath !== item.path) {
|
|
246311
|
+
return;
|
|
246312
|
+
}
|
|
246313
|
+
await watcher.close();
|
|
246314
|
+
this.queueWaitForCreation.push(item);
|
|
246315
|
+
this.watchCreationQueue();
|
|
246316
|
+
setTimeout(() => {
|
|
246317
|
+
this.watchers = this.watchers.filter((watcher2) => !watcher2.closed);
|
|
246318
|
+
});
|
|
246319
|
+
});
|
|
246320
|
+
watcher.on("error", (err) => {
|
|
246321
|
+
this.logger.error(`Watch handler failed for ${item.path}`, err instanceof Error ? err : undefined);
|
|
246322
|
+
});
|
|
246323
|
+
return watcher;
|
|
246324
|
+
}
|
|
246325
|
+
}
|
|
246326
|
+
|
|
244261
246327
|
// src/cli/dev/dev-server/main.ts
|
|
244262
246328
|
var DEFAULT_PORT = 4400;
|
|
244263
246329
|
var BASE44_APP_URL = "https://base44.app";
|
|
@@ -244265,7 +246331,7 @@ async function createDevServer(options8) {
|
|
|
244265
246331
|
const { port: userPort } = options8;
|
|
244266
246332
|
const port = userPort ?? await getPorts({ port: DEFAULT_PORT });
|
|
244267
246333
|
const baseUrl = `http://localhost:${port}`;
|
|
244268
|
-
const { functions, entities } = await options8.loadResources();
|
|
246334
|
+
const { functions, entities, project: project2 } = await options8.loadResources();
|
|
244269
246335
|
const app = import_express4.default();
|
|
244270
246336
|
const remoteProxy = import_http_proxy_middleware2.createProxyMiddleware({
|
|
244271
246337
|
target: BASE44_APP_URL,
|
|
@@ -244285,10 +246351,10 @@ async function createDevServer(options8) {
|
|
|
244285
246351
|
});
|
|
244286
246352
|
const devLogger = createDevLogger();
|
|
244287
246353
|
const functionManager = new FunctionManager(functions, devLogger);
|
|
246354
|
+
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
246355
|
+
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
244288
246356
|
if (functionManager.getFunctionNames().length > 0) {
|
|
244289
246357
|
R2.info(`Loaded functions: ${functionManager.getFunctionNames().join(", ")}`);
|
|
244290
|
-
const functionRoutes = createFunctionRouter(functionManager, devLogger);
|
|
244291
|
-
app.use("/api/apps/:appId/functions", functionRoutes);
|
|
244292
246358
|
}
|
|
244293
246359
|
const db2 = new Database(entities);
|
|
244294
246360
|
if (db2.getCollectionNames().length > 0) {
|
|
@@ -244307,8 +246373,8 @@ async function createDevServer(options8) {
|
|
|
244307
246373
|
devLogger.warn(`"${req.originalUrl}" is not supported in local development, passing call to production`);
|
|
244308
246374
|
remoteProxy(req, res, next);
|
|
244309
246375
|
});
|
|
244310
|
-
|
|
244311
|
-
const
|
|
246376
|
+
const server = await new Promise((resolve8, reject) => {
|
|
246377
|
+
const s5 = app.listen(port, "127.0.0.1", (err) => {
|
|
244312
246378
|
if (err) {
|
|
244313
246379
|
if ("code" in err && err.code === "EADDRINUSE") {
|
|
244314
246380
|
reject(new Error(`Port ${port} is already in use. Stop the other process and try again.`));
|
|
@@ -244316,24 +246382,48 @@ async function createDevServer(options8) {
|
|
|
244316
246382
|
reject(err);
|
|
244317
246383
|
}
|
|
244318
246384
|
} 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
|
-
});
|
|
246385
|
+
resolve8(s5);
|
|
244334
246386
|
}
|
|
244335
246387
|
});
|
|
244336
246388
|
});
|
|
246389
|
+
const io6 = createRealtimeServer(server);
|
|
246390
|
+
emitEntityEvent = (appId, entityName, event) => {
|
|
246391
|
+
broadcastEntityEvent(io6, appId, entityName, event);
|
|
246392
|
+
};
|
|
246393
|
+
const base44ConfigWatcher = new WatchBase44([
|
|
246394
|
+
{
|
|
246395
|
+
name: "functions",
|
|
246396
|
+
path: join18(dirname14(project2.configPath), project2.functionsDir)
|
|
246397
|
+
}
|
|
246398
|
+
], devLogger);
|
|
246399
|
+
base44ConfigWatcher.on("change", async (name2) => {
|
|
246400
|
+
try {
|
|
246401
|
+
if (name2 === "functions") {
|
|
246402
|
+
const { functions: functions2 } = await options8.loadResources();
|
|
246403
|
+
const previousFunctionCount = functionManager.getFunctionNames().length;
|
|
246404
|
+
functionManager.reload(functions2);
|
|
246405
|
+
const names = functionManager.getFunctionNames();
|
|
246406
|
+
if (names.length > 0) {
|
|
246407
|
+
devLogger.log(`Reloaded functions: ${names.sort().join(", ")}`);
|
|
246408
|
+
} else if (previousFunctionCount > 0) {
|
|
246409
|
+
devLogger.log("All functions removed");
|
|
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=4E2AD1F555A8C53364756E2164756E21
|