nitro-nightly 3.0.1-20260124-165031-9c6abf17 → 3.0.1-20260127-164246-ef01b092
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_build/common.mjs +2084 -3212
- package/dist/_build/rolldown.mjs +12 -25
- package/dist/_build/rollup.mjs +11 -27
- package/dist/_build/vite.build.mjs +7 -11
- package/dist/_chunks/dev.mjs +20 -42
- package/dist/_chunks/nitro.mjs +13 -92
- package/dist/_chunks/nitro2.mjs +1 -5
- package/dist/_chunks/utils.mjs +10 -24
- package/dist/_common.mjs +12 -24
- package/dist/_libs/citty.mjs +1 -13
- package/dist/_libs/commondir+is-reference.mjs +12 -22
- package/dist/_libs/compatx.mjs +1 -4
- package/dist/_libs/confbox.mjs +363 -376
- package/dist/_libs/escape-string-regexp.mjs +1 -4
- package/dist/_libs/estree-walker.mjs +4 -92
- package/dist/_libs/hasown+resolve+deepmerge.mjs +144 -230
- package/dist/_libs/httpxy.mjs +5 -21
- package/dist/_libs/klona.mjs +1 -4
- package/dist/_libs/nypm+giget+tinyexec.mjs +874 -926
- package/dist/_libs/plugin-alias.mjs +1 -5
- package/dist/_libs/plugin-inject.mjs +1 -5
- package/dist/_libs/plugin-json.mjs +1 -5
- package/dist/_libs/pluginutils+plugin-commonjs.d.mts +2 -2
- package/dist/_libs/pluginutils.mjs +1 -31
- package/dist/_libs/rc9+c12+dotenv.mjs +43 -83
- package/dist/_libs/readdirp+chokidar.mjs +184 -360
- package/dist/_libs/remapping.mjs +1 -5
- package/dist/_libs/resolve-uri+gen-mapping.mjs +12 -48
- package/dist/_libs/rou3.mjs +1 -32
- package/dist/_libs/tsconfck.mjs +21 -334
- package/dist/_libs/ultrahtml.mjs +3 -16
- package/dist/_libs/unimport+unplugin.mjs +15 -75
- package/dist/_presets.mjs +260 -445
- package/dist/builder.mjs +1 -2
- package/dist/cli/_chunks/build.mjs +1 -5
- package/dist/cli/_chunks/common.mjs +1 -4
- package/dist/cli/_chunks/dev.mjs +1 -5
- package/dist/cli/_chunks/list.mjs +1 -5
- package/dist/cli/_chunks/prepare.mjs +1 -5
- package/dist/cli/_chunks/run.mjs +1 -5
- package/dist/cli/_chunks/task.mjs +1 -5
- package/dist/cli/index.mjs +1 -5
- package/dist/types/index.d.mts +5 -5
- package/dist/types/index.mjs +1 -2
- package/dist/vite.mjs +44 -63
- package/package.json +21 -21
|
@@ -5,8 +5,6 @@ import path, { dirname, extname, normalize, resolve, sep } from "path";
|
|
|
5
5
|
import { builtinModules } from "module";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
7
7
|
import { promisify } from "util";
|
|
8
|
-
|
|
9
|
-
//#region node_modules/.pnpm/deepmerge@4.3.1/node_modules/deepmerge/dist/cjs.js
|
|
10
8
|
var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
11
9
|
var isMergeableObject = function isMergeableObject(value) {
|
|
12
10
|
return isNonNullObject(value) && !isSpecial(value);
|
|
@@ -84,12 +82,8 @@ var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
84
82
|
return deepmerge(prev, next, options);
|
|
85
83
|
}, {});
|
|
86
84
|
};
|
|
87
|
-
|
|
88
|
-
module.exports = deepmerge_1;
|
|
85
|
+
module.exports = deepmerge;
|
|
89
86
|
}));
|
|
90
|
-
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region node_modules/.pnpm/is-module@1.0.0/node_modules/is-module/index.js
|
|
93
87
|
var require_is_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
94
88
|
var ES6ImportExportRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(import\s+['"]|(import|module)\s+[^"'\(\)\n;]+\s+from\s+['"]|export\s+(\*|\{|default|function|var|const|let|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*))/;
|
|
95
89
|
var ES6AliasRegExp = /(?:^\s*|[}{\(\);,\n]\s*)(export\s*\*\s*from\s*(?:'([^']+)'|"([^"]+)"))/;
|
|
@@ -97,12 +91,8 @@ var require_is_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
97
91
|
return ES6ImportExportRegExp.test(sauce) || ES6AliasRegExp.test(sauce);
|
|
98
92
|
};
|
|
99
93
|
}));
|
|
100
|
-
|
|
101
|
-
//#endregion
|
|
102
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/homedir.js
|
|
103
94
|
var require_homedir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
104
|
-
|
|
105
|
-
module.exports = os.homedir || function homedir() {
|
|
95
|
+
module.exports = __require("os").homedir || function homedir() {
|
|
106
96
|
var home = process.env.HOME;
|
|
107
97
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
108
98
|
if (process.platform === "win32") return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
|
|
@@ -111,23 +101,17 @@ var require_homedir = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
111
101
|
return home || null;
|
|
112
102
|
};
|
|
113
103
|
}));
|
|
114
|
-
|
|
115
|
-
//#endregion
|
|
116
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/caller.js
|
|
117
104
|
var require_caller = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
118
105
|
module.exports = function() {
|
|
119
106
|
var origPrepareStackTrace = Error.prepareStackTrace;
|
|
120
|
-
Error.prepareStackTrace = function(_, stack
|
|
121
|
-
return stack
|
|
107
|
+
Error.prepareStackTrace = function(_, stack) {
|
|
108
|
+
return stack;
|
|
122
109
|
};
|
|
123
110
|
var stack = (/* @__PURE__ */ new Error()).stack;
|
|
124
111
|
Error.prepareStackTrace = origPrepareStackTrace;
|
|
125
112
|
return stack[2].getFileName();
|
|
126
113
|
};
|
|
127
114
|
}));
|
|
128
|
-
|
|
129
|
-
//#endregion
|
|
130
|
-
//#region node_modules/.pnpm/path-parse@1.0.7/node_modules/path-parse/index.js
|
|
131
115
|
var require_path_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
132
116
|
var isWindows = process.platform === "win32";
|
|
133
117
|
var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
|
|
@@ -169,9 +153,6 @@ var require_path_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
169
153
|
module.exports.posix = posix.parse;
|
|
170
154
|
module.exports.win32 = win32.parse;
|
|
171
155
|
}));
|
|
172
|
-
|
|
173
|
-
//#endregion
|
|
174
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/node-modules-paths.js
|
|
175
156
|
var require_node_modules_paths = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
176
157
|
var path$3 = __require("path");
|
|
177
158
|
var parse = path$3.parse || require_path_parse();
|
|
@@ -202,23 +183,11 @@ var require_node_modules_paths = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
202
183
|
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
|
|
203
184
|
};
|
|
204
185
|
}));
|
|
205
|
-
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/normalize-options.js
|
|
208
186
|
var require_normalize_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
209
187
|
module.exports = function(x, opts) {
|
|
210
|
-
/**
|
|
211
|
-
* This file is purposefully a passthrough. It's expected that third-party
|
|
212
|
-
* environments will override it at runtime in order to inject special logic
|
|
213
|
-
* into `resolve` (by manipulating the options). One such example is the PnP
|
|
214
|
-
* code path in Yarn.
|
|
215
|
-
*/
|
|
216
188
|
return opts || {};
|
|
217
189
|
};
|
|
218
190
|
}));
|
|
219
|
-
|
|
220
|
-
//#endregion
|
|
221
|
-
//#region node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/implementation.js
|
|
222
191
|
var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
223
192
|
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
224
193
|
var toStr = Object.prototype.toString;
|
|
@@ -261,7 +230,7 @@ var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
261
230
|
for (var i = 0; i < boundLength; i++) boundArgs[i] = "$" + i;
|
|
262
231
|
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
263
232
|
if (target.prototype) {
|
|
264
|
-
var Empty = function Empty
|
|
233
|
+
var Empty = function Empty() {};
|
|
265
234
|
Empty.prototype = target.prototype;
|
|
266
235
|
bound.prototype = new Empty();
|
|
267
236
|
Empty.prototype = null;
|
|
@@ -269,26 +238,15 @@ var require_implementation = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
269
238
|
return bound;
|
|
270
239
|
};
|
|
271
240
|
}));
|
|
272
|
-
|
|
273
|
-
//#endregion
|
|
274
|
-
//#region node_modules/.pnpm/function-bind@1.1.2/node_modules/function-bind/index.js
|
|
275
241
|
var require_function_bind = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
276
242
|
var implementation = require_implementation();
|
|
277
243
|
module.exports = Function.prototype.bind || implementation;
|
|
278
244
|
}));
|
|
279
|
-
|
|
280
|
-
//#endregion
|
|
281
|
-
//#region node_modules/.pnpm/hasown@2.0.2/node_modules/hasown/index.js
|
|
282
245
|
var require_hasown = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
283
246
|
var call = Function.prototype.call;
|
|
284
247
|
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
285
|
-
|
|
286
|
-
/** @type {import('.')} */
|
|
287
|
-
module.exports = bind.call(call, $hasOwn);
|
|
248
|
+
module.exports = require_function_bind().call(call, $hasOwn);
|
|
288
249
|
}));
|
|
289
|
-
|
|
290
|
-
//#endregion
|
|
291
|
-
//#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/core.json
|
|
292
250
|
var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
293
251
|
module.exports = {
|
|
294
252
|
"assert": true,
|
|
@@ -461,9 +419,6 @@ var require_core$2 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
461
419
|
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
462
420
|
};
|
|
463
421
|
}));
|
|
464
|
-
|
|
465
|
-
//#endregion
|
|
466
|
-
//#region node_modules/.pnpm/is-core-module@2.16.1/node_modules/is-core-module/index.js
|
|
467
422
|
var require_is_core_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
468
423
|
var hasOwn = require_hasown();
|
|
469
424
|
function specifierIncluded(current, specifier) {
|
|
@@ -502,9 +457,6 @@ var require_is_core_module = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
502
457
|
return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
|
|
503
458
|
};
|
|
504
459
|
}));
|
|
505
|
-
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/async.js
|
|
508
460
|
var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
509
461
|
var fs$1 = __require("fs");
|
|
510
462
|
var getHomedir = require_homedir();
|
|
@@ -522,31 +474,31 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
522
474
|
return [path$2.join(homedir, ".node_modules"), path$2.join(homedir, ".node_libraries")];
|
|
523
475
|
};
|
|
524
476
|
var defaultIsFile = function isFile(file, cb) {
|
|
525
|
-
fs$1.stat(file, function(err, stat
|
|
526
|
-
if (!err) return cb(null, stat
|
|
477
|
+
fs$1.stat(file, function(err, stat) {
|
|
478
|
+
if (!err) return cb(null, stat.isFile() || stat.isFIFO());
|
|
527
479
|
if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
|
|
528
480
|
return cb(err);
|
|
529
481
|
});
|
|
530
482
|
};
|
|
531
483
|
var defaultIsDir = function isDirectory(dir, cb) {
|
|
532
|
-
fs$1.stat(dir, function(err, stat
|
|
533
|
-
if (!err) return cb(null, stat
|
|
484
|
+
fs$1.stat(dir, function(err, stat) {
|
|
485
|
+
if (!err) return cb(null, stat.isDirectory());
|
|
534
486
|
if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
|
|
535
487
|
return cb(err);
|
|
536
488
|
});
|
|
537
489
|
};
|
|
538
|
-
var defaultRealpath = function realpath
|
|
490
|
+
var defaultRealpath = function realpath(x, cb) {
|
|
539
491
|
realpathFS(x, function(realpathErr, realPath) {
|
|
540
492
|
if (realpathErr && realpathErr.code !== "ENOENT") cb(realpathErr);
|
|
541
493
|
else cb(null, realpathErr ? x : realPath);
|
|
542
494
|
});
|
|
543
495
|
};
|
|
544
|
-
var maybeRealpath = function maybeRealpath(realpath
|
|
545
|
-
if (opts && opts.preserveSymlinks === false) realpath
|
|
496
|
+
var maybeRealpath = function maybeRealpath(realpath, x, opts, cb) {
|
|
497
|
+
if (opts && opts.preserveSymlinks === false) realpath(x, cb);
|
|
546
498
|
else cb(null, x);
|
|
547
499
|
};
|
|
548
|
-
var defaultReadPackage = function defaultReadPackage(readFile
|
|
549
|
-
readFile
|
|
500
|
+
var defaultReadPackage = function defaultReadPackage(readFile, pkgfile, cb) {
|
|
501
|
+
readFile(pkgfile, function(readFileErr, body) {
|
|
550
502
|
if (readFileErr) cb(readFileErr);
|
|
551
503
|
else try {
|
|
552
504
|
cb(null, JSON.parse(body));
|
|
@@ -560,7 +512,7 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
560
512
|
for (var i = 0; i < dirs.length; i++) dirs[i] = path$2.join(dirs[i], x);
|
|
561
513
|
return dirs;
|
|
562
514
|
};
|
|
563
|
-
module.exports = function resolve
|
|
515
|
+
module.exports = function resolve(x, options, callback) {
|
|
564
516
|
var cb = callback;
|
|
565
517
|
var opts = options;
|
|
566
518
|
if (typeof options === "function") {
|
|
@@ -576,8 +528,8 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
576
528
|
opts = normalizeOptions(x, opts);
|
|
577
529
|
var isFile = opts.isFile || defaultIsFile;
|
|
578
530
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
579
|
-
var readFile
|
|
580
|
-
var realpath
|
|
531
|
+
var readFile = opts.readFile || fs$1.readFile;
|
|
532
|
+
var realpath = opts.realpath || defaultRealpath;
|
|
581
533
|
var readPackage = opts.readPackage || defaultReadPackage;
|
|
582
534
|
if (opts.readFile && opts.readPackage) {
|
|
583
535
|
var conflictErr = /* @__PURE__ */ new TypeError("`readFile` and `readPackage` are mutually exclusive.");
|
|
@@ -591,22 +543,22 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
591
543
|
var basedir = opts.basedir || path$2.dirname(caller());
|
|
592
544
|
var parent = opts.filename || basedir;
|
|
593
545
|
opts.paths = opts.paths || defaultPaths();
|
|
594
|
-
maybeRealpath(realpath
|
|
595
|
-
if (err
|
|
546
|
+
maybeRealpath(realpath, path$2.resolve(basedir), opts, function(err, realStart) {
|
|
547
|
+
if (err) cb(err);
|
|
596
548
|
else init(realStart);
|
|
597
549
|
});
|
|
598
550
|
var res;
|
|
599
|
-
function init(basedir
|
|
551
|
+
function init(basedir) {
|
|
600
552
|
if (relativePathRegex.test(x)) {
|
|
601
|
-
res = path$2.resolve(basedir
|
|
553
|
+
res = path$2.resolve(basedir, x);
|
|
602
554
|
if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
|
|
603
|
-
if (x.slice(-1) === "/" && res === basedir
|
|
555
|
+
if (x.slice(-1) === "/" && res === basedir) loadAsDirectory(res, opts.package, onfile);
|
|
604
556
|
else loadAsFile(res, opts.package, onfile);
|
|
605
557
|
} else if (includeCoreModules && isCore(x)) return cb(null, x);
|
|
606
|
-
else loadNodeModules(x, basedir
|
|
607
|
-
if (err
|
|
608
|
-
else if (n) return maybeRealpath(realpath
|
|
609
|
-
if (err
|
|
558
|
+
else loadNodeModules(x, basedir, function(err, n, pkg) {
|
|
559
|
+
if (err) cb(err);
|
|
560
|
+
else if (n) return maybeRealpath(realpath, n, opts, function(err, realN) {
|
|
561
|
+
if (err) cb(err);
|
|
610
562
|
else cb(null, realN, pkg);
|
|
611
563
|
});
|
|
612
564
|
else {
|
|
@@ -616,14 +568,14 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
616
568
|
}
|
|
617
569
|
});
|
|
618
570
|
}
|
|
619
|
-
function onfile(err
|
|
620
|
-
if (err
|
|
571
|
+
function onfile(err, m, pkg) {
|
|
572
|
+
if (err) cb(err);
|
|
621
573
|
else if (m) cb(null, m, pkg);
|
|
622
|
-
else loadAsDirectory(res, function(err
|
|
623
|
-
if (err
|
|
624
|
-
else if (d) maybeRealpath(realpath
|
|
625
|
-
if (err
|
|
626
|
-
else cb(null, realD, pkg
|
|
574
|
+
else loadAsDirectory(res, function(err, d, pkg) {
|
|
575
|
+
if (err) cb(err);
|
|
576
|
+
else if (d) maybeRealpath(realpath, d, opts, function(err, realD) {
|
|
577
|
+
if (err) cb(err);
|
|
578
|
+
else cb(null, realD, pkg);
|
|
627
579
|
});
|
|
628
580
|
else {
|
|
629
581
|
var moduleError = /* @__PURE__ */ new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
@@ -632,128 +584,125 @@ var require_async = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
632
584
|
}
|
|
633
585
|
});
|
|
634
586
|
}
|
|
635
|
-
function loadAsFile(x
|
|
587
|
+
function loadAsFile(x, thePackage, callback) {
|
|
636
588
|
var loadAsFilePackage = thePackage;
|
|
637
|
-
var cb
|
|
589
|
+
var cb = callback;
|
|
638
590
|
if (typeof loadAsFilePackage === "function") {
|
|
639
|
-
cb
|
|
591
|
+
cb = loadAsFilePackage;
|
|
640
592
|
loadAsFilePackage = void 0;
|
|
641
593
|
}
|
|
642
|
-
load([""].concat(extensions), x
|
|
643
|
-
function load(exts, x
|
|
644
|
-
if (exts.length === 0) return cb
|
|
645
|
-
var file = x
|
|
594
|
+
load([""].concat(extensions), x, loadAsFilePackage);
|
|
595
|
+
function load(exts, x, loadPackage) {
|
|
596
|
+
if (exts.length === 0) return cb(null, void 0, loadPackage);
|
|
597
|
+
var file = x + exts[0];
|
|
646
598
|
var pkg = loadPackage;
|
|
647
599
|
if (pkg) onpkg(null, pkg);
|
|
648
600
|
else loadpkg(path$2.dirname(file), onpkg);
|
|
649
|
-
function onpkg(err
|
|
601
|
+
function onpkg(err, pkg_, dir) {
|
|
650
602
|
pkg = pkg_;
|
|
651
|
-
if (err
|
|
603
|
+
if (err) return cb(err);
|
|
652
604
|
if (dir && pkg && opts.pathFilter) {
|
|
653
605
|
var rfile = path$2.relative(dir, file);
|
|
654
606
|
var rel = rfile.slice(0, rfile.length - exts[0].length);
|
|
655
|
-
var r = opts.pathFilter(pkg, x
|
|
607
|
+
var r = opts.pathFilter(pkg, x, rel);
|
|
656
608
|
if (r) return load([""].concat(extensions.slice()), path$2.resolve(dir, r), pkg);
|
|
657
609
|
}
|
|
658
610
|
isFile(file, onex);
|
|
659
611
|
}
|
|
660
|
-
function onex(err
|
|
661
|
-
if (err
|
|
662
|
-
if (ex) return cb
|
|
663
|
-
load(exts.slice(1), x
|
|
612
|
+
function onex(err, ex) {
|
|
613
|
+
if (err) return cb(err);
|
|
614
|
+
if (ex) return cb(null, file, pkg);
|
|
615
|
+
load(exts.slice(1), x, pkg);
|
|
664
616
|
}
|
|
665
617
|
}
|
|
666
618
|
}
|
|
667
|
-
function loadpkg(dir, cb
|
|
668
|
-
if (dir === "" || dir === "/") return cb
|
|
669
|
-
if (process.platform === "win32" && windowsDriveRegex.test(dir)) return cb
|
|
670
|
-
if (nodeModulesRegex.test(dir)) return cb
|
|
671
|
-
maybeRealpath(realpath
|
|
672
|
-
if (unwrapErr) return loadpkg(path$2.dirname(dir), cb
|
|
619
|
+
function loadpkg(dir, cb) {
|
|
620
|
+
if (dir === "" || dir === "/") return cb(null);
|
|
621
|
+
if (process.platform === "win32" && windowsDriveRegex.test(dir)) return cb(null);
|
|
622
|
+
if (nodeModulesRegex.test(dir)) return cb(null);
|
|
623
|
+
maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
|
|
624
|
+
if (unwrapErr) return loadpkg(path$2.dirname(dir), cb);
|
|
673
625
|
var pkgfile = path$2.join(pkgdir, "package.json");
|
|
674
|
-
isFile(pkgfile, function(err
|
|
675
|
-
if (!ex) return loadpkg(path$2.dirname(dir), cb
|
|
676
|
-
readPackage(readFile
|
|
677
|
-
if (err
|
|
626
|
+
isFile(pkgfile, function(err, ex) {
|
|
627
|
+
if (!ex) return loadpkg(path$2.dirname(dir), cb);
|
|
628
|
+
readPackage(readFile, pkgfile, function(err, pkgParam) {
|
|
629
|
+
if (err) cb(err);
|
|
678
630
|
var pkg = pkgParam;
|
|
679
631
|
if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, pkgfile);
|
|
680
|
-
cb
|
|
632
|
+
cb(null, pkg, dir);
|
|
681
633
|
});
|
|
682
634
|
});
|
|
683
635
|
});
|
|
684
636
|
}
|
|
685
|
-
function loadAsDirectory(x
|
|
686
|
-
var cb
|
|
637
|
+
function loadAsDirectory(x, loadAsDirectoryPackage, callback) {
|
|
638
|
+
var cb = callback;
|
|
687
639
|
var fpkg = loadAsDirectoryPackage;
|
|
688
640
|
if (typeof fpkg === "function") {
|
|
689
|
-
cb
|
|
641
|
+
cb = fpkg;
|
|
690
642
|
fpkg = opts.package;
|
|
691
643
|
}
|
|
692
|
-
maybeRealpath(realpath
|
|
693
|
-
if (unwrapErr) return cb
|
|
644
|
+
maybeRealpath(realpath, x, opts, function(unwrapErr, pkgdir) {
|
|
645
|
+
if (unwrapErr) return cb(unwrapErr);
|
|
694
646
|
var pkgfile = path$2.join(pkgdir, "package.json");
|
|
695
|
-
isFile(pkgfile, function(err
|
|
696
|
-
if (err
|
|
697
|
-
if (!ex) return loadAsFile(path$2.join(x
|
|
698
|
-
readPackage(readFile
|
|
699
|
-
if (err
|
|
647
|
+
isFile(pkgfile, function(err, ex) {
|
|
648
|
+
if (err) return cb(err);
|
|
649
|
+
if (!ex) return loadAsFile(path$2.join(x, "index"), fpkg, cb);
|
|
650
|
+
readPackage(readFile, pkgfile, function(err, pkgParam) {
|
|
651
|
+
if (err) return cb(err);
|
|
700
652
|
var pkg = pkgParam;
|
|
701
653
|
if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, pkgfile);
|
|
702
654
|
if (pkg && pkg.main) {
|
|
703
655
|
if (typeof pkg.main !== "string") {
|
|
704
656
|
var mainError = /* @__PURE__ */ new TypeError("package “" + pkg.name + "” `main` must be a string");
|
|
705
657
|
mainError.code = "INVALID_PACKAGE_MAIN";
|
|
706
|
-
return cb
|
|
658
|
+
return cb(mainError);
|
|
707
659
|
}
|
|
708
660
|
if (pkg.main === "." || pkg.main === "./") pkg.main = "index";
|
|
709
|
-
loadAsFile(path$2.resolve(x
|
|
710
|
-
if (err
|
|
711
|
-
if (m) return cb
|
|
712
|
-
if (!pkg
|
|
713
|
-
loadAsDirectory(path$2.resolve(x
|
|
714
|
-
if (err
|
|
715
|
-
if (n) return cb
|
|
716
|
-
loadAsFile(path$2.join(x
|
|
661
|
+
loadAsFile(path$2.resolve(x, pkg.main), pkg, function(err, m, pkg) {
|
|
662
|
+
if (err) return cb(err);
|
|
663
|
+
if (m) return cb(null, m, pkg);
|
|
664
|
+
if (!pkg) return loadAsFile(path$2.join(x, "index"), pkg, cb);
|
|
665
|
+
loadAsDirectory(path$2.resolve(x, pkg.main), pkg, function(err, n, pkg) {
|
|
666
|
+
if (err) return cb(err);
|
|
667
|
+
if (n) return cb(null, n, pkg);
|
|
668
|
+
loadAsFile(path$2.join(x, "index"), pkg, cb);
|
|
717
669
|
});
|
|
718
670
|
});
|
|
719
671
|
return;
|
|
720
672
|
}
|
|
721
|
-
loadAsFile(path$2.join(x
|
|
673
|
+
loadAsFile(path$2.join(x, "/index"), pkg, cb);
|
|
722
674
|
});
|
|
723
675
|
});
|
|
724
676
|
});
|
|
725
677
|
}
|
|
726
|
-
function processDirs(cb
|
|
727
|
-
if (dirs.length === 0) return cb
|
|
678
|
+
function processDirs(cb, dirs) {
|
|
679
|
+
if (dirs.length === 0) return cb(null, void 0);
|
|
728
680
|
var dir = dirs[0];
|
|
729
681
|
isDirectory(path$2.dirname(dir), isdir);
|
|
730
|
-
function isdir(err
|
|
731
|
-
if (err
|
|
732
|
-
if (!isdir
|
|
733
|
-
loadAsFile(dir, opts.package, onfile
|
|
682
|
+
function isdir(err, isdir) {
|
|
683
|
+
if (err) return cb(err);
|
|
684
|
+
if (!isdir) return processDirs(cb, dirs.slice(1));
|
|
685
|
+
loadAsFile(dir, opts.package, onfile);
|
|
734
686
|
}
|
|
735
|
-
function onfile
|
|
736
|
-
if (err
|
|
737
|
-
if (m) return cb
|
|
687
|
+
function onfile(err, m, pkg) {
|
|
688
|
+
if (err) return cb(err);
|
|
689
|
+
if (m) return cb(null, m, pkg);
|
|
738
690
|
loadAsDirectory(dir, opts.package, ondir);
|
|
739
691
|
}
|
|
740
|
-
function ondir(err
|
|
741
|
-
if (err
|
|
742
|
-
if (n) return cb
|
|
743
|
-
processDirs(cb
|
|
692
|
+
function ondir(err, n, pkg) {
|
|
693
|
+
if (err) return cb(err);
|
|
694
|
+
if (n) return cb(null, n, pkg);
|
|
695
|
+
processDirs(cb, dirs.slice(1));
|
|
744
696
|
}
|
|
745
697
|
}
|
|
746
|
-
function loadNodeModules(x
|
|
698
|
+
function loadNodeModules(x, start, cb) {
|
|
747
699
|
var thunk = function() {
|
|
748
|
-
return getPackageCandidates(x
|
|
700
|
+
return getPackageCandidates(x, start, opts);
|
|
749
701
|
};
|
|
750
|
-
processDirs(cb
|
|
702
|
+
processDirs(cb, packageIterator ? packageIterator(x, start, thunk, opts) : thunk());
|
|
751
703
|
}
|
|
752
704
|
};
|
|
753
705
|
}));
|
|
754
|
-
|
|
755
|
-
//#endregion
|
|
756
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/core.json
|
|
757
706
|
var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
758
707
|
module.exports = {
|
|
759
708
|
"assert": true,
|
|
@@ -926,9 +875,6 @@ var require_core$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
926
875
|
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
927
876
|
};
|
|
928
877
|
}));
|
|
929
|
-
|
|
930
|
-
//#endregion
|
|
931
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/core.js
|
|
932
878
|
var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
933
879
|
var isCoreModule = require_is_core_module();
|
|
934
880
|
var data = require_core$1();
|
|
@@ -936,18 +882,12 @@ var require_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
936
882
|
for (var mod in data) if (Object.prototype.hasOwnProperty.call(data, mod)) core[mod] = isCoreModule(mod);
|
|
937
883
|
module.exports = core;
|
|
938
884
|
}));
|
|
939
|
-
|
|
940
|
-
//#endregion
|
|
941
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/is-core.js
|
|
942
885
|
var require_is_core = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
943
886
|
var isCoreModule = require_is_core_module();
|
|
944
887
|
module.exports = function isCore(x) {
|
|
945
888
|
return isCoreModule(x);
|
|
946
889
|
};
|
|
947
890
|
}));
|
|
948
|
-
|
|
949
|
-
//#endregion
|
|
950
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/lib/sync.js
|
|
951
891
|
var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
952
892
|
var isCore = require_is_core_module();
|
|
953
893
|
var fs = __require("fs");
|
|
@@ -966,23 +906,23 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
966
906
|
};
|
|
967
907
|
var defaultIsFile = function isFile(file) {
|
|
968
908
|
try {
|
|
969
|
-
var stat
|
|
909
|
+
var stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
970
910
|
} catch (e) {
|
|
971
911
|
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
|
|
972
912
|
throw e;
|
|
973
913
|
}
|
|
974
|
-
return !!stat
|
|
914
|
+
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
975
915
|
};
|
|
976
916
|
var defaultIsDir = function isDirectory(dir) {
|
|
977
917
|
try {
|
|
978
|
-
var stat
|
|
918
|
+
var stat = fs.statSync(dir, { throwIfNoEntry: false });
|
|
979
919
|
} catch (e) {
|
|
980
920
|
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
|
|
981
921
|
throw e;
|
|
982
922
|
}
|
|
983
|
-
return !!stat
|
|
923
|
+
return !!stat && stat.isDirectory();
|
|
984
924
|
};
|
|
985
|
-
var defaultRealpathSync = function realpathSync
|
|
925
|
+
var defaultRealpathSync = function realpathSync(x) {
|
|
986
926
|
try {
|
|
987
927
|
return realpathFS(x);
|
|
988
928
|
} catch (realpathErr) {
|
|
@@ -990,12 +930,12 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
990
930
|
}
|
|
991
931
|
return x;
|
|
992
932
|
};
|
|
993
|
-
var maybeRealpathSync = function maybeRealpathSync(realpathSync
|
|
994
|
-
if (opts && opts.preserveSymlinks === false) return realpathSync
|
|
933
|
+
var maybeRealpathSync = function maybeRealpathSync(realpathSync, x, opts) {
|
|
934
|
+
if (opts && opts.preserveSymlinks === false) return realpathSync(x);
|
|
995
935
|
return x;
|
|
996
936
|
};
|
|
997
|
-
var defaultReadPackageSync = function defaultReadPackageSync(readFileSync
|
|
998
|
-
var body = readFileSync
|
|
937
|
+
var defaultReadPackageSync = function defaultReadPackageSync(readFileSync, pkgfile) {
|
|
938
|
+
var body = readFileSync(pkgfile);
|
|
999
939
|
try {
|
|
1000
940
|
return JSON.parse(body);
|
|
1001
941
|
} catch (jsonErr) {}
|
|
@@ -1009,9 +949,9 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1009
949
|
if (typeof x !== "string") throw new TypeError("Path must be a string.");
|
|
1010
950
|
var opts = normalizeOptions(x, options);
|
|
1011
951
|
var isFile = opts.isFile || defaultIsFile;
|
|
1012
|
-
var readFileSync
|
|
952
|
+
var readFileSync = opts.readFileSync || fs.readFileSync;
|
|
1013
953
|
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
1014
|
-
var realpathSync
|
|
954
|
+
var realpathSync = opts.realpathSync || defaultRealpathSync;
|
|
1015
955
|
var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
1016
956
|
if (opts.readFileSync && opts.readPackageSync) throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
1017
957
|
var packageIterator = opts.packageIterator;
|
|
@@ -1020,30 +960,30 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1020
960
|
var basedir = opts.basedir || path$1.dirname(caller());
|
|
1021
961
|
var parent = opts.filename || basedir;
|
|
1022
962
|
opts.paths = opts.paths || defaultPaths();
|
|
1023
|
-
var absoluteStart = maybeRealpathSync(realpathSync
|
|
963
|
+
var absoluteStart = maybeRealpathSync(realpathSync, path$1.resolve(basedir), opts);
|
|
1024
964
|
if (relativePathRegex.test(x)) {
|
|
1025
965
|
var res = path$1.resolve(absoluteStart, x);
|
|
1026
966
|
if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
|
|
1027
967
|
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
1028
|
-
if (m) return maybeRealpathSync(realpathSync
|
|
968
|
+
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
1029
969
|
} else if (includeCoreModules && isCore(x)) return x;
|
|
1030
970
|
else {
|
|
1031
971
|
var n = loadNodeModulesSync(x, absoluteStart);
|
|
1032
|
-
if (n) return maybeRealpathSync(realpathSync
|
|
972
|
+
if (n) return maybeRealpathSync(realpathSync, n, opts);
|
|
1033
973
|
}
|
|
1034
974
|
var err = /* @__PURE__ */ new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
1035
975
|
err.code = "MODULE_NOT_FOUND";
|
|
1036
976
|
throw err;
|
|
1037
|
-
function loadAsFileSync(x
|
|
1038
|
-
var pkg = loadpkg(path$1.dirname(x
|
|
977
|
+
function loadAsFileSync(x) {
|
|
978
|
+
var pkg = loadpkg(path$1.dirname(x));
|
|
1039
979
|
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
1040
|
-
var rfile = path$1.relative(pkg.dir, x
|
|
1041
|
-
var r = opts.pathFilter(pkg.pkg, x
|
|
1042
|
-
if (r) x
|
|
980
|
+
var rfile = path$1.relative(pkg.dir, x);
|
|
981
|
+
var r = opts.pathFilter(pkg.pkg, x, rfile);
|
|
982
|
+
if (r) x = path$1.resolve(pkg.dir, r);
|
|
1043
983
|
}
|
|
1044
|
-
if (isFile(x
|
|
984
|
+
if (isFile(x)) return x;
|
|
1045
985
|
for (var i = 0; i < extensions.length; i++) {
|
|
1046
|
-
var file = x
|
|
986
|
+
var file = x + extensions[i];
|
|
1047
987
|
if (isFile(file)) return file;
|
|
1048
988
|
}
|
|
1049
989
|
}
|
|
@@ -1051,22 +991,22 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1051
991
|
if (dir === "" || dir === "/") return;
|
|
1052
992
|
if (process.platform === "win32" && windowsDriveRegex.test(dir)) return;
|
|
1053
993
|
if (nodeModulesRegex.test(dir)) return;
|
|
1054
|
-
var pkgfile = path$1.join(maybeRealpathSync(realpathSync
|
|
994
|
+
var pkgfile = path$1.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
|
|
1055
995
|
if (!isFile(pkgfile)) return loadpkg(path$1.dirname(dir));
|
|
1056
|
-
var pkg = readPackageSync(readFileSync
|
|
996
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
1057
997
|
if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, dir);
|
|
1058
998
|
return {
|
|
1059
999
|
pkg,
|
|
1060
1000
|
dir
|
|
1061
1001
|
};
|
|
1062
1002
|
}
|
|
1063
|
-
function loadAsDirectorySync(x
|
|
1064
|
-
var pkgfile = path$1.join(maybeRealpathSync(realpathSync
|
|
1003
|
+
function loadAsDirectorySync(x) {
|
|
1004
|
+
var pkgfile = path$1.join(maybeRealpathSync(realpathSync, x, opts), "/package.json");
|
|
1065
1005
|
if (isFile(pkgfile)) {
|
|
1066
1006
|
try {
|
|
1067
|
-
var pkg = readPackageSync(readFileSync
|
|
1007
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
1068
1008
|
} catch (e) {}
|
|
1069
|
-
if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, x
|
|
1009
|
+
if (pkg && opts.packageFilter) pkg = opts.packageFilter(pkg, x);
|
|
1070
1010
|
if (pkg && pkg.main) {
|
|
1071
1011
|
if (typeof pkg.main !== "string") {
|
|
1072
1012
|
var mainError = /* @__PURE__ */ new TypeError("package “" + pkg.name + "” `main` must be a string");
|
|
@@ -1075,35 +1015,32 @@ var require_sync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1075
1015
|
}
|
|
1076
1016
|
if (pkg.main === "." || pkg.main === "./") pkg.main = "index";
|
|
1077
1017
|
try {
|
|
1078
|
-
var m
|
|
1079
|
-
if (m
|
|
1080
|
-
var n
|
|
1081
|
-
if (n
|
|
1018
|
+
var m = loadAsFileSync(path$1.resolve(x, pkg.main));
|
|
1019
|
+
if (m) return m;
|
|
1020
|
+
var n = loadAsDirectorySync(path$1.resolve(x, pkg.main));
|
|
1021
|
+
if (n) return n;
|
|
1082
1022
|
} catch (e) {}
|
|
1083
1023
|
}
|
|
1084
1024
|
}
|
|
1085
|
-
return loadAsFileSync(path$1.join(x
|
|
1025
|
+
return loadAsFileSync(path$1.join(x, "/index"));
|
|
1086
1026
|
}
|
|
1087
|
-
function loadNodeModulesSync(x
|
|
1027
|
+
function loadNodeModulesSync(x, start) {
|
|
1088
1028
|
var thunk = function() {
|
|
1089
|
-
return getPackageCandidates(x
|
|
1029
|
+
return getPackageCandidates(x, start, opts);
|
|
1090
1030
|
};
|
|
1091
|
-
var dirs = packageIterator ? packageIterator(x
|
|
1031
|
+
var dirs = packageIterator ? packageIterator(x, start, thunk, opts) : thunk();
|
|
1092
1032
|
for (var i = 0; i < dirs.length; i++) {
|
|
1093
1033
|
var dir = dirs[i];
|
|
1094
1034
|
if (isDirectory(path$1.dirname(dir))) {
|
|
1095
|
-
var m
|
|
1096
|
-
if (m
|
|
1097
|
-
var n
|
|
1098
|
-
if (n
|
|
1035
|
+
var m = loadAsFileSync(dir);
|
|
1036
|
+
if (m) return m;
|
|
1037
|
+
var n = loadAsDirectorySync(dir);
|
|
1038
|
+
if (n) return n;
|
|
1099
1039
|
}
|
|
1100
1040
|
}
|
|
1101
1041
|
}
|
|
1102
1042
|
};
|
|
1103
1043
|
}));
|
|
1104
|
-
|
|
1105
|
-
//#endregion
|
|
1106
|
-
//#region node_modules/.pnpm/resolve@1.22.11/node_modules/resolve/index.js
|
|
1107
1044
|
var require_resolve = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1108
1045
|
var async = require_async();
|
|
1109
1046
|
async.core = require_core();
|
|
@@ -1111,9 +1048,6 @@ var require_resolve = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1111
1048
|
async.sync = require_sync();
|
|
1112
1049
|
module.exports = async;
|
|
1113
1050
|
}));
|
|
1114
|
-
|
|
1115
|
-
//#endregion
|
|
1116
|
-
//#region node_modules/.pnpm/@rollup+plugin-node-resolve@16.0.3_rollup@4.55.3/node_modules/@rollup/plugin-node-resolve/dist/es/index.js
|
|
1117
1051
|
var import_cjs = /* @__PURE__ */ __toESM(require_cjs(), 1);
|
|
1118
1052
|
var import_is_module = /* @__PURE__ */ __toESM(require_is_module(), 1);
|
|
1119
1053
|
var import_resolve = /* @__PURE__ */ __toESM(require_resolve(), 1);
|
|
@@ -1130,8 +1064,8 @@ async function fileExists(filePath) {
|
|
|
1130
1064
|
return false;
|
|
1131
1065
|
}
|
|
1132
1066
|
}
|
|
1133
|
-
async function resolveSymlink(path
|
|
1134
|
-
return await fileExists(path
|
|
1067
|
+
async function resolveSymlink(path) {
|
|
1068
|
+
return await fileExists(path) ? realpath(path) : path;
|
|
1135
1069
|
}
|
|
1136
1070
|
const onError = (error) => {
|
|
1137
1071
|
if (error.code === "ENOENT") return false;
|
|
@@ -1305,21 +1239,12 @@ function isUrl(str) {
|
|
|
1305
1239
|
return false;
|
|
1306
1240
|
}
|
|
1307
1241
|
}
|
|
1308
|
-
/**
|
|
1309
|
-
* Conditions is an export object where all keys are conditions like 'node' (aka do not with '.')
|
|
1310
|
-
*/
|
|
1311
1242
|
function isConditions(exports) {
|
|
1312
1243
|
return typeof exports === "object" && Object.keys(exports).every((k) => !k.startsWith("."));
|
|
1313
1244
|
}
|
|
1314
|
-
/**
|
|
1315
|
-
* Mappings is an export object where all keys start with '.
|
|
1316
|
-
*/
|
|
1317
1245
|
function isMappings(exports) {
|
|
1318
1246
|
return typeof exports === "object" && !isConditions(exports);
|
|
1319
1247
|
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Check for mixed exports, which are exports where some keys start with '.' and some do not
|
|
1322
|
-
*/
|
|
1323
1248
|
function isMixedExports(exports) {
|
|
1324
1249
|
const keys = Object.keys(exports);
|
|
1325
1250
|
return keys.some((k) => k.startsWith(".")) && keys.some((k) => !k.startsWith("."));
|
|
@@ -1347,9 +1272,6 @@ var InvalidPackageTargetError = class extends ResolveError {
|
|
|
1347
1272
|
super(createErrorMsg(context, reason));
|
|
1348
1273
|
}
|
|
1349
1274
|
};
|
|
1350
|
-
/**
|
|
1351
|
-
* Check for invalid path segments
|
|
1352
|
-
*/
|
|
1353
1275
|
function includesInvalidSegments(pathSegments, moduleDirs) {
|
|
1354
1276
|
const invalidSegments = [
|
|
1355
1277
|
"",
|
|
@@ -1364,8 +1286,8 @@ async function resolvePackageTarget(context, { target, patternMatch, isImports }
|
|
|
1364
1286
|
if (!target.startsWith("./")) {
|
|
1365
1287
|
if (!isImports || ["/", "../"].some((p) => target.startsWith(p)) || isUrl(target)) throw new InvalidPackageTargetError(context, `Invalid mapping: "${target}".`);
|
|
1366
1288
|
if (typeof patternMatch === "string") {
|
|
1367
|
-
const result
|
|
1368
|
-
return result
|
|
1289
|
+
const result = await context.resolveId(target.replace(/\*/g, patternMatch), context.pkgURL.href);
|
|
1290
|
+
return result ? pathToFileURL(result.location).href : null;
|
|
1369
1291
|
}
|
|
1370
1292
|
const result = await context.resolveId(target, context.pkgURL.href);
|
|
1371
1293
|
return result ? pathToFileURL(result.location).href : null;
|
|
@@ -1414,9 +1336,6 @@ async function resolvePackageTarget(context, { target, patternMatch, isImports }
|
|
|
1414
1336
|
if (target === null) return null;
|
|
1415
1337
|
throw new InvalidPackageTargetError(context, `Invalid exports field.`);
|
|
1416
1338
|
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Implementation of Node's `PATTERN_KEY_COMPARE` function
|
|
1419
|
-
*/
|
|
1420
1339
|
function nodePatternKeyCompare(keyA, keyB) {
|
|
1421
1340
|
const baseLengthA = keyA.includes("*") ? keyA.indexOf("*") + 1 : keyA.length;
|
|
1422
1341
|
const rval = (keyB.includes("*") ? keyB.indexOf("*") + 1 : keyB.length) - baseLengthA;
|
|
@@ -1452,9 +1371,6 @@ async function resolvePackageImportsExports(context, { matchKey, matchObj, isImp
|
|
|
1452
1371
|
}
|
|
1453
1372
|
throw new InvalidModuleSpecifierError(context, isImports);
|
|
1454
1373
|
}
|
|
1455
|
-
/**
|
|
1456
|
-
* Implementation of PACKAGE_EXPORTS_RESOLVE
|
|
1457
|
-
*/
|
|
1458
1374
|
async function resolvePackageExports(context, subpath, exports) {
|
|
1459
1375
|
if (isMixedExports(exports)) throw new InvalidConfigurationError(context, "All keys must either start with ./, or without one.");
|
|
1460
1376
|
if (subpath === ".") {
|
|
@@ -1766,7 +1682,7 @@ const defaults = {
|
|
|
1766
1682
|
allowExportsFolderMapping: true
|
|
1767
1683
|
};
|
|
1768
1684
|
const nodeImportPrefix = /^node:/;
|
|
1769
|
-
|
|
1685
|
+
deepFreeze((0, import_cjs.default)({}, defaults));
|
|
1770
1686
|
function nodeResolve(opts = {}) {
|
|
1771
1687
|
const { warnings } = handleDeprecatedOptions(opts);
|
|
1772
1688
|
const options = {
|
|
@@ -1801,7 +1717,7 @@ function nodeResolve(opts = {}) {
|
|
|
1801
1717
|
const regexPatterns = patterns.map((pattern) => {
|
|
1802
1718
|
if (pattern instanceof RegExp) return pattern;
|
|
1803
1719
|
const normalized = pattern.replace(/[\\^$*+?.()|[\]{}]/g, "\\$&");
|
|
1804
|
-
return
|
|
1720
|
+
return new RegExp(`^${normalized}$`);
|
|
1805
1721
|
});
|
|
1806
1722
|
return (id) => !regexPatterns.length || regexPatterns.some((pattern) => pattern.test(id));
|
|
1807
1723
|
};
|
|
@@ -1844,12 +1760,12 @@ function nodeResolve(opts = {}) {
|
|
|
1844
1760
|
]) if (importee.endsWith(importeeExt) && extensions.includes(resolvedExt)) importSpecifierList.push(importee.slice(0, -importeeExt.length) + resolvedExt);
|
|
1845
1761
|
}
|
|
1846
1762
|
const warn = (...args) => context.warn(...args);
|
|
1847
|
-
const exportConditions
|
|
1848
|
-
if (useBrowserOverrides && !exportConditions
|
|
1763
|
+
const exportConditions = custom && custom["node-resolve"] && custom["node-resolve"].isRequire ? conditionsCjs : conditionsEsm;
|
|
1764
|
+
if (useBrowserOverrides && !exportConditions.includes("browser")) exportConditions.push("browser");
|
|
1849
1765
|
const resolvedWithoutBuiltins = await resolveImportSpecifiers({
|
|
1850
1766
|
importer,
|
|
1851
1767
|
importSpecifierList,
|
|
1852
|
-
exportConditions
|
|
1768
|
+
exportConditions,
|
|
1853
1769
|
warn,
|
|
1854
1770
|
packageInfoCache,
|
|
1855
1771
|
extensions,
|
|
@@ -1967,6 +1883,4 @@ function nodeResolve(opts = {}) {
|
|
|
1967
1883
|
}
|
|
1968
1884
|
};
|
|
1969
1885
|
}
|
|
1970
|
-
|
|
1971
|
-
//#endregion
|
|
1972
|
-
export { nodeResolve as t };
|
|
1886
|
+
export { nodeResolve as t };
|