@storybook/nextjs-vite 10.0.0-beta.10 → 10.0.0-beta.12
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/_node-chunks/{chunk-LG7YCXAD.js → chunk-EJYBCWE7.js} +6 -6
- package/dist/_node-chunks/{dist-MMISEYOA.js → dist-SNJHMWZO.js} +7 -7
- package/dist/_node-chunks/{jiti-BSWDZS5T.js → jiti-43IRZTPX.js} +7 -7
- package/dist/node/index.js +7 -7
- package/dist/preset.js +1704 -1625
- package/dist/vite-plugin/index.js +7 -7
- package/package.json +6 -5
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_so6gtdx40fk from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_so6gtdx40fk from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_so6gtdx40fk from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_so6gtdx40fk.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_so6gtdx40fk.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_so6gtdx40fk.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,652 +14,7 @@ import {
|
|
|
14
14
|
__name,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
18
|
-
|
|
19
|
-
// ../../node_modules/postcss-load-config/node_modules/lilconfig/src/index.js
|
|
20
|
-
var require_src = __commonJS({
|
|
21
|
-
"../../node_modules/postcss-load-config/node_modules/lilconfig/src/index.js"(exports, module) {
|
|
22
|
-
var path2 = __require("path");
|
|
23
|
-
var fs = __require("fs");
|
|
24
|
-
var os = __require("os");
|
|
25
|
-
var url = __require("url");
|
|
26
|
-
var fsReadFileAsync = fs.promises.readFile;
|
|
27
|
-
function getDefaultSearchPlaces(name, sync) {
|
|
28
|
-
return [
|
|
29
|
-
"package.json",
|
|
30
|
-
`.${name}rc.json`,
|
|
31
|
-
`.${name}rc.js`,
|
|
32
|
-
`.${name}rc.cjs`,
|
|
33
|
-
...sync ? [] : [`.${name}rc.mjs`],
|
|
34
|
-
`.config/${name}rc`,
|
|
35
|
-
`.config/${name}rc.json`,
|
|
36
|
-
`.config/${name}rc.js`,
|
|
37
|
-
`.config/${name}rc.cjs`,
|
|
38
|
-
...sync ? [] : [`.config/${name}rc.mjs`],
|
|
39
|
-
`${name}.config.js`,
|
|
40
|
-
`${name}.config.cjs`,
|
|
41
|
-
...sync ? [] : [`${name}.config.mjs`]
|
|
42
|
-
];
|
|
43
|
-
}
|
|
44
|
-
__name(getDefaultSearchPlaces, "getDefaultSearchPlaces");
|
|
45
|
-
function parentDir(p) {
|
|
46
|
-
return path2.dirname(p) || path2.sep;
|
|
47
|
-
}
|
|
48
|
-
__name(parentDir, "parentDir");
|
|
49
|
-
var jsonLoader = /* @__PURE__ */ __name((_, content) => JSON.parse(content), "jsonLoader");
|
|
50
|
-
var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
51
|
-
var defaultLoadersSync = Object.freeze({
|
|
52
|
-
".js": requireFunc,
|
|
53
|
-
".json": requireFunc,
|
|
54
|
-
".cjs": requireFunc,
|
|
55
|
-
noExt: jsonLoader
|
|
56
|
-
});
|
|
57
|
-
module.exports.defaultLoadersSync = defaultLoadersSync;
|
|
58
|
-
var dynamicImport = /* @__PURE__ */ __name(async (id) => {
|
|
59
|
-
try {
|
|
60
|
-
const fileUrl = url.pathToFileURL(id).href;
|
|
61
|
-
const mod = await import(
|
|
62
|
-
/* webpackIgnore: true */
|
|
63
|
-
fileUrl
|
|
64
|
-
);
|
|
65
|
-
return mod.default;
|
|
66
|
-
} catch (e) {
|
|
67
|
-
try {
|
|
68
|
-
return requireFunc(id);
|
|
69
|
-
} catch (requireE) {
|
|
70
|
-
if (requireE.code === "ERR_REQUIRE_ESM" || requireE instanceof SyntaxError && requireE.toString().includes("Cannot use import statement outside a module")) {
|
|
71
|
-
throw e;
|
|
72
|
-
}
|
|
73
|
-
throw requireE;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}, "dynamicImport");
|
|
77
|
-
var defaultLoaders = Object.freeze({
|
|
78
|
-
".js": dynamicImport,
|
|
79
|
-
".mjs": dynamicImport,
|
|
80
|
-
".cjs": dynamicImport,
|
|
81
|
-
".json": jsonLoader,
|
|
82
|
-
noExt: jsonLoader
|
|
83
|
-
});
|
|
84
|
-
module.exports.defaultLoaders = defaultLoaders;
|
|
85
|
-
function getOptions(name, options, sync) {
|
|
86
|
-
const conf = {
|
|
87
|
-
stopDir: os.homedir(),
|
|
88
|
-
searchPlaces: getDefaultSearchPlaces(name, sync),
|
|
89
|
-
ignoreEmptySearchPlaces: true,
|
|
90
|
-
cache: true,
|
|
91
|
-
transform: /* @__PURE__ */ __name((x) => x, "transform"),
|
|
92
|
-
packageProp: [name],
|
|
93
|
-
...options,
|
|
94
|
-
loaders: {
|
|
95
|
-
...sync ? defaultLoadersSync : defaultLoaders,
|
|
96
|
-
...options.loaders
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
conf.searchPlaces.forEach((place) => {
|
|
100
|
-
const key = path2.extname(place) || "noExt";
|
|
101
|
-
const loader = conf.loaders[key];
|
|
102
|
-
if (!loader) {
|
|
103
|
-
throw new Error(`Missing loader for extension "${place}"`);
|
|
104
|
-
}
|
|
105
|
-
if (typeof loader !== "function") {
|
|
106
|
-
throw new Error(
|
|
107
|
-
`Loader for extension "${place}" is not a function: Received ${typeof loader}.`
|
|
108
|
-
);
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
return conf;
|
|
112
|
-
}
|
|
113
|
-
__name(getOptions, "getOptions");
|
|
114
|
-
function getPackageProp(props, obj) {
|
|
115
|
-
if (typeof props === "string" && props in obj) return obj[props];
|
|
116
|
-
return (Array.isArray(props) ? props : props.split(".")).reduce(
|
|
117
|
-
(acc, prop) => acc === void 0 ? acc : acc[prop],
|
|
118
|
-
obj
|
|
119
|
-
) || null;
|
|
120
|
-
}
|
|
121
|
-
__name(getPackageProp, "getPackageProp");
|
|
122
|
-
function validateFilePath(filepath) {
|
|
123
|
-
if (!filepath) throw new Error("load must pass a non-empty string");
|
|
124
|
-
}
|
|
125
|
-
__name(validateFilePath, "validateFilePath");
|
|
126
|
-
function validateLoader(loader, ext) {
|
|
127
|
-
if (!loader) throw new Error(`No loader specified for extension "${ext}"`);
|
|
128
|
-
if (typeof loader !== "function") throw new Error("loader is not a function");
|
|
129
|
-
}
|
|
130
|
-
__name(validateLoader, "validateLoader");
|
|
131
|
-
var makeEmplace = /* @__PURE__ */ __name((enableCache) => (c, filepath, res) => {
|
|
132
|
-
if (enableCache) c.set(filepath, res);
|
|
133
|
-
return res;
|
|
134
|
-
}, "makeEmplace");
|
|
135
|
-
module.exports.lilconfig = /* @__PURE__ */ __name(function lilconfig(name, options) {
|
|
136
|
-
const {
|
|
137
|
-
ignoreEmptySearchPlaces,
|
|
138
|
-
loaders,
|
|
139
|
-
packageProp,
|
|
140
|
-
searchPlaces,
|
|
141
|
-
stopDir,
|
|
142
|
-
transform,
|
|
143
|
-
cache
|
|
144
|
-
} = getOptions(name, options ?? {}, false);
|
|
145
|
-
const searchCache = /* @__PURE__ */ new Map();
|
|
146
|
-
const loadCache = /* @__PURE__ */ new Map();
|
|
147
|
-
const emplace = makeEmplace(cache);
|
|
148
|
-
return {
|
|
149
|
-
async search(searchFrom = process.cwd()) {
|
|
150
|
-
const result = {
|
|
151
|
-
config: null,
|
|
152
|
-
filepath: ""
|
|
153
|
-
};
|
|
154
|
-
const visited = /* @__PURE__ */ new Set();
|
|
155
|
-
let dir = searchFrom;
|
|
156
|
-
dirLoop: while (true) {
|
|
157
|
-
if (cache) {
|
|
158
|
-
const r = searchCache.get(dir);
|
|
159
|
-
if (r !== void 0) {
|
|
160
|
-
for (const p of visited) searchCache.set(p, r);
|
|
161
|
-
return r;
|
|
162
|
-
}
|
|
163
|
-
visited.add(dir);
|
|
164
|
-
}
|
|
165
|
-
for (const searchPlace of searchPlaces) {
|
|
166
|
-
const filepath = path2.join(dir, searchPlace);
|
|
167
|
-
try {
|
|
168
|
-
await fs.promises.access(filepath);
|
|
169
|
-
} catch {
|
|
170
|
-
continue;
|
|
171
|
-
}
|
|
172
|
-
const content = String(await fsReadFileAsync(filepath));
|
|
173
|
-
const loaderKey = path2.extname(searchPlace) || "noExt";
|
|
174
|
-
const loader = loaders[loaderKey];
|
|
175
|
-
if (searchPlace === "package.json") {
|
|
176
|
-
const pkg = await loader(filepath, content);
|
|
177
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
178
|
-
if (maybeConfig != null) {
|
|
179
|
-
result.config = maybeConfig;
|
|
180
|
-
result.filepath = filepath;
|
|
181
|
-
break dirLoop;
|
|
182
|
-
}
|
|
183
|
-
continue;
|
|
184
|
-
}
|
|
185
|
-
const isEmpty = content.trim() === "";
|
|
186
|
-
if (isEmpty && ignoreEmptySearchPlaces) continue;
|
|
187
|
-
if (isEmpty) {
|
|
188
|
-
result.isEmpty = true;
|
|
189
|
-
result.config = void 0;
|
|
190
|
-
} else {
|
|
191
|
-
validateLoader(loader, loaderKey);
|
|
192
|
-
result.config = await loader(filepath, content);
|
|
193
|
-
}
|
|
194
|
-
result.filepath = filepath;
|
|
195
|
-
break dirLoop;
|
|
196
|
-
}
|
|
197
|
-
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
198
|
-
dir = parentDir(dir);
|
|
199
|
-
}
|
|
200
|
-
const transformed = (
|
|
201
|
-
// not found
|
|
202
|
-
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
203
|
-
);
|
|
204
|
-
if (cache) {
|
|
205
|
-
for (const p of visited) searchCache.set(p, transformed);
|
|
206
|
-
}
|
|
207
|
-
return transformed;
|
|
208
|
-
},
|
|
209
|
-
async load(filepath) {
|
|
210
|
-
validateFilePath(filepath);
|
|
211
|
-
const absPath = path2.resolve(process.cwd(), filepath);
|
|
212
|
-
if (cache && loadCache.has(absPath)) {
|
|
213
|
-
return loadCache.get(absPath);
|
|
214
|
-
}
|
|
215
|
-
const { base, ext } = path2.parse(absPath);
|
|
216
|
-
const loaderKey = ext || "noExt";
|
|
217
|
-
const loader = loaders[loaderKey];
|
|
218
|
-
validateLoader(loader, loaderKey);
|
|
219
|
-
const content = String(await fsReadFileAsync(absPath));
|
|
220
|
-
if (base === "package.json") {
|
|
221
|
-
const pkg = await loader(absPath, content);
|
|
222
|
-
return emplace(
|
|
223
|
-
loadCache,
|
|
224
|
-
absPath,
|
|
225
|
-
transform({
|
|
226
|
-
config: getPackageProp(packageProp, pkg),
|
|
227
|
-
filepath: absPath
|
|
228
|
-
})
|
|
229
|
-
);
|
|
230
|
-
}
|
|
231
|
-
const result = {
|
|
232
|
-
config: null,
|
|
233
|
-
filepath: absPath
|
|
234
|
-
};
|
|
235
|
-
const isEmpty = content.trim() === "";
|
|
236
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
|
237
|
-
return emplace(
|
|
238
|
-
loadCache,
|
|
239
|
-
absPath,
|
|
240
|
-
transform({
|
|
241
|
-
config: void 0,
|
|
242
|
-
filepath: absPath,
|
|
243
|
-
isEmpty: true
|
|
244
|
-
})
|
|
245
|
-
);
|
|
246
|
-
result.config = isEmpty ? void 0 : await loader(absPath, content);
|
|
247
|
-
return emplace(
|
|
248
|
-
loadCache,
|
|
249
|
-
absPath,
|
|
250
|
-
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
251
|
-
);
|
|
252
|
-
},
|
|
253
|
-
clearLoadCache() {
|
|
254
|
-
if (cache) loadCache.clear();
|
|
255
|
-
},
|
|
256
|
-
clearSearchCache() {
|
|
257
|
-
if (cache) searchCache.clear();
|
|
258
|
-
},
|
|
259
|
-
clearCaches() {
|
|
260
|
-
if (cache) {
|
|
261
|
-
loadCache.clear();
|
|
262
|
-
searchCache.clear();
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
}, "lilconfig");
|
|
267
|
-
module.exports.lilconfigSync = /* @__PURE__ */ __name(function lilconfigSync(name, options) {
|
|
268
|
-
const {
|
|
269
|
-
ignoreEmptySearchPlaces,
|
|
270
|
-
loaders,
|
|
271
|
-
packageProp,
|
|
272
|
-
searchPlaces,
|
|
273
|
-
stopDir,
|
|
274
|
-
transform,
|
|
275
|
-
cache
|
|
276
|
-
} = getOptions(name, options ?? {}, true);
|
|
277
|
-
const searchCache = /* @__PURE__ */ new Map();
|
|
278
|
-
const loadCache = /* @__PURE__ */ new Map();
|
|
279
|
-
const emplace = makeEmplace(cache);
|
|
280
|
-
return {
|
|
281
|
-
search(searchFrom = process.cwd()) {
|
|
282
|
-
const result = {
|
|
283
|
-
config: null,
|
|
284
|
-
filepath: ""
|
|
285
|
-
};
|
|
286
|
-
const visited = /* @__PURE__ */ new Set();
|
|
287
|
-
let dir = searchFrom;
|
|
288
|
-
dirLoop: while (true) {
|
|
289
|
-
if (cache) {
|
|
290
|
-
const r = searchCache.get(dir);
|
|
291
|
-
if (r !== void 0) {
|
|
292
|
-
for (const p of visited) searchCache.set(p, r);
|
|
293
|
-
return r;
|
|
294
|
-
}
|
|
295
|
-
visited.add(dir);
|
|
296
|
-
}
|
|
297
|
-
for (const searchPlace of searchPlaces) {
|
|
298
|
-
const filepath = path2.join(dir, searchPlace);
|
|
299
|
-
try {
|
|
300
|
-
fs.accessSync(filepath);
|
|
301
|
-
} catch {
|
|
302
|
-
continue;
|
|
303
|
-
}
|
|
304
|
-
const loaderKey = path2.extname(searchPlace) || "noExt";
|
|
305
|
-
const loader = loaders[loaderKey];
|
|
306
|
-
const content = String(fs.readFileSync(filepath));
|
|
307
|
-
if (searchPlace === "package.json") {
|
|
308
|
-
const pkg = loader(filepath, content);
|
|
309
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
310
|
-
if (maybeConfig != null) {
|
|
311
|
-
result.config = maybeConfig;
|
|
312
|
-
result.filepath = filepath;
|
|
313
|
-
break dirLoop;
|
|
314
|
-
}
|
|
315
|
-
continue;
|
|
316
|
-
}
|
|
317
|
-
const isEmpty = content.trim() === "";
|
|
318
|
-
if (isEmpty && ignoreEmptySearchPlaces) continue;
|
|
319
|
-
if (isEmpty) {
|
|
320
|
-
result.isEmpty = true;
|
|
321
|
-
result.config = void 0;
|
|
322
|
-
} else {
|
|
323
|
-
validateLoader(loader, loaderKey);
|
|
324
|
-
result.config = loader(filepath, content);
|
|
325
|
-
}
|
|
326
|
-
result.filepath = filepath;
|
|
327
|
-
break dirLoop;
|
|
328
|
-
}
|
|
329
|
-
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
330
|
-
dir = parentDir(dir);
|
|
331
|
-
}
|
|
332
|
-
const transformed = (
|
|
333
|
-
// not found
|
|
334
|
-
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
335
|
-
);
|
|
336
|
-
if (cache) {
|
|
337
|
-
for (const p of visited) searchCache.set(p, transformed);
|
|
338
|
-
}
|
|
339
|
-
return transformed;
|
|
340
|
-
},
|
|
341
|
-
load(filepath) {
|
|
342
|
-
validateFilePath(filepath);
|
|
343
|
-
const absPath = path2.resolve(process.cwd(), filepath);
|
|
344
|
-
if (cache && loadCache.has(absPath)) {
|
|
345
|
-
return loadCache.get(absPath);
|
|
346
|
-
}
|
|
347
|
-
const { base, ext } = path2.parse(absPath);
|
|
348
|
-
const loaderKey = ext || "noExt";
|
|
349
|
-
const loader = loaders[loaderKey];
|
|
350
|
-
validateLoader(loader, loaderKey);
|
|
351
|
-
const content = String(fs.readFileSync(absPath));
|
|
352
|
-
if (base === "package.json") {
|
|
353
|
-
const pkg = loader(absPath, content);
|
|
354
|
-
return transform({
|
|
355
|
-
config: getPackageProp(packageProp, pkg),
|
|
356
|
-
filepath: absPath
|
|
357
|
-
});
|
|
358
|
-
}
|
|
359
|
-
const result = {
|
|
360
|
-
config: null,
|
|
361
|
-
filepath: absPath
|
|
362
|
-
};
|
|
363
|
-
const isEmpty = content.trim() === "";
|
|
364
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
|
365
|
-
return emplace(
|
|
366
|
-
loadCache,
|
|
367
|
-
absPath,
|
|
368
|
-
transform({
|
|
369
|
-
filepath: absPath,
|
|
370
|
-
config: void 0,
|
|
371
|
-
isEmpty: true
|
|
372
|
-
})
|
|
373
|
-
);
|
|
374
|
-
result.config = isEmpty ? void 0 : loader(absPath, content);
|
|
375
|
-
return emplace(
|
|
376
|
-
loadCache,
|
|
377
|
-
absPath,
|
|
378
|
-
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
379
|
-
);
|
|
380
|
-
},
|
|
381
|
-
clearLoadCache() {
|
|
382
|
-
if (cache) loadCache.clear();
|
|
383
|
-
},
|
|
384
|
-
clearSearchCache() {
|
|
385
|
-
if (cache) searchCache.clear();
|
|
386
|
-
},
|
|
387
|
-
clearCaches() {
|
|
388
|
-
if (cache) {
|
|
389
|
-
loadCache.clear();
|
|
390
|
-
searchCache.clear();
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
};
|
|
394
|
-
}, "lilconfigSync");
|
|
395
|
-
}
|
|
396
|
-
});
|
|
397
|
-
|
|
398
|
-
// ../../node_modules/postcss-load-config/src/req.js
|
|
399
|
-
var require_req = __commonJS({
|
|
400
|
-
"../../node_modules/postcss-load-config/src/req.js"(exports, module) {
|
|
401
|
-
var { createRequire: createRequire2 } = __require("node:module");
|
|
402
|
-
var { pathToFileURL: pathToFileURL2 } = __require("node:url");
|
|
403
|
-
var TS_EXT_RE = /\.[mc]?ts$/;
|
|
404
|
-
var tsx;
|
|
405
|
-
var jiti;
|
|
406
|
-
var importError = [];
|
|
407
|
-
async function req(name, rootFile = __filename) {
|
|
408
|
-
let url = createRequire2(rootFile).resolve(name);
|
|
409
|
-
try {
|
|
410
|
-
return (await import(`${pathToFileURL2(url)}?t=${Date.now()}`)).default;
|
|
411
|
-
} catch (err) {
|
|
412
|
-
if (!TS_EXT_RE.test(url)) {
|
|
413
|
-
throw err;
|
|
414
|
-
}
|
|
415
|
-
}
|
|
416
|
-
if (tsx === void 0) {
|
|
417
|
-
try {
|
|
418
|
-
tsx = await import("tsx/cjs/api");
|
|
419
|
-
} catch (error) {
|
|
420
|
-
importError.push(error);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
if (tsx) {
|
|
424
|
-
let loaded = tsx.require(name, rootFile);
|
|
425
|
-
return loaded && "__esModule" in loaded ? loaded.default : loaded;
|
|
426
|
-
}
|
|
427
|
-
if (jiti === void 0) {
|
|
428
|
-
try {
|
|
429
|
-
jiti = (await import("./_node-chunks/jiti-BSWDZS5T.js")).default;
|
|
430
|
-
} catch (error) {
|
|
431
|
-
importError.push(error);
|
|
432
|
-
}
|
|
433
|
-
}
|
|
434
|
-
if (jiti) {
|
|
435
|
-
return jiti(rootFile, { interopDefault: true })(name);
|
|
436
|
-
}
|
|
437
|
-
throw new Error(
|
|
438
|
-
`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed
|
|
439
|
-
Error: ${importError.map((error) => error.message).join("\n")}`
|
|
440
|
-
);
|
|
441
|
-
}
|
|
442
|
-
__name(req, "req");
|
|
443
|
-
module.exports = req;
|
|
444
|
-
}
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
// ../../node_modules/postcss-load-config/src/options.js
|
|
448
|
-
var require_options = __commonJS({
|
|
449
|
-
"../../node_modules/postcss-load-config/src/options.js"(exports, module) {
|
|
450
|
-
var req = require_req();
|
|
451
|
-
async function options(config, file) {
|
|
452
|
-
if (config.parser && typeof config.parser === "string") {
|
|
453
|
-
try {
|
|
454
|
-
config.parser = await req(config.parser, file);
|
|
455
|
-
} catch (err) {
|
|
456
|
-
throw new Error(
|
|
457
|
-
`Loading PostCSS Parser failed: ${err.message}
|
|
458
|
-
|
|
459
|
-
(@${file})`
|
|
460
|
-
);
|
|
461
|
-
}
|
|
462
|
-
}
|
|
463
|
-
if (config.syntax && typeof config.syntax === "string") {
|
|
464
|
-
try {
|
|
465
|
-
config.syntax = await req(config.syntax, file);
|
|
466
|
-
} catch (err) {
|
|
467
|
-
throw new Error(
|
|
468
|
-
`Loading PostCSS Syntax failed: ${err.message}
|
|
469
|
-
|
|
470
|
-
(@${file})`
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
if (config.stringifier && typeof config.stringifier === "string") {
|
|
475
|
-
try {
|
|
476
|
-
config.stringifier = await req(config.stringifier, file);
|
|
477
|
-
} catch (err) {
|
|
478
|
-
throw new Error(
|
|
479
|
-
`Loading PostCSS Stringifier failed: ${err.message}
|
|
480
|
-
|
|
481
|
-
(@${file})`
|
|
482
|
-
);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
return config;
|
|
486
|
-
}
|
|
487
|
-
__name(options, "options");
|
|
488
|
-
module.exports = options;
|
|
489
|
-
}
|
|
490
|
-
});
|
|
491
|
-
|
|
492
|
-
// ../../node_modules/postcss-load-config/src/plugins.js
|
|
493
|
-
var require_plugins = __commonJS({
|
|
494
|
-
"../../node_modules/postcss-load-config/src/plugins.js"(exports, module) {
|
|
495
|
-
var req = require_req();
|
|
496
|
-
async function load(plugin, options, file) {
|
|
497
|
-
try {
|
|
498
|
-
if (options === null || options === void 0 || Object.keys(options).length === 0) {
|
|
499
|
-
return await req(plugin, file);
|
|
500
|
-
} else {
|
|
501
|
-
return (await req(plugin, file))(options);
|
|
502
|
-
}
|
|
503
|
-
} catch (err) {
|
|
504
|
-
throw new Error(
|
|
505
|
-
`Loading PostCSS Plugin failed: ${err.message}
|
|
506
|
-
|
|
507
|
-
(@${file})`
|
|
508
|
-
);
|
|
509
|
-
}
|
|
510
|
-
}
|
|
511
|
-
__name(load, "load");
|
|
512
|
-
async function plugins(config, file) {
|
|
513
|
-
let list = [];
|
|
514
|
-
if (Array.isArray(config.plugins)) {
|
|
515
|
-
list = config.plugins.filter(Boolean);
|
|
516
|
-
} else {
|
|
517
|
-
list = Object.entries(config.plugins).filter(([, options]) => {
|
|
518
|
-
return options !== false;
|
|
519
|
-
}).map(([plugin, options]) => {
|
|
520
|
-
return load(plugin, options, file);
|
|
521
|
-
});
|
|
522
|
-
list = await Promise.all(list);
|
|
523
|
-
}
|
|
524
|
-
if (list.length && list.length > 0) {
|
|
525
|
-
list.forEach((plugin, i) => {
|
|
526
|
-
if (plugin.default) {
|
|
527
|
-
plugin = plugin.default;
|
|
528
|
-
}
|
|
529
|
-
if (plugin.postcss === true) {
|
|
530
|
-
plugin = plugin();
|
|
531
|
-
} else if (plugin.postcss) {
|
|
532
|
-
plugin = plugin.postcss;
|
|
533
|
-
}
|
|
534
|
-
if (!(typeof plugin === "object" && Array.isArray(plugin.plugins) || typeof plugin === "object" && plugin.postcssPlugin || typeof plugin === "function")) {
|
|
535
|
-
throw new TypeError(
|
|
536
|
-
`Invalid PostCSS Plugin found at: plugins[${i}]
|
|
537
|
-
|
|
538
|
-
(@${file})`
|
|
539
|
-
);
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
}
|
|
543
|
-
return list;
|
|
544
|
-
}
|
|
545
|
-
__name(plugins, "plugins");
|
|
546
|
-
module.exports = plugins;
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
|
|
550
|
-
// ../../node_modules/postcss-load-config/src/index.js
|
|
551
|
-
var require_src2 = __commonJS({
|
|
552
|
-
"../../node_modules/postcss-load-config/src/index.js"(exports, module) {
|
|
553
|
-
var { resolve: resolve2 } = __require("node:path");
|
|
554
|
-
var config = require_src();
|
|
555
|
-
var loadOptions = require_options();
|
|
556
|
-
var loadPlugins = require_plugins();
|
|
557
|
-
var req = require_req();
|
|
558
|
-
var interopRequireDefault = /* @__PURE__ */ __name((obj) => obj && obj.__esModule ? obj : { default: obj }, "interopRequireDefault");
|
|
559
|
-
async function processResult(ctx, result) {
|
|
560
|
-
let file = result.filepath || "";
|
|
561
|
-
let projectConfig = interopRequireDefault(result.config).default || {};
|
|
562
|
-
if (typeof projectConfig === "function") {
|
|
563
|
-
projectConfig = projectConfig(ctx);
|
|
564
|
-
} else {
|
|
565
|
-
projectConfig = Object.assign({}, projectConfig, ctx);
|
|
566
|
-
}
|
|
567
|
-
if (!projectConfig.plugins) {
|
|
568
|
-
projectConfig.plugins = [];
|
|
569
|
-
}
|
|
570
|
-
let res = {
|
|
571
|
-
file,
|
|
572
|
-
options: await loadOptions(projectConfig, file),
|
|
573
|
-
plugins: await loadPlugins(projectConfig, file)
|
|
574
|
-
};
|
|
575
|
-
delete projectConfig.plugins;
|
|
576
|
-
return res;
|
|
577
|
-
}
|
|
578
|
-
__name(processResult, "processResult");
|
|
579
|
-
function createContext(ctx) {
|
|
580
|
-
ctx = Object.assign(
|
|
581
|
-
{
|
|
582
|
-
cwd: process.cwd(),
|
|
583
|
-
env: process.env.NODE_ENV
|
|
584
|
-
},
|
|
585
|
-
ctx
|
|
586
|
-
);
|
|
587
|
-
if (!ctx.env) {
|
|
588
|
-
process.env.NODE_ENV = "development";
|
|
589
|
-
}
|
|
590
|
-
return ctx;
|
|
591
|
-
}
|
|
592
|
-
__name(createContext, "createContext");
|
|
593
|
-
async function loader(filepath) {
|
|
594
|
-
return req(filepath);
|
|
595
|
-
}
|
|
596
|
-
__name(loader, "loader");
|
|
597
|
-
var yaml;
|
|
598
|
-
async function yamlLoader(_, content) {
|
|
599
|
-
if (!yaml) {
|
|
600
|
-
try {
|
|
601
|
-
yaml = await import("./_node-chunks/dist-MMISEYOA.js");
|
|
602
|
-
} catch (e) {
|
|
603
|
-
throw new Error(
|
|
604
|
-
`'yaml' is required for the YAML configuration files. Make sure it is installed
|
|
605
|
-
Error: ${e.message}`
|
|
606
|
-
);
|
|
607
|
-
}
|
|
608
|
-
}
|
|
609
|
-
return yaml.parse(content);
|
|
610
|
-
}
|
|
611
|
-
__name(yamlLoader, "yamlLoader");
|
|
612
|
-
var withLoaders = /* @__PURE__ */ __name((options = {}) => {
|
|
613
|
-
let moduleName = "postcss";
|
|
614
|
-
return {
|
|
615
|
-
...options,
|
|
616
|
-
loaders: {
|
|
617
|
-
...options.loaders,
|
|
618
|
-
".cjs": loader,
|
|
619
|
-
".cts": loader,
|
|
620
|
-
".js": loader,
|
|
621
|
-
".mjs": loader,
|
|
622
|
-
".mts": loader,
|
|
623
|
-
".ts": loader,
|
|
624
|
-
".yaml": yamlLoader,
|
|
625
|
-
".yml": yamlLoader
|
|
626
|
-
},
|
|
627
|
-
searchPlaces: [
|
|
628
|
-
...options.searchPlaces || [],
|
|
629
|
-
"package.json",
|
|
630
|
-
`.${moduleName}rc`,
|
|
631
|
-
`.${moduleName}rc.json`,
|
|
632
|
-
`.${moduleName}rc.yaml`,
|
|
633
|
-
`.${moduleName}rc.yml`,
|
|
634
|
-
`.${moduleName}rc.ts`,
|
|
635
|
-
`.${moduleName}rc.cts`,
|
|
636
|
-
`.${moduleName}rc.mts`,
|
|
637
|
-
`.${moduleName}rc.js`,
|
|
638
|
-
`.${moduleName}rc.cjs`,
|
|
639
|
-
`.${moduleName}rc.mjs`,
|
|
640
|
-
`${moduleName}.config.ts`,
|
|
641
|
-
`${moduleName}.config.cts`,
|
|
642
|
-
`${moduleName}.config.mts`,
|
|
643
|
-
`${moduleName}.config.js`,
|
|
644
|
-
`${moduleName}.config.cjs`,
|
|
645
|
-
`${moduleName}.config.mjs`
|
|
646
|
-
]
|
|
647
|
-
};
|
|
648
|
-
}, "withLoaders");
|
|
649
|
-
function rc(ctx, path2, options) {
|
|
650
|
-
ctx = createContext(ctx);
|
|
651
|
-
path2 = path2 ? resolve2(path2) : process.cwd();
|
|
652
|
-
return config.lilconfig("postcss", withLoaders(options)).search(path2).then((result) => {
|
|
653
|
-
if (!result) {
|
|
654
|
-
throw new Error(`No PostCSS Config found in: ${path2}`);
|
|
655
|
-
}
|
|
656
|
-
return processResult(ctx, result);
|
|
657
|
-
});
|
|
658
|
-
}
|
|
659
|
-
__name(rc, "rc");
|
|
660
|
-
module.exports = rc;
|
|
661
|
-
}
|
|
662
|
-
});
|
|
17
|
+
} from "./_node-chunks/chunk-EJYBCWE7.js";
|
|
663
18
|
|
|
664
19
|
// ../../node_modules/semver/internal/constants.js
|
|
665
20
|
var require_constants = __commonJS({
|
|
@@ -1492,160 +847,465 @@ var require_lrucache = __commonJS({
|
|
|
1492
847
|
if (value === void 0) {
|
|
1493
848
|
return void 0;
|
|
1494
849
|
} else {
|
|
1495
|
-
this.map.delete(key);
|
|
1496
|
-
this.map.set(key, value);
|
|
1497
|
-
return value;
|
|
850
|
+
this.map.delete(key);
|
|
851
|
+
this.map.set(key, value);
|
|
852
|
+
return value;
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
delete(key) {
|
|
856
|
+
return this.map.delete(key);
|
|
857
|
+
}
|
|
858
|
+
set(key, value) {
|
|
859
|
+
const deleted = this.delete(key);
|
|
860
|
+
if (!deleted && value !== void 0) {
|
|
861
|
+
if (this.map.size >= this.max) {
|
|
862
|
+
const firstKey = this.map.keys().next().value;
|
|
863
|
+
this.delete(firstKey);
|
|
864
|
+
}
|
|
865
|
+
this.map.set(key, value);
|
|
866
|
+
}
|
|
867
|
+
return this;
|
|
868
|
+
}
|
|
869
|
+
};
|
|
870
|
+
module.exports = LRUCache;
|
|
871
|
+
}
|
|
872
|
+
});
|
|
873
|
+
|
|
874
|
+
// ../../node_modules/semver/classes/range.js
|
|
875
|
+
var require_range = __commonJS({
|
|
876
|
+
"../../node_modules/semver/classes/range.js"(exports, module) {
|
|
877
|
+
"use strict";
|
|
878
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
879
|
+
var Range = class _Range {
|
|
880
|
+
static {
|
|
881
|
+
__name(this, "Range");
|
|
882
|
+
}
|
|
883
|
+
constructor(range, options) {
|
|
884
|
+
options = parseOptions(options);
|
|
885
|
+
if (range instanceof _Range) {
|
|
886
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
887
|
+
return range;
|
|
888
|
+
} else {
|
|
889
|
+
return new _Range(range.raw, options);
|
|
890
|
+
}
|
|
891
|
+
}
|
|
892
|
+
if (range instanceof Comparator) {
|
|
893
|
+
this.raw = range.value;
|
|
894
|
+
this.set = [[range]];
|
|
895
|
+
this.formatted = void 0;
|
|
896
|
+
return this;
|
|
897
|
+
}
|
|
898
|
+
this.options = options;
|
|
899
|
+
this.loose = !!options.loose;
|
|
900
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
901
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
902
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
903
|
+
if (!this.set.length) {
|
|
904
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
905
|
+
}
|
|
906
|
+
if (this.set.length > 1) {
|
|
907
|
+
const first = this.set[0];
|
|
908
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
909
|
+
if (this.set.length === 0) {
|
|
910
|
+
this.set = [first];
|
|
911
|
+
} else if (this.set.length > 1) {
|
|
912
|
+
for (const c of this.set) {
|
|
913
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
914
|
+
this.set = [c];
|
|
915
|
+
break;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
}
|
|
920
|
+
this.formatted = void 0;
|
|
921
|
+
}
|
|
922
|
+
get range() {
|
|
923
|
+
if (this.formatted === void 0) {
|
|
924
|
+
this.formatted = "";
|
|
925
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
926
|
+
if (i > 0) {
|
|
927
|
+
this.formatted += "||";
|
|
928
|
+
}
|
|
929
|
+
const comps = this.set[i];
|
|
930
|
+
for (let k = 0; k < comps.length; k++) {
|
|
931
|
+
if (k > 0) {
|
|
932
|
+
this.formatted += " ";
|
|
933
|
+
}
|
|
934
|
+
this.formatted += comps[k].toString().trim();
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
return this.formatted;
|
|
939
|
+
}
|
|
940
|
+
format() {
|
|
941
|
+
return this.range;
|
|
942
|
+
}
|
|
943
|
+
toString() {
|
|
944
|
+
return this.range;
|
|
945
|
+
}
|
|
946
|
+
parseRange(range) {
|
|
947
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
948
|
+
const memoKey = memoOpts + ":" + range;
|
|
949
|
+
const cached = cache.get(memoKey);
|
|
950
|
+
if (cached) {
|
|
951
|
+
return cached;
|
|
952
|
+
}
|
|
953
|
+
const loose = this.options.loose;
|
|
954
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
955
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
956
|
+
debug("hyphen replace", range);
|
|
957
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
958
|
+
debug("comparator trim", range);
|
|
959
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
960
|
+
debug("tilde trim", range);
|
|
961
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
962
|
+
debug("caret trim", range);
|
|
963
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
964
|
+
if (loose) {
|
|
965
|
+
rangeList = rangeList.filter((comp) => {
|
|
966
|
+
debug("loose invalid filter", comp, this.options);
|
|
967
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
debug("range list", rangeList);
|
|
971
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
972
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
973
|
+
for (const comp of comparators) {
|
|
974
|
+
if (isNullSet(comp)) {
|
|
975
|
+
return [comp];
|
|
976
|
+
}
|
|
977
|
+
rangeMap.set(comp.value, comp);
|
|
978
|
+
}
|
|
979
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
980
|
+
rangeMap.delete("");
|
|
981
|
+
}
|
|
982
|
+
const result = [...rangeMap.values()];
|
|
983
|
+
cache.set(memoKey, result);
|
|
984
|
+
return result;
|
|
985
|
+
}
|
|
986
|
+
intersects(range, options) {
|
|
987
|
+
if (!(range instanceof _Range)) {
|
|
988
|
+
throw new TypeError("a Range is required");
|
|
989
|
+
}
|
|
990
|
+
return this.set.some((thisComparators) => {
|
|
991
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
992
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
993
|
+
return rangeComparators.every((rangeComparator) => {
|
|
994
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
995
|
+
});
|
|
996
|
+
});
|
|
997
|
+
});
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1001
|
+
test(version) {
|
|
1002
|
+
if (!version) {
|
|
1003
|
+
return false;
|
|
1004
|
+
}
|
|
1005
|
+
if (typeof version === "string") {
|
|
1006
|
+
try {
|
|
1007
|
+
version = new SemVer(version, this.options);
|
|
1008
|
+
} catch (er) {
|
|
1009
|
+
return false;
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1013
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
1014
|
+
return true;
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
return false;
|
|
1018
|
+
}
|
|
1019
|
+
};
|
|
1020
|
+
module.exports = Range;
|
|
1021
|
+
var LRU = require_lrucache();
|
|
1022
|
+
var cache = new LRU();
|
|
1023
|
+
var parseOptions = require_parse_options();
|
|
1024
|
+
var Comparator = require_comparator();
|
|
1025
|
+
var debug = require_debug();
|
|
1026
|
+
var SemVer = require_semver();
|
|
1027
|
+
var {
|
|
1028
|
+
safeRe: re,
|
|
1029
|
+
t,
|
|
1030
|
+
comparatorTrimReplace,
|
|
1031
|
+
tildeTrimReplace,
|
|
1032
|
+
caretTrimReplace
|
|
1033
|
+
} = require_re();
|
|
1034
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1035
|
+
var isNullSet = /* @__PURE__ */ __name((c) => c.value === "<0.0.0-0", "isNullSet");
|
|
1036
|
+
var isAny = /* @__PURE__ */ __name((c) => c.value === "", "isAny");
|
|
1037
|
+
var isSatisfiable = /* @__PURE__ */ __name((comparators, options) => {
|
|
1038
|
+
let result = true;
|
|
1039
|
+
const remainingComparators = comparators.slice();
|
|
1040
|
+
let testComparator = remainingComparators.pop();
|
|
1041
|
+
while (result && remainingComparators.length) {
|
|
1042
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1043
|
+
return testComparator.intersects(otherComparator, options);
|
|
1044
|
+
});
|
|
1045
|
+
testComparator = remainingComparators.pop();
|
|
1046
|
+
}
|
|
1047
|
+
return result;
|
|
1048
|
+
}, "isSatisfiable");
|
|
1049
|
+
var parseComparator = /* @__PURE__ */ __name((comp, options) => {
|
|
1050
|
+
debug("comp", comp, options);
|
|
1051
|
+
comp = replaceCarets(comp, options);
|
|
1052
|
+
debug("caret", comp);
|
|
1053
|
+
comp = replaceTildes(comp, options);
|
|
1054
|
+
debug("tildes", comp);
|
|
1055
|
+
comp = replaceXRanges(comp, options);
|
|
1056
|
+
debug("xrange", comp);
|
|
1057
|
+
comp = replaceStars(comp, options);
|
|
1058
|
+
debug("stars", comp);
|
|
1059
|
+
return comp;
|
|
1060
|
+
}, "parseComparator");
|
|
1061
|
+
var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
|
|
1062
|
+
var replaceTildes = /* @__PURE__ */ __name((comp, options) => {
|
|
1063
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1064
|
+
}, "replaceTildes");
|
|
1065
|
+
var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
1066
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1067
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1068
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1069
|
+
let ret;
|
|
1070
|
+
if (isX(M)) {
|
|
1071
|
+
ret = "";
|
|
1072
|
+
} else if (isX(m)) {
|
|
1073
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1074
|
+
} else if (isX(p)) {
|
|
1075
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1076
|
+
} else if (pr) {
|
|
1077
|
+
debug("replaceTilde pr", pr);
|
|
1078
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1079
|
+
} else {
|
|
1080
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1498
1081
|
}
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1082
|
+
debug("tilde return", ret);
|
|
1083
|
+
return ret;
|
|
1084
|
+
});
|
|
1085
|
+
}, "replaceTilde");
|
|
1086
|
+
var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
|
|
1087
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1088
|
+
}, "replaceCarets");
|
|
1089
|
+
var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1090
|
+
debug("caret", comp, options);
|
|
1091
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1092
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1093
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1094
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1095
|
+
let ret;
|
|
1096
|
+
if (isX(M)) {
|
|
1097
|
+
ret = "";
|
|
1098
|
+
} else if (isX(m)) {
|
|
1099
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1100
|
+
} else if (isX(p)) {
|
|
1101
|
+
if (M === "0") {
|
|
1102
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1103
|
+
} else {
|
|
1104
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1509
1105
|
}
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
}
|
|
1518
|
-
|
|
1519
|
-
// ../../node_modules/semver/classes/range.js
|
|
1520
|
-
var require_range = __commonJS({
|
|
1521
|
-
"../../node_modules/semver/classes/range.js"(exports, module) {
|
|
1522
|
-
"use strict";
|
|
1523
|
-
var SPACE_CHARACTERS = /\s+/g;
|
|
1524
|
-
var Range = class _Range {
|
|
1525
|
-
static {
|
|
1526
|
-
__name(this, "Range");
|
|
1527
|
-
}
|
|
1528
|
-
constructor(range, options) {
|
|
1529
|
-
options = parseOptions(options);
|
|
1530
|
-
if (range instanceof _Range) {
|
|
1531
|
-
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
1532
|
-
return range;
|
|
1106
|
+
} else if (pr) {
|
|
1107
|
+
debug("replaceCaret pr", pr);
|
|
1108
|
+
if (M === "0") {
|
|
1109
|
+
if (m === "0") {
|
|
1110
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1111
|
+
} else {
|
|
1112
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1113
|
+
}
|
|
1533
1114
|
} else {
|
|
1534
|
-
|
|
1115
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1535
1116
|
}
|
|
1536
|
-
}
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
this.options = options;
|
|
1544
|
-
this.loose = !!options.loose;
|
|
1545
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
1546
|
-
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
1547
|
-
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
1548
|
-
if (!this.set.length) {
|
|
1549
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
1550
|
-
}
|
|
1551
|
-
if (this.set.length > 1) {
|
|
1552
|
-
const first = this.set[0];
|
|
1553
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
1554
|
-
if (this.set.length === 0) {
|
|
1555
|
-
this.set = [first];
|
|
1556
|
-
} else if (this.set.length > 1) {
|
|
1557
|
-
for (const c of this.set) {
|
|
1558
|
-
if (c.length === 1 && isAny(c[0])) {
|
|
1559
|
-
this.set = [c];
|
|
1560
|
-
break;
|
|
1561
|
-
}
|
|
1117
|
+
} else {
|
|
1118
|
+
debug("no pr");
|
|
1119
|
+
if (M === "0") {
|
|
1120
|
+
if (m === "0") {
|
|
1121
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1122
|
+
} else {
|
|
1123
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1562
1124
|
}
|
|
1125
|
+
} else {
|
|
1126
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1563
1127
|
}
|
|
1564
1128
|
}
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1129
|
+
debug("caret return", ret);
|
|
1130
|
+
return ret;
|
|
1131
|
+
});
|
|
1132
|
+
}, "replaceCaret");
|
|
1133
|
+
var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
1134
|
+
debug("replaceXRanges", comp, options);
|
|
1135
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1136
|
+
}, "replaceXRanges");
|
|
1137
|
+
var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
1138
|
+
comp = comp.trim();
|
|
1139
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1140
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1141
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1142
|
+
const xM = isX(M);
|
|
1143
|
+
const xm = xM || isX(m);
|
|
1144
|
+
const xp = xm || isX(p);
|
|
1145
|
+
const anyX = xp;
|
|
1146
|
+
if (gtlt === "=" && anyX) {
|
|
1147
|
+
gtlt = "";
|
|
1148
|
+
}
|
|
1149
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1150
|
+
if (xM) {
|
|
1151
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1152
|
+
ret = "<0.0.0-0";
|
|
1153
|
+
} else {
|
|
1154
|
+
ret = "*";
|
|
1155
|
+
}
|
|
1156
|
+
} else if (gtlt && anyX) {
|
|
1157
|
+
if (xm) {
|
|
1158
|
+
m = 0;
|
|
1159
|
+
}
|
|
1160
|
+
p = 0;
|
|
1161
|
+
if (gtlt === ">") {
|
|
1162
|
+
gtlt = ">=";
|
|
1163
|
+
if (xm) {
|
|
1164
|
+
M = +M + 1;
|
|
1165
|
+
m = 0;
|
|
1166
|
+
p = 0;
|
|
1167
|
+
} else {
|
|
1168
|
+
m = +m + 1;
|
|
1169
|
+
p = 0;
|
|
1573
1170
|
}
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1171
|
+
} else if (gtlt === "<=") {
|
|
1172
|
+
gtlt = "<";
|
|
1173
|
+
if (xm) {
|
|
1174
|
+
M = +M + 1;
|
|
1175
|
+
} else {
|
|
1176
|
+
m = +m + 1;
|
|
1580
1177
|
}
|
|
1581
1178
|
}
|
|
1179
|
+
if (gtlt === "<") {
|
|
1180
|
+
pr = "-0";
|
|
1181
|
+
}
|
|
1182
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1183
|
+
} else if (xm) {
|
|
1184
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1185
|
+
} else if (xp) {
|
|
1186
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1582
1187
|
}
|
|
1583
|
-
return
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1188
|
+
debug("xRange return", ret);
|
|
1189
|
+
return ret;
|
|
1190
|
+
});
|
|
1191
|
+
}, "replaceXRange");
|
|
1192
|
+
var replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
1193
|
+
debug("replaceStars", comp, options);
|
|
1194
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1195
|
+
}, "replaceStars");
|
|
1196
|
+
var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
1197
|
+
debug("replaceGTE0", comp, options);
|
|
1198
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1199
|
+
}, "replaceGTE0");
|
|
1200
|
+
var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1201
|
+
if (isX(fM)) {
|
|
1202
|
+
from = "";
|
|
1203
|
+
} else if (isX(fm)) {
|
|
1204
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1205
|
+
} else if (isX(fp)) {
|
|
1206
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1207
|
+
} else if (fpr) {
|
|
1208
|
+
from = `>=${from}`;
|
|
1209
|
+
} else {
|
|
1210
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1587
1211
|
}
|
|
1588
|
-
|
|
1589
|
-
|
|
1212
|
+
if (isX(tM)) {
|
|
1213
|
+
to = "";
|
|
1214
|
+
} else if (isX(tm)) {
|
|
1215
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1216
|
+
} else if (isX(tp)) {
|
|
1217
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1218
|
+
} else if (tpr) {
|
|
1219
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1220
|
+
} else if (incPr) {
|
|
1221
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1222
|
+
} else {
|
|
1223
|
+
to = `<=${to}`;
|
|
1590
1224
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
if (
|
|
1596
|
-
return
|
|
1225
|
+
return `${from} ${to}`.trim();
|
|
1226
|
+
}, "hyphenReplace");
|
|
1227
|
+
var testSet = /* @__PURE__ */ __name((set, version, options) => {
|
|
1228
|
+
for (let i = 0; i < set.length; i++) {
|
|
1229
|
+
if (!set[i].test(version)) {
|
|
1230
|
+
return false;
|
|
1597
1231
|
}
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
debug("loose invalid filter", comp, this.options);
|
|
1612
|
-
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1613
|
-
});
|
|
1232
|
+
}
|
|
1233
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1234
|
+
for (let i = 0; i < set.length; i++) {
|
|
1235
|
+
debug(set[i].semver);
|
|
1236
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1237
|
+
continue;
|
|
1238
|
+
}
|
|
1239
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1240
|
+
const allowed = set[i].semver;
|
|
1241
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1242
|
+
return true;
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1614
1245
|
}
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1246
|
+
return false;
|
|
1247
|
+
}
|
|
1248
|
+
return true;
|
|
1249
|
+
}, "testSet");
|
|
1250
|
+
}
|
|
1251
|
+
});
|
|
1252
|
+
|
|
1253
|
+
// ../../node_modules/semver/classes/comparator.js
|
|
1254
|
+
var require_comparator = __commonJS({
|
|
1255
|
+
"../../node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1256
|
+
"use strict";
|
|
1257
|
+
var ANY = Symbol("SemVer ANY");
|
|
1258
|
+
var Comparator = class _Comparator {
|
|
1259
|
+
static {
|
|
1260
|
+
__name(this, "Comparator");
|
|
1261
|
+
}
|
|
1262
|
+
static get ANY() {
|
|
1263
|
+
return ANY;
|
|
1264
|
+
}
|
|
1265
|
+
constructor(comp, options) {
|
|
1266
|
+
options = parseOptions(options);
|
|
1267
|
+
if (comp instanceof _Comparator) {
|
|
1268
|
+
if (comp.loose === !!options.loose) {
|
|
1269
|
+
return comp;
|
|
1270
|
+
} else {
|
|
1271
|
+
comp = comp.value;
|
|
1621
1272
|
}
|
|
1622
|
-
rangeMap.set(comp.value, comp);
|
|
1623
1273
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1274
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1275
|
+
debug("comparator", comp, options);
|
|
1276
|
+
this.options = options;
|
|
1277
|
+
this.loose = !!options.loose;
|
|
1278
|
+
this.parse(comp);
|
|
1279
|
+
if (this.semver === ANY) {
|
|
1280
|
+
this.value = "";
|
|
1281
|
+
} else {
|
|
1282
|
+
this.value = this.operator + this.semver.version;
|
|
1626
1283
|
}
|
|
1627
|
-
|
|
1628
|
-
cache.set(memoKey, result);
|
|
1629
|
-
return result;
|
|
1284
|
+
debug("comp", this);
|
|
1630
1285
|
}
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1286
|
+
parse(comp) {
|
|
1287
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1288
|
+
const m = comp.match(r);
|
|
1289
|
+
if (!m) {
|
|
1290
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1291
|
+
}
|
|
1292
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1293
|
+
if (this.operator === "=") {
|
|
1294
|
+
this.operator = "";
|
|
1295
|
+
}
|
|
1296
|
+
if (!m[2]) {
|
|
1297
|
+
this.semver = ANY;
|
|
1298
|
+
} else {
|
|
1299
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1634
1300
|
}
|
|
1635
|
-
return this.set.some((thisComparators) => {
|
|
1636
|
-
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1637
|
-
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1638
|
-
return rangeComparators.every((rangeComparator) => {
|
|
1639
|
-
return thisComparator.intersects(rangeComparator, options);
|
|
1640
|
-
});
|
|
1641
|
-
});
|
|
1642
|
-
});
|
|
1643
|
-
});
|
|
1644
1301
|
}
|
|
1645
|
-
|
|
1302
|
+
toString() {
|
|
1303
|
+
return this.value;
|
|
1304
|
+
}
|
|
1646
1305
|
test(version) {
|
|
1647
|
-
|
|
1648
|
-
|
|
1306
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1307
|
+
if (this.semver === ANY || version === ANY) {
|
|
1308
|
+
return true;
|
|
1649
1309
|
}
|
|
1650
1310
|
if (typeof version === "string") {
|
|
1651
1311
|
try {
|
|
@@ -1654,942 +1314,1367 @@ var require_range = __commonJS({
|
|
|
1654
1314
|
return false;
|
|
1655
1315
|
}
|
|
1656
1316
|
}
|
|
1657
|
-
|
|
1658
|
-
|
|
1317
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1318
|
+
}
|
|
1319
|
+
intersects(comp, options) {
|
|
1320
|
+
if (!(comp instanceof _Comparator)) {
|
|
1321
|
+
throw new TypeError("a Comparator is required");
|
|
1322
|
+
}
|
|
1323
|
+
if (this.operator === "") {
|
|
1324
|
+
if (this.value === "") {
|
|
1325
|
+
return true;
|
|
1326
|
+
}
|
|
1327
|
+
return new Range(comp.value, options).test(this.value);
|
|
1328
|
+
} else if (comp.operator === "") {
|
|
1329
|
+
if (comp.value === "") {
|
|
1659
1330
|
return true;
|
|
1660
1331
|
}
|
|
1332
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1333
|
+
}
|
|
1334
|
+
options = parseOptions(options);
|
|
1335
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1336
|
+
return false;
|
|
1337
|
+
}
|
|
1338
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1339
|
+
return false;
|
|
1340
|
+
}
|
|
1341
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1342
|
+
return true;
|
|
1343
|
+
}
|
|
1344
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1345
|
+
return true;
|
|
1346
|
+
}
|
|
1347
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1348
|
+
return true;
|
|
1349
|
+
}
|
|
1350
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1351
|
+
return true;
|
|
1352
|
+
}
|
|
1353
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1354
|
+
return true;
|
|
1661
1355
|
}
|
|
1662
1356
|
return false;
|
|
1663
1357
|
}
|
|
1664
1358
|
};
|
|
1665
|
-
module.exports =
|
|
1666
|
-
var LRU = require_lrucache();
|
|
1667
|
-
var cache = new LRU();
|
|
1359
|
+
module.exports = Comparator;
|
|
1668
1360
|
var parseOptions = require_parse_options();
|
|
1669
|
-
var
|
|
1361
|
+
var { safeRe: re, t } = require_re();
|
|
1362
|
+
var cmp = require_cmp();
|
|
1670
1363
|
var debug = require_debug();
|
|
1671
1364
|
var SemVer = require_semver();
|
|
1672
|
-
var
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
var
|
|
1681
|
-
var
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
while (result && remainingComparators.length) {
|
|
1687
|
-
result = remainingComparators.every((otherComparator) => {
|
|
1688
|
-
return testComparator.intersects(otherComparator, options);
|
|
1689
|
-
});
|
|
1690
|
-
testComparator = remainingComparators.pop();
|
|
1365
|
+
var Range = require_range();
|
|
1366
|
+
}
|
|
1367
|
+
});
|
|
1368
|
+
|
|
1369
|
+
// ../../node_modules/semver/functions/satisfies.js
|
|
1370
|
+
var require_satisfies = __commonJS({
|
|
1371
|
+
"../../node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1372
|
+
"use strict";
|
|
1373
|
+
var Range = require_range();
|
|
1374
|
+
var satisfies = /* @__PURE__ */ __name((version, range, options) => {
|
|
1375
|
+
try {
|
|
1376
|
+
range = new Range(range, options);
|
|
1377
|
+
} catch (er) {
|
|
1378
|
+
return false;
|
|
1691
1379
|
}
|
|
1692
|
-
return
|
|
1693
|
-
}, "
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
return ret;
|
|
1729
|
-
});
|
|
1730
|
-
}, "replaceTilde");
|
|
1731
|
-
var replaceCarets = /* @__PURE__ */ __name((comp, options) => {
|
|
1732
|
-
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1733
|
-
}, "replaceCarets");
|
|
1734
|
-
var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1735
|
-
debug("caret", comp, options);
|
|
1736
|
-
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1737
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
1738
|
-
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1739
|
-
debug("caret", comp, _, M, m, p, pr);
|
|
1740
|
-
let ret;
|
|
1741
|
-
if (isX(M)) {
|
|
1742
|
-
ret = "";
|
|
1743
|
-
} else if (isX(m)) {
|
|
1744
|
-
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1745
|
-
} else if (isX(p)) {
|
|
1746
|
-
if (M === "0") {
|
|
1747
|
-
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1748
|
-
} else {
|
|
1749
|
-
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1750
|
-
}
|
|
1751
|
-
} else if (pr) {
|
|
1752
|
-
debug("replaceCaret pr", pr);
|
|
1753
|
-
if (M === "0") {
|
|
1754
|
-
if (m === "0") {
|
|
1755
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1756
|
-
} else {
|
|
1757
|
-
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1758
|
-
}
|
|
1759
|
-
} else {
|
|
1760
|
-
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1761
|
-
}
|
|
1762
|
-
} else {
|
|
1763
|
-
debug("no pr");
|
|
1764
|
-
if (M === "0") {
|
|
1765
|
-
if (m === "0") {
|
|
1766
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1767
|
-
} else {
|
|
1768
|
-
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1769
|
-
}
|
|
1770
|
-
} else {
|
|
1771
|
-
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1380
|
+
return range.test(version);
|
|
1381
|
+
}, "satisfies");
|
|
1382
|
+
module.exports = satisfies;
|
|
1383
|
+
}
|
|
1384
|
+
});
|
|
1385
|
+
|
|
1386
|
+
// ../../node_modules/semver/ranges/to-comparators.js
|
|
1387
|
+
var require_to_comparators = __commonJS({
|
|
1388
|
+
"../../node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1389
|
+
"use strict";
|
|
1390
|
+
var Range = require_range();
|
|
1391
|
+
var toComparators = /* @__PURE__ */ __name((range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" ")), "toComparators");
|
|
1392
|
+
module.exports = toComparators;
|
|
1393
|
+
}
|
|
1394
|
+
});
|
|
1395
|
+
|
|
1396
|
+
// ../../node_modules/semver/ranges/max-satisfying.js
|
|
1397
|
+
var require_max_satisfying = __commonJS({
|
|
1398
|
+
"../../node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1399
|
+
"use strict";
|
|
1400
|
+
var SemVer = require_semver();
|
|
1401
|
+
var Range = require_range();
|
|
1402
|
+
var maxSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
1403
|
+
let max = null;
|
|
1404
|
+
let maxSV = null;
|
|
1405
|
+
let rangeObj = null;
|
|
1406
|
+
try {
|
|
1407
|
+
rangeObj = new Range(range, options);
|
|
1408
|
+
} catch (er) {
|
|
1409
|
+
return null;
|
|
1410
|
+
}
|
|
1411
|
+
versions.forEach((v) => {
|
|
1412
|
+
if (rangeObj.test(v)) {
|
|
1413
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1414
|
+
max = v;
|
|
1415
|
+
maxSV = new SemVer(max, options);
|
|
1772
1416
|
}
|
|
1773
1417
|
}
|
|
1774
|
-
debug("caret return", ret);
|
|
1775
|
-
return ret;
|
|
1776
1418
|
});
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
m = 0;
|
|
1804
|
-
}
|
|
1805
|
-
p = 0;
|
|
1806
|
-
if (gtlt === ">") {
|
|
1807
|
-
gtlt = ">=";
|
|
1808
|
-
if (xm) {
|
|
1809
|
-
M = +M + 1;
|
|
1810
|
-
m = 0;
|
|
1811
|
-
p = 0;
|
|
1812
|
-
} else {
|
|
1813
|
-
m = +m + 1;
|
|
1814
|
-
p = 0;
|
|
1815
|
-
}
|
|
1816
|
-
} else if (gtlt === "<=") {
|
|
1817
|
-
gtlt = "<";
|
|
1818
|
-
if (xm) {
|
|
1819
|
-
M = +M + 1;
|
|
1820
|
-
} else {
|
|
1821
|
-
m = +m + 1;
|
|
1822
|
-
}
|
|
1823
|
-
}
|
|
1824
|
-
if (gtlt === "<") {
|
|
1825
|
-
pr = "-0";
|
|
1419
|
+
return max;
|
|
1420
|
+
}, "maxSatisfying");
|
|
1421
|
+
module.exports = maxSatisfying;
|
|
1422
|
+
}
|
|
1423
|
+
});
|
|
1424
|
+
|
|
1425
|
+
// ../../node_modules/semver/ranges/min-satisfying.js
|
|
1426
|
+
var require_min_satisfying = __commonJS({
|
|
1427
|
+
"../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1428
|
+
"use strict";
|
|
1429
|
+
var SemVer = require_semver();
|
|
1430
|
+
var Range = require_range();
|
|
1431
|
+
var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
1432
|
+
let min = null;
|
|
1433
|
+
let minSV = null;
|
|
1434
|
+
let rangeObj = null;
|
|
1435
|
+
try {
|
|
1436
|
+
rangeObj = new Range(range, options);
|
|
1437
|
+
} catch (er) {
|
|
1438
|
+
return null;
|
|
1439
|
+
}
|
|
1440
|
+
versions.forEach((v) => {
|
|
1441
|
+
if (rangeObj.test(v)) {
|
|
1442
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1443
|
+
min = v;
|
|
1444
|
+
minSV = new SemVer(min, options);
|
|
1826
1445
|
}
|
|
1827
|
-
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1828
|
-
} else if (xm) {
|
|
1829
|
-
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1830
|
-
} else if (xp) {
|
|
1831
|
-
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1832
1446
|
}
|
|
1833
|
-
debug("xRange return", ret);
|
|
1834
|
-
return ret;
|
|
1835
1447
|
});
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
} else {
|
|
1855
|
-
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1448
|
+
return min;
|
|
1449
|
+
}, "minSatisfying");
|
|
1450
|
+
module.exports = minSatisfying;
|
|
1451
|
+
}
|
|
1452
|
+
});
|
|
1453
|
+
|
|
1454
|
+
// ../../node_modules/semver/ranges/min-version.js
|
|
1455
|
+
var require_min_version = __commonJS({
|
|
1456
|
+
"../../node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1457
|
+
"use strict";
|
|
1458
|
+
var SemVer = require_semver();
|
|
1459
|
+
var Range = require_range();
|
|
1460
|
+
var gt = require_gt();
|
|
1461
|
+
var minVersion = /* @__PURE__ */ __name((range, loose) => {
|
|
1462
|
+
range = new Range(range, loose);
|
|
1463
|
+
let minver = new SemVer("0.0.0");
|
|
1464
|
+
if (range.test(minver)) {
|
|
1465
|
+
return minver;
|
|
1856
1466
|
}
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
to = `<${+tM + 1}.0.0-0`;
|
|
1861
|
-
} else if (isX(tp)) {
|
|
1862
|
-
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1863
|
-
} else if (tpr) {
|
|
1864
|
-
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1865
|
-
} else if (incPr) {
|
|
1866
|
-
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1867
|
-
} else {
|
|
1868
|
-
to = `<=${to}`;
|
|
1467
|
+
minver = new SemVer("0.0.0-0");
|
|
1468
|
+
if (range.test(minver)) {
|
|
1469
|
+
return minver;
|
|
1869
1470
|
}
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1471
|
+
minver = null;
|
|
1472
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1473
|
+
const comparators = range.set[i];
|
|
1474
|
+
let setMin = null;
|
|
1475
|
+
comparators.forEach((comparator) => {
|
|
1476
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1477
|
+
switch (comparator.operator) {
|
|
1478
|
+
case ">":
|
|
1479
|
+
if (compver.prerelease.length === 0) {
|
|
1480
|
+
compver.patch++;
|
|
1481
|
+
} else {
|
|
1482
|
+
compver.prerelease.push(0);
|
|
1483
|
+
}
|
|
1484
|
+
compver.raw = compver.format();
|
|
1485
|
+
/* fallthrough */
|
|
1486
|
+
case "":
|
|
1487
|
+
case ">=":
|
|
1488
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1489
|
+
setMin = compver;
|
|
1490
|
+
}
|
|
1491
|
+
break;
|
|
1492
|
+
case "<":
|
|
1493
|
+
case "<=":
|
|
1494
|
+
break;
|
|
1495
|
+
/* istanbul ignore next */
|
|
1496
|
+
default:
|
|
1497
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1498
|
+
}
|
|
1499
|
+
});
|
|
1500
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1501
|
+
minver = setMin;
|
|
1876
1502
|
}
|
|
1877
1503
|
}
|
|
1878
|
-
if (
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1504
|
+
if (minver && range.test(minver)) {
|
|
1505
|
+
return minver;
|
|
1506
|
+
}
|
|
1507
|
+
return null;
|
|
1508
|
+
}, "minVersion");
|
|
1509
|
+
module.exports = minVersion;
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
|
|
1513
|
+
// ../../node_modules/semver/ranges/valid.js
|
|
1514
|
+
var require_valid2 = __commonJS({
|
|
1515
|
+
"../../node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1516
|
+
"use strict";
|
|
1517
|
+
var Range = require_range();
|
|
1518
|
+
var validRange = /* @__PURE__ */ __name((range, options) => {
|
|
1519
|
+
try {
|
|
1520
|
+
return new Range(range, options).range || "*";
|
|
1521
|
+
} catch (er) {
|
|
1522
|
+
return null;
|
|
1523
|
+
}
|
|
1524
|
+
}, "validRange");
|
|
1525
|
+
module.exports = validRange;
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
|
|
1529
|
+
// ../../node_modules/semver/ranges/outside.js
|
|
1530
|
+
var require_outside = __commonJS({
|
|
1531
|
+
"../../node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1532
|
+
"use strict";
|
|
1533
|
+
var SemVer = require_semver();
|
|
1534
|
+
var Comparator = require_comparator();
|
|
1535
|
+
var { ANY } = Comparator;
|
|
1536
|
+
var Range = require_range();
|
|
1537
|
+
var satisfies = require_satisfies();
|
|
1538
|
+
var gt = require_gt();
|
|
1539
|
+
var lt = require_lt();
|
|
1540
|
+
var lte = require_lte();
|
|
1541
|
+
var gte = require_gte();
|
|
1542
|
+
var outside = /* @__PURE__ */ __name((version, range, hilo, options) => {
|
|
1543
|
+
version = new SemVer(version, options);
|
|
1544
|
+
range = new Range(range, options);
|
|
1545
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1546
|
+
switch (hilo) {
|
|
1547
|
+
case ">":
|
|
1548
|
+
gtfn = gt;
|
|
1549
|
+
ltefn = lte;
|
|
1550
|
+
ltfn = lt;
|
|
1551
|
+
comp = ">";
|
|
1552
|
+
ecomp = ">=";
|
|
1553
|
+
break;
|
|
1554
|
+
case "<":
|
|
1555
|
+
gtfn = lt;
|
|
1556
|
+
ltefn = gte;
|
|
1557
|
+
ltfn = gt;
|
|
1558
|
+
comp = "<";
|
|
1559
|
+
ecomp = "<=";
|
|
1560
|
+
break;
|
|
1561
|
+
default:
|
|
1562
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1563
|
+
}
|
|
1564
|
+
if (satisfies(version, range, options)) {
|
|
1565
|
+
return false;
|
|
1566
|
+
}
|
|
1567
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1568
|
+
const comparators = range.set[i];
|
|
1569
|
+
let high = null;
|
|
1570
|
+
let low = null;
|
|
1571
|
+
comparators.forEach((comparator) => {
|
|
1572
|
+
if (comparator.semver === ANY) {
|
|
1573
|
+
comparator = new Comparator(">=0.0.0");
|
|
1883
1574
|
}
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1575
|
+
high = high || comparator;
|
|
1576
|
+
low = low || comparator;
|
|
1577
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1578
|
+
high = comparator;
|
|
1579
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1580
|
+
low = comparator;
|
|
1889
1581
|
}
|
|
1582
|
+
});
|
|
1583
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1584
|
+
return false;
|
|
1585
|
+
}
|
|
1586
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1587
|
+
return false;
|
|
1588
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1589
|
+
return false;
|
|
1890
1590
|
}
|
|
1891
|
-
return false;
|
|
1892
1591
|
}
|
|
1893
1592
|
return true;
|
|
1894
|
-
}, "
|
|
1593
|
+
}, "outside");
|
|
1594
|
+
module.exports = outside;
|
|
1895
1595
|
}
|
|
1896
1596
|
});
|
|
1897
1597
|
|
|
1898
|
-
// ../../node_modules/semver/
|
|
1899
|
-
var
|
|
1900
|
-
"../../node_modules/semver/
|
|
1598
|
+
// ../../node_modules/semver/ranges/gtr.js
|
|
1599
|
+
var require_gtr = __commonJS({
|
|
1600
|
+
"../../node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1901
1601
|
"use strict";
|
|
1902
|
-
var
|
|
1903
|
-
var
|
|
1904
|
-
|
|
1905
|
-
|
|
1602
|
+
var outside = require_outside();
|
|
1603
|
+
var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr");
|
|
1604
|
+
module.exports = gtr;
|
|
1605
|
+
}
|
|
1606
|
+
});
|
|
1607
|
+
|
|
1608
|
+
// ../../node_modules/semver/ranges/ltr.js
|
|
1609
|
+
var require_ltr = __commonJS({
|
|
1610
|
+
"../../node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1611
|
+
"use strict";
|
|
1612
|
+
var outside = require_outside();
|
|
1613
|
+
var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr");
|
|
1614
|
+
module.exports = ltr;
|
|
1615
|
+
}
|
|
1616
|
+
});
|
|
1617
|
+
|
|
1618
|
+
// ../../node_modules/semver/ranges/intersects.js
|
|
1619
|
+
var require_intersects = __commonJS({
|
|
1620
|
+
"../../node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1621
|
+
"use strict";
|
|
1622
|
+
var Range = require_range();
|
|
1623
|
+
var intersects = /* @__PURE__ */ __name((r1, r2, options) => {
|
|
1624
|
+
r1 = new Range(r1, options);
|
|
1625
|
+
r2 = new Range(r2, options);
|
|
1626
|
+
return r1.intersects(r2, options);
|
|
1627
|
+
}, "intersects");
|
|
1628
|
+
module.exports = intersects;
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1631
|
+
|
|
1632
|
+
// ../../node_modules/semver/ranges/simplify.js
|
|
1633
|
+
var require_simplify = __commonJS({
|
|
1634
|
+
"../../node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1635
|
+
"use strict";
|
|
1636
|
+
var satisfies = require_satisfies();
|
|
1637
|
+
var compare = require_compare();
|
|
1638
|
+
module.exports = (versions, range, options) => {
|
|
1639
|
+
const set = [];
|
|
1640
|
+
let first = null;
|
|
1641
|
+
let prev = null;
|
|
1642
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1643
|
+
for (const version of v) {
|
|
1644
|
+
const included = satisfies(version, range, options);
|
|
1645
|
+
if (included) {
|
|
1646
|
+
prev = version;
|
|
1647
|
+
if (!first) {
|
|
1648
|
+
first = version;
|
|
1649
|
+
}
|
|
1650
|
+
} else {
|
|
1651
|
+
if (prev) {
|
|
1652
|
+
set.push([first, prev]);
|
|
1653
|
+
}
|
|
1654
|
+
prev = null;
|
|
1655
|
+
first = null;
|
|
1656
|
+
}
|
|
1906
1657
|
}
|
|
1907
|
-
|
|
1908
|
-
|
|
1658
|
+
if (first) {
|
|
1659
|
+
set.push([first, null]);
|
|
1909
1660
|
}
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
if (
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1661
|
+
const ranges = [];
|
|
1662
|
+
for (const [min, max] of set) {
|
|
1663
|
+
if (min === max) {
|
|
1664
|
+
ranges.push(min);
|
|
1665
|
+
} else if (!max && min === v[0]) {
|
|
1666
|
+
ranges.push("*");
|
|
1667
|
+
} else if (!max) {
|
|
1668
|
+
ranges.push(`>=${min}`);
|
|
1669
|
+
} else if (min === v[0]) {
|
|
1670
|
+
ranges.push(`<=${max}`);
|
|
1671
|
+
} else {
|
|
1672
|
+
ranges.push(`${min} - ${max}`);
|
|
1673
|
+
}
|
|
1674
|
+
}
|
|
1675
|
+
const simplified = ranges.join(" || ");
|
|
1676
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1677
|
+
return simplified.length < original.length ? simplified : range;
|
|
1678
|
+
};
|
|
1679
|
+
}
|
|
1680
|
+
});
|
|
1681
|
+
|
|
1682
|
+
// ../../node_modules/semver/ranges/subset.js
|
|
1683
|
+
var require_subset = __commonJS({
|
|
1684
|
+
"../../node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1685
|
+
"use strict";
|
|
1686
|
+
var Range = require_range();
|
|
1687
|
+
var Comparator = require_comparator();
|
|
1688
|
+
var { ANY } = Comparator;
|
|
1689
|
+
var satisfies = require_satisfies();
|
|
1690
|
+
var compare = require_compare();
|
|
1691
|
+
var subset = /* @__PURE__ */ __name((sub, dom, options = {}) => {
|
|
1692
|
+
if (sub === dom) {
|
|
1693
|
+
return true;
|
|
1694
|
+
}
|
|
1695
|
+
sub = new Range(sub, options);
|
|
1696
|
+
dom = new Range(dom, options);
|
|
1697
|
+
let sawNonNull = false;
|
|
1698
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1699
|
+
for (const simpleDom of dom.set) {
|
|
1700
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1701
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1702
|
+
if (isSub) {
|
|
1703
|
+
continue OUTER;
|
|
1917
1704
|
}
|
|
1918
1705
|
}
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
this.options = options;
|
|
1922
|
-
this.loose = !!options.loose;
|
|
1923
|
-
this.parse(comp);
|
|
1924
|
-
if (this.semver === ANY) {
|
|
1925
|
-
this.value = "";
|
|
1926
|
-
} else {
|
|
1927
|
-
this.value = this.operator + this.semver.version;
|
|
1706
|
+
if (sawNonNull) {
|
|
1707
|
+
return false;
|
|
1928
1708
|
}
|
|
1929
|
-
debug("comp", this);
|
|
1930
1709
|
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1710
|
+
return true;
|
|
1711
|
+
}, "subset");
|
|
1712
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1713
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1714
|
+
var simpleSubset = /* @__PURE__ */ __name((sub, dom, options) => {
|
|
1715
|
+
if (sub === dom) {
|
|
1716
|
+
return true;
|
|
1717
|
+
}
|
|
1718
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1719
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1720
|
+
return true;
|
|
1721
|
+
} else if (options.includePrerelease) {
|
|
1722
|
+
sub = minimumVersionWithPreRelease;
|
|
1723
|
+
} else {
|
|
1724
|
+
sub = minimumVersion;
|
|
1936
1725
|
}
|
|
1937
|
-
|
|
1938
|
-
|
|
1939
|
-
|
|
1726
|
+
}
|
|
1727
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1728
|
+
if (options.includePrerelease) {
|
|
1729
|
+
return true;
|
|
1730
|
+
} else {
|
|
1731
|
+
dom = minimumVersion;
|
|
1940
1732
|
}
|
|
1941
|
-
|
|
1942
|
-
|
|
1733
|
+
}
|
|
1734
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1735
|
+
let gt, lt;
|
|
1736
|
+
for (const c of sub) {
|
|
1737
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1738
|
+
gt = higherGT(gt, c, options);
|
|
1739
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1740
|
+
lt = lowerLT(lt, c, options);
|
|
1943
1741
|
} else {
|
|
1944
|
-
|
|
1742
|
+
eqSet.add(c.semver);
|
|
1945
1743
|
}
|
|
1946
1744
|
}
|
|
1947
|
-
|
|
1948
|
-
return
|
|
1745
|
+
if (eqSet.size > 1) {
|
|
1746
|
+
return null;
|
|
1949
1747
|
}
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1748
|
+
let gtltComp;
|
|
1749
|
+
if (gt && lt) {
|
|
1750
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1751
|
+
if (gtltComp > 0) {
|
|
1752
|
+
return null;
|
|
1753
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1754
|
+
return null;
|
|
1954
1755
|
}
|
|
1955
|
-
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1756
|
+
}
|
|
1757
|
+
for (const eq of eqSet) {
|
|
1758
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1759
|
+
return null;
|
|
1760
|
+
}
|
|
1761
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1762
|
+
return null;
|
|
1763
|
+
}
|
|
1764
|
+
for (const c of dom) {
|
|
1765
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1766
|
+
return false;
|
|
1767
|
+
}
|
|
1768
|
+
}
|
|
1769
|
+
return true;
|
|
1770
|
+
}
|
|
1771
|
+
let higher, lower;
|
|
1772
|
+
let hasDomLT, hasDomGT;
|
|
1773
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1774
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1775
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1776
|
+
needDomLTPre = false;
|
|
1777
|
+
}
|
|
1778
|
+
for (const c of dom) {
|
|
1779
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1780
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1781
|
+
if (gt) {
|
|
1782
|
+
if (needDomGTPre) {
|
|
1783
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1784
|
+
needDomGTPre = false;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1788
|
+
higher = higherGT(gt, c, options);
|
|
1789
|
+
if (higher === c && higher !== gt) {
|
|
1790
|
+
return false;
|
|
1791
|
+
}
|
|
1792
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1959
1793
|
return false;
|
|
1960
1794
|
}
|
|
1961
1795
|
}
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
}
|
|
1968
|
-
if (this.operator === "") {
|
|
1969
|
-
if (this.value === "") {
|
|
1970
|
-
return true;
|
|
1796
|
+
if (lt) {
|
|
1797
|
+
if (needDomLTPre) {
|
|
1798
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1799
|
+
needDomLTPre = false;
|
|
1800
|
+
}
|
|
1971
1801
|
}
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1802
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1803
|
+
lower = lowerLT(lt, c, options);
|
|
1804
|
+
if (lower === c && lower !== lt) {
|
|
1805
|
+
return false;
|
|
1806
|
+
}
|
|
1807
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1808
|
+
return false;
|
|
1976
1809
|
}
|
|
1977
|
-
return new Range(this.value, options).test(comp.semver);
|
|
1978
|
-
}
|
|
1979
|
-
options = parseOptions(options);
|
|
1980
|
-
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1981
|
-
return false;
|
|
1982
1810
|
}
|
|
1983
|
-
if (!
|
|
1811
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1984
1812
|
return false;
|
|
1985
1813
|
}
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
}
|
|
1989
|
-
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1990
|
-
return true;
|
|
1991
|
-
}
|
|
1992
|
-
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1993
|
-
return true;
|
|
1994
|
-
}
|
|
1995
|
-
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1996
|
-
return true;
|
|
1997
|
-
}
|
|
1998
|
-
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1999
|
-
return true;
|
|
2000
|
-
}
|
|
1814
|
+
}
|
|
1815
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
2001
1816
|
return false;
|
|
2002
1817
|
}
|
|
2003
|
-
|
|
2004
|
-
module.exports = Comparator;
|
|
2005
|
-
var parseOptions = require_parse_options();
|
|
2006
|
-
var { safeRe: re, t } = require_re();
|
|
2007
|
-
var cmp = require_cmp();
|
|
2008
|
-
var debug = require_debug();
|
|
2009
|
-
var SemVer = require_semver();
|
|
2010
|
-
var Range = require_range();
|
|
2011
|
-
}
|
|
2012
|
-
});
|
|
2013
|
-
|
|
2014
|
-
// ../../node_modules/semver/functions/satisfies.js
|
|
2015
|
-
var require_satisfies = __commonJS({
|
|
2016
|
-
"../../node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
2017
|
-
"use strict";
|
|
2018
|
-
var Range = require_range();
|
|
2019
|
-
var satisfies = /* @__PURE__ */ __name((version, range, options) => {
|
|
2020
|
-
try {
|
|
2021
|
-
range = new Range(range, options);
|
|
2022
|
-
} catch (er) {
|
|
1818
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
2023
1819
|
return false;
|
|
2024
1820
|
}
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
1821
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1822
|
+
return false;
|
|
1823
|
+
}
|
|
1824
|
+
return true;
|
|
1825
|
+
}, "simpleSubset");
|
|
1826
|
+
var higherGT = /* @__PURE__ */ __name((a, b, options) => {
|
|
1827
|
+
if (!a) {
|
|
1828
|
+
return b;
|
|
1829
|
+
}
|
|
1830
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1831
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1832
|
+
}, "higherGT");
|
|
1833
|
+
var lowerLT = /* @__PURE__ */ __name((a, b, options) => {
|
|
1834
|
+
if (!a) {
|
|
1835
|
+
return b;
|
|
1836
|
+
}
|
|
1837
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1838
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1839
|
+
}, "lowerLT");
|
|
1840
|
+
module.exports = subset;
|
|
2028
1841
|
}
|
|
2029
1842
|
});
|
|
2030
1843
|
|
|
2031
|
-
// ../../node_modules/semver/
|
|
2032
|
-
var
|
|
2033
|
-
"../../node_modules/semver/
|
|
1844
|
+
// ../../node_modules/semver/index.js
|
|
1845
|
+
var require_semver2 = __commonJS({
|
|
1846
|
+
"../../node_modules/semver/index.js"(exports, module) {
|
|
2034
1847
|
"use strict";
|
|
1848
|
+
var internalRe = require_re();
|
|
1849
|
+
var constants = require_constants();
|
|
1850
|
+
var SemVer = require_semver();
|
|
1851
|
+
var identifiers = require_identifiers();
|
|
1852
|
+
var parse2 = require_parse();
|
|
1853
|
+
var valid = require_valid();
|
|
1854
|
+
var clean = require_clean();
|
|
1855
|
+
var inc = require_inc();
|
|
1856
|
+
var diff = require_diff();
|
|
1857
|
+
var major = require_major();
|
|
1858
|
+
var minor = require_minor();
|
|
1859
|
+
var patch = require_patch();
|
|
1860
|
+
var prerelease = require_prerelease();
|
|
1861
|
+
var compare = require_compare();
|
|
1862
|
+
var rcompare = require_rcompare();
|
|
1863
|
+
var compareLoose = require_compare_loose();
|
|
1864
|
+
var compareBuild = require_compare_build();
|
|
1865
|
+
var sort = require_sort();
|
|
1866
|
+
var rsort = require_rsort();
|
|
1867
|
+
var gt = require_gt();
|
|
1868
|
+
var lt = require_lt();
|
|
1869
|
+
var eq = require_eq();
|
|
1870
|
+
var neq = require_neq();
|
|
1871
|
+
var gte = require_gte();
|
|
1872
|
+
var lte = require_lte();
|
|
1873
|
+
var cmp = require_cmp();
|
|
1874
|
+
var coerce = require_coerce();
|
|
1875
|
+
var Comparator = require_comparator();
|
|
2035
1876
|
var Range = require_range();
|
|
2036
|
-
var
|
|
2037
|
-
|
|
1877
|
+
var satisfies = require_satisfies();
|
|
1878
|
+
var toComparators = require_to_comparators();
|
|
1879
|
+
var maxSatisfying = require_max_satisfying();
|
|
1880
|
+
var minSatisfying = require_min_satisfying();
|
|
1881
|
+
var minVersion = require_min_version();
|
|
1882
|
+
var validRange = require_valid2();
|
|
1883
|
+
var outside = require_outside();
|
|
1884
|
+
var gtr = require_gtr();
|
|
1885
|
+
var ltr = require_ltr();
|
|
1886
|
+
var intersects = require_intersects();
|
|
1887
|
+
var simplifyRange = require_simplify();
|
|
1888
|
+
var subset = require_subset();
|
|
1889
|
+
module.exports = {
|
|
1890
|
+
parse: parse2,
|
|
1891
|
+
valid,
|
|
1892
|
+
clean,
|
|
1893
|
+
inc,
|
|
1894
|
+
diff,
|
|
1895
|
+
major,
|
|
1896
|
+
minor,
|
|
1897
|
+
patch,
|
|
1898
|
+
prerelease,
|
|
1899
|
+
compare,
|
|
1900
|
+
rcompare,
|
|
1901
|
+
compareLoose,
|
|
1902
|
+
compareBuild,
|
|
1903
|
+
sort,
|
|
1904
|
+
rsort,
|
|
1905
|
+
gt,
|
|
1906
|
+
lt,
|
|
1907
|
+
eq,
|
|
1908
|
+
neq,
|
|
1909
|
+
gte,
|
|
1910
|
+
lte,
|
|
1911
|
+
cmp,
|
|
1912
|
+
coerce,
|
|
1913
|
+
Comparator,
|
|
1914
|
+
Range,
|
|
1915
|
+
satisfies,
|
|
1916
|
+
toComparators,
|
|
1917
|
+
maxSatisfying,
|
|
1918
|
+
minSatisfying,
|
|
1919
|
+
minVersion,
|
|
1920
|
+
validRange,
|
|
1921
|
+
outside,
|
|
1922
|
+
gtr,
|
|
1923
|
+
ltr,
|
|
1924
|
+
intersects,
|
|
1925
|
+
simplifyRange,
|
|
1926
|
+
subset,
|
|
1927
|
+
SemVer,
|
|
1928
|
+
re: internalRe.re,
|
|
1929
|
+
src: internalRe.src,
|
|
1930
|
+
tokens: internalRe.t,
|
|
1931
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1932
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1933
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1934
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1935
|
+
};
|
|
2038
1936
|
}
|
|
2039
1937
|
});
|
|
2040
1938
|
|
|
2041
|
-
// ../../node_modules/
|
|
2042
|
-
var
|
|
2043
|
-
"../../node_modules/
|
|
2044
|
-
|
|
2045
|
-
var
|
|
2046
|
-
var
|
|
2047
|
-
var
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
1939
|
+
// ../../node_modules/lilconfig/src/index.js
|
|
1940
|
+
var require_src = __commonJS({
|
|
1941
|
+
"../../node_modules/lilconfig/src/index.js"(exports, module) {
|
|
1942
|
+
var path2 = __require("path");
|
|
1943
|
+
var fs = __require("fs");
|
|
1944
|
+
var os = __require("os");
|
|
1945
|
+
var url = __require("url");
|
|
1946
|
+
var fsReadFileAsync = fs.promises.readFile;
|
|
1947
|
+
function getDefaultSearchPlaces(name, sync) {
|
|
1948
|
+
return [
|
|
1949
|
+
"package.json",
|
|
1950
|
+
`.${name}rc.json`,
|
|
1951
|
+
`.${name}rc.js`,
|
|
1952
|
+
`.${name}rc.cjs`,
|
|
1953
|
+
...sync ? [] : [`.${name}rc.mjs`],
|
|
1954
|
+
`.config/${name}rc`,
|
|
1955
|
+
`.config/${name}rc.json`,
|
|
1956
|
+
`.config/${name}rc.js`,
|
|
1957
|
+
`.config/${name}rc.cjs`,
|
|
1958
|
+
...sync ? [] : [`.config/${name}rc.mjs`],
|
|
1959
|
+
`${name}.config.js`,
|
|
1960
|
+
`${name}.config.cjs`,
|
|
1961
|
+
...sync ? [] : [`${name}.config.mjs`]
|
|
1962
|
+
];
|
|
1963
|
+
}
|
|
1964
|
+
__name(getDefaultSearchPlaces, "getDefaultSearchPlaces");
|
|
1965
|
+
function parentDir(p) {
|
|
1966
|
+
return path2.dirname(p) || path2.sep;
|
|
1967
|
+
}
|
|
1968
|
+
__name(parentDir, "parentDir");
|
|
1969
|
+
var jsonLoader = /* @__PURE__ */ __name((_, content) => JSON.parse(content), "jsonLoader");
|
|
1970
|
+
var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : __require;
|
|
1971
|
+
var defaultLoadersSync = Object.freeze({
|
|
1972
|
+
".js": requireFunc,
|
|
1973
|
+
".json": requireFunc,
|
|
1974
|
+
".cjs": requireFunc,
|
|
1975
|
+
noExt: jsonLoader
|
|
1976
|
+
});
|
|
1977
|
+
module.exports.defaultLoadersSync = defaultLoadersSync;
|
|
1978
|
+
var dynamicImport = /* @__PURE__ */ __name(async (id) => {
|
|
1979
|
+
try {
|
|
1980
|
+
const fileUrl = url.pathToFileURL(id).href;
|
|
1981
|
+
const mod = await import(
|
|
1982
|
+
/* webpackIgnore: true */
|
|
1983
|
+
fileUrl
|
|
1984
|
+
);
|
|
1985
|
+
return mod.default;
|
|
1986
|
+
} catch (e) {
|
|
1987
|
+
try {
|
|
1988
|
+
return requireFunc(id);
|
|
1989
|
+
} catch (requireE) {
|
|
1990
|
+
if (requireE.code === "ERR_REQUIRE_ESM" || requireE instanceof SyntaxError && requireE.toString().includes("Cannot use import statement outside a module")) {
|
|
1991
|
+
throw e;
|
|
2061
1992
|
}
|
|
1993
|
+
throw requireE;
|
|
2062
1994
|
}
|
|
2063
|
-
});
|
|
2064
|
-
return max;
|
|
2065
|
-
}, "maxSatisfying");
|
|
2066
|
-
module.exports = maxSatisfying;
|
|
2067
|
-
}
|
|
2068
|
-
});
|
|
2069
|
-
|
|
2070
|
-
// ../../node_modules/semver/ranges/min-satisfying.js
|
|
2071
|
-
var require_min_satisfying = __commonJS({
|
|
2072
|
-
"../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
2073
|
-
"use strict";
|
|
2074
|
-
var SemVer = require_semver();
|
|
2075
|
-
var Range = require_range();
|
|
2076
|
-
var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
2077
|
-
let min = null;
|
|
2078
|
-
let minSV = null;
|
|
2079
|
-
let rangeObj = null;
|
|
2080
|
-
try {
|
|
2081
|
-
rangeObj = new Range(range, options);
|
|
2082
|
-
} catch (er) {
|
|
2083
|
-
return null;
|
|
2084
1995
|
}
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
1996
|
+
}, "dynamicImport");
|
|
1997
|
+
var defaultLoaders = Object.freeze({
|
|
1998
|
+
".js": dynamicImport,
|
|
1999
|
+
".mjs": dynamicImport,
|
|
2000
|
+
".cjs": dynamicImport,
|
|
2001
|
+
".json": jsonLoader,
|
|
2002
|
+
noExt: jsonLoader
|
|
2003
|
+
});
|
|
2004
|
+
module.exports.defaultLoaders = defaultLoaders;
|
|
2005
|
+
function getOptions(name, options, sync) {
|
|
2006
|
+
const conf = {
|
|
2007
|
+
stopDir: os.homedir(),
|
|
2008
|
+
searchPlaces: getDefaultSearchPlaces(name, sync),
|
|
2009
|
+
ignoreEmptySearchPlaces: true,
|
|
2010
|
+
cache: true,
|
|
2011
|
+
transform: /* @__PURE__ */ __name((x) => x, "transform"),
|
|
2012
|
+
packageProp: [name],
|
|
2013
|
+
...options,
|
|
2014
|
+
loaders: {
|
|
2015
|
+
...sync ? defaultLoadersSync : defaultLoaders,
|
|
2016
|
+
...options.loaders
|
|
2017
|
+
}
|
|
2018
|
+
};
|
|
2019
|
+
conf.searchPlaces.forEach((place) => {
|
|
2020
|
+
const key = path2.extname(place) || "noExt";
|
|
2021
|
+
const loader2 = conf.loaders[key];
|
|
2022
|
+
if (!loader2) {
|
|
2023
|
+
throw new Error(`Missing loader for extension "${place}"`);
|
|
2024
|
+
}
|
|
2025
|
+
if (typeof loader2 !== "function") {
|
|
2026
|
+
throw new Error(
|
|
2027
|
+
`Loader for extension "${place}" is not a function: Received ${typeof loader2}.`
|
|
2028
|
+
);
|
|
2091
2029
|
}
|
|
2092
2030
|
});
|
|
2093
|
-
return
|
|
2094
|
-
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
if (
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2031
|
+
return conf;
|
|
2032
|
+
}
|
|
2033
|
+
__name(getOptions, "getOptions");
|
|
2034
|
+
function getPackageProp(props, obj) {
|
|
2035
|
+
if (typeof props === "string" && props in obj) return obj[props];
|
|
2036
|
+
return (Array.isArray(props) ? props : props.split(".")).reduce(
|
|
2037
|
+
(acc, prop) => acc === void 0 ? acc : acc[prop],
|
|
2038
|
+
obj
|
|
2039
|
+
) || null;
|
|
2040
|
+
}
|
|
2041
|
+
__name(getPackageProp, "getPackageProp");
|
|
2042
|
+
function validateFilePath(filepath) {
|
|
2043
|
+
if (!filepath) throw new Error("load must pass a non-empty string");
|
|
2044
|
+
}
|
|
2045
|
+
__name(validateFilePath, "validateFilePath");
|
|
2046
|
+
function validateLoader(loader2, ext) {
|
|
2047
|
+
if (!loader2) throw new Error(`No loader specified for extension "${ext}"`);
|
|
2048
|
+
if (typeof loader2 !== "function") throw new Error("loader is not a function");
|
|
2049
|
+
}
|
|
2050
|
+
__name(validateLoader, "validateLoader");
|
|
2051
|
+
var makeEmplace = /* @__PURE__ */ __name((enableCache) => (c, filepath, res) => {
|
|
2052
|
+
if (enableCache) c.set(filepath, res);
|
|
2053
|
+
return res;
|
|
2054
|
+
}, "makeEmplace");
|
|
2055
|
+
module.exports.lilconfig = /* @__PURE__ */ __name(function lilconfig(name, options) {
|
|
2056
|
+
const {
|
|
2057
|
+
ignoreEmptySearchPlaces,
|
|
2058
|
+
loaders,
|
|
2059
|
+
packageProp,
|
|
2060
|
+
searchPlaces,
|
|
2061
|
+
stopDir,
|
|
2062
|
+
transform,
|
|
2063
|
+
cache
|
|
2064
|
+
} = getOptions(name, options ?? {}, false);
|
|
2065
|
+
const searchCache = /* @__PURE__ */ new Map();
|
|
2066
|
+
const loadCache = /* @__PURE__ */ new Map();
|
|
2067
|
+
const emplace = makeEmplace(cache);
|
|
2068
|
+
return {
|
|
2069
|
+
async search(searchFrom = process.cwd()) {
|
|
2070
|
+
const result = {
|
|
2071
|
+
config: null,
|
|
2072
|
+
filepath: ""
|
|
2073
|
+
};
|
|
2074
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2075
|
+
let dir = searchFrom;
|
|
2076
|
+
dirLoop: while (true) {
|
|
2077
|
+
if (cache) {
|
|
2078
|
+
const r = searchCache.get(dir);
|
|
2079
|
+
if (r !== void 0) {
|
|
2080
|
+
for (const p of visited) searchCache.set(p, r);
|
|
2081
|
+
return r;
|
|
2082
|
+
}
|
|
2083
|
+
visited.add(dir);
|
|
2084
|
+
}
|
|
2085
|
+
for (const searchPlace of searchPlaces) {
|
|
2086
|
+
const filepath = path2.join(dir, searchPlace);
|
|
2087
|
+
try {
|
|
2088
|
+
await fs.promises.access(filepath);
|
|
2089
|
+
} catch {
|
|
2090
|
+
continue;
|
|
2091
|
+
}
|
|
2092
|
+
const content = String(await fsReadFileAsync(filepath));
|
|
2093
|
+
const loaderKey = path2.extname(searchPlace) || "noExt";
|
|
2094
|
+
const loader2 = loaders[loaderKey];
|
|
2095
|
+
if (searchPlace === "package.json") {
|
|
2096
|
+
const pkg = await loader2(filepath, content);
|
|
2097
|
+
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
2098
|
+
if (maybeConfig != null) {
|
|
2099
|
+
result.config = maybeConfig;
|
|
2100
|
+
result.filepath = filepath;
|
|
2101
|
+
break dirLoop;
|
|
2102
|
+
}
|
|
2103
|
+
continue;
|
|
2104
|
+
}
|
|
2105
|
+
const isEmpty = content.trim() === "";
|
|
2106
|
+
if (isEmpty && ignoreEmptySearchPlaces) continue;
|
|
2107
|
+
if (isEmpty) {
|
|
2108
|
+
result.isEmpty = true;
|
|
2109
|
+
result.config = void 0;
|
|
2126
2110
|
} else {
|
|
2127
|
-
|
|
2111
|
+
validateLoader(loader2, loaderKey);
|
|
2112
|
+
result.config = await loader2(filepath, content);
|
|
2113
|
+
}
|
|
2114
|
+
result.filepath = filepath;
|
|
2115
|
+
break dirLoop;
|
|
2116
|
+
}
|
|
2117
|
+
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
2118
|
+
dir = parentDir(dir);
|
|
2119
|
+
}
|
|
2120
|
+
const transformed = (
|
|
2121
|
+
// not found
|
|
2122
|
+
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
2123
|
+
);
|
|
2124
|
+
if (cache) {
|
|
2125
|
+
for (const p of visited) searchCache.set(p, transformed);
|
|
2126
|
+
}
|
|
2127
|
+
return transformed;
|
|
2128
|
+
},
|
|
2129
|
+
async load(filepath) {
|
|
2130
|
+
validateFilePath(filepath);
|
|
2131
|
+
const absPath = path2.resolve(process.cwd(), filepath);
|
|
2132
|
+
if (cache && loadCache.has(absPath)) {
|
|
2133
|
+
return loadCache.get(absPath);
|
|
2134
|
+
}
|
|
2135
|
+
const { base, ext } = path2.parse(absPath);
|
|
2136
|
+
const loaderKey = ext || "noExt";
|
|
2137
|
+
const loader2 = loaders[loaderKey];
|
|
2138
|
+
validateLoader(loader2, loaderKey);
|
|
2139
|
+
const content = String(await fsReadFileAsync(absPath));
|
|
2140
|
+
if (base === "package.json") {
|
|
2141
|
+
const pkg = await loader2(absPath, content);
|
|
2142
|
+
return emplace(
|
|
2143
|
+
loadCache,
|
|
2144
|
+
absPath,
|
|
2145
|
+
transform({
|
|
2146
|
+
config: getPackageProp(packageProp, pkg),
|
|
2147
|
+
filepath: absPath
|
|
2148
|
+
})
|
|
2149
|
+
);
|
|
2150
|
+
}
|
|
2151
|
+
const result = {
|
|
2152
|
+
config: null,
|
|
2153
|
+
filepath: absPath
|
|
2154
|
+
};
|
|
2155
|
+
const isEmpty = content.trim() === "";
|
|
2156
|
+
if (isEmpty && ignoreEmptySearchPlaces)
|
|
2157
|
+
return emplace(
|
|
2158
|
+
loadCache,
|
|
2159
|
+
absPath,
|
|
2160
|
+
transform({
|
|
2161
|
+
config: void 0,
|
|
2162
|
+
filepath: absPath,
|
|
2163
|
+
isEmpty: true
|
|
2164
|
+
})
|
|
2165
|
+
);
|
|
2166
|
+
result.config = isEmpty ? void 0 : await loader2(absPath, content);
|
|
2167
|
+
return emplace(
|
|
2168
|
+
loadCache,
|
|
2169
|
+
absPath,
|
|
2170
|
+
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
2171
|
+
);
|
|
2172
|
+
},
|
|
2173
|
+
clearLoadCache() {
|
|
2174
|
+
if (cache) loadCache.clear();
|
|
2175
|
+
},
|
|
2176
|
+
clearSearchCache() {
|
|
2177
|
+
if (cache) searchCache.clear();
|
|
2178
|
+
},
|
|
2179
|
+
clearCaches() {
|
|
2180
|
+
if (cache) {
|
|
2181
|
+
loadCache.clear();
|
|
2182
|
+
searchCache.clear();
|
|
2183
|
+
}
|
|
2184
|
+
}
|
|
2185
|
+
};
|
|
2186
|
+
}, "lilconfig");
|
|
2187
|
+
module.exports.lilconfigSync = /* @__PURE__ */ __name(function lilconfigSync(name, options) {
|
|
2188
|
+
const {
|
|
2189
|
+
ignoreEmptySearchPlaces,
|
|
2190
|
+
loaders,
|
|
2191
|
+
packageProp,
|
|
2192
|
+
searchPlaces,
|
|
2193
|
+
stopDir,
|
|
2194
|
+
transform,
|
|
2195
|
+
cache
|
|
2196
|
+
} = getOptions(name, options ?? {}, true);
|
|
2197
|
+
const searchCache = /* @__PURE__ */ new Map();
|
|
2198
|
+
const loadCache = /* @__PURE__ */ new Map();
|
|
2199
|
+
const emplace = makeEmplace(cache);
|
|
2200
|
+
return {
|
|
2201
|
+
search(searchFrom = process.cwd()) {
|
|
2202
|
+
const result = {
|
|
2203
|
+
config: null,
|
|
2204
|
+
filepath: ""
|
|
2205
|
+
};
|
|
2206
|
+
const visited = /* @__PURE__ */ new Set();
|
|
2207
|
+
let dir = searchFrom;
|
|
2208
|
+
dirLoop: while (true) {
|
|
2209
|
+
if (cache) {
|
|
2210
|
+
const r = searchCache.get(dir);
|
|
2211
|
+
if (r !== void 0) {
|
|
2212
|
+
for (const p of visited) searchCache.set(p, r);
|
|
2213
|
+
return r;
|
|
2128
2214
|
}
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2215
|
+
visited.add(dir);
|
|
2216
|
+
}
|
|
2217
|
+
for (const searchPlace of searchPlaces) {
|
|
2218
|
+
const filepath = path2.join(dir, searchPlace);
|
|
2219
|
+
try {
|
|
2220
|
+
fs.accessSync(filepath);
|
|
2221
|
+
} catch {
|
|
2222
|
+
continue;
|
|
2135
2223
|
}
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2224
|
+
const loaderKey = path2.extname(searchPlace) || "noExt";
|
|
2225
|
+
const loader2 = loaders[loaderKey];
|
|
2226
|
+
const content = String(fs.readFileSync(filepath));
|
|
2227
|
+
if (searchPlace === "package.json") {
|
|
2228
|
+
const pkg = loader2(filepath, content);
|
|
2229
|
+
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
2230
|
+
if (maybeConfig != null) {
|
|
2231
|
+
result.config = maybeConfig;
|
|
2232
|
+
result.filepath = filepath;
|
|
2233
|
+
break dirLoop;
|
|
2234
|
+
}
|
|
2235
|
+
continue;
|
|
2236
|
+
}
|
|
2237
|
+
const isEmpty = content.trim() === "";
|
|
2238
|
+
if (isEmpty && ignoreEmptySearchPlaces) continue;
|
|
2239
|
+
if (isEmpty) {
|
|
2240
|
+
result.isEmpty = true;
|
|
2241
|
+
result.config = void 0;
|
|
2242
|
+
} else {
|
|
2243
|
+
validateLoader(loader2, loaderKey);
|
|
2244
|
+
result.config = loader2(filepath, content);
|
|
2245
|
+
}
|
|
2246
|
+
result.filepath = filepath;
|
|
2247
|
+
break dirLoop;
|
|
2248
|
+
}
|
|
2249
|
+
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
2250
|
+
dir = parentDir(dir);
|
|
2143
2251
|
}
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
return minver;
|
|
2151
|
-
}
|
|
2152
|
-
return null;
|
|
2153
|
-
}, "minVersion");
|
|
2154
|
-
module.exports = minVersion;
|
|
2155
|
-
}
|
|
2156
|
-
});
|
|
2157
|
-
|
|
2158
|
-
// ../../node_modules/semver/ranges/valid.js
|
|
2159
|
-
var require_valid2 = __commonJS({
|
|
2160
|
-
"../../node_modules/semver/ranges/valid.js"(exports, module) {
|
|
2161
|
-
"use strict";
|
|
2162
|
-
var Range = require_range();
|
|
2163
|
-
var validRange = /* @__PURE__ */ __name((range, options) => {
|
|
2164
|
-
try {
|
|
2165
|
-
return new Range(range, options).range || "*";
|
|
2166
|
-
} catch (er) {
|
|
2167
|
-
return null;
|
|
2168
|
-
}
|
|
2169
|
-
}, "validRange");
|
|
2170
|
-
module.exports = validRange;
|
|
2171
|
-
}
|
|
2172
|
-
});
|
|
2173
|
-
|
|
2174
|
-
// ../../node_modules/semver/ranges/outside.js
|
|
2175
|
-
var require_outside = __commonJS({
|
|
2176
|
-
"../../node_modules/semver/ranges/outside.js"(exports, module) {
|
|
2177
|
-
"use strict";
|
|
2178
|
-
var SemVer = require_semver();
|
|
2179
|
-
var Comparator = require_comparator();
|
|
2180
|
-
var { ANY } = Comparator;
|
|
2181
|
-
var Range = require_range();
|
|
2182
|
-
var satisfies = require_satisfies();
|
|
2183
|
-
var gt = require_gt();
|
|
2184
|
-
var lt = require_lt();
|
|
2185
|
-
var lte = require_lte();
|
|
2186
|
-
var gte = require_gte();
|
|
2187
|
-
var outside = /* @__PURE__ */ __name((version, range, hilo, options) => {
|
|
2188
|
-
version = new SemVer(version, options);
|
|
2189
|
-
range = new Range(range, options);
|
|
2190
|
-
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
2191
|
-
switch (hilo) {
|
|
2192
|
-
case ">":
|
|
2193
|
-
gtfn = gt;
|
|
2194
|
-
ltefn = lte;
|
|
2195
|
-
ltfn = lt;
|
|
2196
|
-
comp = ">";
|
|
2197
|
-
ecomp = ">=";
|
|
2198
|
-
break;
|
|
2199
|
-
case "<":
|
|
2200
|
-
gtfn = lt;
|
|
2201
|
-
ltefn = gte;
|
|
2202
|
-
ltfn = gt;
|
|
2203
|
-
comp = "<";
|
|
2204
|
-
ecomp = "<=";
|
|
2205
|
-
break;
|
|
2206
|
-
default:
|
|
2207
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
2208
|
-
}
|
|
2209
|
-
if (satisfies(version, range, options)) {
|
|
2210
|
-
return false;
|
|
2211
|
-
}
|
|
2212
|
-
for (let i = 0; i < range.set.length; ++i) {
|
|
2213
|
-
const comparators = range.set[i];
|
|
2214
|
-
let high = null;
|
|
2215
|
-
let low = null;
|
|
2216
|
-
comparators.forEach((comparator) => {
|
|
2217
|
-
if (comparator.semver === ANY) {
|
|
2218
|
-
comparator = new Comparator(">=0.0.0");
|
|
2252
|
+
const transformed = (
|
|
2253
|
+
// not found
|
|
2254
|
+
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
2255
|
+
);
|
|
2256
|
+
if (cache) {
|
|
2257
|
+
for (const p of visited) searchCache.set(p, transformed);
|
|
2219
2258
|
}
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2259
|
+
return transformed;
|
|
2260
|
+
},
|
|
2261
|
+
load(filepath) {
|
|
2262
|
+
validateFilePath(filepath);
|
|
2263
|
+
const absPath = path2.resolve(process.cwd(), filepath);
|
|
2264
|
+
if (cache && loadCache.has(absPath)) {
|
|
2265
|
+
return loadCache.get(absPath);
|
|
2226
2266
|
}
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
}, "outside");
|
|
2239
|
-
module.exports = outside;
|
|
2240
|
-
}
|
|
2241
|
-
});
|
|
2242
|
-
|
|
2243
|
-
// ../../node_modules/semver/ranges/gtr.js
|
|
2244
|
-
var require_gtr = __commonJS({
|
|
2245
|
-
"../../node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
2246
|
-
"use strict";
|
|
2247
|
-
var outside = require_outside();
|
|
2248
|
-
var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr");
|
|
2249
|
-
module.exports = gtr;
|
|
2250
|
-
}
|
|
2251
|
-
});
|
|
2252
|
-
|
|
2253
|
-
// ../../node_modules/semver/ranges/ltr.js
|
|
2254
|
-
var require_ltr = __commonJS({
|
|
2255
|
-
"../../node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
2256
|
-
"use strict";
|
|
2257
|
-
var outside = require_outside();
|
|
2258
|
-
var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr");
|
|
2259
|
-
module.exports = ltr;
|
|
2260
|
-
}
|
|
2261
|
-
});
|
|
2262
|
-
|
|
2263
|
-
// ../../node_modules/semver/ranges/intersects.js
|
|
2264
|
-
var require_intersects = __commonJS({
|
|
2265
|
-
"../../node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
2266
|
-
"use strict";
|
|
2267
|
-
var Range = require_range();
|
|
2268
|
-
var intersects = /* @__PURE__ */ __name((r1, r2, options) => {
|
|
2269
|
-
r1 = new Range(r1, options);
|
|
2270
|
-
r2 = new Range(r2, options);
|
|
2271
|
-
return r1.intersects(r2, options);
|
|
2272
|
-
}, "intersects");
|
|
2273
|
-
module.exports = intersects;
|
|
2274
|
-
}
|
|
2275
|
-
});
|
|
2276
|
-
|
|
2277
|
-
// ../../node_modules/semver/ranges/simplify.js
|
|
2278
|
-
var require_simplify = __commonJS({
|
|
2279
|
-
"../../node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
2280
|
-
"use strict";
|
|
2281
|
-
var satisfies = require_satisfies();
|
|
2282
|
-
var compare = require_compare();
|
|
2283
|
-
module.exports = (versions, range, options) => {
|
|
2284
|
-
const set = [];
|
|
2285
|
-
let first = null;
|
|
2286
|
-
let prev = null;
|
|
2287
|
-
const v = versions.sort((a, b) => compare(a, b, options));
|
|
2288
|
-
for (const version of v) {
|
|
2289
|
-
const included = satisfies(version, range, options);
|
|
2290
|
-
if (included) {
|
|
2291
|
-
prev = version;
|
|
2292
|
-
if (!first) {
|
|
2293
|
-
first = version;
|
|
2267
|
+
const { base, ext } = path2.parse(absPath);
|
|
2268
|
+
const loaderKey = ext || "noExt";
|
|
2269
|
+
const loader2 = loaders[loaderKey];
|
|
2270
|
+
validateLoader(loader2, loaderKey);
|
|
2271
|
+
const content = String(fs.readFileSync(absPath));
|
|
2272
|
+
if (base === "package.json") {
|
|
2273
|
+
const pkg = loader2(absPath, content);
|
|
2274
|
+
return transform({
|
|
2275
|
+
config: getPackageProp(packageProp, pkg),
|
|
2276
|
+
filepath: absPath
|
|
2277
|
+
});
|
|
2294
2278
|
}
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2279
|
+
const result = {
|
|
2280
|
+
config: null,
|
|
2281
|
+
filepath: absPath
|
|
2282
|
+
};
|
|
2283
|
+
const isEmpty = content.trim() === "";
|
|
2284
|
+
if (isEmpty && ignoreEmptySearchPlaces)
|
|
2285
|
+
return emplace(
|
|
2286
|
+
loadCache,
|
|
2287
|
+
absPath,
|
|
2288
|
+
transform({
|
|
2289
|
+
filepath: absPath,
|
|
2290
|
+
config: void 0,
|
|
2291
|
+
isEmpty: true
|
|
2292
|
+
})
|
|
2293
|
+
);
|
|
2294
|
+
result.config = isEmpty ? void 0 : loader2(absPath, content);
|
|
2295
|
+
return emplace(
|
|
2296
|
+
loadCache,
|
|
2297
|
+
absPath,
|
|
2298
|
+
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
2299
|
+
);
|
|
2300
|
+
},
|
|
2301
|
+
clearLoadCache() {
|
|
2302
|
+
if (cache) loadCache.clear();
|
|
2303
|
+
},
|
|
2304
|
+
clearSearchCache() {
|
|
2305
|
+
if (cache) searchCache.clear();
|
|
2306
|
+
},
|
|
2307
|
+
clearCaches() {
|
|
2308
|
+
if (cache) {
|
|
2309
|
+
loadCache.clear();
|
|
2310
|
+
searchCache.clear();
|
|
2298
2311
|
}
|
|
2299
|
-
prev = null;
|
|
2300
|
-
first = null;
|
|
2301
|
-
}
|
|
2302
|
-
}
|
|
2303
|
-
if (first) {
|
|
2304
|
-
set.push([first, null]);
|
|
2305
|
-
}
|
|
2306
|
-
const ranges = [];
|
|
2307
|
-
for (const [min, max] of set) {
|
|
2308
|
-
if (min === max) {
|
|
2309
|
-
ranges.push(min);
|
|
2310
|
-
} else if (!max && min === v[0]) {
|
|
2311
|
-
ranges.push("*");
|
|
2312
|
-
} else if (!max) {
|
|
2313
|
-
ranges.push(`>=${min}`);
|
|
2314
|
-
} else if (min === v[0]) {
|
|
2315
|
-
ranges.push(`<=${max}`);
|
|
2316
|
-
} else {
|
|
2317
|
-
ranges.push(`${min} - ${max}`);
|
|
2318
2312
|
}
|
|
2319
|
-
}
|
|
2320
|
-
|
|
2321
|
-
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
2322
|
-
return simplified.length < original.length ? simplified : range;
|
|
2323
|
-
};
|
|
2313
|
+
};
|
|
2314
|
+
}, "lilconfigSync");
|
|
2324
2315
|
}
|
|
2325
2316
|
});
|
|
2326
2317
|
|
|
2327
|
-
// ../../node_modules/
|
|
2328
|
-
var
|
|
2329
|
-
"../../node_modules/
|
|
2330
|
-
|
|
2331
|
-
var
|
|
2332
|
-
var
|
|
2333
|
-
var
|
|
2334
|
-
var
|
|
2335
|
-
var
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
OUTER: for (const simpleSub of sub.set) {
|
|
2344
|
-
for (const simpleDom of dom.set) {
|
|
2345
|
-
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
2346
|
-
sawNonNull = sawNonNull || isSub !== null;
|
|
2347
|
-
if (isSub) {
|
|
2348
|
-
continue OUTER;
|
|
2349
|
-
}
|
|
2350
|
-
}
|
|
2351
|
-
if (sawNonNull) {
|
|
2352
|
-
return false;
|
|
2318
|
+
// ../../node_modules/postcss-load-config/src/req.js
|
|
2319
|
+
var require_req = __commonJS({
|
|
2320
|
+
"../../node_modules/postcss-load-config/src/req.js"(exports, module) {
|
|
2321
|
+
var { createRequire: createRequire3 } = __require("node:module");
|
|
2322
|
+
var { pathToFileURL: pathToFileURL2 } = __require("node:url");
|
|
2323
|
+
var TS_EXT_RE = /\.[mc]?ts$/;
|
|
2324
|
+
var tsx;
|
|
2325
|
+
var jiti;
|
|
2326
|
+
var importError = [];
|
|
2327
|
+
async function req(name, rootFile = __filename) {
|
|
2328
|
+
let url = createRequire3(rootFile).resolve(name);
|
|
2329
|
+
try {
|
|
2330
|
+
return (await import(`${pathToFileURL2(url)}?t=${Date.now()}`)).default;
|
|
2331
|
+
} catch (err) {
|
|
2332
|
+
if (!TS_EXT_RE.test(url)) {
|
|
2333
|
+
throw err;
|
|
2353
2334
|
}
|
|
2354
2335
|
}
|
|
2355
|
-
|
|
2356
|
-
|
|
2357
|
-
|
|
2358
|
-
|
|
2359
|
-
|
|
2360
|
-
if (sub === dom) {
|
|
2361
|
-
return true;
|
|
2362
|
-
}
|
|
2363
|
-
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
2364
|
-
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
2365
|
-
return true;
|
|
2366
|
-
} else if (options.includePrerelease) {
|
|
2367
|
-
sub = minimumVersionWithPreRelease;
|
|
2368
|
-
} else {
|
|
2369
|
-
sub = minimumVersion;
|
|
2336
|
+
if (tsx === void 0) {
|
|
2337
|
+
try {
|
|
2338
|
+
tsx = await import("tsx/cjs/api");
|
|
2339
|
+
} catch (error) {
|
|
2340
|
+
importError.push(error);
|
|
2370
2341
|
}
|
|
2371
2342
|
}
|
|
2372
|
-
if (
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
} else {
|
|
2376
|
-
dom = minimumVersion;
|
|
2377
|
-
}
|
|
2343
|
+
if (tsx) {
|
|
2344
|
+
let loaded = tsx.require(name, rootFile);
|
|
2345
|
+
return loaded && "__esModule" in loaded ? loaded.default : loaded;
|
|
2378
2346
|
}
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
} else if (c.operator === "<" || c.operator === "<=") {
|
|
2385
|
-
lt = lowerLT(lt, c, options);
|
|
2386
|
-
} else {
|
|
2387
|
-
eqSet.add(c.semver);
|
|
2347
|
+
if (jiti === void 0) {
|
|
2348
|
+
try {
|
|
2349
|
+
jiti = (await import("./_node-chunks/jiti-43IRZTPX.js")).default;
|
|
2350
|
+
} catch (error) {
|
|
2351
|
+
importError.push(error);
|
|
2388
2352
|
}
|
|
2389
2353
|
}
|
|
2390
|
-
if (
|
|
2391
|
-
return
|
|
2354
|
+
if (jiti) {
|
|
2355
|
+
return jiti(rootFile, { interopDefault: true })(name);
|
|
2392
2356
|
}
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2357
|
+
throw new Error(
|
|
2358
|
+
`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed
|
|
2359
|
+
Error: ${importError.map((error) => error.message).join("\n")}`
|
|
2360
|
+
);
|
|
2361
|
+
}
|
|
2362
|
+
__name(req, "req");
|
|
2363
|
+
module.exports = req;
|
|
2364
|
+
}
|
|
2365
|
+
});
|
|
2366
|
+
|
|
2367
|
+
// ../../node_modules/postcss-load-config/src/options.js
|
|
2368
|
+
var require_options = __commonJS({
|
|
2369
|
+
"../../node_modules/postcss-load-config/src/options.js"(exports, module) {
|
|
2370
|
+
var req = require_req();
|
|
2371
|
+
async function options(config2, file) {
|
|
2372
|
+
if (config2.parser && typeof config2.parser === "string") {
|
|
2373
|
+
try {
|
|
2374
|
+
config2.parser = await req(config2.parser, file);
|
|
2375
|
+
} catch (err) {
|
|
2376
|
+
throw new Error(
|
|
2377
|
+
`Loading PostCSS Parser failed: ${err.message}
|
|
2378
|
+
|
|
2379
|
+
(@${file})`
|
|
2380
|
+
);
|
|
2400
2381
|
}
|
|
2401
2382
|
}
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2383
|
+
if (config2.syntax && typeof config2.syntax === "string") {
|
|
2384
|
+
try {
|
|
2385
|
+
config2.syntax = await req(config2.syntax, file);
|
|
2386
|
+
} catch (err) {
|
|
2387
|
+
throw new Error(
|
|
2388
|
+
`Loading PostCSS Syntax failed: ${err.message}
|
|
2389
|
+
|
|
2390
|
+
(@${file})`
|
|
2391
|
+
);
|
|
2405
2392
|
}
|
|
2406
|
-
|
|
2407
|
-
|
|
2393
|
+
}
|
|
2394
|
+
if (config2.stringifier && typeof config2.stringifier === "string") {
|
|
2395
|
+
try {
|
|
2396
|
+
config2.stringifier = await req(config2.stringifier, file);
|
|
2397
|
+
} catch (err) {
|
|
2398
|
+
throw new Error(
|
|
2399
|
+
`Loading PostCSS Stringifier failed: ${err.message}
|
|
2400
|
+
|
|
2401
|
+
(@${file})`
|
|
2402
|
+
);
|
|
2408
2403
|
}
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2404
|
+
}
|
|
2405
|
+
return config2;
|
|
2406
|
+
}
|
|
2407
|
+
__name(options, "options");
|
|
2408
|
+
module.exports = options;
|
|
2409
|
+
}
|
|
2410
|
+
});
|
|
2411
|
+
|
|
2412
|
+
// ../../node_modules/postcss-load-config/src/plugins.js
|
|
2413
|
+
var require_plugins = __commonJS({
|
|
2414
|
+
"../../node_modules/postcss-load-config/src/plugins.js"(exports, module) {
|
|
2415
|
+
var req = require_req();
|
|
2416
|
+
async function load(plugin, options, file) {
|
|
2417
|
+
try {
|
|
2418
|
+
if (options === null || options === void 0 || Object.keys(options).length === 0) {
|
|
2419
|
+
return await req(plugin, file);
|
|
2420
|
+
} else {
|
|
2421
|
+
return (await req(plugin, file))(options);
|
|
2413
2422
|
}
|
|
2414
|
-
|
|
2423
|
+
} catch (err) {
|
|
2424
|
+
throw new Error(
|
|
2425
|
+
`Loading PostCSS Plugin failed: ${err.message}
|
|
2426
|
+
|
|
2427
|
+
(@${file})`
|
|
2428
|
+
);
|
|
2415
2429
|
}
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
let
|
|
2420
|
-
if (
|
|
2421
|
-
|
|
2430
|
+
}
|
|
2431
|
+
__name(load, "load");
|
|
2432
|
+
async function plugins(config2, file) {
|
|
2433
|
+
let list = [];
|
|
2434
|
+
if (Array.isArray(config2.plugins)) {
|
|
2435
|
+
list = config2.plugins.filter(Boolean);
|
|
2436
|
+
} else {
|
|
2437
|
+
list = Object.entries(config2.plugins).filter(([, options]) => {
|
|
2438
|
+
return options !== false;
|
|
2439
|
+
}).map(([plugin, options]) => {
|
|
2440
|
+
return load(plugin, options, file);
|
|
2441
|
+
});
|
|
2442
|
+
list = await Promise.all(list);
|
|
2422
2443
|
}
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
if (needDomGTPre) {
|
|
2428
|
-
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
2429
|
-
needDomGTPre = false;
|
|
2430
|
-
}
|
|
2431
|
-
}
|
|
2432
|
-
if (c.operator === ">" || c.operator === ">=") {
|
|
2433
|
-
higher = higherGT(gt, c, options);
|
|
2434
|
-
if (higher === c && higher !== gt) {
|
|
2435
|
-
return false;
|
|
2436
|
-
}
|
|
2437
|
-
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
2438
|
-
return false;
|
|
2444
|
+
if (list.length && list.length > 0) {
|
|
2445
|
+
list.forEach((plugin, i) => {
|
|
2446
|
+
if (plugin.default) {
|
|
2447
|
+
plugin = plugin.default;
|
|
2439
2448
|
}
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
if (
|
|
2443
|
-
|
|
2444
|
-
needDomLTPre = false;
|
|
2445
|
-
}
|
|
2449
|
+
if (plugin.postcss === true) {
|
|
2450
|
+
plugin = plugin();
|
|
2451
|
+
} else if (plugin.postcss) {
|
|
2452
|
+
plugin = plugin.postcss;
|
|
2446
2453
|
}
|
|
2447
|
-
if (
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
return false;
|
|
2454
|
+
if (!(typeof plugin === "object" && Array.isArray(plugin.plugins) || typeof plugin === "object" && plugin.postcssPlugin || typeof plugin === "function")) {
|
|
2455
|
+
throw new TypeError(
|
|
2456
|
+
`Invalid PostCSS Plugin found at: plugins[${i}]
|
|
2457
|
+
|
|
2458
|
+
(@${file})`
|
|
2459
|
+
);
|
|
2454
2460
|
}
|
|
2455
|
-
}
|
|
2456
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
2457
|
-
return false;
|
|
2458
|
-
}
|
|
2459
|
-
}
|
|
2460
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
2461
|
-
return false;
|
|
2461
|
+
});
|
|
2462
2462
|
}
|
|
2463
|
-
|
|
2464
|
-
|
|
2463
|
+
return list;
|
|
2464
|
+
}
|
|
2465
|
+
__name(plugins, "plugins");
|
|
2466
|
+
module.exports = plugins;
|
|
2467
|
+
}
|
|
2468
|
+
});
|
|
2469
|
+
|
|
2470
|
+
// ../../node_modules/postcss-load-config/src/index.js
|
|
2471
|
+
var require_src2 = __commonJS({
|
|
2472
|
+
"../../node_modules/postcss-load-config/src/index.js"(exports, module) {
|
|
2473
|
+
var { resolve: resolve2 } = __require("node:path");
|
|
2474
|
+
var config2 = require_src();
|
|
2475
|
+
var loadOptions = require_options();
|
|
2476
|
+
var loadPlugins = require_plugins();
|
|
2477
|
+
var req = require_req();
|
|
2478
|
+
var interopRequireDefault = /* @__PURE__ */ __name((obj) => obj && obj.__esModule ? obj : { default: obj }, "interopRequireDefault");
|
|
2479
|
+
async function processResult(ctx, result) {
|
|
2480
|
+
let file = result.filepath || "";
|
|
2481
|
+
let projectConfig = interopRequireDefault(result.config).default || {};
|
|
2482
|
+
if (typeof projectConfig === "function") {
|
|
2483
|
+
projectConfig = projectConfig(ctx);
|
|
2484
|
+
} else {
|
|
2485
|
+
projectConfig = Object.assign({}, projectConfig, ctx);
|
|
2465
2486
|
}
|
|
2466
|
-
if (
|
|
2467
|
-
|
|
2487
|
+
if (!projectConfig.plugins) {
|
|
2488
|
+
projectConfig.plugins = [];
|
|
2468
2489
|
}
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2490
|
+
let res = {
|
|
2491
|
+
file,
|
|
2492
|
+
options: await loadOptions(projectConfig, file),
|
|
2493
|
+
plugins: await loadPlugins(projectConfig, file)
|
|
2494
|
+
};
|
|
2495
|
+
delete projectConfig.plugins;
|
|
2496
|
+
return res;
|
|
2497
|
+
}
|
|
2498
|
+
__name(processResult, "processResult");
|
|
2499
|
+
function createContext(ctx) {
|
|
2500
|
+
ctx = Object.assign(
|
|
2501
|
+
{
|
|
2502
|
+
cwd: process.cwd(),
|
|
2503
|
+
env: process.env.NODE_ENV
|
|
2504
|
+
},
|
|
2505
|
+
ctx
|
|
2506
|
+
);
|
|
2507
|
+
if (!ctx.env) {
|
|
2508
|
+
process.env.NODE_ENV = "development";
|
|
2474
2509
|
}
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2510
|
+
return ctx;
|
|
2511
|
+
}
|
|
2512
|
+
__name(createContext, "createContext");
|
|
2513
|
+
async function loader2(filepath) {
|
|
2514
|
+
return req(filepath);
|
|
2515
|
+
}
|
|
2516
|
+
__name(loader2, "loader");
|
|
2517
|
+
var yaml;
|
|
2518
|
+
async function yamlLoader(_, content) {
|
|
2519
|
+
if (!yaml) {
|
|
2520
|
+
try {
|
|
2521
|
+
yaml = await import("./_node-chunks/dist-SNJHMWZO.js");
|
|
2522
|
+
} catch (e) {
|
|
2523
|
+
throw new Error(
|
|
2524
|
+
`'yaml' is required for the YAML configuration files. Make sure it is installed
|
|
2525
|
+
Error: ${e.message}`
|
|
2526
|
+
);
|
|
2527
|
+
}
|
|
2481
2528
|
}
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
module.exports = {
|
|
2535
|
-
parse: parse2,
|
|
2536
|
-
valid,
|
|
2537
|
-
clean,
|
|
2538
|
-
inc,
|
|
2539
|
-
diff,
|
|
2540
|
-
major,
|
|
2541
|
-
minor,
|
|
2542
|
-
patch,
|
|
2543
|
-
prerelease,
|
|
2544
|
-
compare,
|
|
2545
|
-
rcompare,
|
|
2546
|
-
compareLoose,
|
|
2547
|
-
compareBuild,
|
|
2548
|
-
sort,
|
|
2549
|
-
rsort,
|
|
2550
|
-
gt,
|
|
2551
|
-
lt,
|
|
2552
|
-
eq,
|
|
2553
|
-
neq,
|
|
2554
|
-
gte,
|
|
2555
|
-
lte,
|
|
2556
|
-
cmp,
|
|
2557
|
-
coerce,
|
|
2558
|
-
Comparator,
|
|
2559
|
-
Range,
|
|
2560
|
-
satisfies,
|
|
2561
|
-
toComparators,
|
|
2562
|
-
maxSatisfying,
|
|
2563
|
-
minSatisfying,
|
|
2564
|
-
minVersion,
|
|
2565
|
-
validRange,
|
|
2566
|
-
outside,
|
|
2567
|
-
gtr,
|
|
2568
|
-
ltr,
|
|
2569
|
-
intersects,
|
|
2570
|
-
simplifyRange,
|
|
2571
|
-
subset,
|
|
2572
|
-
SemVer,
|
|
2573
|
-
re: internalRe.re,
|
|
2574
|
-
src: internalRe.src,
|
|
2575
|
-
tokens: internalRe.t,
|
|
2576
|
-
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
2577
|
-
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
2578
|
-
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2579
|
-
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2580
|
-
};
|
|
2529
|
+
return yaml.parse(content);
|
|
2530
|
+
}
|
|
2531
|
+
__name(yamlLoader, "yamlLoader");
|
|
2532
|
+
var withLoaders2 = /* @__PURE__ */ __name((options = {}) => {
|
|
2533
|
+
let moduleName = "postcss";
|
|
2534
|
+
return {
|
|
2535
|
+
...options,
|
|
2536
|
+
loaders: {
|
|
2537
|
+
...options.loaders,
|
|
2538
|
+
".cjs": loader2,
|
|
2539
|
+
".cts": loader2,
|
|
2540
|
+
".js": loader2,
|
|
2541
|
+
".mjs": loader2,
|
|
2542
|
+
".mts": loader2,
|
|
2543
|
+
".ts": loader2,
|
|
2544
|
+
".yaml": yamlLoader,
|
|
2545
|
+
".yml": yamlLoader
|
|
2546
|
+
},
|
|
2547
|
+
searchPlaces: [
|
|
2548
|
+
...options.searchPlaces || [],
|
|
2549
|
+
"package.json",
|
|
2550
|
+
`.${moduleName}rc`,
|
|
2551
|
+
`.${moduleName}rc.json`,
|
|
2552
|
+
`.${moduleName}rc.yaml`,
|
|
2553
|
+
`.${moduleName}rc.yml`,
|
|
2554
|
+
`.${moduleName}rc.ts`,
|
|
2555
|
+
`.${moduleName}rc.cts`,
|
|
2556
|
+
`.${moduleName}rc.mts`,
|
|
2557
|
+
`.${moduleName}rc.js`,
|
|
2558
|
+
`.${moduleName}rc.cjs`,
|
|
2559
|
+
`.${moduleName}rc.mjs`,
|
|
2560
|
+
`${moduleName}.config.ts`,
|
|
2561
|
+
`${moduleName}.config.cts`,
|
|
2562
|
+
`${moduleName}.config.mts`,
|
|
2563
|
+
`${moduleName}.config.js`,
|
|
2564
|
+
`${moduleName}.config.cjs`,
|
|
2565
|
+
`${moduleName}.config.mjs`
|
|
2566
|
+
]
|
|
2567
|
+
};
|
|
2568
|
+
}, "withLoaders");
|
|
2569
|
+
function rc(ctx, path2, options) {
|
|
2570
|
+
ctx = createContext(ctx);
|
|
2571
|
+
path2 = path2 ? resolve2(path2) : process.cwd();
|
|
2572
|
+
return config2.lilconfig("postcss", withLoaders2(options)).search(path2).then((result) => {
|
|
2573
|
+
if (!result) {
|
|
2574
|
+
throw new Error(`No PostCSS Config found in: ${path2}`);
|
|
2575
|
+
}
|
|
2576
|
+
return processResult(ctx, result);
|
|
2577
|
+
});
|
|
2578
|
+
}
|
|
2579
|
+
__name(rc, "rc");
|
|
2580
|
+
module.exports = rc;
|
|
2581
2581
|
}
|
|
2582
2582
|
});
|
|
2583
2583
|
|
|
2584
2584
|
// src/preset.ts
|
|
2585
|
-
var import_postcss_load_config = __toESM(require_src2(), 1);
|
|
2586
2585
|
var import_semver = __toESM(require_semver2(), 1);
|
|
2587
|
-
import { createRequire } from "node:module";
|
|
2586
|
+
import { createRequire as createRequire2 } from "node:module";
|
|
2588
2587
|
import { dirname as dirname2 } from "node:path";
|
|
2589
2588
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
2589
|
+
import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
|
|
2590
|
+
|
|
2591
|
+
// src/find-postcss-config.ts
|
|
2592
|
+
var import_lilconfig = __toESM(require_src(), 1);
|
|
2593
|
+
var import_postcss_load_config = __toESM(require_src2(), 1);
|
|
2594
|
+
import { readFile, writeFile } from "node:fs/promises";
|
|
2595
|
+
import { createRequire } from "node:module";
|
|
2590
2596
|
import { getProjectRoot } from "storybook/internal/common";
|
|
2591
2597
|
import { IncompatiblePostCssConfigError } from "storybook/internal/server-errors";
|
|
2592
|
-
|
|
2598
|
+
var require2 = createRequire(import.meta.url);
|
|
2599
|
+
async function loader(filepath) {
|
|
2600
|
+
return require2(filepath);
|
|
2601
|
+
}
|
|
2602
|
+
__name(loader, "loader");
|
|
2603
|
+
var withLoaders = /* @__PURE__ */ __name((options = {}) => {
|
|
2604
|
+
const moduleName = "postcss";
|
|
2605
|
+
return {
|
|
2606
|
+
...options,
|
|
2607
|
+
loaders: {
|
|
2608
|
+
...options.loaders,
|
|
2609
|
+
".cjs": loader,
|
|
2610
|
+
".cts": loader,
|
|
2611
|
+
".js": loader,
|
|
2612
|
+
".mjs": loader,
|
|
2613
|
+
".mts": loader,
|
|
2614
|
+
".ts": loader
|
|
2615
|
+
},
|
|
2616
|
+
searchPlaces: [
|
|
2617
|
+
...options.searchPlaces ?? [],
|
|
2618
|
+
"package.json",
|
|
2619
|
+
`.${moduleName}rc`,
|
|
2620
|
+
`.${moduleName}rc.json`,
|
|
2621
|
+
`.${moduleName}rc.ts`,
|
|
2622
|
+
`.${moduleName}rc.cts`,
|
|
2623
|
+
`.${moduleName}rc.mts`,
|
|
2624
|
+
`.${moduleName}rc.js`,
|
|
2625
|
+
`.${moduleName}rc.cjs`,
|
|
2626
|
+
`.${moduleName}rc.mjs`,
|
|
2627
|
+
`${moduleName}.config.ts`,
|
|
2628
|
+
`${moduleName}.config.cts`,
|
|
2629
|
+
`${moduleName}.config.mts`,
|
|
2630
|
+
`${moduleName}.config.js`,
|
|
2631
|
+
`${moduleName}.config.cjs`,
|
|
2632
|
+
`${moduleName}.config.mjs`
|
|
2633
|
+
]
|
|
2634
|
+
};
|
|
2635
|
+
}, "withLoaders");
|
|
2636
|
+
async function postCssFindConfig(path2, options = {}) {
|
|
2637
|
+
const result = await import_lilconfig.default.lilconfig("postcss", withLoaders(options)).search(path2);
|
|
2638
|
+
return result ? result.filepath : null;
|
|
2639
|
+
}
|
|
2640
|
+
__name(postCssFindConfig, "postCssFindConfig");
|
|
2641
|
+
var normalizePostCssConfig = /* @__PURE__ */ __name(async (searchPath) => {
|
|
2642
|
+
const configPath = await postCssFindConfig(searchPath);
|
|
2643
|
+
if (!configPath) {
|
|
2644
|
+
return true;
|
|
2645
|
+
}
|
|
2646
|
+
let error;
|
|
2647
|
+
try {
|
|
2648
|
+
await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
|
|
2649
|
+
return true;
|
|
2650
|
+
} catch (e) {
|
|
2651
|
+
if (e instanceof Error) {
|
|
2652
|
+
error = e;
|
|
2653
|
+
}
|
|
2654
|
+
}
|
|
2655
|
+
if (!error) {
|
|
2656
|
+
return true;
|
|
2657
|
+
}
|
|
2658
|
+
if (error.message.includes("No PostCSS Config found")) {
|
|
2659
|
+
return true;
|
|
2660
|
+
}
|
|
2661
|
+
if (error.message.includes("Invalid PostCSS Plugin found")) {
|
|
2662
|
+
const originalContent = await readFile(configPath, "utf8");
|
|
2663
|
+
try {
|
|
2664
|
+
const modifiedContent = originalContent.replace(
|
|
2665
|
+
'plugins: ["@tailwindcss/postcss"]',
|
|
2666
|
+
'plugins: { "@tailwindcss/postcss": {} }'
|
|
2667
|
+
);
|
|
2668
|
+
await writeFile(configPath, modifiedContent, "utf8");
|
|
2669
|
+
await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
|
|
2670
|
+
return true;
|
|
2671
|
+
} catch (e) {
|
|
2672
|
+
await writeFile(configPath, originalContent, "utf8");
|
|
2673
|
+
throw new IncompatiblePostCssConfigError({ error });
|
|
2674
|
+
}
|
|
2675
|
+
}
|
|
2676
|
+
return false;
|
|
2677
|
+
}, "normalizePostCssConfig");
|
|
2593
2678
|
|
|
2594
2679
|
// src/utils.ts
|
|
2595
2680
|
import { readFileSync } from "node:fs";
|
|
@@ -3056,12 +3141,12 @@ var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
|
|
|
3056
3141
|
var getNextjsVersion = /* @__PURE__ */ __name(() => JSON.parse(readFileSync(join2(resolvePackageDir("next"), "package.json"), "utf8")).version, "getNextjsVersion");
|
|
3057
3142
|
|
|
3058
3143
|
// src/preset.ts
|
|
3059
|
-
var
|
|
3060
|
-
var vitePluginStorybookNextjs =
|
|
3061
|
-
var core = /* @__PURE__ */ __name(async (
|
|
3144
|
+
var require3 = createRequire2(import.meta.url);
|
|
3145
|
+
var vitePluginStorybookNextjs = require3("vite-plugin-storybook-nextjs");
|
|
3146
|
+
var core = /* @__PURE__ */ __name(async (config2, options) => {
|
|
3062
3147
|
const framework = await options.presets.apply("framework");
|
|
3063
3148
|
return {
|
|
3064
|
-
...
|
|
3149
|
+
...config2,
|
|
3065
3150
|
builder: {
|
|
3066
3151
|
name: fileURLToPath2(import.meta.resolve("@storybook/builder-vite")),
|
|
3067
3152
|
options: {
|
|
@@ -3089,18 +3174,12 @@ var optimizeViteDeps = [
|
|
|
3089
3174
|
"@storybook/nextjs-vite > styled-jsx",
|
|
3090
3175
|
"@storybook/nextjs-vite > styled-jsx/style"
|
|
3091
3176
|
];
|
|
3092
|
-
var viteFinal = /* @__PURE__ */ __name(async (
|
|
3093
|
-
const reactConfig = await reactViteFinal(
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
await (
|
|
3098
|
-
} catch (e) {
|
|
3099
|
-
if (!e.message.includes("No PostCSS Config found")) {
|
|
3100
|
-
if (e.message.includes("Invalid PostCSS Plugin found")) {
|
|
3101
|
-
throw new IncompatiblePostCssConfigError({ error: e });
|
|
3102
|
-
}
|
|
3103
|
-
}
|
|
3177
|
+
var viteFinal = /* @__PURE__ */ __name(async (config2, options) => {
|
|
3178
|
+
const reactConfig = await reactViteFinal(config2, options);
|
|
3179
|
+
const inlineOptions = config2.css?.postcss;
|
|
3180
|
+
const searchPath = typeof inlineOptions === "string" ? inlineOptions : config2.root;
|
|
3181
|
+
if (searchPath) {
|
|
3182
|
+
await normalizePostCssConfig(searchPath);
|
|
3104
3183
|
}
|
|
3105
3184
|
const { nextConfigPath } = await options.presets.apply("frameworkOptions");
|
|
3106
3185
|
const nextDir = nextConfigPath ? dirname2(nextConfigPath) : void 0;
|