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