@storybook/react 11.0.0-beta.0 → 11.0.0-beta.2
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/_browser-chunks/{chunk-2TQVKMJE.js → chunk-EA5DV32Q.js} +36 -1
- package/dist/_browser-chunks/{chunk-EZD3TIPB.js → chunk-I62VTYU3.js} +17 -4
- package/dist/_browser-chunks/{chunk-7QIM3PHH.js → chunk-U7XUEUFQ.js} +3 -3
- package/dist/_browser-chunks/{chunk-LGSTPTL6.js → chunk-WWHCZJWM.js} +10 -9
- package/dist/_node-chunks/{chunk-27VFNEPI.js → chunk-2DNUEB5U.js} +6798 -15258
- package/dist/_node-chunks/chunk-ASUAJQT5.js +63 -0
- package/dist/_node-chunks/chunk-BWU7O3KC.js +61 -0
- package/dist/_node-chunks/chunk-DW2HJ23M.js +1674 -0
- package/dist/_node-chunks/chunk-PXKXGEPO.js +6643 -0
- package/dist/_node-chunks/chunk-QRCEILHM.js +93 -0
- package/dist/_node-chunks/chunk-TP7UUO2M.js +18 -0
- package/dist/_node-chunks/chunk-VQBUQHU3.js +33 -0
- package/dist/_node-chunks/chunk-XIFLZILW.js +65 -0
- package/dist/_node-chunks/chunk-XQPV7U3R.js +1395 -0
- package/dist/_node-chunks/extractArgTypesFromComponentFile-PKEIPQGN.js +44 -0
- package/dist/_node-chunks/extractReactDocgenInfo-J6CKNSQN.js +59 -0
- package/dist/_node-chunks/extractReactTypescriptDocgenInfo-AJTC3KA3.js +105 -0
- package/dist/_node-chunks/reactDocgen-YAGNM6ZQ.js +26 -0
- package/dist/builder-docgen.d.ts +51 -0
- package/dist/builder-docgen.js +25 -0
- package/dist/{chunk-DwM7QKaD.d.ts → chunk-6b3AvPEC.d.ts} +66 -1
- package/dist/docgen/docgen-worker.js +23 -87
- package/dist/entry-preview-argtypes.js +1 -1
- package/dist/entry-preview-docs.js +1 -1
- package/dist/entry-preview.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +4 -4
- package/dist/preset.js +79 -1363
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +4 -4
- package/package.json +21 -6
- package/template/cli/js/Button.stories.js +11 -10
- package/template/cli/js/Header.stories.js +6 -5
- package/template/cli/js/Page.stories.js +6 -5
- package/template/cli/ts/Button.stories.ts +11 -14
- package/template/cli/ts/Header.stories.ts +6 -9
- package/template/cli/ts/Page.stories.ts +6 -9
|
@@ -0,0 +1,1395 @@
|
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0pbco1v5vos from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0pbco1v5vos from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0pbco1v5vos from "node:module";
|
|
4
|
+
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0pbco1v5vos.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0pbco1v5vos.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0pbco1v5vos.createRequire(import.meta.url);
|
|
8
|
+
|
|
9
|
+
// ------------------------------------------------------------
|
|
10
|
+
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
|
+
// ------------------------------------------------------------
|
|
12
|
+
import {
|
|
13
|
+
cached,
|
|
14
|
+
cachedReadFileSync,
|
|
15
|
+
cachedResolveImport,
|
|
16
|
+
matchPath
|
|
17
|
+
} from "./chunk-DW2HJ23M.js";
|
|
18
|
+
import {
|
|
19
|
+
require_dist
|
|
20
|
+
} from "./chunk-BWU7O3KC.js";
|
|
21
|
+
import {
|
|
22
|
+
__commonJS,
|
|
23
|
+
__require,
|
|
24
|
+
__toESM
|
|
25
|
+
} from "./chunk-ASUAJQT5.js";
|
|
26
|
+
|
|
27
|
+
// ../../../node_modules/resolve/lib/homedir.js
|
|
28
|
+
var require_homedir = __commonJS({
|
|
29
|
+
"../../../node_modules/resolve/lib/homedir.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var os = __require("os");
|
|
32
|
+
module.exports = os.homedir || function() {
|
|
33
|
+
var home = process.env.HOME, user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
34
|
+
return process.platform === "win32" ? process.env.USERPROFILE || process.env.HOMEDRIVE && process.env.HOMEPATH && process.env.HOMEDRIVE + process.env.HOMEPATH || home || null : process.platform === "darwin" ? home || (user ? "/Users/" + user : null) : process.platform === "linux" ? home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null) : home || null;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// ../../../node_modules/es-errors/index.js
|
|
40
|
+
var require_es_errors = __commonJS({
|
|
41
|
+
"../../../node_modules/es-errors/index.js"(exports, module) {
|
|
42
|
+
"use strict";
|
|
43
|
+
module.exports = Error;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// ../../../node_modules/resolve/lib/caller.js
|
|
48
|
+
var require_caller = __commonJS({
|
|
49
|
+
"../../../node_modules/resolve/lib/caller.js"(exports, module) {
|
|
50
|
+
"use strict";
|
|
51
|
+
var $Error = require_es_errors();
|
|
52
|
+
module.exports = function() {
|
|
53
|
+
var origPrepareStackTrace = $Error.prepareStackTrace;
|
|
54
|
+
$Error.prepareStackTrace = function(_, stack2) {
|
|
55
|
+
return stack2;
|
|
56
|
+
};
|
|
57
|
+
var stack = new $Error().stack;
|
|
58
|
+
return $Error.prepareStackTrace = origPrepareStackTrace, stack[2].getFileName();
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
// ../../../node_modules/path-parse/index.js
|
|
64
|
+
var require_path_parse = __commonJS({
|
|
65
|
+
"../../../node_modules/path-parse/index.js"(exports, module) {
|
|
66
|
+
"use strict";
|
|
67
|
+
var isWindows = process.platform === "win32", splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/, win32 = {};
|
|
68
|
+
function win32SplitPath(filename) {
|
|
69
|
+
return splitWindowsRe.exec(filename).slice(1);
|
|
70
|
+
}
|
|
71
|
+
win32.parse = function(pathString) {
|
|
72
|
+
if (typeof pathString != "string")
|
|
73
|
+
throw new TypeError(
|
|
74
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
75
|
+
);
|
|
76
|
+
var allParts = win32SplitPath(pathString);
|
|
77
|
+
if (!allParts || allParts.length !== 5)
|
|
78
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
79
|
+
return {
|
|
80
|
+
root: allParts[1],
|
|
81
|
+
dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
|
|
82
|
+
base: allParts[2],
|
|
83
|
+
ext: allParts[4],
|
|
84
|
+
name: allParts[3]
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/, posix = {};
|
|
88
|
+
function posixSplitPath(filename) {
|
|
89
|
+
return splitPathRe.exec(filename).slice(1);
|
|
90
|
+
}
|
|
91
|
+
posix.parse = function(pathString) {
|
|
92
|
+
if (typeof pathString != "string")
|
|
93
|
+
throw new TypeError(
|
|
94
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
95
|
+
);
|
|
96
|
+
var allParts = posixSplitPath(pathString);
|
|
97
|
+
if (!allParts || allParts.length !== 5)
|
|
98
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
99
|
+
return {
|
|
100
|
+
root: allParts[1],
|
|
101
|
+
dir: allParts[0].slice(0, -1),
|
|
102
|
+
base: allParts[2],
|
|
103
|
+
ext: allParts[4],
|
|
104
|
+
name: allParts[3]
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
isWindows ? module.exports = win32.parse : module.exports = posix.parse;
|
|
108
|
+
module.exports.posix = posix.parse;
|
|
109
|
+
module.exports.win32 = win32.parse;
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
// ../../../node_modules/resolve/lib/node-modules-paths.js
|
|
114
|
+
var require_node_modules_paths = __commonJS({
|
|
115
|
+
"../../../node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
|
|
116
|
+
var path = __require("path"), parse2 = path.parse || require_path_parse(), driveLetterRegex = /^([A-Za-z]:)/, uncPathRegex = /^\\\\/;
|
|
117
|
+
function getNodeModulesDirs(absoluteStart, modules) {
|
|
118
|
+
var prefix = "/";
|
|
119
|
+
driveLetterRegex.test(absoluteStart) ? prefix = "" : uncPathRegex.test(absoluteStart) && (prefix = "\\\\");
|
|
120
|
+
for (var paths = [absoluteStart], parsed = parse2(absoluteStart); parsed.dir !== paths[paths.length - 1]; )
|
|
121
|
+
paths.push(parsed.dir), parsed = parse2(parsed.dir);
|
|
122
|
+
return paths.reduce(function(dirs, aPath) {
|
|
123
|
+
return dirs.concat(modules.map(function(moduleDir) {
|
|
124
|
+
return path.resolve(prefix, aPath, moduleDir);
|
|
125
|
+
}));
|
|
126
|
+
}, []);
|
|
127
|
+
}
|
|
128
|
+
module.exports = function(start, opts, request) {
|
|
129
|
+
var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
|
|
130
|
+
if (opts && typeof opts.paths == "function")
|
|
131
|
+
return opts.paths(
|
|
132
|
+
request,
|
|
133
|
+
start,
|
|
134
|
+
function() {
|
|
135
|
+
return getNodeModulesDirs(start, modules);
|
|
136
|
+
},
|
|
137
|
+
opts
|
|
138
|
+
);
|
|
139
|
+
var dirs = getNodeModulesDirs(start, modules);
|
|
140
|
+
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// ../../../node_modules/resolve/lib/normalize-options.js
|
|
146
|
+
var require_normalize_options = __commonJS({
|
|
147
|
+
"../../../node_modules/resolve/lib/normalize-options.js"(exports, module) {
|
|
148
|
+
var path = __require("path");
|
|
149
|
+
module.exports = function(_, opts) {
|
|
150
|
+
if (opts = opts || {}, opts.forceNodeResolution || !process.versions.pnp)
|
|
151
|
+
return opts;
|
|
152
|
+
let { findPnpApi } = __require("module"), runPnpResolution = (request, basedir) => {
|
|
153
|
+
let parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
|
|
154
|
+
if (!parts)
|
|
155
|
+
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
|
|
156
|
+
basedir.charAt(basedir.length - 1) !== "/" && (basedir = path.join(basedir, "/"));
|
|
157
|
+
let api = findPnpApi(basedir);
|
|
158
|
+
if (api === null)
|
|
159
|
+
return;
|
|
160
|
+
let manifestPath;
|
|
161
|
+
try {
|
|
162
|
+
manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, { considerBuiltins: !1 });
|
|
163
|
+
} catch {
|
|
164
|
+
return null;
|
|
165
|
+
}
|
|
166
|
+
if (manifestPath === null)
|
|
167
|
+
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
|
|
168
|
+
let packagePath = path.dirname(manifestPath), unqualifiedPath = typeof parts[2] < "u" ? path.join(packagePath, parts[2]) : packagePath;
|
|
169
|
+
return { packagePath, unqualifiedPath };
|
|
170
|
+
}, runPnpResolutionOnArray = (request, paths2) => {
|
|
171
|
+
for (let i = 0; i < paths2.length; i++) {
|
|
172
|
+
let resolution = runPnpResolution(request, paths2[i]);
|
|
173
|
+
if (resolution || i === paths2.length - 1)
|
|
174
|
+
return resolution;
|
|
175
|
+
}
|
|
176
|
+
return null;
|
|
177
|
+
}, originalPaths = Array.isArray(opts.paths) ? opts.paths : [], packageIterator = (request, basedir, getCandidates, opts2) => {
|
|
178
|
+
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
179
|
+
return resolution == null ? getCandidates() : [resolution.unqualifiedPath];
|
|
180
|
+
}, paths = (request, basedir, getNodeModulePaths, opts2) => {
|
|
181
|
+
let pathsToTest = [basedir].concat(originalPaths), resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
182
|
+
if (resolution == null)
|
|
183
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
184
|
+
let nodeModules = path.dirname(resolution.packagePath);
|
|
185
|
+
return request.match(/^@[^/]+\//) && (nodeModules = path.dirname(nodeModules)), [nodeModules];
|
|
186
|
+
}, isInsideIterator = !1;
|
|
187
|
+
return opts.__skipPackageIterator || (opts.packageIterator = function(request, basedir, getCandidates, opts2) {
|
|
188
|
+
isInsideIterator = !0;
|
|
189
|
+
try {
|
|
190
|
+
return packageIterator(request, basedir, getCandidates, opts2);
|
|
191
|
+
} finally {
|
|
192
|
+
isInsideIterator = !1;
|
|
193
|
+
}
|
|
194
|
+
}), opts.paths = function(request, basedir, getNodeModulePaths, opts2) {
|
|
195
|
+
return isInsideIterator ? getNodeModulePaths().concat(originalPaths) : paths(request, basedir, getNodeModulePaths, opts2);
|
|
196
|
+
}, opts;
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// ../../../node_modules/function-bind/implementation.js
|
|
202
|
+
var require_implementation = __commonJS({
|
|
203
|
+
"../../../node_modules/function-bind/implementation.js"(exports, module) {
|
|
204
|
+
"use strict";
|
|
205
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ", toStr = Object.prototype.toString, max = Math.max, funcType = "[object Function]", concatty = function(a, b) {
|
|
206
|
+
for (var arr = [], i = 0; i < a.length; i += 1)
|
|
207
|
+
arr[i] = a[i];
|
|
208
|
+
for (var j = 0; j < b.length; j += 1)
|
|
209
|
+
arr[j + a.length] = b[j];
|
|
210
|
+
return arr;
|
|
211
|
+
}, slicy = function(arrLike, offset) {
|
|
212
|
+
for (var arr = [], i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1)
|
|
213
|
+
arr[j] = arrLike[i];
|
|
214
|
+
return arr;
|
|
215
|
+
}, joiny = function(arr, joiner) {
|
|
216
|
+
for (var str = "", i = 0; i < arr.length; i += 1)
|
|
217
|
+
str += arr[i], i + 1 < arr.length && (str += joiner);
|
|
218
|
+
return str;
|
|
219
|
+
};
|
|
220
|
+
module.exports = function(that) {
|
|
221
|
+
var target = this;
|
|
222
|
+
if (typeof target != "function" || toStr.apply(target) !== funcType)
|
|
223
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
224
|
+
for (var args = slicy(arguments, 1), bound, binder = function() {
|
|
225
|
+
if (this instanceof bound) {
|
|
226
|
+
var result = target.apply(
|
|
227
|
+
this,
|
|
228
|
+
concatty(args, arguments)
|
|
229
|
+
);
|
|
230
|
+
return Object(result) === result ? result : this;
|
|
231
|
+
}
|
|
232
|
+
return target.apply(
|
|
233
|
+
that,
|
|
234
|
+
concatty(args, arguments)
|
|
235
|
+
);
|
|
236
|
+
}, boundLength = max(0, target.length - args.length), boundArgs = [], i = 0; i < boundLength; i++)
|
|
237
|
+
boundArgs[i] = "$" + i;
|
|
238
|
+
if (bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder), target.prototype) {
|
|
239
|
+
var Empty = function() {
|
|
240
|
+
};
|
|
241
|
+
Empty.prototype = target.prototype, bound.prototype = new Empty(), Empty.prototype = null;
|
|
242
|
+
}
|
|
243
|
+
return bound;
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
// ../../../node_modules/function-bind/index.js
|
|
249
|
+
var require_function_bind = __commonJS({
|
|
250
|
+
"../../../node_modules/function-bind/index.js"(exports, module) {
|
|
251
|
+
"use strict";
|
|
252
|
+
var implementation = require_implementation();
|
|
253
|
+
module.exports = Function.prototype.bind || implementation;
|
|
254
|
+
}
|
|
255
|
+
});
|
|
256
|
+
|
|
257
|
+
// ../../../node_modules/hasown/index.js
|
|
258
|
+
var require_hasown = __commonJS({
|
|
259
|
+
"../../../node_modules/hasown/index.js"(exports, module) {
|
|
260
|
+
"use strict";
|
|
261
|
+
var call = Function.prototype.call, $hasOwn = Object.prototype.hasOwnProperty, bind = require_function_bind();
|
|
262
|
+
module.exports = bind.call(call, $hasOwn);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
265
|
+
|
|
266
|
+
// ../../../node_modules/is-core-module/core.json
|
|
267
|
+
var require_core = __commonJS({
|
|
268
|
+
"../../../node_modules/is-core-module/core.json"(exports, module) {
|
|
269
|
+
module.exports = {
|
|
270
|
+
assert: !0,
|
|
271
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
272
|
+
"assert/strict": ">= 15",
|
|
273
|
+
"node:assert/strict": ">= 16",
|
|
274
|
+
async_hooks: ">= 8",
|
|
275
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
276
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
277
|
+
buffer: !0,
|
|
278
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
279
|
+
child_process: !0,
|
|
280
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
281
|
+
cluster: ">= 0.5",
|
|
282
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
283
|
+
console: !0,
|
|
284
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
285
|
+
constants: !0,
|
|
286
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
287
|
+
crypto: !0,
|
|
288
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
289
|
+
_debug_agent: ">= 1 && < 8",
|
|
290
|
+
_debugger: "< 8",
|
|
291
|
+
dgram: !0,
|
|
292
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
293
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
294
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
295
|
+
dns: !0,
|
|
296
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
297
|
+
"dns/promises": ">= 15",
|
|
298
|
+
"node:dns/promises": ">= 16",
|
|
299
|
+
domain: ">= 0.7.12",
|
|
300
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
301
|
+
events: !0,
|
|
302
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
303
|
+
freelist: "< 6",
|
|
304
|
+
fs: !0,
|
|
305
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
306
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
307
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
308
|
+
_http_agent: ">= 0.11.1",
|
|
309
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
310
|
+
_http_client: ">= 0.11.1",
|
|
311
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
312
|
+
_http_common: ">= 0.11.1",
|
|
313
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
314
|
+
_http_incoming: ">= 0.11.1",
|
|
315
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
316
|
+
_http_outgoing: ">= 0.11.1",
|
|
317
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
318
|
+
_http_server: ">= 0.11.1",
|
|
319
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
320
|
+
http: !0,
|
|
321
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
322
|
+
http2: ">= 8.8",
|
|
323
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
324
|
+
https: !0,
|
|
325
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
326
|
+
inspector: ">= 8",
|
|
327
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
328
|
+
"inspector/promises": [">= 19"],
|
|
329
|
+
"node:inspector/promises": [">= 19"],
|
|
330
|
+
_linklist: "< 8",
|
|
331
|
+
module: !0,
|
|
332
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
333
|
+
net: !0,
|
|
334
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
335
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
336
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
337
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
338
|
+
os: !0,
|
|
339
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
340
|
+
path: !0,
|
|
341
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
342
|
+
"path/posix": ">= 15.3",
|
|
343
|
+
"node:path/posix": ">= 16",
|
|
344
|
+
"path/win32": ">= 15.3",
|
|
345
|
+
"node:path/win32": ">= 16",
|
|
346
|
+
perf_hooks: ">= 8.5",
|
|
347
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
348
|
+
process: ">= 1",
|
|
349
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
350
|
+
punycode: ">= 0.5",
|
|
351
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
352
|
+
querystring: !0,
|
|
353
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
354
|
+
readline: !0,
|
|
355
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
356
|
+
"readline/promises": ">= 17",
|
|
357
|
+
"node:readline/promises": ">= 17",
|
|
358
|
+
repl: !0,
|
|
359
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
360
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
361
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
362
|
+
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
|
|
363
|
+
_stream_duplex: ">= 0.9.4 && < 26",
|
|
364
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
365
|
+
_stream_transform: ">= 0.9.4 && < 26",
|
|
366
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
367
|
+
_stream_wrap: ">= 1.4.1 && < 26",
|
|
368
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
369
|
+
_stream_passthrough: ">= 0.9.4 && < 26",
|
|
370
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
371
|
+
_stream_readable: ">= 0.9.4 && < 26",
|
|
372
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
373
|
+
_stream_writable: ">= 0.9.4 && < 26",
|
|
374
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16 && < 26"],
|
|
375
|
+
stream: !0,
|
|
376
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
377
|
+
"stream/consumers": ">= 16.7",
|
|
378
|
+
"node:stream/consumers": ">= 16.7",
|
|
379
|
+
"stream/promises": ">= 15",
|
|
380
|
+
"node:stream/promises": ">= 16",
|
|
381
|
+
"stream/web": ">= 16.5",
|
|
382
|
+
"node:stream/web": ">= 16.5",
|
|
383
|
+
string_decoder: !0,
|
|
384
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
385
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
386
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
387
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
388
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
389
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
390
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
391
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
392
|
+
timers: !0,
|
|
393
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
394
|
+
"timers/promises": ">= 15",
|
|
395
|
+
"node:timers/promises": ">= 16",
|
|
396
|
+
_tls_common: ">= 0.11.13",
|
|
397
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
398
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
399
|
+
_tls_wrap: ">= 0.11.3",
|
|
400
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
401
|
+
tls: !0,
|
|
402
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
403
|
+
trace_events: ">= 10",
|
|
404
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
405
|
+
tty: !0,
|
|
406
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
407
|
+
url: !0,
|
|
408
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
409
|
+
util: !0,
|
|
410
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
411
|
+
"util/types": ">= 15.3",
|
|
412
|
+
"node:util/types": ">= 16",
|
|
413
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
414
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
415
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
416
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
417
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
418
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
419
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
420
|
+
v8: ">= 1",
|
|
421
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
422
|
+
vm: !0,
|
|
423
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
424
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
425
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
426
|
+
worker_threads: ">= 11.7",
|
|
427
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
428
|
+
zlib: ">= 0.5",
|
|
429
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
});
|
|
433
|
+
|
|
434
|
+
// ../../../node_modules/is-core-module/index.js
|
|
435
|
+
var require_is_core_module = __commonJS({
|
|
436
|
+
"../../../node_modules/is-core-module/index.js"(exports, module) {
|
|
437
|
+
"use strict";
|
|
438
|
+
var hasOwn = require_hasown();
|
|
439
|
+
function specifierIncluded(current, specifier) {
|
|
440
|
+
for (var nodeParts = current.split("."), parts = specifier.split(" "), op = parts.length > 1 ? parts[0] : "=", versionParts = (parts.length > 1 ? parts[1] : parts[0]).split("."), i = 0; i < 3; ++i) {
|
|
441
|
+
var cur = parseInt(nodeParts[i] || 0, 10), ver = parseInt(versionParts[i] || 0, 10);
|
|
442
|
+
if (cur !== ver)
|
|
443
|
+
return op === "<" ? cur < ver : op === ">=" ? cur >= ver : !1;
|
|
444
|
+
}
|
|
445
|
+
return op === ">=";
|
|
446
|
+
}
|
|
447
|
+
function matchesRange(current, range) {
|
|
448
|
+
var specifiers = range.split(/ ?&& ?/);
|
|
449
|
+
if (specifiers.length === 0)
|
|
450
|
+
return !1;
|
|
451
|
+
for (var i = 0; i < specifiers.length; ++i)
|
|
452
|
+
if (!specifierIncluded(current, specifiers[i]))
|
|
453
|
+
return !1;
|
|
454
|
+
return !0;
|
|
455
|
+
}
|
|
456
|
+
function versionIncluded(nodeVersion, specifierValue) {
|
|
457
|
+
if (typeof specifierValue == "boolean")
|
|
458
|
+
return specifierValue;
|
|
459
|
+
var current = typeof nodeVersion > "u" ? process.versions && process.versions.node : nodeVersion;
|
|
460
|
+
if (typeof current != "string")
|
|
461
|
+
throw new TypeError(typeof nodeVersion > "u" ? "Unable to determine current node version" : "If provided, a valid node version is required");
|
|
462
|
+
if (specifierValue && typeof specifierValue == "object") {
|
|
463
|
+
for (var i = 0; i < specifierValue.length; ++i)
|
|
464
|
+
if (matchesRange(current, specifierValue[i]))
|
|
465
|
+
return !0;
|
|
466
|
+
return !1;
|
|
467
|
+
}
|
|
468
|
+
return matchesRange(current, specifierValue);
|
|
469
|
+
}
|
|
470
|
+
var data = require_core();
|
|
471
|
+
module.exports = function(x, nodeVersion) {
|
|
472
|
+
return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
|
|
473
|
+
};
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
// ../../../node_modules/es-errors/type.js
|
|
478
|
+
var require_type = __commonJS({
|
|
479
|
+
"../../../node_modules/es-errors/type.js"(exports, module) {
|
|
480
|
+
"use strict";
|
|
481
|
+
module.exports = TypeError;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
// ../../../node_modules/resolve/lib/async.js
|
|
486
|
+
var require_async = __commonJS({
|
|
487
|
+
"../../../node_modules/resolve/lib/async.js"(exports, module) {
|
|
488
|
+
var fs = __require("fs"), getHomedir = require_homedir(), path = __require("path"), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), isCore = require_is_core_module(), $Error = require_es_errors(), $TypeError = require_type(), realpathFS = process.platform !== "win32" && fs.realpath && typeof fs.realpath.native == "function" ? fs.realpath.native : fs.realpath, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
489
|
+
function defaultPaths() {
|
|
490
|
+
return homedir ? [
|
|
491
|
+
path.join(homedir, ".node_modules"),
|
|
492
|
+
path.join(homedir, ".node_libraries")
|
|
493
|
+
] : [];
|
|
494
|
+
}
|
|
495
|
+
var defaultIsFile = function(file, cb) {
|
|
496
|
+
fs.stat(file, function(err, stat) {
|
|
497
|
+
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isFile() || stat.isFIFO());
|
|
498
|
+
});
|
|
499
|
+
}, defaultIsDir = function(dir, cb) {
|
|
500
|
+
fs.stat(dir, function(err, stat) {
|
|
501
|
+
return err ? err.code === "ENOENT" || err.code === "ENOTDIR" ? cb(null, !1) : cb(err) : cb(null, stat.isDirectory());
|
|
502
|
+
});
|
|
503
|
+
}, defaultRealpath = function(x, cb) {
|
|
504
|
+
realpathFS(x, function(realpathErr, realPath) {
|
|
505
|
+
realpathErr && realpathErr.code !== "ENOENT" ? cb(realpathErr) : cb(null, realpathErr ? x : realPath);
|
|
506
|
+
});
|
|
507
|
+
};
|
|
508
|
+
function maybeRealpath(realpath, x, opts, cb) {
|
|
509
|
+
opts && opts.preserveSymlinks === !1 ? realpath(x, cb) : cb(null, x);
|
|
510
|
+
}
|
|
511
|
+
function defaultReadPackage(readFile, pkgfile, cb) {
|
|
512
|
+
readFile(pkgfile, function(readFileErr, body) {
|
|
513
|
+
if (readFileErr) cb(readFileErr);
|
|
514
|
+
else
|
|
515
|
+
try {
|
|
516
|
+
var pkg = JSON.parse(body);
|
|
517
|
+
cb(null, pkg);
|
|
518
|
+
} catch {
|
|
519
|
+
cb(null);
|
|
520
|
+
}
|
|
521
|
+
});
|
|
522
|
+
}
|
|
523
|
+
function getPackageCandidates(x, start, opts) {
|
|
524
|
+
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
|
|
525
|
+
dirs[i] = path.join(dirs[i], x);
|
|
526
|
+
return dirs;
|
|
527
|
+
}
|
|
528
|
+
module.exports = function(x, options, callback) {
|
|
529
|
+
var cb = callback, opts = options;
|
|
530
|
+
if (typeof options == "function" && (cb = opts, opts = {}), typeof x != "string") {
|
|
531
|
+
var err = new $TypeError("Path must be a string.");
|
|
532
|
+
return process.nextTick(function() {
|
|
533
|
+
cb(err);
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
opts = normalizeOptions(x, opts);
|
|
537
|
+
var isFile = opts.isFile || defaultIsFile, isDirectory = opts.isDirectory || defaultIsDir, readFile = opts.readFile || fs.readFile, realpath = opts.realpath || defaultRealpath, readPackage = opts.readPackage || defaultReadPackage;
|
|
538
|
+
if (opts.readFile && opts.readPackage) {
|
|
539
|
+
var conflictErr = new $TypeError("`readFile` and `readPackage` are mutually exclusive.");
|
|
540
|
+
return process.nextTick(function() {
|
|
541
|
+
cb(conflictErr);
|
|
542
|
+
});
|
|
543
|
+
}
|
|
544
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path.dirname(caller()), parent = opts.filename || basedir;
|
|
545
|
+
opts.paths = opts.paths || defaultPaths();
|
|
546
|
+
var absoluteStart = path.resolve(basedir);
|
|
547
|
+
maybeRealpath(
|
|
548
|
+
realpath,
|
|
549
|
+
absoluteStart,
|
|
550
|
+
opts,
|
|
551
|
+
function(err2, realStart) {
|
|
552
|
+
err2 ? cb(err2) : init(realStart);
|
|
553
|
+
}
|
|
554
|
+
);
|
|
555
|
+
var res;
|
|
556
|
+
function init(basedir2) {
|
|
557
|
+
if (relativePathRegex.test(x))
|
|
558
|
+
res = path.resolve(basedir2, x), (x === "." || x === ".." || x.slice(-1) === "/") && (res += "/"), x.slice(-1) === "/" && res === basedir2 ? loadAsDirectory(res, opts.package, onfile) : loadAsFile(res, opts.package, onfile);
|
|
559
|
+
else {
|
|
560
|
+
if (includeCoreModules && isCore(x))
|
|
561
|
+
return cb(null, x);
|
|
562
|
+
loadNodeModules(x, basedir2, function(err2, n, pkg) {
|
|
563
|
+
if (err2) cb(err2);
|
|
564
|
+
else {
|
|
565
|
+
if (n)
|
|
566
|
+
return maybeRealpath(realpath, n, opts, function(err3, realN) {
|
|
567
|
+
err3 ? cb(err3) : cb(null, realN, pkg);
|
|
568
|
+
});
|
|
569
|
+
var moduleError = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
570
|
+
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
|
|
571
|
+
}
|
|
572
|
+
});
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
function onfile(err2, m, pkg) {
|
|
576
|
+
err2 ? cb(err2) : m ? cb(null, m, pkg) : loadAsDirectory(res, function(err3, d, pkg2) {
|
|
577
|
+
if (err3) cb(err3);
|
|
578
|
+
else if (d)
|
|
579
|
+
maybeRealpath(realpath, d, opts, function(err4, realD) {
|
|
580
|
+
err4 ? cb(err4) : cb(null, realD, pkg2);
|
|
581
|
+
});
|
|
582
|
+
else {
|
|
583
|
+
var moduleError = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
584
|
+
moduleError.code = "MODULE_NOT_FOUND", cb(moduleError);
|
|
585
|
+
}
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
function loadAsFile(x2, thePackage, callback2) {
|
|
589
|
+
var loadAsFilePackage = thePackage, cb2 = callback2;
|
|
590
|
+
typeof loadAsFilePackage == "function" && (cb2 = loadAsFilePackage, loadAsFilePackage = void 0);
|
|
591
|
+
var exts = [""].concat(extensions);
|
|
592
|
+
load(exts, x2, loadAsFilePackage);
|
|
593
|
+
function load(exts2, x3, loadPackage) {
|
|
594
|
+
if (exts2.length === 0) return cb2(null, void 0, loadPackage);
|
|
595
|
+
var file = x3 + exts2[0], pkg = loadPackage;
|
|
596
|
+
pkg ? onpkg(null, pkg) : loadpkg(path.dirname(file), onpkg);
|
|
597
|
+
function onpkg(err2, pkg_, dir) {
|
|
598
|
+
if (pkg = pkg_, err2) return cb2(err2);
|
|
599
|
+
if (dir && pkg && opts.pathFilter) {
|
|
600
|
+
var rfile = path.relative(dir, file), rel = rfile.slice(0, rfile.length - exts2[0].length), r = opts.pathFilter(pkg, x3, rel);
|
|
601
|
+
if (r) return load(
|
|
602
|
+
[""].concat(extensions),
|
|
603
|
+
path.resolve(dir, r),
|
|
604
|
+
pkg
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
isFile(file, onex);
|
|
608
|
+
}
|
|
609
|
+
function onex(err2, ex) {
|
|
610
|
+
if (err2) return cb2(err2);
|
|
611
|
+
if (ex) return cb2(null, file, pkg);
|
|
612
|
+
load(exts2.slice(1), x3, pkg);
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
function loadpkg(dir, cb2) {
|
|
617
|
+
if (dir === "" || dir === "/" || process.platform === "win32" && windowsDriveRegex.test(dir) || nodeModulesRegex.test(dir)) return cb2(null);
|
|
618
|
+
maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
|
|
619
|
+
if (unwrapErr) return loadpkg(path.dirname(dir), cb2);
|
|
620
|
+
var pkgfile = path.join(pkgdir, "package.json");
|
|
621
|
+
isFile(pkgfile, function(err2, ex) {
|
|
622
|
+
if (!ex) return loadpkg(path.dirname(dir), cb2);
|
|
623
|
+
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
624
|
+
if (err3)
|
|
625
|
+
return cb2(err3);
|
|
626
|
+
var pkg = pkgParam;
|
|
627
|
+
pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), cb2(null, pkg, dir);
|
|
628
|
+
});
|
|
629
|
+
});
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
function loadAsDirectory(x2, loadAsDirectoryPackage, callback2) {
|
|
633
|
+
var cb2 = callback2, fpkg = loadAsDirectoryPackage;
|
|
634
|
+
typeof fpkg == "function" && (cb2 = fpkg, fpkg = opts.package), maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
|
|
635
|
+
if (unwrapErr) return cb2(unwrapErr);
|
|
636
|
+
var pkgfile = path.join(pkgdir, "package.json");
|
|
637
|
+
isFile(pkgfile, function(err2, ex) {
|
|
638
|
+
if (err2) return cb2(err2);
|
|
639
|
+
if (!ex) return loadAsFile(path.join(x2, "index"), fpkg, cb2);
|
|
640
|
+
readPackage(readFile, pkgfile, function(err3, pkgParam) {
|
|
641
|
+
if (err3) return cb2(err3);
|
|
642
|
+
var pkg = pkgParam;
|
|
643
|
+
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(pkg, pkgfile)), pkg && pkg.main) {
|
|
644
|
+
if (typeof pkg.main != "string") {
|
|
645
|
+
var mainError = new $TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
646
|
+
return mainError.code = "INVALID_PACKAGE_MAIN", cb2(mainError);
|
|
647
|
+
}
|
|
648
|
+
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index"), loadAsFile(path.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
|
|
649
|
+
if (err4) return cb2(err4);
|
|
650
|
+
if (m) return cb2(null, m, pkg2);
|
|
651
|
+
if (!pkg2) return loadAsFile(path.join(x2, "index"), pkg2, cb2);
|
|
652
|
+
var dir = path.resolve(x2, pkg2.main);
|
|
653
|
+
loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
|
|
654
|
+
if (err5) return cb2(err5);
|
|
655
|
+
if (n) return cb2(null, n, pkg3);
|
|
656
|
+
loadAsFile(path.join(x2, "index"), pkg3, cb2);
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
return;
|
|
660
|
+
}
|
|
661
|
+
loadAsFile(path.join(x2, "/index"), pkg, cb2);
|
|
662
|
+
});
|
|
663
|
+
});
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
function processDirs(cb2, dirs) {
|
|
667
|
+
if (dirs.length === 0) return cb2(null, void 0);
|
|
668
|
+
var dir = dirs[0];
|
|
669
|
+
isDirectory(path.dirname(dir), isdir);
|
|
670
|
+
function isdir(err2, isdir2) {
|
|
671
|
+
if (err2) return cb2(err2);
|
|
672
|
+
if (!isdir2) return processDirs(cb2, dirs.slice(1));
|
|
673
|
+
loadAsFile(dir, opts.package, onfile2);
|
|
674
|
+
}
|
|
675
|
+
function onfile2(err2, m, pkg) {
|
|
676
|
+
if (err2) return cb2(err2);
|
|
677
|
+
if (m) return cb2(null, m, pkg);
|
|
678
|
+
loadAsDirectory(dir, opts.package, ondir);
|
|
679
|
+
}
|
|
680
|
+
function ondir(err2, n, pkg) {
|
|
681
|
+
if (err2) return cb2(err2);
|
|
682
|
+
if (n) return cb2(null, n, pkg);
|
|
683
|
+
processDirs(cb2, dirs.slice(1));
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
function loadNodeModules(x2, start, cb2) {
|
|
687
|
+
var thunk = function() {
|
|
688
|
+
return getPackageCandidates(x2, start, opts);
|
|
689
|
+
};
|
|
690
|
+
processDirs(
|
|
691
|
+
cb2,
|
|
692
|
+
packageIterator ? packageIterator(x2, start, thunk, opts) : thunk()
|
|
693
|
+
);
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
}
|
|
697
|
+
});
|
|
698
|
+
|
|
699
|
+
// ../../../node_modules/resolve/lib/core.json
|
|
700
|
+
var require_core2 = __commonJS({
|
|
701
|
+
"../../../node_modules/resolve/lib/core.json"(exports, module) {
|
|
702
|
+
module.exports = {
|
|
703
|
+
assert: !0,
|
|
704
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
705
|
+
"assert/strict": ">= 15",
|
|
706
|
+
"node:assert/strict": ">= 16",
|
|
707
|
+
async_hooks: ">= 8",
|
|
708
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
709
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
710
|
+
buffer: !0,
|
|
711
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
712
|
+
child_process: !0,
|
|
713
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
714
|
+
cluster: ">= 0.5",
|
|
715
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
716
|
+
console: !0,
|
|
717
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
718
|
+
constants: !0,
|
|
719
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
720
|
+
crypto: !0,
|
|
721
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
722
|
+
_debug_agent: ">= 1 && < 8",
|
|
723
|
+
_debugger: "< 8",
|
|
724
|
+
dgram: !0,
|
|
725
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
726
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
727
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
728
|
+
dns: !0,
|
|
729
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
730
|
+
"dns/promises": ">= 15",
|
|
731
|
+
"node:dns/promises": ">= 16",
|
|
732
|
+
domain: ">= 0.7.12",
|
|
733
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
734
|
+
events: !0,
|
|
735
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
736
|
+
freelist: "< 6",
|
|
737
|
+
fs: !0,
|
|
738
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
739
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
740
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
741
|
+
_http_agent: ">= 0.11.1",
|
|
742
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
743
|
+
_http_client: ">= 0.11.1",
|
|
744
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
745
|
+
_http_common: ">= 0.11.1",
|
|
746
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
747
|
+
_http_incoming: ">= 0.11.1",
|
|
748
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
749
|
+
_http_outgoing: ">= 0.11.1",
|
|
750
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
751
|
+
_http_server: ">= 0.11.1",
|
|
752
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
753
|
+
http: !0,
|
|
754
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
755
|
+
http2: ">= 8.8",
|
|
756
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
757
|
+
https: !0,
|
|
758
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
759
|
+
inspector: ">= 8",
|
|
760
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
761
|
+
"inspector/promises": [">= 19"],
|
|
762
|
+
"node:inspector/promises": [">= 19"],
|
|
763
|
+
_linklist: "< 8",
|
|
764
|
+
module: !0,
|
|
765
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
766
|
+
net: !0,
|
|
767
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
768
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
769
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
770
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
771
|
+
os: !0,
|
|
772
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
773
|
+
path: !0,
|
|
774
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
775
|
+
"path/posix": ">= 15.3",
|
|
776
|
+
"node:path/posix": ">= 16",
|
|
777
|
+
"path/win32": ">= 15.3",
|
|
778
|
+
"node:path/win32": ">= 16",
|
|
779
|
+
perf_hooks: ">= 8.5",
|
|
780
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
781
|
+
process: ">= 1",
|
|
782
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
783
|
+
punycode: ">= 0.5",
|
|
784
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
785
|
+
querystring: !0,
|
|
786
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
787
|
+
readline: !0,
|
|
788
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
789
|
+
"readline/promises": ">= 17",
|
|
790
|
+
"node:readline/promises": ">= 17",
|
|
791
|
+
repl: !0,
|
|
792
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
793
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
794
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
795
|
+
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
|
|
796
|
+
_stream_duplex: ">= 0.9.4",
|
|
797
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
|
|
798
|
+
_stream_transform: ">= 0.9.4",
|
|
799
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
|
|
800
|
+
_stream_wrap: ">= 1.4.1",
|
|
801
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
802
|
+
_stream_passthrough: ">= 0.9.4",
|
|
803
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
|
|
804
|
+
_stream_readable: ">= 0.9.4",
|
|
805
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
|
|
806
|
+
_stream_writable: ">= 0.9.4",
|
|
807
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
|
|
808
|
+
stream: !0,
|
|
809
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
810
|
+
"stream/consumers": ">= 16.7",
|
|
811
|
+
"node:stream/consumers": ">= 16.7",
|
|
812
|
+
"stream/promises": ">= 15",
|
|
813
|
+
"node:stream/promises": ">= 16",
|
|
814
|
+
"stream/web": ">= 16.5",
|
|
815
|
+
"node:stream/web": ">= 16.5",
|
|
816
|
+
string_decoder: !0,
|
|
817
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
818
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
819
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
820
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
821
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
822
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
823
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
824
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
825
|
+
timers: !0,
|
|
826
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
827
|
+
"timers/promises": ">= 15",
|
|
828
|
+
"node:timers/promises": ">= 16",
|
|
829
|
+
_tls_common: ">= 0.11.13",
|
|
830
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
831
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
832
|
+
_tls_wrap: ">= 0.11.3",
|
|
833
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
834
|
+
tls: !0,
|
|
835
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
836
|
+
trace_events: ">= 10",
|
|
837
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
838
|
+
tty: !0,
|
|
839
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
840
|
+
url: !0,
|
|
841
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
842
|
+
util: !0,
|
|
843
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
844
|
+
"util/types": ">= 15.3",
|
|
845
|
+
"node:util/types": ">= 16",
|
|
846
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
847
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
848
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
849
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
850
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
851
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
852
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
853
|
+
v8: ">= 1",
|
|
854
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
855
|
+
vm: !0,
|
|
856
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
857
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
858
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
859
|
+
worker_threads: ">= 11.7",
|
|
860
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
861
|
+
zlib: ">= 0.5",
|
|
862
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
863
|
+
};
|
|
864
|
+
}
|
|
865
|
+
});
|
|
866
|
+
|
|
867
|
+
// ../../../node_modules/resolve/lib/core.js
|
|
868
|
+
var require_core3 = __commonJS({
|
|
869
|
+
"../../../node_modules/resolve/lib/core.js"(exports, module) {
|
|
870
|
+
"use strict";
|
|
871
|
+
var isCoreModule = require_is_core_module(), data = require_core2(), core = {};
|
|
872
|
+
for (mod in data)
|
|
873
|
+
Object.prototype.hasOwnProperty.call(data, mod) && (core[mod] = isCoreModule(mod));
|
|
874
|
+
var mod;
|
|
875
|
+
module.exports = core;
|
|
876
|
+
}
|
|
877
|
+
});
|
|
878
|
+
|
|
879
|
+
// ../../../node_modules/resolve/lib/is-core.js
|
|
880
|
+
var require_is_core = __commonJS({
|
|
881
|
+
"../../../node_modules/resolve/lib/is-core.js"(exports, module) {
|
|
882
|
+
var isCoreModule = require_is_core_module();
|
|
883
|
+
module.exports = function(x) {
|
|
884
|
+
return isCoreModule(x);
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
});
|
|
888
|
+
|
|
889
|
+
// ../../../node_modules/resolve/lib/sync.js
|
|
890
|
+
var require_sync = __commonJS({
|
|
891
|
+
"../../../node_modules/resolve/lib/sync.js"(exports, module) {
|
|
892
|
+
var isCore = require_is_core_module(), fs = __require("fs"), path = __require("path"), $Error = require_es_errors(), $TypeError = require_type(), getHomedir = require_homedir(), caller = require_caller(), nodeModulesPaths = require_node_modules_paths(), normalizeOptions = require_normalize_options(), realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native == "function" ? fs.realpathSync.native : fs.realpathSync, relativePathRegex = /^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/, windowsDriveRegex = /^\w:[/\\]*$/, nodeModulesRegex = /[/\\]node_modules[/\\]*$/, homedir = getHomedir();
|
|
893
|
+
function defaultPaths() {
|
|
894
|
+
return homedir ? [
|
|
895
|
+
path.join(homedir, ".node_modules"),
|
|
896
|
+
path.join(homedir, ".node_libraries")
|
|
897
|
+
] : [];
|
|
898
|
+
}
|
|
899
|
+
var defaultIsFile = function(file) {
|
|
900
|
+
try {
|
|
901
|
+
var stat = fs.statSync(file, { throwIfNoEntry: !1 });
|
|
902
|
+
} catch (e) {
|
|
903
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
|
|
904
|
+
throw e;
|
|
905
|
+
}
|
|
906
|
+
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
907
|
+
}, defaultIsDir = function(dir) {
|
|
908
|
+
try {
|
|
909
|
+
var stat = fs.statSync(dir, { throwIfNoEntry: !1 });
|
|
910
|
+
} catch (e) {
|
|
911
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return !1;
|
|
912
|
+
throw e;
|
|
913
|
+
}
|
|
914
|
+
return !!stat && stat.isDirectory();
|
|
915
|
+
}, defaultRealpathSync = function(x) {
|
|
916
|
+
try {
|
|
917
|
+
return realpathFS(x);
|
|
918
|
+
} catch (realpathErr) {
|
|
919
|
+
if (realpathErr.code !== "ENOENT")
|
|
920
|
+
throw realpathErr;
|
|
921
|
+
}
|
|
922
|
+
return x;
|
|
923
|
+
};
|
|
924
|
+
function maybeRealpathSync(realpathSync, x, opts) {
|
|
925
|
+
return opts && opts.preserveSymlinks === !1 ? realpathSync(x) : x;
|
|
926
|
+
}
|
|
927
|
+
function defaultReadPackageSync(readFileSync, pkgfile) {
|
|
928
|
+
var body = readFileSync(pkgfile);
|
|
929
|
+
try {
|
|
930
|
+
var pkg = JSON.parse(body);
|
|
931
|
+
return pkg;
|
|
932
|
+
} catch {
|
|
933
|
+
}
|
|
934
|
+
}
|
|
935
|
+
function getPackageCandidates(x, start, opts) {
|
|
936
|
+
for (var dirs = nodeModulesPaths(start, opts, x), i = 0; i < dirs.length; i++)
|
|
937
|
+
dirs[i] = path.join(dirs[i], x);
|
|
938
|
+
return dirs;
|
|
939
|
+
}
|
|
940
|
+
module.exports = function(x, options) {
|
|
941
|
+
if (typeof x != "string")
|
|
942
|
+
throw new $TypeError("Path must be a string.");
|
|
943
|
+
var opts = normalizeOptions(x, options), isFile = opts.isFile || defaultIsFile, readFileSync = opts.readFileSync || fs.readFileSync, isDirectory = opts.isDirectory || defaultIsDir, realpathSync = opts.realpathSync || defaultRealpathSync, readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
944
|
+
if (opts.readFileSync && opts.readPackageSync)
|
|
945
|
+
throw new $TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
946
|
+
var packageIterator = opts.packageIterator, extensions = opts.extensions || [".js"], includeCoreModules = opts.includeCoreModules !== !1, basedir = opts.basedir || path.dirname(caller()), parent = opts.filename || basedir;
|
|
947
|
+
opts.paths = opts.paths || defaultPaths();
|
|
948
|
+
var absoluteStart = maybeRealpathSync(realpathSync, path.resolve(basedir), opts);
|
|
949
|
+
if (relativePathRegex.test(x)) {
|
|
950
|
+
var res = path.resolve(absoluteStart, x);
|
|
951
|
+
(x === "." || x === ".." || x.slice(-1) === "/") && (res += "/");
|
|
952
|
+
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
953
|
+
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
954
|
+
} else {
|
|
955
|
+
if (includeCoreModules && isCore(x))
|
|
956
|
+
return x;
|
|
957
|
+
var n = loadNodeModulesSync(x, absoluteStart);
|
|
958
|
+
if (n) return maybeRealpathSync(realpathSync, n, opts);
|
|
959
|
+
}
|
|
960
|
+
var err = new $Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
961
|
+
throw err.code = "MODULE_NOT_FOUND", err;
|
|
962
|
+
function loadAsFileSync(x2) {
|
|
963
|
+
var pkg = loadpkg(path.dirname(x2));
|
|
964
|
+
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
965
|
+
var rfile = path.relative(pkg.dir, x2), r = opts.pathFilter(pkg.pkg, x2, rfile);
|
|
966
|
+
r && (x2 = path.resolve(pkg.dir, r));
|
|
967
|
+
}
|
|
968
|
+
if (isFile(x2))
|
|
969
|
+
return x2;
|
|
970
|
+
for (var i = 0; i < extensions.length; i++) {
|
|
971
|
+
var file = x2 + extensions[i];
|
|
972
|
+
if (isFile(file))
|
|
973
|
+
return file;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
function loadpkg(dir) {
|
|
977
|
+
if (!(dir === "" || dir === "/") && !(process.platform === "win32" && windowsDriveRegex.test(dir)) && !nodeModulesRegex.test(dir)) {
|
|
978
|
+
var pkgfile = path.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
|
|
979
|
+
if (!isFile(pkgfile))
|
|
980
|
+
return loadpkg(path.dirname(dir));
|
|
981
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
982
|
+
return pkg && opts.packageFilter && (pkg = opts.packageFilter(
|
|
983
|
+
pkg,
|
|
984
|
+
/*pkgfile,*/
|
|
985
|
+
dir
|
|
986
|
+
)), { pkg, dir };
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
function loadAsDirectorySync(x2) {
|
|
990
|
+
var pkgfile = path.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
|
|
991
|
+
if (isFile(pkgfile)) {
|
|
992
|
+
try {
|
|
993
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
994
|
+
} catch {
|
|
995
|
+
}
|
|
996
|
+
if (pkg && opts.packageFilter && (pkg = opts.packageFilter(
|
|
997
|
+
pkg,
|
|
998
|
+
/*pkgfile,*/
|
|
999
|
+
x2
|
|
1000
|
+
)), pkg && pkg.main) {
|
|
1001
|
+
if (typeof pkg.main != "string") {
|
|
1002
|
+
var mainError = new $TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
1003
|
+
throw mainError.code = "INVALID_PACKAGE_MAIN", mainError;
|
|
1004
|
+
}
|
|
1005
|
+
(pkg.main === "." || pkg.main === "./") && (pkg.main = "index");
|
|
1006
|
+
try {
|
|
1007
|
+
var m2 = loadAsFileSync(path.resolve(x2, pkg.main));
|
|
1008
|
+
if (m2) return m2;
|
|
1009
|
+
var n2 = loadAsDirectorySync(path.resolve(x2, pkg.main));
|
|
1010
|
+
if (n2) return n2;
|
|
1011
|
+
} catch {
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
}
|
|
1015
|
+
return loadAsFileSync(path.join(x2, "/index"));
|
|
1016
|
+
}
|
|
1017
|
+
function loadNodeModulesSync(x2, start) {
|
|
1018
|
+
for (var thunk = function() {
|
|
1019
|
+
return getPackageCandidates(x2, start, opts);
|
|
1020
|
+
}, dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk(), i = 0; i < dirs.length; i++) {
|
|
1021
|
+
var dir = dirs[i];
|
|
1022
|
+
if (isDirectory(path.dirname(dir))) {
|
|
1023
|
+
var m2 = loadAsFileSync(dir);
|
|
1024
|
+
if (m2) return m2;
|
|
1025
|
+
var n2 = loadAsDirectorySync(dir);
|
|
1026
|
+
if (n2) return n2;
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
1033
|
+
|
|
1034
|
+
// ../../../node_modules/resolve/index.js
|
|
1035
|
+
var require_resolve = __commonJS({
|
|
1036
|
+
"../../../node_modules/resolve/index.js"(exports, module) {
|
|
1037
|
+
var async = require_async();
|
|
1038
|
+
async.core = require_core3();
|
|
1039
|
+
async.isCore = require_is_core();
|
|
1040
|
+
async.sync = require_sync();
|
|
1041
|
+
module.exports = async;
|
|
1042
|
+
}
|
|
1043
|
+
});
|
|
1044
|
+
|
|
1045
|
+
// src/componentManifest/reactDocgen.ts
|
|
1046
|
+
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
1047
|
+
import { existsSync } from "node:fs";
|
|
1048
|
+
import { dirname, sep } from "node:path";
|
|
1049
|
+
import { supportedExtensions as supportedExtensions2 } from "storybook/internal/common";
|
|
1050
|
+
import { parseModule } from "storybook/internal/csf-tools";
|
|
1051
|
+
import { logger } from "storybook/internal/node-logger";
|
|
1052
|
+
import {
|
|
1053
|
+
builtinHandlers as docgenHandlers,
|
|
1054
|
+
builtinResolvers as docgenResolver,
|
|
1055
|
+
makeFsImporter,
|
|
1056
|
+
parse
|
|
1057
|
+
} from "react-docgen";
|
|
1058
|
+
|
|
1059
|
+
// src/componentManifest/reactDocgen/actualNameHandler.ts
|
|
1060
|
+
import { utils } from "react-docgen";
|
|
1061
|
+
var { getNameOrValue, isReactForwardRefCall } = utils, actualNameHandler = function(documentation, componentDefinition) {
|
|
1062
|
+
if (documentation.set("definedInFile", componentDefinition.hub.file.opts.filename), (componentDefinition.isClassDeclaration() || componentDefinition.isFunctionDeclaration()) && componentDefinition.has("id"))
|
|
1063
|
+
documentation.set(
|
|
1064
|
+
"actualName",
|
|
1065
|
+
getNameOrValue(componentDefinition.get("id"))
|
|
1066
|
+
);
|
|
1067
|
+
else if (componentDefinition.isArrowFunctionExpression() || componentDefinition.isFunctionExpression() || isReactForwardRefCall(componentDefinition)) {
|
|
1068
|
+
let currentPath = componentDefinition;
|
|
1069
|
+
for (; currentPath.parentPath; ) {
|
|
1070
|
+
if (currentPath.parentPath.isVariableDeclarator()) {
|
|
1071
|
+
documentation.set("actualName", getNameOrValue(currentPath.parentPath.get("id")));
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1074
|
+
if (currentPath.parentPath.isAssignmentExpression()) {
|
|
1075
|
+
let leftPath = currentPath.parentPath.get("left");
|
|
1076
|
+
if (leftPath.isIdentifier() || leftPath.isLiteral()) {
|
|
1077
|
+
documentation.set("actualName", getNameOrValue(leftPath));
|
|
1078
|
+
return;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
currentPath = currentPath.parentPath;
|
|
1082
|
+
}
|
|
1083
|
+
documentation.set("actualName", "");
|
|
1084
|
+
}
|
|
1085
|
+
}, actualNameHandler_default = actualNameHandler;
|
|
1086
|
+
|
|
1087
|
+
// src/componentManifest/reactDocgen/docgenResolver.ts
|
|
1088
|
+
var import_resolve = __toESM(require_resolve(), 1);
|
|
1089
|
+
import { supportedExtensions } from "storybook/internal/common";
|
|
1090
|
+
var ReactDocgenResolveError = class extends Error {
|
|
1091
|
+
constructor(filename) {
|
|
1092
|
+
super(`'${filename}' was ignored by react-docgen.`);
|
|
1093
|
+
// the magic string that react-docgen uses to check if a module is ignored
|
|
1094
|
+
this.code = "MODULE_NOT_FOUND";
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
// src/componentManifest/reactDocgen/exportNameHandler.ts
|
|
1099
|
+
import { utils as utils2 } from "react-docgen";
|
|
1100
|
+
var { isReactForwardRefCall: isReactForwardRefCall2 } = utils2;
|
|
1101
|
+
function nameFromId(path) {
|
|
1102
|
+
if (path) {
|
|
1103
|
+
if (path.isIdentifier())
|
|
1104
|
+
return path.node.name;
|
|
1105
|
+
if (path.isStringLiteral())
|
|
1106
|
+
return path.node.value;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
function isInlineDefaultExport(path) {
|
|
1110
|
+
let p = path;
|
|
1111
|
+
for (; p && p.parentPath; ) {
|
|
1112
|
+
if (p.parentPath.isExportDefaultDeclaration())
|
|
1113
|
+
return !0;
|
|
1114
|
+
p = p.parentPath;
|
|
1115
|
+
}
|
|
1116
|
+
return !1;
|
|
1117
|
+
}
|
|
1118
|
+
function findProgram(path) {
|
|
1119
|
+
let found = path.findParent((p) => p.isProgram());
|
|
1120
|
+
return found && found.isProgram() ? found : void 0;
|
|
1121
|
+
}
|
|
1122
|
+
function getLocalName(componentDefinition, fallback) {
|
|
1123
|
+
if (fallback)
|
|
1124
|
+
return fallback;
|
|
1125
|
+
if ((componentDefinition.isClassDeclaration() || componentDefinition.isFunctionDeclaration()) && componentDefinition.has("id")) {
|
|
1126
|
+
let idPath = componentDefinition.get("id");
|
|
1127
|
+
return nameFromId(idPath);
|
|
1128
|
+
}
|
|
1129
|
+
if (componentDefinition.isArrowFunctionExpression() || componentDefinition.isFunctionExpression() || isReactForwardRefCall2(componentDefinition)) {
|
|
1130
|
+
let p = componentDefinition;
|
|
1131
|
+
for (; p && p.parentPath; ) {
|
|
1132
|
+
if (p.parentPath.isVariableDeclarator()) {
|
|
1133
|
+
let id = p.parentPath.get("id");
|
|
1134
|
+
return nameFromId(id);
|
|
1135
|
+
}
|
|
1136
|
+
if (p.parentPath.isAssignmentExpression()) {
|
|
1137
|
+
let left = p.parentPath.get("left"), lhs = nameFromId(left);
|
|
1138
|
+
if (lhs)
|
|
1139
|
+
return lhs;
|
|
1140
|
+
}
|
|
1141
|
+
p = p.parentPath;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
}
|
|
1145
|
+
var exportNameHandler = (documentation, componentDefinition) => {
|
|
1146
|
+
if (isInlineDefaultExport(componentDefinition)) {
|
|
1147
|
+
documentation.set("exportName", "default");
|
|
1148
|
+
return;
|
|
1149
|
+
}
|
|
1150
|
+
let actual = documentation.get("actualName"), localName = getLocalName(componentDefinition, typeof actual == "string" ? actual : void 0), programPath = findProgram(componentDefinition);
|
|
1151
|
+
if (!programPath) {
|
|
1152
|
+
documentation.set("exportName", void 0);
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
let body = programPath.get("body");
|
|
1156
|
+
for (let stmt of body) {
|
|
1157
|
+
if (stmt.isExportNamedDeclaration() && stmt.has("declaration")) {
|
|
1158
|
+
let decl = stmt.get("declaration");
|
|
1159
|
+
if (decl.isFunctionDeclaration() || decl.isClassDeclaration()) {
|
|
1160
|
+
let name = nameFromId(decl.get("id"));
|
|
1161
|
+
if (name && name === localName) {
|
|
1162
|
+
documentation.set("exportName", name);
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
if (decl.isVariableDeclaration()) {
|
|
1167
|
+
let decls = decl.get("declarations");
|
|
1168
|
+
for (let d of decls)
|
|
1169
|
+
if (d.isVariableDeclarator()) {
|
|
1170
|
+
let id = d.get("id");
|
|
1171
|
+
if (id.isIdentifier() && id.node.name === localName) {
|
|
1172
|
+
documentation.set("exportName", localName);
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
if (stmt.isExportNamedDeclaration() && stmt.has("specifiers")) {
|
|
1179
|
+
let specs = stmt.get("specifiers");
|
|
1180
|
+
for (let s of specs)
|
|
1181
|
+
if (s.isExportSpecifier()) {
|
|
1182
|
+
let local = nameFromId(s.get("local")), exported = nameFromId(s.get("exported"));
|
|
1183
|
+
if (local && local === localName) {
|
|
1184
|
+
documentation.set(
|
|
1185
|
+
"exportName",
|
|
1186
|
+
exported === "default" ? "default" : exported ?? local
|
|
1187
|
+
);
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
if (stmt.isExportDefaultDeclaration()) {
|
|
1193
|
+
let decl = stmt.get("declaration");
|
|
1194
|
+
for (; decl.isTSAsExpression() || decl.isParenthesizedExpression(); )
|
|
1195
|
+
decl = decl.get("expression");
|
|
1196
|
+
if (decl.isIdentifier() && decl.node.name === localName) {
|
|
1197
|
+
documentation.set("exportName", "default");
|
|
1198
|
+
return;
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
documentation.set("exportName", void 0);
|
|
1203
|
+
}, exportNameHandler_default = exportNameHandler;
|
|
1204
|
+
|
|
1205
|
+
// src/componentManifest/reactDocgen.ts
|
|
1206
|
+
var defaultHandlers = Object.values(docgenHandlers).map((handler) => handler), defaultResolver = new docgenResolver.FindExportedDefinitionsResolver(), handlers = [...defaultHandlers, actualNameHandler_default, exportNameHandler_default];
|
|
1207
|
+
function getMatchingDocgen(docgens, component) {
|
|
1208
|
+
if (docgens.length === 0)
|
|
1209
|
+
return;
|
|
1210
|
+
if (docgens.length === 1)
|
|
1211
|
+
return docgens[0];
|
|
1212
|
+
if (component.importName === "default") {
|
|
1213
|
+
let defaultExports = docgens.filter((docgen) => docgen.exportName === "default");
|
|
1214
|
+
if (defaultExports.length === 1)
|
|
1215
|
+
return defaultExports[0];
|
|
1216
|
+
let names = new Set([component.localImportName, component.componentName].filter(Boolean)), matchingName = docgens.find(
|
|
1217
|
+
(docgen) => names.has(docgen.actualName) || docgen.displayName && names.has(docgen.displayName)
|
|
1218
|
+
);
|
|
1219
|
+
if (matchingName)
|
|
1220
|
+
return matchingName;
|
|
1221
|
+
}
|
|
1222
|
+
return docgens.find(
|
|
1223
|
+
(docgen) => [component.importName, component.localImportName].includes(docgen.exportName)
|
|
1224
|
+
) ?? docgens.find(
|
|
1225
|
+
(docgen) => [component.importName, component.localImportName, component.componentName].includes(
|
|
1226
|
+
docgen.displayName
|
|
1227
|
+
) || [component.importName, component.localImportName, component.componentName].includes(
|
|
1228
|
+
docgen.actualName
|
|
1229
|
+
)
|
|
1230
|
+
) ?? docgens[0];
|
|
1231
|
+
}
|
|
1232
|
+
var parseWithReactDocgen = cached(
|
|
1233
|
+
(code, path) => parse(code, {
|
|
1234
|
+
resolver: defaultResolver,
|
|
1235
|
+
handlers,
|
|
1236
|
+
importer: getReactDocgenImporter(),
|
|
1237
|
+
filename: path
|
|
1238
|
+
}),
|
|
1239
|
+
{ key: (code, path) => path, name: "parseWithReactDocgen" }
|
|
1240
|
+
), getExportPaths = cached(
|
|
1241
|
+
(code, filePath) => {
|
|
1242
|
+
let program;
|
|
1243
|
+
try {
|
|
1244
|
+
program = parseModule(code, filePath).program;
|
|
1245
|
+
} catch {
|
|
1246
|
+
return [];
|
|
1247
|
+
}
|
|
1248
|
+
let basedir = dirname(filePath);
|
|
1249
|
+
return program.body.flatMap(
|
|
1250
|
+
(statement) => statement.type === "ExportAllDeclaration" ? [statement.source.value] : statement.type === "ExportNamedDeclaration" && statement.source && !statement.declaration ? [statement.source.value] : []
|
|
1251
|
+
).map((id) => matchPath(id, filePath)).flatMap((id) => {
|
|
1252
|
+
try {
|
|
1253
|
+
return [cachedResolveImport(id, { basedir })];
|
|
1254
|
+
} catch (e) {
|
|
1255
|
+
return logger.debug(e), [];
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
},
|
|
1259
|
+
{ name: "getExportPaths" }
|
|
1260
|
+
), gatherDocgensForPath = cached(
|
|
1261
|
+
(path, depth) => {
|
|
1262
|
+
if (path.includes("node_modules"))
|
|
1263
|
+
return {
|
|
1264
|
+
docgens: [],
|
|
1265
|
+
errors: [
|
|
1266
|
+
{
|
|
1267
|
+
path,
|
|
1268
|
+
code: "/* File in node_modules */",
|
|
1269
|
+
name: "Component file in node_modules",
|
|
1270
|
+
message: import_ts_dedent.dedent`
|
|
1271
|
+
Component files in node_modules are not supported.
|
|
1272
|
+
The distributed files in node_modules usually don't contain the necessary comments or types needed to analyze component information.
|
|
1273
|
+
Configure TypeScript path aliases to map your package name to the source file instead.
|
|
1274
|
+
|
|
1275
|
+
Example (tsconfig.json):
|
|
1276
|
+
{
|
|
1277
|
+
"compilerOptions": {
|
|
1278
|
+
"baseUrl": ".",
|
|
1279
|
+
"paths": {
|
|
1280
|
+
"@design-system/button": ["src/components/Button.tsx"],
|
|
1281
|
+
"@design-system/*": ["src/components/*"]
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
Then import using:
|
|
1287
|
+
import { Button } from '@design-system/button'
|
|
1288
|
+
|
|
1289
|
+
Storybook resolves tsconfig paths automatically.
|
|
1290
|
+
`
|
|
1291
|
+
}
|
|
1292
|
+
]
|
|
1293
|
+
};
|
|
1294
|
+
let code;
|
|
1295
|
+
try {
|
|
1296
|
+
code = cachedReadFileSync(path, "utf-8");
|
|
1297
|
+
} catch {
|
|
1298
|
+
return {
|
|
1299
|
+
docgens: [],
|
|
1300
|
+
errors: [
|
|
1301
|
+
{
|
|
1302
|
+
path,
|
|
1303
|
+
code: "/* File not found or unreadable */",
|
|
1304
|
+
name: "Component file could not be read",
|
|
1305
|
+
message: `Could not read the component file located at "${path}".
|
|
1306
|
+
Prefer relative imports if possible.`
|
|
1307
|
+
}
|
|
1308
|
+
]
|
|
1309
|
+
};
|
|
1310
|
+
}
|
|
1311
|
+
if (depth > 5)
|
|
1312
|
+
return {
|
|
1313
|
+
docgens: [],
|
|
1314
|
+
errors: [
|
|
1315
|
+
{
|
|
1316
|
+
path,
|
|
1317
|
+
code,
|
|
1318
|
+
name: "Max re-export depth exceeded",
|
|
1319
|
+
message: import_ts_dedent.dedent`
|
|
1320
|
+
Traversal stopped after 5 steps while following re-exports starting from this file.
|
|
1321
|
+
This usually indicates a deep or circular re-export chain. Try one of the following:
|
|
1322
|
+
- Import the component file directly (e.g., src/components/Button.tsx),
|
|
1323
|
+
- Reduce the number of re-export hops.
|
|
1324
|
+
`
|
|
1325
|
+
}
|
|
1326
|
+
]
|
|
1327
|
+
};
|
|
1328
|
+
let exportPaths = getExportPaths(code, path).map((p) => gatherDocgensForPath(p, depth + 1)), docgens = exportPaths.flatMap((r) => r.docgens), errors = exportPaths.flatMap((r) => r.errors);
|
|
1329
|
+
try {
|
|
1330
|
+
return {
|
|
1331
|
+
docgens: [...parseWithReactDocgen(code, path), ...docgens],
|
|
1332
|
+
errors
|
|
1333
|
+
};
|
|
1334
|
+
} catch (e) {
|
|
1335
|
+
let message = e instanceof Error ? e.message : String(e);
|
|
1336
|
+
return {
|
|
1337
|
+
docgens,
|
|
1338
|
+
errors: [
|
|
1339
|
+
{
|
|
1340
|
+
path,
|
|
1341
|
+
code,
|
|
1342
|
+
name: "No component definition found",
|
|
1343
|
+
message: import_ts_dedent.dedent`
|
|
1344
|
+
${message}
|
|
1345
|
+
You can debug your component file in this playground: https://react-docgen.dev/playground
|
|
1346
|
+
`
|
|
1347
|
+
},
|
|
1348
|
+
...errors
|
|
1349
|
+
]
|
|
1350
|
+
};
|
|
1351
|
+
}
|
|
1352
|
+
},
|
|
1353
|
+
{ name: "gatherDocgensWithTrace", key: (filePath) => filePath }
|
|
1354
|
+
), getReactDocgen = cached(
|
|
1355
|
+
(path, component) => {
|
|
1356
|
+
let { docgens, errors } = gatherDocgensForPath(path, 0), docgen = getMatchingDocgen(docgens, component);
|
|
1357
|
+
return docgen ? { type: "success", data: docgen } : { type: "error", error: {
|
|
1358
|
+
name: errors.at(-1)?.name ?? "No component definition found",
|
|
1359
|
+
message: errors.map(
|
|
1360
|
+
(e) => import_ts_dedent.dedent`
|
|
1361
|
+
File: ${e.path}
|
|
1362
|
+
Error:
|
|
1363
|
+
${e.message}
|
|
1364
|
+
Code:
|
|
1365
|
+
${e.code}`
|
|
1366
|
+
).join(`
|
|
1367
|
+
|
|
1368
|
+
`)
|
|
1369
|
+
} };
|
|
1370
|
+
},
|
|
1371
|
+
{ name: "getReactDocgen", key: (path, component) => path + JSON.stringify(component) }
|
|
1372
|
+
);
|
|
1373
|
+
function getReactDocgenImporter() {
|
|
1374
|
+
return makeFsImporter((filename, basedir) => {
|
|
1375
|
+
let mappedFilenameByPaths = matchPath(filename, basedir), result = cachedResolveImport(mappedFilenameByPaths, { basedir });
|
|
1376
|
+
if (result.includes(`${sep}react-native${sep}index.js`)) {
|
|
1377
|
+
let replaced = result.replace(
|
|
1378
|
+
`${sep}react-native${sep}index.js`,
|
|
1379
|
+
`${sep}react-native-web${sep}dist${sep}index.js`
|
|
1380
|
+
);
|
|
1381
|
+
if (existsSync(replaced) && supportedExtensions2.find((ext) => result.endsWith(ext)))
|
|
1382
|
+
return replaced;
|
|
1383
|
+
}
|
|
1384
|
+
if (supportedExtensions2.find((ext) => result.endsWith(ext)))
|
|
1385
|
+
return result;
|
|
1386
|
+
throw new ReactDocgenResolveError(filename);
|
|
1387
|
+
});
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
export {
|
|
1391
|
+
getMatchingDocgen,
|
|
1392
|
+
parseWithReactDocgen,
|
|
1393
|
+
getReactDocgen,
|
|
1394
|
+
getReactDocgenImporter
|
|
1395
|
+
};
|