bunki 0.18.1 → 0.18.5
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/README.md +98 -0
- package/dist/cli/commands/images-push.d.ts +3 -1
- package/dist/cli/commands/validate-media.d.ts +9 -0
- package/dist/cli.js +24288 -24010
- package/dist/constants.d.ts +47 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +510 -433
- package/dist/types.d.ts +35 -2
- package/dist/utils/build-cache.d.ts +2 -1
- package/dist/utils/image-uploader.d.ts +1 -0
- package/dist/utils/json-ld.d.ts +6 -0
- package/dist/utils/markdown/constants.d.ts +2 -0
- package/dist/utils/s3-uploader.d.ts +1 -1
- package/dist/utils/schema-factory.d.ts +58 -0
- package/dist/utils/template-engine.d.ts +19 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15416,6 +15416,57 @@ and ensure you are accounting for this risk.
|
|
|
15416
15416
|
};
|
|
15417
15417
|
});
|
|
15418
15418
|
|
|
15419
|
+
// node_modules/slugify/slugify.js
|
|
15420
|
+
var require_slugify = __commonJS((exports, module) => {
|
|
15421
|
+
(function(name, root, factory) {
|
|
15422
|
+
if (typeof exports === "object") {
|
|
15423
|
+
module.exports = factory();
|
|
15424
|
+
module.exports["default"] = factory();
|
|
15425
|
+
} else if (typeof define === "function" && define.amd) {
|
|
15426
|
+
define(factory);
|
|
15427
|
+
} else {
|
|
15428
|
+
root[name] = factory();
|
|
15429
|
+
}
|
|
15430
|
+
})("slugify", exports, function() {
|
|
15431
|
+
var charMap = JSON.parse('{"$":"dollar","%":"percent","&":"and","<":"less",">":"greater","|":"or","\xA2":"cent","\xA3":"pound","\xA4":"currency","\xA5":"yen","\xA9":"(c)","\xAA":"a","\xAE":"(r)","\xBA":"o","\xC0":"A","\xC1":"A","\xC2":"A","\xC3":"A","\xC4":"A","\xC5":"A","\xC6":"AE","\xC7":"C","\xC8":"E","\xC9":"E","\xCA":"E","\xCB":"E","\xCC":"I","\xCD":"I","\xCE":"I","\xCF":"I","\xD0":"D","\xD1":"N","\xD2":"O","\xD3":"O","\xD4":"O","\xD5":"O","\xD6":"O","\xD8":"O","\xD9":"U","\xDA":"U","\xDB":"U","\xDC":"U","\xDD":"Y","\xDE":"TH","\xDF":"ss","\xE0":"a","\xE1":"a","\xE2":"a","\xE3":"a","\xE4":"a","\xE5":"a","\xE6":"ae","\xE7":"c","\xE8":"e","\xE9":"e","\xEA":"e","\xEB":"e","\xEC":"i","\xED":"i","\xEE":"i","\xEF":"i","\xF0":"d","\xF1":"n","\xF2":"o","\xF3":"o","\xF4":"o","\xF5":"o","\xF6":"o","\xF8":"o","\xF9":"u","\xFA":"u","\xFB":"u","\xFC":"u","\xFD":"y","\xFE":"th","\xFF":"y","\u0100":"A","\u0101":"a","\u0102":"A","\u0103":"a","\u0104":"A","\u0105":"a","\u0106":"C","\u0107":"c","\u010C":"C","\u010D":"c","\u010E":"D","\u010F":"d","\u0110":"DJ","\u0111":"dj","\u0112":"E","\u0113":"e","\u0116":"E","\u0117":"e","\u0118":"e","\u0119":"e","\u011A":"E","\u011B":"e","\u011E":"G","\u011F":"g","\u0122":"G","\u0123":"g","\u0128":"I","\u0129":"i","\u012A":"i","\u012B":"i","\u012E":"I","\u012F":"i","\u0130":"I","\u0131":"i","\u0136":"k","\u0137":"k","\u013B":"L","\u013C":"l","\u013D":"L","\u013E":"l","\u0141":"L","\u0142":"l","\u0143":"N","\u0144":"n","\u0145":"N","\u0146":"n","\u0147":"N","\u0148":"n","\u014C":"O","\u014D":"o","\u0150":"O","\u0151":"o","\u0152":"OE","\u0153":"oe","\u0154":"R","\u0155":"r","\u0158":"R","\u0159":"r","\u015A":"S","\u015B":"s","\u015E":"S","\u015F":"s","\u0160":"S","\u0161":"s","\u0162":"T","\u0163":"t","\u0164":"T","\u0165":"t","\u0168":"U","\u0169":"u","\u016A":"u","\u016B":"u","\u016E":"U","\u016F":"u","\u0170":"U","\u0171":"u","\u0172":"U","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017A":"z","\u017B":"Z","\u017C":"z","\u017D":"Z","\u017E":"z","\u018F":"E","\u0192":"f","\u01A0":"O","\u01A1":"o","\u01AF":"U","\u01B0":"u","\u01C8":"LJ","\u01C9":"lj","\u01CB":"NJ","\u01CC":"nj","\u0218":"S","\u0219":"s","\u021A":"T","\u021B":"t","\u0259":"e","\u02DA":"o","\u0386":"A","\u0388":"E","\u0389":"H","\u038A":"I","\u038C":"O","\u038E":"Y","\u038F":"W","\u0390":"i","\u0391":"A","\u0392":"B","\u0393":"G","\u0394":"D","\u0395":"E","\u0396":"Z","\u0397":"H","\u0398":"8","\u0399":"I","\u039A":"K","\u039B":"L","\u039C":"M","\u039D":"N","\u039E":"3","\u039F":"O","\u03A0":"P","\u03A1":"R","\u03A3":"S","\u03A4":"T","\u03A5":"Y","\u03A6":"F","\u03A7":"X","\u03A8":"PS","\u03A9":"W","\u03AA":"I","\u03AB":"Y","\u03AC":"a","\u03AD":"e","\u03AE":"h","\u03AF":"i","\u03B0":"y","\u03B1":"a","\u03B2":"b","\u03B3":"g","\u03B4":"d","\u03B5":"e","\u03B6":"z","\u03B7":"h","\u03B8":"8","\u03B9":"i","\u03BA":"k","\u03BB":"l","\u03BC":"m","\u03BD":"n","\u03BE":"3","\u03BF":"o","\u03C0":"p","\u03C1":"r","\u03C2":"s","\u03C3":"s","\u03C4":"t","\u03C5":"y","\u03C6":"f","\u03C7":"x","\u03C8":"ps","\u03C9":"w","\u03CA":"i","\u03CB":"y","\u03CC":"o","\u03CD":"y","\u03CE":"w","\u0401":"Yo","\u0402":"DJ","\u0404":"Ye","\u0406":"I","\u0407":"Yi","\u0408":"J","\u0409":"LJ","\u040A":"NJ","\u040B":"C","\u040F":"DZ","\u0410":"A","\u0411":"B","\u0412":"V","\u0413":"G","\u0414":"D","\u0415":"E","\u0416":"Zh","\u0417":"Z","\u0418":"I","\u0419":"J","\u041A":"K","\u041B":"L","\u041C":"M","\u041D":"N","\u041E":"O","\u041F":"P","\u0420":"R","\u0421":"S","\u0422":"T","\u0423":"U","\u0424":"F","\u0425":"H","\u0426":"C","\u0427":"Ch","\u0428":"Sh","\u0429":"Sh","\u042A":"U","\u042B":"Y","\u042C":"","\u042D":"E","\u042E":"Yu","\u042F":"Ya","\u0430":"a","\u0431":"b","\u0432":"v","\u0433":"g","\u0434":"d","\u0435":"e","\u0436":"zh","\u0437":"z","\u0438":"i","\u0439":"j","\u043A":"k","\u043B":"l","\u043C":"m","\u043D":"n","\u043E":"o","\u043F":"p","\u0440":"r","\u0441":"s","\u0442":"t","\u0443":"u","\u0444":"f","\u0445":"h","\u0446":"c","\u0447":"ch","\u0448":"sh","\u0449":"sh","\u044A":"u","\u044B":"y","\u044C":"","\u044D":"e","\u044E":"yu","\u044F":"ya","\u0451":"yo","\u0452":"dj","\u0454":"ye","\u0456":"i","\u0457":"yi","\u0458":"j","\u0459":"lj","\u045A":"nj","\u045B":"c","\u045D":"u","\u045F":"dz","\u0490":"G","\u0491":"g","\u0492":"GH","\u0493":"gh","\u049A":"KH","\u049B":"kh","\u04A2":"NG","\u04A3":"ng","\u04AE":"UE","\u04AF":"ue","\u04B0":"U","\u04B1":"u","\u04BA":"H","\u04BB":"h","\u04D8":"AE","\u04D9":"ae","\u04E8":"OE","\u04E9":"oe","\u0531":"A","\u0532":"B","\u0533":"G","\u0534":"D","\u0535":"E","\u0536":"Z","\u0537":"E\'","\u0538":"Y\'","\u0539":"T\'","\u053A":"JH","\u053B":"I","\u053C":"L","\u053D":"X","\u053E":"C\'","\u053F":"K","\u0540":"H","\u0541":"D\'","\u0542":"GH","\u0543":"TW","\u0544":"M","\u0545":"Y","\u0546":"N","\u0547":"SH","\u0549":"CH","\u054A":"P","\u054B":"J","\u054C":"R\'","\u054D":"S","\u054E":"V","\u054F":"T","\u0550":"R","\u0551":"C","\u0553":"P\'","\u0554":"Q\'","\u0555":"O\'\'","\u0556":"F","\u0587":"EV","\u0621":"a","\u0622":"aa","\u0623":"a","\u0624":"u","\u0625":"i","\u0626":"e","\u0627":"a","\u0628":"b","\u0629":"h","\u062A":"t","\u062B":"th","\u062C":"j","\u062D":"h","\u062E":"kh","\u062F":"d","\u0630":"th","\u0631":"r","\u0632":"z","\u0633":"s","\u0634":"sh","\u0635":"s","\u0636":"dh","\u0637":"t","\u0638":"z","\u0639":"a","\u063A":"gh","\u0641":"f","\u0642":"q","\u0643":"k","\u0644":"l","\u0645":"m","\u0646":"n","\u0647":"h","\u0648":"w","\u0649":"a","\u064A":"y","\u064B":"an","\u064C":"on","\u064D":"en","\u064E":"a","\u064F":"u","\u0650":"e","\u0652":"","\u0660":"0","\u0661":"1","\u0662":"2","\u0663":"3","\u0664":"4","\u0665":"5","\u0666":"6","\u0667":"7","\u0668":"8","\u0669":"9","\u067E":"p","\u0686":"ch","\u0698":"zh","\u06A9":"k","\u06AF":"g","\u06CC":"y","\u06F0":"0","\u06F1":"1","\u06F2":"2","\u06F3":"3","\u06F4":"4","\u06F5":"5","\u06F6":"6","\u06F7":"7","\u06F8":"8","\u06F9":"9","\u0E3F":"baht","\u10D0":"a","\u10D1":"b","\u10D2":"g","\u10D3":"d","\u10D4":"e","\u10D5":"v","\u10D6":"z","\u10D7":"t","\u10D8":"i","\u10D9":"k","\u10DA":"l","\u10DB":"m","\u10DC":"n","\u10DD":"o","\u10DE":"p","\u10DF":"zh","\u10E0":"r","\u10E1":"s","\u10E2":"t","\u10E3":"u","\u10E4":"f","\u10E5":"k","\u10E6":"gh","\u10E7":"q","\u10E8":"sh","\u10E9":"ch","\u10EA":"ts","\u10EB":"dz","\u10EC":"ts","\u10ED":"ch","\u10EE":"kh","\u10EF":"j","\u10F0":"h","\u1E62":"S","\u1E63":"s","\u1E80":"W","\u1E81":"w","\u1E82":"W","\u1E83":"w","\u1E84":"W","\u1E85":"w","\u1E9E":"SS","\u1EA0":"A","\u1EA1":"a","\u1EA2":"A","\u1EA3":"a","\u1EA4":"A","\u1EA5":"a","\u1EA6":"A","\u1EA7":"a","\u1EA8":"A","\u1EA9":"a","\u1EAA":"A","\u1EAB":"a","\u1EAC":"A","\u1EAD":"a","\u1EAE":"A","\u1EAF":"a","\u1EB0":"A","\u1EB1":"a","\u1EB2":"A","\u1EB3":"a","\u1EB4":"A","\u1EB5":"a","\u1EB6":"A","\u1EB7":"a","\u1EB8":"E","\u1EB9":"e","\u1EBA":"E","\u1EBB":"e","\u1EBC":"E","\u1EBD":"e","\u1EBE":"E","\u1EBF":"e","\u1EC0":"E","\u1EC1":"e","\u1EC2":"E","\u1EC3":"e","\u1EC4":"E","\u1EC5":"e","\u1EC6":"E","\u1EC7":"e","\u1EC8":"I","\u1EC9":"i","\u1ECA":"I","\u1ECB":"i","\u1ECC":"O","\u1ECD":"o","\u1ECE":"O","\u1ECF":"o","\u1ED0":"O","\u1ED1":"o","\u1ED2":"O","\u1ED3":"o","\u1ED4":"O","\u1ED5":"o","\u1ED6":"O","\u1ED7":"o","\u1ED8":"O","\u1ED9":"o","\u1EDA":"O","\u1EDB":"o","\u1EDC":"O","\u1EDD":"o","\u1EDE":"O","\u1EDF":"o","\u1EE0":"O","\u1EE1":"o","\u1EE2":"O","\u1EE3":"o","\u1EE4":"U","\u1EE5":"u","\u1EE6":"U","\u1EE7":"u","\u1EE8":"U","\u1EE9":"u","\u1EEA":"U","\u1EEB":"u","\u1EEC":"U","\u1EED":"u","\u1EEE":"U","\u1EEF":"u","\u1EF0":"U","\u1EF1":"u","\u1EF2":"Y","\u1EF3":"y","\u1EF4":"Y","\u1EF5":"y","\u1EF6":"Y","\u1EF7":"y","\u1EF8":"Y","\u1EF9":"y","\u2013":"-","\u2018":"\'","\u2019":"\'","\u201C":"\\"","\u201D":"\\"","\u201E":"\\"","\u2020":"+","\u2022":"*","\u2026":"...","\u20A0":"ecu","\u20A2":"cruzeiro","\u20A3":"french franc","\u20A4":"lira","\u20A5":"mill","\u20A6":"naira","\u20A7":"peseta","\u20A8":"rupee","\u20A9":"won","\u20AA":"new shequel","\u20AB":"dong","\u20AC":"euro","\u20AD":"kip","\u20AE":"tugrik","\u20AF":"drachma","\u20B0":"penny","\u20B1":"peso","\u20B2":"guarani","\u20B3":"austral","\u20B4":"hryvnia","\u20B5":"cedi","\u20B8":"kazakhstani tenge","\u20B9":"indian rupee","\u20BA":"turkish lira","\u20BD":"russian ruble","\u20BF":"bitcoin","\u2120":"sm","\u2122":"tm","\u2202":"d","\u2206":"delta","\u2211":"sum","\u221E":"infinity","\u2665":"love","\u5143":"yuan","\u5186":"yen","\uFDFC":"rial","\uFEF5":"laa","\uFEF7":"laa","\uFEF9":"lai","\uFEFB":"la"}');
|
|
15432
|
+
var locales = JSON.parse('{"bg":{"\u0419":"Y","\u0426":"Ts","\u0429":"Sht","\u042A":"A","\u042C":"Y","\u0439":"y","\u0446":"ts","\u0449":"sht","\u044A":"a","\u044C":"y"},"de":{"\xC4":"AE","\xE4":"ae","\xD6":"OE","\xF6":"oe","\xDC":"UE","\xFC":"ue","\xDF":"ss","%":"prozent","&":"und","|":"oder","\u2211":"summe","\u221E":"unendlich","\u2665":"liebe"},"es":{"%":"por ciento","&":"y","<":"menor que",">":"mayor que","|":"o","\xA2":"centavos","\xA3":"libras","\xA4":"moneda","\u20A3":"francos","\u2211":"suma","\u221E":"infinito","\u2665":"amor"},"fr":{"%":"pourcent","&":"et","<":"plus petit",">":"plus grand","|":"ou","\xA2":"centime","\xA3":"livre","\xA4":"devise","\u20A3":"franc","\u2211":"somme","\u221E":"infini","\u2665":"amour"},"pt":{"%":"porcento","&":"e","<":"menor",">":"maior","|":"ou","\xA2":"centavo","\u2211":"soma","\xA3":"libra","\u221E":"infinito","\u2665":"amor"},"uk":{"\u0418":"Y","\u0438":"y","\u0419":"Y","\u0439":"y","\u0426":"Ts","\u0446":"ts","\u0425":"Kh","\u0445":"kh","\u0429":"Shch","\u0449":"shch","\u0413":"H","\u0433":"h"},"vi":{"\u0110":"D","\u0111":"d"},"da":{"\xD8":"OE","\xF8":"oe","\xC5":"AA","\xE5":"aa","%":"procent","&":"og","|":"eller","$":"dollar","<":"mindre end",">":"st\xF8rre end"},"nb":{"&":"og","\xC5":"AA","\xC6":"AE","\xD8":"OE","\xE5":"aa","\xE6":"ae","\xF8":"oe"},"it":{"&":"e"},"nl":{"&":"en"},"sv":{"&":"och","\xC5":"AA","\xC4":"AE","\xD6":"OE","\xE5":"aa","\xE4":"ae","\xF6":"oe"}}');
|
|
15433
|
+
function replace(string, options2) {
|
|
15434
|
+
if (typeof string !== "string") {
|
|
15435
|
+
throw new Error("slugify: string argument expected");
|
|
15436
|
+
}
|
|
15437
|
+
options2 = typeof options2 === "string" ? { replacement: options2 } : options2 || {};
|
|
15438
|
+
var locale = locales[options2.locale] || {};
|
|
15439
|
+
var replacement = options2.replacement === undefined ? "-" : options2.replacement;
|
|
15440
|
+
var trim = options2.trim === undefined ? true : options2.trim;
|
|
15441
|
+
var slug = string.normalize().split("").reduce(function(result, ch) {
|
|
15442
|
+
var appendChar = locale[ch];
|
|
15443
|
+
if (appendChar === undefined)
|
|
15444
|
+
appendChar = charMap[ch];
|
|
15445
|
+
if (appendChar === undefined)
|
|
15446
|
+
appendChar = ch;
|
|
15447
|
+
if (appendChar === replacement)
|
|
15448
|
+
appendChar = " ";
|
|
15449
|
+
return result + appendChar.replace(options2.remove || /[^\w\s$*_+~.()'"!\-:@]+/g, "");
|
|
15450
|
+
}, "");
|
|
15451
|
+
if (options2.strict) {
|
|
15452
|
+
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
|
15453
|
+
}
|
|
15454
|
+
if (trim) {
|
|
15455
|
+
slug = slug.trim();
|
|
15456
|
+
}
|
|
15457
|
+
slug = slug.replace(/\s+/g, replacement);
|
|
15458
|
+
if (options2.lower) {
|
|
15459
|
+
slug = slug.toLowerCase();
|
|
15460
|
+
}
|
|
15461
|
+
return slug;
|
|
15462
|
+
}
|
|
15463
|
+
replace.extend = function(customMap) {
|
|
15464
|
+
Object.assign(charMap, customMap);
|
|
15465
|
+
};
|
|
15466
|
+
return replace;
|
|
15467
|
+
});
|
|
15468
|
+
});
|
|
15469
|
+
|
|
15419
15470
|
// node_modules/nunjucks/src/lib.js
|
|
15420
15471
|
var require_lib7 = __commonJS((exports, module) => {
|
|
15421
15472
|
var ArrayProto = Array.prototype;
|
|
@@ -15437,11 +15488,11 @@ var require_lib7 = __commonJS((exports, module) => {
|
|
|
15437
15488
|
function lookupEscape(ch) {
|
|
15438
15489
|
return escapeMap[ch];
|
|
15439
15490
|
}
|
|
15440
|
-
function _prettifyError(
|
|
15491
|
+
function _prettifyError(path6, withInternals, err) {
|
|
15441
15492
|
if (!err.Update) {
|
|
15442
15493
|
err = new _exports.TemplateError(err);
|
|
15443
15494
|
}
|
|
15444
|
-
err.Update(
|
|
15495
|
+
err.Update(path6);
|
|
15445
15496
|
if (!withInternals) {
|
|
15446
15497
|
var old = err;
|
|
15447
15498
|
err = new Error(old.message);
|
|
@@ -15502,8 +15553,8 @@ var require_lib7 = __commonJS((exports, module) => {
|
|
|
15502
15553
|
err.lineno = lineno;
|
|
15503
15554
|
err.colno = colno;
|
|
15504
15555
|
err.firstUpdate = true;
|
|
15505
|
-
err.Update = function Update(
|
|
15506
|
-
var msg = "(" + (
|
|
15556
|
+
err.Update = function Update(path6) {
|
|
15557
|
+
var msg = "(" + (path6 || "unknown path") + ")";
|
|
15507
15558
|
if (this.firstUpdate) {
|
|
15508
15559
|
if (this.lineno && this.colno) {
|
|
15509
15560
|
msg += " [Line " + this.lineno + ", Column " + this.colno + "]";
|
|
@@ -19700,7 +19751,7 @@ var require_loader2 = __commonJS((exports, module) => {
|
|
|
19700
19751
|
};
|
|
19701
19752
|
return _setPrototypeOf(o, p);
|
|
19702
19753
|
}
|
|
19703
|
-
var
|
|
19754
|
+
var path6 = __require("path");
|
|
19704
19755
|
var _require = require_object();
|
|
19705
19756
|
var EmitterObj = _require.EmitterObj;
|
|
19706
19757
|
module.exports = /* @__PURE__ */ function(_EmitterObj) {
|
|
@@ -19710,7 +19761,7 @@ var require_loader2 = __commonJS((exports, module) => {
|
|
|
19710
19761
|
}
|
|
19711
19762
|
var _proto = Loader.prototype;
|
|
19712
19763
|
_proto.resolve = function resolve(from, to) {
|
|
19713
|
-
return
|
|
19764
|
+
return path6.resolve(path6.dirname(from), to);
|
|
19714
19765
|
};
|
|
19715
19766
|
_proto.isRelative = function isRelative(filename) {
|
|
19716
19767
|
return filename.indexOf("./") === 0 || filename.indexOf("../") === 0;
|
|
@@ -19764,7 +19815,7 @@ var require_precompiled_loader = __commonJS((exports, module) => {
|
|
|
19764
19815
|
|
|
19765
19816
|
// node_modules/picomatch/lib/constants.js
|
|
19766
19817
|
var require_constants = __commonJS((exports, module) => {
|
|
19767
|
-
var
|
|
19818
|
+
var path6 = __require("path");
|
|
19768
19819
|
var WIN_SLASH = "\\\\/";
|
|
19769
19820
|
var WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
19770
19821
|
var DOT_LITERAL = "\\.";
|
|
@@ -19886,7 +19937,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
19886
19937
|
CHAR_UNDERSCORE: 95,
|
|
19887
19938
|
CHAR_VERTICAL_LINE: 124,
|
|
19888
19939
|
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279,
|
|
19889
|
-
SEP:
|
|
19940
|
+
SEP: path6.sep,
|
|
19890
19941
|
extglobChars(chars) {
|
|
19891
19942
|
return {
|
|
19892
19943
|
"!": { type: "negate", open: "(?:(?!(?:", close: `))${chars.STAR})` },
|
|
@@ -19904,7 +19955,7 @@ var require_constants = __commonJS((exports, module) => {
|
|
|
19904
19955
|
|
|
19905
19956
|
// node_modules/picomatch/lib/utils.js
|
|
19906
19957
|
var require_utils2 = __commonJS((exports) => {
|
|
19907
|
-
var
|
|
19958
|
+
var path6 = __require("path");
|
|
19908
19959
|
var win32 = process.platform === "win32";
|
|
19909
19960
|
var {
|
|
19910
19961
|
REGEX_BACKSLASH,
|
|
@@ -19933,7 +19984,7 @@ var require_utils2 = __commonJS((exports) => {
|
|
|
19933
19984
|
if (options2 && typeof options2.windows === "boolean") {
|
|
19934
19985
|
return options2.windows;
|
|
19935
19986
|
}
|
|
19936
|
-
return win32 === true ||
|
|
19987
|
+
return win32 === true || path6.sep === "\\";
|
|
19937
19988
|
};
|
|
19938
19989
|
exports.escapeLast = (input, char, lastIdx) => {
|
|
19939
19990
|
const idx = input.lastIndexOf(char, lastIdx);
|
|
@@ -21057,7 +21108,7 @@ var require_parse3 = __commonJS((exports, module) => {
|
|
|
21057
21108
|
|
|
21058
21109
|
// node_modules/picomatch/lib/picomatch.js
|
|
21059
21110
|
var require_picomatch = __commonJS((exports, module) => {
|
|
21060
|
-
var
|
|
21111
|
+
var path6 = __require("path");
|
|
21061
21112
|
var scan = require_scan();
|
|
21062
21113
|
var parse2 = require_parse3();
|
|
21063
21114
|
var utils = require_utils2();
|
|
@@ -21143,7 +21194,7 @@ var require_picomatch = __commonJS((exports, module) => {
|
|
|
21143
21194
|
};
|
|
21144
21195
|
picomatch.matchBase = (input, glob, options2, posix = utils.isWindows(options2)) => {
|
|
21145
21196
|
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options2);
|
|
21146
|
-
return regex.test(
|
|
21197
|
+
return regex.test(path6.basename(input));
|
|
21147
21198
|
};
|
|
21148
21199
|
picomatch.isMatch = (str2, patterns, options2) => picomatch(patterns, options2)(str2);
|
|
21149
21200
|
picomatch.parse = (pattern, options2) => {
|
|
@@ -21252,8 +21303,8 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
21252
21303
|
static get defaultOptions() {
|
|
21253
21304
|
return {
|
|
21254
21305
|
root: ".",
|
|
21255
|
-
fileFilter: (
|
|
21256
|
-
directoryFilter: (
|
|
21306
|
+
fileFilter: (path6) => true,
|
|
21307
|
+
directoryFilter: (path6) => true,
|
|
21257
21308
|
type: FILE_TYPE,
|
|
21258
21309
|
lstat: false,
|
|
21259
21310
|
depth: 2147483648,
|
|
@@ -21272,7 +21323,7 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
21272
21323
|
this._directoryFilter = normalizeFilter(opts.directoryFilter);
|
|
21273
21324
|
const statMethod = opts.lstat ? lstat : stat;
|
|
21274
21325
|
if (wantBigintFsStats) {
|
|
21275
|
-
this._stat = (
|
|
21326
|
+
this._stat = (path6) => statMethod(path6, { bigint: true });
|
|
21276
21327
|
} else {
|
|
21277
21328
|
this._stat = statMethod;
|
|
21278
21329
|
}
|
|
@@ -21294,9 +21345,9 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
21294
21345
|
this.reading = true;
|
|
21295
21346
|
try {
|
|
21296
21347
|
while (!this.destroyed && batch > 0) {
|
|
21297
|
-
const { path:
|
|
21348
|
+
const { path: path6, depth, files = [] } = this.parent || {};
|
|
21298
21349
|
if (files.length > 0) {
|
|
21299
|
-
const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent,
|
|
21350
|
+
const slice = files.splice(0, batch).map((dirent) => this._formatEntry(dirent, path6));
|
|
21300
21351
|
for (const entry of await Promise.all(slice)) {
|
|
21301
21352
|
if (this.destroyed)
|
|
21302
21353
|
return;
|
|
@@ -21333,20 +21384,20 @@ var require_readdirp = __commonJS((exports, module) => {
|
|
|
21333
21384
|
this.reading = false;
|
|
21334
21385
|
}
|
|
21335
21386
|
}
|
|
21336
|
-
async _exploreDir(
|
|
21387
|
+
async _exploreDir(path6, depth) {
|
|
21337
21388
|
let files;
|
|
21338
21389
|
try {
|
|
21339
|
-
files = await readdir(
|
|
21390
|
+
files = await readdir(path6, this._rdOptions);
|
|
21340
21391
|
} catch (error) {
|
|
21341
21392
|
this._onError(error);
|
|
21342
21393
|
}
|
|
21343
|
-
return { files, depth, path:
|
|
21394
|
+
return { files, depth, path: path6 };
|
|
21344
21395
|
}
|
|
21345
|
-
async _formatEntry(dirent,
|
|
21396
|
+
async _formatEntry(dirent, path6) {
|
|
21346
21397
|
let entry;
|
|
21347
21398
|
try {
|
|
21348
21399
|
const basename = this._isDirent ? dirent.name : dirent;
|
|
21349
|
-
const fullPath = sysPath.resolve(sysPath.join(
|
|
21400
|
+
const fullPath = sysPath.resolve(sysPath.join(path6, basename));
|
|
21350
21401
|
entry = { path: sysPath.relative(this._root, fullPath), fullPath, basename };
|
|
21351
21402
|
entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
|
|
21352
21403
|
} catch (err) {
|
|
@@ -21435,24 +21486,24 @@ var require_normalize_path = __commonJS((exports, module) => {
|
|
|
21435
21486
|
* Copyright (c) 2014-2018, Jon Schlinkert.
|
|
21436
21487
|
* Released under the MIT License.
|
|
21437
21488
|
*/
|
|
21438
|
-
module.exports = function(
|
|
21439
|
-
if (typeof
|
|
21489
|
+
module.exports = function(path6, stripTrailing) {
|
|
21490
|
+
if (typeof path6 !== "string") {
|
|
21440
21491
|
throw new TypeError("expected path to be a string");
|
|
21441
21492
|
}
|
|
21442
|
-
if (
|
|
21493
|
+
if (path6 === "\\" || path6 === "/")
|
|
21443
21494
|
return "/";
|
|
21444
|
-
var len =
|
|
21495
|
+
var len = path6.length;
|
|
21445
21496
|
if (len <= 1)
|
|
21446
|
-
return
|
|
21497
|
+
return path6;
|
|
21447
21498
|
var prefix = "";
|
|
21448
|
-
if (len > 4 &&
|
|
21449
|
-
var ch =
|
|
21450
|
-
if ((ch === "?" || ch === ".") &&
|
|
21451
|
-
|
|
21499
|
+
if (len > 4 && path6[3] === "\\") {
|
|
21500
|
+
var ch = path6[2];
|
|
21501
|
+
if ((ch === "?" || ch === ".") && path6.slice(0, 2) === "\\\\") {
|
|
21502
|
+
path6 = path6.slice(2);
|
|
21452
21503
|
prefix = "//";
|
|
21453
21504
|
}
|
|
21454
21505
|
}
|
|
21455
|
-
var segs =
|
|
21506
|
+
var segs = path6.split(/[/\\]+/);
|
|
21456
21507
|
if (stripTrailing !== false && segs[segs.length - 1] === "") {
|
|
21457
21508
|
segs.pop();
|
|
21458
21509
|
}
|
|
@@ -21487,17 +21538,17 @@ var require_anymatch = __commonJS((exports, module) => {
|
|
|
21487
21538
|
if (!isList && typeof _path !== "string") {
|
|
21488
21539
|
throw new TypeError("anymatch: second argument must be a string: got " + Object.prototype.toString.call(_path));
|
|
21489
21540
|
}
|
|
21490
|
-
const
|
|
21541
|
+
const path6 = normalizePath(_path, false);
|
|
21491
21542
|
for (let index = 0;index < negPatterns.length; index++) {
|
|
21492
21543
|
const nglob = negPatterns[index];
|
|
21493
|
-
if (nglob(
|
|
21544
|
+
if (nglob(path6)) {
|
|
21494
21545
|
return returnIndex ? -1 : false;
|
|
21495
21546
|
}
|
|
21496
21547
|
}
|
|
21497
|
-
const applied = isList && [
|
|
21548
|
+
const applied = isList && [path6].concat(args.slice(1));
|
|
21498
21549
|
for (let index = 0;index < patterns.length; index++) {
|
|
21499
21550
|
const pattern = patterns[index];
|
|
21500
|
-
if (isList ? pattern(...applied) : pattern(
|
|
21551
|
+
if (isList ? pattern(...applied) : pattern(path6)) {
|
|
21501
21552
|
return returnIndex ? index : true;
|
|
21502
21553
|
}
|
|
21503
21554
|
}
|
|
@@ -23016,10 +23067,10 @@ var require_binary_extensions = __commonJS((exports, module) => {
|
|
|
23016
23067
|
|
|
23017
23068
|
// node_modules/is-binary-path/index.js
|
|
23018
23069
|
var require_is_binary_path = __commonJS((exports, module) => {
|
|
23019
|
-
var
|
|
23070
|
+
var path6 = __require("path");
|
|
23020
23071
|
var binaryExtensions = require_binary_extensions();
|
|
23021
23072
|
var extensions = new Set(binaryExtensions);
|
|
23022
|
-
module.exports = (filePath) => extensions.has(
|
|
23073
|
+
module.exports = (filePath) => extensions.has(path6.extname(filePath).slice(1).toLowerCase());
|
|
23023
23074
|
});
|
|
23024
23075
|
|
|
23025
23076
|
// node_modules/chokidar/lib/constants.js
|
|
@@ -23145,16 +23196,16 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23145
23196
|
};
|
|
23146
23197
|
var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
|
|
23147
23198
|
var FsWatchInstances = new Map;
|
|
23148
|
-
function createFsWatchInstance(
|
|
23199
|
+
function createFsWatchInstance(path6, options2, listener, errHandler, emitRaw) {
|
|
23149
23200
|
const handleEvent = (rawEvent, evPath) => {
|
|
23150
|
-
listener(
|
|
23151
|
-
emitRaw(rawEvent, evPath, { watchedPath:
|
|
23152
|
-
if (evPath &&
|
|
23153
|
-
fsWatchBroadcast(sysPath.resolve(
|
|
23201
|
+
listener(path6);
|
|
23202
|
+
emitRaw(rawEvent, evPath, { watchedPath: path6 });
|
|
23203
|
+
if (evPath && path6 !== evPath) {
|
|
23204
|
+
fsWatchBroadcast(sysPath.resolve(path6, evPath), KEY_LISTENERS, sysPath.join(path6, evPath));
|
|
23154
23205
|
}
|
|
23155
23206
|
};
|
|
23156
23207
|
try {
|
|
23157
|
-
return fs2.watch(
|
|
23208
|
+
return fs2.watch(path6, options2, handleEvent);
|
|
23158
23209
|
} catch (error) {
|
|
23159
23210
|
errHandler(error);
|
|
23160
23211
|
}
|
|
@@ -23167,12 +23218,12 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23167
23218
|
listener(val1, val2, val3);
|
|
23168
23219
|
});
|
|
23169
23220
|
};
|
|
23170
|
-
var setFsWatchListener = (
|
|
23221
|
+
var setFsWatchListener = (path6, fullPath, options2, handlers) => {
|
|
23171
23222
|
const { listener, errHandler, rawEmitter } = handlers;
|
|
23172
23223
|
let cont = FsWatchInstances.get(fullPath);
|
|
23173
23224
|
let watcher;
|
|
23174
23225
|
if (!options2.persistent) {
|
|
23175
|
-
watcher = createFsWatchInstance(
|
|
23226
|
+
watcher = createFsWatchInstance(path6, options2, listener, errHandler, rawEmitter);
|
|
23176
23227
|
return watcher.close.bind(watcher);
|
|
23177
23228
|
}
|
|
23178
23229
|
if (cont) {
|
|
@@ -23180,7 +23231,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23180
23231
|
addAndConvert(cont, KEY_ERR, errHandler);
|
|
23181
23232
|
addAndConvert(cont, KEY_RAW, rawEmitter);
|
|
23182
23233
|
} else {
|
|
23183
|
-
watcher = createFsWatchInstance(
|
|
23234
|
+
watcher = createFsWatchInstance(path6, options2, fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS), errHandler, fsWatchBroadcast.bind(null, fullPath, KEY_RAW));
|
|
23184
23235
|
if (!watcher)
|
|
23185
23236
|
return;
|
|
23186
23237
|
watcher.on(EV_ERROR, async (error) => {
|
|
@@ -23188,7 +23239,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23188
23239
|
cont.watcherUnusable = true;
|
|
23189
23240
|
if (isWindows && error.code === "EPERM") {
|
|
23190
23241
|
try {
|
|
23191
|
-
const fd = await open(
|
|
23242
|
+
const fd = await open(path6, "r");
|
|
23192
23243
|
await close(fd);
|
|
23193
23244
|
broadcastErr(error);
|
|
23194
23245
|
} catch (err) {}
|
|
@@ -23218,7 +23269,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23218
23269
|
};
|
|
23219
23270
|
};
|
|
23220
23271
|
var FsWatchFileInstances = new Map;
|
|
23221
|
-
var setFsWatchFileListener = (
|
|
23272
|
+
var setFsWatchFileListener = (path6, fullPath, options2, handlers) => {
|
|
23222
23273
|
const { listener, rawEmitter } = handlers;
|
|
23223
23274
|
let cont = FsWatchFileInstances.get(fullPath);
|
|
23224
23275
|
let listeners = new Set;
|
|
@@ -23244,7 +23295,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23244
23295
|
});
|
|
23245
23296
|
const currmtime = curr.mtimeMs;
|
|
23246
23297
|
if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
|
|
23247
|
-
foreach(cont.listeners, (listener2) => listener2(
|
|
23298
|
+
foreach(cont.listeners, (listener2) => listener2(path6, curr));
|
|
23248
23299
|
}
|
|
23249
23300
|
})
|
|
23250
23301
|
};
|
|
@@ -23267,25 +23318,25 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23267
23318
|
this.fsw = fsW;
|
|
23268
23319
|
this._boundHandleError = (error) => fsW._handleError(error);
|
|
23269
23320
|
}
|
|
23270
|
-
_watchWithNodeFs(
|
|
23321
|
+
_watchWithNodeFs(path6, listener) {
|
|
23271
23322
|
const opts = this.fsw.options;
|
|
23272
|
-
const directory = sysPath.dirname(
|
|
23273
|
-
const basename = sysPath.basename(
|
|
23323
|
+
const directory = sysPath.dirname(path6);
|
|
23324
|
+
const basename = sysPath.basename(path6);
|
|
23274
23325
|
const parent = this.fsw._getWatchedDir(directory);
|
|
23275
23326
|
parent.add(basename);
|
|
23276
|
-
const absolutePath = sysPath.resolve(
|
|
23327
|
+
const absolutePath = sysPath.resolve(path6);
|
|
23277
23328
|
const options2 = { persistent: opts.persistent };
|
|
23278
23329
|
if (!listener)
|
|
23279
23330
|
listener = EMPTY_FN;
|
|
23280
23331
|
let closer;
|
|
23281
23332
|
if (opts.usePolling) {
|
|
23282
23333
|
options2.interval = opts.enableBinaryInterval && isBinaryPath(basename) ? opts.binaryInterval : opts.interval;
|
|
23283
|
-
closer = setFsWatchFileListener(
|
|
23334
|
+
closer = setFsWatchFileListener(path6, absolutePath, options2, {
|
|
23284
23335
|
listener,
|
|
23285
23336
|
rawEmitter: this.fsw._emitRaw
|
|
23286
23337
|
});
|
|
23287
23338
|
} else {
|
|
23288
|
-
closer = setFsWatchListener(
|
|
23339
|
+
closer = setFsWatchListener(path6, absolutePath, options2, {
|
|
23289
23340
|
listener,
|
|
23290
23341
|
errHandler: this._boundHandleError,
|
|
23291
23342
|
rawEmitter: this.fsw._emitRaw
|
|
@@ -23303,7 +23354,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23303
23354
|
let prevStats = stats;
|
|
23304
23355
|
if (parent.has(basename))
|
|
23305
23356
|
return;
|
|
23306
|
-
const listener = async (
|
|
23357
|
+
const listener = async (path6, newStats) => {
|
|
23307
23358
|
if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
|
|
23308
23359
|
return;
|
|
23309
23360
|
if (!newStats || newStats.mtimeMs === 0) {
|
|
@@ -23317,9 +23368,9 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23317
23368
|
this.fsw._emit(EV_CHANGE, file, newStats2);
|
|
23318
23369
|
}
|
|
23319
23370
|
if (isLinux && prevStats.ino !== newStats2.ino) {
|
|
23320
|
-
this.fsw._closeFile(
|
|
23371
|
+
this.fsw._closeFile(path6);
|
|
23321
23372
|
prevStats = newStats2;
|
|
23322
|
-
this.fsw._addPathCloser(
|
|
23373
|
+
this.fsw._addPathCloser(path6, this._watchWithNodeFs(file, listener));
|
|
23323
23374
|
} else {
|
|
23324
23375
|
prevStats = newStats2;
|
|
23325
23376
|
}
|
|
@@ -23343,7 +23394,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23343
23394
|
}
|
|
23344
23395
|
return closer;
|
|
23345
23396
|
}
|
|
23346
|
-
async _handleSymlink(entry, directory,
|
|
23397
|
+
async _handleSymlink(entry, directory, path6, item) {
|
|
23347
23398
|
if (this.fsw.closed) {
|
|
23348
23399
|
return;
|
|
23349
23400
|
}
|
|
@@ -23353,7 +23404,7 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23353
23404
|
this.fsw._incrReadyCount();
|
|
23354
23405
|
let linkPath;
|
|
23355
23406
|
try {
|
|
23356
|
-
linkPath = await fsrealpath(
|
|
23407
|
+
linkPath = await fsrealpath(path6);
|
|
23357
23408
|
} catch (e) {
|
|
23358
23409
|
this.fsw._emitReady();
|
|
23359
23410
|
return true;
|
|
@@ -23363,12 +23414,12 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23363
23414
|
if (dir.has(item)) {
|
|
23364
23415
|
if (this.fsw._symlinkPaths.get(full) !== linkPath) {
|
|
23365
23416
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
23366
|
-
this.fsw._emit(EV_CHANGE,
|
|
23417
|
+
this.fsw._emit(EV_CHANGE, path6, entry.stats);
|
|
23367
23418
|
}
|
|
23368
23419
|
} else {
|
|
23369
23420
|
dir.add(item);
|
|
23370
23421
|
this.fsw._symlinkPaths.set(full, linkPath);
|
|
23371
|
-
this.fsw._emit(EV_ADD,
|
|
23422
|
+
this.fsw._emit(EV_ADD, path6, entry.stats);
|
|
23372
23423
|
}
|
|
23373
23424
|
this.fsw._emitReady();
|
|
23374
23425
|
return true;
|
|
@@ -23397,9 +23448,9 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23397
23448
|
return;
|
|
23398
23449
|
}
|
|
23399
23450
|
const item = entry.path;
|
|
23400
|
-
let
|
|
23451
|
+
let path6 = sysPath.join(directory, item);
|
|
23401
23452
|
current.add(item);
|
|
23402
|
-
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory,
|
|
23453
|
+
if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path6, item)) {
|
|
23403
23454
|
return;
|
|
23404
23455
|
}
|
|
23405
23456
|
if (this.fsw.closed) {
|
|
@@ -23408,8 +23459,8 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23408
23459
|
}
|
|
23409
23460
|
if (item === target || !target && !previous.has(item)) {
|
|
23410
23461
|
this.fsw._incrReadyCount();
|
|
23411
|
-
|
|
23412
|
-
this._addToNodeFs(
|
|
23462
|
+
path6 = sysPath.join(dir, sysPath.relative(dir, path6));
|
|
23463
|
+
this._addToNodeFs(path6, initialAdd, wh, depth + 1);
|
|
23413
23464
|
}
|
|
23414
23465
|
}).on(EV_ERROR, this._boundHandleError);
|
|
23415
23466
|
return new Promise((resolve) => stream.once(STR_END, () => {
|
|
@@ -23457,13 +23508,13 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23457
23508
|
}
|
|
23458
23509
|
return closer;
|
|
23459
23510
|
}
|
|
23460
|
-
async _addToNodeFs(
|
|
23511
|
+
async _addToNodeFs(path6, initialAdd, priorWh, depth, target) {
|
|
23461
23512
|
const ready = this.fsw._emitReady;
|
|
23462
|
-
if (this.fsw._isIgnored(
|
|
23513
|
+
if (this.fsw._isIgnored(path6) || this.fsw.closed) {
|
|
23463
23514
|
ready();
|
|
23464
23515
|
return false;
|
|
23465
23516
|
}
|
|
23466
|
-
const wh = this.fsw._getWatchHelpers(
|
|
23517
|
+
const wh = this.fsw._getWatchHelpers(path6, depth);
|
|
23467
23518
|
if (!wh.hasGlob && priorWh) {
|
|
23468
23519
|
wh.hasGlob = priorWh.hasGlob;
|
|
23469
23520
|
wh.globFilter = priorWh.globFilter;
|
|
@@ -23478,11 +23529,11 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23478
23529
|
ready();
|
|
23479
23530
|
return false;
|
|
23480
23531
|
}
|
|
23481
|
-
const follow = this.fsw.options.followSymlinks && !
|
|
23532
|
+
const follow = this.fsw.options.followSymlinks && !path6.includes(STAR) && !path6.includes(BRACE_START);
|
|
23482
23533
|
let closer;
|
|
23483
23534
|
if (stats.isDirectory()) {
|
|
23484
|
-
const absPath = sysPath.resolve(
|
|
23485
|
-
const targetPath = follow ? await fsrealpath(
|
|
23535
|
+
const absPath = sysPath.resolve(path6);
|
|
23536
|
+
const targetPath = follow ? await fsrealpath(path6) : path6;
|
|
23486
23537
|
if (this.fsw.closed)
|
|
23487
23538
|
return;
|
|
23488
23539
|
closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
|
|
@@ -23492,28 +23543,28 @@ var require_nodefs_handler = __commonJS((exports, module) => {
|
|
|
23492
23543
|
this.fsw._symlinkPaths.set(absPath, targetPath);
|
|
23493
23544
|
}
|
|
23494
23545
|
} else if (stats.isSymbolicLink()) {
|
|
23495
|
-
const targetPath = follow ? await fsrealpath(
|
|
23546
|
+
const targetPath = follow ? await fsrealpath(path6) : path6;
|
|
23496
23547
|
if (this.fsw.closed)
|
|
23497
23548
|
return;
|
|
23498
23549
|
const parent = sysPath.dirname(wh.watchPath);
|
|
23499
23550
|
this.fsw._getWatchedDir(parent).add(wh.watchPath);
|
|
23500
23551
|
this.fsw._emit(EV_ADD, wh.watchPath, stats);
|
|
23501
|
-
closer = await this._handleDir(parent, stats, initialAdd, depth,
|
|
23552
|
+
closer = await this._handleDir(parent, stats, initialAdd, depth, path6, wh, targetPath);
|
|
23502
23553
|
if (this.fsw.closed)
|
|
23503
23554
|
return;
|
|
23504
23555
|
if (targetPath !== undefined) {
|
|
23505
|
-
this.fsw._symlinkPaths.set(sysPath.resolve(
|
|
23556
|
+
this.fsw._symlinkPaths.set(sysPath.resolve(path6), targetPath);
|
|
23506
23557
|
}
|
|
23507
23558
|
} else {
|
|
23508
23559
|
closer = this._handleFile(wh.watchPath, stats, initialAdd);
|
|
23509
23560
|
}
|
|
23510
23561
|
ready();
|
|
23511
|
-
this.fsw._addPathCloser(
|
|
23562
|
+
this.fsw._addPathCloser(path6, closer);
|
|
23512
23563
|
return false;
|
|
23513
23564
|
} catch (error) {
|
|
23514
23565
|
if (this.fsw._handleError(error)) {
|
|
23515
23566
|
ready();
|
|
23516
|
-
return
|
|
23567
|
+
return path6;
|
|
23517
23568
|
}
|
|
23518
23569
|
}
|
|
23519
23570
|
}
|
|
@@ -23533,9 +23584,9 @@ var require_fsevents2 = __commonJS((exports) => {
|
|
|
23533
23584
|
}
|
|
23534
23585
|
var Native = require_fsevents();
|
|
23535
23586
|
var events = Native.constants;
|
|
23536
|
-
function watch(
|
|
23537
|
-
if (typeof
|
|
23538
|
-
throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof
|
|
23587
|
+
function watch(path6, since, handler) {
|
|
23588
|
+
if (typeof path6 !== "string") {
|
|
23589
|
+
throw new TypeError(`fsevents argument 1 must be a string and not a ${typeof path6}`);
|
|
23539
23590
|
}
|
|
23540
23591
|
if (typeof since === "function" && typeof handler === "undefined") {
|
|
23541
23592
|
handler = since;
|
|
@@ -23547,18 +23598,18 @@ var require_fsevents2 = __commonJS((exports) => {
|
|
|
23547
23598
|
if (typeof handler !== "function") {
|
|
23548
23599
|
throw new TypeError(`fsevents argument 3 must be a function and not a ${typeof handler}`);
|
|
23549
23600
|
}
|
|
23550
|
-
let instance = Native.start(Native.global,
|
|
23601
|
+
let instance = Native.start(Native.global, path6, since, handler);
|
|
23551
23602
|
if (!instance)
|
|
23552
|
-
throw new Error(`could not watch: ${
|
|
23603
|
+
throw new Error(`could not watch: ${path6}`);
|
|
23553
23604
|
return () => {
|
|
23554
23605
|
const result = instance ? Promise.resolve(instance).then(Native.stop) : Promise.resolve(undefined);
|
|
23555
23606
|
instance = undefined;
|
|
23556
23607
|
return result;
|
|
23557
23608
|
};
|
|
23558
23609
|
}
|
|
23559
|
-
function getInfo(
|
|
23610
|
+
function getInfo(path6, flags) {
|
|
23560
23611
|
return {
|
|
23561
|
-
path:
|
|
23612
|
+
path: path6,
|
|
23562
23613
|
flags,
|
|
23563
23614
|
event: getEventType(flags),
|
|
23564
23615
|
type: getFileType(flags),
|
|
@@ -23675,18 +23726,18 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23675
23726
|
131840,
|
|
23676
23727
|
262912
|
|
23677
23728
|
]);
|
|
23678
|
-
var createFSEventsInstance = (
|
|
23679
|
-
const stop = fsevents.watch(
|
|
23729
|
+
var createFSEventsInstance = (path6, callback) => {
|
|
23730
|
+
const stop = fsevents.watch(path6, callback);
|
|
23680
23731
|
return { stop };
|
|
23681
23732
|
};
|
|
23682
|
-
function setFSEventsListener(
|
|
23733
|
+
function setFSEventsListener(path6, realPath, listener, rawEmitter) {
|
|
23683
23734
|
let watchPath = sysPath.extname(realPath) ? sysPath.dirname(realPath) : realPath;
|
|
23684
23735
|
const parentPath = sysPath.dirname(watchPath);
|
|
23685
23736
|
let cont = FSEventsWatchers.get(watchPath);
|
|
23686
23737
|
if (couldConsolidate(parentPath)) {
|
|
23687
23738
|
watchPath = parentPath;
|
|
23688
23739
|
}
|
|
23689
|
-
const resolvedPath = sysPath.resolve(
|
|
23740
|
+
const resolvedPath = sysPath.resolve(path6);
|
|
23690
23741
|
const hasSymlink = resolvedPath !== realPath;
|
|
23691
23742
|
const filteredListener = (fullPath, flags, info) => {
|
|
23692
23743
|
if (hasSymlink)
|
|
@@ -23736,10 +23787,10 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23736
23787
|
}
|
|
23737
23788
|
};
|
|
23738
23789
|
}
|
|
23739
|
-
var couldConsolidate = (
|
|
23790
|
+
var couldConsolidate = (path6) => {
|
|
23740
23791
|
let count = 0;
|
|
23741
23792
|
for (const watchPath of FSEventsWatchers.keys()) {
|
|
23742
|
-
if (watchPath.indexOf(
|
|
23793
|
+
if (watchPath.indexOf(path6) === 0) {
|
|
23743
23794
|
count++;
|
|
23744
23795
|
if (count >= consolidateThreshhold) {
|
|
23745
23796
|
return true;
|
|
@@ -23749,9 +23800,9 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23749
23800
|
return false;
|
|
23750
23801
|
};
|
|
23751
23802
|
var canUse = () => fsevents && FSEventsWatchers.size < 128;
|
|
23752
|
-
var calcDepth = (
|
|
23803
|
+
var calcDepth = (path6, root) => {
|
|
23753
23804
|
let i = 0;
|
|
23754
|
-
while (!
|
|
23805
|
+
while (!path6.indexOf(root) && (path6 = sysPath.dirname(path6)) !== root)
|
|
23755
23806
|
i++;
|
|
23756
23807
|
return i;
|
|
23757
23808
|
};
|
|
@@ -23761,42 +23812,42 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23761
23812
|
constructor(fsw) {
|
|
23762
23813
|
this.fsw = fsw;
|
|
23763
23814
|
}
|
|
23764
|
-
checkIgnored(
|
|
23815
|
+
checkIgnored(path6, stats) {
|
|
23765
23816
|
const ipaths = this.fsw._ignoredPaths;
|
|
23766
|
-
if (this.fsw._isIgnored(
|
|
23767
|
-
ipaths.add(
|
|
23817
|
+
if (this.fsw._isIgnored(path6, stats)) {
|
|
23818
|
+
ipaths.add(path6);
|
|
23768
23819
|
if (stats && stats.isDirectory()) {
|
|
23769
|
-
ipaths.add(
|
|
23820
|
+
ipaths.add(path6 + ROOT_GLOBSTAR);
|
|
23770
23821
|
}
|
|
23771
23822
|
return true;
|
|
23772
23823
|
}
|
|
23773
|
-
ipaths.delete(
|
|
23774
|
-
ipaths.delete(
|
|
23824
|
+
ipaths.delete(path6);
|
|
23825
|
+
ipaths.delete(path6 + ROOT_GLOBSTAR);
|
|
23775
23826
|
}
|
|
23776
|
-
addOrChange(
|
|
23827
|
+
addOrChange(path6, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
23777
23828
|
const event = watchedDir.has(item) ? EV_CHANGE : EV_ADD;
|
|
23778
|
-
this.handleEvent(event,
|
|
23829
|
+
this.handleEvent(event, path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23779
23830
|
}
|
|
23780
|
-
async checkExists(
|
|
23831
|
+
async checkExists(path6, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
23781
23832
|
try {
|
|
23782
|
-
const stats = await stat(
|
|
23833
|
+
const stats = await stat(path6);
|
|
23783
23834
|
if (this.fsw.closed)
|
|
23784
23835
|
return;
|
|
23785
23836
|
if (sameTypes(info, stats)) {
|
|
23786
|
-
this.addOrChange(
|
|
23837
|
+
this.addOrChange(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23787
23838
|
} else {
|
|
23788
|
-
this.handleEvent(EV_UNLINK,
|
|
23839
|
+
this.handleEvent(EV_UNLINK, path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23789
23840
|
}
|
|
23790
23841
|
} catch (error) {
|
|
23791
23842
|
if (error.code === "EACCES") {
|
|
23792
|
-
this.addOrChange(
|
|
23843
|
+
this.addOrChange(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23793
23844
|
} else {
|
|
23794
|
-
this.handleEvent(EV_UNLINK,
|
|
23845
|
+
this.handleEvent(EV_UNLINK, path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23795
23846
|
}
|
|
23796
23847
|
}
|
|
23797
23848
|
}
|
|
23798
|
-
handleEvent(event,
|
|
23799
|
-
if (this.fsw.closed || this.checkIgnored(
|
|
23849
|
+
handleEvent(event, path6, fullPath, realPath, parent, watchedDir, item, info, opts) {
|
|
23850
|
+
if (this.fsw.closed || this.checkIgnored(path6))
|
|
23800
23851
|
return;
|
|
23801
23852
|
if (event === EV_UNLINK) {
|
|
23802
23853
|
const isDirectory2 = info.type === FSEVENT_TYPE_DIRECTORY;
|
|
@@ -23806,17 +23857,17 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23806
23857
|
} else {
|
|
23807
23858
|
if (event === EV_ADD) {
|
|
23808
23859
|
if (info.type === FSEVENT_TYPE_DIRECTORY)
|
|
23809
|
-
this.fsw._getWatchedDir(
|
|
23860
|
+
this.fsw._getWatchedDir(path6);
|
|
23810
23861
|
if (info.type === FSEVENT_TYPE_SYMLINK && opts.followSymlinks) {
|
|
23811
23862
|
const curDepth = opts.depth === undefined ? undefined : calcDepth(fullPath, realPath) + 1;
|
|
23812
|
-
return this._addToFsEvents(
|
|
23863
|
+
return this._addToFsEvents(path6, false, true, curDepth);
|
|
23813
23864
|
}
|
|
23814
23865
|
this.fsw._getWatchedDir(parent).add(item);
|
|
23815
23866
|
}
|
|
23816
23867
|
const eventName = info.type === FSEVENT_TYPE_DIRECTORY ? event + DIR_SUFFIX : event;
|
|
23817
|
-
this.fsw._emit(eventName,
|
|
23868
|
+
this.fsw._emit(eventName, path6);
|
|
23818
23869
|
if (eventName === EV_ADD_DIR)
|
|
23819
|
-
this._addToFsEvents(
|
|
23870
|
+
this._addToFsEvents(path6, false, true);
|
|
23820
23871
|
}
|
|
23821
23872
|
}
|
|
23822
23873
|
_watchWithFsEvents(watchPath, realPath, transform, globFilter) {
|
|
@@ -23828,38 +23879,38 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23828
23879
|
return;
|
|
23829
23880
|
if (opts.depth !== undefined && calcDepth(fullPath, realPath) > opts.depth)
|
|
23830
23881
|
return;
|
|
23831
|
-
const
|
|
23832
|
-
if (globFilter && !globFilter(
|
|
23882
|
+
const path6 = transform(sysPath.join(watchPath, sysPath.relative(watchPath, fullPath)));
|
|
23883
|
+
if (globFilter && !globFilter(path6))
|
|
23833
23884
|
return;
|
|
23834
|
-
const parent = sysPath.dirname(
|
|
23835
|
-
const item = sysPath.basename(
|
|
23836
|
-
const watchedDir = this.fsw._getWatchedDir(info.type === FSEVENT_TYPE_DIRECTORY ?
|
|
23885
|
+
const parent = sysPath.dirname(path6);
|
|
23886
|
+
const item = sysPath.basename(path6);
|
|
23887
|
+
const watchedDir = this.fsw._getWatchedDir(info.type === FSEVENT_TYPE_DIRECTORY ? path6 : parent);
|
|
23837
23888
|
if (wrongEventFlags.has(flags) || info.event === FSEVENT_UNKNOWN) {
|
|
23838
23889
|
if (typeof opts.ignored === FUNCTION_TYPE) {
|
|
23839
23890
|
let stats;
|
|
23840
23891
|
try {
|
|
23841
|
-
stats = await stat(
|
|
23892
|
+
stats = await stat(path6);
|
|
23842
23893
|
} catch (error) {}
|
|
23843
23894
|
if (this.fsw.closed)
|
|
23844
23895
|
return;
|
|
23845
|
-
if (this.checkIgnored(
|
|
23896
|
+
if (this.checkIgnored(path6, stats))
|
|
23846
23897
|
return;
|
|
23847
23898
|
if (sameTypes(info, stats)) {
|
|
23848
|
-
this.addOrChange(
|
|
23899
|
+
this.addOrChange(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23849
23900
|
} else {
|
|
23850
|
-
this.handleEvent(EV_UNLINK,
|
|
23901
|
+
this.handleEvent(EV_UNLINK, path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23851
23902
|
}
|
|
23852
23903
|
} else {
|
|
23853
|
-
this.checkExists(
|
|
23904
|
+
this.checkExists(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23854
23905
|
}
|
|
23855
23906
|
} else {
|
|
23856
23907
|
switch (info.event) {
|
|
23857
23908
|
case FSEVENT_CREATED:
|
|
23858
23909
|
case FSEVENT_MODIFIED:
|
|
23859
|
-
return this.addOrChange(
|
|
23910
|
+
return this.addOrChange(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23860
23911
|
case FSEVENT_DELETED:
|
|
23861
23912
|
case FSEVENT_MOVED:
|
|
23862
|
-
return this.checkExists(
|
|
23913
|
+
return this.checkExists(path6, fullPath, realPath, parent, watchedDir, item, info, opts);
|
|
23863
23914
|
}
|
|
23864
23915
|
}
|
|
23865
23916
|
};
|
|
@@ -23880,12 +23931,12 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23880
23931
|
return this.fsw._emitReady();
|
|
23881
23932
|
}
|
|
23882
23933
|
this.fsw._incrReadyCount();
|
|
23883
|
-
this._addToFsEvents(linkTarget || linkPath, (
|
|
23934
|
+
this._addToFsEvents(linkTarget || linkPath, (path6) => {
|
|
23884
23935
|
let aliasedPath = linkPath;
|
|
23885
23936
|
if (linkTarget && linkTarget !== DOT_SLASH) {
|
|
23886
|
-
aliasedPath =
|
|
23887
|
-
} else if (
|
|
23888
|
-
aliasedPath = sysPath.join(linkPath,
|
|
23937
|
+
aliasedPath = path6.replace(linkTarget, linkPath);
|
|
23938
|
+
} else if (path6 !== DOT_SLASH) {
|
|
23939
|
+
aliasedPath = sysPath.join(linkPath, path6);
|
|
23889
23940
|
}
|
|
23890
23941
|
return transform(aliasedPath);
|
|
23891
23942
|
}, false, curDepth);
|
|
@@ -23909,19 +23960,19 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23909
23960
|
this.fsw._emit(isDir ? EV_ADD_DIR : EV_ADD, pp, stats);
|
|
23910
23961
|
}
|
|
23911
23962
|
}
|
|
23912
|
-
initWatch(realPath,
|
|
23963
|
+
initWatch(realPath, path6, wh, processPath) {
|
|
23913
23964
|
if (this.fsw.closed)
|
|
23914
23965
|
return;
|
|
23915
23966
|
const closer = this._watchWithFsEvents(wh.watchPath, sysPath.resolve(realPath || wh.watchPath), processPath, wh.globFilter);
|
|
23916
|
-
this.fsw._addPathCloser(
|
|
23967
|
+
this.fsw._addPathCloser(path6, closer);
|
|
23917
23968
|
}
|
|
23918
|
-
async _addToFsEvents(
|
|
23969
|
+
async _addToFsEvents(path6, transform, forceAdd, priorDepth) {
|
|
23919
23970
|
if (this.fsw.closed) {
|
|
23920
23971
|
return;
|
|
23921
23972
|
}
|
|
23922
23973
|
const opts = this.fsw.options;
|
|
23923
23974
|
const processPath = typeof transform === FUNCTION_TYPE ? transform : IDENTITY_FN;
|
|
23924
|
-
const wh = this.fsw._getWatchHelpers(
|
|
23975
|
+
const wh = this.fsw._getWatchHelpers(path6);
|
|
23925
23976
|
try {
|
|
23926
23977
|
const stats = await statMethods[wh.statMethod](wh.watchPath);
|
|
23927
23978
|
if (this.fsw.closed)
|
|
@@ -23931,7 +23982,7 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23931
23982
|
}
|
|
23932
23983
|
if (stats.isDirectory()) {
|
|
23933
23984
|
if (!wh.globFilter)
|
|
23934
|
-
this.emitAdd(processPath(
|
|
23985
|
+
this.emitAdd(processPath(path6), stats, processPath, opts, forceAdd);
|
|
23935
23986
|
if (priorDepth && priorDepth > opts.depth)
|
|
23936
23987
|
return;
|
|
23937
23988
|
this.fsw._readdirp(wh.watchPath, {
|
|
@@ -23967,13 +24018,13 @@ var require_fsevents_handler = __commonJS((exports, module) => {
|
|
|
23967
24018
|
}
|
|
23968
24019
|
if (opts.persistent && forceAdd !== true) {
|
|
23969
24020
|
if (typeof transform === FUNCTION_TYPE) {
|
|
23970
|
-
this.initWatch(undefined,
|
|
24021
|
+
this.initWatch(undefined, path6, wh, processPath);
|
|
23971
24022
|
} else {
|
|
23972
24023
|
let realPath;
|
|
23973
24024
|
try {
|
|
23974
24025
|
realPath = await realpath(wh.watchPath);
|
|
23975
24026
|
} catch (e) {}
|
|
23976
|
-
this.initWatch(realPath,
|
|
24027
|
+
this.initWatch(realPath, path6, wh, processPath);
|
|
23977
24028
|
}
|
|
23978
24029
|
}
|
|
23979
24030
|
}
|
|
@@ -24064,20 +24115,20 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24064
24115
|
}
|
|
24065
24116
|
return str2;
|
|
24066
24117
|
};
|
|
24067
|
-
var normalizePathToUnix = (
|
|
24068
|
-
var normalizeIgnored = (cwd = EMPTY_STR) => (
|
|
24069
|
-
if (typeof
|
|
24070
|
-
return
|
|
24071
|
-
return normalizePathToUnix(sysPath.isAbsolute(
|
|
24118
|
+
var normalizePathToUnix = (path6) => toUnix(sysPath.normalize(toUnix(path6)));
|
|
24119
|
+
var normalizeIgnored = (cwd = EMPTY_STR) => (path6) => {
|
|
24120
|
+
if (typeof path6 !== STRING_TYPE)
|
|
24121
|
+
return path6;
|
|
24122
|
+
return normalizePathToUnix(sysPath.isAbsolute(path6) ? path6 : sysPath.join(cwd, path6));
|
|
24072
24123
|
};
|
|
24073
|
-
var getAbsolutePath = (
|
|
24074
|
-
if (sysPath.isAbsolute(
|
|
24075
|
-
return
|
|
24124
|
+
var getAbsolutePath = (path6, cwd) => {
|
|
24125
|
+
if (sysPath.isAbsolute(path6)) {
|
|
24126
|
+
return path6;
|
|
24076
24127
|
}
|
|
24077
|
-
if (
|
|
24078
|
-
return BANG + sysPath.join(cwd,
|
|
24128
|
+
if (path6.startsWith(BANG)) {
|
|
24129
|
+
return BANG + sysPath.join(cwd, path6.slice(1));
|
|
24079
24130
|
}
|
|
24080
|
-
return sysPath.join(cwd,
|
|
24131
|
+
return sysPath.join(cwd, path6);
|
|
24081
24132
|
};
|
|
24082
24133
|
var undef = (opts, key) => opts[key] === undefined;
|
|
24083
24134
|
|
|
@@ -24134,17 +24185,17 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24134
24185
|
var STAT_METHOD_L = "lstat";
|
|
24135
24186
|
|
|
24136
24187
|
class WatchHelper {
|
|
24137
|
-
constructor(
|
|
24188
|
+
constructor(path6, watchPath, follow, fsw) {
|
|
24138
24189
|
this.fsw = fsw;
|
|
24139
|
-
this.path =
|
|
24190
|
+
this.path = path6 = path6.replace(REPLACER_RE, EMPTY_STR);
|
|
24140
24191
|
this.watchPath = watchPath;
|
|
24141
24192
|
this.fullWatchPath = sysPath.resolve(watchPath);
|
|
24142
|
-
this.hasGlob = watchPath !==
|
|
24143
|
-
if (
|
|
24193
|
+
this.hasGlob = watchPath !== path6;
|
|
24194
|
+
if (path6 === EMPTY_STR)
|
|
24144
24195
|
this.hasGlob = false;
|
|
24145
24196
|
this.globSymlink = this.hasGlob && follow ? undefined : false;
|
|
24146
|
-
this.globFilter = this.hasGlob ? anymatch(
|
|
24147
|
-
this.dirParts = this.getDirParts(
|
|
24197
|
+
this.globFilter = this.hasGlob ? anymatch(path6, undefined, ANYMATCH_OPTS) : false;
|
|
24198
|
+
this.dirParts = this.getDirParts(path6);
|
|
24148
24199
|
this.dirParts.forEach((parts) => {
|
|
24149
24200
|
if (parts.length > 1)
|
|
24150
24201
|
parts.pop();
|
|
@@ -24172,13 +24223,13 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24172
24223
|
const matchesGlob = this.hasGlob && typeof this.globFilter === FUNCTION_TYPE ? this.globFilter(resolvedPath) : true;
|
|
24173
24224
|
return matchesGlob && this.fsw._isntIgnored(resolvedPath, stats) && this.fsw._hasReadPermissions(stats);
|
|
24174
24225
|
}
|
|
24175
|
-
getDirParts(
|
|
24226
|
+
getDirParts(path6) {
|
|
24176
24227
|
if (!this.hasGlob)
|
|
24177
24228
|
return [];
|
|
24178
24229
|
const parts = [];
|
|
24179
|
-
const expandedPath =
|
|
24180
|
-
expandedPath.forEach((
|
|
24181
|
-
parts.push(sysPath.relative(this.watchPath,
|
|
24230
|
+
const expandedPath = path6.includes(BRACE_START) ? braces.expand(path6) : [path6];
|
|
24231
|
+
expandedPath.forEach((path7) => {
|
|
24232
|
+
parts.push(sysPath.relative(this.watchPath, path7).split(SLASH_OR_BACK_SLASH_RE));
|
|
24182
24233
|
});
|
|
24183
24234
|
return parts;
|
|
24184
24235
|
}
|
|
@@ -24294,21 +24345,21 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24294
24345
|
this.closed = false;
|
|
24295
24346
|
let paths = unifyPaths(paths_);
|
|
24296
24347
|
if (cwd) {
|
|
24297
|
-
paths = paths.map((
|
|
24298
|
-
const absPath = getAbsolutePath(
|
|
24299
|
-
if (disableGlobbing || !isGlob(
|
|
24348
|
+
paths = paths.map((path6) => {
|
|
24349
|
+
const absPath = getAbsolutePath(path6, cwd);
|
|
24350
|
+
if (disableGlobbing || !isGlob(path6)) {
|
|
24300
24351
|
return absPath;
|
|
24301
24352
|
}
|
|
24302
24353
|
return normalizePath(absPath);
|
|
24303
24354
|
});
|
|
24304
24355
|
}
|
|
24305
|
-
paths = paths.filter((
|
|
24306
|
-
if (
|
|
24307
|
-
this._ignoredPaths.add(
|
|
24356
|
+
paths = paths.filter((path6) => {
|
|
24357
|
+
if (path6.startsWith(BANG)) {
|
|
24358
|
+
this._ignoredPaths.add(path6.slice(1));
|
|
24308
24359
|
return false;
|
|
24309
24360
|
}
|
|
24310
|
-
this._ignoredPaths.delete(
|
|
24311
|
-
this._ignoredPaths.delete(
|
|
24361
|
+
this._ignoredPaths.delete(path6);
|
|
24362
|
+
this._ignoredPaths.delete(path6 + SLASH_GLOBSTAR);
|
|
24312
24363
|
this._userIgnored = undefined;
|
|
24313
24364
|
return true;
|
|
24314
24365
|
});
|
|
@@ -24317,13 +24368,13 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24317
24368
|
this._readyCount = paths.length;
|
|
24318
24369
|
if (this.options.persistent)
|
|
24319
24370
|
this._readyCount += paths.length;
|
|
24320
|
-
paths.forEach((
|
|
24371
|
+
paths.forEach((path6) => this._fsEventsHandler._addToFsEvents(path6));
|
|
24321
24372
|
} else {
|
|
24322
24373
|
if (!this._readyCount)
|
|
24323
24374
|
this._readyCount = 0;
|
|
24324
24375
|
this._readyCount += paths.length;
|
|
24325
|
-
Promise.all(paths.map(async (
|
|
24326
|
-
const res = await this._nodeFsHandler._addToNodeFs(
|
|
24376
|
+
Promise.all(paths.map(async (path6) => {
|
|
24377
|
+
const res = await this._nodeFsHandler._addToNodeFs(path6, !_internal, 0, 0, _origAdd);
|
|
24327
24378
|
if (res)
|
|
24328
24379
|
this._emitReady();
|
|
24329
24380
|
return res;
|
|
@@ -24342,16 +24393,16 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24342
24393
|
return this;
|
|
24343
24394
|
const paths = unifyPaths(paths_);
|
|
24344
24395
|
const { cwd } = this.options;
|
|
24345
|
-
paths.forEach((
|
|
24346
|
-
if (!sysPath.isAbsolute(
|
|
24396
|
+
paths.forEach((path6) => {
|
|
24397
|
+
if (!sysPath.isAbsolute(path6) && !this._closers.has(path6)) {
|
|
24347
24398
|
if (cwd)
|
|
24348
|
-
|
|
24349
|
-
|
|
24399
|
+
path6 = sysPath.join(cwd, path6);
|
|
24400
|
+
path6 = sysPath.resolve(path6);
|
|
24350
24401
|
}
|
|
24351
|
-
this._closePath(
|
|
24352
|
-
this._ignoredPaths.add(
|
|
24353
|
-
if (this._watched.has(
|
|
24354
|
-
this._ignoredPaths.add(
|
|
24402
|
+
this._closePath(path6);
|
|
24403
|
+
this._ignoredPaths.add(path6);
|
|
24404
|
+
if (this._watched.has(path6)) {
|
|
24405
|
+
this._ignoredPaths.add(path6 + SLASH_GLOBSTAR);
|
|
24355
24406
|
}
|
|
24356
24407
|
this._userIgnored = undefined;
|
|
24357
24408
|
});
|
|
@@ -24394,15 +24445,15 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24394
24445
|
if (event !== EV_ERROR)
|
|
24395
24446
|
this.emit(EV_ALL, ...args);
|
|
24396
24447
|
}
|
|
24397
|
-
async _emit(event,
|
|
24448
|
+
async _emit(event, path6, val1, val2, val3) {
|
|
24398
24449
|
if (this.closed)
|
|
24399
24450
|
return;
|
|
24400
24451
|
const opts = this.options;
|
|
24401
24452
|
if (isWindows)
|
|
24402
|
-
|
|
24453
|
+
path6 = sysPath.normalize(path6);
|
|
24403
24454
|
if (opts.cwd)
|
|
24404
|
-
|
|
24405
|
-
const args = [event,
|
|
24455
|
+
path6 = sysPath.relative(opts.cwd, path6);
|
|
24456
|
+
const args = [event, path6];
|
|
24406
24457
|
if (val3 !== undefined)
|
|
24407
24458
|
args.push(val1, val2, val3);
|
|
24408
24459
|
else if (val2 !== undefined)
|
|
@@ -24411,25 +24462,25 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24411
24462
|
args.push(val1);
|
|
24412
24463
|
const awf = opts.awaitWriteFinish;
|
|
24413
24464
|
let pw;
|
|
24414
|
-
if (awf && (pw = this._pendingWrites.get(
|
|
24465
|
+
if (awf && (pw = this._pendingWrites.get(path6))) {
|
|
24415
24466
|
pw.lastChange = new Date;
|
|
24416
24467
|
return this;
|
|
24417
24468
|
}
|
|
24418
24469
|
if (opts.atomic) {
|
|
24419
24470
|
if (event === EV_UNLINK) {
|
|
24420
|
-
this._pendingUnlinks.set(
|
|
24471
|
+
this._pendingUnlinks.set(path6, args);
|
|
24421
24472
|
setTimeout(() => {
|
|
24422
|
-
this._pendingUnlinks.forEach((entry,
|
|
24473
|
+
this._pendingUnlinks.forEach((entry, path7) => {
|
|
24423
24474
|
this.emit(...entry);
|
|
24424
24475
|
this.emit(EV_ALL, ...entry);
|
|
24425
|
-
this._pendingUnlinks.delete(
|
|
24476
|
+
this._pendingUnlinks.delete(path7);
|
|
24426
24477
|
});
|
|
24427
24478
|
}, typeof opts.atomic === "number" ? opts.atomic : 100);
|
|
24428
24479
|
return this;
|
|
24429
24480
|
}
|
|
24430
|
-
if (event === EV_ADD && this._pendingUnlinks.has(
|
|
24481
|
+
if (event === EV_ADD && this._pendingUnlinks.has(path6)) {
|
|
24431
24482
|
event = args[0] = EV_CHANGE;
|
|
24432
|
-
this._pendingUnlinks.delete(
|
|
24483
|
+
this._pendingUnlinks.delete(path6);
|
|
24433
24484
|
}
|
|
24434
24485
|
}
|
|
24435
24486
|
if (awf && (event === EV_ADD || event === EV_CHANGE) && this._readyEmitted) {
|
|
@@ -24447,16 +24498,16 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24447
24498
|
this.emitWithAll(event, args);
|
|
24448
24499
|
}
|
|
24449
24500
|
};
|
|
24450
|
-
this._awaitWriteFinish(
|
|
24501
|
+
this._awaitWriteFinish(path6, awf.stabilityThreshold, event, awfEmit);
|
|
24451
24502
|
return this;
|
|
24452
24503
|
}
|
|
24453
24504
|
if (event === EV_CHANGE) {
|
|
24454
|
-
const isThrottled = !this._throttle(EV_CHANGE,
|
|
24505
|
+
const isThrottled = !this._throttle(EV_CHANGE, path6, 50);
|
|
24455
24506
|
if (isThrottled)
|
|
24456
24507
|
return this;
|
|
24457
24508
|
}
|
|
24458
24509
|
if (opts.alwaysStat && val1 === undefined && (event === EV_ADD || event === EV_ADD_DIR || event === EV_CHANGE)) {
|
|
24459
|
-
const fullPath = opts.cwd ? sysPath.join(opts.cwd,
|
|
24510
|
+
const fullPath = opts.cwd ? sysPath.join(opts.cwd, path6) : path6;
|
|
24460
24511
|
let stats;
|
|
24461
24512
|
try {
|
|
24462
24513
|
stats = await stat(fullPath);
|
|
@@ -24475,21 +24526,21 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24475
24526
|
}
|
|
24476
24527
|
return error || this.closed;
|
|
24477
24528
|
}
|
|
24478
|
-
_throttle(actionType,
|
|
24529
|
+
_throttle(actionType, path6, timeout) {
|
|
24479
24530
|
if (!this._throttled.has(actionType)) {
|
|
24480
24531
|
this._throttled.set(actionType, new Map);
|
|
24481
24532
|
}
|
|
24482
24533
|
const action = this._throttled.get(actionType);
|
|
24483
|
-
const actionPath = action.get(
|
|
24534
|
+
const actionPath = action.get(path6);
|
|
24484
24535
|
if (actionPath) {
|
|
24485
24536
|
actionPath.count++;
|
|
24486
24537
|
return false;
|
|
24487
24538
|
}
|
|
24488
24539
|
let timeoutObject;
|
|
24489
24540
|
const clear = () => {
|
|
24490
|
-
const item = action.get(
|
|
24541
|
+
const item = action.get(path6);
|
|
24491
24542
|
const count = item ? item.count : 0;
|
|
24492
|
-
action.delete(
|
|
24543
|
+
action.delete(path6);
|
|
24493
24544
|
clearTimeout(timeoutObject);
|
|
24494
24545
|
if (item)
|
|
24495
24546
|
clearTimeout(item.timeoutObject);
|
|
@@ -24497,45 +24548,45 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24497
24548
|
};
|
|
24498
24549
|
timeoutObject = setTimeout(clear, timeout);
|
|
24499
24550
|
const thr = { timeoutObject, clear, count: 0 };
|
|
24500
|
-
action.set(
|
|
24551
|
+
action.set(path6, thr);
|
|
24501
24552
|
return thr;
|
|
24502
24553
|
}
|
|
24503
24554
|
_incrReadyCount() {
|
|
24504
24555
|
return this._readyCount++;
|
|
24505
24556
|
}
|
|
24506
|
-
_awaitWriteFinish(
|
|
24557
|
+
_awaitWriteFinish(path6, threshold, event, awfEmit) {
|
|
24507
24558
|
let timeoutHandler;
|
|
24508
|
-
let fullPath =
|
|
24509
|
-
if (this.options.cwd && !sysPath.isAbsolute(
|
|
24510
|
-
fullPath = sysPath.join(this.options.cwd,
|
|
24559
|
+
let fullPath = path6;
|
|
24560
|
+
if (this.options.cwd && !sysPath.isAbsolute(path6)) {
|
|
24561
|
+
fullPath = sysPath.join(this.options.cwd, path6);
|
|
24511
24562
|
}
|
|
24512
24563
|
const now = new Date;
|
|
24513
24564
|
const awaitWriteFinish = (prevStat) => {
|
|
24514
24565
|
fs2.stat(fullPath, (err, curStat) => {
|
|
24515
|
-
if (err || !this._pendingWrites.has(
|
|
24566
|
+
if (err || !this._pendingWrites.has(path6)) {
|
|
24516
24567
|
if (err && err.code !== "ENOENT")
|
|
24517
24568
|
awfEmit(err);
|
|
24518
24569
|
return;
|
|
24519
24570
|
}
|
|
24520
24571
|
const now2 = Number(new Date);
|
|
24521
24572
|
if (prevStat && curStat.size !== prevStat.size) {
|
|
24522
|
-
this._pendingWrites.get(
|
|
24573
|
+
this._pendingWrites.get(path6).lastChange = now2;
|
|
24523
24574
|
}
|
|
24524
|
-
const pw = this._pendingWrites.get(
|
|
24575
|
+
const pw = this._pendingWrites.get(path6);
|
|
24525
24576
|
const df = now2 - pw.lastChange;
|
|
24526
24577
|
if (df >= threshold) {
|
|
24527
|
-
this._pendingWrites.delete(
|
|
24578
|
+
this._pendingWrites.delete(path6);
|
|
24528
24579
|
awfEmit(undefined, curStat);
|
|
24529
24580
|
} else {
|
|
24530
24581
|
timeoutHandler = setTimeout(awaitWriteFinish, this.options.awaitWriteFinish.pollInterval, curStat);
|
|
24531
24582
|
}
|
|
24532
24583
|
});
|
|
24533
24584
|
};
|
|
24534
|
-
if (!this._pendingWrites.has(
|
|
24535
|
-
this._pendingWrites.set(
|
|
24585
|
+
if (!this._pendingWrites.has(path6)) {
|
|
24586
|
+
this._pendingWrites.set(path6, {
|
|
24536
24587
|
lastChange: now,
|
|
24537
24588
|
cancelWait: () => {
|
|
24538
|
-
this._pendingWrites.delete(
|
|
24589
|
+
this._pendingWrites.delete(path6);
|
|
24539
24590
|
clearTimeout(timeoutHandler);
|
|
24540
24591
|
return event;
|
|
24541
24592
|
}
|
|
@@ -24546,26 +24597,26 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24546
24597
|
_getGlobIgnored() {
|
|
24547
24598
|
return [...this._ignoredPaths.values()];
|
|
24548
24599
|
}
|
|
24549
|
-
_isIgnored(
|
|
24550
|
-
if (this.options.atomic && DOT_RE.test(
|
|
24600
|
+
_isIgnored(path6, stats) {
|
|
24601
|
+
if (this.options.atomic && DOT_RE.test(path6))
|
|
24551
24602
|
return true;
|
|
24552
24603
|
if (!this._userIgnored) {
|
|
24553
24604
|
const { cwd } = this.options;
|
|
24554
24605
|
const ign = this.options.ignored;
|
|
24555
24606
|
const ignored = ign && ign.map(normalizeIgnored(cwd));
|
|
24556
|
-
const paths = arrify(ignored).filter((
|
|
24607
|
+
const paths = arrify(ignored).filter((path7) => typeof path7 === STRING_TYPE && !isGlob(path7)).map((path7) => path7 + SLASH_GLOBSTAR);
|
|
24557
24608
|
const list = this._getGlobIgnored().map(normalizeIgnored(cwd)).concat(ignored, paths);
|
|
24558
24609
|
this._userIgnored = anymatch(list, undefined, ANYMATCH_OPTS);
|
|
24559
24610
|
}
|
|
24560
|
-
return this._userIgnored([
|
|
24611
|
+
return this._userIgnored([path6, stats]);
|
|
24561
24612
|
}
|
|
24562
|
-
_isntIgnored(
|
|
24563
|
-
return !this._isIgnored(
|
|
24613
|
+
_isntIgnored(path6, stat2) {
|
|
24614
|
+
return !this._isIgnored(path6, stat2);
|
|
24564
24615
|
}
|
|
24565
|
-
_getWatchHelpers(
|
|
24566
|
-
const watchPath = depth || this.options.disableGlobbing || !isGlob(
|
|
24616
|
+
_getWatchHelpers(path6, depth) {
|
|
24617
|
+
const watchPath = depth || this.options.disableGlobbing || !isGlob(path6) ? path6 : globParent(path6);
|
|
24567
24618
|
const follow = this.options.followSymlinks;
|
|
24568
|
-
return new WatchHelper(
|
|
24619
|
+
return new WatchHelper(path6, watchPath, follow, this);
|
|
24569
24620
|
}
|
|
24570
24621
|
_getWatchedDir(directory) {
|
|
24571
24622
|
if (!this._boundRemove)
|
|
@@ -24584,59 +24635,59 @@ var require_chokidar = __commonJS((exports) => {
|
|
|
24584
24635
|
return Boolean(4 & it2);
|
|
24585
24636
|
}
|
|
24586
24637
|
_remove(directory, item, isDirectory2) {
|
|
24587
|
-
const
|
|
24588
|
-
const fullPath = sysPath.resolve(
|
|
24589
|
-
isDirectory2 = isDirectory2 != null ? isDirectory2 : this._watched.has(
|
|
24590
|
-
if (!this._throttle("remove",
|
|
24638
|
+
const path6 = sysPath.join(directory, item);
|
|
24639
|
+
const fullPath = sysPath.resolve(path6);
|
|
24640
|
+
isDirectory2 = isDirectory2 != null ? isDirectory2 : this._watched.has(path6) || this._watched.has(fullPath);
|
|
24641
|
+
if (!this._throttle("remove", path6, 100))
|
|
24591
24642
|
return;
|
|
24592
24643
|
if (!isDirectory2 && !this.options.useFsEvents && this._watched.size === 1) {
|
|
24593
24644
|
this.add(directory, item, true);
|
|
24594
24645
|
}
|
|
24595
|
-
const wp = this._getWatchedDir(
|
|
24646
|
+
const wp = this._getWatchedDir(path6);
|
|
24596
24647
|
const nestedDirectoryChildren = wp.getChildren();
|
|
24597
|
-
nestedDirectoryChildren.forEach((nested) => this._remove(
|
|
24648
|
+
nestedDirectoryChildren.forEach((nested) => this._remove(path6, nested));
|
|
24598
24649
|
const parent = this._getWatchedDir(directory);
|
|
24599
24650
|
const wasTracked = parent.has(item);
|
|
24600
24651
|
parent.remove(item);
|
|
24601
24652
|
if (this._symlinkPaths.has(fullPath)) {
|
|
24602
24653
|
this._symlinkPaths.delete(fullPath);
|
|
24603
24654
|
}
|
|
24604
|
-
let relPath =
|
|
24655
|
+
let relPath = path6;
|
|
24605
24656
|
if (this.options.cwd)
|
|
24606
|
-
relPath = sysPath.relative(this.options.cwd,
|
|
24657
|
+
relPath = sysPath.relative(this.options.cwd, path6);
|
|
24607
24658
|
if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
|
|
24608
24659
|
const event = this._pendingWrites.get(relPath).cancelWait();
|
|
24609
24660
|
if (event === EV_ADD)
|
|
24610
24661
|
return;
|
|
24611
24662
|
}
|
|
24612
|
-
this._watched.delete(
|
|
24663
|
+
this._watched.delete(path6);
|
|
24613
24664
|
this._watched.delete(fullPath);
|
|
24614
24665
|
const eventName = isDirectory2 ? EV_UNLINK_DIR : EV_UNLINK;
|
|
24615
|
-
if (wasTracked && !this._isIgnored(
|
|
24616
|
-
this._emit(eventName,
|
|
24666
|
+
if (wasTracked && !this._isIgnored(path6))
|
|
24667
|
+
this._emit(eventName, path6);
|
|
24617
24668
|
if (!this.options.useFsEvents) {
|
|
24618
|
-
this._closePath(
|
|
24669
|
+
this._closePath(path6);
|
|
24619
24670
|
}
|
|
24620
24671
|
}
|
|
24621
|
-
_closePath(
|
|
24622
|
-
this._closeFile(
|
|
24623
|
-
const dir = sysPath.dirname(
|
|
24624
|
-
this._getWatchedDir(dir).remove(sysPath.basename(
|
|
24672
|
+
_closePath(path6) {
|
|
24673
|
+
this._closeFile(path6);
|
|
24674
|
+
const dir = sysPath.dirname(path6);
|
|
24675
|
+
this._getWatchedDir(dir).remove(sysPath.basename(path6));
|
|
24625
24676
|
}
|
|
24626
|
-
_closeFile(
|
|
24627
|
-
const closers = this._closers.get(
|
|
24677
|
+
_closeFile(path6) {
|
|
24678
|
+
const closers = this._closers.get(path6);
|
|
24628
24679
|
if (!closers)
|
|
24629
24680
|
return;
|
|
24630
24681
|
closers.forEach((closer) => closer());
|
|
24631
|
-
this._closers.delete(
|
|
24682
|
+
this._closers.delete(path6);
|
|
24632
24683
|
}
|
|
24633
|
-
_addPathCloser(
|
|
24684
|
+
_addPathCloser(path6, closer) {
|
|
24634
24685
|
if (!closer)
|
|
24635
24686
|
return;
|
|
24636
|
-
let list = this._closers.get(
|
|
24687
|
+
let list = this._closers.get(path6);
|
|
24637
24688
|
if (!list) {
|
|
24638
24689
|
list = [];
|
|
24639
|
-
this._closers.set(
|
|
24690
|
+
this._closers.set(path6, list);
|
|
24640
24691
|
}
|
|
24641
24692
|
list.push(closer);
|
|
24642
24693
|
}
|
|
@@ -24682,7 +24733,7 @@ var require_node_loaders = __commonJS((exports, module) => {
|
|
|
24682
24733
|
return _setPrototypeOf(o, p);
|
|
24683
24734
|
}
|
|
24684
24735
|
var fs2 = __require("fs");
|
|
24685
|
-
var
|
|
24736
|
+
var path6 = __require("path");
|
|
24686
24737
|
var Loader = require_loader2();
|
|
24687
24738
|
var _require = require_precompiled_loader();
|
|
24688
24739
|
var PrecompiledLoader = _require.PrecompiledLoader;
|
|
@@ -24700,7 +24751,7 @@ var require_node_loaders = __commonJS((exports, module) => {
|
|
|
24700
24751
|
_this.noCache = !!opts.noCache;
|
|
24701
24752
|
if (searchPaths) {
|
|
24702
24753
|
searchPaths = Array.isArray(searchPaths) ? searchPaths : [searchPaths];
|
|
24703
|
-
_this.searchPaths = searchPaths.map(
|
|
24754
|
+
_this.searchPaths = searchPaths.map(path6.normalize);
|
|
24704
24755
|
} else {
|
|
24705
24756
|
_this.searchPaths = ["."];
|
|
24706
24757
|
}
|
|
@@ -24713,7 +24764,7 @@ var require_node_loaders = __commonJS((exports, module) => {
|
|
|
24713
24764
|
var paths = _this.searchPaths.filter(fs2.existsSync);
|
|
24714
24765
|
var watcher = chokidar.watch(paths);
|
|
24715
24766
|
watcher.on("all", function(event, fullname) {
|
|
24716
|
-
fullname =
|
|
24767
|
+
fullname = path6.resolve(fullname);
|
|
24717
24768
|
if (event === "change" && fullname in _this.pathsToNames) {
|
|
24718
24769
|
_this.emit("update", _this.pathsToNames[fullname], fullname);
|
|
24719
24770
|
}
|
|
@@ -24729,8 +24780,8 @@ var require_node_loaders = __commonJS((exports, module) => {
|
|
|
24729
24780
|
var fullpath = null;
|
|
24730
24781
|
var paths = this.searchPaths;
|
|
24731
24782
|
for (var i = 0;i < paths.length; i++) {
|
|
24732
|
-
var basePath =
|
|
24733
|
-
var p =
|
|
24783
|
+
var basePath = path6.resolve(paths[i]);
|
|
24784
|
+
var p = path6.resolve(paths[i], name);
|
|
24734
24785
|
if (p.indexOf(basePath) === 0 && fs2.existsSync(p)) {
|
|
24735
24786
|
fullpath = p;
|
|
24736
24787
|
break;
|
|
@@ -24979,13 +25030,13 @@ var require_globals = __commonJS((exports, module) => {
|
|
|
24979
25030
|
|
|
24980
25031
|
// node_modules/nunjucks/src/express-app.js
|
|
24981
25032
|
var require_express_app = __commonJS((exports, module) => {
|
|
24982
|
-
var
|
|
25033
|
+
var path6 = __require("path");
|
|
24983
25034
|
module.exports = function express(env, app) {
|
|
24984
25035
|
function NunjucksView(name, opts) {
|
|
24985
25036
|
this.name = name;
|
|
24986
25037
|
this.path = name;
|
|
24987
25038
|
this.defaultEngine = opts.defaultEngine;
|
|
24988
|
-
this.ext =
|
|
25039
|
+
this.ext = path6.extname(name);
|
|
24989
25040
|
if (!this.ext && !this.defaultEngine) {
|
|
24990
25041
|
throw new Error("No default engine was specified and no extension was provided.");
|
|
24991
25042
|
}
|
|
@@ -25362,7 +25413,7 @@ var require_environment = __commonJS((exports, module) => {
|
|
|
25362
25413
|
return _Obj2.apply(this, arguments) || this;
|
|
25363
25414
|
}
|
|
25364
25415
|
var _proto3 = Template2.prototype;
|
|
25365
|
-
_proto3.init = function init(src, env,
|
|
25416
|
+
_proto3.init = function init(src, env, path6, eagerCompile) {
|
|
25366
25417
|
this.env = env || new Environment;
|
|
25367
25418
|
if (lib.isObject(src)) {
|
|
25368
25419
|
switch (src.type) {
|
|
@@ -25380,7 +25431,7 @@ var require_environment = __commonJS((exports, module) => {
|
|
|
25380
25431
|
} else {
|
|
25381
25432
|
throw new Error("src must be a string or an object describing the source");
|
|
25382
25433
|
}
|
|
25383
|
-
this.path =
|
|
25434
|
+
this.path = path6;
|
|
25384
25435
|
if (eagerCompile) {
|
|
25385
25436
|
try {
|
|
25386
25437
|
this._compile();
|
|
@@ -25530,7 +25581,7 @@ var require_precompile_global = __commonJS((exports, module) => {
|
|
|
25530
25581
|
// node_modules/nunjucks/src/precompile.js
|
|
25531
25582
|
var require_precompile = __commonJS((exports, module) => {
|
|
25532
25583
|
var fs2 = __require("fs");
|
|
25533
|
-
var
|
|
25584
|
+
var path6 = __require("path");
|
|
25534
25585
|
var _require = require_lib7();
|
|
25535
25586
|
var _prettifyError = _require._prettifyError;
|
|
25536
25587
|
var compiler = require_compiler();
|
|
@@ -25567,8 +25618,8 @@ var require_precompile = __commonJS((exports, module) => {
|
|
|
25567
25618
|
var templates = [];
|
|
25568
25619
|
function addTemplates(dir) {
|
|
25569
25620
|
fs2.readdirSync(dir).forEach(function(file) {
|
|
25570
|
-
var filepath =
|
|
25571
|
-
var subpath = filepath.substr(
|
|
25621
|
+
var filepath = path6.join(dir, file);
|
|
25622
|
+
var subpath = filepath.substr(path6.join(input, "/").length);
|
|
25572
25623
|
var stat = fs2.statSync(filepath);
|
|
25573
25624
|
if (stat && stat.isDirectory()) {
|
|
25574
25625
|
subpath += "/";
|
|
@@ -25585,7 +25636,7 @@ var require_precompile = __commonJS((exports, module) => {
|
|
|
25585
25636
|
} else if (pathStats.isDirectory()) {
|
|
25586
25637
|
addTemplates(input);
|
|
25587
25638
|
for (var i = 0;i < templates.length; i++) {
|
|
25588
|
-
var name = templates[i].replace(
|
|
25639
|
+
var name = templates[i].replace(path6.join(input, "/"), "");
|
|
25589
25640
|
try {
|
|
25590
25641
|
precompiled.push(_precompile(fs2.readFileSync(templates[i], "utf-8"), name, env));
|
|
25591
25642
|
} catch (e) {
|
|
@@ -25957,11 +26008,11 @@ var require_nunjucks = __commonJS((exports, module) => {
|
|
|
25957
26008
|
reset: function reset() {
|
|
25958
26009
|
e = undefined;
|
|
25959
26010
|
},
|
|
25960
|
-
compile: function compile(src, env,
|
|
26011
|
+
compile: function compile(src, env, path6, eagerCompile) {
|
|
25961
26012
|
if (!e) {
|
|
25962
26013
|
configure();
|
|
25963
26014
|
}
|
|
25964
|
-
return new Template(src, env,
|
|
26015
|
+
return new Template(src, env, path6, eagerCompile);
|
|
25965
26016
|
},
|
|
25966
26017
|
render: function render(name, ctx, cb) {
|
|
25967
26018
|
if (!e) {
|
|
@@ -25979,57 +26030,39 @@ var require_nunjucks = __commonJS((exports, module) => {
|
|
|
25979
26030
|
precompileString: precompile ? precompile.precompileString : undefined
|
|
25980
26031
|
};
|
|
25981
26032
|
});
|
|
25982
|
-
|
|
25983
|
-
|
|
25984
|
-
|
|
25985
|
-
|
|
25986
|
-
|
|
25987
|
-
|
|
25988
|
-
|
|
25989
|
-
|
|
25990
|
-
|
|
25991
|
-
|
|
25992
|
-
|
|
25993
|
-
|
|
25994
|
-
|
|
25995
|
-
|
|
25996
|
-
|
|
25997
|
-
|
|
25998
|
-
|
|
25999
|
-
|
|
26000
|
-
|
|
26001
|
-
|
|
26002
|
-
|
|
26003
|
-
|
|
26004
|
-
|
|
26005
|
-
|
|
26006
|
-
|
|
26007
|
-
|
|
26008
|
-
|
|
26009
|
-
|
|
26010
|
-
|
|
26011
|
-
|
|
26012
|
-
|
|
26013
|
-
|
|
26014
|
-
|
|
26015
|
-
if (options2.strict) {
|
|
26016
|
-
slug = slug.replace(/[^A-Za-z0-9\s]/g, "");
|
|
26017
|
-
}
|
|
26018
|
-
if (trim) {
|
|
26019
|
-
slug = slug.trim();
|
|
26020
|
-
}
|
|
26021
|
-
slug = slug.replace(/\s+/g, replacement);
|
|
26022
|
-
if (options2.lower) {
|
|
26023
|
-
slug = slug.toLowerCase();
|
|
26024
|
-
}
|
|
26025
|
-
return slug;
|
|
26026
|
-
}
|
|
26027
|
-
replace.extend = function(customMap) {
|
|
26028
|
-
Object.assign(charMap, customMap);
|
|
26029
|
-
};
|
|
26030
|
-
return replace;
|
|
26031
|
-
});
|
|
26032
|
-
});
|
|
26033
|
+
// src/constants.ts
|
|
26034
|
+
var PAGINATION = {
|
|
26035
|
+
DEFAULT_PAGE_SIZE: 10,
|
|
26036
|
+
BATCH_SIZE: 10,
|
|
26037
|
+
RSS_FEED_LIMIT: 40
|
|
26038
|
+
};
|
|
26039
|
+
var FILES = {
|
|
26040
|
+
WRITE_BUFFER_SIZE: 1024 * 1024,
|
|
26041
|
+
MAX_SITEMAP_SIZE: 40000,
|
|
26042
|
+
MAX_SITEMAP_URLS: 1000
|
|
26043
|
+
};
|
|
26044
|
+
var SEO = {
|
|
26045
|
+
NOINDEX_AFTER_PAGE: 2
|
|
26046
|
+
};
|
|
26047
|
+
var CACHE = {
|
|
26048
|
+
ONE_MONTH_MS: 30 * 24 * 60 * 60 * 1000
|
|
26049
|
+
};
|
|
26050
|
+
var DATE = {
|
|
26051
|
+
MONTHS: [
|
|
26052
|
+
"January",
|
|
26053
|
+
"February",
|
|
26054
|
+
"March",
|
|
26055
|
+
"April",
|
|
26056
|
+
"May",
|
|
26057
|
+
"June",
|
|
26058
|
+
"July",
|
|
26059
|
+
"August",
|
|
26060
|
+
"September",
|
|
26061
|
+
"October",
|
|
26062
|
+
"November",
|
|
26063
|
+
"December"
|
|
26064
|
+
]
|
|
26065
|
+
};
|
|
26033
26066
|
// src/parser.ts
|
|
26034
26067
|
import path2 from "path";
|
|
26035
26068
|
|
|
@@ -26113,6 +26146,14 @@ async function copyFile(sourcePath, targetPath) {
|
|
|
26113
26146
|
throw error;
|
|
26114
26147
|
}
|
|
26115
26148
|
}
|
|
26149
|
+
async function getFileMtime(filePath) {
|
|
26150
|
+
try {
|
|
26151
|
+
const stat = await Bun.file(filePath).stat();
|
|
26152
|
+
return stat?.mtime?.getTime() ?? null;
|
|
26153
|
+
} catch {
|
|
26154
|
+
return null;
|
|
26155
|
+
}
|
|
26156
|
+
}
|
|
26116
26157
|
|
|
26117
26158
|
// src/utils/markdown-utils.ts
|
|
26118
26159
|
var import_gray_matter = __toESM(require_gray_matter(), 1);
|
|
@@ -30554,6 +30595,8 @@ var import_sanitize_html = __toESM(require_sanitize_html(), 1);
|
|
|
30554
30595
|
// src/utils/markdown/constants.ts
|
|
30555
30596
|
var RELATIVE_LINK_REGEX = /^(\.\.\/)+(\d{4})\/([a-zA-Z0-9_-]+?)(?:\.md)?(?:\/)?(#[^#]*)?$/;
|
|
30556
30597
|
var IMAGE_PATH_REGEX = /^\.\.\/\.\.\/assets\/(\d{4})\/([^/]+)\/(.+)$/;
|
|
30598
|
+
var IMAGE_PATH_ASSETS_DIR = /^\.\.\/\_assets\/(.+)$/;
|
|
30599
|
+
var IMAGE_PATH_ASSETS_SAME_DIR = /^\.\/\_assets\/(.+)$/;
|
|
30557
30600
|
var YOUTUBE_EMBED_REGEX = /<a href="(https?:\/\/(www\.)?(youtube\.com\/watch\?v=|youtu\.be\/)([\w-]+)[^"]*)"[^>]*>(.*?)<\/a>/g;
|
|
30558
30601
|
var EXTERNAL_LINK_REGEX = /<a href="(https?:\/\/|\/\/)([^"]+)"/g;
|
|
30559
30602
|
var SCHEMA_ORG_PLACE_TYPES = new Set([
|
|
@@ -30613,12 +30656,25 @@ function setNoFollowExceptions(exceptions) {
|
|
|
30613
30656
|
noFollowExceptions = new Set(exceptions.map((domain) => domain.toLowerCase().replace(/^www\./, "")));
|
|
30614
30657
|
}
|
|
30615
30658
|
function transformImagePath(relativePath, config) {
|
|
30616
|
-
const
|
|
30617
|
-
if (
|
|
30618
|
-
|
|
30619
|
-
|
|
30620
|
-
|
|
30621
|
-
|
|
30659
|
+
const legacyMatch = relativePath.match(IMAGE_PATH_REGEX);
|
|
30660
|
+
if (legacyMatch) {
|
|
30661
|
+
const [, year, slug, filename] = legacyMatch;
|
|
30662
|
+
const path2 = config.pathPattern.replace("{year}", year).replace("{slug}", slug).replace("{filename}", filename);
|
|
30663
|
+
return `${config.baseUrl}/${path2}`;
|
|
30664
|
+
}
|
|
30665
|
+
const assetsDirMatch = relativePath.match(IMAGE_PATH_ASSETS_DIR);
|
|
30666
|
+
if (assetsDirMatch && config.postYear) {
|
|
30667
|
+
const [, filename] = assetsDirMatch;
|
|
30668
|
+
const path2 = config.pathPattern.replace("{year}", config.postYear).replace("{slug}", "").replace("{filename}", filename).replace(/\/+/g, "/").replace(/^\//, "");
|
|
30669
|
+
return `${config.baseUrl}/${path2}`;
|
|
30670
|
+
}
|
|
30671
|
+
const assetsSameDirMatch = relativePath.match(IMAGE_PATH_ASSETS_SAME_DIR);
|
|
30672
|
+
if (assetsSameDirMatch && config.postYear) {
|
|
30673
|
+
const [, filename] = assetsSameDirMatch;
|
|
30674
|
+
const path2 = config.pathPattern.replace("{year}", config.postYear).replace("{slug}", "").replace("{filename}", filename).replace(/\/+/g, "/").replace(/^\//, "");
|
|
30675
|
+
return `${config.baseUrl}/${path2}`;
|
|
30676
|
+
}
|
|
30677
|
+
return null;
|
|
30622
30678
|
}
|
|
30623
30679
|
function createMarked(cdnConfig) {
|
|
30624
30680
|
const marked = new B(markedHighlight({
|
|
@@ -30658,7 +30714,7 @@ function createMarked(cdnConfig) {
|
|
|
30658
30714
|
}
|
|
30659
30715
|
if (token.type === "image" && cdnConfig?.enabled) {
|
|
30660
30716
|
const href = token.href || "";
|
|
30661
|
-
if (href.startsWith("../../assets/")) {
|
|
30717
|
+
if (href.startsWith("../../assets/") || href.startsWith("../_assets/") || href.startsWith("./_assets/")) {
|
|
30662
30718
|
const transformed = transformImagePath(href, cdnConfig);
|
|
30663
30719
|
if (transformed) {
|
|
30664
30720
|
token.href = transformed;
|
|
@@ -30907,9 +30963,10 @@ async function parseMarkdownFile(filePath, cdnConfig) {
|
|
|
30907
30963
|
}
|
|
30908
30964
|
}
|
|
30909
30965
|
const slug = getBaseFilename(filePath);
|
|
30910
|
-
const sanitizedHtml = convertMarkdownToHtml(content, cdnConfig);
|
|
30911
30966
|
const pacificDate = toPacificTime(data.date);
|
|
30912
30967
|
const postYear = getPacificYear(data.date);
|
|
30968
|
+
const cdnConfigWithYear = cdnConfig ? { ...cdnConfig, postYear: String(postYear) } : undefined;
|
|
30969
|
+
const sanitizedHtml = convertMarkdownToHtml(content, cdnConfigWithYear);
|
|
30913
30970
|
const post = {
|
|
30914
30971
|
title: data.title,
|
|
30915
30972
|
date: pacificDate.toISOString(),
|
|
@@ -31364,7 +31421,6 @@ async function startServer(outputDir = DEFAULT_OUTPUT_DIR, port = 3000) {
|
|
|
31364
31421
|
return server;
|
|
31365
31422
|
}
|
|
31366
31423
|
// src/site-generator.ts
|
|
31367
|
-
var import_nunjucks2 = __toESM(require_nunjucks(), 1);
|
|
31368
31424
|
var import_slugify = __toESM(require_slugify(), 1);
|
|
31369
31425
|
import path9 from "path";
|
|
31370
31426
|
|
|
@@ -31502,6 +31558,10 @@ function toScriptTag(jsonLd) {
|
|
|
31502
31558
|
${json2}
|
|
31503
31559
|
</script>`;
|
|
31504
31560
|
}
|
|
31561
|
+
function schemasToHtml(schemas) {
|
|
31562
|
+
return schemas.map((schema) => toScriptTag(schema)).join(`
|
|
31563
|
+
`);
|
|
31564
|
+
}
|
|
31505
31565
|
function extractFirstImageUrl(html, baseUrl) {
|
|
31506
31566
|
const imgMatch = html.match(/<img[^>]+src=["']([^"']+)["']/i);
|
|
31507
31567
|
if (!imgMatch || !imgMatch[1]) {
|
|
@@ -31545,13 +31605,9 @@ async function hashFile(filePath) {
|
|
|
31545
31605
|
return "";
|
|
31546
31606
|
}
|
|
31547
31607
|
}
|
|
31548
|
-
async function
|
|
31549
|
-
|
|
31550
|
-
|
|
31551
|
-
return stat?.mtime?.getTime() || 0;
|
|
31552
|
-
} catch (error) {
|
|
31553
|
-
return 0;
|
|
31554
|
-
}
|
|
31608
|
+
async function getFileMtime2(filePath) {
|
|
31609
|
+
const mtime = await getFileMtime(filePath);
|
|
31610
|
+
return mtime ?? 0;
|
|
31555
31611
|
}
|
|
31556
31612
|
async function loadCache(cwd) {
|
|
31557
31613
|
const cachePath = path5.join(cwd, CACHE_FILENAME);
|
|
@@ -31590,7 +31646,7 @@ async function hasFileChanged(filePath, cache) {
|
|
|
31590
31646
|
if (!cached) {
|
|
31591
31647
|
return true;
|
|
31592
31648
|
}
|
|
31593
|
-
const currentMtime = await
|
|
31649
|
+
const currentMtime = await getFileMtime2(filePath);
|
|
31594
31650
|
if (currentMtime !== cached.mtime) {
|
|
31595
31651
|
const currentHash = await hashFile(filePath);
|
|
31596
31652
|
return currentHash !== cached.hash;
|
|
@@ -31599,7 +31655,7 @@ async function hasFileChanged(filePath, cache) {
|
|
|
31599
31655
|
}
|
|
31600
31656
|
async function updateCacheEntry(filePath, cache, options2) {
|
|
31601
31657
|
const currentHash = await hashFile(filePath);
|
|
31602
|
-
const currentMtime = await
|
|
31658
|
+
const currentMtime = await getFileMtime2(filePath);
|
|
31603
31659
|
cache.files[filePath] = {
|
|
31604
31660
|
hash: currentHash,
|
|
31605
31661
|
mtime: currentMtime,
|
|
@@ -31785,7 +31841,7 @@ function formatRSSDate(date) {
|
|
|
31785
31841
|
return toPacificTime(date).toUTCString();
|
|
31786
31842
|
}
|
|
31787
31843
|
function generateRSSFeed(site, config) {
|
|
31788
|
-
const posts = site.posts.slice(0,
|
|
31844
|
+
const posts = site.posts.slice(0, PAGINATION.RSS_FEED_LIMIT);
|
|
31789
31845
|
const now = toPacificTime(new Date);
|
|
31790
31846
|
const latestPostDate = posts.length > 0 ? posts[0].date : now.toISOString();
|
|
31791
31847
|
const lastBuildDate = formatRSSDate(latestPostDate);
|
|
@@ -31855,8 +31911,7 @@ function generateSitemap(site, config, pageSize = 10) {
|
|
|
31855
31911
|
const postDate = new Date(post.date).toISOString();
|
|
31856
31912
|
const priority = calculateFreshnessPriority(post.date, 0.7, now);
|
|
31857
31913
|
const age = now - new Date(post.date).getTime();
|
|
31858
|
-
const
|
|
31859
|
-
const changefreq = age < ONE_MONTH ? "weekly" : "monthly";
|
|
31914
|
+
const changefreq = age < CACHE.ONE_MONTH_MS ? "weekly" : "monthly";
|
|
31860
31915
|
sitemapContent += buildSitemapUrl(postUrl, postDate, changefreq, priority);
|
|
31861
31916
|
}
|
|
31862
31917
|
sitemapContent += buildSitemapUrl(`${config.baseUrl}/tags/`, currentDate, "weekly", 0.5);
|
|
@@ -31917,6 +31972,33 @@ Sitemap: ${config.baseUrl}/sitemap.xml
|
|
|
31917
31972
|
// src/generators/pages.ts
|
|
31918
31973
|
var import_nunjucks = __toESM(require_nunjucks(), 1);
|
|
31919
31974
|
import path6 from "path";
|
|
31975
|
+
|
|
31976
|
+
// src/utils/schema-factory.ts
|
|
31977
|
+
function generateCollectionSchemas(config, options2) {
|
|
31978
|
+
const schemas = [
|
|
31979
|
+
generateCollectionPageSchema({
|
|
31980
|
+
title: options2.title,
|
|
31981
|
+
description: options2.description,
|
|
31982
|
+
url: options2.url,
|
|
31983
|
+
posts: options2.posts,
|
|
31984
|
+
site: config
|
|
31985
|
+
}),
|
|
31986
|
+
generateBreadcrumbListSchema({
|
|
31987
|
+
site: config,
|
|
31988
|
+
items: options2.breadcrumbs
|
|
31989
|
+
})
|
|
31990
|
+
];
|
|
31991
|
+
return schemasToHtml(schemas);
|
|
31992
|
+
}
|
|
31993
|
+
function generateHomeBreadcrumbs(config) {
|
|
31994
|
+
const schema = generateBreadcrumbListSchema({
|
|
31995
|
+
site: config,
|
|
31996
|
+
items: [{ name: "Home", url: `${config.baseUrl}/` }]
|
|
31997
|
+
});
|
|
31998
|
+
return schemasToHtml([schema]);
|
|
31999
|
+
}
|
|
32000
|
+
|
|
32001
|
+
// src/generators/pages.ts
|
|
31920
32002
|
function getSortedTags(tags, limit) {
|
|
31921
32003
|
const sorted = Object.values(tags).sort((a, b2) => b2.count - a.count);
|
|
31922
32004
|
return limit ? sorted.slice(0, limit) : sorted;
|
|
@@ -31927,7 +32009,7 @@ async function writeHtmlFile(outputDir, relativePath, content) {
|
|
|
31927
32009
|
await ensureDir(dir);
|
|
31928
32010
|
await Bun.write(fullPath, content);
|
|
31929
32011
|
}
|
|
31930
|
-
async function generateIndexPages(site, config, outputDir, pageSize =
|
|
32012
|
+
async function generateIndexPages(site, config, outputDir, pageSize = PAGINATION.DEFAULT_PAGE_SIZE) {
|
|
31931
32013
|
const totalPages = getTotalPages(site.posts.length, pageSize);
|
|
31932
32014
|
for (let page = 1;page <= totalPages; page++) {
|
|
31933
32015
|
const paginatedPosts = getPaginatedItems(site.posts, page, pageSize);
|
|
@@ -31935,8 +32017,7 @@ async function generateIndexPages(site, config, outputDir, pageSize = 10) {
|
|
|
31935
32017
|
let jsonLd = "";
|
|
31936
32018
|
if (page === 1) {
|
|
31937
32019
|
const schemas = generateHomePageSchemas({ site: config });
|
|
31938
|
-
jsonLd = schemas
|
|
31939
|
-
`);
|
|
32020
|
+
jsonLd = schemasToHtml(schemas);
|
|
31940
32021
|
}
|
|
31941
32022
|
const pageHtml = import_nunjucks.default.render("index.njk", {
|
|
31942
32023
|
site: config,
|
|
@@ -31944,16 +32025,15 @@ async function generateIndexPages(site, config, outputDir, pageSize = 10) {
|
|
|
31944
32025
|
tags: getSortedTags(site.tags, config.maxTagsOnHomepage),
|
|
31945
32026
|
pagination,
|
|
31946
32027
|
jsonLd,
|
|
31947
|
-
noindex: page >
|
|
32028
|
+
noindex: page > SEO.NOINDEX_AFTER_PAGE
|
|
31948
32029
|
});
|
|
31949
32030
|
const outputPath = page === 1 ? "index.html" : `page/${page}/index.html`;
|
|
31950
32031
|
await writeHtmlFile(outputDir, outputPath, pageHtml);
|
|
31951
32032
|
}
|
|
31952
32033
|
}
|
|
31953
32034
|
async function generatePostPages(site, config, outputDir) {
|
|
31954
|
-
|
|
31955
|
-
|
|
31956
|
-
const batch = site.posts.slice(i, i + batchSize);
|
|
32035
|
+
for (let i = 0;i < site.posts.length; i += PAGINATION.BATCH_SIZE) {
|
|
32036
|
+
const batch = site.posts.slice(i, i + PAGINATION.BATCH_SIZE);
|
|
31957
32037
|
await Promise.all(batch.map(async (post) => {
|
|
31958
32038
|
const postPath = post.url.substring(1);
|
|
31959
32039
|
const postHtml = import_nunjucks.default.render("post.njk", {
|
|
@@ -31965,7 +32045,7 @@ async function generatePostPages(site, config, outputDir) {
|
|
|
31965
32045
|
}));
|
|
31966
32046
|
}
|
|
31967
32047
|
}
|
|
31968
|
-
async function generateTagPages(site, config, outputDir, pageSize =
|
|
32048
|
+
async function generateTagPages(site, config, outputDir, pageSize = PAGINATION.DEFAULT_PAGE_SIZE) {
|
|
31969
32049
|
const tagIndexHtml = import_nunjucks.default.render("tags.njk", {
|
|
31970
32050
|
site: config,
|
|
31971
32051
|
tags: getSortedTags(site.tags)
|
|
@@ -31980,36 +32060,25 @@ async function generateTagPages(site, config, outputDir, pageSize = 10) {
|
|
|
31980
32060
|
posts: paginatedPosts
|
|
31981
32061
|
};
|
|
31982
32062
|
const pagination = createPagination(tagData.posts, page, pageSize, `/tags/${tagData.slug}/`);
|
|
31983
|
-
|
|
31984
|
-
|
|
31985
|
-
|
|
31986
|
-
|
|
31987
|
-
|
|
31988
|
-
|
|
31989
|
-
|
|
31990
|
-
|
|
31991
|
-
|
|
31992
|
-
|
|
31993
|
-
|
|
31994
|
-
|
|
31995
|
-
|
|
31996
|
-
items: [
|
|
31997
|
-
{ name: "Home", url: `${config.baseUrl}/` },
|
|
31998
|
-
{
|
|
31999
|
-
name: tagName,
|
|
32000
|
-
url: `${config.baseUrl}/tags/${tagData.slug}/`
|
|
32001
|
-
}
|
|
32002
|
-
]
|
|
32003
|
-
}));
|
|
32004
|
-
jsonLd = schemas.map((schema) => toScriptTag(schema)).join(`
|
|
32005
|
-
`);
|
|
32006
|
-
}
|
|
32063
|
+
const jsonLd = page === 1 ? generateCollectionSchemas(config, {
|
|
32064
|
+
title: tagName,
|
|
32065
|
+
description: tagData.description || `Articles tagged with ${tagName}`,
|
|
32066
|
+
url: `${config.baseUrl}/tags/${tagData.slug}/`,
|
|
32067
|
+
posts: tagData.posts,
|
|
32068
|
+
breadcrumbs: [
|
|
32069
|
+
{ name: "Home", url: `${config.baseUrl}/` },
|
|
32070
|
+
{
|
|
32071
|
+
name: tagName,
|
|
32072
|
+
url: `${config.baseUrl}/tags/${tagData.slug}/`
|
|
32073
|
+
}
|
|
32074
|
+
]
|
|
32075
|
+
}) : "";
|
|
32007
32076
|
const tagPageHtml = import_nunjucks.default.render("tag.njk", {
|
|
32008
32077
|
site: config,
|
|
32009
32078
|
tag: paginatedTagData,
|
|
32010
32079
|
tags: Object.values(site.tags),
|
|
32011
32080
|
pagination,
|
|
32012
|
-
noindex: page >
|
|
32081
|
+
noindex: page > SEO.NOINDEX_AFTER_PAGE,
|
|
32013
32082
|
jsonLd
|
|
32014
32083
|
});
|
|
32015
32084
|
const outputPath = page === 1 ? `tags/${tagData.slug}/index.html` : `tags/${tagData.slug}/page/${page}/index.html`;
|
|
@@ -32017,39 +32086,29 @@ async function generateTagPages(site, config, outputDir, pageSize = 10) {
|
|
|
32017
32086
|
}
|
|
32018
32087
|
}
|
|
32019
32088
|
}
|
|
32020
|
-
async function generateYearArchives(site, config, outputDir, pageSize =
|
|
32089
|
+
async function generateYearArchives(site, config, outputDir, pageSize = PAGINATION.DEFAULT_PAGE_SIZE) {
|
|
32021
32090
|
for (const [year, yearPosts] of Object.entries(site.postsByYear)) {
|
|
32022
32091
|
const totalPages = getTotalPages(yearPosts.length, pageSize);
|
|
32023
32092
|
for (let page = 1;page <= totalPages; page++) {
|
|
32024
32093
|
const paginatedPosts = getPaginatedItems(yearPosts, page, pageSize);
|
|
32025
32094
|
const pagination = createPagination(yearPosts, page, pageSize, `/${year}/`);
|
|
32026
|
-
|
|
32027
|
-
|
|
32028
|
-
|
|
32029
|
-
|
|
32030
|
-
|
|
32031
|
-
|
|
32032
|
-
url: `${config.baseUrl}
|
|
32033
|
-
|
|
32034
|
-
|
|
32035
|
-
|
|
32036
|
-
schemas.push(generateBreadcrumbListSchema({
|
|
32037
|
-
site: config,
|
|
32038
|
-
items: [
|
|
32039
|
-
{ name: "Home", url: `${config.baseUrl}/` },
|
|
32040
|
-
{ name: year, url: `${config.baseUrl}/${year}/` }
|
|
32041
|
-
]
|
|
32042
|
-
}));
|
|
32043
|
-
jsonLd = schemas.map((schema) => toScriptTag(schema)).join(`
|
|
32044
|
-
`);
|
|
32045
|
-
}
|
|
32095
|
+
const jsonLd = page === 1 ? generateCollectionSchemas(config, {
|
|
32096
|
+
title: `Posts from ${year}`,
|
|
32097
|
+
description: `Articles published in ${year}`,
|
|
32098
|
+
url: `${config.baseUrl}/${year}/`,
|
|
32099
|
+
posts: yearPosts,
|
|
32100
|
+
breadcrumbs: [
|
|
32101
|
+
{ name: "Home", url: `${config.baseUrl}/` },
|
|
32102
|
+
{ name: year, url: `${config.baseUrl}/${year}/` }
|
|
32103
|
+
]
|
|
32104
|
+
}) : "";
|
|
32046
32105
|
const yearPageHtml = import_nunjucks.default.render("archive.njk", {
|
|
32047
32106
|
site: config,
|
|
32048
32107
|
posts: paginatedPosts,
|
|
32049
32108
|
tags: getSortedTags(site.tags, config.maxTagsOnHomepage),
|
|
32050
32109
|
year,
|
|
32051
32110
|
pagination,
|
|
32052
|
-
noindex: page >
|
|
32111
|
+
noindex: page > SEO.NOINDEX_AFTER_PAGE,
|
|
32053
32112
|
jsonLd
|
|
32054
32113
|
});
|
|
32055
32114
|
const outputPath = page === 1 ? `${year}/index.html` : `${year}/page/${page}/index.html`;
|
|
@@ -32333,6 +32392,36 @@ function displayMetrics(metrics) {
|
|
|
32333
32392
|
`);
|
|
32334
32393
|
}
|
|
32335
32394
|
|
|
32395
|
+
// src/utils/template-engine.ts
|
|
32396
|
+
var import_nunjucks2 = __toESM(require_nunjucks(), 1);
|
|
32397
|
+
function createTemplateEngine(templatesDir, watch = false) {
|
|
32398
|
+
const env = import_nunjucks2.default.configure(templatesDir, {
|
|
32399
|
+
autoescape: true,
|
|
32400
|
+
watch
|
|
32401
|
+
});
|
|
32402
|
+
env.addFilter("date", formatDate);
|
|
32403
|
+
return env;
|
|
32404
|
+
}
|
|
32405
|
+
function formatDate(date, format) {
|
|
32406
|
+
const d2 = toPacificTime(date);
|
|
32407
|
+
const month = DATE.MONTHS[d2.getMonth()];
|
|
32408
|
+
switch (format) {
|
|
32409
|
+
case "YYYY":
|
|
32410
|
+
return d2.getFullYear().toString();
|
|
32411
|
+
case "MMMM D, YYYY":
|
|
32412
|
+
return `${month} ${d2.getDate()}, ${d2.getFullYear()}`;
|
|
32413
|
+
case "MMMM D, YYYY h:mm A": {
|
|
32414
|
+
const hours = d2.getHours() % 12 || 12;
|
|
32415
|
+
const ampm = d2.getHours() >= 12 ? "PM" : "AM";
|
|
32416
|
+
return `${month} ${d2.getDate()}, ${d2.getFullYear()} @ ${hours} ${ampm}`;
|
|
32417
|
+
}
|
|
32418
|
+
default:
|
|
32419
|
+
return d2.toLocaleDateString("en-US", {
|
|
32420
|
+
timeZone: "America/Los_Angeles"
|
|
32421
|
+
});
|
|
32422
|
+
}
|
|
32423
|
+
}
|
|
32424
|
+
|
|
32336
32425
|
// src/site-generator.ts
|
|
32337
32426
|
class SiteGenerator {
|
|
32338
32427
|
options;
|
|
@@ -32349,40 +32438,7 @@ class SiteGenerator {
|
|
|
32349
32438
|
postsByYear: {}
|
|
32350
32439
|
};
|
|
32351
32440
|
this.metrics = new MetricsCollector;
|
|
32352
|
-
|
|
32353
|
-
autoescape: true,
|
|
32354
|
-
watch: false
|
|
32355
|
-
});
|
|
32356
|
-
env.addFilter("date", (date, format) => {
|
|
32357
|
-
const d2 = toPacificTime(date);
|
|
32358
|
-
const months = [
|
|
32359
|
-
"January",
|
|
32360
|
-
"February",
|
|
32361
|
-
"March",
|
|
32362
|
-
"April",
|
|
32363
|
-
"May",
|
|
32364
|
-
"June",
|
|
32365
|
-
"July",
|
|
32366
|
-
"August",
|
|
32367
|
-
"September",
|
|
32368
|
-
"October",
|
|
32369
|
-
"November",
|
|
32370
|
-
"December"
|
|
32371
|
-
];
|
|
32372
|
-
if (format === "YYYY") {
|
|
32373
|
-
return d2.getFullYear();
|
|
32374
|
-
} else if (format === "MMMM D, YYYY") {
|
|
32375
|
-
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()}`;
|
|
32376
|
-
} else if (format === "MMMM D, YYYY h:mm A") {
|
|
32377
|
-
const hours = d2.getHours() % 12 || 12;
|
|
32378
|
-
const ampm = d2.getHours() >= 12 ? "PM" : "AM";
|
|
32379
|
-
return `${months[d2.getMonth()]} ${d2.getDate()}, ${d2.getFullYear()} @ ${hours} ${ampm}`;
|
|
32380
|
-
} else {
|
|
32381
|
-
return d2.toLocaleDateString("en-US", {
|
|
32382
|
-
timeZone: "America/Los_Angeles"
|
|
32383
|
-
});
|
|
32384
|
-
}
|
|
32385
|
-
});
|
|
32441
|
+
createTemplateEngine(this.options.templatesDir);
|
|
32386
32442
|
}
|
|
32387
32443
|
enableIncrementalMode() {
|
|
32388
32444
|
this.incrementalMode = true;
|
|
@@ -32424,8 +32480,7 @@ class SiteGenerator {
|
|
|
32424
32480
|
site: this.options.config,
|
|
32425
32481
|
imageUrl: post.image
|
|
32426
32482
|
});
|
|
32427
|
-
post.jsonLd = schemas
|
|
32428
|
-
`);
|
|
32483
|
+
post.jsonLd = schemasToHtml(schemas);
|
|
32429
32484
|
post.tags.forEach((tagName) => {
|
|
32430
32485
|
const tagSlug = import_slugify.default(tagName, { lower: true, strict: true });
|
|
32431
32486
|
post.tagSlugs[tagName] = tagSlug;
|
|
@@ -32492,15 +32547,14 @@ class SiteGenerator {
|
|
|
32492
32547
|
}
|
|
32493
32548
|
}
|
|
32494
32549
|
async generateFeeds() {
|
|
32495
|
-
const pageSize = 10;
|
|
32496
32550
|
const rssContent = generateRSSFeed(this.site, this.options.config);
|
|
32497
32551
|
await Bun.write(path9.join(this.options.outputDir, "feed.xml"), rssContent);
|
|
32498
|
-
const sitemapContent = generateSitemap(this.site, this.options.config,
|
|
32552
|
+
const sitemapContent = generateSitemap(this.site, this.options.config, PAGINATION.DEFAULT_PAGE_SIZE);
|
|
32499
32553
|
await Bun.write(path9.join(this.options.outputDir, "sitemap.xml"), sitemapContent);
|
|
32500
32554
|
console.log("Generated sitemap.xml");
|
|
32501
32555
|
const urlCount = this.site.posts.length + Object.keys(this.site.tags).length + 10;
|
|
32502
32556
|
const sitemapSize = sitemapContent.length;
|
|
32503
|
-
if (urlCount >
|
|
32557
|
+
if (urlCount > FILES.MAX_SITEMAP_URLS || sitemapSize > FILES.MAX_SITEMAP_SIZE) {
|
|
32504
32558
|
const sitemapIndexContent = generateSitemapIndex(this.options.config);
|
|
32505
32559
|
await Bun.write(path9.join(this.options.outputDir, "sitemap_index.xml"), sitemapIndexContent);
|
|
32506
32560
|
console.log("Generated sitemap_index.xml");
|
|
@@ -32515,10 +32569,8 @@ class SiteGenerator {
|
|
|
32515
32569
|
const posts = await parseMarkdownDirectory(this.options.contentDir, strictMode, this.options.config.cdn);
|
|
32516
32570
|
if (this.cache) {
|
|
32517
32571
|
const allFiles2 = await findFilesByPattern("**/*.md", this.options.contentDir, true);
|
|
32518
|
-
const
|
|
32519
|
-
for (
|
|
32520
|
-
const filePath = allFiles2[i];
|
|
32521
|
-
const post = posts[i];
|
|
32572
|
+
const postsWithPaths = await parseMarkdownFiles(allFiles2, this.options.config.cdn);
|
|
32573
|
+
for (const { post, filePath } of postsWithPaths) {
|
|
32522
32574
|
await updateCacheEntry(filePath, this.cache, { post });
|
|
32523
32575
|
}
|
|
32524
32576
|
}
|
|
@@ -32678,14 +32730,14 @@ class S3Uploader {
|
|
|
32678
32730
|
await Promise.all(executing);
|
|
32679
32731
|
return results;
|
|
32680
32732
|
}
|
|
32681
|
-
async uploadImages(imagesDir, minYear) {
|
|
32733
|
+
async uploadImages(imagesDir, minYear, keyTransform) {
|
|
32682
32734
|
console.log(`[S3] Uploading all images from ${imagesDir} to bucket ${this.s3Config.bucket}...`);
|
|
32683
32735
|
if (minYear) {
|
|
32684
32736
|
console.log(`[S3] Filtering images from year ${minYear} onwards`);
|
|
32685
32737
|
}
|
|
32686
32738
|
const imageUrls = {};
|
|
32687
32739
|
try {
|
|
32688
|
-
const glob = new Bun.Glob("**/*.{jpg,jpeg,png,gif,webp,svg}");
|
|
32740
|
+
const glob = new Bun.Glob("**/*.{jpg,jpeg,png,gif,webp,svg,mp4}");
|
|
32689
32741
|
const files = [];
|
|
32690
32742
|
console.log(`[S3] Scanning directory ${imagesDir} for image files...`);
|
|
32691
32743
|
try {
|
|
@@ -32723,20 +32775,19 @@ class S3Uploader {
|
|
|
32723
32775
|
const uploadTasks = imageFiles.map((imageFile) => async () => {
|
|
32724
32776
|
try {
|
|
32725
32777
|
const imagePath = path10.join(imagesDir, imageFile);
|
|
32726
|
-
const
|
|
32778
|
+
const s3Key = keyTransform ? keyTransform(imageFile) : imageFile;
|
|
32727
32779
|
const file = Bun.file(imagePath);
|
|
32728
|
-
const contentType = file.type;
|
|
32729
32780
|
if (process.env.BUNKI_DRY_RUN === "true") {} else {
|
|
32730
|
-
const s3File = this.client.file(
|
|
32781
|
+
const s3File = this.client.file(s3Key);
|
|
32731
32782
|
await s3File.write(file);
|
|
32732
32783
|
}
|
|
32733
|
-
const imageUrl = this.getPublicUrl(
|
|
32734
|
-
imageUrls[
|
|
32784
|
+
const imageUrl = this.getPublicUrl(s3Key);
|
|
32785
|
+
imageUrls[s3Key] = imageUrl;
|
|
32735
32786
|
uploadedCount++;
|
|
32736
32787
|
if (uploadedCount % 10 === 0) {
|
|
32737
32788
|
console.log(`[S3] Progress: ${uploadedCount}/${imageFiles.length} images uploaded`);
|
|
32738
32789
|
}
|
|
32739
|
-
return { success: true, file:
|
|
32790
|
+
return { success: true, file: s3Key };
|
|
32740
32791
|
} catch (error) {
|
|
32741
32792
|
failedCount++;
|
|
32742
32793
|
console.error(`[S3] Error uploading ${imageFile}:`, error);
|
|
@@ -32758,9 +32809,12 @@ function createUploader(config) {
|
|
|
32758
32809
|
|
|
32759
32810
|
// src/utils/image-uploader.ts
|
|
32760
32811
|
var DEFAULT_IMAGES_DIR = path11.join(process.cwd(), "assets");
|
|
32812
|
+
var DEFAULT_CONTENT_DIR2 = path11.join(process.cwd(), "content");
|
|
32761
32813
|
async function uploadImages(options2 = {}) {
|
|
32762
32814
|
try {
|
|
32763
|
-
const
|
|
32815
|
+
const contentAssetsMode = options2.contentAssets === true;
|
|
32816
|
+
const defaultDir = contentAssetsMode ? DEFAULT_CONTENT_DIR2 : DEFAULT_IMAGES_DIR;
|
|
32817
|
+
const imagesDir = path11.resolve(options2.images || defaultDir);
|
|
32764
32818
|
if (!await fileExists(imagesDir)) {
|
|
32765
32819
|
console.log(`Creating images directory at ${imagesDir}...`);
|
|
32766
32820
|
await ensureDir(imagesDir);
|
|
@@ -32790,12 +32844,27 @@ async function uploadImages(options2 = {}) {
|
|
|
32790
32844
|
publicUrl: config.s3.publicUrl || config.publicUrl || ""
|
|
32791
32845
|
};
|
|
32792
32846
|
}
|
|
32793
|
-
|
|
32847
|
+
const assetsDir = options2.contentAssetsDir || config.contentAssets?.assetsDir || "_assets";
|
|
32848
|
+
if (contentAssetsMode) {
|
|
32849
|
+
if (config.contentAssets?.s3) {
|
|
32850
|
+
s3Config = {
|
|
32851
|
+
...config.contentAssets.s3,
|
|
32852
|
+
publicUrl: config.contentAssets.s3.publicUrl || s3Config.publicUrl
|
|
32853
|
+
};
|
|
32854
|
+
console.log(`[content-assets] Using dedicated S3 config (bucket: ${s3Config.bucket})`);
|
|
32855
|
+
}
|
|
32856
|
+
console.log(`Uploading content assets from ${imagesDir} to bucket ${s3Config.bucket}`);
|
|
32857
|
+
console.log(`[content-assets] S3 key: {year}/{filename} (/${assetsDir}/ stripped from path)`);
|
|
32858
|
+
} else {
|
|
32859
|
+
console.log(`Uploading images from ${imagesDir} to bucket ${s3Config.bucket}`);
|
|
32860
|
+
}
|
|
32794
32861
|
if (options2.minYear) {
|
|
32795
32862
|
console.log(`Filtering images from year ${options2.minYear} onwards`);
|
|
32796
32863
|
}
|
|
32864
|
+
const escapedDir = assetsDir.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
32865
|
+
const keyTransform = contentAssetsMode ? (filePath) => filePath.replace(new RegExp(`/${escapedDir}/`), "/") : undefined;
|
|
32797
32866
|
const uploader = createUploader(s3Config);
|
|
32798
|
-
const imageUrlMap = await uploader.uploadImages(imagesDir, options2.minYear);
|
|
32867
|
+
const imageUrlMap = await uploader.uploadImages(imagesDir, options2.minYear, keyTransform);
|
|
32799
32868
|
if (options2.outputJson) {
|
|
32800
32869
|
const outputFile = path11.resolve(options2.outputJson);
|
|
32801
32870
|
await Bun.write(outputFile, JSON.stringify(imageUrlMap, null, 2));
|
|
@@ -32825,19 +32894,27 @@ export {
|
|
|
32825
32894
|
parseMarkdownDirectory,
|
|
32826
32895
|
loadConfig,
|
|
32827
32896
|
getBaseFilename,
|
|
32897
|
+
generateHomeBreadcrumbs,
|
|
32898
|
+
generateCollectionSchemas,
|
|
32828
32899
|
findFilesByPattern,
|
|
32829
32900
|
fileExists,
|
|
32830
32901
|
extractExcerpt,
|
|
32831
32902
|
ensureDir,
|
|
32832
32903
|
createUploader,
|
|
32904
|
+
createTemplateEngine,
|
|
32833
32905
|
createDefaultConfig,
|
|
32834
32906
|
copyFile,
|
|
32835
32907
|
convertMarkdownToHtml,
|
|
32836
32908
|
configExists,
|
|
32837
32909
|
SiteGenerator,
|
|
32910
|
+
SEO,
|
|
32911
|
+
PAGINATION,
|
|
32912
|
+
FILES,
|
|
32838
32913
|
DEFAULT_TEMPLATES_DIR,
|
|
32839
32914
|
DEFAULT_OUTPUT_DIR,
|
|
32840
32915
|
DEFAULT_IMAGES_DIR,
|
|
32841
32916
|
DEFAULT_CONTENT_DIR,
|
|
32842
|
-
DEFAULT_CONFIG_FILE
|
|
32917
|
+
DEFAULT_CONFIG_FILE,
|
|
32918
|
+
DATE,
|
|
32919
|
+
CACHE
|
|
32843
32920
|
};
|