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