@forsakringskassan/vite-lib-config 1.7.13 → 1.8.0
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/bin/{build-vue-lib.js → build-vue-lib.mjs} +1 -1
- package/dist/api-extractor.js +69 -96
- package/dist/{cli.js → cli.mjs} +26 -29
- package/dist/tsdoc-metadata.json +1 -1
- package/dist/{vite.config.js → vite.config.cjs} +110 -158
- package/dist/vite.config.mjs +12518 -0
- package/package.json +7 -6
|
@@ -656,7 +656,6 @@ export { render, staticRenderFns }`;
|
|
|
656
656
|
return transformRequireToImport(result.code);
|
|
657
657
|
}
|
|
658
658
|
function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
|
659
|
-
var _a2, _b, _c, _d, _e;
|
|
660
659
|
const block = descriptor.template;
|
|
661
660
|
if (!block) {
|
|
662
661
|
return;
|
|
@@ -664,19 +663,19 @@ export { render, staticRenderFns }`;
|
|
|
664
663
|
const resolvedScript = getResolvedScript(descriptor, ssr);
|
|
665
664
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
666
665
|
const { id, filename } = descriptor;
|
|
667
|
-
let preprocessOptions = block.lang &&
|
|
666
|
+
let preprocessOptions = block.lang && options.template?.preprocessOptions;
|
|
668
667
|
if (block.lang === "pug") {
|
|
669
668
|
preprocessOptions = {
|
|
670
669
|
doctype: "html",
|
|
671
670
|
...preprocessOptions
|
|
672
671
|
};
|
|
673
672
|
}
|
|
674
|
-
const transformAssetUrls =
|
|
673
|
+
const transformAssetUrls = options.template?.transformAssetUrls ?? true;
|
|
675
674
|
let assetUrlOptions;
|
|
676
675
|
if (options.devServer) {
|
|
677
676
|
if (filename.startsWith(options.root)) {
|
|
678
677
|
assetUrlOptions = {
|
|
679
|
-
base: (
|
|
678
|
+
base: (options.devServer.config.server?.origin ?? "") + options.devServer.config.base + slash(path__default.relative(options.root, path__default.dirname(filename)))
|
|
680
679
|
};
|
|
681
680
|
}
|
|
682
681
|
} else if (transformAssetUrls !== false) {
|
|
@@ -693,7 +692,7 @@ export { render, staticRenderFns }`;
|
|
|
693
692
|
optimizeSSR: ssr,
|
|
694
693
|
transformAssetUrlsOptions: {
|
|
695
694
|
...assetUrlOptions,
|
|
696
|
-
...
|
|
695
|
+
...options.template?.transformAssetUrlsOptions
|
|
697
696
|
},
|
|
698
697
|
preprocessLang: block.lang,
|
|
699
698
|
preprocessOptions,
|
|
@@ -702,7 +701,7 @@ export { render, staticRenderFns }`;
|
|
|
702
701
|
compilerOptions: {
|
|
703
702
|
whitespace: "condense",
|
|
704
703
|
outputSourceRange: true,
|
|
705
|
-
...
|
|
704
|
+
...options.template?.compilerOptions,
|
|
706
705
|
scopeId: hasScoped ? `data-v-${id}` : void 0
|
|
707
706
|
}
|
|
708
707
|
};
|
|
@@ -722,7 +721,6 @@ export { render, staticRenderFns }`;
|
|
|
722
721
|
}
|
|
723
722
|
var directRequestRE = /(\?|&)direct\b/;
|
|
724
723
|
async function handleHotUpdate({ file, modules, read, server }, options) {
|
|
725
|
-
var _a2, _b, _c, _d;
|
|
726
724
|
const prevDescriptor = getDescriptor(file, options, false);
|
|
727
725
|
if (!prevDescriptor) {
|
|
728
726
|
return;
|
|
@@ -737,8 +735,8 @@ export { render, staticRenderFns }`;
|
|
|
737
735
|
const scriptChanged = hasScriptChanged(prevDescriptor, descriptor);
|
|
738
736
|
if (scriptChanged) {
|
|
739
737
|
let scriptModule;
|
|
740
|
-
if (
|
|
741
|
-
const scriptModuleRE = new RegExp(`type=script.*&lang.${
|
|
738
|
+
if (descriptor.scriptSetup?.lang && !descriptor.scriptSetup.src || descriptor.script?.lang && !descriptor.script.src) {
|
|
739
|
+
const scriptModuleRE = new RegExp(`type=script.*&lang.${descriptor.scriptSetup?.lang || descriptor.script?.lang}$`);
|
|
742
740
|
scriptModule = modules.find((m) => scriptModuleRE.test(m.url));
|
|
743
741
|
}
|
|
744
742
|
affectedModules.add(scriptModule || mainModule);
|
|
@@ -829,7 +827,7 @@ export { render, staticRenderFns }`;
|
|
|
829
827
|
return true;
|
|
830
828
|
}
|
|
831
829
|
const prevResolvedScript = getResolvedScript(prev, false);
|
|
832
|
-
const prevImports = prevResolvedScript
|
|
830
|
+
const prevImports = prevResolvedScript?.imports;
|
|
833
831
|
if (prevImports) {
|
|
834
832
|
return next.shouldForceReload(prevImports);
|
|
835
833
|
}
|
|
@@ -930,7 +928,6 @@ export default function normalizeComponent (
|
|
|
930
928
|
}
|
|
931
929
|
}`;
|
|
932
930
|
async function transformMain(code, filename, options, pluginContext, ssr) {
|
|
933
|
-
var _a2, _b, _c, _d, _e;
|
|
934
931
|
const { devServer, isProduction, devToolsEnabled } = options;
|
|
935
932
|
const prevDescriptor = getPrevDescriptor(filename);
|
|
936
933
|
const { descriptor, errors } = createDescriptor(filename, code, options);
|
|
@@ -977,7 +974,7 @@ var __component__ = /*#__PURE__*/__normalizer(
|
|
|
977
974
|
let resolvedMap = scriptMap;
|
|
978
975
|
output.push(`export default __component__.exports`);
|
|
979
976
|
let resolvedCode = output.join("\n");
|
|
980
|
-
if ((
|
|
977
|
+
if ((descriptor.script?.lang === "ts" || descriptor.scriptSetup?.lang === "ts") && !descriptor.script?.src) {
|
|
981
978
|
const { code: code2, map } = await vite.transformWithEsbuild(resolvedCode, filename, {
|
|
982
979
|
loader: "ts",
|
|
983
980
|
target: "esnext",
|
|
@@ -993,7 +990,7 @@ var __component__ = /*#__PURE__*/__normalizer(
|
|
|
993
990
|
},
|
|
994
991
|
meta: {
|
|
995
992
|
vite: {
|
|
996
|
-
lang:
|
|
993
|
+
lang: descriptor.script?.lang || descriptor.scriptSetup?.lang || "js"
|
|
997
994
|
}
|
|
998
995
|
}
|
|
999
996
|
};
|
|
@@ -1020,13 +1017,12 @@ var __component__ = /*#__PURE__*/__normalizer(
|
|
|
1020
1017
|
}
|
|
1021
1018
|
}
|
|
1022
1019
|
async function genScriptCode(descriptor, options, pluginContext, ssr) {
|
|
1023
|
-
var _a2;
|
|
1024
1020
|
let scriptCode = `const _sfc_main = {}`;
|
|
1025
1021
|
let map;
|
|
1026
1022
|
const script = resolveScript(descriptor, options, ssr);
|
|
1027
1023
|
if (script) {
|
|
1028
1024
|
if ((!script.lang || script.lang === "ts" && options.devServer) && !script.src) {
|
|
1029
|
-
const userPlugins =
|
|
1025
|
+
const userPlugins = options.script?.babelParserPlugins || [];
|
|
1030
1026
|
const defaultPlugins2 = script.lang === "ts" ? userPlugins.includes("decorators") ? ["typescript"] : ["typescript", "decorators-legacy"] : [];
|
|
1031
1027
|
scriptCode = options.compiler.rewriteDefault(script.content, "_sfc_main", [...defaultPlugins2, ...userPlugins]);
|
|
1032
1028
|
map = script.map;
|
|
@@ -1119,8 +1115,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
1119
1115
|
return code;
|
|
1120
1116
|
}
|
|
1121
1117
|
async function linkSrcToDescriptor(src, descriptor, pluginContext, scoped) {
|
|
1122
|
-
|
|
1123
|
-
const srcFile = ((_a2 = await pluginContext.resolve(src, descriptor.filename)) == null ? void 0 : _a2.id) || src;
|
|
1118
|
+
const srcFile = (await pluginContext.resolve(src, descriptor.filename))?.id || src;
|
|
1124
1119
|
setSrcDescriptor(srcFile.replace(/\?.*$/, ""), descriptor, scoped);
|
|
1125
1120
|
}
|
|
1126
1121
|
var ignoreList = ["id", "index", "src", "type", "lang", "module", "scoped"];
|
|
@@ -1211,13 +1206,12 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
1211
1206
|
return handleHotUpdate(ctx, options);
|
|
1212
1207
|
},
|
|
1213
1208
|
configResolved(config) {
|
|
1214
|
-
var _a2;
|
|
1215
1209
|
options = {
|
|
1216
1210
|
...options,
|
|
1217
1211
|
root: config.root,
|
|
1218
1212
|
isProduction: config.isProduction,
|
|
1219
1213
|
sourceMap: config.command === "build" ? !!config.build.sourcemap : true,
|
|
1220
|
-
cssDevSourcemap:
|
|
1214
|
+
cssDevSourcemap: config.css?.devSourcemap ?? false,
|
|
1221
1215
|
devToolsEnabled: !config.isProduction
|
|
1222
1216
|
};
|
|
1223
1217
|
if (!config.resolve.alias.some(({ find }) => find === "vue")) {
|
|
@@ -1242,7 +1236,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
1242
1236
|
}
|
|
1243
1237
|
},
|
|
1244
1238
|
load(id, opt) {
|
|
1245
|
-
const ssr =
|
|
1239
|
+
const ssr = opt?.ssr === true;
|
|
1246
1240
|
if (id === NORMALIZER_ID) {
|
|
1247
1241
|
return normalizerCode;
|
|
1248
1242
|
}
|
|
@@ -1274,7 +1268,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
1274
1268
|
}
|
|
1275
1269
|
},
|
|
1276
1270
|
async transform(code, id, opt) {
|
|
1277
|
-
const ssr =
|
|
1271
|
+
const ssr = opt?.ssr === true;
|
|
1278
1272
|
const { filename, query } = parseVueRequest(id);
|
|
1279
1273
|
if (query.raw) {
|
|
1280
1274
|
return;
|
|
@@ -1506,7 +1500,7 @@ var require_dist2 = __commonJS({
|
|
|
1506
1500
|
filename,
|
|
1507
1501
|
sourceMap,
|
|
1508
1502
|
// @ts-ignore only available in Vue 3.4+
|
|
1509
|
-
templateParseOptions: template
|
|
1503
|
+
templateParseOptions: template?.compilerOptions
|
|
1510
1504
|
});
|
|
1511
1505
|
const normalizedPath = slash(path__default.normalize(path__default.relative(root, filename)));
|
|
1512
1506
|
descriptor.id = getHash(normalizedPath + (isProduction ? source : ""));
|
|
@@ -1653,7 +1647,6 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1653
1647
|
return result;
|
|
1654
1648
|
}
|
|
1655
1649
|
function resolveTemplateCompilerOptions(descriptor, options, ssr) {
|
|
1656
|
-
var _a2, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
1657
1650
|
const block = descriptor.template;
|
|
1658
1651
|
if (!block) {
|
|
1659
1652
|
return;
|
|
@@ -1661,13 +1654,13 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1661
1654
|
const resolvedScript = getResolvedScript(descriptor, ssr);
|
|
1662
1655
|
const hasScoped = descriptor.styles.some((s) => s.scoped);
|
|
1663
1656
|
const { id, filename, cssVars } = descriptor;
|
|
1664
|
-
let transformAssetUrls =
|
|
1657
|
+
let transformAssetUrls = options.template?.transformAssetUrls;
|
|
1665
1658
|
let assetUrlOptions;
|
|
1666
1659
|
if (options.devServer) {
|
|
1667
1660
|
if (filename.startsWith(options.root)) {
|
|
1668
1661
|
const devBase = options.devServer.config.base;
|
|
1669
1662
|
assetUrlOptions = {
|
|
1670
|
-
base: (
|
|
1663
|
+
base: (options.devServer.config.server?.origin ?? "") + devBase + slash(path__default.relative(options.root, path__default.dirname(filename))),
|
|
1671
1664
|
includeAbsolute: !!devBase
|
|
1672
1665
|
};
|
|
1673
1666
|
}
|
|
@@ -1688,15 +1681,15 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1688
1681
|
} else {
|
|
1689
1682
|
transformAssetUrls = assetUrlOptions;
|
|
1690
1683
|
}
|
|
1691
|
-
let preprocessOptions = block.lang &&
|
|
1684
|
+
let preprocessOptions = block.lang && options.template?.preprocessOptions;
|
|
1692
1685
|
if (block.lang === "pug") {
|
|
1693
1686
|
preprocessOptions = {
|
|
1694
1687
|
doctype: "html",
|
|
1695
1688
|
...preprocessOptions
|
|
1696
1689
|
};
|
|
1697
1690
|
}
|
|
1698
|
-
const expressionPlugins =
|
|
1699
|
-
const lang =
|
|
1691
|
+
const expressionPlugins = options.template?.compilerOptions?.expressionPlugins || [];
|
|
1692
|
+
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
|
1700
1693
|
if (lang && /tsx?$/.test(lang) && !expressionPlugins.includes("typescript")) {
|
|
1701
1694
|
expressionPlugins.push("typescript");
|
|
1702
1695
|
}
|
|
@@ -1704,7 +1697,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1704
1697
|
...options.template,
|
|
1705
1698
|
id,
|
|
1706
1699
|
// @ts-ignore only available in vue 3.4+
|
|
1707
|
-
ast: canReuseAST(options.compiler.version) ?
|
|
1700
|
+
ast: canReuseAST(options.compiler.version) ? descriptor.template?.ast : void 0,
|
|
1708
1701
|
filename,
|
|
1709
1702
|
scoped: hasScoped,
|
|
1710
1703
|
slotted: descriptor.slotted,
|
|
@@ -1716,7 +1709,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1716
1709
|
preprocessLang: block.lang === "html" ? void 0 : block.lang,
|
|
1717
1710
|
preprocessOptions,
|
|
1718
1711
|
compilerOptions: {
|
|
1719
|
-
...
|
|
1712
|
+
...options.template?.compilerOptions,
|
|
1720
1713
|
scopeId: hasScoped ? `data-v-${id}` : void 0,
|
|
1721
1714
|
bindingMetadata: resolvedScript ? resolvedScript.bindings : void 0,
|
|
1722
1715
|
expressionPlugins,
|
|
@@ -1750,8 +1743,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1750
1743
|
(ssr ? ssrCache : clientCache).set(descriptor, script);
|
|
1751
1744
|
}
|
|
1752
1745
|
function isUseInlineTemplate(descriptor, isProd) {
|
|
1753
|
-
|
|
1754
|
-
return isProd && !!descriptor.scriptSetup && !((_a2 = descriptor.template) == null ? void 0 : _a2.src);
|
|
1746
|
+
return isProd && !!descriptor.scriptSetup && !descriptor.template?.src;
|
|
1755
1747
|
}
|
|
1756
1748
|
var scriptIdentifier = `_sfc_main`;
|
|
1757
1749
|
function resolveScript(descriptor, options, ssr, customElement) {
|
|
@@ -1775,7 +1767,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1775
1767
|
genDefaultAs: canInlineMain(descriptor, options) ? scriptIdentifier : void 0,
|
|
1776
1768
|
customElement
|
|
1777
1769
|
});
|
|
1778
|
-
if (!options.isProduction &&
|
|
1770
|
+
if (!options.isProduction && resolved?.deps) {
|
|
1779
1771
|
for (const [key, sfcs] of typeDepToSFCMap) {
|
|
1780
1772
|
if (sfcs.has(descriptor.filename) && !resolved.deps.includes(key)) {
|
|
1781
1773
|
sfcs.delete(descriptor.filename);
|
|
@@ -1794,11 +1786,10 @@ import.meta.hot.accept(({ render }) => {
|
|
|
1794
1786
|
return resolved;
|
|
1795
1787
|
}
|
|
1796
1788
|
function canInlineMain(descriptor, options) {
|
|
1797
|
-
|
|
1798
|
-
if (((_a2 = descriptor.script) == null ? void 0 : _a2.src) || ((_b = descriptor.scriptSetup) == null ? void 0 : _b.src)) {
|
|
1789
|
+
if (descriptor.script?.src || descriptor.scriptSetup?.src) {
|
|
1799
1790
|
return false;
|
|
1800
1791
|
}
|
|
1801
|
-
const lang =
|
|
1792
|
+
const lang = descriptor.script?.lang || descriptor.scriptSetup?.lang;
|
|
1802
1793
|
if (!lang || lang === "js") {
|
|
1803
1794
|
return true;
|
|
1804
1795
|
}
|
|
@@ -3166,7 +3157,7 @@ import.meta.hot.accept(({ render }) => {
|
|
|
3166
3157
|
return true;
|
|
3167
3158
|
}
|
|
3168
3159
|
const prevResolvedScript = getResolvedScript(prev, false);
|
|
3169
|
-
const prevImports = prevResolvedScript
|
|
3160
|
+
const prevImports = prevResolvedScript?.imports;
|
|
3170
3161
|
if (prevImports) {
|
|
3171
3162
|
return !next.template || next.shouldForceReload(prevImports);
|
|
3172
3163
|
}
|
|
@@ -3203,7 +3194,6 @@ export default (sfc, props) => {
|
|
|
3203
3194
|
}
|
|
3204
3195
|
`;
|
|
3205
3196
|
async function transformMain(code, filename, options, pluginContext, ssr, customElement) {
|
|
3206
|
-
var _a2, _b, _c, _d, _e, _f;
|
|
3207
3197
|
const { devServer, isProduction, devToolsEnabled } = options;
|
|
3208
3198
|
const prevDescriptor = getPrevDescriptor(filename);
|
|
3209
3199
|
const { descriptor, errors } = createDescriptor(filename, code, options);
|
|
@@ -3328,7 +3318,7 @@ export default (sfc, props) => {
|
|
|
3328
3318
|
// same above
|
|
3329
3319
|
templateMap
|
|
3330
3320
|
);
|
|
3331
|
-
const offset = (
|
|
3321
|
+
const offset = (scriptCode.match(/\r?\n/g)?.length ?? 0) + 1;
|
|
3332
3322
|
eachMapping(tracer, (m) => {
|
|
3333
3323
|
if (m.source == null)
|
|
3334
3324
|
return;
|
|
@@ -3356,8 +3346,8 @@ export default (sfc, props) => {
|
|
|
3356
3346
|
);
|
|
3357
3347
|
}
|
|
3358
3348
|
let resolvedCode = output.join("\n");
|
|
3359
|
-
const lang =
|
|
3360
|
-
if (lang && /tsx?$/.test(lang) && !
|
|
3349
|
+
const lang = descriptor.scriptSetup?.lang || descriptor.script?.lang;
|
|
3350
|
+
if (lang && /tsx?$/.test(lang) && !descriptor.script?.src) {
|
|
3361
3351
|
const { code: code2, map } = await vite.transformWithEsbuild(
|
|
3362
3352
|
resolvedCode,
|
|
3363
3353
|
filename,
|
|
@@ -3378,7 +3368,7 @@ export default (sfc, props) => {
|
|
|
3378
3368
|
},
|
|
3379
3369
|
meta: {
|
|
3380
3370
|
vite: {
|
|
3381
|
-
lang:
|
|
3371
|
+
lang: descriptor.script?.lang || descriptor.scriptSetup?.lang || "js"
|
|
3382
3372
|
}
|
|
3383
3373
|
}
|
|
3384
3374
|
};
|
|
@@ -3418,14 +3408,13 @@ export default (sfc, props) => {
|
|
|
3418
3408
|
}
|
|
3419
3409
|
}
|
|
3420
3410
|
async function genScriptCode(descriptor, options, pluginContext, ssr, customElement) {
|
|
3421
|
-
var _a2;
|
|
3422
3411
|
let scriptCode = `const ${scriptIdentifier} = {}`;
|
|
3423
3412
|
let map;
|
|
3424
3413
|
const script = resolveScript(descriptor, options, ssr, customElement);
|
|
3425
3414
|
if (script) {
|
|
3426
3415
|
if (canInlineMain(descriptor, options)) {
|
|
3427
3416
|
if (!options.compiler.version) {
|
|
3428
|
-
const userPlugins =
|
|
3417
|
+
const userPlugins = options.script?.babelParserPlugins || [];
|
|
3429
3418
|
const defaultPlugins2 = script.lang === "ts" ? userPlugins.includes("decorators") ? ["typescript"] : ["typescript", "decorators-legacy"] : [];
|
|
3430
3419
|
scriptCode = options.compiler.rewriteDefault(
|
|
3431
3420
|
script.content,
|
|
@@ -3550,8 +3539,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3550
3539
|
return code;
|
|
3551
3540
|
}
|
|
3552
3541
|
async function linkSrcToDescriptor(src2, descriptor, pluginContext, scoped) {
|
|
3553
|
-
|
|
3554
|
-
const srcFile = ((_a2 = await pluginContext.resolve(src2, descriptor.filename)) == null ? void 0 : _a2.id) || src2;
|
|
3542
|
+
const srcFile = (await pluginContext.resolve(src2, descriptor.filename))?.id || src2;
|
|
3555
3543
|
setSrcDescriptor(srcFile.replace(/\?.*$/, ""), descriptor, scoped);
|
|
3556
3544
|
}
|
|
3557
3545
|
var ignoreList = [
|
|
@@ -3666,29 +3654,27 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3666
3654
|
}
|
|
3667
3655
|
},
|
|
3668
3656
|
config(config) {
|
|
3669
|
-
var _a2, _b, _c, _d, _e;
|
|
3670
3657
|
return {
|
|
3671
3658
|
resolve: {
|
|
3672
|
-
dedupe:
|
|
3659
|
+
dedupe: config.build?.ssr ? [] : ["vue"]
|
|
3673
3660
|
},
|
|
3674
3661
|
define: {
|
|
3675
|
-
__VUE_OPTIONS_API__:
|
|
3676
|
-
__VUE_PROD_DEVTOOLS__:
|
|
3677
|
-
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__:
|
|
3662
|
+
__VUE_OPTIONS_API__: config.define?.__VUE_OPTIONS_API__ ?? true,
|
|
3663
|
+
__VUE_PROD_DEVTOOLS__: config.define?.__VUE_PROD_DEVTOOLS__ ?? false,
|
|
3664
|
+
__VUE_PROD_HYDRATION_MISMATCH_DETAILS__: config.define?.__VUE_PROD_HYDRATION_MISMATCH_DETAILS__ ?? false
|
|
3678
3665
|
},
|
|
3679
3666
|
ssr: {
|
|
3680
3667
|
// @ts-ignore -- config.legacy.buildSsrCjsExternalHeuristics will be removed in Vite 5
|
|
3681
|
-
external:
|
|
3668
|
+
external: config.legacy?.buildSsrCjsExternalHeuristics ? ["vue", "@vue/server-renderer"] : []
|
|
3682
3669
|
}
|
|
3683
3670
|
};
|
|
3684
3671
|
},
|
|
3685
3672
|
configResolved(config) {
|
|
3686
|
-
var _a2;
|
|
3687
3673
|
options.value = {
|
|
3688
3674
|
...options.value,
|
|
3689
3675
|
root: config.root,
|
|
3690
3676
|
sourceMap: config.command === "build" ? !!config.build.sourcemap : true,
|
|
3691
|
-
cssDevSourcemap:
|
|
3677
|
+
cssDevSourcemap: config.css?.devSourcemap ?? false,
|
|
3692
3678
|
isProduction: config.isProduction,
|
|
3693
3679
|
devToolsEnabled: !!config.define.__VUE_PROD_DEVTOOLS__ || !config.isProduction
|
|
3694
3680
|
};
|
|
@@ -3697,10 +3683,9 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3697
3683
|
options.value.devServer = server;
|
|
3698
3684
|
},
|
|
3699
3685
|
buildStart() {
|
|
3700
|
-
var _a2;
|
|
3701
3686
|
const compiler = options.value.compiler = options.value.compiler || resolveCompiler(options.value.root);
|
|
3702
3687
|
if (compiler.invalidateTypeCache) {
|
|
3703
|
-
|
|
3688
|
+
options.value.devServer?.watcher.on("unlink", (file) => {
|
|
3704
3689
|
compiler.invalidateTypeCache(file);
|
|
3705
3690
|
});
|
|
3706
3691
|
}
|
|
@@ -3714,7 +3699,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3714
3699
|
}
|
|
3715
3700
|
},
|
|
3716
3701
|
load(id, opt) {
|
|
3717
|
-
const ssr =
|
|
3702
|
+
const ssr = opt?.ssr === true;
|
|
3718
3703
|
if (id === EXPORT_HELPER_ID) {
|
|
3719
3704
|
return helperCode;
|
|
3720
3705
|
}
|
|
@@ -3743,7 +3728,7 @@ import ${styleVar} from ${JSON.stringify(moduleRequest)}`,
|
|
|
3743
3728
|
}
|
|
3744
3729
|
},
|
|
3745
3730
|
transform(code, id, opt) {
|
|
3746
|
-
const ssr =
|
|
3731
|
+
const ssr = opt?.ssr === true;
|
|
3747
3732
|
const { filename, query } = parseVueRequest(id);
|
|
3748
3733
|
if (query.raw || query.url) {
|
|
3749
3734
|
return;
|
|
@@ -5921,8 +5906,8 @@ function indexHtmlPlugin() {
|
|
|
5921
5906
|
}
|
|
5922
5907
|
},
|
|
5923
5908
|
transformIndexHtml: {
|
|
5924
|
-
|
|
5925
|
-
async
|
|
5909
|
+
order: "pre",
|
|
5910
|
+
async handler() {
|
|
5926
5911
|
const content = await import_promises.default.readFile(templateFile, "utf-8");
|
|
5927
5912
|
return content.replace(/{{([^}]+)}}/g, (match2, key) => {
|
|
5928
5913
|
return templateData[key.trim()] ?? match2;
|
|
@@ -5930,8 +5915,7 @@ function indexHtmlPlugin() {
|
|
|
5930
5915
|
}
|
|
5931
5916
|
},
|
|
5932
5917
|
config(config) {
|
|
5933
|
-
|
|
5934
|
-
if ((_a2 = config.fk) == null ? void 0 : _a2.entrypoint) {
|
|
5918
|
+
if (config.fk?.entrypoint) {
|
|
5935
5919
|
templateData.entrypoint = config.fk.entrypoint;
|
|
5936
5920
|
}
|
|
5937
5921
|
},
|
|
@@ -6196,20 +6180,18 @@ var AST = class _AST {
|
|
|
6196
6180
|
}
|
|
6197
6181
|
}
|
|
6198
6182
|
toJSON() {
|
|
6199
|
-
var _a2;
|
|
6200
6183
|
const ret = this.type === null ? this.#parts.slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...this.#parts.map((p) => p.toJSON())];
|
|
6201
6184
|
if (this.isStart() && !this.type)
|
|
6202
6185
|
ret.unshift([]);
|
|
6203
|
-
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs &&
|
|
6186
|
+
if (this.isEnd() && (this === this.#root || this.#root.#filledNegs && this.#parent?.type === "!")) {
|
|
6204
6187
|
ret.push({});
|
|
6205
6188
|
}
|
|
6206
6189
|
return ret;
|
|
6207
6190
|
}
|
|
6208
6191
|
isStart() {
|
|
6209
|
-
var _a2;
|
|
6210
6192
|
if (this.#root === this)
|
|
6211
6193
|
return true;
|
|
6212
|
-
if (!
|
|
6194
|
+
if (!this.#parent?.isStart())
|
|
6213
6195
|
return false;
|
|
6214
6196
|
if (this.#parentIndex === 0)
|
|
6215
6197
|
return true;
|
|
@@ -6223,15 +6205,14 @@ var AST = class _AST {
|
|
|
6223
6205
|
return true;
|
|
6224
6206
|
}
|
|
6225
6207
|
isEnd() {
|
|
6226
|
-
var _a2, _b, _c;
|
|
6227
6208
|
if (this.#root === this)
|
|
6228
6209
|
return true;
|
|
6229
|
-
if (
|
|
6210
|
+
if (this.#parent?.type === "!")
|
|
6230
6211
|
return true;
|
|
6231
|
-
if (!
|
|
6212
|
+
if (!this.#parent?.isEnd())
|
|
6232
6213
|
return false;
|
|
6233
6214
|
if (!this.type)
|
|
6234
|
-
return
|
|
6215
|
+
return this.#parent?.isEnd();
|
|
6235
6216
|
const pl = this.#parent ? this.#parent.#parts.length : 0;
|
|
6236
6217
|
return this.#parentIndex === pl - 1;
|
|
6237
6218
|
}
|
|
@@ -6447,7 +6428,6 @@ var AST = class _AST {
|
|
|
6447
6428
|
// is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
|
|
6448
6429
|
// or start or whatever) and prepend ^ or / at the Regexp construction.
|
|
6449
6430
|
toRegExpSource(allowDot) {
|
|
6450
|
-
var _a2;
|
|
6451
6431
|
const dot = allowDot ?? !!this.#options.dot;
|
|
6452
6432
|
if (this.#root === this)
|
|
6453
6433
|
this.#fillNegs();
|
|
@@ -6477,7 +6457,7 @@ var AST = class _AST {
|
|
|
6477
6457
|
}
|
|
6478
6458
|
}
|
|
6479
6459
|
let end = "";
|
|
6480
|
-
if (this.isEnd() && this.#root.#filledNegs &&
|
|
6460
|
+
if (this.isEnd() && this.#root.#filledNegs && this.#parent?.type === "!") {
|
|
6481
6461
|
end = "(?:$|\\/)";
|
|
6482
6462
|
}
|
|
6483
6463
|
const final2 = start2 + src + end;
|
|
@@ -7315,7 +7295,6 @@ var emitWarning = (msg, type, code, fn) => {
|
|
|
7315
7295
|
};
|
|
7316
7296
|
var AC = globalThis.AbortController;
|
|
7317
7297
|
var AS = globalThis.AbortSignal;
|
|
7318
|
-
var _a;
|
|
7319
7298
|
if (typeof AC === "undefined") {
|
|
7320
7299
|
AS = class AbortSignal {
|
|
7321
7300
|
onabort;
|
|
@@ -7332,7 +7311,6 @@ if (typeof AC === "undefined") {
|
|
|
7332
7311
|
}
|
|
7333
7312
|
signal = new AS();
|
|
7334
7313
|
abort(reason) {
|
|
7335
|
-
var _a2, _b;
|
|
7336
7314
|
if (this.signal.aborted)
|
|
7337
7315
|
return;
|
|
7338
7316
|
this.signal.reason = reason;
|
|
@@ -7340,10 +7318,10 @@ if (typeof AC === "undefined") {
|
|
|
7340
7318
|
for (const fn of this.signal._onabort) {
|
|
7341
7319
|
fn(reason);
|
|
7342
7320
|
}
|
|
7343
|
-
|
|
7321
|
+
this.signal.onabort?.(reason);
|
|
7344
7322
|
}
|
|
7345
7323
|
};
|
|
7346
|
-
let printACPolyfillWarning =
|
|
7324
|
+
let printACPolyfillWarning = PROCESS.env?.LRU_CACHE_IGNORE_AC_WARNING !== "1";
|
|
7347
7325
|
const warnACPolyfill = () => {
|
|
7348
7326
|
if (!printACPolyfillWarning)
|
|
7349
7327
|
return;
|
|
@@ -8036,7 +8014,6 @@ var LRUCache = class _LRUCache {
|
|
|
8036
8014
|
* {@link LRUCache#delete}
|
|
8037
8015
|
*/
|
|
8038
8016
|
set(k, v, setOptions = {}) {
|
|
8039
|
-
var _a2, _b, _c, _d, _e;
|
|
8040
8017
|
if (v === void 0) {
|
|
8041
8018
|
this.delete(k);
|
|
8042
8019
|
return this;
|
|
@@ -8075,18 +8052,18 @@ var LRUCache = class _LRUCache {
|
|
|
8075
8052
|
const { __staleWhileFetching: s } = oldVal;
|
|
8076
8053
|
if (s !== void 0 && !noDisposeOnSet) {
|
|
8077
8054
|
if (this.#hasDispose) {
|
|
8078
|
-
|
|
8055
|
+
this.#dispose?.(s, k, "set");
|
|
8079
8056
|
}
|
|
8080
8057
|
if (this.#hasDisposeAfter) {
|
|
8081
|
-
|
|
8058
|
+
this.#disposed?.push([s, k, "set"]);
|
|
8082
8059
|
}
|
|
8083
8060
|
}
|
|
8084
8061
|
} else if (!noDisposeOnSet) {
|
|
8085
8062
|
if (this.#hasDispose) {
|
|
8086
|
-
|
|
8063
|
+
this.#dispose?.(oldVal, k, "set");
|
|
8087
8064
|
}
|
|
8088
8065
|
if (this.#hasDisposeAfter) {
|
|
8089
|
-
|
|
8066
|
+
this.#disposed?.push([oldVal, k, "set"]);
|
|
8090
8067
|
}
|
|
8091
8068
|
}
|
|
8092
8069
|
this.#removeItemSize(index);
|
|
@@ -8115,8 +8092,8 @@ var LRUCache = class _LRUCache {
|
|
|
8115
8092
|
if (!noDisposeOnSet && this.#hasDisposeAfter && this.#disposed) {
|
|
8116
8093
|
const dt = this.#disposed;
|
|
8117
8094
|
let task;
|
|
8118
|
-
while (task = dt
|
|
8119
|
-
|
|
8095
|
+
while (task = dt?.shift()) {
|
|
8096
|
+
this.#disposeAfter?.(...task);
|
|
8120
8097
|
}
|
|
8121
8098
|
}
|
|
8122
8099
|
return this;
|
|
@@ -8126,7 +8103,6 @@ var LRUCache = class _LRUCache {
|
|
|
8126
8103
|
* `undefined` if cache is empty.
|
|
8127
8104
|
*/
|
|
8128
8105
|
pop() {
|
|
8129
|
-
var _a2;
|
|
8130
8106
|
try {
|
|
8131
8107
|
while (this.#size) {
|
|
8132
8108
|
const val = this.#valList[this.#head];
|
|
@@ -8143,14 +8119,13 @@ var LRUCache = class _LRUCache {
|
|
|
8143
8119
|
if (this.#hasDisposeAfter && this.#disposed) {
|
|
8144
8120
|
const dt = this.#disposed;
|
|
8145
8121
|
let task;
|
|
8146
|
-
while (task = dt
|
|
8147
|
-
|
|
8122
|
+
while (task = dt?.shift()) {
|
|
8123
|
+
this.#disposeAfter?.(...task);
|
|
8148
8124
|
}
|
|
8149
8125
|
}
|
|
8150
8126
|
}
|
|
8151
8127
|
}
|
|
8152
8128
|
#evict(free) {
|
|
8153
|
-
var _a2, _b;
|
|
8154
8129
|
const head = this.#head;
|
|
8155
8130
|
const k = this.#keyList[head];
|
|
8156
8131
|
const v = this.#valList[head];
|
|
@@ -8158,10 +8133,10 @@ var LRUCache = class _LRUCache {
|
|
|
8158
8133
|
v.__abortController.abort(new Error("evicted"));
|
|
8159
8134
|
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
8160
8135
|
if (this.#hasDispose) {
|
|
8161
|
-
|
|
8136
|
+
this.#dispose?.(v, k, "evict");
|
|
8162
8137
|
}
|
|
8163
8138
|
if (this.#hasDisposeAfter) {
|
|
8164
|
-
|
|
8139
|
+
this.#disposed?.push([v, k, "evict"]);
|
|
8165
8140
|
}
|
|
8166
8141
|
}
|
|
8167
8142
|
this.#removeItemSize(head);
|
|
@@ -8237,7 +8212,7 @@ var LRUCache = class _LRUCache {
|
|
|
8237
8212
|
}
|
|
8238
8213
|
const ac = new AC();
|
|
8239
8214
|
const { signal } = options;
|
|
8240
|
-
signal
|
|
8215
|
+
signal?.addEventListener("abort", () => ac.abort(signal.reason), {
|
|
8241
8216
|
signal: ac.signal
|
|
8242
8217
|
});
|
|
8243
8218
|
const fetchOpts = {
|
|
@@ -8308,8 +8283,7 @@ var LRUCache = class _LRUCache {
|
|
|
8308
8283
|
}
|
|
8309
8284
|
};
|
|
8310
8285
|
const pcall = (res, rej) => {
|
|
8311
|
-
|
|
8312
|
-
const fmp = (_a2 = this.#fetchMethod) == null ? void 0 : _a2.call(this, k, v, fetchOpts);
|
|
8286
|
+
const fmp = this.#fetchMethod?.(k, v, fetchOpts);
|
|
8313
8287
|
if (fmp && fmp instanceof Promise) {
|
|
8314
8288
|
fmp.then((v2) => res(v2 === void 0 ? void 0 : v2), rej);
|
|
8315
8289
|
}
|
|
@@ -8498,7 +8472,6 @@ var LRUCache = class _LRUCache {
|
|
|
8498
8472
|
* Returns true if the key was deleted, false otherwise.
|
|
8499
8473
|
*/
|
|
8500
8474
|
delete(k) {
|
|
8501
|
-
var _a2, _b, _c, _d;
|
|
8502
8475
|
let deleted = false;
|
|
8503
8476
|
if (this.#size !== 0) {
|
|
8504
8477
|
const index = this.#keyMap.get(k);
|
|
@@ -8513,10 +8486,10 @@ var LRUCache = class _LRUCache {
|
|
|
8513
8486
|
v.__abortController.abort(new Error("deleted"));
|
|
8514
8487
|
} else if (this.#hasDispose || this.#hasDisposeAfter) {
|
|
8515
8488
|
if (this.#hasDispose) {
|
|
8516
|
-
|
|
8489
|
+
this.#dispose?.(v, k, "delete");
|
|
8517
8490
|
}
|
|
8518
8491
|
if (this.#hasDisposeAfter) {
|
|
8519
|
-
|
|
8492
|
+
this.#disposed?.push([v, k, "delete"]);
|
|
8520
8493
|
}
|
|
8521
8494
|
}
|
|
8522
8495
|
this.#keyMap.delete(k);
|
|
@@ -8537,11 +8510,11 @@ var LRUCache = class _LRUCache {
|
|
|
8537
8510
|
}
|
|
8538
8511
|
}
|
|
8539
8512
|
}
|
|
8540
|
-
if (this.#hasDisposeAfter &&
|
|
8513
|
+
if (this.#hasDisposeAfter && this.#disposed?.length) {
|
|
8541
8514
|
const dt = this.#disposed;
|
|
8542
8515
|
let task;
|
|
8543
|
-
while (task = dt
|
|
8544
|
-
|
|
8516
|
+
while (task = dt?.shift()) {
|
|
8517
|
+
this.#disposeAfter?.(...task);
|
|
8545
8518
|
}
|
|
8546
8519
|
}
|
|
8547
8520
|
return deleted;
|
|
@@ -8550,7 +8523,6 @@ var LRUCache = class _LRUCache {
|
|
|
8550
8523
|
* Clear the cache entirely, throwing away all values.
|
|
8551
8524
|
*/
|
|
8552
8525
|
clear() {
|
|
8553
|
-
var _a2, _b, _c;
|
|
8554
8526
|
for (const index of this.#rindexes({ allowStale: true })) {
|
|
8555
8527
|
const v = this.#valList[index];
|
|
8556
8528
|
if (this.#isBackgroundFetch(v)) {
|
|
@@ -8558,10 +8530,10 @@ var LRUCache = class _LRUCache {
|
|
|
8558
8530
|
} else {
|
|
8559
8531
|
const k = this.#keyList[index];
|
|
8560
8532
|
if (this.#hasDispose) {
|
|
8561
|
-
|
|
8533
|
+
this.#dispose?.(v, k, "delete");
|
|
8562
8534
|
}
|
|
8563
8535
|
if (this.#hasDisposeAfter) {
|
|
8564
|
-
|
|
8536
|
+
this.#disposed?.push([v, k, "delete"]);
|
|
8565
8537
|
}
|
|
8566
8538
|
}
|
|
8567
8539
|
}
|
|
@@ -8583,8 +8555,8 @@ var LRUCache = class _LRUCache {
|
|
|
8583
8555
|
if (this.#hasDisposeAfter && this.#disposed) {
|
|
8584
8556
|
const dt = this.#disposed;
|
|
8585
8557
|
let task;
|
|
8586
|
-
while (task = dt
|
|
8587
|
-
|
|
8558
|
+
while (task = dt?.shift()) {
|
|
8559
|
+
this.#disposeAfter?.(...task);
|
|
8588
8560
|
}
|
|
8589
8561
|
}
|
|
8590
8562
|
}
|
|
@@ -8812,10 +8784,9 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
8812
8784
|
}
|
|
8813
8785
|
// drop everything and get out of the flow completely
|
|
8814
8786
|
[ABORT]() {
|
|
8815
|
-
var _a2, _b;
|
|
8816
8787
|
this[ABORTED] = true;
|
|
8817
|
-
this.emit("abort",
|
|
8818
|
-
this.destroy(
|
|
8788
|
+
this.emit("abort", this[SIGNAL]?.reason);
|
|
8789
|
+
this.destroy(this[SIGNAL]?.reason);
|
|
8819
8790
|
}
|
|
8820
8791
|
/**
|
|
8821
8792
|
* True if the stream has been aborted.
|
|
@@ -8830,7 +8801,6 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
8830
8801
|
set aborted(_) {
|
|
8831
8802
|
}
|
|
8832
8803
|
write(chunk, encoding, cb) {
|
|
8833
|
-
var _a2;
|
|
8834
8804
|
if (this[ABORTED])
|
|
8835
8805
|
return false;
|
|
8836
8806
|
if (this[EOF])
|
|
@@ -8876,7 +8846,7 @@ var Minipass = class extends import_node_events.EventEmitter {
|
|
|
8876
8846
|
return this[FLOWING];
|
|
8877
8847
|
}
|
|
8878
8848
|
if (typeof chunk === "string" && // unless it is a string already ready for us to use
|
|
8879
|
-
!(encoding === this[ENCODING] && !
|
|
8849
|
+
!(encoding === this[ENCODING] && !this[DECODER]?.lastNeed)) {
|
|
8880
8850
|
chunk = Buffer.from(chunk, encoding);
|
|
8881
8851
|
}
|
|
8882
8852
|
if (Buffer.isBuffer(chunk) && this[ENCODING]) {
|
|
@@ -10052,7 +10022,6 @@ var PathBase = class {
|
|
|
10052
10022
|
* Result is cached, and thus may be outdated if the filesystem is mutated.
|
|
10053
10023
|
*/
|
|
10054
10024
|
async readlink() {
|
|
10055
|
-
var _a2;
|
|
10056
10025
|
const target = this.#linkTarget;
|
|
10057
10026
|
if (target) {
|
|
10058
10027
|
return target;
|
|
@@ -10065,7 +10034,7 @@ var PathBase = class {
|
|
|
10065
10034
|
}
|
|
10066
10035
|
try {
|
|
10067
10036
|
const read = await this.#fs.promises.readlink(this.fullpath());
|
|
10068
|
-
const linkTarget = (
|
|
10037
|
+
const linkTarget = (await this.parent.realpath())?.resolve(read);
|
|
10069
10038
|
if (linkTarget) {
|
|
10070
10039
|
return this.#linkTarget = linkTarget;
|
|
10071
10040
|
}
|
|
@@ -10078,7 +10047,6 @@ var PathBase = class {
|
|
|
10078
10047
|
* Synchronous {@link PathBase.readlink}
|
|
10079
10048
|
*/
|
|
10080
10049
|
readlinkSync() {
|
|
10081
|
-
var _a2;
|
|
10082
10050
|
const target = this.#linkTarget;
|
|
10083
10051
|
if (target) {
|
|
10084
10052
|
return target;
|
|
@@ -10091,7 +10059,7 @@ var PathBase = class {
|
|
|
10091
10059
|
}
|
|
10092
10060
|
try {
|
|
10093
10061
|
const read = this.#fs.readlinkSync(this.fullpath());
|
|
10094
|
-
const linkTarget =
|
|
10062
|
+
const linkTarget = this.parent.realpathSync()?.resolve(read);
|
|
10095
10063
|
if (linkTarget) {
|
|
10096
10064
|
return this.#linkTarget = linkTarget;
|
|
10097
10065
|
}
|
|
@@ -10821,7 +10789,7 @@ var PathScurryBase = class {
|
|
|
10821
10789
|
entry = this.cwd;
|
|
10822
10790
|
}
|
|
10823
10791
|
const e = await entry.readlink();
|
|
10824
|
-
return withFileTypes ? e : e
|
|
10792
|
+
return withFileTypes ? e : e?.fullpath();
|
|
10825
10793
|
}
|
|
10826
10794
|
readlinkSync(entry = this.cwd, { withFileTypes } = {
|
|
10827
10795
|
withFileTypes: false
|
|
@@ -10833,7 +10801,7 @@ var PathScurryBase = class {
|
|
|
10833
10801
|
entry = this.cwd;
|
|
10834
10802
|
}
|
|
10835
10803
|
const e = entry.readlinkSync();
|
|
10836
|
-
return withFileTypes ? e : e
|
|
10804
|
+
return withFileTypes ? e : e?.fullpath();
|
|
10837
10805
|
}
|
|
10838
10806
|
async realpath(entry = this.cwd, { withFileTypes } = {
|
|
10839
10807
|
withFileTypes: false
|
|
@@ -10845,7 +10813,7 @@ var PathScurryBase = class {
|
|
|
10845
10813
|
entry = this.cwd;
|
|
10846
10814
|
}
|
|
10847
10815
|
const e = await entry.realpath();
|
|
10848
|
-
return withFileTypes ? e : e
|
|
10816
|
+
return withFileTypes ? e : e?.fullpath();
|
|
10849
10817
|
}
|
|
10850
10818
|
realpathSync(entry = this.cwd, { withFileTypes } = {
|
|
10851
10819
|
withFileTypes: false
|
|
@@ -10857,7 +10825,7 @@ var PathScurryBase = class {
|
|
|
10857
10825
|
entry = this.cwd;
|
|
10858
10826
|
}
|
|
10859
10827
|
const e = entry.realpathSync();
|
|
10860
|
-
return withFileTypes ? e : e
|
|
10828
|
+
return withFileTypes ? e : e?.fullpath();
|
|
10861
10829
|
}
|
|
10862
10830
|
async walk(entry = this.cwd, opts = {}) {
|
|
10863
10831
|
if (typeof entry === "string") {
|
|
@@ -10891,7 +10859,7 @@ var PathScurryBase = class {
|
|
|
10891
10859
|
results.push(withFileTypes ? e : e.fullpath());
|
|
10892
10860
|
}
|
|
10893
10861
|
if (follow && e.isSymbolicLink()) {
|
|
10894
|
-
e.realpath().then((r) =>
|
|
10862
|
+
e.realpath().then((r) => r?.isUnknown() ? r.lstat() : r).then((r) => r?.shouldWalk(dirs, walkFilter) ? walk(r, next) : next());
|
|
10895
10863
|
} else {
|
|
10896
10864
|
if (e.shouldWalk(dirs, walkFilter)) {
|
|
10897
10865
|
walk(e, next);
|
|
@@ -11037,7 +11005,7 @@ var PathScurryBase = class {
|
|
|
11037
11005
|
const promises = [];
|
|
11038
11006
|
for (const e of entries) {
|
|
11039
11007
|
if (e.isSymbolicLink()) {
|
|
11040
|
-
promises.push(e.realpath().then((r) =>
|
|
11008
|
+
promises.push(e.realpath().then((r) => r?.isUnknown() ? r.lstat() : r));
|
|
11041
11009
|
}
|
|
11042
11010
|
}
|
|
11043
11011
|
if (promises.length) {
|
|
@@ -11465,8 +11433,7 @@ var HasWalkedCache = class _HasWalkedCache {
|
|
|
11465
11433
|
return new _HasWalkedCache(new Map(this.store));
|
|
11466
11434
|
}
|
|
11467
11435
|
hasWalked(target, pattern) {
|
|
11468
|
-
|
|
11469
|
-
return (_a2 = this.store.get(target.fullpath())) == null ? void 0 : _a2.has(pattern.globString());
|
|
11436
|
+
return this.store.get(target.fullpath())?.has(pattern.globString());
|
|
11470
11437
|
}
|
|
11471
11438
|
storeWalked(target, pattern) {
|
|
11472
11439
|
const fullpath = target.fullpath();
|
|
@@ -11578,8 +11545,8 @@ var Processor = class _Processor {
|
|
|
11578
11545
|
if (!t.isSymbolicLink() || this.follow || pattern.checkFollowGlobstar()) {
|
|
11579
11546
|
this.subwalks.add(t, pattern);
|
|
11580
11547
|
}
|
|
11581
|
-
const rp = rest
|
|
11582
|
-
const rrest = rest
|
|
11548
|
+
const rp = rest?.pattern();
|
|
11549
|
+
const rrest = rest?.rest();
|
|
11583
11550
|
if (!rest || (rp === "" || rp === ".") && !rrest) {
|
|
11584
11551
|
this.matches.add(t, absolute, rp === "" || rp === ".");
|
|
11585
11552
|
} else {
|
|
@@ -11714,20 +11681,17 @@ var GlobUtil = class {
|
|
|
11714
11681
|
}
|
|
11715
11682
|
}
|
|
11716
11683
|
#ignored(path4) {
|
|
11717
|
-
|
|
11718
|
-
return this.seen.has(path4) || !!((_b = (_a2 = this.#ignore) == null ? void 0 : _a2.ignored) == null ? void 0 : _b.call(_a2, path4));
|
|
11684
|
+
return this.seen.has(path4) || !!this.#ignore?.ignored?.(path4);
|
|
11719
11685
|
}
|
|
11720
11686
|
#childrenIgnored(path4) {
|
|
11721
|
-
|
|
11722
|
-
return !!((_b = (_a2 = this.#ignore) == null ? void 0 : _a2.childrenIgnored) == null ? void 0 : _b.call(_a2, path4));
|
|
11687
|
+
return !!this.#ignore?.childrenIgnored?.(path4);
|
|
11723
11688
|
}
|
|
11724
11689
|
// backpressure mechanism
|
|
11725
11690
|
pause() {
|
|
11726
11691
|
this.paused = true;
|
|
11727
11692
|
}
|
|
11728
11693
|
resume() {
|
|
11729
|
-
|
|
11730
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11694
|
+
if (this.signal?.aborted)
|
|
11731
11695
|
return;
|
|
11732
11696
|
this.paused = false;
|
|
11733
11697
|
let fn = void 0;
|
|
@@ -11736,8 +11700,7 @@ var GlobUtil = class {
|
|
|
11736
11700
|
}
|
|
11737
11701
|
}
|
|
11738
11702
|
onResume(fn) {
|
|
11739
|
-
|
|
11740
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11703
|
+
if (this.signal?.aborted)
|
|
11741
11704
|
return;
|
|
11742
11705
|
if (!this.paused) {
|
|
11743
11706
|
fn();
|
|
@@ -11759,7 +11722,7 @@ var GlobUtil = class {
|
|
|
11759
11722
|
}
|
|
11760
11723
|
const needStat = e.isUnknown() || this.opts.stat;
|
|
11761
11724
|
const s = needStat ? await e.lstat() : e;
|
|
11762
|
-
if (this.opts.follow && this.opts.nodir &&
|
|
11725
|
+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
|
11763
11726
|
const target = await s.realpath();
|
|
11764
11727
|
if (target && (target.isUnknown() || this.opts.stat)) {
|
|
11765
11728
|
await target.lstat();
|
|
@@ -11768,8 +11731,7 @@ var GlobUtil = class {
|
|
|
11768
11731
|
return this.matchCheckTest(s, ifDir);
|
|
11769
11732
|
}
|
|
11770
11733
|
matchCheckTest(e, ifDir) {
|
|
11771
|
-
|
|
11772
|
-
return e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e.isSymbolicLink() || !((_a2 = e.realpathCached()) == null ? void 0 : _a2.isDirectory())) && !this.#ignored(e) ? e : void 0;
|
|
11734
|
+
return e && (this.maxDepth === Infinity || e.depth() <= this.maxDepth) && (!ifDir || e.canReaddir()) && (!this.opts.nodir || !e.isDirectory()) && (!this.opts.nodir || !this.opts.follow || !e.isSymbolicLink() || !e.realpathCached()?.isDirectory()) && !this.#ignored(e) ? e : void 0;
|
|
11773
11735
|
}
|
|
11774
11736
|
matchCheckSync(e, ifDir) {
|
|
11775
11737
|
if (ifDir && this.opts.nodir)
|
|
@@ -11783,19 +11745,18 @@ var GlobUtil = class {
|
|
|
11783
11745
|
}
|
|
11784
11746
|
const needStat = e.isUnknown() || this.opts.stat;
|
|
11785
11747
|
const s = needStat ? e.lstatSync() : e;
|
|
11786
|
-
if (this.opts.follow && this.opts.nodir &&
|
|
11748
|
+
if (this.opts.follow && this.opts.nodir && s?.isSymbolicLink()) {
|
|
11787
11749
|
const target = s.realpathSync();
|
|
11788
|
-
if (target && (
|
|
11750
|
+
if (target && (target?.isUnknown() || this.opts.stat)) {
|
|
11789
11751
|
target.lstatSync();
|
|
11790
11752
|
}
|
|
11791
11753
|
}
|
|
11792
11754
|
return this.matchCheckTest(s, ifDir);
|
|
11793
11755
|
}
|
|
11794
11756
|
matchFinish(e, absolute) {
|
|
11795
|
-
var _a2;
|
|
11796
11757
|
if (this.#ignored(e))
|
|
11797
11758
|
return;
|
|
11798
|
-
if (!this.includeChildMatches &&
|
|
11759
|
+
if (!this.includeChildMatches && this.#ignore?.add) {
|
|
11799
11760
|
const ign = `${e.relativePosix()}/**`;
|
|
11800
11761
|
this.#ignore.add(ign);
|
|
11801
11762
|
}
|
|
@@ -11824,16 +11785,14 @@ var GlobUtil = class {
|
|
|
11824
11785
|
this.matchFinish(p, absolute);
|
|
11825
11786
|
}
|
|
11826
11787
|
walkCB(target, patterns, cb) {
|
|
11827
|
-
|
|
11828
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11788
|
+
if (this.signal?.aborted)
|
|
11829
11789
|
cb();
|
|
11830
11790
|
this.walkCB2(target, patterns, new Processor(this.opts), cb);
|
|
11831
11791
|
}
|
|
11832
11792
|
walkCB2(target, patterns, processor, cb) {
|
|
11833
|
-
var _a2;
|
|
11834
11793
|
if (this.#childrenIgnored(target))
|
|
11835
11794
|
return cb();
|
|
11836
|
-
if (
|
|
11795
|
+
if (this.signal?.aborted)
|
|
11837
11796
|
cb();
|
|
11838
11797
|
if (this.paused) {
|
|
11839
11798
|
this.onResume(() => this.walkCB2(target, patterns, processor, cb));
|
|
@@ -11885,16 +11844,14 @@ var GlobUtil = class {
|
|
|
11885
11844
|
next();
|
|
11886
11845
|
}
|
|
11887
11846
|
walkCBSync(target, patterns, cb) {
|
|
11888
|
-
|
|
11889
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11847
|
+
if (this.signal?.aborted)
|
|
11890
11848
|
cb();
|
|
11891
11849
|
this.walkCB2Sync(target, patterns, new Processor(this.opts), cb);
|
|
11892
11850
|
}
|
|
11893
11851
|
walkCB2Sync(target, patterns, processor, cb) {
|
|
11894
|
-
var _a2;
|
|
11895
11852
|
if (this.#childrenIgnored(target))
|
|
11896
11853
|
return cb();
|
|
11897
|
-
if (
|
|
11854
|
+
if (this.signal?.aborted)
|
|
11898
11855
|
cb();
|
|
11899
11856
|
if (this.paused) {
|
|
11900
11857
|
this.onResume(() => this.walkCB2Sync(target, patterns, processor, cb));
|
|
@@ -11949,16 +11906,14 @@ var GlobWalker = class extends GlobUtil {
|
|
|
11949
11906
|
this.matches.add(e);
|
|
11950
11907
|
}
|
|
11951
11908
|
async walk() {
|
|
11952
|
-
|
|
11953
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11909
|
+
if (this.signal?.aborted)
|
|
11954
11910
|
throw this.signal.reason;
|
|
11955
11911
|
if (this.path.isUnknown()) {
|
|
11956
11912
|
await this.path.lstat();
|
|
11957
11913
|
}
|
|
11958
11914
|
await new Promise((res, rej) => {
|
|
11959
11915
|
this.walkCB(this.path, this.patterns, () => {
|
|
11960
|
-
|
|
11961
|
-
if ((_a3 = this.signal) == null ? void 0 : _a3.aborted) {
|
|
11916
|
+
if (this.signal?.aborted) {
|
|
11962
11917
|
rej(this.signal.reason);
|
|
11963
11918
|
} else {
|
|
11964
11919
|
res(this.matches);
|
|
@@ -11968,15 +11923,13 @@ var GlobWalker = class extends GlobUtil {
|
|
|
11968
11923
|
return this.matches;
|
|
11969
11924
|
}
|
|
11970
11925
|
walkSync() {
|
|
11971
|
-
|
|
11972
|
-
if ((_a2 = this.signal) == null ? void 0 : _a2.aborted)
|
|
11926
|
+
if (this.signal?.aborted)
|
|
11973
11927
|
throw this.signal.reason;
|
|
11974
11928
|
if (this.path.isUnknown()) {
|
|
11975
11929
|
this.path.lstatSync();
|
|
11976
11930
|
}
|
|
11977
11931
|
this.walkCBSync(this.path, this.patterns, () => {
|
|
11978
|
-
|
|
11979
|
-
if ((_a3 = this.signal) == null ? void 0 : _a3.aborted)
|
|
11932
|
+
if (this.signal?.aborted)
|
|
11980
11933
|
throw this.signal.reason;
|
|
11981
11934
|
});
|
|
11982
11935
|
return this.matches;
|
|
@@ -12525,12 +12478,11 @@ var defaultConfig = {
|
|
|
12525
12478
|
},
|
|
12526
12479
|
clearScreen: false
|
|
12527
12480
|
};
|
|
12528
|
-
function overwriteMerge(
|
|
12481
|
+
function overwriteMerge(_a, b) {
|
|
12529
12482
|
return b;
|
|
12530
12483
|
}
|
|
12531
12484
|
function defineConfig(config) {
|
|
12532
|
-
|
|
12533
|
-
const { mocks = [] } = (config == null ? void 0 : config.fk) ?? {};
|
|
12485
|
+
const { mocks = [] } = config?.fk ?? {};
|
|
12534
12486
|
if (mocks.length > 0) {
|
|
12535
12487
|
defaultConfig.plugins.push((0, import_apimock_express.vitePlugin)(mocks));
|
|
12536
12488
|
}
|
|
@@ -12545,11 +12497,11 @@ function defineConfig(config) {
|
|
|
12545
12497
|
result = defaultConfig;
|
|
12546
12498
|
}
|
|
12547
12499
|
const { build } = result;
|
|
12548
|
-
const external2 =
|
|
12500
|
+
const external2 = build?.rollupOptions?.external;
|
|
12549
12501
|
console.group(import_picocolors.default.bold("Configuration:"));
|
|
12550
12502
|
console.log(
|
|
12551
12503
|
"Internal dependencies:",
|
|
12552
|
-
prettyList(
|
|
12504
|
+
prettyList(result.optimizeDeps?.include ?? [])
|
|
12553
12505
|
);
|
|
12554
12506
|
console.log(
|
|
12555
12507
|
"External dependencies:",
|