@storybook/react 10.1.0-alpha.1 → 10.1.0-alpha.3
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-HBQ5Y6GW.js → chunk-APL3BLM6.js} +1 -1
- package/dist/_browser-chunks/{chunk-O24TFCLO.js → chunk-LBDZ5UD7.js} +1 -1
- package/dist/entry-preview-docs.js +1 -1
- package/dist/index.js +2 -2
- package/dist/preset.js +4837 -10
- package/dist/preview.js +2 -2
- package/package.json +5 -3
package/dist/preset.js
CHANGED
|
@@ -1,16 +1,3414 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_eqmqwiqjsm4 from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_eqmqwiqjsm4 from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_eqmqwiqjsm4 from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_eqmqwiqjsm4.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_eqmqwiqjsm4.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_eqmqwiqjsm4.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
+
var __create = Object.create;
|
|
12
13
|
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
15
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
16
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
17
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
18
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
19
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
20
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
21
|
+
}) : x)(function(x) {
|
|
22
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
23
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
24
|
+
});
|
|
25
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
26
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from))
|
|
31
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
32
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
33
|
+
}
|
|
34
|
+
return to;
|
|
35
|
+
};
|
|
36
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
37
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
38
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
39
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
40
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
41
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
|
+
mod
|
|
43
|
+
));
|
|
44
|
+
|
|
45
|
+
// ../../node_modules/tsconfig-paths/lib/filesystem.js
|
|
46
|
+
var require_filesystem = __commonJS({
|
|
47
|
+
"../../node_modules/tsconfig-paths/lib/filesystem.js"(exports) {
|
|
48
|
+
"use strict";
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.removeExtension = exports.fileExistsAsync = exports.readJsonFromDiskAsync = exports.readJsonFromDiskSync = exports.fileExistsSync = void 0;
|
|
51
|
+
var fs = __require("fs");
|
|
52
|
+
function fileExistsSync(path2) {
|
|
53
|
+
if (!fs.existsSync(path2)) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
try {
|
|
57
|
+
var stats = fs.statSync(path2);
|
|
58
|
+
return stats.isFile();
|
|
59
|
+
} catch (err) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
__name(fileExistsSync, "fileExistsSync");
|
|
64
|
+
exports.fileExistsSync = fileExistsSync;
|
|
65
|
+
function readJsonFromDiskSync(packageJsonPath) {
|
|
66
|
+
if (!fs.existsSync(packageJsonPath)) {
|
|
67
|
+
return void 0;
|
|
68
|
+
}
|
|
69
|
+
return __require(packageJsonPath);
|
|
70
|
+
}
|
|
71
|
+
__name(readJsonFromDiskSync, "readJsonFromDiskSync");
|
|
72
|
+
exports.readJsonFromDiskSync = readJsonFromDiskSync;
|
|
73
|
+
function readJsonFromDiskAsync(path2, callback) {
|
|
74
|
+
fs.readFile(path2, "utf8", function(err, result) {
|
|
75
|
+
if (err || !result) {
|
|
76
|
+
return callback();
|
|
77
|
+
}
|
|
78
|
+
var json = JSON.parse(result);
|
|
79
|
+
return callback(void 0, json);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
__name(readJsonFromDiskAsync, "readJsonFromDiskAsync");
|
|
83
|
+
exports.readJsonFromDiskAsync = readJsonFromDiskAsync;
|
|
84
|
+
function fileExistsAsync(path2, callback2) {
|
|
85
|
+
fs.stat(path2, function(err, stats) {
|
|
86
|
+
if (err) {
|
|
87
|
+
return callback2(void 0, false);
|
|
88
|
+
}
|
|
89
|
+
callback2(void 0, stats ? stats.isFile() : false);
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
__name(fileExistsAsync, "fileExistsAsync");
|
|
93
|
+
exports.fileExistsAsync = fileExistsAsync;
|
|
94
|
+
function removeExtension(path2) {
|
|
95
|
+
return path2.substring(0, path2.lastIndexOf(".")) || path2;
|
|
96
|
+
}
|
|
97
|
+
__name(removeExtension, "removeExtension");
|
|
98
|
+
exports.removeExtension = removeExtension;
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
// ../../node_modules/tsconfig-paths/lib/mapping-entry.js
|
|
103
|
+
var require_mapping_entry = __commonJS({
|
|
104
|
+
"../../node_modules/tsconfig-paths/lib/mapping-entry.js"(exports) {
|
|
105
|
+
"use strict";
|
|
106
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
107
|
+
exports.getAbsoluteMappingEntries = void 0;
|
|
108
|
+
var path2 = __require("path");
|
|
109
|
+
function getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll) {
|
|
110
|
+
var sortedKeys = sortByLongestPrefix(Object.keys(paths));
|
|
111
|
+
var absolutePaths = [];
|
|
112
|
+
for (var _i = 0, sortedKeys_1 = sortedKeys; _i < sortedKeys_1.length; _i++) {
|
|
113
|
+
var key = sortedKeys_1[_i];
|
|
114
|
+
absolutePaths.push({
|
|
115
|
+
pattern: key,
|
|
116
|
+
paths: paths[key].map(function(pathToResolve) {
|
|
117
|
+
return path2.resolve(absoluteBaseUrl, pathToResolve);
|
|
118
|
+
})
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
if (!paths["*"] && addMatchAll) {
|
|
122
|
+
absolutePaths.push({
|
|
123
|
+
pattern: "*",
|
|
124
|
+
paths: ["".concat(absoluteBaseUrl.replace(/\/$/, ""), "/*")]
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
return absolutePaths;
|
|
128
|
+
}
|
|
129
|
+
__name(getAbsoluteMappingEntries, "getAbsoluteMappingEntries");
|
|
130
|
+
exports.getAbsoluteMappingEntries = getAbsoluteMappingEntries;
|
|
131
|
+
function sortByLongestPrefix(arr) {
|
|
132
|
+
return arr.concat().sort(function(a, b) {
|
|
133
|
+
return getPrefixLength(b) - getPrefixLength(a);
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
__name(sortByLongestPrefix, "sortByLongestPrefix");
|
|
137
|
+
function getPrefixLength(pattern) {
|
|
138
|
+
var prefixLength = pattern.indexOf("*");
|
|
139
|
+
return pattern.substr(0, prefixLength).length;
|
|
140
|
+
}
|
|
141
|
+
__name(getPrefixLength, "getPrefixLength");
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
// ../../node_modules/tsconfig-paths/lib/try-path.js
|
|
146
|
+
var require_try_path = __commonJS({
|
|
147
|
+
"../../node_modules/tsconfig-paths/lib/try-path.js"(exports) {
|
|
148
|
+
"use strict";
|
|
149
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
150
|
+
exports.exhaustiveTypeException = exports.getStrippedPath = exports.getPathsToTry = void 0;
|
|
151
|
+
var path2 = __require("path");
|
|
152
|
+
var path_1 = __require("path");
|
|
153
|
+
var filesystem_1 = require_filesystem();
|
|
154
|
+
function getPathsToTry(extensions, absolutePathMappings, requestedModule) {
|
|
155
|
+
if (!absolutePathMappings || !requestedModule || requestedModule[0] === ".") {
|
|
156
|
+
return void 0;
|
|
157
|
+
}
|
|
158
|
+
var pathsToTry = [];
|
|
159
|
+
for (var _i = 0, absolutePathMappings_1 = absolutePathMappings; _i < absolutePathMappings_1.length; _i++) {
|
|
160
|
+
var entry = absolutePathMappings_1[_i];
|
|
161
|
+
var starMatch = entry.pattern === requestedModule ? "" : matchStar(entry.pattern, requestedModule);
|
|
162
|
+
if (starMatch !== void 0) {
|
|
163
|
+
var _loop_1 = /* @__PURE__ */ __name(function(physicalPathPattern2) {
|
|
164
|
+
var physicalPath = physicalPathPattern2.replace("*", starMatch);
|
|
165
|
+
pathsToTry.push({ type: "file", path: physicalPath });
|
|
166
|
+
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
167
|
+
return { type: "extension", path: physicalPath + e };
|
|
168
|
+
}));
|
|
169
|
+
pathsToTry.push({
|
|
170
|
+
type: "package",
|
|
171
|
+
path: path2.join(physicalPath, "/package.json")
|
|
172
|
+
});
|
|
173
|
+
var indexPath = path2.join(physicalPath, "/index");
|
|
174
|
+
pathsToTry.push.apply(pathsToTry, extensions.map(function(e) {
|
|
175
|
+
return { type: "index", path: indexPath + e };
|
|
176
|
+
}));
|
|
177
|
+
}, "_loop_1");
|
|
178
|
+
for (var _a = 0, _b = entry.paths; _a < _b.length; _a++) {
|
|
179
|
+
var physicalPathPattern = _b[_a];
|
|
180
|
+
_loop_1(physicalPathPattern);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
return pathsToTry.length === 0 ? void 0 : pathsToTry;
|
|
185
|
+
}
|
|
186
|
+
__name(getPathsToTry, "getPathsToTry");
|
|
187
|
+
exports.getPathsToTry = getPathsToTry;
|
|
188
|
+
function getStrippedPath(tryPath) {
|
|
189
|
+
return tryPath.type === "index" ? (0, path_1.dirname)(tryPath.path) : tryPath.type === "file" ? tryPath.path : tryPath.type === "extension" ? (0, filesystem_1.removeExtension)(tryPath.path) : tryPath.type === "package" ? tryPath.path : exhaustiveTypeException(tryPath.type);
|
|
190
|
+
}
|
|
191
|
+
__name(getStrippedPath, "getStrippedPath");
|
|
192
|
+
exports.getStrippedPath = getStrippedPath;
|
|
193
|
+
function exhaustiveTypeException(check) {
|
|
194
|
+
throw new Error("Unknown type ".concat(check));
|
|
195
|
+
}
|
|
196
|
+
__name(exhaustiveTypeException, "exhaustiveTypeException");
|
|
197
|
+
exports.exhaustiveTypeException = exhaustiveTypeException;
|
|
198
|
+
function matchStar(pattern, search) {
|
|
199
|
+
if (search.length < pattern.length) {
|
|
200
|
+
return void 0;
|
|
201
|
+
}
|
|
202
|
+
if (pattern === "*") {
|
|
203
|
+
return search;
|
|
204
|
+
}
|
|
205
|
+
var star = pattern.indexOf("*");
|
|
206
|
+
if (star === -1) {
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
var part1 = pattern.substring(0, star);
|
|
210
|
+
var part2 = pattern.substring(star + 1);
|
|
211
|
+
if (search.substr(0, star) !== part1) {
|
|
212
|
+
return void 0;
|
|
213
|
+
}
|
|
214
|
+
if (search.substr(search.length - part2.length) !== part2) {
|
|
215
|
+
return void 0;
|
|
216
|
+
}
|
|
217
|
+
return search.substr(star, search.length - part2.length);
|
|
218
|
+
}
|
|
219
|
+
__name(matchStar, "matchStar");
|
|
220
|
+
}
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
// ../../node_modules/tsconfig-paths/lib/match-path-sync.js
|
|
224
|
+
var require_match_path_sync = __commonJS({
|
|
225
|
+
"../../node_modules/tsconfig-paths/lib/match-path-sync.js"(exports) {
|
|
226
|
+
"use strict";
|
|
227
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
228
|
+
exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
229
|
+
var path2 = __require("path");
|
|
230
|
+
var Filesystem = require_filesystem();
|
|
231
|
+
var MappingEntry = require_mapping_entry();
|
|
232
|
+
var TryPath = require_try_path();
|
|
233
|
+
function createMatchPath2(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
234
|
+
if (mainFields === void 0) {
|
|
235
|
+
mainFields = ["main"];
|
|
236
|
+
}
|
|
237
|
+
if (addMatchAll === void 0) {
|
|
238
|
+
addMatchAll = true;
|
|
239
|
+
}
|
|
240
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
241
|
+
return function(requestedModule, readJson, fileExists, extensions) {
|
|
242
|
+
return matchFromAbsolutePaths(absolutePaths, requestedModule, readJson, fileExists, extensions, mainFields);
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
__name(createMatchPath2, "createMatchPath");
|
|
246
|
+
exports.createMatchPath = createMatchPath2;
|
|
247
|
+
function matchFromAbsolutePaths(absolutePathMappings, requestedModule, readJson, fileExists, extensions, mainFields) {
|
|
248
|
+
if (readJson === void 0) {
|
|
249
|
+
readJson = Filesystem.readJsonFromDiskSync;
|
|
250
|
+
}
|
|
251
|
+
if (fileExists === void 0) {
|
|
252
|
+
fileExists = Filesystem.fileExistsSync;
|
|
253
|
+
}
|
|
254
|
+
if (extensions === void 0) {
|
|
255
|
+
extensions = Object.keys(__require.extensions);
|
|
256
|
+
}
|
|
257
|
+
if (mainFields === void 0) {
|
|
258
|
+
mainFields = ["main"];
|
|
259
|
+
}
|
|
260
|
+
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
261
|
+
if (!tryPaths) {
|
|
262
|
+
return void 0;
|
|
263
|
+
}
|
|
264
|
+
return findFirstExistingPath(tryPaths, readJson, fileExists, mainFields);
|
|
265
|
+
}
|
|
266
|
+
__name(matchFromAbsolutePaths, "matchFromAbsolutePaths");
|
|
267
|
+
exports.matchFromAbsolutePaths = matchFromAbsolutePaths;
|
|
268
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExists) {
|
|
269
|
+
for (var index = 0; index < mainFields.length; index++) {
|
|
270
|
+
var mainFieldSelector = mainFields[index];
|
|
271
|
+
var candidateMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
272
|
+
return obj[key];
|
|
273
|
+
}, packageJson);
|
|
274
|
+
if (candidateMapping && typeof candidateMapping === "string") {
|
|
275
|
+
var candidateFilePath = path2.join(path2.dirname(packageJsonPath), candidateMapping);
|
|
276
|
+
if (fileExists(candidateFilePath)) {
|
|
277
|
+
return candidateFilePath;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
return void 0;
|
|
282
|
+
}
|
|
283
|
+
__name(findFirstExistingMainFieldMappedFile, "findFirstExistingMainFieldMappedFile");
|
|
284
|
+
function findFirstExistingPath(tryPaths, readJson, fileExists, mainFields) {
|
|
285
|
+
if (readJson === void 0) {
|
|
286
|
+
readJson = Filesystem.readJsonFromDiskSync;
|
|
287
|
+
}
|
|
288
|
+
if (mainFields === void 0) {
|
|
289
|
+
mainFields = ["main"];
|
|
290
|
+
}
|
|
291
|
+
for (var _i = 0, tryPaths_1 = tryPaths; _i < tryPaths_1.length; _i++) {
|
|
292
|
+
var tryPath = tryPaths_1[_i];
|
|
293
|
+
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
294
|
+
if (fileExists(tryPath.path)) {
|
|
295
|
+
return TryPath.getStrippedPath(tryPath);
|
|
296
|
+
}
|
|
297
|
+
} else if (tryPath.type === "package") {
|
|
298
|
+
var packageJson = readJson(tryPath.path);
|
|
299
|
+
if (packageJson) {
|
|
300
|
+
var mainFieldMappedFile = findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists);
|
|
301
|
+
if (mainFieldMappedFile) {
|
|
302
|
+
return mainFieldMappedFile;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
} else {
|
|
306
|
+
TryPath.exhaustiveTypeException(tryPath.type);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return void 0;
|
|
310
|
+
}
|
|
311
|
+
__name(findFirstExistingPath, "findFirstExistingPath");
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
|
|
315
|
+
// ../../node_modules/tsconfig-paths/lib/match-path-async.js
|
|
316
|
+
var require_match_path_async = __commonJS({
|
|
317
|
+
"../../node_modules/tsconfig-paths/lib/match-path-async.js"(exports) {
|
|
318
|
+
"use strict";
|
|
319
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
320
|
+
exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = void 0;
|
|
321
|
+
var path2 = __require("path");
|
|
322
|
+
var TryPath = require_try_path();
|
|
323
|
+
var MappingEntry = require_mapping_entry();
|
|
324
|
+
var Filesystem = require_filesystem();
|
|
325
|
+
function createMatchPathAsync(absoluteBaseUrl, paths, mainFields, addMatchAll) {
|
|
326
|
+
if (mainFields === void 0) {
|
|
327
|
+
mainFields = ["main"];
|
|
328
|
+
}
|
|
329
|
+
if (addMatchAll === void 0) {
|
|
330
|
+
addMatchAll = true;
|
|
331
|
+
}
|
|
332
|
+
var absolutePaths = MappingEntry.getAbsoluteMappingEntries(absoluteBaseUrl, paths, addMatchAll);
|
|
333
|
+
return function(requestedModule, readJson, fileExists, extensions, callback) {
|
|
334
|
+
return matchFromAbsolutePathsAsync(absolutePaths, requestedModule, readJson, fileExists, extensions, callback, mainFields);
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
__name(createMatchPathAsync, "createMatchPathAsync");
|
|
338
|
+
exports.createMatchPathAsync = createMatchPathAsync;
|
|
339
|
+
function matchFromAbsolutePathsAsync(absolutePathMappings, requestedModule, readJson, fileExists, extensions, callback, mainFields) {
|
|
340
|
+
if (readJson === void 0) {
|
|
341
|
+
readJson = Filesystem.readJsonFromDiskAsync;
|
|
342
|
+
}
|
|
343
|
+
if (fileExists === void 0) {
|
|
344
|
+
fileExists = Filesystem.fileExistsAsync;
|
|
345
|
+
}
|
|
346
|
+
if (extensions === void 0) {
|
|
347
|
+
extensions = Object.keys(__require.extensions);
|
|
348
|
+
}
|
|
349
|
+
if (mainFields === void 0) {
|
|
350
|
+
mainFields = ["main"];
|
|
351
|
+
}
|
|
352
|
+
var tryPaths = TryPath.getPathsToTry(extensions, absolutePathMappings, requestedModule);
|
|
353
|
+
if (!tryPaths) {
|
|
354
|
+
return callback();
|
|
355
|
+
}
|
|
356
|
+
findFirstExistingPath(tryPaths, readJson, fileExists, callback, 0, mainFields);
|
|
357
|
+
}
|
|
358
|
+
__name(matchFromAbsolutePathsAsync, "matchFromAbsolutePathsAsync");
|
|
359
|
+
exports.matchFromAbsolutePathsAsync = matchFromAbsolutePathsAsync;
|
|
360
|
+
function findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index) {
|
|
361
|
+
if (index === void 0) {
|
|
362
|
+
index = 0;
|
|
363
|
+
}
|
|
364
|
+
if (index >= mainFields.length) {
|
|
365
|
+
return doneCallback(void 0, void 0);
|
|
366
|
+
}
|
|
367
|
+
var tryNext = /* @__PURE__ */ __name(function() {
|
|
368
|
+
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, packageJsonPath, fileExistsAsync, doneCallback, index + 1);
|
|
369
|
+
}, "tryNext");
|
|
370
|
+
var mainFieldSelector = mainFields[index];
|
|
371
|
+
var mainFieldMapping = typeof mainFieldSelector === "string" ? packageJson[mainFieldSelector] : mainFieldSelector.reduce(function(obj, key) {
|
|
372
|
+
return obj[key];
|
|
373
|
+
}, packageJson);
|
|
374
|
+
if (typeof mainFieldMapping !== "string") {
|
|
375
|
+
return tryNext();
|
|
376
|
+
}
|
|
377
|
+
var mappedFilePath = path2.join(path2.dirname(packageJsonPath), mainFieldMapping);
|
|
378
|
+
fileExistsAsync(mappedFilePath, function(err, exists) {
|
|
379
|
+
if (err) {
|
|
380
|
+
return doneCallback(err);
|
|
381
|
+
}
|
|
382
|
+
if (exists) {
|
|
383
|
+
return doneCallback(void 0, mappedFilePath);
|
|
384
|
+
}
|
|
385
|
+
return tryNext();
|
|
386
|
+
});
|
|
387
|
+
}
|
|
388
|
+
__name(findFirstExistingMainFieldMappedFile, "findFirstExistingMainFieldMappedFile");
|
|
389
|
+
function findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index, mainFields) {
|
|
390
|
+
if (index === void 0) {
|
|
391
|
+
index = 0;
|
|
392
|
+
}
|
|
393
|
+
if (mainFields === void 0) {
|
|
394
|
+
mainFields = ["main"];
|
|
395
|
+
}
|
|
396
|
+
var tryPath = tryPaths[index];
|
|
397
|
+
if (tryPath.type === "file" || tryPath.type === "extension" || tryPath.type === "index") {
|
|
398
|
+
fileExists(tryPath.path, function(err, exists) {
|
|
399
|
+
if (err) {
|
|
400
|
+
return doneCallback(err);
|
|
401
|
+
}
|
|
402
|
+
if (exists) {
|
|
403
|
+
return doneCallback(void 0, TryPath.getStrippedPath(tryPath));
|
|
404
|
+
}
|
|
405
|
+
if (index === tryPaths.length - 1) {
|
|
406
|
+
return doneCallback();
|
|
407
|
+
}
|
|
408
|
+
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
409
|
+
});
|
|
410
|
+
} else if (tryPath.type === "package") {
|
|
411
|
+
readJson(tryPath.path, function(err, packageJson) {
|
|
412
|
+
if (err) {
|
|
413
|
+
return doneCallback(err);
|
|
414
|
+
}
|
|
415
|
+
if (packageJson) {
|
|
416
|
+
return findFirstExistingMainFieldMappedFile(packageJson, mainFields, tryPath.path, fileExists, function(mainFieldErr, mainFieldMappedFile) {
|
|
417
|
+
if (mainFieldErr) {
|
|
418
|
+
return doneCallback(mainFieldErr);
|
|
419
|
+
}
|
|
420
|
+
if (mainFieldMappedFile) {
|
|
421
|
+
return doneCallback(void 0, mainFieldMappedFile);
|
|
422
|
+
}
|
|
423
|
+
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
424
|
+
});
|
|
425
|
+
}
|
|
426
|
+
return findFirstExistingPath(tryPaths, readJson, fileExists, doneCallback, index + 1, mainFields);
|
|
427
|
+
});
|
|
428
|
+
} else {
|
|
429
|
+
TryPath.exhaustiveTypeException(tryPath.type);
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
__name(findFirstExistingPath, "findFirstExistingPath");
|
|
433
|
+
}
|
|
434
|
+
});
|
|
435
|
+
|
|
436
|
+
// ../../node_modules/json5/lib/unicode.js
|
|
437
|
+
var require_unicode = __commonJS({
|
|
438
|
+
"../../node_modules/json5/lib/unicode.js"(exports, module) {
|
|
439
|
+
module.exports.Space_Separator = /[\u1680\u2000-\u200A\u202F\u205F\u3000]/;
|
|
440
|
+
module.exports.ID_Start = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
|
|
441
|
+
module.exports.ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
|
|
445
|
+
// ../../node_modules/json5/lib/util.js
|
|
446
|
+
var require_util = __commonJS({
|
|
447
|
+
"../../node_modules/json5/lib/util.js"(exports, module) {
|
|
448
|
+
var unicode = require_unicode();
|
|
449
|
+
module.exports = {
|
|
450
|
+
isSpaceSeparator(c) {
|
|
451
|
+
return typeof c === "string" && unicode.Space_Separator.test(c);
|
|
452
|
+
},
|
|
453
|
+
isIdStartChar(c) {
|
|
454
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c === "$" || c === "_" || unicode.ID_Start.test(c));
|
|
455
|
+
},
|
|
456
|
+
isIdContinueChar(c) {
|
|
457
|
+
return typeof c === "string" && (c >= "a" && c <= "z" || c >= "A" && c <= "Z" || c >= "0" && c <= "9" || c === "$" || c === "_" || c === "\u200C" || c === "\u200D" || unicode.ID_Continue.test(c));
|
|
458
|
+
},
|
|
459
|
+
isDigit(c) {
|
|
460
|
+
return typeof c === "string" && /[0-9]/.test(c);
|
|
461
|
+
},
|
|
462
|
+
isHexDigit(c) {
|
|
463
|
+
return typeof c === "string" && /[0-9A-Fa-f]/.test(c);
|
|
464
|
+
}
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
// ../../node_modules/json5/lib/parse.js
|
|
470
|
+
var require_parse = __commonJS({
|
|
471
|
+
"../../node_modules/json5/lib/parse.js"(exports, module) {
|
|
472
|
+
var util = require_util();
|
|
473
|
+
var source;
|
|
474
|
+
var parseState;
|
|
475
|
+
var stack;
|
|
476
|
+
var pos;
|
|
477
|
+
var line;
|
|
478
|
+
var column;
|
|
479
|
+
var token;
|
|
480
|
+
var key;
|
|
481
|
+
var root;
|
|
482
|
+
module.exports = /* @__PURE__ */ __name(function parse4(text, reviver) {
|
|
483
|
+
source = String(text);
|
|
484
|
+
parseState = "start";
|
|
485
|
+
stack = [];
|
|
486
|
+
pos = 0;
|
|
487
|
+
line = 1;
|
|
488
|
+
column = 0;
|
|
489
|
+
token = void 0;
|
|
490
|
+
key = void 0;
|
|
491
|
+
root = void 0;
|
|
492
|
+
do {
|
|
493
|
+
token = lex();
|
|
494
|
+
parseStates[parseState]();
|
|
495
|
+
} while (token.type !== "eof");
|
|
496
|
+
if (typeof reviver === "function") {
|
|
497
|
+
return internalize({ "": root }, "", reviver);
|
|
498
|
+
}
|
|
499
|
+
return root;
|
|
500
|
+
}, "parse");
|
|
501
|
+
function internalize(holder, name, reviver) {
|
|
502
|
+
const value = holder[name];
|
|
503
|
+
if (value != null && typeof value === "object") {
|
|
504
|
+
if (Array.isArray(value)) {
|
|
505
|
+
for (let i = 0; i < value.length; i++) {
|
|
506
|
+
const key2 = String(i);
|
|
507
|
+
const replacement = internalize(value, key2, reviver);
|
|
508
|
+
if (replacement === void 0) {
|
|
509
|
+
delete value[key2];
|
|
510
|
+
} else {
|
|
511
|
+
Object.defineProperty(value, key2, {
|
|
512
|
+
value: replacement,
|
|
513
|
+
writable: true,
|
|
514
|
+
enumerable: true,
|
|
515
|
+
configurable: true
|
|
516
|
+
});
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
} else {
|
|
520
|
+
for (const key2 in value) {
|
|
521
|
+
const replacement = internalize(value, key2, reviver);
|
|
522
|
+
if (replacement === void 0) {
|
|
523
|
+
delete value[key2];
|
|
524
|
+
} else {
|
|
525
|
+
Object.defineProperty(value, key2, {
|
|
526
|
+
value: replacement,
|
|
527
|
+
writable: true,
|
|
528
|
+
enumerable: true,
|
|
529
|
+
configurable: true
|
|
530
|
+
});
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return reviver.call(holder, name, value);
|
|
536
|
+
}
|
|
537
|
+
__name(internalize, "internalize");
|
|
538
|
+
var lexState;
|
|
539
|
+
var buffer;
|
|
540
|
+
var doubleQuote;
|
|
541
|
+
var sign;
|
|
542
|
+
var c;
|
|
543
|
+
function lex() {
|
|
544
|
+
lexState = "default";
|
|
545
|
+
buffer = "";
|
|
546
|
+
doubleQuote = false;
|
|
547
|
+
sign = 1;
|
|
548
|
+
for (; ; ) {
|
|
549
|
+
c = peek();
|
|
550
|
+
const token2 = lexStates[lexState]();
|
|
551
|
+
if (token2) {
|
|
552
|
+
return token2;
|
|
553
|
+
}
|
|
554
|
+
}
|
|
555
|
+
}
|
|
556
|
+
__name(lex, "lex");
|
|
557
|
+
function peek() {
|
|
558
|
+
if (source[pos]) {
|
|
559
|
+
return String.fromCodePoint(source.codePointAt(pos));
|
|
560
|
+
}
|
|
561
|
+
}
|
|
562
|
+
__name(peek, "peek");
|
|
563
|
+
function read() {
|
|
564
|
+
const c2 = peek();
|
|
565
|
+
if (c2 === "\n") {
|
|
566
|
+
line++;
|
|
567
|
+
column = 0;
|
|
568
|
+
} else if (c2) {
|
|
569
|
+
column += c2.length;
|
|
570
|
+
} else {
|
|
571
|
+
column++;
|
|
572
|
+
}
|
|
573
|
+
if (c2) {
|
|
574
|
+
pos += c2.length;
|
|
575
|
+
}
|
|
576
|
+
return c2;
|
|
577
|
+
}
|
|
578
|
+
__name(read, "read");
|
|
579
|
+
var lexStates = {
|
|
580
|
+
default() {
|
|
581
|
+
switch (c) {
|
|
582
|
+
case " ":
|
|
583
|
+
case "\v":
|
|
584
|
+
case "\f":
|
|
585
|
+
case " ":
|
|
586
|
+
case "\xA0":
|
|
587
|
+
case "\uFEFF":
|
|
588
|
+
case "\n":
|
|
589
|
+
case "\r":
|
|
590
|
+
case "\u2028":
|
|
591
|
+
case "\u2029":
|
|
592
|
+
read();
|
|
593
|
+
return;
|
|
594
|
+
case "/":
|
|
595
|
+
read();
|
|
596
|
+
lexState = "comment";
|
|
597
|
+
return;
|
|
598
|
+
case void 0:
|
|
599
|
+
read();
|
|
600
|
+
return newToken("eof");
|
|
601
|
+
}
|
|
602
|
+
if (util.isSpaceSeparator(c)) {
|
|
603
|
+
read();
|
|
604
|
+
return;
|
|
605
|
+
}
|
|
606
|
+
return lexStates[parseState]();
|
|
607
|
+
},
|
|
608
|
+
comment() {
|
|
609
|
+
switch (c) {
|
|
610
|
+
case "*":
|
|
611
|
+
read();
|
|
612
|
+
lexState = "multiLineComment";
|
|
613
|
+
return;
|
|
614
|
+
case "/":
|
|
615
|
+
read();
|
|
616
|
+
lexState = "singleLineComment";
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
throw invalidChar(read());
|
|
620
|
+
},
|
|
621
|
+
multiLineComment() {
|
|
622
|
+
switch (c) {
|
|
623
|
+
case "*":
|
|
624
|
+
read();
|
|
625
|
+
lexState = "multiLineCommentAsterisk";
|
|
626
|
+
return;
|
|
627
|
+
case void 0:
|
|
628
|
+
throw invalidChar(read());
|
|
629
|
+
}
|
|
630
|
+
read();
|
|
631
|
+
},
|
|
632
|
+
multiLineCommentAsterisk() {
|
|
633
|
+
switch (c) {
|
|
634
|
+
case "*":
|
|
635
|
+
read();
|
|
636
|
+
return;
|
|
637
|
+
case "/":
|
|
638
|
+
read();
|
|
639
|
+
lexState = "default";
|
|
640
|
+
return;
|
|
641
|
+
case void 0:
|
|
642
|
+
throw invalidChar(read());
|
|
643
|
+
}
|
|
644
|
+
read();
|
|
645
|
+
lexState = "multiLineComment";
|
|
646
|
+
},
|
|
647
|
+
singleLineComment() {
|
|
648
|
+
switch (c) {
|
|
649
|
+
case "\n":
|
|
650
|
+
case "\r":
|
|
651
|
+
case "\u2028":
|
|
652
|
+
case "\u2029":
|
|
653
|
+
read();
|
|
654
|
+
lexState = "default";
|
|
655
|
+
return;
|
|
656
|
+
case void 0:
|
|
657
|
+
read();
|
|
658
|
+
return newToken("eof");
|
|
659
|
+
}
|
|
660
|
+
read();
|
|
661
|
+
},
|
|
662
|
+
value() {
|
|
663
|
+
switch (c) {
|
|
664
|
+
case "{":
|
|
665
|
+
case "[":
|
|
666
|
+
return newToken("punctuator", read());
|
|
667
|
+
case "n":
|
|
668
|
+
read();
|
|
669
|
+
literal("ull");
|
|
670
|
+
return newToken("null", null);
|
|
671
|
+
case "t":
|
|
672
|
+
read();
|
|
673
|
+
literal("rue");
|
|
674
|
+
return newToken("boolean", true);
|
|
675
|
+
case "f":
|
|
676
|
+
read();
|
|
677
|
+
literal("alse");
|
|
678
|
+
return newToken("boolean", false);
|
|
679
|
+
case "-":
|
|
680
|
+
case "+":
|
|
681
|
+
if (read() === "-") {
|
|
682
|
+
sign = -1;
|
|
683
|
+
}
|
|
684
|
+
lexState = "sign";
|
|
685
|
+
return;
|
|
686
|
+
case ".":
|
|
687
|
+
buffer = read();
|
|
688
|
+
lexState = "decimalPointLeading";
|
|
689
|
+
return;
|
|
690
|
+
case "0":
|
|
691
|
+
buffer = read();
|
|
692
|
+
lexState = "zero";
|
|
693
|
+
return;
|
|
694
|
+
case "1":
|
|
695
|
+
case "2":
|
|
696
|
+
case "3":
|
|
697
|
+
case "4":
|
|
698
|
+
case "5":
|
|
699
|
+
case "6":
|
|
700
|
+
case "7":
|
|
701
|
+
case "8":
|
|
702
|
+
case "9":
|
|
703
|
+
buffer = read();
|
|
704
|
+
lexState = "decimalInteger";
|
|
705
|
+
return;
|
|
706
|
+
case "I":
|
|
707
|
+
read();
|
|
708
|
+
literal("nfinity");
|
|
709
|
+
return newToken("numeric", Infinity);
|
|
710
|
+
case "N":
|
|
711
|
+
read();
|
|
712
|
+
literal("aN");
|
|
713
|
+
return newToken("numeric", NaN);
|
|
714
|
+
case '"':
|
|
715
|
+
case "'":
|
|
716
|
+
doubleQuote = read() === '"';
|
|
717
|
+
buffer = "";
|
|
718
|
+
lexState = "string";
|
|
719
|
+
return;
|
|
720
|
+
}
|
|
721
|
+
throw invalidChar(read());
|
|
722
|
+
},
|
|
723
|
+
identifierNameStartEscape() {
|
|
724
|
+
if (c !== "u") {
|
|
725
|
+
throw invalidChar(read());
|
|
726
|
+
}
|
|
727
|
+
read();
|
|
728
|
+
const u = unicodeEscape();
|
|
729
|
+
switch (u) {
|
|
730
|
+
case "$":
|
|
731
|
+
case "_":
|
|
732
|
+
break;
|
|
733
|
+
default:
|
|
734
|
+
if (!util.isIdStartChar(u)) {
|
|
735
|
+
throw invalidIdentifier();
|
|
736
|
+
}
|
|
737
|
+
break;
|
|
738
|
+
}
|
|
739
|
+
buffer += u;
|
|
740
|
+
lexState = "identifierName";
|
|
741
|
+
},
|
|
742
|
+
identifierName() {
|
|
743
|
+
switch (c) {
|
|
744
|
+
case "$":
|
|
745
|
+
case "_":
|
|
746
|
+
case "\u200C":
|
|
747
|
+
case "\u200D":
|
|
748
|
+
buffer += read();
|
|
749
|
+
return;
|
|
750
|
+
case "\\":
|
|
751
|
+
read();
|
|
752
|
+
lexState = "identifierNameEscape";
|
|
753
|
+
return;
|
|
754
|
+
}
|
|
755
|
+
if (util.isIdContinueChar(c)) {
|
|
756
|
+
buffer += read();
|
|
757
|
+
return;
|
|
758
|
+
}
|
|
759
|
+
return newToken("identifier", buffer);
|
|
760
|
+
},
|
|
761
|
+
identifierNameEscape() {
|
|
762
|
+
if (c !== "u") {
|
|
763
|
+
throw invalidChar(read());
|
|
764
|
+
}
|
|
765
|
+
read();
|
|
766
|
+
const u = unicodeEscape();
|
|
767
|
+
switch (u) {
|
|
768
|
+
case "$":
|
|
769
|
+
case "_":
|
|
770
|
+
case "\u200C":
|
|
771
|
+
case "\u200D":
|
|
772
|
+
break;
|
|
773
|
+
default:
|
|
774
|
+
if (!util.isIdContinueChar(u)) {
|
|
775
|
+
throw invalidIdentifier();
|
|
776
|
+
}
|
|
777
|
+
break;
|
|
778
|
+
}
|
|
779
|
+
buffer += u;
|
|
780
|
+
lexState = "identifierName";
|
|
781
|
+
},
|
|
782
|
+
sign() {
|
|
783
|
+
switch (c) {
|
|
784
|
+
case ".":
|
|
785
|
+
buffer = read();
|
|
786
|
+
lexState = "decimalPointLeading";
|
|
787
|
+
return;
|
|
788
|
+
case "0":
|
|
789
|
+
buffer = read();
|
|
790
|
+
lexState = "zero";
|
|
791
|
+
return;
|
|
792
|
+
case "1":
|
|
793
|
+
case "2":
|
|
794
|
+
case "3":
|
|
795
|
+
case "4":
|
|
796
|
+
case "5":
|
|
797
|
+
case "6":
|
|
798
|
+
case "7":
|
|
799
|
+
case "8":
|
|
800
|
+
case "9":
|
|
801
|
+
buffer = read();
|
|
802
|
+
lexState = "decimalInteger";
|
|
803
|
+
return;
|
|
804
|
+
case "I":
|
|
805
|
+
read();
|
|
806
|
+
literal("nfinity");
|
|
807
|
+
return newToken("numeric", sign * Infinity);
|
|
808
|
+
case "N":
|
|
809
|
+
read();
|
|
810
|
+
literal("aN");
|
|
811
|
+
return newToken("numeric", NaN);
|
|
812
|
+
}
|
|
813
|
+
throw invalidChar(read());
|
|
814
|
+
},
|
|
815
|
+
zero() {
|
|
816
|
+
switch (c) {
|
|
817
|
+
case ".":
|
|
818
|
+
buffer += read();
|
|
819
|
+
lexState = "decimalPoint";
|
|
820
|
+
return;
|
|
821
|
+
case "e":
|
|
822
|
+
case "E":
|
|
823
|
+
buffer += read();
|
|
824
|
+
lexState = "decimalExponent";
|
|
825
|
+
return;
|
|
826
|
+
case "x":
|
|
827
|
+
case "X":
|
|
828
|
+
buffer += read();
|
|
829
|
+
lexState = "hexadecimal";
|
|
830
|
+
return;
|
|
831
|
+
}
|
|
832
|
+
return newToken("numeric", sign * 0);
|
|
833
|
+
},
|
|
834
|
+
decimalInteger() {
|
|
835
|
+
switch (c) {
|
|
836
|
+
case ".":
|
|
837
|
+
buffer += read();
|
|
838
|
+
lexState = "decimalPoint";
|
|
839
|
+
return;
|
|
840
|
+
case "e":
|
|
841
|
+
case "E":
|
|
842
|
+
buffer += read();
|
|
843
|
+
lexState = "decimalExponent";
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
if (util.isDigit(c)) {
|
|
847
|
+
buffer += read();
|
|
848
|
+
return;
|
|
849
|
+
}
|
|
850
|
+
return newToken("numeric", sign * Number(buffer));
|
|
851
|
+
},
|
|
852
|
+
decimalPointLeading() {
|
|
853
|
+
if (util.isDigit(c)) {
|
|
854
|
+
buffer += read();
|
|
855
|
+
lexState = "decimalFraction";
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
throw invalidChar(read());
|
|
859
|
+
},
|
|
860
|
+
decimalPoint() {
|
|
861
|
+
switch (c) {
|
|
862
|
+
case "e":
|
|
863
|
+
case "E":
|
|
864
|
+
buffer += read();
|
|
865
|
+
lexState = "decimalExponent";
|
|
866
|
+
return;
|
|
867
|
+
}
|
|
868
|
+
if (util.isDigit(c)) {
|
|
869
|
+
buffer += read();
|
|
870
|
+
lexState = "decimalFraction";
|
|
871
|
+
return;
|
|
872
|
+
}
|
|
873
|
+
return newToken("numeric", sign * Number(buffer));
|
|
874
|
+
},
|
|
875
|
+
decimalFraction() {
|
|
876
|
+
switch (c) {
|
|
877
|
+
case "e":
|
|
878
|
+
case "E":
|
|
879
|
+
buffer += read();
|
|
880
|
+
lexState = "decimalExponent";
|
|
881
|
+
return;
|
|
882
|
+
}
|
|
883
|
+
if (util.isDigit(c)) {
|
|
884
|
+
buffer += read();
|
|
885
|
+
return;
|
|
886
|
+
}
|
|
887
|
+
return newToken("numeric", sign * Number(buffer));
|
|
888
|
+
},
|
|
889
|
+
decimalExponent() {
|
|
890
|
+
switch (c) {
|
|
891
|
+
case "+":
|
|
892
|
+
case "-":
|
|
893
|
+
buffer += read();
|
|
894
|
+
lexState = "decimalExponentSign";
|
|
895
|
+
return;
|
|
896
|
+
}
|
|
897
|
+
if (util.isDigit(c)) {
|
|
898
|
+
buffer += read();
|
|
899
|
+
lexState = "decimalExponentInteger";
|
|
900
|
+
return;
|
|
901
|
+
}
|
|
902
|
+
throw invalidChar(read());
|
|
903
|
+
},
|
|
904
|
+
decimalExponentSign() {
|
|
905
|
+
if (util.isDigit(c)) {
|
|
906
|
+
buffer += read();
|
|
907
|
+
lexState = "decimalExponentInteger";
|
|
908
|
+
return;
|
|
909
|
+
}
|
|
910
|
+
throw invalidChar(read());
|
|
911
|
+
},
|
|
912
|
+
decimalExponentInteger() {
|
|
913
|
+
if (util.isDigit(c)) {
|
|
914
|
+
buffer += read();
|
|
915
|
+
return;
|
|
916
|
+
}
|
|
917
|
+
return newToken("numeric", sign * Number(buffer));
|
|
918
|
+
},
|
|
919
|
+
hexadecimal() {
|
|
920
|
+
if (util.isHexDigit(c)) {
|
|
921
|
+
buffer += read();
|
|
922
|
+
lexState = "hexadecimalInteger";
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
925
|
+
throw invalidChar(read());
|
|
926
|
+
},
|
|
927
|
+
hexadecimalInteger() {
|
|
928
|
+
if (util.isHexDigit(c)) {
|
|
929
|
+
buffer += read();
|
|
930
|
+
return;
|
|
931
|
+
}
|
|
932
|
+
return newToken("numeric", sign * Number(buffer));
|
|
933
|
+
},
|
|
934
|
+
string() {
|
|
935
|
+
switch (c) {
|
|
936
|
+
case "\\":
|
|
937
|
+
read();
|
|
938
|
+
buffer += escape();
|
|
939
|
+
return;
|
|
940
|
+
case '"':
|
|
941
|
+
if (doubleQuote) {
|
|
942
|
+
read();
|
|
943
|
+
return newToken("string", buffer);
|
|
944
|
+
}
|
|
945
|
+
buffer += read();
|
|
946
|
+
return;
|
|
947
|
+
case "'":
|
|
948
|
+
if (!doubleQuote) {
|
|
949
|
+
read();
|
|
950
|
+
return newToken("string", buffer);
|
|
951
|
+
}
|
|
952
|
+
buffer += read();
|
|
953
|
+
return;
|
|
954
|
+
case "\n":
|
|
955
|
+
case "\r":
|
|
956
|
+
throw invalidChar(read());
|
|
957
|
+
case "\u2028":
|
|
958
|
+
case "\u2029":
|
|
959
|
+
separatorChar(c);
|
|
960
|
+
break;
|
|
961
|
+
case void 0:
|
|
962
|
+
throw invalidChar(read());
|
|
963
|
+
}
|
|
964
|
+
buffer += read();
|
|
965
|
+
},
|
|
966
|
+
start() {
|
|
967
|
+
switch (c) {
|
|
968
|
+
case "{":
|
|
969
|
+
case "[":
|
|
970
|
+
return newToken("punctuator", read());
|
|
971
|
+
}
|
|
972
|
+
lexState = "value";
|
|
973
|
+
},
|
|
974
|
+
beforePropertyName() {
|
|
975
|
+
switch (c) {
|
|
976
|
+
case "$":
|
|
977
|
+
case "_":
|
|
978
|
+
buffer = read();
|
|
979
|
+
lexState = "identifierName";
|
|
980
|
+
return;
|
|
981
|
+
case "\\":
|
|
982
|
+
read();
|
|
983
|
+
lexState = "identifierNameStartEscape";
|
|
984
|
+
return;
|
|
985
|
+
case "}":
|
|
986
|
+
return newToken("punctuator", read());
|
|
987
|
+
case '"':
|
|
988
|
+
case "'":
|
|
989
|
+
doubleQuote = read() === '"';
|
|
990
|
+
lexState = "string";
|
|
991
|
+
return;
|
|
992
|
+
}
|
|
993
|
+
if (util.isIdStartChar(c)) {
|
|
994
|
+
buffer += read();
|
|
995
|
+
lexState = "identifierName";
|
|
996
|
+
return;
|
|
997
|
+
}
|
|
998
|
+
throw invalidChar(read());
|
|
999
|
+
},
|
|
1000
|
+
afterPropertyName() {
|
|
1001
|
+
if (c === ":") {
|
|
1002
|
+
return newToken("punctuator", read());
|
|
1003
|
+
}
|
|
1004
|
+
throw invalidChar(read());
|
|
1005
|
+
},
|
|
1006
|
+
beforePropertyValue() {
|
|
1007
|
+
lexState = "value";
|
|
1008
|
+
},
|
|
1009
|
+
afterPropertyValue() {
|
|
1010
|
+
switch (c) {
|
|
1011
|
+
case ",":
|
|
1012
|
+
case "}":
|
|
1013
|
+
return newToken("punctuator", read());
|
|
1014
|
+
}
|
|
1015
|
+
throw invalidChar(read());
|
|
1016
|
+
},
|
|
1017
|
+
beforeArrayValue() {
|
|
1018
|
+
if (c === "]") {
|
|
1019
|
+
return newToken("punctuator", read());
|
|
1020
|
+
}
|
|
1021
|
+
lexState = "value";
|
|
1022
|
+
},
|
|
1023
|
+
afterArrayValue() {
|
|
1024
|
+
switch (c) {
|
|
1025
|
+
case ",":
|
|
1026
|
+
case "]":
|
|
1027
|
+
return newToken("punctuator", read());
|
|
1028
|
+
}
|
|
1029
|
+
throw invalidChar(read());
|
|
1030
|
+
},
|
|
1031
|
+
end() {
|
|
1032
|
+
throw invalidChar(read());
|
|
1033
|
+
}
|
|
1034
|
+
};
|
|
1035
|
+
function newToken(type, value) {
|
|
1036
|
+
return {
|
|
1037
|
+
type,
|
|
1038
|
+
value,
|
|
1039
|
+
line,
|
|
1040
|
+
column
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
__name(newToken, "newToken");
|
|
1044
|
+
function literal(s) {
|
|
1045
|
+
for (const c2 of s) {
|
|
1046
|
+
const p = peek();
|
|
1047
|
+
if (p !== c2) {
|
|
1048
|
+
throw invalidChar(read());
|
|
1049
|
+
}
|
|
1050
|
+
read();
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
__name(literal, "literal");
|
|
1054
|
+
function escape() {
|
|
1055
|
+
const c2 = peek();
|
|
1056
|
+
switch (c2) {
|
|
1057
|
+
case "b":
|
|
1058
|
+
read();
|
|
1059
|
+
return "\b";
|
|
1060
|
+
case "f":
|
|
1061
|
+
read();
|
|
1062
|
+
return "\f";
|
|
1063
|
+
case "n":
|
|
1064
|
+
read();
|
|
1065
|
+
return "\n";
|
|
1066
|
+
case "r":
|
|
1067
|
+
read();
|
|
1068
|
+
return "\r";
|
|
1069
|
+
case "t":
|
|
1070
|
+
read();
|
|
1071
|
+
return " ";
|
|
1072
|
+
case "v":
|
|
1073
|
+
read();
|
|
1074
|
+
return "\v";
|
|
1075
|
+
case "0":
|
|
1076
|
+
read();
|
|
1077
|
+
if (util.isDigit(peek())) {
|
|
1078
|
+
throw invalidChar(read());
|
|
1079
|
+
}
|
|
1080
|
+
return "\0";
|
|
1081
|
+
case "x":
|
|
1082
|
+
read();
|
|
1083
|
+
return hexEscape();
|
|
1084
|
+
case "u":
|
|
1085
|
+
read();
|
|
1086
|
+
return unicodeEscape();
|
|
1087
|
+
case "\n":
|
|
1088
|
+
case "\u2028":
|
|
1089
|
+
case "\u2029":
|
|
1090
|
+
read();
|
|
1091
|
+
return "";
|
|
1092
|
+
case "\r":
|
|
1093
|
+
read();
|
|
1094
|
+
if (peek() === "\n") {
|
|
1095
|
+
read();
|
|
1096
|
+
}
|
|
1097
|
+
return "";
|
|
1098
|
+
case "1":
|
|
1099
|
+
case "2":
|
|
1100
|
+
case "3":
|
|
1101
|
+
case "4":
|
|
1102
|
+
case "5":
|
|
1103
|
+
case "6":
|
|
1104
|
+
case "7":
|
|
1105
|
+
case "8":
|
|
1106
|
+
case "9":
|
|
1107
|
+
throw invalidChar(read());
|
|
1108
|
+
case void 0:
|
|
1109
|
+
throw invalidChar(read());
|
|
1110
|
+
}
|
|
1111
|
+
return read();
|
|
1112
|
+
}
|
|
1113
|
+
__name(escape, "escape");
|
|
1114
|
+
function hexEscape() {
|
|
1115
|
+
let buffer2 = "";
|
|
1116
|
+
let c2 = peek();
|
|
1117
|
+
if (!util.isHexDigit(c2)) {
|
|
1118
|
+
throw invalidChar(read());
|
|
1119
|
+
}
|
|
1120
|
+
buffer2 += read();
|
|
1121
|
+
c2 = peek();
|
|
1122
|
+
if (!util.isHexDigit(c2)) {
|
|
1123
|
+
throw invalidChar(read());
|
|
1124
|
+
}
|
|
1125
|
+
buffer2 += read();
|
|
1126
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
1127
|
+
}
|
|
1128
|
+
__name(hexEscape, "hexEscape");
|
|
1129
|
+
function unicodeEscape() {
|
|
1130
|
+
let buffer2 = "";
|
|
1131
|
+
let count = 4;
|
|
1132
|
+
while (count-- > 0) {
|
|
1133
|
+
const c2 = peek();
|
|
1134
|
+
if (!util.isHexDigit(c2)) {
|
|
1135
|
+
throw invalidChar(read());
|
|
1136
|
+
}
|
|
1137
|
+
buffer2 += read();
|
|
1138
|
+
}
|
|
1139
|
+
return String.fromCodePoint(parseInt(buffer2, 16));
|
|
1140
|
+
}
|
|
1141
|
+
__name(unicodeEscape, "unicodeEscape");
|
|
1142
|
+
var parseStates = {
|
|
1143
|
+
start() {
|
|
1144
|
+
if (token.type === "eof") {
|
|
1145
|
+
throw invalidEOF();
|
|
1146
|
+
}
|
|
1147
|
+
push();
|
|
1148
|
+
},
|
|
1149
|
+
beforePropertyName() {
|
|
1150
|
+
switch (token.type) {
|
|
1151
|
+
case "identifier":
|
|
1152
|
+
case "string":
|
|
1153
|
+
key = token.value;
|
|
1154
|
+
parseState = "afterPropertyName";
|
|
1155
|
+
return;
|
|
1156
|
+
case "punctuator":
|
|
1157
|
+
pop();
|
|
1158
|
+
return;
|
|
1159
|
+
case "eof":
|
|
1160
|
+
throw invalidEOF();
|
|
1161
|
+
}
|
|
1162
|
+
},
|
|
1163
|
+
afterPropertyName() {
|
|
1164
|
+
if (token.type === "eof") {
|
|
1165
|
+
throw invalidEOF();
|
|
1166
|
+
}
|
|
1167
|
+
parseState = "beforePropertyValue";
|
|
1168
|
+
},
|
|
1169
|
+
beforePropertyValue() {
|
|
1170
|
+
if (token.type === "eof") {
|
|
1171
|
+
throw invalidEOF();
|
|
1172
|
+
}
|
|
1173
|
+
push();
|
|
1174
|
+
},
|
|
1175
|
+
beforeArrayValue() {
|
|
1176
|
+
if (token.type === "eof") {
|
|
1177
|
+
throw invalidEOF();
|
|
1178
|
+
}
|
|
1179
|
+
if (token.type === "punctuator" && token.value === "]") {
|
|
1180
|
+
pop();
|
|
1181
|
+
return;
|
|
1182
|
+
}
|
|
1183
|
+
push();
|
|
1184
|
+
},
|
|
1185
|
+
afterPropertyValue() {
|
|
1186
|
+
if (token.type === "eof") {
|
|
1187
|
+
throw invalidEOF();
|
|
1188
|
+
}
|
|
1189
|
+
switch (token.value) {
|
|
1190
|
+
case ",":
|
|
1191
|
+
parseState = "beforePropertyName";
|
|
1192
|
+
return;
|
|
1193
|
+
case "}":
|
|
1194
|
+
pop();
|
|
1195
|
+
}
|
|
1196
|
+
},
|
|
1197
|
+
afterArrayValue() {
|
|
1198
|
+
if (token.type === "eof") {
|
|
1199
|
+
throw invalidEOF();
|
|
1200
|
+
}
|
|
1201
|
+
switch (token.value) {
|
|
1202
|
+
case ",":
|
|
1203
|
+
parseState = "beforeArrayValue";
|
|
1204
|
+
return;
|
|
1205
|
+
case "]":
|
|
1206
|
+
pop();
|
|
1207
|
+
}
|
|
1208
|
+
},
|
|
1209
|
+
end() {
|
|
1210
|
+
}
|
|
1211
|
+
};
|
|
1212
|
+
function push() {
|
|
1213
|
+
let value;
|
|
1214
|
+
switch (token.type) {
|
|
1215
|
+
case "punctuator":
|
|
1216
|
+
switch (token.value) {
|
|
1217
|
+
case "{":
|
|
1218
|
+
value = {};
|
|
1219
|
+
break;
|
|
1220
|
+
case "[":
|
|
1221
|
+
value = [];
|
|
1222
|
+
break;
|
|
1223
|
+
}
|
|
1224
|
+
break;
|
|
1225
|
+
case "null":
|
|
1226
|
+
case "boolean":
|
|
1227
|
+
case "numeric":
|
|
1228
|
+
case "string":
|
|
1229
|
+
value = token.value;
|
|
1230
|
+
break;
|
|
1231
|
+
}
|
|
1232
|
+
if (root === void 0) {
|
|
1233
|
+
root = value;
|
|
1234
|
+
} else {
|
|
1235
|
+
const parent = stack[stack.length - 1];
|
|
1236
|
+
if (Array.isArray(parent)) {
|
|
1237
|
+
parent.push(value);
|
|
1238
|
+
} else {
|
|
1239
|
+
Object.defineProperty(parent, key, {
|
|
1240
|
+
value,
|
|
1241
|
+
writable: true,
|
|
1242
|
+
enumerable: true,
|
|
1243
|
+
configurable: true
|
|
1244
|
+
});
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
if (value !== null && typeof value === "object") {
|
|
1248
|
+
stack.push(value);
|
|
1249
|
+
if (Array.isArray(value)) {
|
|
1250
|
+
parseState = "beforeArrayValue";
|
|
1251
|
+
} else {
|
|
1252
|
+
parseState = "beforePropertyName";
|
|
1253
|
+
}
|
|
1254
|
+
} else {
|
|
1255
|
+
const current = stack[stack.length - 1];
|
|
1256
|
+
if (current == null) {
|
|
1257
|
+
parseState = "end";
|
|
1258
|
+
} else if (Array.isArray(current)) {
|
|
1259
|
+
parseState = "afterArrayValue";
|
|
1260
|
+
} else {
|
|
1261
|
+
parseState = "afterPropertyValue";
|
|
1262
|
+
}
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
__name(push, "push");
|
|
1266
|
+
function pop() {
|
|
1267
|
+
stack.pop();
|
|
1268
|
+
const current = stack[stack.length - 1];
|
|
1269
|
+
if (current == null) {
|
|
1270
|
+
parseState = "end";
|
|
1271
|
+
} else if (Array.isArray(current)) {
|
|
1272
|
+
parseState = "afterArrayValue";
|
|
1273
|
+
} else {
|
|
1274
|
+
parseState = "afterPropertyValue";
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
__name(pop, "pop");
|
|
1278
|
+
function invalidChar(c2) {
|
|
1279
|
+
if (c2 === void 0) {
|
|
1280
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
1281
|
+
}
|
|
1282
|
+
return syntaxError(`JSON5: invalid character '${formatChar(c2)}' at ${line}:${column}`);
|
|
1283
|
+
}
|
|
1284
|
+
__name(invalidChar, "invalidChar");
|
|
1285
|
+
function invalidEOF() {
|
|
1286
|
+
return syntaxError(`JSON5: invalid end of input at ${line}:${column}`);
|
|
1287
|
+
}
|
|
1288
|
+
__name(invalidEOF, "invalidEOF");
|
|
1289
|
+
function invalidIdentifier() {
|
|
1290
|
+
column -= 5;
|
|
1291
|
+
return syntaxError(`JSON5: invalid identifier character at ${line}:${column}`);
|
|
1292
|
+
}
|
|
1293
|
+
__name(invalidIdentifier, "invalidIdentifier");
|
|
1294
|
+
function separatorChar(c2) {
|
|
1295
|
+
console.warn(`JSON5: '${formatChar(c2)}' in strings is not valid ECMAScript; consider escaping`);
|
|
1296
|
+
}
|
|
1297
|
+
__name(separatorChar, "separatorChar");
|
|
1298
|
+
function formatChar(c2) {
|
|
1299
|
+
const replacements = {
|
|
1300
|
+
"'": "\\'",
|
|
1301
|
+
'"': '\\"',
|
|
1302
|
+
"\\": "\\\\",
|
|
1303
|
+
"\b": "\\b",
|
|
1304
|
+
"\f": "\\f",
|
|
1305
|
+
"\n": "\\n",
|
|
1306
|
+
"\r": "\\r",
|
|
1307
|
+
" ": "\\t",
|
|
1308
|
+
"\v": "\\v",
|
|
1309
|
+
"\0": "\\0",
|
|
1310
|
+
"\u2028": "\\u2028",
|
|
1311
|
+
"\u2029": "\\u2029"
|
|
1312
|
+
};
|
|
1313
|
+
if (replacements[c2]) {
|
|
1314
|
+
return replacements[c2];
|
|
1315
|
+
}
|
|
1316
|
+
if (c2 < " ") {
|
|
1317
|
+
const hexString = c2.charCodeAt(0).toString(16);
|
|
1318
|
+
return "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1319
|
+
}
|
|
1320
|
+
return c2;
|
|
1321
|
+
}
|
|
1322
|
+
__name(formatChar, "formatChar");
|
|
1323
|
+
function syntaxError(message) {
|
|
1324
|
+
const err = new SyntaxError(message);
|
|
1325
|
+
err.lineNumber = line;
|
|
1326
|
+
err.columnNumber = column;
|
|
1327
|
+
return err;
|
|
1328
|
+
}
|
|
1329
|
+
__name(syntaxError, "syntaxError");
|
|
1330
|
+
}
|
|
1331
|
+
});
|
|
1332
|
+
|
|
1333
|
+
// ../../node_modules/json5/lib/stringify.js
|
|
1334
|
+
var require_stringify = __commonJS({
|
|
1335
|
+
"../../node_modules/json5/lib/stringify.js"(exports, module) {
|
|
1336
|
+
var util = require_util();
|
|
1337
|
+
module.exports = /* @__PURE__ */ __name(function stringify2(value, replacer, space) {
|
|
1338
|
+
const stack = [];
|
|
1339
|
+
let indent2 = "";
|
|
1340
|
+
let propertyList;
|
|
1341
|
+
let replacerFunc;
|
|
1342
|
+
let gap = "";
|
|
1343
|
+
let quote;
|
|
1344
|
+
if (replacer != null && typeof replacer === "object" && !Array.isArray(replacer)) {
|
|
1345
|
+
space = replacer.space;
|
|
1346
|
+
quote = replacer.quote;
|
|
1347
|
+
replacer = replacer.replacer;
|
|
1348
|
+
}
|
|
1349
|
+
if (typeof replacer === "function") {
|
|
1350
|
+
replacerFunc = replacer;
|
|
1351
|
+
} else if (Array.isArray(replacer)) {
|
|
1352
|
+
propertyList = [];
|
|
1353
|
+
for (const v of replacer) {
|
|
1354
|
+
let item;
|
|
1355
|
+
if (typeof v === "string") {
|
|
1356
|
+
item = v;
|
|
1357
|
+
} else if (typeof v === "number" || v instanceof String || v instanceof Number) {
|
|
1358
|
+
item = String(v);
|
|
1359
|
+
}
|
|
1360
|
+
if (item !== void 0 && propertyList.indexOf(item) < 0) {
|
|
1361
|
+
propertyList.push(item);
|
|
1362
|
+
}
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
if (space instanceof Number) {
|
|
1366
|
+
space = Number(space);
|
|
1367
|
+
} else if (space instanceof String) {
|
|
1368
|
+
space = String(space);
|
|
1369
|
+
}
|
|
1370
|
+
if (typeof space === "number") {
|
|
1371
|
+
if (space > 0) {
|
|
1372
|
+
space = Math.min(10, Math.floor(space));
|
|
1373
|
+
gap = " ".substr(0, space);
|
|
1374
|
+
}
|
|
1375
|
+
} else if (typeof space === "string") {
|
|
1376
|
+
gap = space.substr(0, 10);
|
|
1377
|
+
}
|
|
1378
|
+
return serializeProperty("", { "": value });
|
|
1379
|
+
function serializeProperty(key, holder) {
|
|
1380
|
+
let value2 = holder[key];
|
|
1381
|
+
if (value2 != null) {
|
|
1382
|
+
if (typeof value2.toJSON5 === "function") {
|
|
1383
|
+
value2 = value2.toJSON5(key);
|
|
1384
|
+
} else if (typeof value2.toJSON === "function") {
|
|
1385
|
+
value2 = value2.toJSON(key);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
if (replacerFunc) {
|
|
1389
|
+
value2 = replacerFunc.call(holder, key, value2);
|
|
1390
|
+
}
|
|
1391
|
+
if (value2 instanceof Number) {
|
|
1392
|
+
value2 = Number(value2);
|
|
1393
|
+
} else if (value2 instanceof String) {
|
|
1394
|
+
value2 = String(value2);
|
|
1395
|
+
} else if (value2 instanceof Boolean) {
|
|
1396
|
+
value2 = value2.valueOf();
|
|
1397
|
+
}
|
|
1398
|
+
switch (value2) {
|
|
1399
|
+
case null:
|
|
1400
|
+
return "null";
|
|
1401
|
+
case true:
|
|
1402
|
+
return "true";
|
|
1403
|
+
case false:
|
|
1404
|
+
return "false";
|
|
1405
|
+
}
|
|
1406
|
+
if (typeof value2 === "string") {
|
|
1407
|
+
return quoteString(value2, false);
|
|
1408
|
+
}
|
|
1409
|
+
if (typeof value2 === "number") {
|
|
1410
|
+
return String(value2);
|
|
1411
|
+
}
|
|
1412
|
+
if (typeof value2 === "object") {
|
|
1413
|
+
return Array.isArray(value2) ? serializeArray(value2) : serializeObject(value2);
|
|
1414
|
+
}
|
|
1415
|
+
return void 0;
|
|
1416
|
+
}
|
|
1417
|
+
__name(serializeProperty, "serializeProperty");
|
|
1418
|
+
function quoteString(value2) {
|
|
1419
|
+
const quotes = {
|
|
1420
|
+
"'": 0.1,
|
|
1421
|
+
'"': 0.2
|
|
1422
|
+
};
|
|
1423
|
+
const replacements = {
|
|
1424
|
+
"'": "\\'",
|
|
1425
|
+
'"': '\\"',
|
|
1426
|
+
"\\": "\\\\",
|
|
1427
|
+
"\b": "\\b",
|
|
1428
|
+
"\f": "\\f",
|
|
1429
|
+
"\n": "\\n",
|
|
1430
|
+
"\r": "\\r",
|
|
1431
|
+
" ": "\\t",
|
|
1432
|
+
"\v": "\\v",
|
|
1433
|
+
"\0": "\\0",
|
|
1434
|
+
"\u2028": "\\u2028",
|
|
1435
|
+
"\u2029": "\\u2029"
|
|
1436
|
+
};
|
|
1437
|
+
let product = "";
|
|
1438
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1439
|
+
const c = value2[i];
|
|
1440
|
+
switch (c) {
|
|
1441
|
+
case "'":
|
|
1442
|
+
case '"':
|
|
1443
|
+
quotes[c]++;
|
|
1444
|
+
product += c;
|
|
1445
|
+
continue;
|
|
1446
|
+
case "\0":
|
|
1447
|
+
if (util.isDigit(value2[i + 1])) {
|
|
1448
|
+
product += "\\x00";
|
|
1449
|
+
continue;
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
if (replacements[c]) {
|
|
1453
|
+
product += replacements[c];
|
|
1454
|
+
continue;
|
|
1455
|
+
}
|
|
1456
|
+
if (c < " ") {
|
|
1457
|
+
let hexString = c.charCodeAt(0).toString(16);
|
|
1458
|
+
product += "\\x" + ("00" + hexString).substring(hexString.length);
|
|
1459
|
+
continue;
|
|
1460
|
+
}
|
|
1461
|
+
product += c;
|
|
1462
|
+
}
|
|
1463
|
+
const quoteChar = quote || Object.keys(quotes).reduce((a, b) => quotes[a] < quotes[b] ? a : b);
|
|
1464
|
+
product = product.replace(new RegExp(quoteChar, "g"), replacements[quoteChar]);
|
|
1465
|
+
return quoteChar + product + quoteChar;
|
|
1466
|
+
}
|
|
1467
|
+
__name(quoteString, "quoteString");
|
|
1468
|
+
function serializeObject(value2) {
|
|
1469
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1470
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1471
|
+
}
|
|
1472
|
+
stack.push(value2);
|
|
1473
|
+
let stepback = indent2;
|
|
1474
|
+
indent2 = indent2 + gap;
|
|
1475
|
+
let keys = propertyList || Object.keys(value2);
|
|
1476
|
+
let partial = [];
|
|
1477
|
+
for (const key of keys) {
|
|
1478
|
+
const propertyString = serializeProperty(key, value2);
|
|
1479
|
+
if (propertyString !== void 0) {
|
|
1480
|
+
let member = serializeKey(key) + ":";
|
|
1481
|
+
if (gap !== "") {
|
|
1482
|
+
member += " ";
|
|
1483
|
+
}
|
|
1484
|
+
member += propertyString;
|
|
1485
|
+
partial.push(member);
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1488
|
+
let final;
|
|
1489
|
+
if (partial.length === 0) {
|
|
1490
|
+
final = "{}";
|
|
1491
|
+
} else {
|
|
1492
|
+
let properties;
|
|
1493
|
+
if (gap === "") {
|
|
1494
|
+
properties = partial.join(",");
|
|
1495
|
+
final = "{" + properties + "}";
|
|
1496
|
+
} else {
|
|
1497
|
+
let separator = ",\n" + indent2;
|
|
1498
|
+
properties = partial.join(separator);
|
|
1499
|
+
final = "{\n" + indent2 + properties + ",\n" + stepback + "}";
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
stack.pop();
|
|
1503
|
+
indent2 = stepback;
|
|
1504
|
+
return final;
|
|
1505
|
+
}
|
|
1506
|
+
__name(serializeObject, "serializeObject");
|
|
1507
|
+
function serializeKey(key) {
|
|
1508
|
+
if (key.length === 0) {
|
|
1509
|
+
return quoteString(key, true);
|
|
1510
|
+
}
|
|
1511
|
+
const firstChar = String.fromCodePoint(key.codePointAt(0));
|
|
1512
|
+
if (!util.isIdStartChar(firstChar)) {
|
|
1513
|
+
return quoteString(key, true);
|
|
1514
|
+
}
|
|
1515
|
+
for (let i = firstChar.length; i < key.length; i++) {
|
|
1516
|
+
if (!util.isIdContinueChar(String.fromCodePoint(key.codePointAt(i)))) {
|
|
1517
|
+
return quoteString(key, true);
|
|
1518
|
+
}
|
|
1519
|
+
}
|
|
1520
|
+
return key;
|
|
1521
|
+
}
|
|
1522
|
+
__name(serializeKey, "serializeKey");
|
|
1523
|
+
function serializeArray(value2) {
|
|
1524
|
+
if (stack.indexOf(value2) >= 0) {
|
|
1525
|
+
throw TypeError("Converting circular structure to JSON5");
|
|
1526
|
+
}
|
|
1527
|
+
stack.push(value2);
|
|
1528
|
+
let stepback = indent2;
|
|
1529
|
+
indent2 = indent2 + gap;
|
|
1530
|
+
let partial = [];
|
|
1531
|
+
for (let i = 0; i < value2.length; i++) {
|
|
1532
|
+
const propertyString = serializeProperty(String(i), value2);
|
|
1533
|
+
partial.push(propertyString !== void 0 ? propertyString : "null");
|
|
1534
|
+
}
|
|
1535
|
+
let final;
|
|
1536
|
+
if (partial.length === 0) {
|
|
1537
|
+
final = "[]";
|
|
1538
|
+
} else {
|
|
1539
|
+
if (gap === "") {
|
|
1540
|
+
let properties = partial.join(",");
|
|
1541
|
+
final = "[" + properties + "]";
|
|
1542
|
+
} else {
|
|
1543
|
+
let separator = ",\n" + indent2;
|
|
1544
|
+
let properties = partial.join(separator);
|
|
1545
|
+
final = "[\n" + indent2 + properties + ",\n" + stepback + "]";
|
|
1546
|
+
}
|
|
1547
|
+
}
|
|
1548
|
+
stack.pop();
|
|
1549
|
+
indent2 = stepback;
|
|
1550
|
+
return final;
|
|
1551
|
+
}
|
|
1552
|
+
__name(serializeArray, "serializeArray");
|
|
1553
|
+
}, "stringify");
|
|
1554
|
+
}
|
|
1555
|
+
});
|
|
1556
|
+
|
|
1557
|
+
// ../../node_modules/json5/lib/index.js
|
|
1558
|
+
var require_lib = __commonJS({
|
|
1559
|
+
"../../node_modules/json5/lib/index.js"(exports, module) {
|
|
1560
|
+
var parse4 = require_parse();
|
|
1561
|
+
var stringify2 = require_stringify();
|
|
1562
|
+
var JSON5 = {
|
|
1563
|
+
parse: parse4,
|
|
1564
|
+
stringify: stringify2
|
|
1565
|
+
};
|
|
1566
|
+
module.exports = JSON5;
|
|
1567
|
+
}
|
|
1568
|
+
});
|
|
1569
|
+
|
|
1570
|
+
// ../../node_modules/strip-bom/index.js
|
|
1571
|
+
var require_strip_bom = __commonJS({
|
|
1572
|
+
"../../node_modules/strip-bom/index.js"(exports, module) {
|
|
1573
|
+
"use strict";
|
|
1574
|
+
module.exports = (x) => {
|
|
1575
|
+
if (typeof x !== "string") {
|
|
1576
|
+
throw new TypeError("Expected a string, got " + typeof x);
|
|
1577
|
+
}
|
|
1578
|
+
if (x.charCodeAt(0) === 65279) {
|
|
1579
|
+
return x.slice(1);
|
|
1580
|
+
}
|
|
1581
|
+
return x;
|
|
1582
|
+
};
|
|
1583
|
+
}
|
|
1584
|
+
});
|
|
1585
|
+
|
|
1586
|
+
// ../../node_modules/tsconfig-paths/lib/tsconfig-loader.js
|
|
1587
|
+
var require_tsconfig_loader = __commonJS({
|
|
1588
|
+
"../../node_modules/tsconfig-paths/lib/tsconfig-loader.js"(exports) {
|
|
1589
|
+
"use strict";
|
|
1590
|
+
var __assign = exports && exports.__assign || function() {
|
|
1591
|
+
__assign = Object.assign || function(t4) {
|
|
1592
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
1593
|
+
s = arguments[i];
|
|
1594
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
1595
|
+
t4[p] = s[p];
|
|
1596
|
+
}
|
|
1597
|
+
return t4;
|
|
1598
|
+
};
|
|
1599
|
+
return __assign.apply(this, arguments);
|
|
1600
|
+
};
|
|
1601
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1602
|
+
exports.loadTsconfig = exports.walkForTsConfig = exports.tsConfigLoader = void 0;
|
|
1603
|
+
var path2 = __require("path");
|
|
1604
|
+
var fs = __require("fs");
|
|
1605
|
+
var JSON5 = require_lib();
|
|
1606
|
+
var StripBom = require_strip_bom();
|
|
1607
|
+
function tsConfigLoader(_a) {
|
|
1608
|
+
var getEnv = _a.getEnv, cwd2 = _a.cwd, _b = _a.loadSync, loadSync = _b === void 0 ? loadSyncDefault : _b;
|
|
1609
|
+
var TS_NODE_PROJECT = getEnv("TS_NODE_PROJECT");
|
|
1610
|
+
var TS_NODE_BASEURL = getEnv("TS_NODE_BASEURL");
|
|
1611
|
+
var loadResult = loadSync(cwd2, TS_NODE_PROJECT, TS_NODE_BASEURL);
|
|
1612
|
+
return loadResult;
|
|
1613
|
+
}
|
|
1614
|
+
__name(tsConfigLoader, "tsConfigLoader");
|
|
1615
|
+
exports.tsConfigLoader = tsConfigLoader;
|
|
1616
|
+
function loadSyncDefault(cwd2, filename, baseUrl) {
|
|
1617
|
+
var configPath = resolveConfigPath(cwd2, filename);
|
|
1618
|
+
if (!configPath) {
|
|
1619
|
+
return {
|
|
1620
|
+
tsConfigPath: void 0,
|
|
1621
|
+
baseUrl: void 0,
|
|
1622
|
+
paths: void 0
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1625
|
+
var config = loadTsconfig(configPath);
|
|
1626
|
+
return {
|
|
1627
|
+
tsConfigPath: configPath,
|
|
1628
|
+
baseUrl: baseUrl || config && config.compilerOptions && config.compilerOptions.baseUrl,
|
|
1629
|
+
paths: config && config.compilerOptions && config.compilerOptions.paths
|
|
1630
|
+
};
|
|
1631
|
+
}
|
|
1632
|
+
__name(loadSyncDefault, "loadSyncDefault");
|
|
1633
|
+
function resolveConfigPath(cwd2, filename) {
|
|
1634
|
+
if (filename) {
|
|
1635
|
+
var absolutePath = fs.lstatSync(filename).isDirectory() ? path2.resolve(filename, "./tsconfig.json") : path2.resolve(cwd2, filename);
|
|
1636
|
+
return absolutePath;
|
|
1637
|
+
}
|
|
1638
|
+
if (fs.statSync(cwd2).isFile()) {
|
|
1639
|
+
return path2.resolve(cwd2);
|
|
1640
|
+
}
|
|
1641
|
+
var configAbsolutePath = walkForTsConfig(cwd2);
|
|
1642
|
+
return configAbsolutePath ? path2.resolve(configAbsolutePath) : void 0;
|
|
1643
|
+
}
|
|
1644
|
+
__name(resolveConfigPath, "resolveConfigPath");
|
|
1645
|
+
function walkForTsConfig(directory, readdirSync) {
|
|
1646
|
+
if (readdirSync === void 0) {
|
|
1647
|
+
readdirSync = fs.readdirSync;
|
|
1648
|
+
}
|
|
1649
|
+
var files = readdirSync(directory);
|
|
1650
|
+
var filesToCheck = ["tsconfig.json", "jsconfig.json"];
|
|
1651
|
+
for (var _i = 0, filesToCheck_1 = filesToCheck; _i < filesToCheck_1.length; _i++) {
|
|
1652
|
+
var fileToCheck = filesToCheck_1[_i];
|
|
1653
|
+
if (files.indexOf(fileToCheck) !== -1) {
|
|
1654
|
+
return path2.join(directory, fileToCheck);
|
|
1655
|
+
}
|
|
1656
|
+
}
|
|
1657
|
+
var parentDirectory = path2.dirname(directory);
|
|
1658
|
+
if (directory === parentDirectory) {
|
|
1659
|
+
return void 0;
|
|
1660
|
+
}
|
|
1661
|
+
return walkForTsConfig(parentDirectory, readdirSync);
|
|
1662
|
+
}
|
|
1663
|
+
__name(walkForTsConfig, "walkForTsConfig");
|
|
1664
|
+
exports.walkForTsConfig = walkForTsConfig;
|
|
1665
|
+
function loadTsconfig(configFilePath, existsSync3, readFileSync) {
|
|
1666
|
+
if (existsSync3 === void 0) {
|
|
1667
|
+
existsSync3 = fs.existsSync;
|
|
1668
|
+
}
|
|
1669
|
+
if (readFileSync === void 0) {
|
|
1670
|
+
readFileSync = /* @__PURE__ */ __name(function(filename) {
|
|
1671
|
+
return fs.readFileSync(filename, "utf8");
|
|
1672
|
+
}, "readFileSync");
|
|
1673
|
+
}
|
|
1674
|
+
if (!existsSync3(configFilePath)) {
|
|
1675
|
+
return void 0;
|
|
1676
|
+
}
|
|
1677
|
+
var configString = readFileSync(configFilePath);
|
|
1678
|
+
var cleanedJson = StripBom(configString);
|
|
1679
|
+
var config;
|
|
1680
|
+
try {
|
|
1681
|
+
config = JSON5.parse(cleanedJson);
|
|
1682
|
+
} catch (e) {
|
|
1683
|
+
throw new Error("".concat(configFilePath, " is malformed ").concat(e.message));
|
|
1684
|
+
}
|
|
1685
|
+
var extendedConfig = config.extends;
|
|
1686
|
+
if (extendedConfig) {
|
|
1687
|
+
var base = void 0;
|
|
1688
|
+
if (Array.isArray(extendedConfig)) {
|
|
1689
|
+
base = extendedConfig.reduce(function(currBase, extendedConfigElement) {
|
|
1690
|
+
return mergeTsconfigs(currBase, loadTsconfigFromExtends(configFilePath, extendedConfigElement, existsSync3, readFileSync));
|
|
1691
|
+
}, {});
|
|
1692
|
+
} else {
|
|
1693
|
+
base = loadTsconfigFromExtends(configFilePath, extendedConfig, existsSync3, readFileSync);
|
|
1694
|
+
}
|
|
1695
|
+
return mergeTsconfigs(base, config);
|
|
1696
|
+
}
|
|
1697
|
+
return config;
|
|
1698
|
+
}
|
|
1699
|
+
__name(loadTsconfig, "loadTsconfig");
|
|
1700
|
+
exports.loadTsconfig = loadTsconfig;
|
|
1701
|
+
function loadTsconfigFromExtends(configFilePath, extendedConfigValue, existsSync3, readFileSync) {
|
|
1702
|
+
var _a;
|
|
1703
|
+
if (typeof extendedConfigValue === "string" && extendedConfigValue.indexOf(".json") === -1) {
|
|
1704
|
+
extendedConfigValue += ".json";
|
|
1705
|
+
}
|
|
1706
|
+
var currentDir = path2.dirname(configFilePath);
|
|
1707
|
+
var extendedConfigPath = path2.join(currentDir, extendedConfigValue);
|
|
1708
|
+
if (extendedConfigValue.indexOf("/") !== -1 && extendedConfigValue.indexOf(".") !== -1 && !existsSync3(extendedConfigPath)) {
|
|
1709
|
+
extendedConfigPath = path2.join(currentDir, "node_modules", extendedConfigValue);
|
|
1710
|
+
}
|
|
1711
|
+
var config = loadTsconfig(extendedConfigPath, existsSync3, readFileSync) || {};
|
|
1712
|
+
if ((_a = config.compilerOptions) === null || _a === void 0 ? void 0 : _a.baseUrl) {
|
|
1713
|
+
var extendsDir = path2.dirname(extendedConfigValue);
|
|
1714
|
+
config.compilerOptions.baseUrl = path2.join(extendsDir, config.compilerOptions.baseUrl);
|
|
1715
|
+
}
|
|
1716
|
+
return config;
|
|
1717
|
+
}
|
|
1718
|
+
__name(loadTsconfigFromExtends, "loadTsconfigFromExtends");
|
|
1719
|
+
function mergeTsconfigs(base, config) {
|
|
1720
|
+
base = base || {};
|
|
1721
|
+
config = config || {};
|
|
1722
|
+
return __assign(__assign(__assign({}, base), config), { compilerOptions: __assign(__assign({}, base.compilerOptions), config.compilerOptions) });
|
|
1723
|
+
}
|
|
1724
|
+
__name(mergeTsconfigs, "mergeTsconfigs");
|
|
1725
|
+
}
|
|
1726
|
+
});
|
|
1727
|
+
|
|
1728
|
+
// ../../node_modules/tsconfig-paths/lib/config-loader.js
|
|
1729
|
+
var require_config_loader = __commonJS({
|
|
1730
|
+
"../../node_modules/tsconfig-paths/lib/config-loader.js"(exports) {
|
|
1731
|
+
"use strict";
|
|
1732
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1733
|
+
exports.configLoader = exports.loadConfig = void 0;
|
|
1734
|
+
var TsConfigLoader2 = require_tsconfig_loader();
|
|
1735
|
+
var path2 = __require("path");
|
|
1736
|
+
function loadConfig2(cwd2) {
|
|
1737
|
+
if (cwd2 === void 0) {
|
|
1738
|
+
cwd2 = process.cwd();
|
|
1739
|
+
}
|
|
1740
|
+
return configLoader({ cwd: cwd2 });
|
|
1741
|
+
}
|
|
1742
|
+
__name(loadConfig2, "loadConfig");
|
|
1743
|
+
exports.loadConfig = loadConfig2;
|
|
1744
|
+
function configLoader(_a) {
|
|
1745
|
+
var cwd2 = _a.cwd, explicitParams = _a.explicitParams, _b = _a.tsConfigLoader, tsConfigLoader = _b === void 0 ? TsConfigLoader2.tsConfigLoader : _b;
|
|
1746
|
+
if (explicitParams) {
|
|
1747
|
+
var absoluteBaseUrl = path2.isAbsolute(explicitParams.baseUrl) ? explicitParams.baseUrl : path2.join(cwd2, explicitParams.baseUrl);
|
|
1748
|
+
return {
|
|
1749
|
+
resultType: "success",
|
|
1750
|
+
configFileAbsolutePath: "",
|
|
1751
|
+
baseUrl: explicitParams.baseUrl,
|
|
1752
|
+
absoluteBaseUrl,
|
|
1753
|
+
paths: explicitParams.paths,
|
|
1754
|
+
mainFields: explicitParams.mainFields,
|
|
1755
|
+
addMatchAll: explicitParams.addMatchAll
|
|
1756
|
+
};
|
|
1757
|
+
}
|
|
1758
|
+
var loadResult = tsConfigLoader({
|
|
1759
|
+
cwd: cwd2,
|
|
1760
|
+
getEnv: /* @__PURE__ */ __name(function(key) {
|
|
1761
|
+
return process.env[key];
|
|
1762
|
+
}, "getEnv")
|
|
1763
|
+
});
|
|
1764
|
+
if (!loadResult.tsConfigPath) {
|
|
1765
|
+
return {
|
|
1766
|
+
resultType: "failed",
|
|
1767
|
+
message: "Couldn't find tsconfig.json"
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
return {
|
|
1771
|
+
resultType: "success",
|
|
1772
|
+
configFileAbsolutePath: loadResult.tsConfigPath,
|
|
1773
|
+
baseUrl: loadResult.baseUrl,
|
|
1774
|
+
absoluteBaseUrl: path2.resolve(path2.dirname(loadResult.tsConfigPath), loadResult.baseUrl || ""),
|
|
1775
|
+
paths: loadResult.paths || {},
|
|
1776
|
+
addMatchAll: loadResult.baseUrl !== void 0
|
|
1777
|
+
};
|
|
1778
|
+
}
|
|
1779
|
+
__name(configLoader, "configLoader");
|
|
1780
|
+
exports.configLoader = configLoader;
|
|
1781
|
+
}
|
|
1782
|
+
});
|
|
1783
|
+
|
|
1784
|
+
// ../../node_modules/minimist/index.js
|
|
1785
|
+
var require_minimist = __commonJS({
|
|
1786
|
+
"../../node_modules/minimist/index.js"(exports, module) {
|
|
1787
|
+
"use strict";
|
|
1788
|
+
function hasKey(obj, keys) {
|
|
1789
|
+
var o = obj;
|
|
1790
|
+
keys.slice(0, -1).forEach(function(key2) {
|
|
1791
|
+
o = o[key2] || {};
|
|
1792
|
+
});
|
|
1793
|
+
var key = keys[keys.length - 1];
|
|
1794
|
+
return key in o;
|
|
1795
|
+
}
|
|
1796
|
+
__name(hasKey, "hasKey");
|
|
1797
|
+
function isNumber(x) {
|
|
1798
|
+
if (typeof x === "number") {
|
|
1799
|
+
return true;
|
|
1800
|
+
}
|
|
1801
|
+
if (/^0x[0-9a-f]+$/i.test(x)) {
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1804
|
+
return /^[-+]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(x);
|
|
1805
|
+
}
|
|
1806
|
+
__name(isNumber, "isNumber");
|
|
1807
|
+
function isConstructorOrProto(obj, key) {
|
|
1808
|
+
return key === "constructor" && typeof obj[key] === "function" || key === "__proto__";
|
|
1809
|
+
}
|
|
1810
|
+
__name(isConstructorOrProto, "isConstructorOrProto");
|
|
1811
|
+
module.exports = function(args, opts) {
|
|
1812
|
+
if (!opts) {
|
|
1813
|
+
opts = {};
|
|
1814
|
+
}
|
|
1815
|
+
var flags = {
|
|
1816
|
+
bools: {},
|
|
1817
|
+
strings: {},
|
|
1818
|
+
unknownFn: null
|
|
1819
|
+
};
|
|
1820
|
+
if (typeof opts.unknown === "function") {
|
|
1821
|
+
flags.unknownFn = opts.unknown;
|
|
1822
|
+
}
|
|
1823
|
+
if (typeof opts.boolean === "boolean" && opts.boolean) {
|
|
1824
|
+
flags.allBools = true;
|
|
1825
|
+
} else {
|
|
1826
|
+
[].concat(opts.boolean).filter(Boolean).forEach(function(key2) {
|
|
1827
|
+
flags.bools[key2] = true;
|
|
1828
|
+
});
|
|
1829
|
+
}
|
|
1830
|
+
var aliases = {};
|
|
1831
|
+
function aliasIsBoolean(key2) {
|
|
1832
|
+
return aliases[key2].some(function(x) {
|
|
1833
|
+
return flags.bools[x];
|
|
1834
|
+
});
|
|
1835
|
+
}
|
|
1836
|
+
__name(aliasIsBoolean, "aliasIsBoolean");
|
|
1837
|
+
Object.keys(opts.alias || {}).forEach(function(key2) {
|
|
1838
|
+
aliases[key2] = [].concat(opts.alias[key2]);
|
|
1839
|
+
aliases[key2].forEach(function(x) {
|
|
1840
|
+
aliases[x] = [key2].concat(aliases[key2].filter(function(y) {
|
|
1841
|
+
return x !== y;
|
|
1842
|
+
}));
|
|
1843
|
+
});
|
|
1844
|
+
});
|
|
1845
|
+
[].concat(opts.string).filter(Boolean).forEach(function(key2) {
|
|
1846
|
+
flags.strings[key2] = true;
|
|
1847
|
+
if (aliases[key2]) {
|
|
1848
|
+
[].concat(aliases[key2]).forEach(function(k) {
|
|
1849
|
+
flags.strings[k] = true;
|
|
1850
|
+
});
|
|
1851
|
+
}
|
|
1852
|
+
});
|
|
1853
|
+
var defaults = opts.default || {};
|
|
1854
|
+
var argv = { _: [] };
|
|
1855
|
+
function argDefined(key2, arg2) {
|
|
1856
|
+
return flags.allBools && /^--[^=]+$/.test(arg2) || flags.strings[key2] || flags.bools[key2] || aliases[key2];
|
|
1857
|
+
}
|
|
1858
|
+
__name(argDefined, "argDefined");
|
|
1859
|
+
function setKey(obj, keys, value2) {
|
|
1860
|
+
var o = obj;
|
|
1861
|
+
for (var i2 = 0; i2 < keys.length - 1; i2++) {
|
|
1862
|
+
var key2 = keys[i2];
|
|
1863
|
+
if (isConstructorOrProto(o, key2)) {
|
|
1864
|
+
return;
|
|
1865
|
+
}
|
|
1866
|
+
if (o[key2] === void 0) {
|
|
1867
|
+
o[key2] = {};
|
|
1868
|
+
}
|
|
1869
|
+
if (o[key2] === Object.prototype || o[key2] === Number.prototype || o[key2] === String.prototype) {
|
|
1870
|
+
o[key2] = {};
|
|
1871
|
+
}
|
|
1872
|
+
if (o[key2] === Array.prototype) {
|
|
1873
|
+
o[key2] = [];
|
|
1874
|
+
}
|
|
1875
|
+
o = o[key2];
|
|
1876
|
+
}
|
|
1877
|
+
var lastKey = keys[keys.length - 1];
|
|
1878
|
+
if (isConstructorOrProto(o, lastKey)) {
|
|
1879
|
+
return;
|
|
1880
|
+
}
|
|
1881
|
+
if (o === Object.prototype || o === Number.prototype || o === String.prototype) {
|
|
1882
|
+
o = {};
|
|
1883
|
+
}
|
|
1884
|
+
if (o === Array.prototype) {
|
|
1885
|
+
o = [];
|
|
1886
|
+
}
|
|
1887
|
+
if (o[lastKey] === void 0 || flags.bools[lastKey] || typeof o[lastKey] === "boolean") {
|
|
1888
|
+
o[lastKey] = value2;
|
|
1889
|
+
} else if (Array.isArray(o[lastKey])) {
|
|
1890
|
+
o[lastKey].push(value2);
|
|
1891
|
+
} else {
|
|
1892
|
+
o[lastKey] = [o[lastKey], value2];
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
__name(setKey, "setKey");
|
|
1896
|
+
function setArg(key2, val, arg2) {
|
|
1897
|
+
if (arg2 && flags.unknownFn && !argDefined(key2, arg2)) {
|
|
1898
|
+
if (flags.unknownFn(arg2) === false) {
|
|
1899
|
+
return;
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
var value2 = !flags.strings[key2] && isNumber(val) ? Number(val) : val;
|
|
1903
|
+
setKey(argv, key2.split("."), value2);
|
|
1904
|
+
(aliases[key2] || []).forEach(function(x) {
|
|
1905
|
+
setKey(argv, x.split("."), value2);
|
|
1906
|
+
});
|
|
1907
|
+
}
|
|
1908
|
+
__name(setArg, "setArg");
|
|
1909
|
+
Object.keys(flags.bools).forEach(function(key2) {
|
|
1910
|
+
setArg(key2, defaults[key2] === void 0 ? false : defaults[key2]);
|
|
1911
|
+
});
|
|
1912
|
+
var notFlags = [];
|
|
1913
|
+
if (args.indexOf("--") !== -1) {
|
|
1914
|
+
notFlags = args.slice(args.indexOf("--") + 1);
|
|
1915
|
+
args = args.slice(0, args.indexOf("--"));
|
|
1916
|
+
}
|
|
1917
|
+
for (var i = 0; i < args.length; i++) {
|
|
1918
|
+
var arg = args[i];
|
|
1919
|
+
var key;
|
|
1920
|
+
var next;
|
|
1921
|
+
if (/^--.+=/.test(arg)) {
|
|
1922
|
+
var m = arg.match(/^--([^=]+)=([\s\S]*)$/);
|
|
1923
|
+
key = m[1];
|
|
1924
|
+
var value = m[2];
|
|
1925
|
+
if (flags.bools[key]) {
|
|
1926
|
+
value = value !== "false";
|
|
1927
|
+
}
|
|
1928
|
+
setArg(key, value, arg);
|
|
1929
|
+
} else if (/^--no-.+/.test(arg)) {
|
|
1930
|
+
key = arg.match(/^--no-(.+)/)[1];
|
|
1931
|
+
setArg(key, false, arg);
|
|
1932
|
+
} else if (/^--.+/.test(arg)) {
|
|
1933
|
+
key = arg.match(/^--(.+)/)[1];
|
|
1934
|
+
next = args[i + 1];
|
|
1935
|
+
if (next !== void 0 && !/^(-|--)[^-]/.test(next) && !flags.bools[key] && !flags.allBools && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
1936
|
+
setArg(key, next, arg);
|
|
1937
|
+
i += 1;
|
|
1938
|
+
} else if (/^(true|false)$/.test(next)) {
|
|
1939
|
+
setArg(key, next === "true", arg);
|
|
1940
|
+
i += 1;
|
|
1941
|
+
} else {
|
|
1942
|
+
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
1943
|
+
}
|
|
1944
|
+
} else if (/^-[^-]+/.test(arg)) {
|
|
1945
|
+
var letters = arg.slice(1, -1).split("");
|
|
1946
|
+
var broken = false;
|
|
1947
|
+
for (var j = 0; j < letters.length; j++) {
|
|
1948
|
+
next = arg.slice(j + 2);
|
|
1949
|
+
if (next === "-") {
|
|
1950
|
+
setArg(letters[j], next, arg);
|
|
1951
|
+
continue;
|
|
1952
|
+
}
|
|
1953
|
+
if (/[A-Za-z]/.test(letters[j]) && next[0] === "=") {
|
|
1954
|
+
setArg(letters[j], next.slice(1), arg);
|
|
1955
|
+
broken = true;
|
|
1956
|
+
break;
|
|
1957
|
+
}
|
|
1958
|
+
if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) {
|
|
1959
|
+
setArg(letters[j], next, arg);
|
|
1960
|
+
broken = true;
|
|
1961
|
+
break;
|
|
1962
|
+
}
|
|
1963
|
+
if (letters[j + 1] && letters[j + 1].match(/\W/)) {
|
|
1964
|
+
setArg(letters[j], arg.slice(j + 2), arg);
|
|
1965
|
+
broken = true;
|
|
1966
|
+
break;
|
|
1967
|
+
} else {
|
|
1968
|
+
setArg(letters[j], flags.strings[letters[j]] ? "" : true, arg);
|
|
1969
|
+
}
|
|
1970
|
+
}
|
|
1971
|
+
key = arg.slice(-1)[0];
|
|
1972
|
+
if (!broken && key !== "-") {
|
|
1973
|
+
if (args[i + 1] && !/^(-|--)[^-]/.test(args[i + 1]) && !flags.bools[key] && (aliases[key] ? !aliasIsBoolean(key) : true)) {
|
|
1974
|
+
setArg(key, args[i + 1], arg);
|
|
1975
|
+
i += 1;
|
|
1976
|
+
} else if (args[i + 1] && /^(true|false)$/.test(args[i + 1])) {
|
|
1977
|
+
setArg(key, args[i + 1] === "true", arg);
|
|
1978
|
+
i += 1;
|
|
1979
|
+
} else {
|
|
1980
|
+
setArg(key, flags.strings[key] ? "" : true, arg);
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1983
|
+
} else {
|
|
1984
|
+
if (!flags.unknownFn || flags.unknownFn(arg) !== false) {
|
|
1985
|
+
argv._.push(flags.strings._ || !isNumber(arg) ? arg : Number(arg));
|
|
1986
|
+
}
|
|
1987
|
+
if (opts.stopEarly) {
|
|
1988
|
+
argv._.push.apply(argv._, args.slice(i + 1));
|
|
1989
|
+
break;
|
|
1990
|
+
}
|
|
1991
|
+
}
|
|
1992
|
+
}
|
|
1993
|
+
Object.keys(defaults).forEach(function(k) {
|
|
1994
|
+
if (!hasKey(argv, k.split("."))) {
|
|
1995
|
+
setKey(argv, k.split("."), defaults[k]);
|
|
1996
|
+
(aliases[k] || []).forEach(function(x) {
|
|
1997
|
+
setKey(argv, x.split("."), defaults[k]);
|
|
1998
|
+
});
|
|
1999
|
+
}
|
|
2000
|
+
});
|
|
2001
|
+
if (opts["--"]) {
|
|
2002
|
+
argv["--"] = notFlags.slice();
|
|
2003
|
+
} else {
|
|
2004
|
+
notFlags.forEach(function(k) {
|
|
2005
|
+
argv._.push(k);
|
|
2006
|
+
});
|
|
2007
|
+
}
|
|
2008
|
+
return argv;
|
|
2009
|
+
};
|
|
2010
|
+
}
|
|
2011
|
+
});
|
|
2012
|
+
|
|
2013
|
+
// ../../node_modules/tsconfig-paths/lib/register.js
|
|
2014
|
+
var require_register = __commonJS({
|
|
2015
|
+
"../../node_modules/tsconfig-paths/lib/register.js"(exports) {
|
|
2016
|
+
"use strict";
|
|
2017
|
+
var __spreadArray = exports && exports.__spreadArray || function(to, from, pack) {
|
|
2018
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
2019
|
+
if (ar || !(i in from)) {
|
|
2020
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
2021
|
+
ar[i] = from[i];
|
|
2022
|
+
}
|
|
2023
|
+
}
|
|
2024
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
2025
|
+
};
|
|
2026
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2027
|
+
exports.register = void 0;
|
|
2028
|
+
var match_path_sync_1 = require_match_path_sync();
|
|
2029
|
+
var config_loader_1 = require_config_loader();
|
|
2030
|
+
var noOp = /* @__PURE__ */ __name(function() {
|
|
2031
|
+
return void 0;
|
|
2032
|
+
}, "noOp");
|
|
2033
|
+
function getCoreModules(builtinModules) {
|
|
2034
|
+
builtinModules = builtinModules || [
|
|
2035
|
+
"assert",
|
|
2036
|
+
"buffer",
|
|
2037
|
+
"child_process",
|
|
2038
|
+
"cluster",
|
|
2039
|
+
"crypto",
|
|
2040
|
+
"dgram",
|
|
2041
|
+
"dns",
|
|
2042
|
+
"domain",
|
|
2043
|
+
"events",
|
|
2044
|
+
"fs",
|
|
2045
|
+
"http",
|
|
2046
|
+
"https",
|
|
2047
|
+
"net",
|
|
2048
|
+
"os",
|
|
2049
|
+
"path",
|
|
2050
|
+
"punycode",
|
|
2051
|
+
"querystring",
|
|
2052
|
+
"readline",
|
|
2053
|
+
"stream",
|
|
2054
|
+
"string_decoder",
|
|
2055
|
+
"tls",
|
|
2056
|
+
"tty",
|
|
2057
|
+
"url",
|
|
2058
|
+
"util",
|
|
2059
|
+
"v8",
|
|
2060
|
+
"vm",
|
|
2061
|
+
"zlib"
|
|
2062
|
+
];
|
|
2063
|
+
var coreModules = {};
|
|
2064
|
+
for (var _i = 0, builtinModules_1 = builtinModules; _i < builtinModules_1.length; _i++) {
|
|
2065
|
+
var module_1 = builtinModules_1[_i];
|
|
2066
|
+
coreModules[module_1] = true;
|
|
2067
|
+
}
|
|
2068
|
+
return coreModules;
|
|
2069
|
+
}
|
|
2070
|
+
__name(getCoreModules, "getCoreModules");
|
|
2071
|
+
function register(params) {
|
|
2072
|
+
var cwd2;
|
|
2073
|
+
var explicitParams;
|
|
2074
|
+
if (params) {
|
|
2075
|
+
cwd2 = params.cwd;
|
|
2076
|
+
if (params.baseUrl || params.paths) {
|
|
2077
|
+
explicitParams = params;
|
|
2078
|
+
}
|
|
2079
|
+
} else {
|
|
2080
|
+
var minimist = require_minimist();
|
|
2081
|
+
var argv = minimist(process.argv.slice(2), {
|
|
2082
|
+
// eslint-disable-next-line id-denylist
|
|
2083
|
+
string: ["project"],
|
|
2084
|
+
alias: {
|
|
2085
|
+
project: ["P"]
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
cwd2 = argv.project;
|
|
2089
|
+
}
|
|
2090
|
+
var configLoaderResult = (0, config_loader_1.configLoader)({
|
|
2091
|
+
cwd: cwd2 !== null && cwd2 !== void 0 ? cwd2 : process.cwd(),
|
|
2092
|
+
explicitParams
|
|
2093
|
+
});
|
|
2094
|
+
if (configLoaderResult.resultType === "failed") {
|
|
2095
|
+
console.warn("".concat(configLoaderResult.message, ". tsconfig-paths will be skipped"));
|
|
2096
|
+
return noOp;
|
|
2097
|
+
}
|
|
2098
|
+
var matchPath = (0, match_path_sync_1.createMatchPath)(configLoaderResult.absoluteBaseUrl, configLoaderResult.paths, configLoaderResult.mainFields, configLoaderResult.addMatchAll);
|
|
2099
|
+
var Module = __require("module");
|
|
2100
|
+
var originalResolveFilename = Module._resolveFilename;
|
|
2101
|
+
var coreModules = getCoreModules(Module.builtinModules);
|
|
2102
|
+
Module._resolveFilename = function(request, _parent) {
|
|
2103
|
+
var isCoreModule = coreModules.hasOwnProperty(request);
|
|
2104
|
+
if (!isCoreModule) {
|
|
2105
|
+
var found = matchPath(request);
|
|
2106
|
+
if (found) {
|
|
2107
|
+
var modifiedArguments = __spreadArray([found], [].slice.call(arguments, 1), true);
|
|
2108
|
+
return originalResolveFilename.apply(this, modifiedArguments);
|
|
2109
|
+
}
|
|
2110
|
+
}
|
|
2111
|
+
return originalResolveFilename.apply(this, arguments);
|
|
2112
|
+
};
|
|
2113
|
+
return function() {
|
|
2114
|
+
Module._resolveFilename = originalResolveFilename;
|
|
2115
|
+
};
|
|
2116
|
+
}
|
|
2117
|
+
__name(register, "register");
|
|
2118
|
+
exports.register = register;
|
|
2119
|
+
}
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
// ../../node_modules/tsconfig-paths/lib/index.js
|
|
2123
|
+
var require_lib2 = __commonJS({
|
|
2124
|
+
"../../node_modules/tsconfig-paths/lib/index.js"(exports) {
|
|
2125
|
+
"use strict";
|
|
2126
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2127
|
+
exports.loadConfig = exports.register = exports.matchFromAbsolutePathsAsync = exports.createMatchPathAsync = exports.matchFromAbsolutePaths = exports.createMatchPath = void 0;
|
|
2128
|
+
var match_path_sync_1 = require_match_path_sync();
|
|
2129
|
+
Object.defineProperty(exports, "createMatchPath", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2130
|
+
return match_path_sync_1.createMatchPath;
|
|
2131
|
+
}, "get") });
|
|
2132
|
+
Object.defineProperty(exports, "matchFromAbsolutePaths", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2133
|
+
return match_path_sync_1.matchFromAbsolutePaths;
|
|
2134
|
+
}, "get") });
|
|
2135
|
+
var match_path_async_1 = require_match_path_async();
|
|
2136
|
+
Object.defineProperty(exports, "createMatchPathAsync", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2137
|
+
return match_path_async_1.createMatchPathAsync;
|
|
2138
|
+
}, "get") });
|
|
2139
|
+
Object.defineProperty(exports, "matchFromAbsolutePathsAsync", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2140
|
+
return match_path_async_1.matchFromAbsolutePathsAsync;
|
|
2141
|
+
}, "get") });
|
|
2142
|
+
var register_1 = require_register();
|
|
2143
|
+
Object.defineProperty(exports, "register", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2144
|
+
return register_1.register;
|
|
2145
|
+
}, "get") });
|
|
2146
|
+
var config_loader_1 = require_config_loader();
|
|
2147
|
+
Object.defineProperty(exports, "loadConfig", { enumerable: true, get: /* @__PURE__ */ __name(function() {
|
|
2148
|
+
return config_loader_1.loadConfig;
|
|
2149
|
+
}, "get") });
|
|
2150
|
+
}
|
|
2151
|
+
});
|
|
2152
|
+
|
|
2153
|
+
// ../../node_modules/resolve/lib/homedir.js
|
|
2154
|
+
var require_homedir = __commonJS({
|
|
2155
|
+
"../../node_modules/resolve/lib/homedir.js"(exports, module) {
|
|
2156
|
+
"use strict";
|
|
2157
|
+
var os = __require("os");
|
|
2158
|
+
module.exports = os.homedir || /* @__PURE__ */ __name(function homedir() {
|
|
2159
|
+
var home = process.env.HOME;
|
|
2160
|
+
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
2161
|
+
if (process.platform === "win32") {
|
|
2162
|
+
return process.env.USERPROFILE || process.env.HOMEDRIVE + process.env.HOMEPATH || home || null;
|
|
2163
|
+
}
|
|
2164
|
+
if (process.platform === "darwin") {
|
|
2165
|
+
return home || (user ? "/Users/" + user : null);
|
|
2166
|
+
}
|
|
2167
|
+
if (process.platform === "linux") {
|
|
2168
|
+
return home || (process.getuid() === 0 ? "/root" : user ? "/home/" + user : null);
|
|
2169
|
+
}
|
|
2170
|
+
return home || null;
|
|
2171
|
+
}, "homedir");
|
|
2172
|
+
}
|
|
2173
|
+
});
|
|
2174
|
+
|
|
2175
|
+
// ../../node_modules/resolve/lib/caller.js
|
|
2176
|
+
var require_caller = __commonJS({
|
|
2177
|
+
"../../node_modules/resolve/lib/caller.js"(exports, module) {
|
|
2178
|
+
module.exports = function() {
|
|
2179
|
+
var origPrepareStackTrace = Error.prepareStackTrace;
|
|
2180
|
+
Error.prepareStackTrace = function(_, stack2) {
|
|
2181
|
+
return stack2;
|
|
2182
|
+
};
|
|
2183
|
+
var stack = new Error().stack;
|
|
2184
|
+
Error.prepareStackTrace = origPrepareStackTrace;
|
|
2185
|
+
return stack[2].getFileName();
|
|
2186
|
+
};
|
|
2187
|
+
}
|
|
2188
|
+
});
|
|
2189
|
+
|
|
2190
|
+
// ../../node_modules/path-parse/index.js
|
|
2191
|
+
var require_path_parse = __commonJS({
|
|
2192
|
+
"../../node_modules/path-parse/index.js"(exports, module) {
|
|
2193
|
+
"use strict";
|
|
2194
|
+
var isWindows2 = process.platform === "win32";
|
|
2195
|
+
var splitWindowsRe = /^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/;
|
|
2196
|
+
var win32 = {};
|
|
2197
|
+
function win32SplitPath(filename) {
|
|
2198
|
+
return splitWindowsRe.exec(filename).slice(1);
|
|
2199
|
+
}
|
|
2200
|
+
__name(win32SplitPath, "win32SplitPath");
|
|
2201
|
+
win32.parse = function(pathString) {
|
|
2202
|
+
if (typeof pathString !== "string") {
|
|
2203
|
+
throw new TypeError(
|
|
2204
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
2205
|
+
);
|
|
2206
|
+
}
|
|
2207
|
+
var allParts = win32SplitPath(pathString);
|
|
2208
|
+
if (!allParts || allParts.length !== 5) {
|
|
2209
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
2210
|
+
}
|
|
2211
|
+
return {
|
|
2212
|
+
root: allParts[1],
|
|
2213
|
+
dir: allParts[0] === allParts[1] ? allParts[0] : allParts[0].slice(0, -1),
|
|
2214
|
+
base: allParts[2],
|
|
2215
|
+
ext: allParts[4],
|
|
2216
|
+
name: allParts[3]
|
|
2217
|
+
};
|
|
2218
|
+
};
|
|
2219
|
+
var splitPathRe = /^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/;
|
|
2220
|
+
var posix = {};
|
|
2221
|
+
function posixSplitPath(filename) {
|
|
2222
|
+
return splitPathRe.exec(filename).slice(1);
|
|
2223
|
+
}
|
|
2224
|
+
__name(posixSplitPath, "posixSplitPath");
|
|
2225
|
+
posix.parse = function(pathString) {
|
|
2226
|
+
if (typeof pathString !== "string") {
|
|
2227
|
+
throw new TypeError(
|
|
2228
|
+
"Parameter 'pathString' must be a string, not " + typeof pathString
|
|
2229
|
+
);
|
|
2230
|
+
}
|
|
2231
|
+
var allParts = posixSplitPath(pathString);
|
|
2232
|
+
if (!allParts || allParts.length !== 5) {
|
|
2233
|
+
throw new TypeError("Invalid path '" + pathString + "'");
|
|
2234
|
+
}
|
|
2235
|
+
return {
|
|
2236
|
+
root: allParts[1],
|
|
2237
|
+
dir: allParts[0].slice(0, -1),
|
|
2238
|
+
base: allParts[2],
|
|
2239
|
+
ext: allParts[4],
|
|
2240
|
+
name: allParts[3]
|
|
2241
|
+
};
|
|
2242
|
+
};
|
|
2243
|
+
if (isWindows2)
|
|
2244
|
+
module.exports = win32.parse;
|
|
2245
|
+
else
|
|
2246
|
+
module.exports = posix.parse;
|
|
2247
|
+
module.exports.posix = posix.parse;
|
|
2248
|
+
module.exports.win32 = win32.parse;
|
|
2249
|
+
}
|
|
2250
|
+
});
|
|
2251
|
+
|
|
2252
|
+
// ../../node_modules/resolve/lib/node-modules-paths.js
|
|
2253
|
+
var require_node_modules_paths = __commonJS({
|
|
2254
|
+
"../../node_modules/resolve/lib/node-modules-paths.js"(exports, module) {
|
|
2255
|
+
var path2 = __require("path");
|
|
2256
|
+
var parse4 = path2.parse || require_path_parse();
|
|
2257
|
+
var getNodeModulesDirs = /* @__PURE__ */ __name(function getNodeModulesDirs2(absoluteStart, modules) {
|
|
2258
|
+
var prefix = "/";
|
|
2259
|
+
if (/^([A-Za-z]:)/.test(absoluteStart)) {
|
|
2260
|
+
prefix = "";
|
|
2261
|
+
} else if (/^\\\\/.test(absoluteStart)) {
|
|
2262
|
+
prefix = "\\\\";
|
|
2263
|
+
}
|
|
2264
|
+
var paths = [absoluteStart];
|
|
2265
|
+
var parsed = parse4(absoluteStart);
|
|
2266
|
+
while (parsed.dir !== paths[paths.length - 1]) {
|
|
2267
|
+
paths.push(parsed.dir);
|
|
2268
|
+
parsed = parse4(parsed.dir);
|
|
2269
|
+
}
|
|
2270
|
+
return paths.reduce(function(dirs, aPath) {
|
|
2271
|
+
return dirs.concat(modules.map(function(moduleDir) {
|
|
2272
|
+
return path2.resolve(prefix, aPath, moduleDir);
|
|
2273
|
+
}));
|
|
2274
|
+
}, []);
|
|
2275
|
+
}, "getNodeModulesDirs");
|
|
2276
|
+
module.exports = /* @__PURE__ */ __name(function nodeModulesPaths(start, opts, request) {
|
|
2277
|
+
var modules = opts && opts.moduleDirectory ? [].concat(opts.moduleDirectory) : ["node_modules"];
|
|
2278
|
+
if (opts && typeof opts.paths === "function") {
|
|
2279
|
+
return opts.paths(
|
|
2280
|
+
request,
|
|
2281
|
+
start,
|
|
2282
|
+
function() {
|
|
2283
|
+
return getNodeModulesDirs(start, modules);
|
|
2284
|
+
},
|
|
2285
|
+
opts
|
|
2286
|
+
);
|
|
2287
|
+
}
|
|
2288
|
+
var dirs = getNodeModulesDirs(start, modules);
|
|
2289
|
+
return opts && opts.paths ? dirs.concat(opts.paths) : dirs;
|
|
2290
|
+
}, "nodeModulesPaths");
|
|
2291
|
+
}
|
|
2292
|
+
});
|
|
2293
|
+
|
|
2294
|
+
// ../../node_modules/resolve/lib/normalize-options.js
|
|
2295
|
+
var require_normalize_options = __commonJS({
|
|
2296
|
+
"../../node_modules/resolve/lib/normalize-options.js"(exports, module) {
|
|
2297
|
+
var path2 = __require("path");
|
|
2298
|
+
module.exports = function(_, opts) {
|
|
2299
|
+
opts = opts || {};
|
|
2300
|
+
if (opts.forceNodeResolution || !process.versions.pnp)
|
|
2301
|
+
return opts;
|
|
2302
|
+
const { findPnpApi } = __require("module");
|
|
2303
|
+
const runPnpResolution = /* @__PURE__ */ __name((request, basedir) => {
|
|
2304
|
+
const parts = request.match(/^((?:@[^/]+\/)?[^/]+)(\/.*)?/);
|
|
2305
|
+
if (!parts)
|
|
2306
|
+
throw new Error(`Assertion failed: Expected the "resolve" package to call the "paths" callback with package names only (got "${request}")`);
|
|
2307
|
+
if (basedir.charAt(basedir.length - 1) !== `/`)
|
|
2308
|
+
basedir = path2.join(basedir, `/`);
|
|
2309
|
+
const api = findPnpApi(basedir);
|
|
2310
|
+
if (api === null)
|
|
2311
|
+
return void 0;
|
|
2312
|
+
let manifestPath;
|
|
2313
|
+
try {
|
|
2314
|
+
manifestPath = api.resolveToUnqualified(`${parts[1]}/package.json`, basedir, { considerBuiltins: false });
|
|
2315
|
+
} catch (err) {
|
|
2316
|
+
return null;
|
|
2317
|
+
}
|
|
2318
|
+
if (manifestPath === null)
|
|
2319
|
+
throw new Error(`Assertion failed: The resolution thinks that "${parts[1]}" is a Node builtin`);
|
|
2320
|
+
const packagePath = path2.dirname(manifestPath);
|
|
2321
|
+
const unqualifiedPath = typeof parts[2] !== `undefined` ? path2.join(packagePath, parts[2]) : packagePath;
|
|
2322
|
+
return { packagePath, unqualifiedPath };
|
|
2323
|
+
}, "runPnpResolution");
|
|
2324
|
+
const runPnpResolutionOnArray = /* @__PURE__ */ __name((request, paths2) => {
|
|
2325
|
+
for (let i = 0; i < paths2.length; i++) {
|
|
2326
|
+
const resolution = runPnpResolution(request, paths2[i]);
|
|
2327
|
+
if (resolution || i === paths2.length - 1) {
|
|
2328
|
+
return resolution;
|
|
2329
|
+
}
|
|
2330
|
+
}
|
|
2331
|
+
return null;
|
|
2332
|
+
}, "runPnpResolutionOnArray");
|
|
2333
|
+
const originalPaths = Array.isArray(opts.paths) ? opts.paths : [];
|
|
2334
|
+
const packageIterator = /* @__PURE__ */ __name((request, basedir, getCandidates, opts2) => {
|
|
2335
|
+
const pathsToTest = [basedir].concat(originalPaths);
|
|
2336
|
+
const resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
2337
|
+
if (resolution == null)
|
|
2338
|
+
return getCandidates();
|
|
2339
|
+
return [resolution.unqualifiedPath];
|
|
2340
|
+
}, "packageIterator");
|
|
2341
|
+
const paths = /* @__PURE__ */ __name((request, basedir, getNodeModulePaths, opts2) => {
|
|
2342
|
+
const pathsToTest = [basedir].concat(originalPaths);
|
|
2343
|
+
const resolution = runPnpResolutionOnArray(request, pathsToTest);
|
|
2344
|
+
if (resolution == null)
|
|
2345
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
2346
|
+
let nodeModules = path2.dirname(resolution.packagePath);
|
|
2347
|
+
if (request.match(/^@[^/]+\//))
|
|
2348
|
+
nodeModules = path2.dirname(nodeModules);
|
|
2349
|
+
return [nodeModules];
|
|
2350
|
+
}, "paths");
|
|
2351
|
+
let isInsideIterator = false;
|
|
2352
|
+
if (!opts.__skipPackageIterator) {
|
|
2353
|
+
opts.packageIterator = function(request, basedir, getCandidates, opts2) {
|
|
2354
|
+
isInsideIterator = true;
|
|
2355
|
+
try {
|
|
2356
|
+
return packageIterator(request, basedir, getCandidates, opts2);
|
|
2357
|
+
} finally {
|
|
2358
|
+
isInsideIterator = false;
|
|
2359
|
+
}
|
|
2360
|
+
};
|
|
2361
|
+
}
|
|
2362
|
+
opts.paths = function(request, basedir, getNodeModulePaths, opts2) {
|
|
2363
|
+
if (isInsideIterator)
|
|
2364
|
+
return getNodeModulePaths().concat(originalPaths);
|
|
2365
|
+
return paths(request, basedir, getNodeModulePaths, opts2);
|
|
2366
|
+
};
|
|
2367
|
+
return opts;
|
|
2368
|
+
};
|
|
2369
|
+
}
|
|
2370
|
+
});
|
|
2371
|
+
|
|
2372
|
+
// ../../node_modules/function-bind/implementation.js
|
|
2373
|
+
var require_implementation = __commonJS({
|
|
2374
|
+
"../../node_modules/function-bind/implementation.js"(exports, module) {
|
|
2375
|
+
"use strict";
|
|
2376
|
+
var ERROR_MESSAGE = "Function.prototype.bind called on incompatible ";
|
|
2377
|
+
var toStr = Object.prototype.toString;
|
|
2378
|
+
var max = Math.max;
|
|
2379
|
+
var funcType = "[object Function]";
|
|
2380
|
+
var concatty = /* @__PURE__ */ __name(function concatty2(a, b) {
|
|
2381
|
+
var arr = [];
|
|
2382
|
+
for (var i = 0; i < a.length; i += 1) {
|
|
2383
|
+
arr[i] = a[i];
|
|
2384
|
+
}
|
|
2385
|
+
for (var j = 0; j < b.length; j += 1) {
|
|
2386
|
+
arr[j + a.length] = b[j];
|
|
2387
|
+
}
|
|
2388
|
+
return arr;
|
|
2389
|
+
}, "concatty");
|
|
2390
|
+
var slicy = /* @__PURE__ */ __name(function slicy2(arrLike, offset) {
|
|
2391
|
+
var arr = [];
|
|
2392
|
+
for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {
|
|
2393
|
+
arr[j] = arrLike[i];
|
|
2394
|
+
}
|
|
2395
|
+
return arr;
|
|
2396
|
+
}, "slicy");
|
|
2397
|
+
var joiny = /* @__PURE__ */ __name(function(arr, joiner) {
|
|
2398
|
+
var str = "";
|
|
2399
|
+
for (var i = 0; i < arr.length; i += 1) {
|
|
2400
|
+
str += arr[i];
|
|
2401
|
+
if (i + 1 < arr.length) {
|
|
2402
|
+
str += joiner;
|
|
2403
|
+
}
|
|
2404
|
+
}
|
|
2405
|
+
return str;
|
|
2406
|
+
}, "joiny");
|
|
2407
|
+
module.exports = /* @__PURE__ */ __name(function bind(that) {
|
|
2408
|
+
var target = this;
|
|
2409
|
+
if (typeof target !== "function" || toStr.apply(target) !== funcType) {
|
|
2410
|
+
throw new TypeError(ERROR_MESSAGE + target);
|
|
2411
|
+
}
|
|
2412
|
+
var args = slicy(arguments, 1);
|
|
2413
|
+
var bound;
|
|
2414
|
+
var binder = /* @__PURE__ */ __name(function() {
|
|
2415
|
+
if (this instanceof bound) {
|
|
2416
|
+
var result = target.apply(
|
|
2417
|
+
this,
|
|
2418
|
+
concatty(args, arguments)
|
|
2419
|
+
);
|
|
2420
|
+
if (Object(result) === result) {
|
|
2421
|
+
return result;
|
|
2422
|
+
}
|
|
2423
|
+
return this;
|
|
2424
|
+
}
|
|
2425
|
+
return target.apply(
|
|
2426
|
+
that,
|
|
2427
|
+
concatty(args, arguments)
|
|
2428
|
+
);
|
|
2429
|
+
}, "binder");
|
|
2430
|
+
var boundLength = max(0, target.length - args.length);
|
|
2431
|
+
var boundArgs = [];
|
|
2432
|
+
for (var i = 0; i < boundLength; i++) {
|
|
2433
|
+
boundArgs[i] = "$" + i;
|
|
2434
|
+
}
|
|
2435
|
+
bound = Function("binder", "return function (" + joiny(boundArgs, ",") + "){ return binder.apply(this,arguments); }")(binder);
|
|
2436
|
+
if (target.prototype) {
|
|
2437
|
+
var Empty = /* @__PURE__ */ __name(function Empty2() {
|
|
2438
|
+
}, "Empty");
|
|
2439
|
+
Empty.prototype = target.prototype;
|
|
2440
|
+
bound.prototype = new Empty();
|
|
2441
|
+
Empty.prototype = null;
|
|
2442
|
+
}
|
|
2443
|
+
return bound;
|
|
2444
|
+
}, "bind");
|
|
2445
|
+
}
|
|
2446
|
+
});
|
|
2447
|
+
|
|
2448
|
+
// ../../node_modules/function-bind/index.js
|
|
2449
|
+
var require_function_bind = __commonJS({
|
|
2450
|
+
"../../node_modules/function-bind/index.js"(exports, module) {
|
|
2451
|
+
"use strict";
|
|
2452
|
+
var implementation = require_implementation();
|
|
2453
|
+
module.exports = Function.prototype.bind || implementation;
|
|
2454
|
+
}
|
|
2455
|
+
});
|
|
2456
|
+
|
|
2457
|
+
// ../../node_modules/hasown/index.js
|
|
2458
|
+
var require_hasown = __commonJS({
|
|
2459
|
+
"../../node_modules/hasown/index.js"(exports, module) {
|
|
2460
|
+
"use strict";
|
|
2461
|
+
var call = Function.prototype.call;
|
|
2462
|
+
var $hasOwn = Object.prototype.hasOwnProperty;
|
|
2463
|
+
var bind = require_function_bind();
|
|
2464
|
+
module.exports = bind.call(call, $hasOwn);
|
|
2465
|
+
}
|
|
2466
|
+
});
|
|
2467
|
+
|
|
2468
|
+
// ../../node_modules/is-core-module/core.json
|
|
2469
|
+
var require_core = __commonJS({
|
|
2470
|
+
"../../node_modules/is-core-module/core.json"(exports, module) {
|
|
2471
|
+
module.exports = {
|
|
2472
|
+
assert: true,
|
|
2473
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
2474
|
+
"assert/strict": ">= 15",
|
|
2475
|
+
"node:assert/strict": ">= 16",
|
|
2476
|
+
async_hooks: ">= 8",
|
|
2477
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
2478
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
2479
|
+
buffer: true,
|
|
2480
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
2481
|
+
child_process: true,
|
|
2482
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
2483
|
+
cluster: ">= 0.5",
|
|
2484
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
2485
|
+
console: true,
|
|
2486
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
2487
|
+
constants: true,
|
|
2488
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
2489
|
+
crypto: true,
|
|
2490
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
2491
|
+
_debug_agent: ">= 1 && < 8",
|
|
2492
|
+
_debugger: "< 8",
|
|
2493
|
+
dgram: true,
|
|
2494
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
2495
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
2496
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
2497
|
+
dns: true,
|
|
2498
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
2499
|
+
"dns/promises": ">= 15",
|
|
2500
|
+
"node:dns/promises": ">= 16",
|
|
2501
|
+
domain: ">= 0.7.12",
|
|
2502
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
2503
|
+
events: true,
|
|
2504
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
2505
|
+
freelist: "< 6",
|
|
2506
|
+
fs: true,
|
|
2507
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
2508
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
2509
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
2510
|
+
_http_agent: ">= 0.11.1",
|
|
2511
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
2512
|
+
_http_client: ">= 0.11.1",
|
|
2513
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
2514
|
+
_http_common: ">= 0.11.1",
|
|
2515
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
2516
|
+
_http_incoming: ">= 0.11.1",
|
|
2517
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
2518
|
+
_http_outgoing: ">= 0.11.1",
|
|
2519
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
2520
|
+
_http_server: ">= 0.11.1",
|
|
2521
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
2522
|
+
http: true,
|
|
2523
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
2524
|
+
http2: ">= 8.8",
|
|
2525
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
2526
|
+
https: true,
|
|
2527
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
2528
|
+
inspector: ">= 8",
|
|
2529
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
2530
|
+
"inspector/promises": [">= 19"],
|
|
2531
|
+
"node:inspector/promises": [">= 19"],
|
|
2532
|
+
_linklist: "< 8",
|
|
2533
|
+
module: true,
|
|
2534
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
2535
|
+
net: true,
|
|
2536
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
2537
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
2538
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
2539
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
2540
|
+
os: true,
|
|
2541
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
2542
|
+
path: true,
|
|
2543
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
2544
|
+
"path/posix": ">= 15.3",
|
|
2545
|
+
"node:path/posix": ">= 16",
|
|
2546
|
+
"path/win32": ">= 15.3",
|
|
2547
|
+
"node:path/win32": ">= 16",
|
|
2548
|
+
perf_hooks: ">= 8.5",
|
|
2549
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
2550
|
+
process: ">= 1",
|
|
2551
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
2552
|
+
punycode: ">= 0.5",
|
|
2553
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
2554
|
+
querystring: true,
|
|
2555
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
2556
|
+
readline: true,
|
|
2557
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
2558
|
+
"readline/promises": ">= 17",
|
|
2559
|
+
"node:readline/promises": ">= 17",
|
|
2560
|
+
repl: true,
|
|
2561
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
2562
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
2563
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
2564
|
+
"node:sqlite": [">= 22.13 && < 23", ">= 23.4"],
|
|
2565
|
+
_stream_duplex: ">= 0.9.4",
|
|
2566
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
|
|
2567
|
+
_stream_transform: ">= 0.9.4",
|
|
2568
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
|
|
2569
|
+
_stream_wrap: ">= 1.4.1",
|
|
2570
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
2571
|
+
_stream_passthrough: ">= 0.9.4",
|
|
2572
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
|
|
2573
|
+
_stream_readable: ">= 0.9.4",
|
|
2574
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
|
|
2575
|
+
_stream_writable: ">= 0.9.4",
|
|
2576
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
|
|
2577
|
+
stream: true,
|
|
2578
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
2579
|
+
"stream/consumers": ">= 16.7",
|
|
2580
|
+
"node:stream/consumers": ">= 16.7",
|
|
2581
|
+
"stream/promises": ">= 15",
|
|
2582
|
+
"node:stream/promises": ">= 16",
|
|
2583
|
+
"stream/web": ">= 16.5",
|
|
2584
|
+
"node:stream/web": ">= 16.5",
|
|
2585
|
+
string_decoder: true,
|
|
2586
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
2587
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
2588
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
2589
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
2590
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
2591
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
2592
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
2593
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
2594
|
+
timers: true,
|
|
2595
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
2596
|
+
"timers/promises": ">= 15",
|
|
2597
|
+
"node:timers/promises": ">= 16",
|
|
2598
|
+
_tls_common: ">= 0.11.13",
|
|
2599
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
2600
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
2601
|
+
_tls_wrap: ">= 0.11.3",
|
|
2602
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
2603
|
+
tls: true,
|
|
2604
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
2605
|
+
trace_events: ">= 10",
|
|
2606
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
2607
|
+
tty: true,
|
|
2608
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
2609
|
+
url: true,
|
|
2610
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
2611
|
+
util: true,
|
|
2612
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
2613
|
+
"util/types": ">= 15.3",
|
|
2614
|
+
"node:util/types": ">= 16",
|
|
2615
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
2616
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2617
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2618
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2619
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2620
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2621
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
2622
|
+
v8: ">= 1",
|
|
2623
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
2624
|
+
vm: true,
|
|
2625
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
2626
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
2627
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
2628
|
+
worker_threads: ">= 11.7",
|
|
2629
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
2630
|
+
zlib: ">= 0.5",
|
|
2631
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
});
|
|
2635
|
+
|
|
2636
|
+
// ../../node_modules/is-core-module/index.js
|
|
2637
|
+
var require_is_core_module = __commonJS({
|
|
2638
|
+
"../../node_modules/is-core-module/index.js"(exports, module) {
|
|
2639
|
+
"use strict";
|
|
2640
|
+
var hasOwn = require_hasown();
|
|
2641
|
+
function specifierIncluded(current, specifier) {
|
|
2642
|
+
var nodeParts = current.split(".");
|
|
2643
|
+
var parts = specifier.split(" ");
|
|
2644
|
+
var op = parts.length > 1 ? parts[0] : "=";
|
|
2645
|
+
var versionParts = (parts.length > 1 ? parts[1] : parts[0]).split(".");
|
|
2646
|
+
for (var i = 0; i < 3; ++i) {
|
|
2647
|
+
var cur = parseInt(nodeParts[i] || 0, 10);
|
|
2648
|
+
var ver = parseInt(versionParts[i] || 0, 10);
|
|
2649
|
+
if (cur === ver) {
|
|
2650
|
+
continue;
|
|
2651
|
+
}
|
|
2652
|
+
if (op === "<") {
|
|
2653
|
+
return cur < ver;
|
|
2654
|
+
}
|
|
2655
|
+
if (op === ">=") {
|
|
2656
|
+
return cur >= ver;
|
|
2657
|
+
}
|
|
2658
|
+
return false;
|
|
2659
|
+
}
|
|
2660
|
+
return op === ">=";
|
|
2661
|
+
}
|
|
2662
|
+
__name(specifierIncluded, "specifierIncluded");
|
|
2663
|
+
function matchesRange(current, range) {
|
|
2664
|
+
var specifiers = range.split(/ ?&& ?/);
|
|
2665
|
+
if (specifiers.length === 0) {
|
|
2666
|
+
return false;
|
|
2667
|
+
}
|
|
2668
|
+
for (var i = 0; i < specifiers.length; ++i) {
|
|
2669
|
+
if (!specifierIncluded(current, specifiers[i])) {
|
|
2670
|
+
return false;
|
|
2671
|
+
}
|
|
2672
|
+
}
|
|
2673
|
+
return true;
|
|
2674
|
+
}
|
|
2675
|
+
__name(matchesRange, "matchesRange");
|
|
2676
|
+
function versionIncluded(nodeVersion, specifierValue) {
|
|
2677
|
+
if (typeof specifierValue === "boolean") {
|
|
2678
|
+
return specifierValue;
|
|
2679
|
+
}
|
|
2680
|
+
var current = typeof nodeVersion === "undefined" ? process.versions && process.versions.node : nodeVersion;
|
|
2681
|
+
if (typeof current !== "string") {
|
|
2682
|
+
throw new TypeError(typeof nodeVersion === "undefined" ? "Unable to determine current node version" : "If provided, a valid node version is required");
|
|
2683
|
+
}
|
|
2684
|
+
if (specifierValue && typeof specifierValue === "object") {
|
|
2685
|
+
for (var i = 0; i < specifierValue.length; ++i) {
|
|
2686
|
+
if (matchesRange(current, specifierValue[i])) {
|
|
2687
|
+
return true;
|
|
2688
|
+
}
|
|
2689
|
+
}
|
|
2690
|
+
return false;
|
|
2691
|
+
}
|
|
2692
|
+
return matchesRange(current, specifierValue);
|
|
2693
|
+
}
|
|
2694
|
+
__name(versionIncluded, "versionIncluded");
|
|
2695
|
+
var data = require_core();
|
|
2696
|
+
module.exports = /* @__PURE__ */ __name(function isCore(x, nodeVersion) {
|
|
2697
|
+
return hasOwn(data, x) && versionIncluded(nodeVersion, data[x]);
|
|
2698
|
+
}, "isCore");
|
|
2699
|
+
}
|
|
2700
|
+
});
|
|
2701
|
+
|
|
2702
|
+
// ../../node_modules/resolve/lib/async.js
|
|
2703
|
+
var require_async = __commonJS({
|
|
2704
|
+
"../../node_modules/resolve/lib/async.js"(exports, module) {
|
|
2705
|
+
var fs = __require("fs");
|
|
2706
|
+
var getHomedir = require_homedir();
|
|
2707
|
+
var path2 = __require("path");
|
|
2708
|
+
var caller = require_caller();
|
|
2709
|
+
var nodeModulesPaths = require_node_modules_paths();
|
|
2710
|
+
var normalizeOptions = require_normalize_options();
|
|
2711
|
+
var isCore = require_is_core_module();
|
|
2712
|
+
var realpathFS = process.platform !== "win32" && fs.realpath && typeof fs.realpath.native === "function" ? fs.realpath.native : fs.realpath;
|
|
2713
|
+
var homedir = getHomedir();
|
|
2714
|
+
var defaultPaths = /* @__PURE__ */ __name(function() {
|
|
2715
|
+
return [
|
|
2716
|
+
path2.join(homedir, ".node_modules"),
|
|
2717
|
+
path2.join(homedir, ".node_libraries")
|
|
2718
|
+
];
|
|
2719
|
+
}, "defaultPaths");
|
|
2720
|
+
var defaultIsFile = /* @__PURE__ */ __name(function isFile(file, cb) {
|
|
2721
|
+
fs.stat(file, function(err, stat) {
|
|
2722
|
+
if (!err) {
|
|
2723
|
+
return cb(null, stat.isFile() || stat.isFIFO());
|
|
2724
|
+
}
|
|
2725
|
+
if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
|
|
2726
|
+
return cb(err);
|
|
2727
|
+
});
|
|
2728
|
+
}, "isFile");
|
|
2729
|
+
var defaultIsDir = /* @__PURE__ */ __name(function isDirectory(dir, cb) {
|
|
2730
|
+
fs.stat(dir, function(err, stat) {
|
|
2731
|
+
if (!err) {
|
|
2732
|
+
return cb(null, stat.isDirectory());
|
|
2733
|
+
}
|
|
2734
|
+
if (err.code === "ENOENT" || err.code === "ENOTDIR") return cb(null, false);
|
|
2735
|
+
return cb(err);
|
|
2736
|
+
});
|
|
2737
|
+
}, "isDirectory");
|
|
2738
|
+
var defaultRealpath = /* @__PURE__ */ __name(function realpath(x, cb) {
|
|
2739
|
+
realpathFS(x, function(realpathErr, realPath) {
|
|
2740
|
+
if (realpathErr && realpathErr.code !== "ENOENT") cb(realpathErr);
|
|
2741
|
+
else cb(null, realpathErr ? x : realPath);
|
|
2742
|
+
});
|
|
2743
|
+
}, "realpath");
|
|
2744
|
+
var maybeRealpath = /* @__PURE__ */ __name(function maybeRealpath2(realpath, x, opts, cb) {
|
|
2745
|
+
if (opts && opts.preserveSymlinks === false) {
|
|
2746
|
+
realpath(x, cb);
|
|
2747
|
+
} else {
|
|
2748
|
+
cb(null, x);
|
|
2749
|
+
}
|
|
2750
|
+
}, "maybeRealpath");
|
|
2751
|
+
var defaultReadPackage = /* @__PURE__ */ __name(function defaultReadPackage2(readFile2, pkgfile, cb) {
|
|
2752
|
+
readFile2(pkgfile, function(readFileErr, body) {
|
|
2753
|
+
if (readFileErr) cb(readFileErr);
|
|
2754
|
+
else {
|
|
2755
|
+
try {
|
|
2756
|
+
var pkg = JSON.parse(body);
|
|
2757
|
+
cb(null, pkg);
|
|
2758
|
+
} catch (jsonErr) {
|
|
2759
|
+
cb(null);
|
|
2760
|
+
}
|
|
2761
|
+
}
|
|
2762
|
+
});
|
|
2763
|
+
}, "defaultReadPackage");
|
|
2764
|
+
var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x, start, opts) {
|
|
2765
|
+
var dirs = nodeModulesPaths(start, opts, x);
|
|
2766
|
+
for (var i = 0; i < dirs.length; i++) {
|
|
2767
|
+
dirs[i] = path2.join(dirs[i], x);
|
|
2768
|
+
}
|
|
2769
|
+
return dirs;
|
|
2770
|
+
}, "getPackageCandidates");
|
|
2771
|
+
module.exports = /* @__PURE__ */ __name(function resolve4(x, options, callback) {
|
|
2772
|
+
var cb = callback;
|
|
2773
|
+
var opts = options;
|
|
2774
|
+
if (typeof options === "function") {
|
|
2775
|
+
cb = opts;
|
|
2776
|
+
opts = {};
|
|
2777
|
+
}
|
|
2778
|
+
if (typeof x !== "string") {
|
|
2779
|
+
var err = new TypeError("Path must be a string.");
|
|
2780
|
+
return process.nextTick(function() {
|
|
2781
|
+
cb(err);
|
|
2782
|
+
});
|
|
2783
|
+
}
|
|
2784
|
+
opts = normalizeOptions(x, opts);
|
|
2785
|
+
var isFile = opts.isFile || defaultIsFile;
|
|
2786
|
+
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
2787
|
+
var readFile2 = opts.readFile || fs.readFile;
|
|
2788
|
+
var realpath = opts.realpath || defaultRealpath;
|
|
2789
|
+
var readPackage = opts.readPackage || defaultReadPackage;
|
|
2790
|
+
if (opts.readFile && opts.readPackage) {
|
|
2791
|
+
var conflictErr = new TypeError("`readFile` and `readPackage` are mutually exclusive.");
|
|
2792
|
+
return process.nextTick(function() {
|
|
2793
|
+
cb(conflictErr);
|
|
2794
|
+
});
|
|
2795
|
+
}
|
|
2796
|
+
var packageIterator = opts.packageIterator;
|
|
2797
|
+
var extensions = opts.extensions || [".js"];
|
|
2798
|
+
var includeCoreModules = opts.includeCoreModules !== false;
|
|
2799
|
+
var basedir = opts.basedir || path2.dirname(caller());
|
|
2800
|
+
var parent = opts.filename || basedir;
|
|
2801
|
+
opts.paths = opts.paths || defaultPaths();
|
|
2802
|
+
var absoluteStart = path2.resolve(basedir);
|
|
2803
|
+
maybeRealpath(
|
|
2804
|
+
realpath,
|
|
2805
|
+
absoluteStart,
|
|
2806
|
+
opts,
|
|
2807
|
+
function(err2, realStart) {
|
|
2808
|
+
if (err2) cb(err2);
|
|
2809
|
+
else init(realStart);
|
|
2810
|
+
}
|
|
2811
|
+
);
|
|
2812
|
+
var res;
|
|
2813
|
+
function init(basedir2) {
|
|
2814
|
+
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
|
|
2815
|
+
res = path2.resolve(basedir2, x);
|
|
2816
|
+
if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
|
|
2817
|
+
if (/\/$/.test(x) && res === basedir2) {
|
|
2818
|
+
loadAsDirectory(res, opts.package, onfile);
|
|
2819
|
+
} else loadAsFile(res, opts.package, onfile);
|
|
2820
|
+
} else if (includeCoreModules && isCore(x)) {
|
|
2821
|
+
return cb(null, x);
|
|
2822
|
+
} else loadNodeModules(x, basedir2, function(err2, n, pkg) {
|
|
2823
|
+
if (err2) cb(err2);
|
|
2824
|
+
else if (n) {
|
|
2825
|
+
return maybeRealpath(realpath, n, opts, function(err3, realN) {
|
|
2826
|
+
if (err3) {
|
|
2827
|
+
cb(err3);
|
|
2828
|
+
} else {
|
|
2829
|
+
cb(null, realN, pkg);
|
|
2830
|
+
}
|
|
2831
|
+
});
|
|
2832
|
+
} else {
|
|
2833
|
+
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
2834
|
+
moduleError.code = "MODULE_NOT_FOUND";
|
|
2835
|
+
cb(moduleError);
|
|
2836
|
+
}
|
|
2837
|
+
});
|
|
2838
|
+
}
|
|
2839
|
+
__name(init, "init");
|
|
2840
|
+
function onfile(err2, m, pkg) {
|
|
2841
|
+
if (err2) cb(err2);
|
|
2842
|
+
else if (m) cb(null, m, pkg);
|
|
2843
|
+
else loadAsDirectory(res, function(err3, d, pkg2) {
|
|
2844
|
+
if (err3) cb(err3);
|
|
2845
|
+
else if (d) {
|
|
2846
|
+
maybeRealpath(realpath, d, opts, function(err4, realD) {
|
|
2847
|
+
if (err4) {
|
|
2848
|
+
cb(err4);
|
|
2849
|
+
} else {
|
|
2850
|
+
cb(null, realD, pkg2);
|
|
2851
|
+
}
|
|
2852
|
+
});
|
|
2853
|
+
} else {
|
|
2854
|
+
var moduleError = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
2855
|
+
moduleError.code = "MODULE_NOT_FOUND";
|
|
2856
|
+
cb(moduleError);
|
|
2857
|
+
}
|
|
2858
|
+
});
|
|
2859
|
+
}
|
|
2860
|
+
__name(onfile, "onfile");
|
|
2861
|
+
function loadAsFile(x2, thePackage, callback2) {
|
|
2862
|
+
var loadAsFilePackage = thePackage;
|
|
2863
|
+
var cb2 = callback2;
|
|
2864
|
+
if (typeof loadAsFilePackage === "function") {
|
|
2865
|
+
cb2 = loadAsFilePackage;
|
|
2866
|
+
loadAsFilePackage = void 0;
|
|
2867
|
+
}
|
|
2868
|
+
var exts = [""].concat(extensions);
|
|
2869
|
+
load(exts, x2, loadAsFilePackage);
|
|
2870
|
+
function load(exts2, x3, loadPackage) {
|
|
2871
|
+
if (exts2.length === 0) return cb2(null, void 0, loadPackage);
|
|
2872
|
+
var file = x3 + exts2[0];
|
|
2873
|
+
var pkg = loadPackage;
|
|
2874
|
+
if (pkg) onpkg(null, pkg);
|
|
2875
|
+
else loadpkg(path2.dirname(file), onpkg);
|
|
2876
|
+
function onpkg(err2, pkg_, dir) {
|
|
2877
|
+
pkg = pkg_;
|
|
2878
|
+
if (err2) return cb2(err2);
|
|
2879
|
+
if (dir && pkg && opts.pathFilter) {
|
|
2880
|
+
var rfile = path2.relative(dir, file);
|
|
2881
|
+
var rel = rfile.slice(0, rfile.length - exts2[0].length);
|
|
2882
|
+
var r = opts.pathFilter(pkg, x3, rel);
|
|
2883
|
+
if (r) return load(
|
|
2884
|
+
[""].concat(extensions.slice()),
|
|
2885
|
+
path2.resolve(dir, r),
|
|
2886
|
+
pkg
|
|
2887
|
+
);
|
|
2888
|
+
}
|
|
2889
|
+
isFile(file, onex);
|
|
2890
|
+
}
|
|
2891
|
+
__name(onpkg, "onpkg");
|
|
2892
|
+
function onex(err2, ex) {
|
|
2893
|
+
if (err2) return cb2(err2);
|
|
2894
|
+
if (ex) return cb2(null, file, pkg);
|
|
2895
|
+
load(exts2.slice(1), x3, pkg);
|
|
2896
|
+
}
|
|
2897
|
+
__name(onex, "onex");
|
|
2898
|
+
}
|
|
2899
|
+
__name(load, "load");
|
|
2900
|
+
}
|
|
2901
|
+
__name(loadAsFile, "loadAsFile");
|
|
2902
|
+
function loadpkg(dir, cb2) {
|
|
2903
|
+
if (dir === "" || dir === "/") return cb2(null);
|
|
2904
|
+
if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) {
|
|
2905
|
+
return cb2(null);
|
|
2906
|
+
}
|
|
2907
|
+
if (/[/\\]node_modules[/\\]*$/.test(dir)) return cb2(null);
|
|
2908
|
+
maybeRealpath(realpath, dir, opts, function(unwrapErr, pkgdir) {
|
|
2909
|
+
if (unwrapErr) return loadpkg(path2.dirname(dir), cb2);
|
|
2910
|
+
var pkgfile = path2.join(pkgdir, "package.json");
|
|
2911
|
+
isFile(pkgfile, function(err2, ex) {
|
|
2912
|
+
if (!ex) return loadpkg(path2.dirname(dir), cb2);
|
|
2913
|
+
readPackage(readFile2, pkgfile, function(err3, pkgParam) {
|
|
2914
|
+
if (err3) cb2(err3);
|
|
2915
|
+
var pkg = pkgParam;
|
|
2916
|
+
if (pkg && opts.packageFilter) {
|
|
2917
|
+
pkg = opts.packageFilter(pkg, pkgfile);
|
|
2918
|
+
}
|
|
2919
|
+
cb2(null, pkg, dir);
|
|
2920
|
+
});
|
|
2921
|
+
});
|
|
2922
|
+
});
|
|
2923
|
+
}
|
|
2924
|
+
__name(loadpkg, "loadpkg");
|
|
2925
|
+
function loadAsDirectory(x2, loadAsDirectoryPackage, callback2) {
|
|
2926
|
+
var cb2 = callback2;
|
|
2927
|
+
var fpkg = loadAsDirectoryPackage;
|
|
2928
|
+
if (typeof fpkg === "function") {
|
|
2929
|
+
cb2 = fpkg;
|
|
2930
|
+
fpkg = opts.package;
|
|
2931
|
+
}
|
|
2932
|
+
maybeRealpath(realpath, x2, opts, function(unwrapErr, pkgdir) {
|
|
2933
|
+
if (unwrapErr) return cb2(unwrapErr);
|
|
2934
|
+
var pkgfile = path2.join(pkgdir, "package.json");
|
|
2935
|
+
isFile(pkgfile, function(err2, ex) {
|
|
2936
|
+
if (err2) return cb2(err2);
|
|
2937
|
+
if (!ex) return loadAsFile(path2.join(x2, "index"), fpkg, cb2);
|
|
2938
|
+
readPackage(readFile2, pkgfile, function(err3, pkgParam) {
|
|
2939
|
+
if (err3) return cb2(err3);
|
|
2940
|
+
var pkg = pkgParam;
|
|
2941
|
+
if (pkg && opts.packageFilter) {
|
|
2942
|
+
pkg = opts.packageFilter(pkg, pkgfile);
|
|
2943
|
+
}
|
|
2944
|
+
if (pkg && pkg.main) {
|
|
2945
|
+
if (typeof pkg.main !== "string") {
|
|
2946
|
+
var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
2947
|
+
mainError.code = "INVALID_PACKAGE_MAIN";
|
|
2948
|
+
return cb2(mainError);
|
|
2949
|
+
}
|
|
2950
|
+
if (pkg.main === "." || pkg.main === "./") {
|
|
2951
|
+
pkg.main = "index";
|
|
2952
|
+
}
|
|
2953
|
+
loadAsFile(path2.resolve(x2, pkg.main), pkg, function(err4, m, pkg2) {
|
|
2954
|
+
if (err4) return cb2(err4);
|
|
2955
|
+
if (m) return cb2(null, m, pkg2);
|
|
2956
|
+
if (!pkg2) return loadAsFile(path2.join(x2, "index"), pkg2, cb2);
|
|
2957
|
+
var dir = path2.resolve(x2, pkg2.main);
|
|
2958
|
+
loadAsDirectory(dir, pkg2, function(err5, n, pkg3) {
|
|
2959
|
+
if (err5) return cb2(err5);
|
|
2960
|
+
if (n) return cb2(null, n, pkg3);
|
|
2961
|
+
loadAsFile(path2.join(x2, "index"), pkg3, cb2);
|
|
2962
|
+
});
|
|
2963
|
+
});
|
|
2964
|
+
return;
|
|
2965
|
+
}
|
|
2966
|
+
loadAsFile(path2.join(x2, "/index"), pkg, cb2);
|
|
2967
|
+
});
|
|
2968
|
+
});
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
__name(loadAsDirectory, "loadAsDirectory");
|
|
2972
|
+
function processDirs(cb2, dirs) {
|
|
2973
|
+
if (dirs.length === 0) return cb2(null, void 0);
|
|
2974
|
+
var dir = dirs[0];
|
|
2975
|
+
isDirectory(path2.dirname(dir), isdir);
|
|
2976
|
+
function isdir(err2, isdir2) {
|
|
2977
|
+
if (err2) return cb2(err2);
|
|
2978
|
+
if (!isdir2) return processDirs(cb2, dirs.slice(1));
|
|
2979
|
+
loadAsFile(dir, opts.package, onfile2);
|
|
2980
|
+
}
|
|
2981
|
+
__name(isdir, "isdir");
|
|
2982
|
+
function onfile2(err2, m, pkg) {
|
|
2983
|
+
if (err2) return cb2(err2);
|
|
2984
|
+
if (m) return cb2(null, m, pkg);
|
|
2985
|
+
loadAsDirectory(dir, opts.package, ondir);
|
|
2986
|
+
}
|
|
2987
|
+
__name(onfile2, "onfile");
|
|
2988
|
+
function ondir(err2, n, pkg) {
|
|
2989
|
+
if (err2) return cb2(err2);
|
|
2990
|
+
if (n) return cb2(null, n, pkg);
|
|
2991
|
+
processDirs(cb2, dirs.slice(1));
|
|
2992
|
+
}
|
|
2993
|
+
__name(ondir, "ondir");
|
|
2994
|
+
}
|
|
2995
|
+
__name(processDirs, "processDirs");
|
|
2996
|
+
function loadNodeModules(x2, start, cb2) {
|
|
2997
|
+
var thunk = /* @__PURE__ */ __name(function() {
|
|
2998
|
+
return getPackageCandidates(x2, start, opts);
|
|
2999
|
+
}, "thunk");
|
|
3000
|
+
processDirs(
|
|
3001
|
+
cb2,
|
|
3002
|
+
packageIterator ? packageIterator(x2, start, thunk, opts) : thunk()
|
|
3003
|
+
);
|
|
3004
|
+
}
|
|
3005
|
+
__name(loadNodeModules, "loadNodeModules");
|
|
3006
|
+
}, "resolve");
|
|
3007
|
+
}
|
|
3008
|
+
});
|
|
3009
|
+
|
|
3010
|
+
// ../../node_modules/resolve/lib/core.json
|
|
3011
|
+
var require_core2 = __commonJS({
|
|
3012
|
+
"../../node_modules/resolve/lib/core.json"(exports, module) {
|
|
3013
|
+
module.exports = {
|
|
3014
|
+
assert: true,
|
|
3015
|
+
"node:assert": [">= 14.18 && < 15", ">= 16"],
|
|
3016
|
+
"assert/strict": ">= 15",
|
|
3017
|
+
"node:assert/strict": ">= 16",
|
|
3018
|
+
async_hooks: ">= 8",
|
|
3019
|
+
"node:async_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
3020
|
+
buffer_ieee754: ">= 0.5 && < 0.9.7",
|
|
3021
|
+
buffer: true,
|
|
3022
|
+
"node:buffer": [">= 14.18 && < 15", ">= 16"],
|
|
3023
|
+
child_process: true,
|
|
3024
|
+
"node:child_process": [">= 14.18 && < 15", ">= 16"],
|
|
3025
|
+
cluster: ">= 0.5",
|
|
3026
|
+
"node:cluster": [">= 14.18 && < 15", ">= 16"],
|
|
3027
|
+
console: true,
|
|
3028
|
+
"node:console": [">= 14.18 && < 15", ">= 16"],
|
|
3029
|
+
constants: true,
|
|
3030
|
+
"node:constants": [">= 14.18 && < 15", ">= 16"],
|
|
3031
|
+
crypto: true,
|
|
3032
|
+
"node:crypto": [">= 14.18 && < 15", ">= 16"],
|
|
3033
|
+
_debug_agent: ">= 1 && < 8",
|
|
3034
|
+
_debugger: "< 8",
|
|
3035
|
+
dgram: true,
|
|
3036
|
+
"node:dgram": [">= 14.18 && < 15", ">= 16"],
|
|
3037
|
+
diagnostics_channel: [">= 14.17 && < 15", ">= 15.1"],
|
|
3038
|
+
"node:diagnostics_channel": [">= 14.18 && < 15", ">= 16"],
|
|
3039
|
+
dns: true,
|
|
3040
|
+
"node:dns": [">= 14.18 && < 15", ">= 16"],
|
|
3041
|
+
"dns/promises": ">= 15",
|
|
3042
|
+
"node:dns/promises": ">= 16",
|
|
3043
|
+
domain: ">= 0.7.12",
|
|
3044
|
+
"node:domain": [">= 14.18 && < 15", ">= 16"],
|
|
3045
|
+
events: true,
|
|
3046
|
+
"node:events": [">= 14.18 && < 15", ">= 16"],
|
|
3047
|
+
freelist: "< 6",
|
|
3048
|
+
fs: true,
|
|
3049
|
+
"node:fs": [">= 14.18 && < 15", ">= 16"],
|
|
3050
|
+
"fs/promises": [">= 10 && < 10.1", ">= 14"],
|
|
3051
|
+
"node:fs/promises": [">= 14.18 && < 15", ">= 16"],
|
|
3052
|
+
_http_agent: ">= 0.11.1",
|
|
3053
|
+
"node:_http_agent": [">= 14.18 && < 15", ">= 16"],
|
|
3054
|
+
_http_client: ">= 0.11.1",
|
|
3055
|
+
"node:_http_client": [">= 14.18 && < 15", ">= 16"],
|
|
3056
|
+
_http_common: ">= 0.11.1",
|
|
3057
|
+
"node:_http_common": [">= 14.18 && < 15", ">= 16"],
|
|
3058
|
+
_http_incoming: ">= 0.11.1",
|
|
3059
|
+
"node:_http_incoming": [">= 14.18 && < 15", ">= 16"],
|
|
3060
|
+
_http_outgoing: ">= 0.11.1",
|
|
3061
|
+
"node:_http_outgoing": [">= 14.18 && < 15", ">= 16"],
|
|
3062
|
+
_http_server: ">= 0.11.1",
|
|
3063
|
+
"node:_http_server": [">= 14.18 && < 15", ">= 16"],
|
|
3064
|
+
http: true,
|
|
3065
|
+
"node:http": [">= 14.18 && < 15", ">= 16"],
|
|
3066
|
+
http2: ">= 8.8",
|
|
3067
|
+
"node:http2": [">= 14.18 && < 15", ">= 16"],
|
|
3068
|
+
https: true,
|
|
3069
|
+
"node:https": [">= 14.18 && < 15", ">= 16"],
|
|
3070
|
+
inspector: ">= 8",
|
|
3071
|
+
"node:inspector": [">= 14.18 && < 15", ">= 16"],
|
|
3072
|
+
"inspector/promises": [">= 19"],
|
|
3073
|
+
"node:inspector/promises": [">= 19"],
|
|
3074
|
+
_linklist: "< 8",
|
|
3075
|
+
module: true,
|
|
3076
|
+
"node:module": [">= 14.18 && < 15", ">= 16"],
|
|
3077
|
+
net: true,
|
|
3078
|
+
"node:net": [">= 14.18 && < 15", ">= 16"],
|
|
3079
|
+
"node-inspect/lib/_inspect": ">= 7.6 && < 12",
|
|
3080
|
+
"node-inspect/lib/internal/inspect_client": ">= 7.6 && < 12",
|
|
3081
|
+
"node-inspect/lib/internal/inspect_repl": ">= 7.6 && < 12",
|
|
3082
|
+
os: true,
|
|
3083
|
+
"node:os": [">= 14.18 && < 15", ">= 16"],
|
|
3084
|
+
path: true,
|
|
3085
|
+
"node:path": [">= 14.18 && < 15", ">= 16"],
|
|
3086
|
+
"path/posix": ">= 15.3",
|
|
3087
|
+
"node:path/posix": ">= 16",
|
|
3088
|
+
"path/win32": ">= 15.3",
|
|
3089
|
+
"node:path/win32": ">= 16",
|
|
3090
|
+
perf_hooks: ">= 8.5",
|
|
3091
|
+
"node:perf_hooks": [">= 14.18 && < 15", ">= 16"],
|
|
3092
|
+
process: ">= 1",
|
|
3093
|
+
"node:process": [">= 14.18 && < 15", ">= 16"],
|
|
3094
|
+
punycode: ">= 0.5",
|
|
3095
|
+
"node:punycode": [">= 14.18 && < 15", ">= 16"],
|
|
3096
|
+
querystring: true,
|
|
3097
|
+
"node:querystring": [">= 14.18 && < 15", ">= 16"],
|
|
3098
|
+
readline: true,
|
|
3099
|
+
"node:readline": [">= 14.18 && < 15", ">= 16"],
|
|
3100
|
+
"readline/promises": ">= 17",
|
|
3101
|
+
"node:readline/promises": ">= 17",
|
|
3102
|
+
repl: true,
|
|
3103
|
+
"node:repl": [">= 14.18 && < 15", ">= 16"],
|
|
3104
|
+
"node:sea": [">= 20.12 && < 21", ">= 21.7"],
|
|
3105
|
+
smalloc: ">= 0.11.5 && < 3",
|
|
3106
|
+
"node:sqlite": ">= 23.4",
|
|
3107
|
+
_stream_duplex: ">= 0.9.4",
|
|
3108
|
+
"node:_stream_duplex": [">= 14.18 && < 15", ">= 16"],
|
|
3109
|
+
_stream_transform: ">= 0.9.4",
|
|
3110
|
+
"node:_stream_transform": [">= 14.18 && < 15", ">= 16"],
|
|
3111
|
+
_stream_wrap: ">= 1.4.1",
|
|
3112
|
+
"node:_stream_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
3113
|
+
_stream_passthrough: ">= 0.9.4",
|
|
3114
|
+
"node:_stream_passthrough": [">= 14.18 && < 15", ">= 16"],
|
|
3115
|
+
_stream_readable: ">= 0.9.4",
|
|
3116
|
+
"node:_stream_readable": [">= 14.18 && < 15", ">= 16"],
|
|
3117
|
+
_stream_writable: ">= 0.9.4",
|
|
3118
|
+
"node:_stream_writable": [">= 14.18 && < 15", ">= 16"],
|
|
3119
|
+
stream: true,
|
|
3120
|
+
"node:stream": [">= 14.18 && < 15", ">= 16"],
|
|
3121
|
+
"stream/consumers": ">= 16.7",
|
|
3122
|
+
"node:stream/consumers": ">= 16.7",
|
|
3123
|
+
"stream/promises": ">= 15",
|
|
3124
|
+
"node:stream/promises": ">= 16",
|
|
3125
|
+
"stream/web": ">= 16.5",
|
|
3126
|
+
"node:stream/web": ">= 16.5",
|
|
3127
|
+
string_decoder: true,
|
|
3128
|
+
"node:string_decoder": [">= 14.18 && < 15", ">= 16"],
|
|
3129
|
+
sys: [">= 0.4 && < 0.7", ">= 0.8"],
|
|
3130
|
+
"node:sys": [">= 14.18 && < 15", ">= 16"],
|
|
3131
|
+
"test/reporters": ">= 19.9 && < 20.2",
|
|
3132
|
+
"node:test/reporters": [">= 18.17 && < 19", ">= 19.9", ">= 20"],
|
|
3133
|
+
"test/mock_loader": ">= 22.3 && < 22.7",
|
|
3134
|
+
"node:test/mock_loader": ">= 22.3 && < 22.7",
|
|
3135
|
+
"node:test": [">= 16.17 && < 17", ">= 18"],
|
|
3136
|
+
timers: true,
|
|
3137
|
+
"node:timers": [">= 14.18 && < 15", ">= 16"],
|
|
3138
|
+
"timers/promises": ">= 15",
|
|
3139
|
+
"node:timers/promises": ">= 16",
|
|
3140
|
+
_tls_common: ">= 0.11.13",
|
|
3141
|
+
"node:_tls_common": [">= 14.18 && < 15", ">= 16"],
|
|
3142
|
+
_tls_legacy: ">= 0.11.3 && < 10",
|
|
3143
|
+
_tls_wrap: ">= 0.11.3",
|
|
3144
|
+
"node:_tls_wrap": [">= 14.18 && < 15", ">= 16"],
|
|
3145
|
+
tls: true,
|
|
3146
|
+
"node:tls": [">= 14.18 && < 15", ">= 16"],
|
|
3147
|
+
trace_events: ">= 10",
|
|
3148
|
+
"node:trace_events": [">= 14.18 && < 15", ">= 16"],
|
|
3149
|
+
tty: true,
|
|
3150
|
+
"node:tty": [">= 14.18 && < 15", ">= 16"],
|
|
3151
|
+
url: true,
|
|
3152
|
+
"node:url": [">= 14.18 && < 15", ">= 16"],
|
|
3153
|
+
util: true,
|
|
3154
|
+
"node:util": [">= 14.18 && < 15", ">= 16"],
|
|
3155
|
+
"util/types": ">= 15.3",
|
|
3156
|
+
"node:util/types": ">= 16",
|
|
3157
|
+
"v8/tools/arguments": ">= 10 && < 12",
|
|
3158
|
+
"v8/tools/codemap": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3159
|
+
"v8/tools/consarray": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3160
|
+
"v8/tools/csvparser": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3161
|
+
"v8/tools/logreader": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3162
|
+
"v8/tools/profile_view": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3163
|
+
"v8/tools/splaytree": [">= 4.4 && < 5", ">= 5.2 && < 12"],
|
|
3164
|
+
v8: ">= 1",
|
|
3165
|
+
"node:v8": [">= 14.18 && < 15", ">= 16"],
|
|
3166
|
+
vm: true,
|
|
3167
|
+
"node:vm": [">= 14.18 && < 15", ">= 16"],
|
|
3168
|
+
wasi: [">= 13.4 && < 13.5", ">= 18.17 && < 19", ">= 20"],
|
|
3169
|
+
"node:wasi": [">= 18.17 && < 19", ">= 20"],
|
|
3170
|
+
worker_threads: ">= 11.7",
|
|
3171
|
+
"node:worker_threads": [">= 14.18 && < 15", ">= 16"],
|
|
3172
|
+
zlib: ">= 0.5",
|
|
3173
|
+
"node:zlib": [">= 14.18 && < 15", ">= 16"]
|
|
3174
|
+
};
|
|
3175
|
+
}
|
|
3176
|
+
});
|
|
3177
|
+
|
|
3178
|
+
// ../../node_modules/resolve/lib/core.js
|
|
3179
|
+
var require_core3 = __commonJS({
|
|
3180
|
+
"../../node_modules/resolve/lib/core.js"(exports, module) {
|
|
3181
|
+
"use strict";
|
|
3182
|
+
var isCoreModule = require_is_core_module();
|
|
3183
|
+
var data = require_core2();
|
|
3184
|
+
var core = {};
|
|
3185
|
+
for (mod in data) {
|
|
3186
|
+
if (Object.prototype.hasOwnProperty.call(data, mod)) {
|
|
3187
|
+
core[mod] = isCoreModule(mod);
|
|
3188
|
+
}
|
|
3189
|
+
}
|
|
3190
|
+
var mod;
|
|
3191
|
+
module.exports = core;
|
|
3192
|
+
}
|
|
3193
|
+
});
|
|
3194
|
+
|
|
3195
|
+
// ../../node_modules/resolve/lib/is-core.js
|
|
3196
|
+
var require_is_core = __commonJS({
|
|
3197
|
+
"../../node_modules/resolve/lib/is-core.js"(exports, module) {
|
|
3198
|
+
var isCoreModule = require_is_core_module();
|
|
3199
|
+
module.exports = /* @__PURE__ */ __name(function isCore(x) {
|
|
3200
|
+
return isCoreModule(x);
|
|
3201
|
+
}, "isCore");
|
|
3202
|
+
}
|
|
3203
|
+
});
|
|
3204
|
+
|
|
3205
|
+
// ../../node_modules/resolve/lib/sync.js
|
|
3206
|
+
var require_sync = __commonJS({
|
|
3207
|
+
"../../node_modules/resolve/lib/sync.js"(exports, module) {
|
|
3208
|
+
var isCore = require_is_core_module();
|
|
3209
|
+
var fs = __require("fs");
|
|
3210
|
+
var path2 = __require("path");
|
|
3211
|
+
var getHomedir = require_homedir();
|
|
3212
|
+
var caller = require_caller();
|
|
3213
|
+
var nodeModulesPaths = require_node_modules_paths();
|
|
3214
|
+
var normalizeOptions = require_normalize_options();
|
|
3215
|
+
var realpathFS = process.platform !== "win32" && fs.realpathSync && typeof fs.realpathSync.native === "function" ? fs.realpathSync.native : fs.realpathSync;
|
|
3216
|
+
var homedir = getHomedir();
|
|
3217
|
+
var defaultPaths = /* @__PURE__ */ __name(function() {
|
|
3218
|
+
return [
|
|
3219
|
+
path2.join(homedir, ".node_modules"),
|
|
3220
|
+
path2.join(homedir, ".node_libraries")
|
|
3221
|
+
];
|
|
3222
|
+
}, "defaultPaths");
|
|
3223
|
+
var defaultIsFile = /* @__PURE__ */ __name(function isFile(file) {
|
|
3224
|
+
try {
|
|
3225
|
+
var stat = fs.statSync(file, { throwIfNoEntry: false });
|
|
3226
|
+
} catch (e) {
|
|
3227
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
|
|
3228
|
+
throw e;
|
|
3229
|
+
}
|
|
3230
|
+
return !!stat && (stat.isFile() || stat.isFIFO());
|
|
3231
|
+
}, "isFile");
|
|
3232
|
+
var defaultIsDir = /* @__PURE__ */ __name(function isDirectory(dir) {
|
|
3233
|
+
try {
|
|
3234
|
+
var stat = fs.statSync(dir, { throwIfNoEntry: false });
|
|
3235
|
+
} catch (e) {
|
|
3236
|
+
if (e && (e.code === "ENOENT" || e.code === "ENOTDIR")) return false;
|
|
3237
|
+
throw e;
|
|
3238
|
+
}
|
|
3239
|
+
return !!stat && stat.isDirectory();
|
|
3240
|
+
}, "isDirectory");
|
|
3241
|
+
var defaultRealpathSync = /* @__PURE__ */ __name(function realpathSync(x) {
|
|
3242
|
+
try {
|
|
3243
|
+
return realpathFS(x);
|
|
3244
|
+
} catch (realpathErr) {
|
|
3245
|
+
if (realpathErr.code !== "ENOENT") {
|
|
3246
|
+
throw realpathErr;
|
|
3247
|
+
}
|
|
3248
|
+
}
|
|
3249
|
+
return x;
|
|
3250
|
+
}, "realpathSync");
|
|
3251
|
+
var maybeRealpathSync = /* @__PURE__ */ __name(function maybeRealpathSync2(realpathSync, x, opts) {
|
|
3252
|
+
if (opts && opts.preserveSymlinks === false) {
|
|
3253
|
+
return realpathSync(x);
|
|
3254
|
+
}
|
|
3255
|
+
return x;
|
|
3256
|
+
}, "maybeRealpathSync");
|
|
3257
|
+
var defaultReadPackageSync = /* @__PURE__ */ __name(function defaultReadPackageSync2(readFileSync, pkgfile) {
|
|
3258
|
+
var body = readFileSync(pkgfile);
|
|
3259
|
+
try {
|
|
3260
|
+
var pkg = JSON.parse(body);
|
|
3261
|
+
return pkg;
|
|
3262
|
+
} catch (jsonErr) {
|
|
3263
|
+
}
|
|
3264
|
+
}, "defaultReadPackageSync");
|
|
3265
|
+
var getPackageCandidates = /* @__PURE__ */ __name(function getPackageCandidates2(x, start, opts) {
|
|
3266
|
+
var dirs = nodeModulesPaths(start, opts, x);
|
|
3267
|
+
for (var i = 0; i < dirs.length; i++) {
|
|
3268
|
+
dirs[i] = path2.join(dirs[i], x);
|
|
3269
|
+
}
|
|
3270
|
+
return dirs;
|
|
3271
|
+
}, "getPackageCandidates");
|
|
3272
|
+
module.exports = /* @__PURE__ */ __name(function resolveSync(x, options) {
|
|
3273
|
+
if (typeof x !== "string") {
|
|
3274
|
+
throw new TypeError("Path must be a string.");
|
|
3275
|
+
}
|
|
3276
|
+
var opts = normalizeOptions(x, options);
|
|
3277
|
+
var isFile = opts.isFile || defaultIsFile;
|
|
3278
|
+
var readFileSync = opts.readFileSync || fs.readFileSync;
|
|
3279
|
+
var isDirectory = opts.isDirectory || defaultIsDir;
|
|
3280
|
+
var realpathSync = opts.realpathSync || defaultRealpathSync;
|
|
3281
|
+
var readPackageSync = opts.readPackageSync || defaultReadPackageSync;
|
|
3282
|
+
if (opts.readFileSync && opts.readPackageSync) {
|
|
3283
|
+
throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");
|
|
3284
|
+
}
|
|
3285
|
+
var packageIterator = opts.packageIterator;
|
|
3286
|
+
var extensions = opts.extensions || [".js"];
|
|
3287
|
+
var includeCoreModules = opts.includeCoreModules !== false;
|
|
3288
|
+
var basedir = opts.basedir || path2.dirname(caller());
|
|
3289
|
+
var parent = opts.filename || basedir;
|
|
3290
|
+
opts.paths = opts.paths || defaultPaths();
|
|
3291
|
+
var absoluteStart = maybeRealpathSync(realpathSync, path2.resolve(basedir), opts);
|
|
3292
|
+
if (/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(x)) {
|
|
3293
|
+
var res = path2.resolve(absoluteStart, x);
|
|
3294
|
+
if (x === "." || x === ".." || x.slice(-1) === "/") res += "/";
|
|
3295
|
+
var m = loadAsFileSync(res) || loadAsDirectorySync(res);
|
|
3296
|
+
if (m) return maybeRealpathSync(realpathSync, m, opts);
|
|
3297
|
+
} else if (includeCoreModules && isCore(x)) {
|
|
3298
|
+
return x;
|
|
3299
|
+
} else {
|
|
3300
|
+
var n = loadNodeModulesSync(x, absoluteStart);
|
|
3301
|
+
if (n) return maybeRealpathSync(realpathSync, n, opts);
|
|
3302
|
+
}
|
|
3303
|
+
var err = new Error("Cannot find module '" + x + "' from '" + parent + "'");
|
|
3304
|
+
err.code = "MODULE_NOT_FOUND";
|
|
3305
|
+
throw err;
|
|
3306
|
+
function loadAsFileSync(x2) {
|
|
3307
|
+
var pkg = loadpkg(path2.dirname(x2));
|
|
3308
|
+
if (pkg && pkg.dir && pkg.pkg && opts.pathFilter) {
|
|
3309
|
+
var rfile = path2.relative(pkg.dir, x2);
|
|
3310
|
+
var r = opts.pathFilter(pkg.pkg, x2, rfile);
|
|
3311
|
+
if (r) {
|
|
3312
|
+
x2 = path2.resolve(pkg.dir, r);
|
|
3313
|
+
}
|
|
3314
|
+
}
|
|
3315
|
+
if (isFile(x2)) {
|
|
3316
|
+
return x2;
|
|
3317
|
+
}
|
|
3318
|
+
for (var i = 0; i < extensions.length; i++) {
|
|
3319
|
+
var file = x2 + extensions[i];
|
|
3320
|
+
if (isFile(file)) {
|
|
3321
|
+
return file;
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
}
|
|
3325
|
+
__name(loadAsFileSync, "loadAsFileSync");
|
|
3326
|
+
function loadpkg(dir) {
|
|
3327
|
+
if (dir === "" || dir === "/") return;
|
|
3328
|
+
if (process.platform === "win32" && /^\w:[/\\]*$/.test(dir)) {
|
|
3329
|
+
return;
|
|
3330
|
+
}
|
|
3331
|
+
if (/[/\\]node_modules[/\\]*$/.test(dir)) return;
|
|
3332
|
+
var pkgfile = path2.join(maybeRealpathSync(realpathSync, dir, opts), "package.json");
|
|
3333
|
+
if (!isFile(pkgfile)) {
|
|
3334
|
+
return loadpkg(path2.dirname(dir));
|
|
3335
|
+
}
|
|
3336
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
3337
|
+
if (pkg && opts.packageFilter) {
|
|
3338
|
+
pkg = opts.packageFilter(
|
|
3339
|
+
pkg,
|
|
3340
|
+
/*pkgfile,*/
|
|
3341
|
+
dir
|
|
3342
|
+
);
|
|
3343
|
+
}
|
|
3344
|
+
return { pkg, dir };
|
|
3345
|
+
}
|
|
3346
|
+
__name(loadpkg, "loadpkg");
|
|
3347
|
+
function loadAsDirectorySync(x2) {
|
|
3348
|
+
var pkgfile = path2.join(maybeRealpathSync(realpathSync, x2, opts), "/package.json");
|
|
3349
|
+
if (isFile(pkgfile)) {
|
|
3350
|
+
try {
|
|
3351
|
+
var pkg = readPackageSync(readFileSync, pkgfile);
|
|
3352
|
+
} catch (e) {
|
|
3353
|
+
}
|
|
3354
|
+
if (pkg && opts.packageFilter) {
|
|
3355
|
+
pkg = opts.packageFilter(
|
|
3356
|
+
pkg,
|
|
3357
|
+
/*pkgfile,*/
|
|
3358
|
+
x2
|
|
3359
|
+
);
|
|
3360
|
+
}
|
|
3361
|
+
if (pkg && pkg.main) {
|
|
3362
|
+
if (typeof pkg.main !== "string") {
|
|
3363
|
+
var mainError = new TypeError("package \u201C" + pkg.name + "\u201D `main` must be a string");
|
|
3364
|
+
mainError.code = "INVALID_PACKAGE_MAIN";
|
|
3365
|
+
throw mainError;
|
|
3366
|
+
}
|
|
3367
|
+
if (pkg.main === "." || pkg.main === "./") {
|
|
3368
|
+
pkg.main = "index";
|
|
3369
|
+
}
|
|
3370
|
+
try {
|
|
3371
|
+
var m2 = loadAsFileSync(path2.resolve(x2, pkg.main));
|
|
3372
|
+
if (m2) return m2;
|
|
3373
|
+
var n2 = loadAsDirectorySync(path2.resolve(x2, pkg.main));
|
|
3374
|
+
if (n2) return n2;
|
|
3375
|
+
} catch (e) {
|
|
3376
|
+
}
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
return loadAsFileSync(path2.join(x2, "/index"));
|
|
3380
|
+
}
|
|
3381
|
+
__name(loadAsDirectorySync, "loadAsDirectorySync");
|
|
3382
|
+
function loadNodeModulesSync(x2, start) {
|
|
3383
|
+
var thunk = /* @__PURE__ */ __name(function() {
|
|
3384
|
+
return getPackageCandidates(x2, start, opts);
|
|
3385
|
+
}, "thunk");
|
|
3386
|
+
var dirs = packageIterator ? packageIterator(x2, start, thunk, opts) : thunk();
|
|
3387
|
+
for (var i = 0; i < dirs.length; i++) {
|
|
3388
|
+
var dir = dirs[i];
|
|
3389
|
+
if (isDirectory(path2.dirname(dir))) {
|
|
3390
|
+
var m2 = loadAsFileSync(dir);
|
|
3391
|
+
if (m2) return m2;
|
|
3392
|
+
var n2 = loadAsDirectorySync(dir);
|
|
3393
|
+
if (n2) return n2;
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
}
|
|
3397
|
+
__name(loadNodeModulesSync, "loadNodeModulesSync");
|
|
3398
|
+
}, "resolveSync");
|
|
3399
|
+
}
|
|
3400
|
+
});
|
|
3401
|
+
|
|
3402
|
+
// ../../node_modules/resolve/index.js
|
|
3403
|
+
var require_resolve = __commonJS({
|
|
3404
|
+
"../../node_modules/resolve/index.js"(exports, module) {
|
|
3405
|
+
var async = require_async();
|
|
3406
|
+
async.core = require_core3();
|
|
3407
|
+
async.isCore = require_is_core();
|
|
3408
|
+
async.sync = require_sync();
|
|
3409
|
+
module.exports = async;
|
|
3410
|
+
}
|
|
3411
|
+
});
|
|
14
3412
|
|
|
15
3413
|
// src/preset.ts
|
|
16
3414
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
@@ -338,6 +3736,9 @@ __name(normalizeWindowsPath, "normalizeWindowsPath");
|
|
|
338
3736
|
var _UNC_REGEX = /^[/\\]{2}/;
|
|
339
3737
|
var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
|
340
3738
|
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
3739
|
+
var _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
|
3740
|
+
var sep = "/";
|
|
3741
|
+
var delimiter = ":";
|
|
341
3742
|
var normalize = /* @__PURE__ */ __name(function(path2) {
|
|
342
3743
|
if (path2.length === 0) {
|
|
343
3744
|
return ".";
|
|
@@ -381,11 +3782,36 @@ var join = /* @__PURE__ */ __name(function(...arguments_) {
|
|
|
381
3782
|
}
|
|
382
3783
|
}
|
|
383
3784
|
}
|
|
384
|
-
if (joined === void 0) {
|
|
385
|
-
return ".";
|
|
3785
|
+
if (joined === void 0) {
|
|
3786
|
+
return ".";
|
|
3787
|
+
}
|
|
3788
|
+
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
3789
|
+
}, "join");
|
|
3790
|
+
function cwd() {
|
|
3791
|
+
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
|
3792
|
+
return process.cwd().replace(/\\/g, "/");
|
|
3793
|
+
}
|
|
3794
|
+
return "/";
|
|
3795
|
+
}
|
|
3796
|
+
__name(cwd, "cwd");
|
|
3797
|
+
var resolve = /* @__PURE__ */ __name(function(...arguments_) {
|
|
3798
|
+
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
|
3799
|
+
let resolvedPath = "";
|
|
3800
|
+
let resolvedAbsolute = false;
|
|
3801
|
+
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
|
3802
|
+
const path2 = index >= 0 ? arguments_[index] : cwd();
|
|
3803
|
+
if (!path2 || path2.length === 0) {
|
|
3804
|
+
continue;
|
|
3805
|
+
}
|
|
3806
|
+
resolvedPath = `${path2}/${resolvedPath}`;
|
|
3807
|
+
resolvedAbsolute = isAbsolute(path2);
|
|
3808
|
+
}
|
|
3809
|
+
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
|
3810
|
+
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
|
3811
|
+
return `/${resolvedPath}`;
|
|
386
3812
|
}
|
|
387
|
-
return
|
|
388
|
-
}, "
|
|
3813
|
+
return resolvedPath.length > 0 ? resolvedPath : ".";
|
|
3814
|
+
}, "resolve");
|
|
389
3815
|
function normalizeString(path2, allowAboveRoot) {
|
|
390
3816
|
let res = "";
|
|
391
3817
|
let lastSegmentLength = 0;
|
|
@@ -450,6 +3876,30 @@ __name(normalizeString, "normalizeString");
|
|
|
450
3876
|
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
451
3877
|
return _IS_ABSOLUTE_RE.test(p);
|
|
452
3878
|
}, "isAbsolute");
|
|
3879
|
+
var toNamespacedPath = /* @__PURE__ */ __name(function(p) {
|
|
3880
|
+
return normalizeWindowsPath(p);
|
|
3881
|
+
}, "toNamespacedPath");
|
|
3882
|
+
var _EXTNAME_RE = /.(\.[^./]+)$/;
|
|
3883
|
+
var extname = /* @__PURE__ */ __name(function(p) {
|
|
3884
|
+
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
|
3885
|
+
return match && match[1] || "";
|
|
3886
|
+
}, "extname");
|
|
3887
|
+
var relative = /* @__PURE__ */ __name(function(from, to) {
|
|
3888
|
+
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
3889
|
+
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
|
3890
|
+
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
|
3891
|
+
return _to.join("/");
|
|
3892
|
+
}
|
|
3893
|
+
const _fromCopy = [..._from];
|
|
3894
|
+
for (const segment of _fromCopy) {
|
|
3895
|
+
if (_to[0] !== segment) {
|
|
3896
|
+
break;
|
|
3897
|
+
}
|
|
3898
|
+
_from.shift();
|
|
3899
|
+
_to.shift();
|
|
3900
|
+
}
|
|
3901
|
+
return [..._from.map(() => ".."), ..._to].join("/");
|
|
3902
|
+
}, "relative");
|
|
453
3903
|
var dirname = /* @__PURE__ */ __name(function(p) {
|
|
454
3904
|
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
455
3905
|
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
|
@@ -457,6 +3907,45 @@ var dirname = /* @__PURE__ */ __name(function(p) {
|
|
|
457
3907
|
}
|
|
458
3908
|
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
459
3909
|
}, "dirname");
|
|
3910
|
+
var format2 = /* @__PURE__ */ __name(function(p) {
|
|
3911
|
+
const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
|
|
3912
|
+
return normalizeWindowsPath(
|
|
3913
|
+
p.root ? resolve(...segments) : segments.join("/")
|
|
3914
|
+
);
|
|
3915
|
+
}, "format");
|
|
3916
|
+
var basename = /* @__PURE__ */ __name(function(p, extension) {
|
|
3917
|
+
const lastSegment = normalizeWindowsPath(p).split("/").pop();
|
|
3918
|
+
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
|
3919
|
+
}, "basename");
|
|
3920
|
+
var parse = /* @__PURE__ */ __name(function(p) {
|
|
3921
|
+
const root = normalizeWindowsPath(p).split("/").shift() || "/";
|
|
3922
|
+
const base = basename(p);
|
|
3923
|
+
const extension = extname(base);
|
|
3924
|
+
return {
|
|
3925
|
+
root,
|
|
3926
|
+
dir: dirname(p),
|
|
3927
|
+
base,
|
|
3928
|
+
ext: extension,
|
|
3929
|
+
name: base.slice(0, base.length - extension.length)
|
|
3930
|
+
};
|
|
3931
|
+
}, "parse");
|
|
3932
|
+
var path = {
|
|
3933
|
+
__proto__: null,
|
|
3934
|
+
basename,
|
|
3935
|
+
delimiter,
|
|
3936
|
+
dirname,
|
|
3937
|
+
extname,
|
|
3938
|
+
format: format2,
|
|
3939
|
+
isAbsolute,
|
|
3940
|
+
join,
|
|
3941
|
+
normalize,
|
|
3942
|
+
normalizeString,
|
|
3943
|
+
parse,
|
|
3944
|
+
relative,
|
|
3945
|
+
resolve,
|
|
3946
|
+
sep,
|
|
3947
|
+
toNamespacedPath
|
|
3948
|
+
};
|
|
460
3949
|
|
|
461
3950
|
// ../../core/src/shared/utils/module.ts
|
|
462
3951
|
var importMetaResolve = /* @__PURE__ */ __name((...args) => {
|
|
@@ -472,6 +3961,1342 @@ var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
|
|
|
472
3961
|
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
473
3962
|
}, "resolvePackageDir");
|
|
474
3963
|
|
|
3964
|
+
// src/componentManifest/generator.ts
|
|
3965
|
+
import { readFile } from "node:fs/promises";
|
|
3966
|
+
import { recast } from "storybook/internal/babel";
|
|
3967
|
+
import { loadCsf } from "storybook/internal/csf-tools";
|
|
3968
|
+
import { extractDescription } from "storybook/internal/csf-tools";
|
|
3969
|
+
|
|
3970
|
+
// src/componentManifest/generateCodeSnippet.ts
|
|
3971
|
+
import { types as t } from "storybook/internal/babel";
|
|
3972
|
+
|
|
3973
|
+
// src/componentManifest/utils.ts
|
|
3974
|
+
var groupBy = /* @__PURE__ */ __name((items, keySelector) => {
|
|
3975
|
+
return items.reduce((acc = {}, item, index) => {
|
|
3976
|
+
const key = keySelector(item, index);
|
|
3977
|
+
acc[key] ??= [];
|
|
3978
|
+
acc[key].push(item);
|
|
3979
|
+
return acc;
|
|
3980
|
+
}, {});
|
|
3981
|
+
}, "groupBy");
|
|
3982
|
+
function invariant(condition, message) {
|
|
3983
|
+
if (condition) {
|
|
3984
|
+
return;
|
|
3985
|
+
}
|
|
3986
|
+
throw new Error((typeof message === "function" ? message() : message) ?? "Invariant failed");
|
|
3987
|
+
}
|
|
3988
|
+
__name(invariant, "invariant");
|
|
3989
|
+
|
|
3990
|
+
// src/componentManifest/generateCodeSnippet.ts
|
|
3991
|
+
function getCodeSnippet(csf, storyName, componentName) {
|
|
3992
|
+
const storyDeclaration = csf._storyDeclarationPath[storyName];
|
|
3993
|
+
const metaObj = csf._metaNode;
|
|
3994
|
+
if (!storyDeclaration) {
|
|
3995
|
+
const message = "Expected story to be a function or variable declaration";
|
|
3996
|
+
throw csf._storyPaths[storyName]?.buildCodeFrameError(message) ?? message;
|
|
3997
|
+
}
|
|
3998
|
+
let storyPath;
|
|
3999
|
+
if (storyDeclaration.isFunctionDeclaration()) {
|
|
4000
|
+
storyPath = storyDeclaration;
|
|
4001
|
+
} else if (storyDeclaration.isVariableDeclarator()) {
|
|
4002
|
+
const init = storyDeclaration.get("init");
|
|
4003
|
+
invariant(
|
|
4004
|
+
init.isExpression(),
|
|
4005
|
+
() => storyDeclaration.buildCodeFrameError("Expected story initializer to be an expression").message
|
|
4006
|
+
);
|
|
4007
|
+
storyPath = init;
|
|
4008
|
+
} else {
|
|
4009
|
+
throw storyDeclaration.buildCodeFrameError(
|
|
4010
|
+
"Expected story to be a function or variable declaration"
|
|
4011
|
+
);
|
|
4012
|
+
}
|
|
4013
|
+
let normalizedPath = storyPath;
|
|
4014
|
+
if (storyPath.isCallExpression()) {
|
|
4015
|
+
const callee = storyPath.get("callee");
|
|
4016
|
+
if (callee.isMemberExpression()) {
|
|
4017
|
+
const obj = callee.get("object");
|
|
4018
|
+
const prop = callee.get("property");
|
|
4019
|
+
const isBind = prop.isIdentifier() && prop.node.name === "bind" || t.isStringLiteral(prop.node) && prop.node.value === "bind";
|
|
4020
|
+
if (obj.isIdentifier() && isBind) {
|
|
4021
|
+
const resolved = resolveBindIdentifierInit(storyDeclaration, obj);
|
|
4022
|
+
if (resolved) {
|
|
4023
|
+
normalizedPath = resolved;
|
|
4024
|
+
}
|
|
4025
|
+
}
|
|
4026
|
+
}
|
|
4027
|
+
if (storyPath === normalizedPath) {
|
|
4028
|
+
const args = storyPath.get("arguments");
|
|
4029
|
+
if (args.length === 0) {
|
|
4030
|
+
} else {
|
|
4031
|
+
invariant(
|
|
4032
|
+
args.length === 1,
|
|
4033
|
+
() => storyPath.buildCodeFrameError("Could not evaluate story expression").message
|
|
4034
|
+
);
|
|
4035
|
+
const storyArg = args[0];
|
|
4036
|
+
invariant(
|
|
4037
|
+
storyArg.isExpression(),
|
|
4038
|
+
() => storyPath.buildCodeFrameError("Could not evaluate story expression").message
|
|
4039
|
+
);
|
|
4040
|
+
normalizedPath = storyArg;
|
|
4041
|
+
}
|
|
4042
|
+
}
|
|
4043
|
+
}
|
|
4044
|
+
normalizedPath = normalizedPath.isTSSatisfiesExpression() ? normalizedPath.get("expression") : normalizedPath.isTSAsExpression() ? normalizedPath.get("expression") : normalizedPath;
|
|
4045
|
+
let storyFn;
|
|
4046
|
+
if (normalizedPath.isArrowFunctionExpression() || normalizedPath.isFunctionExpression() || normalizedPath.isFunctionDeclaration()) {
|
|
4047
|
+
storyFn = normalizedPath;
|
|
4048
|
+
} else if (!normalizedPath.isObjectExpression()) {
|
|
4049
|
+
if (normalizedPath.isCallExpression() && Array.isArray(normalizedPath.node.arguments) && normalizedPath.node.arguments.length === 0) {
|
|
4050
|
+
} else {
|
|
4051
|
+
throw normalizedPath.buildCodeFrameError(
|
|
4052
|
+
"Expected story to be csf factory, function or an object expression"
|
|
4053
|
+
);
|
|
4054
|
+
}
|
|
4055
|
+
}
|
|
4056
|
+
const storyProps = normalizedPath.isObjectExpression() ? normalizedPath.get("properties").filter((p) => p.isObjectProperty()) : [];
|
|
4057
|
+
const metaPath = pathForNode(csf._file.path, metaObj);
|
|
4058
|
+
const metaProps = metaPath?.isObjectExpression() ? metaPath.get("properties").filter((p) => p.isObjectProperty()) : [];
|
|
4059
|
+
const getRenderPath = /* @__PURE__ */ __name((object) => object.filter((p) => keyOf(p.node) === "render").map((p) => p.get("value")).find(
|
|
4060
|
+
(v) => v.isArrowFunctionExpression() || v.isFunctionExpression()
|
|
4061
|
+
), "getRenderPath");
|
|
4062
|
+
const renderPath = getRenderPath(storyProps);
|
|
4063
|
+
const metaRenderPath = getRenderPath(metaProps);
|
|
4064
|
+
storyFn ??= renderPath ?? metaRenderPath;
|
|
4065
|
+
const metaArgs = metaArgsRecord(metaObj ?? null);
|
|
4066
|
+
const storyArgsPath = storyProps.filter((p) => keyOf(p.node) === "args").map((p) => p.get("value")).find((v) => v.isObjectExpression());
|
|
4067
|
+
const storyArgs = argsRecordFromObjectPath(storyArgsPath);
|
|
4068
|
+
const storyAssignedArgsPath = storyArgsAssignmentPath(csf._file.path, storyName);
|
|
4069
|
+
const storyAssignedArgs = argsRecordFromObjectPath(storyAssignedArgsPath);
|
|
4070
|
+
const merged = { ...metaArgs, ...storyArgs, ...storyAssignedArgs };
|
|
4071
|
+
const entries = Object.entries(merged).filter(([k]) => k !== "children");
|
|
4072
|
+
const validEntries = entries.filter(([k, v]) => isValidJsxAttrName(k) && v != null);
|
|
4073
|
+
const invalidEntries = entries.filter(([k, v]) => !isValidJsxAttrName(k) && v != null);
|
|
4074
|
+
const injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => a != null);
|
|
4075
|
+
if (storyFn) {
|
|
4076
|
+
const fn = storyFn.node;
|
|
4077
|
+
if (t.isArrowFunctionExpression(fn) && (t.isJSXElement(fn.body) || t.isJSXFragment(fn.body))) {
|
|
4078
|
+
const spreadRes = transformArgsSpreadsInJsx(fn.body, merged);
|
|
4079
|
+
const inlineRes = inlineArgsInJsx(spreadRes.node, merged);
|
|
4080
|
+
if (spreadRes.changed || inlineRes.changed) {
|
|
4081
|
+
const newFn = t.arrowFunctionExpression([], inlineRes.node, fn.async);
|
|
4082
|
+
return t.variableDeclaration("const", [
|
|
4083
|
+
t.variableDeclarator(t.identifier(storyName), newFn)
|
|
4084
|
+
]);
|
|
4085
|
+
}
|
|
4086
|
+
}
|
|
4087
|
+
const stmts = t.isFunctionDeclaration(fn) ? fn.body.body : t.isArrowFunctionExpression(fn) && t.isBlockStatement(fn.body) ? fn.body.body : t.isFunctionExpression(fn) && t.isBlockStatement(fn.body) ? fn.body.body : void 0;
|
|
4088
|
+
if (stmts) {
|
|
4089
|
+
let changed = false;
|
|
4090
|
+
const newBody = stmts.map((stmt) => {
|
|
4091
|
+
if (t.isReturnStatement(stmt) && stmt.argument && (t.isJSXElement(stmt.argument) || t.isJSXFragment(stmt.argument))) {
|
|
4092
|
+
const spreadRes = transformArgsSpreadsInJsx(stmt.argument, merged);
|
|
4093
|
+
const inlineRes = inlineArgsInJsx(spreadRes.node, merged);
|
|
4094
|
+
if (spreadRes.changed || inlineRes.changed) {
|
|
4095
|
+
changed = true;
|
|
4096
|
+
return t.returnStatement(inlineRes.node);
|
|
4097
|
+
}
|
|
4098
|
+
}
|
|
4099
|
+
return stmt;
|
|
4100
|
+
});
|
|
4101
|
+
if (changed) {
|
|
4102
|
+
return t.isFunctionDeclaration(fn) ? t.functionDeclaration(fn.id, [], t.blockStatement(newBody), fn.generator, fn.async) : t.variableDeclaration("const", [
|
|
4103
|
+
t.variableDeclarator(
|
|
4104
|
+
t.identifier(storyName),
|
|
4105
|
+
t.arrowFunctionExpression([], t.blockStatement(newBody), fn.async)
|
|
4106
|
+
)
|
|
4107
|
+
]);
|
|
4108
|
+
}
|
|
4109
|
+
}
|
|
4110
|
+
return t.isFunctionDeclaration(fn) ? fn : t.variableDeclaration("const", [t.variableDeclarator(t.identifier(storyName), fn)]);
|
|
4111
|
+
}
|
|
4112
|
+
invariant(componentName, "Could not generate snippet without component name.");
|
|
4113
|
+
const invalidSpread = buildInvalidSpread(invalidEntries);
|
|
4114
|
+
const name = t.jsxIdentifier(componentName);
|
|
4115
|
+
const openingElAttrs = invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs;
|
|
4116
|
+
const arrow = t.arrowFunctionExpression(
|
|
4117
|
+
[],
|
|
4118
|
+
t.jsxElement(
|
|
4119
|
+
t.jsxOpeningElement(name, openingElAttrs, false),
|
|
4120
|
+
t.jsxClosingElement(name),
|
|
4121
|
+
toJsxChildren(merged.children),
|
|
4122
|
+
false
|
|
4123
|
+
)
|
|
4124
|
+
);
|
|
4125
|
+
return t.variableDeclaration("const", [t.variableDeclarator(t.identifier(storyName), arrow)]);
|
|
4126
|
+
}
|
|
4127
|
+
__name(getCodeSnippet, "getCodeSnippet");
|
|
4128
|
+
function buildInvalidSpread(entries) {
|
|
4129
|
+
if (entries.length === 0) {
|
|
4130
|
+
return null;
|
|
4131
|
+
}
|
|
4132
|
+
const objectProps = entries.map(
|
|
4133
|
+
([k, v]) => t.objectProperty(t.stringLiteral(k), t.isExpression(v) ? v : t.identifier("undefined"))
|
|
4134
|
+
);
|
|
4135
|
+
return t.jsxSpreadAttribute(t.objectExpression(objectProps));
|
|
4136
|
+
}
|
|
4137
|
+
__name(buildInvalidSpread, "buildInvalidSpread");
|
|
4138
|
+
var keyOf = /* @__PURE__ */ __name((p) => t.isIdentifier(p.key) ? p.key.name : t.isStringLiteral(p.key) ? p.key.value : null, "keyOf");
|
|
4139
|
+
var isValidJsxAttrName = /* @__PURE__ */ __name((n) => /^[A-Za-z_][A-Za-z0-9_:-]*$/.test(n), "isValidJsxAttrName");
|
|
4140
|
+
var argsRecordFromObjectPath = /* @__PURE__ */ __name((objPath) => objPath ? Object.fromEntries(
|
|
4141
|
+
objPath.get("properties").filter((p) => p.isObjectProperty()).map((p) => [keyOf(p.node), p.get("value").node]).filter((e) => Boolean(e[0]))
|
|
4142
|
+
) : {}, "argsRecordFromObjectPath");
|
|
4143
|
+
function storyArgsAssignmentPath(program, storyName) {
|
|
4144
|
+
let found = null;
|
|
4145
|
+
program.traverse({
|
|
4146
|
+
AssignmentExpression(p) {
|
|
4147
|
+
const left = p.get("left");
|
|
4148
|
+
const right = p.get("right");
|
|
4149
|
+
if (left.isMemberExpression()) {
|
|
4150
|
+
const obj = left.get("object");
|
|
4151
|
+
const prop = left.get("property");
|
|
4152
|
+
const isStoryIdent = obj.isIdentifier() && obj.node.name === storyName;
|
|
4153
|
+
const isArgsProp = prop.isIdentifier() && prop.node.name === "args" && !left.node.computed || t.isStringLiteral(prop.node) && left.node.computed && prop.node.value === "args";
|
|
4154
|
+
if (isStoryIdent && isArgsProp && right.isObjectExpression()) {
|
|
4155
|
+
found = right;
|
|
4156
|
+
}
|
|
4157
|
+
}
|
|
4158
|
+
}
|
|
4159
|
+
});
|
|
4160
|
+
return found;
|
|
4161
|
+
}
|
|
4162
|
+
__name(storyArgsAssignmentPath, "storyArgsAssignmentPath");
|
|
4163
|
+
var argsRecordFromObjectNode = /* @__PURE__ */ __name((obj) => obj ? Object.fromEntries(
|
|
4164
|
+
obj.properties.filter((p) => t.isObjectProperty(p)).map((p) => [keyOf(p), p.value]).filter((e) => Boolean(e[0]))
|
|
4165
|
+
) : {}, "argsRecordFromObjectNode");
|
|
4166
|
+
var metaArgsRecord = /* @__PURE__ */ __name((meta) => {
|
|
4167
|
+
if (!meta) {
|
|
4168
|
+
return {};
|
|
4169
|
+
}
|
|
4170
|
+
const argsProp = meta.properties.find(
|
|
4171
|
+
(p) => t.isObjectProperty(p) && keyOf(p) === "args"
|
|
4172
|
+
);
|
|
4173
|
+
return argsProp && t.isObjectExpression(argsProp.value) ? argsRecordFromObjectNode(argsProp.value) : {};
|
|
4174
|
+
}, "metaArgsRecord");
|
|
4175
|
+
var toAttr = /* @__PURE__ */ __name((key, value) => {
|
|
4176
|
+
if (t.isBooleanLiteral(value)) {
|
|
4177
|
+
return value.value ? t.jsxAttribute(t.jsxIdentifier(key), null) : t.jsxAttribute(t.jsxIdentifier(key), t.jsxExpressionContainer(value));
|
|
4178
|
+
}
|
|
4179
|
+
if (t.isStringLiteral(value)) {
|
|
4180
|
+
return t.jsxAttribute(t.jsxIdentifier(key), t.stringLiteral(value.value));
|
|
4181
|
+
}
|
|
4182
|
+
if (t.isExpression(value)) {
|
|
4183
|
+
return t.jsxAttribute(t.jsxIdentifier(key), t.jsxExpressionContainer(value));
|
|
4184
|
+
}
|
|
4185
|
+
return null;
|
|
4186
|
+
}, "toAttr");
|
|
4187
|
+
var toJsxChildren = /* @__PURE__ */ __name((node) => !node ? [] : t.isStringLiteral(node) ? [t.jsxText(node.value)] : t.isJSXElement(node) || t.isJSXFragment(node) ? [node] : t.isExpression(node) ? [t.jsxExpressionContainer(node)] : [], "toJsxChildren");
|
|
4188
|
+
function getArgsMemberKey(expr) {
|
|
4189
|
+
if (t.isMemberExpression(expr) && t.isIdentifier(expr.object) && expr.object.name === "args") {
|
|
4190
|
+
if (t.isIdentifier(expr.property) && !expr.computed) {
|
|
4191
|
+
return expr.property.name;
|
|
4192
|
+
}
|
|
4193
|
+
if (t.isStringLiteral(expr.property) && expr.computed) {
|
|
4194
|
+
return expr.property.value;
|
|
4195
|
+
}
|
|
4196
|
+
}
|
|
4197
|
+
if (t.isOptionalMemberExpression?.(expr) && t.isIdentifier(expr.object) && expr.object.name === "args") {
|
|
4198
|
+
const prop = expr.property;
|
|
4199
|
+
if (t.isIdentifier(prop) && !expr.computed) {
|
|
4200
|
+
return prop.name;
|
|
4201
|
+
}
|
|
4202
|
+
if (t.isStringLiteral(prop) && expr.computed) {
|
|
4203
|
+
return prop.value;
|
|
4204
|
+
}
|
|
4205
|
+
}
|
|
4206
|
+
return null;
|
|
4207
|
+
}
|
|
4208
|
+
__name(getArgsMemberKey, "getArgsMemberKey");
|
|
4209
|
+
function inlineArgsInJsx(node, merged) {
|
|
4210
|
+
let changed = false;
|
|
4211
|
+
if (t.isJSXElement(node)) {
|
|
4212
|
+
const opening = node.openingElement;
|
|
4213
|
+
const newAttrs = opening.attributes.flatMap((a) => {
|
|
4214
|
+
if (!t.isJSXAttribute(a)) {
|
|
4215
|
+
return [a];
|
|
4216
|
+
}
|
|
4217
|
+
const name = t.isJSXIdentifier(a.name) ? a.name.name : null;
|
|
4218
|
+
if (!(name && a.value && t.isJSXExpressionContainer(a.value))) {
|
|
4219
|
+
return [a];
|
|
4220
|
+
}
|
|
4221
|
+
const key = getArgsMemberKey(a.value.expression);
|
|
4222
|
+
if (!(key && key in merged)) {
|
|
4223
|
+
return [a];
|
|
4224
|
+
}
|
|
4225
|
+
const repl = toAttr(name, merged[key]);
|
|
4226
|
+
changed = true;
|
|
4227
|
+
return repl ? [repl] : [];
|
|
4228
|
+
});
|
|
4229
|
+
const newChildren = node.children.flatMap((c) => {
|
|
4230
|
+
if (t.isJSXElement(c) || t.isJSXFragment(c)) {
|
|
4231
|
+
const res = inlineArgsInJsx(c, merged);
|
|
4232
|
+
changed ||= res.changed;
|
|
4233
|
+
return [res.node];
|
|
4234
|
+
}
|
|
4235
|
+
if (t.isJSXExpressionContainer(c)) {
|
|
4236
|
+
const key = getArgsMemberKey(c.expression);
|
|
4237
|
+
if (key === "children" && merged.children) {
|
|
4238
|
+
changed = true;
|
|
4239
|
+
return toJsxChildren(merged.children);
|
|
4240
|
+
}
|
|
4241
|
+
}
|
|
4242
|
+
return [c];
|
|
4243
|
+
});
|
|
4244
|
+
const selfClosing = opening.selfClosing && newChildren.length === 0;
|
|
4245
|
+
return {
|
|
4246
|
+
node: t.jsxElement(
|
|
4247
|
+
t.jsxOpeningElement(opening.name, newAttrs, selfClosing),
|
|
4248
|
+
selfClosing ? null : node.closingElement ?? t.jsxClosingElement(opening.name),
|
|
4249
|
+
newChildren,
|
|
4250
|
+
selfClosing
|
|
4251
|
+
),
|
|
4252
|
+
changed
|
|
4253
|
+
};
|
|
4254
|
+
}
|
|
4255
|
+
const fragChildren = node.children.flatMap((c) => {
|
|
4256
|
+
if (t.isJSXElement(c) || t.isJSXFragment(c)) {
|
|
4257
|
+
const res = inlineArgsInJsx(c, merged);
|
|
4258
|
+
changed ||= res.changed;
|
|
4259
|
+
return [res.node];
|
|
4260
|
+
}
|
|
4261
|
+
if (t.isJSXExpressionContainer(c)) {
|
|
4262
|
+
const key = getArgsMemberKey(c.expression);
|
|
4263
|
+
if (key === "children" && "children" in merged) {
|
|
4264
|
+
changed = true;
|
|
4265
|
+
return toJsxChildren(merged.children);
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
return [c];
|
|
4269
|
+
});
|
|
4270
|
+
return { node: t.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
|
|
4271
|
+
}
|
|
4272
|
+
__name(inlineArgsInJsx, "inlineArgsInJsx");
|
|
4273
|
+
function transformArgsSpreadsInJsx(node, merged) {
|
|
4274
|
+
let changed = false;
|
|
4275
|
+
const makeInjectedPieces = /* @__PURE__ */ __name((existing) => {
|
|
4276
|
+
const entries = Object.entries(merged).filter(([k, v]) => v != null && k !== "children");
|
|
4277
|
+
const validEntries = entries.filter(([k]) => isValidJsxAttrName(k));
|
|
4278
|
+
const invalidEntries = entries.filter(([k]) => !isValidJsxAttrName(k));
|
|
4279
|
+
const injectedAttrs = validEntries.map(([k, v]) => toAttr(k, v)).filter((a) => Boolean(a)).filter((a) => t.isJSXIdentifier(a.name) && !existing.has(a.name.name));
|
|
4280
|
+
const invalidSpread = buildInvalidSpread(invalidEntries.filter(([k]) => !existing.has(k)));
|
|
4281
|
+
return invalidSpread ? [...injectedAttrs, invalidSpread] : injectedAttrs;
|
|
4282
|
+
}, "makeInjectedPieces");
|
|
4283
|
+
if (t.isJSXElement(node)) {
|
|
4284
|
+
const opening = node.openingElement;
|
|
4285
|
+
const attrs = opening.attributes;
|
|
4286
|
+
const isArgsSpread = /* @__PURE__ */ __name((a) => t.isJSXSpreadAttribute(a) && t.isIdentifier(a.argument) && a.argument.name === "args", "isArgsSpread");
|
|
4287
|
+
const sawArgsSpread = attrs.some(isArgsSpread);
|
|
4288
|
+
const firstIdx = attrs.findIndex(isArgsSpread);
|
|
4289
|
+
const nonArgsAttrs = attrs.filter((a) => !isArgsSpread(a));
|
|
4290
|
+
const insertionIndex = sawArgsSpread ? attrs.slice(0, firstIdx).filter((a) => !isArgsSpread(a)).length : 0;
|
|
4291
|
+
const newAttrs = sawArgsSpread ? (() => {
|
|
4292
|
+
const existing = new Set(
|
|
4293
|
+
nonArgsAttrs.filter((a) => t.isJSXAttribute(a)).flatMap((a) => t.isJSXIdentifier(a.name) ? [a.name.name] : [])
|
|
4294
|
+
);
|
|
4295
|
+
const pieces = makeInjectedPieces(existing);
|
|
4296
|
+
changed = true;
|
|
4297
|
+
return [
|
|
4298
|
+
...nonArgsAttrs.slice(0, insertionIndex),
|
|
4299
|
+
...pieces,
|
|
4300
|
+
...nonArgsAttrs.slice(insertionIndex)
|
|
4301
|
+
];
|
|
4302
|
+
})() : nonArgsAttrs;
|
|
4303
|
+
const newChildren = node.children.flatMap((c) => {
|
|
4304
|
+
if (t.isJSXElement(c) || t.isJSXFragment(c)) {
|
|
4305
|
+
const res = transformArgsSpreadsInJsx(c, merged);
|
|
4306
|
+
changed ||= res.changed;
|
|
4307
|
+
return [res.node];
|
|
4308
|
+
}
|
|
4309
|
+
return [c];
|
|
4310
|
+
});
|
|
4311
|
+
const children = sawArgsSpread && newChildren.length === 0 && merged.children ? (changed = true, toJsxChildren(merged.children)) : newChildren;
|
|
4312
|
+
const selfClosing = children.length === 0;
|
|
4313
|
+
return {
|
|
4314
|
+
node: t.jsxElement(
|
|
4315
|
+
t.jsxOpeningElement(opening.name, newAttrs, selfClosing),
|
|
4316
|
+
selfClosing ? null : node.closingElement ?? t.jsxClosingElement(opening.name),
|
|
4317
|
+
children,
|
|
4318
|
+
selfClosing
|
|
4319
|
+
),
|
|
4320
|
+
changed
|
|
4321
|
+
};
|
|
4322
|
+
}
|
|
4323
|
+
const fragChildren = node.children.flatMap((c) => {
|
|
4324
|
+
if (t.isJSXElement(c) || t.isJSXFragment(c)) {
|
|
4325
|
+
const res = transformArgsSpreadsInJsx(c, merged);
|
|
4326
|
+
changed ||= res.changed;
|
|
4327
|
+
return [res.node];
|
|
4328
|
+
}
|
|
4329
|
+
return [c];
|
|
4330
|
+
});
|
|
4331
|
+
return { node: t.jsxFragment(node.openingFragment, node.closingFragment, fragChildren), changed };
|
|
4332
|
+
}
|
|
4333
|
+
__name(transformArgsSpreadsInJsx, "transformArgsSpreadsInJsx");
|
|
4334
|
+
function resolveBindIdentifierInit(storyPath, identifier) {
|
|
4335
|
+
const programPath = storyPath.findParent((p) => p.isProgram());
|
|
4336
|
+
if (!programPath) {
|
|
4337
|
+
return null;
|
|
4338
|
+
}
|
|
4339
|
+
const declarators = programPath.get("body").flatMap((stmt) => {
|
|
4340
|
+
if (stmt.isVariableDeclaration()) {
|
|
4341
|
+
return stmt.get("declarations");
|
|
4342
|
+
}
|
|
4343
|
+
if (stmt.isExportNamedDeclaration()) {
|
|
4344
|
+
const decl = stmt.get("declaration");
|
|
4345
|
+
if (decl && decl.isVariableDeclaration()) {
|
|
4346
|
+
return decl.get("declarations");
|
|
4347
|
+
}
|
|
4348
|
+
}
|
|
4349
|
+
return [];
|
|
4350
|
+
});
|
|
4351
|
+
const match = declarators.find((d) => {
|
|
4352
|
+
const id = d.get("id");
|
|
4353
|
+
return id.isIdentifier() && id.node.name === identifier.node.name;
|
|
4354
|
+
});
|
|
4355
|
+
if (!match) {
|
|
4356
|
+
return null;
|
|
4357
|
+
}
|
|
4358
|
+
const init = match.get("init");
|
|
4359
|
+
return init && init.isExpression() ? init : null;
|
|
4360
|
+
}
|
|
4361
|
+
__name(resolveBindIdentifierInit, "resolveBindIdentifierInit");
|
|
4362
|
+
function pathForNode(program, target) {
|
|
4363
|
+
if (!target) {
|
|
4364
|
+
return void 0;
|
|
4365
|
+
}
|
|
4366
|
+
let found;
|
|
4367
|
+
program.traverse({
|
|
4368
|
+
enter(p) {
|
|
4369
|
+
if (p.node && p.node === target) {
|
|
4370
|
+
found = p;
|
|
4371
|
+
p.stop();
|
|
4372
|
+
}
|
|
4373
|
+
}
|
|
4374
|
+
});
|
|
4375
|
+
return found;
|
|
4376
|
+
}
|
|
4377
|
+
__name(pathForNode, "pathForNode");
|
|
4378
|
+
|
|
4379
|
+
// ../../node_modules/comment-parser/es6/primitives.js
|
|
4380
|
+
var Markers;
|
|
4381
|
+
(function(Markers2) {
|
|
4382
|
+
Markers2["start"] = "/**";
|
|
4383
|
+
Markers2["nostart"] = "/***";
|
|
4384
|
+
Markers2["delim"] = "*";
|
|
4385
|
+
Markers2["end"] = "*/";
|
|
4386
|
+
})(Markers = Markers || (Markers = {}));
|
|
4387
|
+
|
|
4388
|
+
// ../../node_modules/comment-parser/es6/util.js
|
|
4389
|
+
function isSpace(source) {
|
|
4390
|
+
return /^\s+$/.test(source);
|
|
4391
|
+
}
|
|
4392
|
+
__name(isSpace, "isSpace");
|
|
4393
|
+
function splitCR(source) {
|
|
4394
|
+
const matches = source.match(/\r+$/);
|
|
4395
|
+
return matches == null ? ["", source] : [source.slice(-matches[0].length), source.slice(0, -matches[0].length)];
|
|
4396
|
+
}
|
|
4397
|
+
__name(splitCR, "splitCR");
|
|
4398
|
+
function splitSpace(source) {
|
|
4399
|
+
const matches = source.match(/^\s+/);
|
|
4400
|
+
return matches == null ? ["", source] : [source.slice(0, matches[0].length), source.slice(matches[0].length)];
|
|
4401
|
+
}
|
|
4402
|
+
__name(splitSpace, "splitSpace");
|
|
4403
|
+
function splitLines(source) {
|
|
4404
|
+
return source.split(/\n/);
|
|
4405
|
+
}
|
|
4406
|
+
__name(splitLines, "splitLines");
|
|
4407
|
+
function seedSpec(spec = {}) {
|
|
4408
|
+
return Object.assign({ tag: "", name: "", type: "", optional: false, description: "", problems: [], source: [] }, spec);
|
|
4409
|
+
}
|
|
4410
|
+
__name(seedSpec, "seedSpec");
|
|
4411
|
+
function seedTokens(tokens = {}) {
|
|
4412
|
+
return Object.assign({ start: "", delimiter: "", postDelimiter: "", tag: "", postTag: "", name: "", postName: "", type: "", postType: "", description: "", end: "", lineEnd: "" }, tokens);
|
|
4413
|
+
}
|
|
4414
|
+
__name(seedTokens, "seedTokens");
|
|
4415
|
+
|
|
4416
|
+
// ../../node_modules/comment-parser/es6/parser/block-parser.js
|
|
4417
|
+
var reTag = /^@\S+/;
|
|
4418
|
+
function getParser({ fence = "```" } = {}) {
|
|
4419
|
+
const fencer = getFencer(fence);
|
|
4420
|
+
const toggleFence = /* @__PURE__ */ __name((source, isFenced) => fencer(source) ? !isFenced : isFenced, "toggleFence");
|
|
4421
|
+
return /* @__PURE__ */ __name(function parseBlock(source) {
|
|
4422
|
+
const sections = [[]];
|
|
4423
|
+
let isFenced = false;
|
|
4424
|
+
for (const line of source) {
|
|
4425
|
+
if (reTag.test(line.tokens.description) && !isFenced) {
|
|
4426
|
+
sections.push([line]);
|
|
4427
|
+
} else {
|
|
4428
|
+
sections[sections.length - 1].push(line);
|
|
4429
|
+
}
|
|
4430
|
+
isFenced = toggleFence(line.tokens.description, isFenced);
|
|
4431
|
+
}
|
|
4432
|
+
return sections;
|
|
4433
|
+
}, "parseBlock");
|
|
4434
|
+
}
|
|
4435
|
+
__name(getParser, "getParser");
|
|
4436
|
+
function getFencer(fence) {
|
|
4437
|
+
if (typeof fence === "string")
|
|
4438
|
+
return (source) => source.split(fence).length % 2 === 0;
|
|
4439
|
+
return fence;
|
|
4440
|
+
}
|
|
4441
|
+
__name(getFencer, "getFencer");
|
|
4442
|
+
|
|
4443
|
+
// ../../node_modules/comment-parser/es6/parser/source-parser.js
|
|
4444
|
+
function getParser2({ startLine = 0, markers = Markers } = {}) {
|
|
4445
|
+
let block = null;
|
|
4446
|
+
let num = startLine;
|
|
4447
|
+
return /* @__PURE__ */ __name(function parseSource(source) {
|
|
4448
|
+
let rest = source;
|
|
4449
|
+
const tokens = seedTokens();
|
|
4450
|
+
[tokens.lineEnd, rest] = splitCR(rest);
|
|
4451
|
+
[tokens.start, rest] = splitSpace(rest);
|
|
4452
|
+
if (block === null && rest.startsWith(markers.start) && !rest.startsWith(markers.nostart)) {
|
|
4453
|
+
block = [];
|
|
4454
|
+
tokens.delimiter = rest.slice(0, markers.start.length);
|
|
4455
|
+
rest = rest.slice(markers.start.length);
|
|
4456
|
+
[tokens.postDelimiter, rest] = splitSpace(rest);
|
|
4457
|
+
}
|
|
4458
|
+
if (block === null) {
|
|
4459
|
+
num++;
|
|
4460
|
+
return null;
|
|
4461
|
+
}
|
|
4462
|
+
const isClosed = rest.trimRight().endsWith(markers.end);
|
|
4463
|
+
if (tokens.delimiter === "" && rest.startsWith(markers.delim) && !rest.startsWith(markers.end)) {
|
|
4464
|
+
tokens.delimiter = markers.delim;
|
|
4465
|
+
rest = rest.slice(markers.delim.length);
|
|
4466
|
+
[tokens.postDelimiter, rest] = splitSpace(rest);
|
|
4467
|
+
}
|
|
4468
|
+
if (isClosed) {
|
|
4469
|
+
const trimmed = rest.trimRight();
|
|
4470
|
+
tokens.end = rest.slice(trimmed.length - markers.end.length);
|
|
4471
|
+
rest = trimmed.slice(0, -markers.end.length);
|
|
4472
|
+
}
|
|
4473
|
+
tokens.description = rest;
|
|
4474
|
+
block.push({ number: num, source, tokens });
|
|
4475
|
+
num++;
|
|
4476
|
+
if (isClosed) {
|
|
4477
|
+
const result = block.slice();
|
|
4478
|
+
block = null;
|
|
4479
|
+
return result;
|
|
4480
|
+
}
|
|
4481
|
+
return null;
|
|
4482
|
+
}, "parseSource");
|
|
4483
|
+
}
|
|
4484
|
+
__name(getParser2, "getParser");
|
|
4485
|
+
|
|
4486
|
+
// ../../node_modules/comment-parser/es6/parser/spec-parser.js
|
|
4487
|
+
function getParser3({ tokenizers }) {
|
|
4488
|
+
return /* @__PURE__ */ __name(function parseSpec(source) {
|
|
4489
|
+
var _a;
|
|
4490
|
+
let spec = seedSpec({ source });
|
|
4491
|
+
for (const tokenize of tokenizers) {
|
|
4492
|
+
spec = tokenize(spec);
|
|
4493
|
+
if ((_a = spec.problems[spec.problems.length - 1]) === null || _a === void 0 ? void 0 : _a.critical)
|
|
4494
|
+
break;
|
|
4495
|
+
}
|
|
4496
|
+
return spec;
|
|
4497
|
+
}, "parseSpec");
|
|
4498
|
+
}
|
|
4499
|
+
__name(getParser3, "getParser");
|
|
4500
|
+
|
|
4501
|
+
// ../../node_modules/comment-parser/es6/parser/tokenizers/tag.js
|
|
4502
|
+
function tagTokenizer() {
|
|
4503
|
+
return (spec) => {
|
|
4504
|
+
const { tokens } = spec.source[0];
|
|
4505
|
+
const match = tokens.description.match(/\s*(@(\S+))(\s*)/);
|
|
4506
|
+
if (match === null) {
|
|
4507
|
+
spec.problems.push({
|
|
4508
|
+
code: "spec:tag:prefix",
|
|
4509
|
+
message: 'tag should start with "@" symbol',
|
|
4510
|
+
line: spec.source[0].number,
|
|
4511
|
+
critical: true
|
|
4512
|
+
});
|
|
4513
|
+
return spec;
|
|
4514
|
+
}
|
|
4515
|
+
tokens.tag = match[1];
|
|
4516
|
+
tokens.postTag = match[3];
|
|
4517
|
+
tokens.description = tokens.description.slice(match[0].length);
|
|
4518
|
+
spec.tag = match[2];
|
|
4519
|
+
return spec;
|
|
4520
|
+
};
|
|
4521
|
+
}
|
|
4522
|
+
__name(tagTokenizer, "tagTokenizer");
|
|
4523
|
+
|
|
4524
|
+
// ../../node_modules/comment-parser/es6/parser/tokenizers/type.js
|
|
4525
|
+
function typeTokenizer(spacing = "compact") {
|
|
4526
|
+
const join5 = getJoiner(spacing);
|
|
4527
|
+
return (spec) => {
|
|
4528
|
+
let curlies = 0;
|
|
4529
|
+
let lines = [];
|
|
4530
|
+
for (const [i, { tokens }] of spec.source.entries()) {
|
|
4531
|
+
let type = "";
|
|
4532
|
+
if (i === 0 && tokens.description[0] !== "{")
|
|
4533
|
+
return spec;
|
|
4534
|
+
for (const ch of tokens.description) {
|
|
4535
|
+
if (ch === "{")
|
|
4536
|
+
curlies++;
|
|
4537
|
+
if (ch === "}")
|
|
4538
|
+
curlies--;
|
|
4539
|
+
type += ch;
|
|
4540
|
+
if (curlies === 0)
|
|
4541
|
+
break;
|
|
4542
|
+
}
|
|
4543
|
+
lines.push([tokens, type]);
|
|
4544
|
+
if (curlies === 0)
|
|
4545
|
+
break;
|
|
4546
|
+
}
|
|
4547
|
+
if (curlies !== 0) {
|
|
4548
|
+
spec.problems.push({
|
|
4549
|
+
code: "spec:type:unpaired-curlies",
|
|
4550
|
+
message: "unpaired curlies",
|
|
4551
|
+
line: spec.source[0].number,
|
|
4552
|
+
critical: true
|
|
4553
|
+
});
|
|
4554
|
+
return spec;
|
|
4555
|
+
}
|
|
4556
|
+
const parts = [];
|
|
4557
|
+
const offset = lines[0][0].postDelimiter.length;
|
|
4558
|
+
for (const [i, [tokens, type]] of lines.entries()) {
|
|
4559
|
+
tokens.type = type;
|
|
4560
|
+
if (i > 0) {
|
|
4561
|
+
tokens.type = tokens.postDelimiter.slice(offset) + type;
|
|
4562
|
+
tokens.postDelimiter = tokens.postDelimiter.slice(0, offset);
|
|
4563
|
+
}
|
|
4564
|
+
[tokens.postType, tokens.description] = splitSpace(tokens.description.slice(type.length));
|
|
4565
|
+
parts.push(tokens.type);
|
|
4566
|
+
}
|
|
4567
|
+
parts[0] = parts[0].slice(1);
|
|
4568
|
+
parts[parts.length - 1] = parts[parts.length - 1].slice(0, -1);
|
|
4569
|
+
spec.type = join5(parts);
|
|
4570
|
+
return spec;
|
|
4571
|
+
};
|
|
4572
|
+
}
|
|
4573
|
+
__name(typeTokenizer, "typeTokenizer");
|
|
4574
|
+
var trim = /* @__PURE__ */ __name((x) => x.trim(), "trim");
|
|
4575
|
+
function getJoiner(spacing) {
|
|
4576
|
+
if (spacing === "compact")
|
|
4577
|
+
return (t4) => t4.map(trim).join("");
|
|
4578
|
+
else if (spacing === "preserve")
|
|
4579
|
+
return (t4) => t4.join("\n");
|
|
4580
|
+
else
|
|
4581
|
+
return spacing;
|
|
4582
|
+
}
|
|
4583
|
+
__name(getJoiner, "getJoiner");
|
|
4584
|
+
|
|
4585
|
+
// ../../node_modules/comment-parser/es6/parser/tokenizers/name.js
|
|
4586
|
+
var isQuoted = /* @__PURE__ */ __name((s) => s && s.startsWith('"') && s.endsWith('"'), "isQuoted");
|
|
4587
|
+
function nameTokenizer() {
|
|
4588
|
+
const typeEnd = /* @__PURE__ */ __name((num, { tokens }, i) => tokens.type === "" ? num : i, "typeEnd");
|
|
4589
|
+
return (spec) => {
|
|
4590
|
+
const { tokens } = spec.source[spec.source.reduce(typeEnd, 0)];
|
|
4591
|
+
const source = tokens.description.trimLeft();
|
|
4592
|
+
const quotedGroups = source.split('"');
|
|
4593
|
+
if (quotedGroups.length > 1 && quotedGroups[0] === "" && quotedGroups.length % 2 === 1) {
|
|
4594
|
+
spec.name = quotedGroups[1];
|
|
4595
|
+
tokens.name = `"${quotedGroups[1]}"`;
|
|
4596
|
+
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
|
4597
|
+
return spec;
|
|
4598
|
+
}
|
|
4599
|
+
let brackets = 0;
|
|
4600
|
+
let name = "";
|
|
4601
|
+
let optional = false;
|
|
4602
|
+
let defaultValue;
|
|
4603
|
+
for (const ch of source) {
|
|
4604
|
+
if (brackets === 0 && isSpace(ch))
|
|
4605
|
+
break;
|
|
4606
|
+
if (ch === "[")
|
|
4607
|
+
brackets++;
|
|
4608
|
+
if (ch === "]")
|
|
4609
|
+
brackets--;
|
|
4610
|
+
name += ch;
|
|
4611
|
+
}
|
|
4612
|
+
if (brackets !== 0) {
|
|
4613
|
+
spec.problems.push({
|
|
4614
|
+
code: "spec:name:unpaired-brackets",
|
|
4615
|
+
message: "unpaired brackets",
|
|
4616
|
+
line: spec.source[0].number,
|
|
4617
|
+
critical: true
|
|
4618
|
+
});
|
|
4619
|
+
return spec;
|
|
4620
|
+
}
|
|
4621
|
+
const nameToken = name;
|
|
4622
|
+
if (name[0] === "[" && name[name.length - 1] === "]") {
|
|
4623
|
+
optional = true;
|
|
4624
|
+
name = name.slice(1, -1);
|
|
4625
|
+
const parts = name.split("=");
|
|
4626
|
+
name = parts[0].trim();
|
|
4627
|
+
if (parts[1] !== void 0)
|
|
4628
|
+
defaultValue = parts.slice(1).join("=").trim();
|
|
4629
|
+
if (name === "") {
|
|
4630
|
+
spec.problems.push({
|
|
4631
|
+
code: "spec:name:empty-name",
|
|
4632
|
+
message: "empty name",
|
|
4633
|
+
line: spec.source[0].number,
|
|
4634
|
+
critical: true
|
|
4635
|
+
});
|
|
4636
|
+
return spec;
|
|
4637
|
+
}
|
|
4638
|
+
if (defaultValue === "") {
|
|
4639
|
+
spec.problems.push({
|
|
4640
|
+
code: "spec:name:empty-default",
|
|
4641
|
+
message: "empty default value",
|
|
4642
|
+
line: spec.source[0].number,
|
|
4643
|
+
critical: true
|
|
4644
|
+
});
|
|
4645
|
+
return spec;
|
|
4646
|
+
}
|
|
4647
|
+
if (!isQuoted(defaultValue) && /=(?!>)/.test(defaultValue)) {
|
|
4648
|
+
spec.problems.push({
|
|
4649
|
+
code: "spec:name:invalid-default",
|
|
4650
|
+
message: "invalid default value syntax",
|
|
4651
|
+
line: spec.source[0].number,
|
|
4652
|
+
critical: true
|
|
4653
|
+
});
|
|
4654
|
+
return spec;
|
|
4655
|
+
}
|
|
4656
|
+
}
|
|
4657
|
+
spec.optional = optional;
|
|
4658
|
+
spec.name = name;
|
|
4659
|
+
tokens.name = nameToken;
|
|
4660
|
+
if (defaultValue !== void 0)
|
|
4661
|
+
spec.default = defaultValue;
|
|
4662
|
+
[tokens.postName, tokens.description] = splitSpace(source.slice(tokens.name.length));
|
|
4663
|
+
return spec;
|
|
4664
|
+
};
|
|
4665
|
+
}
|
|
4666
|
+
__name(nameTokenizer, "nameTokenizer");
|
|
4667
|
+
|
|
4668
|
+
// ../../node_modules/comment-parser/es6/parser/tokenizers/description.js
|
|
4669
|
+
function descriptionTokenizer(spacing = "compact", markers = Markers) {
|
|
4670
|
+
const join5 = getJoiner2(spacing);
|
|
4671
|
+
return (spec) => {
|
|
4672
|
+
spec.description = join5(spec.source, markers);
|
|
4673
|
+
return spec;
|
|
4674
|
+
};
|
|
4675
|
+
}
|
|
4676
|
+
__name(descriptionTokenizer, "descriptionTokenizer");
|
|
4677
|
+
function getJoiner2(spacing) {
|
|
4678
|
+
if (spacing === "compact")
|
|
4679
|
+
return compactJoiner;
|
|
4680
|
+
if (spacing === "preserve")
|
|
4681
|
+
return preserveJoiner;
|
|
4682
|
+
return spacing;
|
|
4683
|
+
}
|
|
4684
|
+
__name(getJoiner2, "getJoiner");
|
|
4685
|
+
function compactJoiner(lines, markers = Markers) {
|
|
4686
|
+
return lines.map(({ tokens: { description } }) => description.trim()).filter((description) => description !== "").join(" ");
|
|
4687
|
+
}
|
|
4688
|
+
__name(compactJoiner, "compactJoiner");
|
|
4689
|
+
var lineNo = /* @__PURE__ */ __name((num, { tokens }, i) => tokens.type === "" ? num : i, "lineNo");
|
|
4690
|
+
var getDescription = /* @__PURE__ */ __name(({ tokens }) => (tokens.delimiter === "" ? tokens.start : tokens.postDelimiter.slice(1)) + tokens.description, "getDescription");
|
|
4691
|
+
function preserveJoiner(lines, markers = Markers) {
|
|
4692
|
+
if (lines.length === 0)
|
|
4693
|
+
return "";
|
|
4694
|
+
if (lines[0].tokens.description === "" && lines[0].tokens.delimiter === markers.start)
|
|
4695
|
+
lines = lines.slice(1);
|
|
4696
|
+
const lastLine = lines[lines.length - 1];
|
|
4697
|
+
if (lastLine !== void 0 && lastLine.tokens.description === "" && lastLine.tokens.end.endsWith(markers.end))
|
|
4698
|
+
lines = lines.slice(0, -1);
|
|
4699
|
+
lines = lines.slice(lines.reduce(lineNo, 0));
|
|
4700
|
+
return lines.map(getDescription).join("\n");
|
|
4701
|
+
}
|
|
4702
|
+
__name(preserveJoiner, "preserveJoiner");
|
|
4703
|
+
|
|
4704
|
+
// ../../node_modules/comment-parser/es6/parser/index.js
|
|
4705
|
+
function getParser4({ startLine = 0, fence = "```", spacing = "compact", markers = Markers, tokenizers = [
|
|
4706
|
+
tagTokenizer(),
|
|
4707
|
+
typeTokenizer(spacing),
|
|
4708
|
+
nameTokenizer(),
|
|
4709
|
+
descriptionTokenizer(spacing)
|
|
4710
|
+
] } = {}) {
|
|
4711
|
+
if (startLine < 0 || startLine % 1 > 0)
|
|
4712
|
+
throw new Error("Invalid startLine");
|
|
4713
|
+
const parseSource = getParser2({ startLine, markers });
|
|
4714
|
+
const parseBlock = getParser({ fence });
|
|
4715
|
+
const parseSpec = getParser3({ tokenizers });
|
|
4716
|
+
const joinDescription = getJoiner2(spacing);
|
|
4717
|
+
return function(source) {
|
|
4718
|
+
const blocks = [];
|
|
4719
|
+
for (const line of splitLines(source)) {
|
|
4720
|
+
const lines = parseSource(line);
|
|
4721
|
+
if (lines === null)
|
|
4722
|
+
continue;
|
|
4723
|
+
const sections = parseBlock(lines);
|
|
4724
|
+
const specs = sections.slice(1).map(parseSpec);
|
|
4725
|
+
blocks.push({
|
|
4726
|
+
description: joinDescription(sections[0], markers),
|
|
4727
|
+
tags: specs,
|
|
4728
|
+
source: lines,
|
|
4729
|
+
problems: specs.reduce((acc, spec) => acc.concat(spec.problems), [])
|
|
4730
|
+
});
|
|
4731
|
+
}
|
|
4732
|
+
return blocks;
|
|
4733
|
+
};
|
|
4734
|
+
}
|
|
4735
|
+
__name(getParser4, "getParser");
|
|
4736
|
+
|
|
4737
|
+
// ../../node_modules/comment-parser/es6/stringifier/index.js
|
|
4738
|
+
function join2(tokens) {
|
|
4739
|
+
return tokens.start + tokens.delimiter + tokens.postDelimiter + tokens.tag + tokens.postTag + tokens.type + tokens.postType + tokens.name + tokens.postName + tokens.description + tokens.end + tokens.lineEnd;
|
|
4740
|
+
}
|
|
4741
|
+
__name(join2, "join");
|
|
4742
|
+
function getStringifier() {
|
|
4743
|
+
return (block) => block.source.map(({ tokens }) => join2(tokens)).join("\n");
|
|
4744
|
+
}
|
|
4745
|
+
__name(getStringifier, "getStringifier");
|
|
4746
|
+
|
|
4747
|
+
// ../../node_modules/comment-parser/es6/stringifier/inspect.js
|
|
4748
|
+
var zeroWidth = {
|
|
4749
|
+
line: 0,
|
|
4750
|
+
start: 0,
|
|
4751
|
+
delimiter: 0,
|
|
4752
|
+
postDelimiter: 0,
|
|
4753
|
+
tag: 0,
|
|
4754
|
+
postTag: 0,
|
|
4755
|
+
name: 0,
|
|
4756
|
+
postName: 0,
|
|
4757
|
+
type: 0,
|
|
4758
|
+
postType: 0,
|
|
4759
|
+
description: 0,
|
|
4760
|
+
end: 0,
|
|
4761
|
+
lineEnd: 0
|
|
4762
|
+
};
|
|
4763
|
+
var fields = Object.keys(zeroWidth);
|
|
4764
|
+
|
|
4765
|
+
// ../../node_modules/comment-parser/es6/index.js
|
|
4766
|
+
function parse2(source, options = {}) {
|
|
4767
|
+
return getParser4(options)(source);
|
|
4768
|
+
}
|
|
4769
|
+
__name(parse2, "parse");
|
|
4770
|
+
var stringify = getStringifier();
|
|
4771
|
+
|
|
4772
|
+
// src/componentManifest/jsdocTags.ts
|
|
4773
|
+
function extractJSDocInfo(jsdocComment) {
|
|
4774
|
+
const lines = jsdocComment.split("\n");
|
|
4775
|
+
const jsDoc = ["/**", ...lines.map((line) => ` * ${line}`), " */"].join("\n");
|
|
4776
|
+
const parsed = parse2(jsDoc);
|
|
4777
|
+
return {
|
|
4778
|
+
description: parsed[0].description,
|
|
4779
|
+
tags: Object.fromEntries(
|
|
4780
|
+
Object.entries(groupBy(parsed[0].tags, (it) => it.tag)).map(([key, tags]) => [
|
|
4781
|
+
key,
|
|
4782
|
+
tags?.map((tag) => (tag.type ? `{${tag.type}} ` : "") + `${tag.name} ${tag.description}`) ?? []
|
|
4783
|
+
])
|
|
4784
|
+
)
|
|
4785
|
+
};
|
|
4786
|
+
}
|
|
4787
|
+
__name(extractJSDocInfo, "extractJSDocInfo");
|
|
4788
|
+
|
|
4789
|
+
// src/componentManifest/reactDocgen.ts
|
|
4790
|
+
import { existsSync as existsSync2 } from "node:fs";
|
|
4791
|
+
import { sep as sep2 } from "node:path";
|
|
4792
|
+
import { types as t2 } from "storybook/internal/babel";
|
|
4793
|
+
import { getProjectRoot } from "storybook/internal/common";
|
|
4794
|
+
import { supportedExtensions as supportedExtensions2 } from "storybook/internal/common";
|
|
4795
|
+
import { resolveImport } from "storybook/internal/common";
|
|
4796
|
+
|
|
4797
|
+
// ../../node_modules/empathic/find.mjs
|
|
4798
|
+
import { join as join4 } from "node:path";
|
|
4799
|
+
import { existsSync, statSync } from "node:fs";
|
|
4800
|
+
|
|
4801
|
+
// ../../node_modules/empathic/walk.mjs
|
|
4802
|
+
import { dirname as dirname2 } from "node:path";
|
|
4803
|
+
|
|
4804
|
+
// ../../node_modules/empathic/resolve.mjs
|
|
4805
|
+
import { isAbsolute as isAbsolute2, join as join3, resolve as resolve2 } from "node:path";
|
|
4806
|
+
function absolute(input, root) {
|
|
4807
|
+
return isAbsolute2(input) ? input : resolve2(root || ".", input);
|
|
4808
|
+
}
|
|
4809
|
+
__name(absolute, "absolute");
|
|
4810
|
+
|
|
4811
|
+
// ../../node_modules/empathic/walk.mjs
|
|
4812
|
+
function up(base, options) {
|
|
4813
|
+
let { last, cwd: cwd2 } = options || {};
|
|
4814
|
+
let tmp = absolute(base, cwd2);
|
|
4815
|
+
let root = absolute(last || "/", cwd2);
|
|
4816
|
+
let prev, arr = [];
|
|
4817
|
+
while (prev !== root) {
|
|
4818
|
+
arr.push(tmp);
|
|
4819
|
+
tmp = dirname2(prev = tmp);
|
|
4820
|
+
if (tmp === prev) break;
|
|
4821
|
+
}
|
|
4822
|
+
return arr;
|
|
4823
|
+
}
|
|
4824
|
+
__name(up, "up");
|
|
4825
|
+
|
|
4826
|
+
// ../../node_modules/empathic/find.mjs
|
|
4827
|
+
function up2(name, options) {
|
|
4828
|
+
let dir, tmp;
|
|
4829
|
+
let start = options && options.cwd || "";
|
|
4830
|
+
for (dir of up(start, options)) {
|
|
4831
|
+
tmp = join4(dir, name);
|
|
4832
|
+
if (existsSync(tmp)) return tmp;
|
|
4833
|
+
}
|
|
4834
|
+
}
|
|
4835
|
+
__name(up2, "up");
|
|
4836
|
+
|
|
4837
|
+
// src/componentManifest/reactDocgen.ts
|
|
4838
|
+
var TsconfigPaths = __toESM(require_lib2(), 1);
|
|
4839
|
+
import { ERROR_CODES } from "react-docgen";
|
|
4840
|
+
import {
|
|
4841
|
+
builtinHandlers as docgenHandlers,
|
|
4842
|
+
builtinResolvers as docgenResolver,
|
|
4843
|
+
makeFsImporter,
|
|
4844
|
+
parse as parse3
|
|
4845
|
+
} from "react-docgen";
|
|
4846
|
+
|
|
4847
|
+
// src/componentManifest/reactDocgen/actualNameHandler.ts
|
|
4848
|
+
import { utils } from "react-docgen";
|
|
4849
|
+
var { getNameOrValue, isReactForwardRefCall } = utils;
|
|
4850
|
+
var actualNameHandler = /* @__PURE__ */ __name(function actualNameHandler2(documentation, componentDefinition) {
|
|
4851
|
+
documentation.set("definedInFile", componentDefinition.hub.file.opts.filename);
|
|
4852
|
+
if ((componentDefinition.isClassDeclaration() || componentDefinition.isFunctionDeclaration()) && componentDefinition.has("id")) {
|
|
4853
|
+
documentation.set(
|
|
4854
|
+
"actualName",
|
|
4855
|
+
getNameOrValue(componentDefinition.get("id"))
|
|
4856
|
+
);
|
|
4857
|
+
} else if (componentDefinition.isArrowFunctionExpression() || componentDefinition.isFunctionExpression() || isReactForwardRefCall(componentDefinition)) {
|
|
4858
|
+
let currentPath = componentDefinition;
|
|
4859
|
+
while (currentPath.parentPath) {
|
|
4860
|
+
if (currentPath.parentPath.isVariableDeclarator()) {
|
|
4861
|
+
documentation.set("actualName", getNameOrValue(currentPath.parentPath.get("id")));
|
|
4862
|
+
return;
|
|
4863
|
+
}
|
|
4864
|
+
if (currentPath.parentPath.isAssignmentExpression()) {
|
|
4865
|
+
const leftPath = currentPath.parentPath.get("left");
|
|
4866
|
+
if (leftPath.isIdentifier() || leftPath.isLiteral()) {
|
|
4867
|
+
documentation.set("actualName", getNameOrValue(leftPath));
|
|
4868
|
+
return;
|
|
4869
|
+
}
|
|
4870
|
+
}
|
|
4871
|
+
currentPath = currentPath.parentPath;
|
|
4872
|
+
}
|
|
4873
|
+
documentation.set("actualName", "");
|
|
4874
|
+
}
|
|
4875
|
+
}, "actualNameHandler");
|
|
4876
|
+
var actualNameHandler_default = actualNameHandler;
|
|
4877
|
+
|
|
4878
|
+
// src/componentManifest/reactDocgen/docgenResolver.ts
|
|
4879
|
+
var import_resolve2 = __toESM(require_resolve(), 1);
|
|
4880
|
+
import { supportedExtensions } from "storybook/internal/common";
|
|
4881
|
+
var ReactDocgenResolveError = class extends Error {
|
|
4882
|
+
constructor(filename) {
|
|
4883
|
+
super(`'${filename}' was ignored by react-docgen.`);
|
|
4884
|
+
// the magic string that react-docgen uses to check if a module is ignored
|
|
4885
|
+
this.code = "MODULE_NOT_FOUND";
|
|
4886
|
+
}
|
|
4887
|
+
static {
|
|
4888
|
+
__name(this, "ReactDocgenResolveError");
|
|
4889
|
+
}
|
|
4890
|
+
};
|
|
4891
|
+
|
|
4892
|
+
// src/componentManifest/reactDocgen/exportNameHandler.ts
|
|
4893
|
+
import { utils as utils2 } from "react-docgen";
|
|
4894
|
+
var { isReactForwardRefCall: isReactForwardRefCall2 } = utils2;
|
|
4895
|
+
function nameFromId(path2) {
|
|
4896
|
+
if (!path2) {
|
|
4897
|
+
return void 0;
|
|
4898
|
+
}
|
|
4899
|
+
if (path2.isIdentifier()) {
|
|
4900
|
+
return path2.node.name;
|
|
4901
|
+
}
|
|
4902
|
+
if (path2.isStringLiteral()) {
|
|
4903
|
+
return path2.node.value;
|
|
4904
|
+
}
|
|
4905
|
+
return void 0;
|
|
4906
|
+
}
|
|
4907
|
+
__name(nameFromId, "nameFromId");
|
|
4908
|
+
function isInlineDefaultExport(path2) {
|
|
4909
|
+
let p = path2;
|
|
4910
|
+
while (p && p.parentPath) {
|
|
4911
|
+
if (p.parentPath.isExportDefaultDeclaration()) {
|
|
4912
|
+
return true;
|
|
4913
|
+
}
|
|
4914
|
+
p = p.parentPath;
|
|
4915
|
+
}
|
|
4916
|
+
return false;
|
|
4917
|
+
}
|
|
4918
|
+
__name(isInlineDefaultExport, "isInlineDefaultExport");
|
|
4919
|
+
function findProgram(path2) {
|
|
4920
|
+
const found = path2.findParent((p) => p.isProgram());
|
|
4921
|
+
return found && found.isProgram() ? found : void 0;
|
|
4922
|
+
}
|
|
4923
|
+
__name(findProgram, "findProgram");
|
|
4924
|
+
function getLocalName(componentDefinition, fallback) {
|
|
4925
|
+
if (fallback) {
|
|
4926
|
+
return fallback;
|
|
4927
|
+
}
|
|
4928
|
+
if ((componentDefinition.isClassDeclaration() || componentDefinition.isFunctionDeclaration()) && componentDefinition.has("id")) {
|
|
4929
|
+
const idPath = componentDefinition.get("id");
|
|
4930
|
+
return nameFromId(idPath);
|
|
4931
|
+
}
|
|
4932
|
+
if (componentDefinition.isArrowFunctionExpression() || componentDefinition.isFunctionExpression() || isReactForwardRefCall2(componentDefinition)) {
|
|
4933
|
+
let p = componentDefinition;
|
|
4934
|
+
while (p && p.parentPath) {
|
|
4935
|
+
if (p.parentPath.isVariableDeclarator()) {
|
|
4936
|
+
const id = p.parentPath.get("id");
|
|
4937
|
+
return nameFromId(id);
|
|
4938
|
+
}
|
|
4939
|
+
if (p.parentPath.isAssignmentExpression()) {
|
|
4940
|
+
const left = p.parentPath.get("left");
|
|
4941
|
+
const lhs = nameFromId(left);
|
|
4942
|
+
if (lhs) {
|
|
4943
|
+
return lhs;
|
|
4944
|
+
}
|
|
4945
|
+
}
|
|
4946
|
+
p = p.parentPath;
|
|
4947
|
+
}
|
|
4948
|
+
}
|
|
4949
|
+
return void 0;
|
|
4950
|
+
}
|
|
4951
|
+
__name(getLocalName, "getLocalName");
|
|
4952
|
+
var exportNameHandler = /* @__PURE__ */ __name((documentation, componentDefinition) => {
|
|
4953
|
+
if (isInlineDefaultExport(componentDefinition)) {
|
|
4954
|
+
documentation.set("exportName", "default");
|
|
4955
|
+
return;
|
|
4956
|
+
}
|
|
4957
|
+
const actual = documentation.get("actualName");
|
|
4958
|
+
const actualName = typeof actual === "string" ? actual : void 0;
|
|
4959
|
+
const localName = getLocalName(componentDefinition, actualName);
|
|
4960
|
+
const programPath = findProgram(componentDefinition);
|
|
4961
|
+
if (!programPath) {
|
|
4962
|
+
documentation.set("exportName", void 0);
|
|
4963
|
+
return;
|
|
4964
|
+
}
|
|
4965
|
+
const body = programPath.get("body");
|
|
4966
|
+
for (const stmt of body) {
|
|
4967
|
+
if (stmt.isExportNamedDeclaration() && stmt.has("declaration")) {
|
|
4968
|
+
const decl = stmt.get("declaration");
|
|
4969
|
+
if (decl.isFunctionDeclaration() || decl.isClassDeclaration()) {
|
|
4970
|
+
const name = nameFromId(decl.get("id"));
|
|
4971
|
+
if (name && name === localName) {
|
|
4972
|
+
documentation.set("exportName", name);
|
|
4973
|
+
return;
|
|
4974
|
+
}
|
|
4975
|
+
}
|
|
4976
|
+
if (decl.isVariableDeclaration()) {
|
|
4977
|
+
const decls = decl.get("declarations");
|
|
4978
|
+
for (const d of decls) {
|
|
4979
|
+
if (d.isVariableDeclarator()) {
|
|
4980
|
+
const id = d.get("id");
|
|
4981
|
+
if (id.isIdentifier() && id.node.name === localName) {
|
|
4982
|
+
documentation.set("exportName", localName);
|
|
4983
|
+
return;
|
|
4984
|
+
}
|
|
4985
|
+
}
|
|
4986
|
+
}
|
|
4987
|
+
}
|
|
4988
|
+
}
|
|
4989
|
+
if (stmt.isExportNamedDeclaration() && stmt.has("specifiers")) {
|
|
4990
|
+
const specs = stmt.get("specifiers");
|
|
4991
|
+
for (const s of specs) {
|
|
4992
|
+
if (s.isExportSpecifier()) {
|
|
4993
|
+
const local = nameFromId(s.get("local"));
|
|
4994
|
+
const exported = nameFromId(s.get("exported"));
|
|
4995
|
+
if (local && local === localName) {
|
|
4996
|
+
documentation.set(
|
|
4997
|
+
"exportName",
|
|
4998
|
+
exported === "default" ? "default" : exported ?? local
|
|
4999
|
+
);
|
|
5000
|
+
return;
|
|
5001
|
+
}
|
|
5002
|
+
}
|
|
5003
|
+
}
|
|
5004
|
+
}
|
|
5005
|
+
if (stmt.isExportDefaultDeclaration()) {
|
|
5006
|
+
const decl = stmt.get("declaration");
|
|
5007
|
+
if (decl.isIdentifier() && decl.node.name === localName) {
|
|
5008
|
+
documentation.set("exportName", "default");
|
|
5009
|
+
return;
|
|
5010
|
+
}
|
|
5011
|
+
}
|
|
5012
|
+
}
|
|
5013
|
+
documentation.set("exportName", void 0);
|
|
5014
|
+
}, "exportNameHandler");
|
|
5015
|
+
var exportNameHandler_default = exportNameHandler;
|
|
5016
|
+
|
|
5017
|
+
// src/componentManifest/reactDocgen.ts
|
|
5018
|
+
var defaultHandlers = Object.values(docgenHandlers).map((handler) => handler);
|
|
5019
|
+
var defaultResolver = new docgenResolver.FindExportedDefinitionsResolver();
|
|
5020
|
+
var handlers = [...defaultHandlers, actualNameHandler_default, exportNameHandler_default];
|
|
5021
|
+
function getMatchingDocgen(docgens, csf) {
|
|
5022
|
+
const componentName = csf._meta?.component;
|
|
5023
|
+
if (docgens.length === 1) {
|
|
5024
|
+
return docgens[0];
|
|
5025
|
+
}
|
|
5026
|
+
const importSpecifier = csf._componentImportSpecifier;
|
|
5027
|
+
let importName;
|
|
5028
|
+
if (t2.isImportSpecifier(importSpecifier)) {
|
|
5029
|
+
const imported = importSpecifier.imported;
|
|
5030
|
+
importName = t2.isIdentifier(imported) ? imported.name : imported.value;
|
|
5031
|
+
} else if (t2.isImportDefaultSpecifier(importSpecifier)) {
|
|
5032
|
+
importName = "default";
|
|
5033
|
+
}
|
|
5034
|
+
const docgen = docgens.find((docgen2) => docgen2.exportName === importName);
|
|
5035
|
+
if (docgen || !componentName) {
|
|
5036
|
+
return docgen;
|
|
5037
|
+
}
|
|
5038
|
+
return docgens.find(
|
|
5039
|
+
(docgen2) => docgen2.displayName === componentName || docgen2.actualName === componentName
|
|
5040
|
+
);
|
|
5041
|
+
}
|
|
5042
|
+
__name(getMatchingDocgen, "getMatchingDocgen");
|
|
5043
|
+
async function parseWithReactDocgen({ code, filename }) {
|
|
5044
|
+
const tsconfigPath = up2("tsconfig.json", { cwd: process.cwd(), last: getProjectRoot() });
|
|
5045
|
+
const tsconfig = TsconfigPaths.loadConfig(tsconfigPath);
|
|
5046
|
+
let matchPath;
|
|
5047
|
+
if (tsconfig.resultType === "success") {
|
|
5048
|
+
matchPath = TsconfigPaths.createMatchPath(tsconfig.absoluteBaseUrl, tsconfig.paths, [
|
|
5049
|
+
"browser",
|
|
5050
|
+
"module",
|
|
5051
|
+
"main"
|
|
5052
|
+
]);
|
|
5053
|
+
}
|
|
5054
|
+
try {
|
|
5055
|
+
return parse3(code, {
|
|
5056
|
+
resolver: defaultResolver,
|
|
5057
|
+
handlers,
|
|
5058
|
+
importer: getReactDocgenImporter(matchPath),
|
|
5059
|
+
filename
|
|
5060
|
+
});
|
|
5061
|
+
} catch (e) {
|
|
5062
|
+
if (!(e instanceof Error && "code" in e && e.code === ERROR_CODES.MISSING_DEFINITION)) {
|
|
5063
|
+
console.error(e);
|
|
5064
|
+
}
|
|
5065
|
+
return [];
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
__name(parseWithReactDocgen, "parseWithReactDocgen");
|
|
5069
|
+
function getReactDocgenImporter(matchPath) {
|
|
5070
|
+
return makeFsImporter((filename, basedir) => {
|
|
5071
|
+
const mappedFilenameByPaths = (() => {
|
|
5072
|
+
if (matchPath) {
|
|
5073
|
+
const match = matchPath(filename, void 0, void 0, supportedExtensions2);
|
|
5074
|
+
return match || filename;
|
|
5075
|
+
} else {
|
|
5076
|
+
return filename;
|
|
5077
|
+
}
|
|
5078
|
+
})();
|
|
5079
|
+
const result = resolveImport(mappedFilenameByPaths, { basedir });
|
|
5080
|
+
if (result.includes(`${sep2}react-native${sep2}index.js`)) {
|
|
5081
|
+
const replaced = result.replace(
|
|
5082
|
+
`${sep2}react-native${sep2}index.js`,
|
|
5083
|
+
`${sep2}react-native-web${sep2}dist${sep2}index.js`
|
|
5084
|
+
);
|
|
5085
|
+
if (existsSync2(replaced)) {
|
|
5086
|
+
if (supportedExtensions2.find((ext) => result.endsWith(ext))) {
|
|
5087
|
+
return replaced;
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
5090
|
+
}
|
|
5091
|
+
if (supportedExtensions2.find((ext) => result.endsWith(ext))) {
|
|
5092
|
+
return result;
|
|
5093
|
+
}
|
|
5094
|
+
throw new ReactDocgenResolveError(filename);
|
|
5095
|
+
});
|
|
5096
|
+
}
|
|
5097
|
+
__name(getReactDocgenImporter, "getReactDocgenImporter");
|
|
5098
|
+
|
|
5099
|
+
// src/componentManifest/generator.ts
|
|
5100
|
+
var componentManifestGenerator = /* @__PURE__ */ __name(async () => {
|
|
5101
|
+
return async (storyIndexGenerator) => {
|
|
5102
|
+
const index = await storyIndexGenerator.getIndex();
|
|
5103
|
+
const groupByComponentId = groupBy(
|
|
5104
|
+
Object.values(index.entries).filter((entry) => entry.type === "story").filter((entry) => entry.subtype === "story"),
|
|
5105
|
+
(it) => it.id.split("--")[0]
|
|
5106
|
+
);
|
|
5107
|
+
const singleEntryPerComponent = Object.values(groupByComponentId).flatMap(
|
|
5108
|
+
(group) => group && group?.length > 0 ? [group[0]] : []
|
|
5109
|
+
);
|
|
5110
|
+
const components = await Promise.all(
|
|
5111
|
+
singleEntryPerComponent.flatMap(async (entry) => {
|
|
5112
|
+
const storyFile = await readFile(path.join(process.cwd(), entry.importPath), "utf-8");
|
|
5113
|
+
const csf = loadCsf(storyFile, { makeTitle: /* @__PURE__ */ __name((title) => title ?? "No title", "makeTitle") }).parse();
|
|
5114
|
+
const name = csf._meta?.component ?? entry.title.split("/").at(-1);
|
|
5115
|
+
const id = entry.id.split("--")[0];
|
|
5116
|
+
const importPath = entry.importPath;
|
|
5117
|
+
const examples = Object.keys(csf._stories).map((storyName) => {
|
|
5118
|
+
try {
|
|
5119
|
+
return {
|
|
5120
|
+
name: storyName,
|
|
5121
|
+
snippet: recast.print(getCodeSnippet(csf, storyName, name)).code
|
|
5122
|
+
};
|
|
5123
|
+
} catch (e) {
|
|
5124
|
+
invariant(e instanceof Error);
|
|
5125
|
+
return {
|
|
5126
|
+
name: storyName,
|
|
5127
|
+
error: {
|
|
5128
|
+
name: e.name,
|
|
5129
|
+
message: e.message
|
|
5130
|
+
}
|
|
5131
|
+
};
|
|
5132
|
+
}
|
|
5133
|
+
}).filter(Boolean);
|
|
5134
|
+
const base = {
|
|
5135
|
+
id,
|
|
5136
|
+
name,
|
|
5137
|
+
path: importPath,
|
|
5138
|
+
examples,
|
|
5139
|
+
jsDocTags: {}
|
|
5140
|
+
};
|
|
5141
|
+
if (!entry.componentPath) {
|
|
5142
|
+
const componentName = csf._meta?.component;
|
|
5143
|
+
const error2 = !componentName ? {
|
|
5144
|
+
name: "No meta.component specified",
|
|
5145
|
+
message: "Specify meta.component for the component to be included in the manifest."
|
|
5146
|
+
} : {
|
|
5147
|
+
name: "No component import found",
|
|
5148
|
+
message: `No component file found for the "${componentName}" component.`
|
|
5149
|
+
};
|
|
5150
|
+
return {
|
|
5151
|
+
...base,
|
|
5152
|
+
name,
|
|
5153
|
+
examples,
|
|
5154
|
+
error: {
|
|
5155
|
+
name: error2.name,
|
|
5156
|
+
message: csf._metaStatementPath?.buildCodeFrameError(error2.message).message ?? error2.message
|
|
5157
|
+
}
|
|
5158
|
+
};
|
|
5159
|
+
}
|
|
5160
|
+
let componentFile;
|
|
5161
|
+
try {
|
|
5162
|
+
componentFile = await readFile(path.join(process.cwd(), entry.componentPath), "utf-8");
|
|
5163
|
+
} catch (e) {
|
|
5164
|
+
invariant(e instanceof Error);
|
|
5165
|
+
return {
|
|
5166
|
+
...base,
|
|
5167
|
+
name,
|
|
5168
|
+
examples,
|
|
5169
|
+
error: {
|
|
5170
|
+
name: "Component file could not be read",
|
|
5171
|
+
message: `Could not read the component file located at "${entry.componentPath}".
|
|
5172
|
+
Prefer relative imports.`
|
|
5173
|
+
}
|
|
5174
|
+
};
|
|
5175
|
+
}
|
|
5176
|
+
const docgens = await parseWithReactDocgen({
|
|
5177
|
+
code: componentFile,
|
|
5178
|
+
filename: path.join(process.cwd(), entry.componentPath)
|
|
5179
|
+
});
|
|
5180
|
+
const docgen = getMatchingDocgen(docgens, csf);
|
|
5181
|
+
const error = !docgen ? {
|
|
5182
|
+
name: "Docgen evaluation failed",
|
|
5183
|
+
message: `Could not parse props information for the component file located at "${entry.componentPath}"
|
|
5184
|
+
Avoid barrel files when importing your component file.
|
|
5185
|
+
Prefer relative imports if possible.
|
|
5186
|
+
Avoid pointing to transpiled files.
|
|
5187
|
+
You can debug your component file in this playground: https://react-docgen.dev/playground`
|
|
5188
|
+
} : void 0;
|
|
5189
|
+
const metaDescription = extractDescription(csf._metaStatement);
|
|
5190
|
+
const jsdocComment = metaDescription || docgen?.description;
|
|
5191
|
+
const { tags = {}, description } = jsdocComment ? extractJSDocInfo(jsdocComment) : {};
|
|
5192
|
+
const manifestDescription = (tags?.describe?.[0] || tags?.desc?.[0]) ?? description;
|
|
5193
|
+
return {
|
|
5194
|
+
...base,
|
|
5195
|
+
name,
|
|
5196
|
+
description: manifestDescription?.trim(),
|
|
5197
|
+
summary: tags.summary?.[0],
|
|
5198
|
+
import: tags.import?.[0],
|
|
5199
|
+
reactDocgen: docgen,
|
|
5200
|
+
jsDocTags: tags,
|
|
5201
|
+
examples,
|
|
5202
|
+
error
|
|
5203
|
+
};
|
|
5204
|
+
})
|
|
5205
|
+
);
|
|
5206
|
+
return {
|
|
5207
|
+
v: 0,
|
|
5208
|
+
components: Object.fromEntries(
|
|
5209
|
+
components.filter((component) => component != null).map((component) => [component.id, component])
|
|
5210
|
+
)
|
|
5211
|
+
};
|
|
5212
|
+
};
|
|
5213
|
+
}, "componentManifestGenerator");
|
|
5214
|
+
|
|
5215
|
+
// src/enrichCsf.ts
|
|
5216
|
+
import { recast as recast2, types as t3 } from "storybook/internal/babel";
|
|
5217
|
+
import { getPrettier } from "storybook/internal/common";
|
|
5218
|
+
var enrichCsf = /* @__PURE__ */ __name(async (input, options) => {
|
|
5219
|
+
const features = await options.presets.apply("features");
|
|
5220
|
+
if (!features.experimentalCodeExamples) {
|
|
5221
|
+
return;
|
|
5222
|
+
}
|
|
5223
|
+
return async (csf, csfSource) => {
|
|
5224
|
+
const promises = Object.keys(csf._stories).map(async (key) => {
|
|
5225
|
+
if (!csfSource._meta?.component) {
|
|
5226
|
+
return;
|
|
5227
|
+
}
|
|
5228
|
+
const { format: format3 } = await getPrettier();
|
|
5229
|
+
let node;
|
|
5230
|
+
let snippet;
|
|
5231
|
+
try {
|
|
5232
|
+
node = getCodeSnippet(csfSource, key, csfSource._meta?.component);
|
|
5233
|
+
} catch (e) {
|
|
5234
|
+
if (!(e instanceof Error)) {
|
|
5235
|
+
return;
|
|
5236
|
+
}
|
|
5237
|
+
snippet = e.message;
|
|
5238
|
+
}
|
|
5239
|
+
try {
|
|
5240
|
+
if (!snippet && node) {
|
|
5241
|
+
snippet = await format3(recast2.print(node).code, {
|
|
5242
|
+
filepath: join(process.cwd(), "component.tsx")
|
|
5243
|
+
});
|
|
5244
|
+
}
|
|
5245
|
+
} catch (e) {
|
|
5246
|
+
if (!(e instanceof Error)) {
|
|
5247
|
+
return;
|
|
5248
|
+
}
|
|
5249
|
+
snippet = e.message;
|
|
5250
|
+
}
|
|
5251
|
+
if (!snippet) {
|
|
5252
|
+
return;
|
|
5253
|
+
}
|
|
5254
|
+
const originalParameters = t3.memberExpression(
|
|
5255
|
+
csf._metaIsFactory ? t3.memberExpression(t3.identifier(key), t3.identifier("input")) : t3.identifier(key),
|
|
5256
|
+
t3.identifier("parameters")
|
|
5257
|
+
);
|
|
5258
|
+
const docsParameter = t3.optionalMemberExpression(
|
|
5259
|
+
originalParameters,
|
|
5260
|
+
t3.identifier("docs"),
|
|
5261
|
+
false,
|
|
5262
|
+
true
|
|
5263
|
+
);
|
|
5264
|
+
csf._ast.program.body.push(
|
|
5265
|
+
t3.expressionStatement(
|
|
5266
|
+
t3.assignmentExpression(
|
|
5267
|
+
"=",
|
|
5268
|
+
originalParameters,
|
|
5269
|
+
t3.objectExpression([
|
|
5270
|
+
t3.spreadElement(originalParameters),
|
|
5271
|
+
t3.objectProperty(
|
|
5272
|
+
t3.identifier("docs"),
|
|
5273
|
+
t3.objectExpression([
|
|
5274
|
+
t3.spreadElement(docsParameter),
|
|
5275
|
+
t3.objectProperty(
|
|
5276
|
+
t3.identifier("source"),
|
|
5277
|
+
t3.objectExpression([
|
|
5278
|
+
t3.objectProperty(t3.identifier("code"), t3.stringLiteral(snippet)),
|
|
5279
|
+
t3.spreadElement(
|
|
5280
|
+
t3.optionalMemberExpression(
|
|
5281
|
+
docsParameter,
|
|
5282
|
+
t3.identifier("source"),
|
|
5283
|
+
false,
|
|
5284
|
+
true
|
|
5285
|
+
)
|
|
5286
|
+
)
|
|
5287
|
+
])
|
|
5288
|
+
)
|
|
5289
|
+
])
|
|
5290
|
+
)
|
|
5291
|
+
])
|
|
5292
|
+
)
|
|
5293
|
+
)
|
|
5294
|
+
);
|
|
5295
|
+
});
|
|
5296
|
+
await Promise.all(promises);
|
|
5297
|
+
};
|
|
5298
|
+
}, "enrichCsf");
|
|
5299
|
+
|
|
475
5300
|
// src/preset.ts
|
|
476
5301
|
var addons = [
|
|
477
5302
|
import.meta.resolve("@storybook/react-dom-shim/preset")
|
|
@@ -506,6 +5331,8 @@ var resolvedReact = /* @__PURE__ */ __name(async (existing) => {
|
|
|
506
5331
|
}, "resolvedReact");
|
|
507
5332
|
export {
|
|
508
5333
|
addons,
|
|
5334
|
+
componentManifestGenerator as experimental_componentManifestGenerator,
|
|
5335
|
+
enrichCsf as experimental_enrichCsf,
|
|
509
5336
|
previewAnnotations,
|
|
510
5337
|
resolvedReact
|
|
511
5338
|
};
|