@storybook/nextjs-vite 10.1.0-alpha.9 → 10.1.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_browser-chunks/{chunk-I34DATQB.js → chunk-37RBXWOJ.js} +51 -101
- package/dist/_browser-chunks/{chunk-L5NVL7MD.js → chunk-SL3VIQZ3.js} +7 -13
- package/dist/_browser-chunks/react-18-PYSEDAWB.js +43 -0
- package/dist/_node-chunks/{chunk-HE6QWXEZ.js → chunk-CARV73UI.js} +15 -20
- package/dist/_node-chunks/dist-K7J2QH6T.js +5431 -0
- package/dist/_node-chunks/jiti-VJSHM3WA.js +2998 -0
- package/dist/export-mocks/cache/index.js +3 -8
- package/dist/export-mocks/headers/index.js +6 -29
- package/dist/export-mocks/navigation/index.js +15 -38
- package/dist/export-mocks/router/index.d.ts +4 -7
- package/dist/export-mocks/router/index.js +20 -54
- package/dist/index.js +2865 -8413
- package/dist/node/index.js +7 -10
- package/dist/preset.js +640 -1859
- package/dist/preview.js +2 -2
- package/dist/vite-plugin/index.js +8 -10
- package/package.json +6 -6
- package/dist/_browser-chunks/react-18-G7Q4PNHD.js +0 -71
- package/dist/_node-chunks/dist-VPRWN5KQ.js +0 -7476
- package/dist/_node-chunks/jiti-VSU63IVF.js +0 -32417
package/dist/preset.js
CHANGED
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8tqdoxyg80i from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8tqdoxyg80i from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8tqdoxyg80i from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8tqdoxyg80i.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8tqdoxyg80i.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8tqdoxyg80i.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
|
-
__name,
|
|
15
14
|
__require,
|
|
16
15
|
__toESM
|
|
17
|
-
} from "./_node-chunks/chunk-
|
|
16
|
+
} from "./_node-chunks/chunk-CARV73UI.js";
|
|
18
17
|
|
|
19
18
|
// ../../node_modules/semver/internal/constants.js
|
|
20
19
|
var require_constants = __commonJS({
|
|
21
20
|
"../../node_modules/semver/internal/constants.js"(exports, module) {
|
|
22
21
|
"use strict";
|
|
23
|
-
var SEMVER_SPEC_VERSION = "2.0.0"
|
|
24
|
-
|
|
25
|
-
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
26
|
-
9007199254740991;
|
|
27
|
-
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
28
|
-
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
29
|
-
var RELEASE_TYPES = [
|
|
22
|
+
var SEMVER_SPEC_VERSION = "2.0.0", MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
23
|
+
9007199254740991, MAX_SAFE_COMPONENT_LENGTH = 16, MAX_SAFE_BUILD_LENGTH = 250, RELEASE_TYPES = [
|
|
30
24
|
"major",
|
|
31
25
|
"premajor",
|
|
32
26
|
"minor",
|
|
@@ -36,7 +30,7 @@ var require_constants = __commonJS({
|
|
|
36
30
|
"prerelease"
|
|
37
31
|
];
|
|
38
32
|
module.exports = {
|
|
39
|
-
MAX_LENGTH,
|
|
33
|
+
MAX_LENGTH: 256,
|
|
40
34
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
41
35
|
MAX_SAFE_BUILD_LENGTH,
|
|
42
36
|
MAX_SAFE_INTEGER,
|
|
@@ -52,7 +46,7 @@ var require_constants = __commonJS({
|
|
|
52
46
|
var require_debug = __commonJS({
|
|
53
47
|
"../../node_modules/semver/internal/debug.js"(exports, module) {
|
|
54
48
|
"use strict";
|
|
55
|
-
var debug = typeof process
|
|
49
|
+
var debug = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
56
50
|
};
|
|
57
51
|
module.exports = debug;
|
|
58
52
|
}
|
|
@@ -66,37 +60,20 @@ var require_re = __commonJS({
|
|
|
66
60
|
MAX_SAFE_COMPONENT_LENGTH,
|
|
67
61
|
MAX_SAFE_BUILD_LENGTH,
|
|
68
62
|
MAX_LENGTH
|
|
69
|
-
} = require_constants();
|
|
70
|
-
var debug = require_debug();
|
|
63
|
+
} = require_constants(), debug = require_debug();
|
|
71
64
|
exports = module.exports = {};
|
|
72
|
-
var re = exports.re = []
|
|
73
|
-
var safeRe = exports.safeRe = [];
|
|
74
|
-
var src = exports.src = [];
|
|
75
|
-
var safeSrc = exports.safeSrc = [];
|
|
76
|
-
var t = exports.t = {};
|
|
77
|
-
var R = 0;
|
|
78
|
-
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
79
|
-
var safeRegexReplacements = [
|
|
65
|
+
var re = exports.re = [], safeRe = exports.safeRe = [], src = exports.src = [], safeSrc = exports.safeSrc = [], t = exports.t = {}, R = 0, LETTERDASHNUMBER = "[a-zA-Z0-9-]", safeRegexReplacements = [
|
|
80
66
|
["\\s", 1],
|
|
81
67
|
["\\d", MAX_LENGTH],
|
|
82
68
|
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
83
|
-
]
|
|
84
|
-
|
|
85
|
-
for (const [token, max] of safeRegexReplacements) {
|
|
69
|
+
], makeSafeRegex = (value) => {
|
|
70
|
+
for (let [token, max] of safeRegexReplacements)
|
|
86
71
|
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
87
|
-
}
|
|
88
72
|
return value;
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
debug(name, index, value);
|
|
94
|
-
t[name] = index;
|
|
95
|
-
src[index] = value;
|
|
96
|
-
safeSrc[index] = safe;
|
|
97
|
-
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
98
|
-
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
99
|
-
}, "createToken");
|
|
73
|
+
}, createToken = (name, value, isGlobal) => {
|
|
74
|
+
let safe = makeSafeRegex(value), index = R++;
|
|
75
|
+
debug(name, index, value), t[name] = index, src[index] = value, safeSrc[index] = safe, re[index] = new RegExp(value, isGlobal ? "g" : void 0), safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
76
|
+
};
|
|
100
77
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
101
78
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
102
79
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
@@ -119,24 +96,24 @@ var require_re = __commonJS({
|
|
|
119
96
|
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
120
97
|
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
121
98
|
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
122
|
-
createToken("COERCEPLAIN",
|
|
99
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
123
100
|
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
124
101
|
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
125
|
-
createToken("COERCERTL", src[t.COERCE],
|
|
126
|
-
createToken("COERCERTLFULL", src[t.COERCEFULL],
|
|
102
|
+
createToken("COERCERTL", src[t.COERCE], !0);
|
|
103
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], !0);
|
|
127
104
|
createToken("LONETILDE", "(?:~>?)");
|
|
128
|
-
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`,
|
|
105
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, !0);
|
|
129
106
|
exports.tildeTrimReplace = "$1~";
|
|
130
107
|
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
131
108
|
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
132
109
|
createToken("LONECARET", "(?:\\^)");
|
|
133
|
-
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`,
|
|
110
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, !0);
|
|
134
111
|
exports.caretTrimReplace = "$1^";
|
|
135
112
|
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
136
113
|
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
137
114
|
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
138
115
|
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
139
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`,
|
|
116
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, !0);
|
|
140
117
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
141
118
|
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
142
119
|
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
@@ -150,17 +127,7 @@ var require_re = __commonJS({
|
|
|
150
127
|
var require_parse_options = __commonJS({
|
|
151
128
|
"../../node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
152
129
|
"use strict";
|
|
153
|
-
var looseOption = Object.freeze({ loose:
|
|
154
|
-
var emptyOpts = Object.freeze({});
|
|
155
|
-
var parseOptions = /* @__PURE__ */ __name((options) => {
|
|
156
|
-
if (!options) {
|
|
157
|
-
return emptyOpts;
|
|
158
|
-
}
|
|
159
|
-
if (typeof options !== "object") {
|
|
160
|
-
return looseOption;
|
|
161
|
-
}
|
|
162
|
-
return options;
|
|
163
|
-
}, "parseOptions");
|
|
130
|
+
var looseOption = Object.freeze({ loose: !0 }), emptyOpts = Object.freeze({}), parseOptions = (options) => options ? typeof options != "object" ? looseOption : options : emptyOpts;
|
|
164
131
|
module.exports = parseOptions;
|
|
165
132
|
}
|
|
166
133
|
});
|
|
@@ -169,17 +136,12 @@ var require_parse_options = __commonJS({
|
|
|
169
136
|
var require_identifiers = __commonJS({
|
|
170
137
|
"../../node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
171
138
|
"use strict";
|
|
172
|
-
var numeric = /^[0-9]
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
b = +b;
|
|
179
|
-
}
|
|
180
|
-
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
181
|
-
}, "compareIdentifiers");
|
|
182
|
-
var rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers(b, a), "rcompareIdentifiers");
|
|
139
|
+
var numeric = /^[0-9]+$/, compareIdentifiers = (a, b) => {
|
|
140
|
+
if (typeof a == "number" && typeof b == "number")
|
|
141
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
142
|
+
let anum = numeric.test(a), bnum = numeric.test(b);
|
|
143
|
+
return anum && bnum && (a = +a, b = +b), a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
144
|
+
}, rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
183
145
|
module.exports = {
|
|
184
146
|
compareIdentifiers,
|
|
185
147
|
rcompareIdentifiers
|
|
@@ -191,260 +153,158 @@ var require_identifiers = __commonJS({
|
|
|
191
153
|
var require_semver = __commonJS({
|
|
192
154
|
"../../node_modules/semver/classes/semver.js"(exports, module) {
|
|
193
155
|
"use strict";
|
|
194
|
-
var debug = require_debug()
|
|
195
|
-
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
196
|
-
var { safeRe: re, t } = require_re();
|
|
197
|
-
var parseOptions = require_parse_options();
|
|
198
|
-
var { compareIdentifiers } = require_identifiers();
|
|
199
|
-
var SemVer = class _SemVer {
|
|
200
|
-
static {
|
|
201
|
-
__name(this, "SemVer");
|
|
202
|
-
}
|
|
156
|
+
var debug = require_debug(), { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants(), { safeRe: re, t } = require_re(), parseOptions = require_parse_options(), { compareIdentifiers } = require_identifiers(), SemVer = class _SemVer {
|
|
203
157
|
constructor(version, options) {
|
|
204
|
-
options = parseOptions(options)
|
|
205
|
-
|
|
206
|
-
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
158
|
+
if (options = parseOptions(options), version instanceof _SemVer) {
|
|
159
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease)
|
|
207
160
|
return version;
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
}
|
|
211
|
-
} else if (typeof version !== "string") {
|
|
161
|
+
version = version.version;
|
|
162
|
+
} else if (typeof version != "string")
|
|
212
163
|
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
213
|
-
|
|
214
|
-
if (version.length > MAX_LENGTH) {
|
|
164
|
+
if (version.length > MAX_LENGTH)
|
|
215
165
|
throw new TypeError(
|
|
216
166
|
`version is longer than ${MAX_LENGTH} characters`
|
|
217
167
|
);
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
this.loose = !!options.loose;
|
|
222
|
-
this.includePrerelease = !!options.includePrerelease;
|
|
223
|
-
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
224
|
-
if (!m) {
|
|
168
|
+
debug("SemVer", version, options), this.options = options, this.loose = !!options.loose, this.includePrerelease = !!options.includePrerelease;
|
|
169
|
+
let m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
170
|
+
if (!m)
|
|
225
171
|
throw new TypeError(`Invalid Version: ${version}`);
|
|
226
|
-
|
|
227
|
-
this.raw = version;
|
|
228
|
-
this.major = +m[1];
|
|
229
|
-
this.minor = +m[2];
|
|
230
|
-
this.patch = +m[3];
|
|
231
|
-
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
172
|
+
if (this.raw = version, this.major = +m[1], this.minor = +m[2], this.patch = +m[3], this.major > MAX_SAFE_INTEGER || this.major < 0)
|
|
232
173
|
throw new TypeError("Invalid major version");
|
|
233
|
-
|
|
234
|
-
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
174
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0)
|
|
235
175
|
throw new TypeError("Invalid minor version");
|
|
236
|
-
|
|
237
|
-
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
176
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0)
|
|
238
177
|
throw new TypeError("Invalid patch version");
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
return num;
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
return id;
|
|
251
|
-
});
|
|
252
|
-
}
|
|
253
|
-
this.build = m[5] ? m[5].split(".") : [];
|
|
254
|
-
this.format();
|
|
178
|
+
m[4] ? this.prerelease = m[4].split(".").map((id) => {
|
|
179
|
+
if (/^[0-9]+$/.test(id)) {
|
|
180
|
+
let num = +id;
|
|
181
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER)
|
|
182
|
+
return num;
|
|
183
|
+
}
|
|
184
|
+
return id;
|
|
185
|
+
}) : this.prerelease = [], this.build = m[5] ? m[5].split(".") : [], this.format();
|
|
255
186
|
}
|
|
256
187
|
format() {
|
|
257
|
-
this.version = `${this.major}.${this.minor}.${this.patch}
|
|
258
|
-
if (this.prerelease.length) {
|
|
259
|
-
this.version += `-${this.prerelease.join(".")}`;
|
|
260
|
-
}
|
|
261
|
-
return this.version;
|
|
188
|
+
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
262
189
|
}
|
|
263
190
|
toString() {
|
|
264
191
|
return this.version;
|
|
265
192
|
}
|
|
266
193
|
compare(other) {
|
|
267
|
-
debug("SemVer.compare", this.version, this.options, other)
|
|
268
|
-
|
|
269
|
-
if (typeof other === "string" && other === this.version) {
|
|
194
|
+
if (debug("SemVer.compare", this.version, this.options, other), !(other instanceof _SemVer)) {
|
|
195
|
+
if (typeof other == "string" && other === this.version)
|
|
270
196
|
return 0;
|
|
271
|
-
}
|
|
272
197
|
other = new _SemVer(other, this.options);
|
|
273
198
|
}
|
|
274
|
-
|
|
275
|
-
return 0;
|
|
276
|
-
}
|
|
277
|
-
return this.compareMain(other) || this.comparePre(other);
|
|
199
|
+
return other.version === this.version ? 0 : this.compareMain(other) || this.comparePre(other);
|
|
278
200
|
}
|
|
279
201
|
compareMain(other) {
|
|
280
|
-
|
|
281
|
-
other = new _SemVer(other, this.options);
|
|
282
|
-
}
|
|
283
|
-
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
202
|
+
return other instanceof _SemVer || (other = new _SemVer(other, this.options)), this.major < other.major ? -1 : this.major > other.major ? 1 : this.minor < other.minor ? -1 : this.minor > other.minor ? 1 : this.patch < other.patch ? -1 : this.patch > other.patch ? 1 : 0;
|
|
284
203
|
}
|
|
285
204
|
comparePre(other) {
|
|
286
|
-
if (
|
|
287
|
-
other = new _SemVer(other, this.options);
|
|
288
|
-
}
|
|
289
|
-
if (this.prerelease.length && !other.prerelease.length) {
|
|
205
|
+
if (other instanceof _SemVer || (other = new _SemVer(other, this.options)), this.prerelease.length && !other.prerelease.length)
|
|
290
206
|
return -1;
|
|
291
|
-
|
|
207
|
+
if (!this.prerelease.length && other.prerelease.length)
|
|
292
208
|
return 1;
|
|
293
|
-
|
|
209
|
+
if (!this.prerelease.length && !other.prerelease.length)
|
|
294
210
|
return 0;
|
|
295
|
-
}
|
|
296
211
|
let i = 0;
|
|
297
212
|
do {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
debug("prerelease compare", i, a, b);
|
|
301
|
-
if (a === void 0 && b === void 0) {
|
|
213
|
+
let a = this.prerelease[i], b = other.prerelease[i];
|
|
214
|
+
if (debug("prerelease compare", i, a, b), a === void 0 && b === void 0)
|
|
302
215
|
return 0;
|
|
303
|
-
|
|
216
|
+
if (b === void 0)
|
|
304
217
|
return 1;
|
|
305
|
-
|
|
218
|
+
if (a === void 0)
|
|
306
219
|
return -1;
|
|
307
|
-
|
|
220
|
+
if (a === b)
|
|
308
221
|
continue;
|
|
309
|
-
|
|
310
|
-
return compareIdentifiers(a, b);
|
|
311
|
-
}
|
|
222
|
+
return compareIdentifiers(a, b);
|
|
312
223
|
} while (++i);
|
|
313
224
|
}
|
|
314
225
|
compareBuild(other) {
|
|
315
|
-
|
|
316
|
-
other = new _SemVer(other, this.options);
|
|
317
|
-
}
|
|
226
|
+
other instanceof _SemVer || (other = new _SemVer(other, this.options));
|
|
318
227
|
let i = 0;
|
|
319
228
|
do {
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
debug("build compare", i, a, b);
|
|
323
|
-
if (a === void 0 && b === void 0) {
|
|
229
|
+
let a = this.build[i], b = other.build[i];
|
|
230
|
+
if (debug("build compare", i, a, b), a === void 0 && b === void 0)
|
|
324
231
|
return 0;
|
|
325
|
-
|
|
232
|
+
if (b === void 0)
|
|
326
233
|
return 1;
|
|
327
|
-
|
|
234
|
+
if (a === void 0)
|
|
328
235
|
return -1;
|
|
329
|
-
|
|
236
|
+
if (a === b)
|
|
330
237
|
continue;
|
|
331
|
-
|
|
332
|
-
return compareIdentifiers(a, b);
|
|
333
|
-
}
|
|
238
|
+
return compareIdentifiers(a, b);
|
|
334
239
|
} while (++i);
|
|
335
240
|
}
|
|
336
241
|
// preminor will bump the version up to the next minor release, and immediately
|
|
337
242
|
// down to pre-release. premajor and prepatch work the same way.
|
|
338
243
|
inc(release, identifier, identifierBase) {
|
|
339
244
|
if (release.startsWith("pre")) {
|
|
340
|
-
if (!identifier && identifierBase ===
|
|
245
|
+
if (!identifier && identifierBase === !1)
|
|
341
246
|
throw new Error("invalid increment argument: identifier is empty");
|
|
342
|
-
}
|
|
343
247
|
if (identifier) {
|
|
344
|
-
|
|
345
|
-
if (!match || match[1] !== identifier)
|
|
248
|
+
let match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
249
|
+
if (!match || match[1] !== identifier)
|
|
346
250
|
throw new Error(`invalid identifier: ${identifier}`);
|
|
347
|
-
}
|
|
348
251
|
}
|
|
349
252
|
}
|
|
350
253
|
switch (release) {
|
|
351
254
|
case "premajor":
|
|
352
|
-
this.prerelease.length = 0;
|
|
353
|
-
this.patch = 0;
|
|
354
|
-
this.minor = 0;
|
|
355
|
-
this.major++;
|
|
356
|
-
this.inc("pre", identifier, identifierBase);
|
|
255
|
+
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", identifier, identifierBase);
|
|
357
256
|
break;
|
|
358
257
|
case "preminor":
|
|
359
|
-
this.prerelease.length = 0;
|
|
360
|
-
this.patch = 0;
|
|
361
|
-
this.minor++;
|
|
362
|
-
this.inc("pre", identifier, identifierBase);
|
|
258
|
+
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", identifier, identifierBase);
|
|
363
259
|
break;
|
|
364
260
|
case "prepatch":
|
|
365
|
-
this.prerelease.length = 0;
|
|
366
|
-
this.inc("patch", identifier, identifierBase);
|
|
367
|
-
this.inc("pre", identifier, identifierBase);
|
|
261
|
+
this.prerelease.length = 0, this.inc("patch", identifier, identifierBase), this.inc("pre", identifier, identifierBase);
|
|
368
262
|
break;
|
|
369
263
|
// If the input is a non-prerelease version, this acts the same as
|
|
370
264
|
// prepatch.
|
|
371
265
|
case "prerelease":
|
|
372
|
-
|
|
373
|
-
this.inc("patch", identifier, identifierBase);
|
|
374
|
-
}
|
|
375
|
-
this.inc("pre", identifier, identifierBase);
|
|
266
|
+
this.prerelease.length === 0 && this.inc("patch", identifier, identifierBase), this.inc("pre", identifier, identifierBase);
|
|
376
267
|
break;
|
|
377
268
|
case "release":
|
|
378
|
-
if (this.prerelease.length === 0)
|
|
269
|
+
if (this.prerelease.length === 0)
|
|
379
270
|
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
380
|
-
}
|
|
381
271
|
this.prerelease.length = 0;
|
|
382
272
|
break;
|
|
383
273
|
case "major":
|
|
384
|
-
|
|
385
|
-
this.major++;
|
|
386
|
-
}
|
|
387
|
-
this.minor = 0;
|
|
388
|
-
this.patch = 0;
|
|
389
|
-
this.prerelease = [];
|
|
274
|
+
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
390
275
|
break;
|
|
391
276
|
case "minor":
|
|
392
|
-
|
|
393
|
-
this.minor++;
|
|
394
|
-
}
|
|
395
|
-
this.patch = 0;
|
|
396
|
-
this.prerelease = [];
|
|
277
|
+
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
397
278
|
break;
|
|
398
279
|
case "patch":
|
|
399
|
-
|
|
400
|
-
this.patch++;
|
|
401
|
-
}
|
|
402
|
-
this.prerelease = [];
|
|
280
|
+
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
403
281
|
break;
|
|
404
282
|
// This probably shouldn't be used publicly.
|
|
405
283
|
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
406
284
|
case "pre": {
|
|
407
|
-
|
|
408
|
-
if (this.prerelease.length === 0)
|
|
285
|
+
let base = Number(identifierBase) ? 1 : 0;
|
|
286
|
+
if (this.prerelease.length === 0)
|
|
409
287
|
this.prerelease = [base];
|
|
410
|
-
|
|
288
|
+
else {
|
|
411
289
|
let i = this.prerelease.length;
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
this.prerelease[i]++;
|
|
415
|
-
i = -2;
|
|
416
|
-
}
|
|
417
|
-
}
|
|
290
|
+
for (; --i >= 0; )
|
|
291
|
+
typeof this.prerelease[i] == "number" && (this.prerelease[i]++, i = -2);
|
|
418
292
|
if (i === -1) {
|
|
419
|
-
if (identifier === this.prerelease.join(".") && identifierBase ===
|
|
293
|
+
if (identifier === this.prerelease.join(".") && identifierBase === !1)
|
|
420
294
|
throw new Error("invalid increment argument: identifier already exists");
|
|
421
|
-
}
|
|
422
295
|
this.prerelease.push(base);
|
|
423
296
|
}
|
|
424
297
|
}
|
|
425
298
|
if (identifier) {
|
|
426
299
|
let prerelease = [identifier, base];
|
|
427
|
-
|
|
428
|
-
prerelease = [identifier];
|
|
429
|
-
}
|
|
430
|
-
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
431
|
-
if (isNaN(this.prerelease[1])) {
|
|
432
|
-
this.prerelease = prerelease;
|
|
433
|
-
}
|
|
434
|
-
} else {
|
|
435
|
-
this.prerelease = prerelease;
|
|
436
|
-
}
|
|
300
|
+
identifierBase === !1 && (prerelease = [identifier]), compareIdentifiers(this.prerelease[0], identifier) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = prerelease) : this.prerelease = prerelease;
|
|
437
301
|
}
|
|
438
302
|
break;
|
|
439
303
|
}
|
|
440
304
|
default:
|
|
441
305
|
throw new Error(`invalid increment argument: ${release}`);
|
|
442
306
|
}
|
|
443
|
-
this.raw = this.format();
|
|
444
|
-
if (this.build.length) {
|
|
445
|
-
this.raw += `+${this.build.join(".")}`;
|
|
446
|
-
}
|
|
447
|
-
return this;
|
|
307
|
+
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
448
308
|
}
|
|
449
309
|
};
|
|
450
310
|
module.exports = SemVer;
|
|
@@ -455,20 +315,17 @@ var require_semver = __commonJS({
|
|
|
455
315
|
var require_parse = __commonJS({
|
|
456
316
|
"../../node_modules/semver/functions/parse.js"(exports, module) {
|
|
457
317
|
"use strict";
|
|
458
|
-
var SemVer = require_semver()
|
|
459
|
-
|
|
460
|
-
if (version instanceof SemVer) {
|
|
318
|
+
var SemVer = require_semver(), parse2 = (version, options, throwErrors = !1) => {
|
|
319
|
+
if (version instanceof SemVer)
|
|
461
320
|
return version;
|
|
462
|
-
}
|
|
463
321
|
try {
|
|
464
322
|
return new SemVer(version, options);
|
|
465
323
|
} catch (er) {
|
|
466
|
-
if (!throwErrors)
|
|
324
|
+
if (!throwErrors)
|
|
467
325
|
return null;
|
|
468
|
-
}
|
|
469
326
|
throw er;
|
|
470
327
|
}
|
|
471
|
-
}
|
|
328
|
+
};
|
|
472
329
|
module.exports = parse2;
|
|
473
330
|
}
|
|
474
331
|
});
|
|
@@ -477,11 +334,10 @@ var require_parse = __commonJS({
|
|
|
477
334
|
var require_valid = __commonJS({
|
|
478
335
|
"../../node_modules/semver/functions/valid.js"(exports, module) {
|
|
479
336
|
"use strict";
|
|
480
|
-
var parse2 = require_parse()
|
|
481
|
-
|
|
482
|
-
const v = parse2(version, options);
|
|
337
|
+
var parse2 = require_parse(), valid = (version, options) => {
|
|
338
|
+
let v = parse2(version, options);
|
|
483
339
|
return v ? v.version : null;
|
|
484
|
-
}
|
|
340
|
+
};
|
|
485
341
|
module.exports = valid;
|
|
486
342
|
}
|
|
487
343
|
});
|
|
@@ -490,11 +346,10 @@ var require_valid = __commonJS({
|
|
|
490
346
|
var require_clean = __commonJS({
|
|
491
347
|
"../../node_modules/semver/functions/clean.js"(exports, module) {
|
|
492
348
|
"use strict";
|
|
493
|
-
var parse2 = require_parse()
|
|
494
|
-
|
|
495
|
-
const s = parse2(version.trim().replace(/^[=v]+/, ""), options);
|
|
349
|
+
var parse2 = require_parse(), clean = (version, options) => {
|
|
350
|
+
let s = parse2(version.trim().replace(/^[=v]+/, ""), options);
|
|
496
351
|
return s ? s.version : null;
|
|
497
|
-
}
|
|
352
|
+
};
|
|
498
353
|
module.exports = clean;
|
|
499
354
|
}
|
|
500
355
|
});
|
|
@@ -503,22 +358,17 @@ var require_clean = __commonJS({
|
|
|
503
358
|
var require_inc = __commonJS({
|
|
504
359
|
"../../node_modules/semver/functions/inc.js"(exports, module) {
|
|
505
360
|
"use strict";
|
|
506
|
-
var SemVer = require_semver()
|
|
507
|
-
|
|
508
|
-
if (typeof options === "string") {
|
|
509
|
-
identifierBase = identifier;
|
|
510
|
-
identifier = options;
|
|
511
|
-
options = void 0;
|
|
512
|
-
}
|
|
361
|
+
var SemVer = require_semver(), inc = (version, release, options, identifier, identifierBase) => {
|
|
362
|
+
typeof options == "string" && (identifierBase = identifier, identifier = options, options = void 0);
|
|
513
363
|
try {
|
|
514
364
|
return new SemVer(
|
|
515
365
|
version instanceof SemVer ? version.version : version,
|
|
516
366
|
options
|
|
517
367
|
).inc(release, identifier, identifierBase).version;
|
|
518
|
-
} catch
|
|
368
|
+
} catch {
|
|
519
369
|
return null;
|
|
520
370
|
}
|
|
521
|
-
}
|
|
371
|
+
};
|
|
522
372
|
module.exports = inc;
|
|
523
373
|
}
|
|
524
374
|
});
|
|
@@ -527,42 +377,20 @@ var require_inc = __commonJS({
|
|
|
527
377
|
var require_diff = __commonJS({
|
|
528
378
|
"../../node_modules/semver/functions/diff.js"(exports, module) {
|
|
529
379
|
"use strict";
|
|
530
|
-
var parse2 = require_parse()
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
const v2 = parse2(version2, null, true);
|
|
534
|
-
const comparison = v1.compare(v2);
|
|
535
|
-
if (comparison === 0) {
|
|
380
|
+
var parse2 = require_parse(), diff = (version1, version2) => {
|
|
381
|
+
let v1 = parse2(version1, null, !0), v2 = parse2(version2, null, !0), comparison = v1.compare(v2);
|
|
382
|
+
if (comparison === 0)
|
|
536
383
|
return null;
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
const lowVersion = v1Higher ? v2 : v1;
|
|
541
|
-
const highHasPre = !!highVersion.prerelease.length;
|
|
542
|
-
const lowHasPre = !!lowVersion.prerelease.length;
|
|
543
|
-
if (lowHasPre && !highHasPre) {
|
|
544
|
-
if (!lowVersion.patch && !lowVersion.minor) {
|
|
384
|
+
let v1Higher = comparison > 0, highVersion = v1Higher ? v1 : v2, lowVersion = v1Higher ? v2 : v1, highHasPre = !!highVersion.prerelease.length;
|
|
385
|
+
if (!!lowVersion.prerelease.length && !highHasPre) {
|
|
386
|
+
if (!lowVersion.patch && !lowVersion.minor)
|
|
545
387
|
return "major";
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
if (lowVersion.minor && !lowVersion.patch) {
|
|
549
|
-
return "minor";
|
|
550
|
-
}
|
|
551
|
-
return "patch";
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
const prefix = highHasPre ? "pre" : "";
|
|
555
|
-
if (v1.major !== v2.major) {
|
|
556
|
-
return prefix + "major";
|
|
557
|
-
}
|
|
558
|
-
if (v1.minor !== v2.minor) {
|
|
559
|
-
return prefix + "minor";
|
|
388
|
+
if (lowVersion.compareMain(highVersion) === 0)
|
|
389
|
+
return lowVersion.minor && !lowVersion.patch ? "minor" : "patch";
|
|
560
390
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
return "prerelease";
|
|
565
|
-
}, "diff");
|
|
391
|
+
let prefix = highHasPre ? "pre" : "";
|
|
392
|
+
return v1.major !== v2.major ? prefix + "major" : v1.minor !== v2.minor ? prefix + "minor" : v1.patch !== v2.patch ? prefix + "patch" : "prerelease";
|
|
393
|
+
};
|
|
566
394
|
module.exports = diff;
|
|
567
395
|
}
|
|
568
396
|
});
|
|
@@ -571,8 +399,7 @@ var require_diff = __commonJS({
|
|
|
571
399
|
var require_major = __commonJS({
|
|
572
400
|
"../../node_modules/semver/functions/major.js"(exports, module) {
|
|
573
401
|
"use strict";
|
|
574
|
-
var SemVer = require_semver();
|
|
575
|
-
var major = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).major, "major");
|
|
402
|
+
var SemVer = require_semver(), major = (a, loose) => new SemVer(a, loose).major;
|
|
576
403
|
module.exports = major;
|
|
577
404
|
}
|
|
578
405
|
});
|
|
@@ -581,8 +408,7 @@ var require_major = __commonJS({
|
|
|
581
408
|
var require_minor = __commonJS({
|
|
582
409
|
"../../node_modules/semver/functions/minor.js"(exports, module) {
|
|
583
410
|
"use strict";
|
|
584
|
-
var SemVer = require_semver();
|
|
585
|
-
var minor = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).minor, "minor");
|
|
411
|
+
var SemVer = require_semver(), minor = (a, loose) => new SemVer(a, loose).minor;
|
|
586
412
|
module.exports = minor;
|
|
587
413
|
}
|
|
588
414
|
});
|
|
@@ -591,8 +417,7 @@ var require_minor = __commonJS({
|
|
|
591
417
|
var require_patch = __commonJS({
|
|
592
418
|
"../../node_modules/semver/functions/patch.js"(exports, module) {
|
|
593
419
|
"use strict";
|
|
594
|
-
var SemVer = require_semver();
|
|
595
|
-
var patch = /* @__PURE__ */ __name((a, loose) => new SemVer(a, loose).patch, "patch");
|
|
420
|
+
var SemVer = require_semver(), patch = (a, loose) => new SemVer(a, loose).patch;
|
|
596
421
|
module.exports = patch;
|
|
597
422
|
}
|
|
598
423
|
});
|
|
@@ -601,11 +426,10 @@ var require_patch = __commonJS({
|
|
|
601
426
|
var require_prerelease = __commonJS({
|
|
602
427
|
"../../node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
603
428
|
"use strict";
|
|
604
|
-
var parse2 = require_parse()
|
|
605
|
-
|
|
606
|
-
const parsed = parse2(version, options);
|
|
429
|
+
var parse2 = require_parse(), prerelease = (version, options) => {
|
|
430
|
+
let parsed = parse2(version, options);
|
|
607
431
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
608
|
-
}
|
|
432
|
+
};
|
|
609
433
|
module.exports = prerelease;
|
|
610
434
|
}
|
|
611
435
|
});
|
|
@@ -614,8 +438,7 @@ var require_prerelease = __commonJS({
|
|
|
614
438
|
var require_compare = __commonJS({
|
|
615
439
|
"../../node_modules/semver/functions/compare.js"(exports, module) {
|
|
616
440
|
"use strict";
|
|
617
|
-
var SemVer = require_semver();
|
|
618
|
-
var compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare");
|
|
441
|
+
var SemVer = require_semver(), compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
619
442
|
module.exports = compare;
|
|
620
443
|
}
|
|
621
444
|
});
|
|
@@ -624,8 +447,7 @@ var require_compare = __commonJS({
|
|
|
624
447
|
var require_rcompare = __commonJS({
|
|
625
448
|
"../../node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
626
449
|
"use strict";
|
|
627
|
-
var compare = require_compare();
|
|
628
|
-
var rcompare = /* @__PURE__ */ __name((a, b, loose) => compare(b, a, loose), "rcompare");
|
|
450
|
+
var compare = require_compare(), rcompare = (a, b, loose) => compare(b, a, loose);
|
|
629
451
|
module.exports = rcompare;
|
|
630
452
|
}
|
|
631
453
|
});
|
|
@@ -634,8 +456,7 @@ var require_rcompare = __commonJS({
|
|
|
634
456
|
var require_compare_loose = __commonJS({
|
|
635
457
|
"../../node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
636
458
|
"use strict";
|
|
637
|
-
var compare = require_compare();
|
|
638
|
-
var compareLoose = /* @__PURE__ */ __name((a, b) => compare(a, b, true), "compareLoose");
|
|
459
|
+
var compare = require_compare(), compareLoose = (a, b) => compare(a, b, !0);
|
|
639
460
|
module.exports = compareLoose;
|
|
640
461
|
}
|
|
641
462
|
});
|
|
@@ -644,12 +465,10 @@ var require_compare_loose = __commonJS({
|
|
|
644
465
|
var require_compare_build = __commonJS({
|
|
645
466
|
"../../node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
646
467
|
"use strict";
|
|
647
|
-
var SemVer = require_semver()
|
|
648
|
-
|
|
649
|
-
const versionA = new SemVer(a, loose);
|
|
650
|
-
const versionB = new SemVer(b, loose);
|
|
468
|
+
var SemVer = require_semver(), compareBuild = (a, b, loose) => {
|
|
469
|
+
let versionA = new SemVer(a, loose), versionB = new SemVer(b, loose);
|
|
651
470
|
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
652
|
-
}
|
|
471
|
+
};
|
|
653
472
|
module.exports = compareBuild;
|
|
654
473
|
}
|
|
655
474
|
});
|
|
@@ -658,8 +477,7 @@ var require_compare_build = __commonJS({
|
|
|
658
477
|
var require_sort = __commonJS({
|
|
659
478
|
"../../node_modules/semver/functions/sort.js"(exports, module) {
|
|
660
479
|
"use strict";
|
|
661
|
-
var compareBuild = require_compare_build();
|
|
662
|
-
var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(a, b, loose)), "sort");
|
|
480
|
+
var compareBuild = require_compare_build(), sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
663
481
|
module.exports = sort;
|
|
664
482
|
}
|
|
665
483
|
});
|
|
@@ -668,8 +486,7 @@ var require_sort = __commonJS({
|
|
|
668
486
|
var require_rsort = __commonJS({
|
|
669
487
|
"../../node_modules/semver/functions/rsort.js"(exports, module) {
|
|
670
488
|
"use strict";
|
|
671
|
-
var compareBuild = require_compare_build();
|
|
672
|
-
var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a, b) => compareBuild(b, a, loose)), "rsort");
|
|
489
|
+
var compareBuild = require_compare_build(), rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
673
490
|
module.exports = rsort;
|
|
674
491
|
}
|
|
675
492
|
});
|
|
@@ -678,8 +495,7 @@ var require_rsort = __commonJS({
|
|
|
678
495
|
var require_gt = __commonJS({
|
|
679
496
|
"../../node_modules/semver/functions/gt.js"(exports, module) {
|
|
680
497
|
"use strict";
|
|
681
|
-
var compare = require_compare();
|
|
682
|
-
var gt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) > 0, "gt");
|
|
498
|
+
var compare = require_compare(), gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
683
499
|
module.exports = gt;
|
|
684
500
|
}
|
|
685
501
|
});
|
|
@@ -688,8 +504,7 @@ var require_gt = __commonJS({
|
|
|
688
504
|
var require_lt = __commonJS({
|
|
689
505
|
"../../node_modules/semver/functions/lt.js"(exports, module) {
|
|
690
506
|
"use strict";
|
|
691
|
-
var compare = require_compare();
|
|
692
|
-
var lt = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) < 0, "lt");
|
|
507
|
+
var compare = require_compare(), lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
693
508
|
module.exports = lt;
|
|
694
509
|
}
|
|
695
510
|
});
|
|
@@ -698,8 +513,7 @@ var require_lt = __commonJS({
|
|
|
698
513
|
var require_eq = __commonJS({
|
|
699
514
|
"../../node_modules/semver/functions/eq.js"(exports, module) {
|
|
700
515
|
"use strict";
|
|
701
|
-
var compare = require_compare();
|
|
702
|
-
var eq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) === 0, "eq");
|
|
516
|
+
var compare = require_compare(), eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
703
517
|
module.exports = eq;
|
|
704
518
|
}
|
|
705
519
|
});
|
|
@@ -708,8 +522,7 @@ var require_eq = __commonJS({
|
|
|
708
522
|
var require_neq = __commonJS({
|
|
709
523
|
"../../node_modules/semver/functions/neq.js"(exports, module) {
|
|
710
524
|
"use strict";
|
|
711
|
-
var compare = require_compare();
|
|
712
|
-
var neq = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) !== 0, "neq");
|
|
525
|
+
var compare = require_compare(), neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
713
526
|
module.exports = neq;
|
|
714
527
|
}
|
|
715
528
|
});
|
|
@@ -718,8 +531,7 @@ var require_neq = __commonJS({
|
|
|
718
531
|
var require_gte = __commonJS({
|
|
719
532
|
"../../node_modules/semver/functions/gte.js"(exports, module) {
|
|
720
533
|
"use strict";
|
|
721
|
-
var compare = require_compare();
|
|
722
|
-
var gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte");
|
|
534
|
+
var compare = require_compare(), gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
723
535
|
module.exports = gte;
|
|
724
536
|
}
|
|
725
537
|
});
|
|
@@ -728,8 +540,7 @@ var require_gte = __commonJS({
|
|
|
728
540
|
var require_lte = __commonJS({
|
|
729
541
|
"../../node_modules/semver/functions/lte.js"(exports, module) {
|
|
730
542
|
"use strict";
|
|
731
|
-
var compare = require_compare();
|
|
732
|
-
var lte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) <= 0, "lte");
|
|
543
|
+
var compare = require_compare(), lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
733
544
|
module.exports = lte;
|
|
734
545
|
}
|
|
735
546
|
});
|
|
@@ -738,30 +549,12 @@ var require_lte = __commonJS({
|
|
|
738
549
|
var require_cmp = __commonJS({
|
|
739
550
|
"../../node_modules/semver/functions/cmp.js"(exports, module) {
|
|
740
551
|
"use strict";
|
|
741
|
-
var eq = require_eq()
|
|
742
|
-
var neq = require_neq();
|
|
743
|
-
var gt = require_gt();
|
|
744
|
-
var gte = require_gte();
|
|
745
|
-
var lt = require_lt();
|
|
746
|
-
var lte = require_lte();
|
|
747
|
-
var cmp = /* @__PURE__ */ __name((a, op, b, loose) => {
|
|
552
|
+
var eq = require_eq(), neq = require_neq(), gt = require_gt(), gte = require_gte(), lt = require_lt(), lte = require_lte(), cmp = (a, op, b, loose) => {
|
|
748
553
|
switch (op) {
|
|
749
554
|
case "===":
|
|
750
|
-
|
|
751
|
-
a = a.version;
|
|
752
|
-
}
|
|
753
|
-
if (typeof b === "object") {
|
|
754
|
-
b = b.version;
|
|
755
|
-
}
|
|
756
|
-
return a === b;
|
|
555
|
+
return typeof a == "object" && (a = a.version), typeof b == "object" && (b = b.version), a === b;
|
|
757
556
|
case "!==":
|
|
758
|
-
|
|
759
|
-
a = a.version;
|
|
760
|
-
}
|
|
761
|
-
if (typeof b === "object") {
|
|
762
|
-
b = b.version;
|
|
763
|
-
}
|
|
764
|
-
return a !== b;
|
|
557
|
+
return typeof a == "object" && (a = a.version), typeof b == "object" && (b = b.version), a !== b;
|
|
765
558
|
case "":
|
|
766
559
|
case "=":
|
|
767
560
|
case "==":
|
|
@@ -779,7 +572,7 @@ var require_cmp = __commonJS({
|
|
|
779
572
|
default:
|
|
780
573
|
throw new TypeError(`Invalid operator: ${op}`);
|
|
781
574
|
}
|
|
782
|
-
}
|
|
575
|
+
};
|
|
783
576
|
module.exports = cmp;
|
|
784
577
|
}
|
|
785
578
|
});
|
|
@@ -788,44 +581,26 @@ var require_cmp = __commonJS({
|
|
|
788
581
|
var require_coerce = __commonJS({
|
|
789
582
|
"../../node_modules/semver/functions/coerce.js"(exports, module) {
|
|
790
583
|
"use strict";
|
|
791
|
-
var SemVer = require_semver()
|
|
792
|
-
|
|
793
|
-
var { safeRe: re, t } = require_re();
|
|
794
|
-
var coerce = /* @__PURE__ */ __name((version, options) => {
|
|
795
|
-
if (version instanceof SemVer) {
|
|
584
|
+
var SemVer = require_semver(), parse2 = require_parse(), { safeRe: re, t } = require_re(), coerce = (version, options) => {
|
|
585
|
+
if (version instanceof SemVer)
|
|
796
586
|
return version;
|
|
797
|
-
|
|
798
|
-
if (typeof version === "number") {
|
|
799
|
-
version = String(version);
|
|
800
|
-
}
|
|
801
|
-
if (typeof version !== "string") {
|
|
587
|
+
if (typeof version == "number" && (version = String(version)), typeof version != "string")
|
|
802
588
|
return null;
|
|
803
|
-
}
|
|
804
589
|
options = options || {};
|
|
805
590
|
let match = null;
|
|
806
|
-
if (!options.rtl)
|
|
591
|
+
if (!options.rtl)
|
|
807
592
|
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
813
|
-
match = next;
|
|
814
|
-
}
|
|
815
|
-
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
816
|
-
}
|
|
593
|
+
else {
|
|
594
|
+
let coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL], next;
|
|
595
|
+
for (; (next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length); )
|
|
596
|
+
(!match || next.index + next[0].length !== match.index + match[0].length) && (match = next), coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
817
597
|
coerceRtlRegex.lastIndex = -1;
|
|
818
598
|
}
|
|
819
|
-
if (match === null)
|
|
599
|
+
if (match === null)
|
|
820
600
|
return null;
|
|
821
|
-
}
|
|
822
|
-
const major = match[2];
|
|
823
|
-
const minor = match[3] || "0";
|
|
824
|
-
const patch = match[4] || "0";
|
|
825
|
-
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
826
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
601
|
+
let major = match[2], minor = match[3] || "0", patch = match[4] || "0", prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "", build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
827
602
|
return parse2(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
828
|
-
}
|
|
603
|
+
};
|
|
829
604
|
module.exports = coerce;
|
|
830
605
|
}
|
|
831
606
|
});
|
|
@@ -835,31 +610,21 @@ var require_lrucache = __commonJS({
|
|
|
835
610
|
"../../node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
836
611
|
"use strict";
|
|
837
612
|
var LRUCache = class {
|
|
838
|
-
static {
|
|
839
|
-
__name(this, "LRUCache");
|
|
840
|
-
}
|
|
841
613
|
constructor() {
|
|
842
|
-
this.max = 1e3;
|
|
843
|
-
this.map = /* @__PURE__ */ new Map();
|
|
614
|
+
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
844
615
|
}
|
|
845
616
|
get(key) {
|
|
846
|
-
|
|
847
|
-
if (value
|
|
848
|
-
return
|
|
849
|
-
} else {
|
|
850
|
-
this.map.delete(key);
|
|
851
|
-
this.map.set(key, value);
|
|
852
|
-
return value;
|
|
853
|
-
}
|
|
617
|
+
let value = this.map.get(key);
|
|
618
|
+
if (value !== void 0)
|
|
619
|
+
return this.map.delete(key), this.map.set(key, value), value;
|
|
854
620
|
}
|
|
855
621
|
delete(key) {
|
|
856
622
|
return this.map.delete(key);
|
|
857
623
|
}
|
|
858
624
|
set(key, value) {
|
|
859
|
-
|
|
860
|
-
if (!deleted && value !== void 0) {
|
|
625
|
+
if (!this.delete(key) && value !== void 0) {
|
|
861
626
|
if (this.map.size >= this.max) {
|
|
862
|
-
|
|
627
|
+
let firstKey = this.map.keys().next().value;
|
|
863
628
|
this.delete(firstKey);
|
|
864
629
|
}
|
|
865
630
|
this.map.set(key, value);
|
|
@@ -875,46 +640,24 @@ var require_lrucache = __commonJS({
|
|
|
875
640
|
var require_range = __commonJS({
|
|
876
641
|
"../../node_modules/semver/classes/range.js"(exports, module) {
|
|
877
642
|
"use strict";
|
|
878
|
-
var SPACE_CHARACTERS = /\s+/g
|
|
879
|
-
var Range = class _Range {
|
|
880
|
-
static {
|
|
881
|
-
__name(this, "Range");
|
|
882
|
-
}
|
|
643
|
+
var SPACE_CHARACTERS = /\s+/g, Range = class _Range {
|
|
883
644
|
constructor(range, options) {
|
|
884
|
-
options = parseOptions(options)
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
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) {
|
|
645
|
+
if (options = parseOptions(options), range instanceof _Range)
|
|
646
|
+
return range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease ? range : new _Range(range.raw, options);
|
|
647
|
+
if (range instanceof Comparator)
|
|
648
|
+
return this.raw = range.value, this.set = [[range]], this.formatted = void 0, this;
|
|
649
|
+
if (this.options = options, this.loose = !!options.loose, this.includePrerelease = !!options.includePrerelease, this.raw = range.trim().replace(SPACE_CHARACTERS, " "), this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length), !this.set.length)
|
|
904
650
|
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
905
|
-
}
|
|
906
651
|
if (this.set.length > 1) {
|
|
907
|
-
|
|
908
|
-
this.set = this.set.filter((c) => !isNullSet(c[0]))
|
|
909
|
-
if (this.set.length === 0) {
|
|
652
|
+
let first = this.set[0];
|
|
653
|
+
if (this.set = this.set.filter((c) => !isNullSet(c[0])), this.set.length === 0)
|
|
910
654
|
this.set = [first];
|
|
911
|
-
|
|
912
|
-
for (
|
|
655
|
+
else if (this.set.length > 1) {
|
|
656
|
+
for (let c of this.set)
|
|
913
657
|
if (c.length === 1 && isAny(c[0])) {
|
|
914
658
|
this.set = [c];
|
|
915
659
|
break;
|
|
916
660
|
}
|
|
917
|
-
}
|
|
918
661
|
}
|
|
919
662
|
}
|
|
920
663
|
this.formatted = void 0;
|
|
@@ -923,16 +666,10 @@ var require_range = __commonJS({
|
|
|
923
666
|
if (this.formatted === void 0) {
|
|
924
667
|
this.formatted = "";
|
|
925
668
|
for (let i = 0; i < this.set.length; i++) {
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
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
|
-
}
|
|
669
|
+
i > 0 && (this.formatted += "||");
|
|
670
|
+
let comps = this.set[i];
|
|
671
|
+
for (let k = 0; k < comps.length; k++)
|
|
672
|
+
k > 0 && (this.formatted += " "), this.formatted += comps[k].toString().trim();
|
|
936
673
|
}
|
|
937
674
|
}
|
|
938
675
|
return this.formatted;
|
|
@@ -944,309 +681,94 @@ var require_range = __commonJS({
|
|
|
944
681
|
return this.range;
|
|
945
682
|
}
|
|
946
683
|
parseRange(range) {
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
const cached = cache.get(memoKey);
|
|
950
|
-
if (cached) {
|
|
684
|
+
let memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range, cached = cache.get(memoKey);
|
|
685
|
+
if (cached)
|
|
951
686
|
return cached;
|
|
952
|
-
|
|
953
|
-
|
|
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);
|
|
687
|
+
let loose = this.options.loose, hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
688
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease)), debug("hyphen replace", range), range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace), debug("comparator trim", range), range = range.replace(re[t.TILDETRIM], tildeTrimReplace), debug("tilde trim", range), range = range.replace(re[t.CARETTRIM], caretTrimReplace), debug("caret trim", range);
|
|
963
689
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
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)) {
|
|
690
|
+
loose && (rangeList = rangeList.filter((comp) => (debug("loose invalid filter", comp, this.options), !!comp.match(re[t.COMPARATORLOOSE])))), debug("range list", rangeList);
|
|
691
|
+
let rangeMap = /* @__PURE__ */ new Map(), comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
692
|
+
for (let comp of comparators) {
|
|
693
|
+
if (isNullSet(comp))
|
|
975
694
|
return [comp];
|
|
976
|
-
}
|
|
977
695
|
rangeMap.set(comp.value, comp);
|
|
978
696
|
}
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
const result = [...rangeMap.values()];
|
|
983
|
-
cache.set(memoKey, result);
|
|
984
|
-
return result;
|
|
697
|
+
rangeMap.size > 1 && rangeMap.has("") && rangeMap.delete("");
|
|
698
|
+
let result = [...rangeMap.values()];
|
|
699
|
+
return cache.set(memoKey, result), result;
|
|
985
700
|
}
|
|
986
701
|
intersects(range, options) {
|
|
987
|
-
if (!(range instanceof _Range))
|
|
702
|
+
if (!(range instanceof _Range))
|
|
988
703
|
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
|
-
});
|
|
704
|
+
return this.set.some((thisComparators) => isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => rangeComparators.every((rangeComparator) => thisComparator.intersects(rangeComparator, options)))));
|
|
999
705
|
}
|
|
1000
706
|
// if ANY of the sets match ALL of its comparators, then pass
|
|
1001
707
|
test(version) {
|
|
1002
|
-
if (!version)
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1005
|
-
if (typeof version === "string") {
|
|
708
|
+
if (!version)
|
|
709
|
+
return !1;
|
|
710
|
+
if (typeof version == "string")
|
|
1006
711
|
try {
|
|
1007
712
|
version = new SemVer(version, this.options);
|
|
1008
|
-
} catch
|
|
1009
|
-
return
|
|
1010
|
-
}
|
|
1011
|
-
}
|
|
1012
|
-
for (let i = 0; i < this.set.length; i++) {
|
|
1013
|
-
if (testSet(this.set[i], version, this.options)) {
|
|
1014
|
-
return true;
|
|
713
|
+
} catch {
|
|
714
|
+
return !1;
|
|
1015
715
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
716
|
+
for (let i = 0; i < this.set.length; i++)
|
|
717
|
+
if (testSet(this.set[i], version, this.options))
|
|
718
|
+
return !0;
|
|
719
|
+
return !1;
|
|
1018
720
|
}
|
|
1019
721
|
};
|
|
1020
722
|
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 {
|
|
723
|
+
var LRU = require_lrucache(), cache = new LRU(), parseOptions = require_parse_options(), Comparator = require_comparator(), debug = require_debug(), SemVer = require_semver(), {
|
|
1028
724
|
safeRe: re,
|
|
1029
725
|
t,
|
|
1030
726
|
comparatorTrimReplace,
|
|
1031
727
|
tildeTrimReplace,
|
|
1032
728
|
caretTrimReplace
|
|
1033
|
-
} = require_re()
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
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
|
-
}
|
|
729
|
+
} = require_re(), { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants(), isNullSet = (c) => c.value === "<0.0.0-0", isAny = (c) => c.value === "", isSatisfiable = (comparators, options) => {
|
|
730
|
+
let result = !0, remainingComparators = comparators.slice(), testComparator = remainingComparators.pop();
|
|
731
|
+
for (; result && remainingComparators.length; )
|
|
732
|
+
result = remainingComparators.every((otherComparator) => testComparator.intersects(otherComparator, options)), testComparator = remainingComparators.pop();
|
|
1047
733
|
return result;
|
|
1048
|
-
}, "
|
|
1049
|
-
|
|
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];
|
|
734
|
+
}, parseComparator = (comp, options) => (comp = comp.replace(re[t.BUILD], ""), debug("comp", comp, options), comp = replaceCarets(comp, options), debug("caret", comp), comp = replaceTildes(comp, options), debug("tildes", comp), comp = replaceXRanges(comp, options), debug("xrange", comp), comp = replaceStars(comp, options), debug("stars", comp), comp), isX = (id) => !id || id.toLowerCase() === "x" || id === "*", replaceTildes = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" "), replaceTilde = (comp, options) => {
|
|
735
|
+
let r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1067
736
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1068
737
|
debug("tilde", comp, _, M, m, p, pr);
|
|
1069
738
|
let ret;
|
|
1070
|
-
|
|
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`;
|
|
1081
|
-
}
|
|
1082
|
-
debug("tilde return", ret);
|
|
1083
|
-
return ret;
|
|
739
|
+
return isX(M) ? ret = "" : isX(m) ? ret = `>=${M}.0.0 <${+M + 1}.0.0-0` : isX(p) ? ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0` : pr ? (debug("replaceTilde pr", pr), ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`) : ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`, debug("tilde return", ret), ret;
|
|
1084
740
|
});
|
|
1085
|
-
}, "
|
|
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) => {
|
|
741
|
+
}, replaceCarets = (comp, options) => comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" "), replaceCaret = (comp, options) => {
|
|
1090
742
|
debug("caret", comp, options);
|
|
1091
|
-
|
|
1092
|
-
const z = options.includePrerelease ? "-0" : "";
|
|
743
|
+
let r = options.loose ? re[t.CARETLOOSE] : re[t.CARET], z = options.includePrerelease ? "-0" : "";
|
|
1093
744
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1094
745
|
debug("caret", comp, _, M, m, p, pr);
|
|
1095
746
|
let ret;
|
|
1096
|
-
|
|
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`;
|
|
1105
|
-
}
|
|
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
|
-
}
|
|
1114
|
-
} else {
|
|
1115
|
-
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1116
|
-
}
|
|
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`;
|
|
1124
|
-
}
|
|
1125
|
-
} else {
|
|
1126
|
-
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1127
|
-
}
|
|
1128
|
-
}
|
|
1129
|
-
debug("caret return", ret);
|
|
1130
|
-
return ret;
|
|
747
|
+
return isX(M) ? ret = "" : isX(m) ? ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0` : isX(p) ? M === "0" ? ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0` : pr ? (debug("replaceCaret pr", pr), M === "0" ? m === "0" ? ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0` : ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`) : (debug("no pr"), M === "0" ? m === "0" ? ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0` : ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0` : ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`), debug("caret return", ret), ret;
|
|
1131
748
|
});
|
|
1132
|
-
}, "
|
|
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) => {
|
|
749
|
+
}, replaceXRanges = (comp, options) => (debug("replaceXRanges", comp, options), comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ")), replaceXRange = (comp, options) => {
|
|
1138
750
|
comp = comp.trim();
|
|
1139
|
-
|
|
751
|
+
let r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1140
752
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1141
753
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1142
|
-
|
|
1143
|
-
|
|
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;
|
|
1170
|
-
}
|
|
1171
|
-
} else if (gtlt === "<=") {
|
|
1172
|
-
gtlt = "<";
|
|
1173
|
-
if (xm) {
|
|
1174
|
-
M = +M + 1;
|
|
1175
|
-
} else {
|
|
1176
|
-
m = +m + 1;
|
|
1177
|
-
}
|
|
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`;
|
|
1187
|
-
}
|
|
1188
|
-
debug("xRange return", ret);
|
|
1189
|
-
return ret;
|
|
754
|
+
let xM = isX(M), xm = xM || isX(m), xp = xm || isX(p), anyX = xp;
|
|
755
|
+
return gtlt === "=" && anyX && (gtlt = ""), pr = options.includePrerelease ? "-0" : "", xM ? gtlt === ">" || gtlt === "<" ? ret = "<0.0.0-0" : ret = "*" : gtlt && anyX ? (xm && (m = 0), p = 0, gtlt === ">" ? (gtlt = ">=", xm ? (M = +M + 1, m = 0, p = 0) : (m = +m + 1, p = 0)) : gtlt === "<=" && (gtlt = "<", xm ? M = +M + 1 : m = +m + 1), gtlt === "<" && (pr = "-0"), ret = `${gtlt + M}.${m}.${p}${pr}`) : xm ? ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0` : xp && (ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`), debug("xRange return", ret), ret;
|
|
1190
756
|
});
|
|
1191
|
-
}, "
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
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" : ""}`;
|
|
1211
|
-
}
|
|
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}`;
|
|
1224
|
-
}
|
|
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;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
757
|
+
}, replaceStars = (comp, options) => (debug("replaceStars", comp, options), comp.trim().replace(re[t.STAR], "")), replaceGTE0 = (comp, options) => (debug("replaceGTE0", comp, options), comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "")), hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => (isX(fM) ? from = "" : isX(fm) ? from = `>=${fM}.0.0${incPr ? "-0" : ""}` : isX(fp) ? from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}` : fpr ? from = `>=${from}` : from = `>=${from}${incPr ? "-0" : ""}`, isX(tM) ? to = "" : isX(tm) ? to = `<${+tM + 1}.0.0-0` : isX(tp) ? to = `<${tM}.${+tm + 1}.0-0` : tpr ? to = `<=${tM}.${tm}.${tp}-${tpr}` : incPr ? to = `<${tM}.${tm}.${+tp + 1}-0` : to = `<=${to}`, `${from} ${to}`.trim()), testSet = (set, version, options) => {
|
|
758
|
+
for (let i = 0; i < set.length; i++)
|
|
759
|
+
if (!set[i].test(version))
|
|
760
|
+
return !1;
|
|
1233
761
|
if (version.prerelease.length && !options.includePrerelease) {
|
|
1234
|
-
for (let i = 0; i < set.length; i++)
|
|
1235
|
-
debug(set[i].semver)
|
|
1236
|
-
|
|
1237
|
-
|
|
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
|
-
}
|
|
762
|
+
for (let i = 0; i < set.length; i++)
|
|
763
|
+
if (debug(set[i].semver), set[i].semver !== Comparator.ANY && set[i].semver.prerelease.length > 0) {
|
|
764
|
+
let allowed = set[i].semver;
|
|
765
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch)
|
|
766
|
+
return !0;
|
|
1244
767
|
}
|
|
1245
|
-
|
|
1246
|
-
return false;
|
|
768
|
+
return !1;
|
|
1247
769
|
}
|
|
1248
|
-
return
|
|
1249
|
-
}
|
|
770
|
+
return !0;
|
|
771
|
+
};
|
|
1250
772
|
}
|
|
1251
773
|
});
|
|
1252
774
|
|
|
@@ -1254,115 +776,46 @@ var require_range = __commonJS({
|
|
|
1254
776
|
var require_comparator = __commonJS({
|
|
1255
777
|
"../../node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1256
778
|
"use strict";
|
|
1257
|
-
var ANY = Symbol("SemVer ANY")
|
|
1258
|
-
var Comparator = class _Comparator {
|
|
1259
|
-
static {
|
|
1260
|
-
__name(this, "Comparator");
|
|
1261
|
-
}
|
|
779
|
+
var ANY = Symbol("SemVer ANY"), Comparator = class _Comparator {
|
|
1262
780
|
static get ANY() {
|
|
1263
781
|
return ANY;
|
|
1264
782
|
}
|
|
1265
783
|
constructor(comp, options) {
|
|
1266
|
-
options = parseOptions(options)
|
|
1267
|
-
|
|
1268
|
-
if (comp.loose === !!options.loose) {
|
|
784
|
+
if (options = parseOptions(options), comp instanceof _Comparator) {
|
|
785
|
+
if (comp.loose === !!options.loose)
|
|
1269
786
|
return comp;
|
|
1270
|
-
|
|
1271
|
-
comp = comp.value;
|
|
1272
|
-
}
|
|
787
|
+
comp = comp.value;
|
|
1273
788
|
}
|
|
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;
|
|
1283
|
-
}
|
|
1284
|
-
debug("comp", this);
|
|
789
|
+
comp = comp.trim().split(/\s+/).join(" "), debug("comparator", comp, options), this.options = options, this.loose = !!options.loose, this.parse(comp), this.semver === ANY ? this.value = "" : this.value = this.operator + this.semver.version, debug("comp", this);
|
|
1285
790
|
}
|
|
1286
791
|
parse(comp) {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
if (!m) {
|
|
792
|
+
let r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR], m = comp.match(r);
|
|
793
|
+
if (!m)
|
|
1290
794
|
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);
|
|
1300
|
-
}
|
|
795
|
+
this.operator = m[1] !== void 0 ? m[1] : "", this.operator === "=" && (this.operator = ""), m[2] ? this.semver = new SemVer(m[2], this.options.loose) : this.semver = ANY;
|
|
1301
796
|
}
|
|
1302
797
|
toString() {
|
|
1303
798
|
return this.value;
|
|
1304
799
|
}
|
|
1305
800
|
test(version) {
|
|
1306
|
-
debug("Comparator.test", version, this.options.loose)
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
}
|
|
1310
|
-
if (typeof version === "string") {
|
|
801
|
+
if (debug("Comparator.test", version, this.options.loose), this.semver === ANY || version === ANY)
|
|
802
|
+
return !0;
|
|
803
|
+
if (typeof version == "string")
|
|
1311
804
|
try {
|
|
1312
805
|
version = new SemVer(version, this.options);
|
|
1313
|
-
} catch
|
|
1314
|
-
return
|
|
806
|
+
} catch {
|
|
807
|
+
return !1;
|
|
1315
808
|
}
|
|
1316
|
-
}
|
|
1317
809
|
return cmp(version, this.operator, this.semver, this.options);
|
|
1318
810
|
}
|
|
1319
811
|
intersects(comp, options) {
|
|
1320
|
-
if (!(comp instanceof _Comparator))
|
|
812
|
+
if (!(comp instanceof _Comparator))
|
|
1321
813
|
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 === "") {
|
|
1330
|
-
return true;
|
|
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;
|
|
1355
|
-
}
|
|
1356
|
-
return false;
|
|
814
|
+
return this.operator === "" ? this.value === "" ? !0 : new Range(comp.value, options).test(this.value) : comp.operator === "" ? comp.value === "" ? !0 : new Range(this.value, options).test(comp.semver) : (options = parseOptions(options), options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0") || !options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && comp.operator.startsWith(">") || this.operator.startsWith("<") && comp.operator.startsWith("<") || this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=") || cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<") || cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")));
|
|
1357
815
|
}
|
|
1358
816
|
};
|
|
1359
817
|
module.exports = Comparator;
|
|
1360
|
-
var parseOptions = require_parse_options();
|
|
1361
|
-
var { safeRe: re, t } = require_re();
|
|
1362
|
-
var cmp = require_cmp();
|
|
1363
|
-
var debug = require_debug();
|
|
1364
|
-
var SemVer = require_semver();
|
|
1365
|
-
var Range = require_range();
|
|
818
|
+
var parseOptions = require_parse_options(), { safeRe: re, t } = require_re(), cmp = require_cmp(), debug = require_debug(), SemVer = require_semver(), Range = require_range();
|
|
1366
819
|
}
|
|
1367
820
|
});
|
|
1368
821
|
|
|
@@ -1370,15 +823,14 @@ var require_comparator = __commonJS({
|
|
|
1370
823
|
var require_satisfies = __commonJS({
|
|
1371
824
|
"../../node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1372
825
|
"use strict";
|
|
1373
|
-
var Range = require_range()
|
|
1374
|
-
var satisfies = /* @__PURE__ */ __name((version, range, options) => {
|
|
826
|
+
var Range = require_range(), satisfies = (version, range, options) => {
|
|
1375
827
|
try {
|
|
1376
828
|
range = new Range(range, options);
|
|
1377
|
-
} catch
|
|
1378
|
-
return
|
|
829
|
+
} catch {
|
|
830
|
+
return !1;
|
|
1379
831
|
}
|
|
1380
832
|
return range.test(version);
|
|
1381
|
-
}
|
|
833
|
+
};
|
|
1382
834
|
module.exports = satisfies;
|
|
1383
835
|
}
|
|
1384
836
|
});
|
|
@@ -1387,8 +839,7 @@ var require_satisfies = __commonJS({
|
|
|
1387
839
|
var require_to_comparators = __commonJS({
|
|
1388
840
|
"../../node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1389
841
|
"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");
|
|
842
|
+
var Range = require_range(), toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1392
843
|
module.exports = toComparators;
|
|
1393
844
|
}
|
|
1394
845
|
});
|
|
@@ -1397,27 +848,17 @@ var require_to_comparators = __commonJS({
|
|
|
1397
848
|
var require_max_satisfying = __commonJS({
|
|
1398
849
|
"../../node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1399
850
|
"use strict";
|
|
1400
|
-
var SemVer = require_semver()
|
|
1401
|
-
|
|
1402
|
-
var maxSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
1403
|
-
let max = null;
|
|
1404
|
-
let maxSV = null;
|
|
1405
|
-
let rangeObj = null;
|
|
851
|
+
var SemVer = require_semver(), Range = require_range(), maxSatisfying = (versions, range, options) => {
|
|
852
|
+
let max = null, maxSV = null, rangeObj = null;
|
|
1406
853
|
try {
|
|
1407
854
|
rangeObj = new Range(range, options);
|
|
1408
|
-
} catch
|
|
855
|
+
} catch {
|
|
1409
856
|
return null;
|
|
1410
857
|
}
|
|
1411
|
-
versions.forEach((v) => {
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
maxSV = new SemVer(max, options);
|
|
1416
|
-
}
|
|
1417
|
-
}
|
|
1418
|
-
});
|
|
1419
|
-
return max;
|
|
1420
|
-
}, "maxSatisfying");
|
|
858
|
+
return versions.forEach((v) => {
|
|
859
|
+
rangeObj.test(v) && (!max || maxSV.compare(v) === -1) && (max = v, maxSV = new SemVer(max, options));
|
|
860
|
+
}), max;
|
|
861
|
+
};
|
|
1421
862
|
module.exports = maxSatisfying;
|
|
1422
863
|
}
|
|
1423
864
|
});
|
|
@@ -1426,27 +867,17 @@ var require_max_satisfying = __commonJS({
|
|
|
1426
867
|
var require_min_satisfying = __commonJS({
|
|
1427
868
|
"../../node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1428
869
|
"use strict";
|
|
1429
|
-
var SemVer = require_semver()
|
|
1430
|
-
|
|
1431
|
-
var minSatisfying = /* @__PURE__ */ __name((versions, range, options) => {
|
|
1432
|
-
let min = null;
|
|
1433
|
-
let minSV = null;
|
|
1434
|
-
let rangeObj = null;
|
|
870
|
+
var SemVer = require_semver(), Range = require_range(), minSatisfying = (versions, range, options) => {
|
|
871
|
+
let min = null, minSV = null, rangeObj = null;
|
|
1435
872
|
try {
|
|
1436
873
|
rangeObj = new Range(range, options);
|
|
1437
|
-
} catch
|
|
874
|
+
} catch {
|
|
1438
875
|
return null;
|
|
1439
876
|
}
|
|
1440
|
-
versions.forEach((v) => {
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
minSV = new SemVer(min, options);
|
|
1445
|
-
}
|
|
1446
|
-
}
|
|
1447
|
-
});
|
|
1448
|
-
return min;
|
|
1449
|
-
}, "minSatisfying");
|
|
877
|
+
return versions.forEach((v) => {
|
|
878
|
+
rangeObj.test(v) && (!min || minSV.compare(v) === 1) && (min = v, minSV = new SemVer(min, options));
|
|
879
|
+
}), min;
|
|
880
|
+
};
|
|
1450
881
|
module.exports = minSatisfying;
|
|
1451
882
|
}
|
|
1452
883
|
});
|
|
@@ -1455,39 +886,23 @@ var require_min_satisfying = __commonJS({
|
|
|
1455
886
|
var require_min_version = __commonJS({
|
|
1456
887
|
"../../node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1457
888
|
"use strict";
|
|
1458
|
-
var SemVer = require_semver()
|
|
1459
|
-
var Range = require_range();
|
|
1460
|
-
var gt = require_gt();
|
|
1461
|
-
var minVersion = /* @__PURE__ */ __name((range, loose) => {
|
|
889
|
+
var SemVer = require_semver(), Range = require_range(), gt = require_gt(), minVersion = (range, loose) => {
|
|
1462
890
|
range = new Range(range, loose);
|
|
1463
891
|
let minver = new SemVer("0.0.0");
|
|
1464
|
-
if (range.test(minver))
|
|
1465
|
-
return minver;
|
|
1466
|
-
}
|
|
1467
|
-
minver = new SemVer("0.0.0-0");
|
|
1468
|
-
if (range.test(minver)) {
|
|
892
|
+
if (range.test(minver) || (minver = new SemVer("0.0.0-0"), range.test(minver)))
|
|
1469
893
|
return minver;
|
|
1470
|
-
}
|
|
1471
894
|
minver = null;
|
|
1472
895
|
for (let i = 0; i < range.set.length; ++i) {
|
|
1473
|
-
|
|
1474
|
-
let setMin = null;
|
|
896
|
+
let comparators = range.set[i], setMin = null;
|
|
1475
897
|
comparators.forEach((comparator) => {
|
|
1476
|
-
|
|
898
|
+
let compver = new SemVer(comparator.semver.version);
|
|
1477
899
|
switch (comparator.operator) {
|
|
1478
900
|
case ">":
|
|
1479
|
-
|
|
1480
|
-
compver.patch++;
|
|
1481
|
-
} else {
|
|
1482
|
-
compver.prerelease.push(0);
|
|
1483
|
-
}
|
|
1484
|
-
compver.raw = compver.format();
|
|
901
|
+
compver.prerelease.length === 0 ? compver.patch++ : compver.prerelease.push(0), compver.raw = compver.format();
|
|
1485
902
|
/* fallthrough */
|
|
1486
903
|
case "":
|
|
1487
904
|
case ">=":
|
|
1488
|
-
|
|
1489
|
-
setMin = compver;
|
|
1490
|
-
}
|
|
905
|
+
(!setMin || gt(compver, setMin)) && (setMin = compver);
|
|
1491
906
|
break;
|
|
1492
907
|
case "<":
|
|
1493
908
|
case "<=":
|
|
@@ -1496,16 +911,10 @@ var require_min_version = __commonJS({
|
|
|
1496
911
|
default:
|
|
1497
912
|
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1498
913
|
}
|
|
1499
|
-
});
|
|
1500
|
-
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1501
|
-
minver = setMin;
|
|
1502
|
-
}
|
|
914
|
+
}), setMin && (!minver || gt(minver, setMin)) && (minver = setMin);
|
|
1503
915
|
}
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
}
|
|
1507
|
-
return null;
|
|
1508
|
-
}, "minVersion");
|
|
916
|
+
return minver && range.test(minver) ? minver : null;
|
|
917
|
+
};
|
|
1509
918
|
module.exports = minVersion;
|
|
1510
919
|
}
|
|
1511
920
|
});
|
|
@@ -1514,14 +923,13 @@ var require_min_version = __commonJS({
|
|
|
1514
923
|
var require_valid2 = __commonJS({
|
|
1515
924
|
"../../node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1516
925
|
"use strict";
|
|
1517
|
-
var Range = require_range()
|
|
1518
|
-
var validRange = /* @__PURE__ */ __name((range, options) => {
|
|
926
|
+
var Range = require_range(), validRange = (range, options) => {
|
|
1519
927
|
try {
|
|
1520
928
|
return new Range(range, options).range || "*";
|
|
1521
|
-
} catch
|
|
929
|
+
} catch {
|
|
1522
930
|
return null;
|
|
1523
931
|
}
|
|
1524
|
-
}
|
|
932
|
+
};
|
|
1525
933
|
module.exports = validRange;
|
|
1526
934
|
}
|
|
1527
935
|
});
|
|
@@ -1530,67 +938,32 @@ var require_valid2 = __commonJS({
|
|
|
1530
938
|
var require_outside = __commonJS({
|
|
1531
939
|
"../../node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1532
940
|
"use strict";
|
|
1533
|
-
var SemVer = require_semver()
|
|
1534
|
-
|
|
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);
|
|
941
|
+
var SemVer = require_semver(), Comparator = require_comparator(), { ANY } = Comparator, Range = require_range(), satisfies = require_satisfies(), gt = require_gt(), lt = require_lt(), lte = require_lte(), gte = require_gte(), outside = (version, range, hilo, options) => {
|
|
942
|
+
version = new SemVer(version, options), range = new Range(range, options);
|
|
1545
943
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1546
944
|
switch (hilo) {
|
|
1547
945
|
case ">":
|
|
1548
|
-
gtfn = gt;
|
|
1549
|
-
ltefn = lte;
|
|
1550
|
-
ltfn = lt;
|
|
1551
|
-
comp = ">";
|
|
1552
|
-
ecomp = ">=";
|
|
946
|
+
gtfn = gt, ltefn = lte, ltfn = lt, comp = ">", ecomp = ">=";
|
|
1553
947
|
break;
|
|
1554
948
|
case "<":
|
|
1555
|
-
gtfn = lt;
|
|
1556
|
-
ltefn = gte;
|
|
1557
|
-
ltfn = gt;
|
|
1558
|
-
comp = "<";
|
|
1559
|
-
ecomp = "<=";
|
|
949
|
+
gtfn = lt, ltefn = gte, ltfn = gt, comp = "<", ecomp = "<=";
|
|
1560
950
|
break;
|
|
1561
951
|
default:
|
|
1562
952
|
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1563
953
|
}
|
|
1564
|
-
if (satisfies(version, range, options))
|
|
1565
|
-
return
|
|
1566
|
-
}
|
|
954
|
+
if (satisfies(version, range, options))
|
|
955
|
+
return !1;
|
|
1567
956
|
for (let i = 0; i < range.set.length; ++i) {
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
high = comparator;
|
|
1579
|
-
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1580
|
-
low = comparator;
|
|
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;
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
return true;
|
|
1593
|
-
}, "outside");
|
|
957
|
+
let comparators = range.set[i], high = null, low = null;
|
|
958
|
+
if (comparators.forEach((comparator) => {
|
|
959
|
+
comparator.semver === ANY && (comparator = new Comparator(">=0.0.0")), high = high || comparator, low = low || comparator, gtfn(comparator.semver, high.semver, options) ? high = comparator : ltfn(comparator.semver, low.semver, options) && (low = comparator);
|
|
960
|
+
}), high.operator === comp || high.operator === ecomp || (!low.operator || low.operator === comp) && ltefn(version, low.semver))
|
|
961
|
+
return !1;
|
|
962
|
+
if (low.operator === ecomp && ltfn(version, low.semver))
|
|
963
|
+
return !1;
|
|
964
|
+
}
|
|
965
|
+
return !0;
|
|
966
|
+
};
|
|
1594
967
|
module.exports = outside;
|
|
1595
968
|
}
|
|
1596
969
|
});
|
|
@@ -1599,8 +972,7 @@ var require_outside = __commonJS({
|
|
|
1599
972
|
var require_gtr = __commonJS({
|
|
1600
973
|
"../../node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1601
974
|
"use strict";
|
|
1602
|
-
var outside = require_outside();
|
|
1603
|
-
var gtr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, ">", options), "gtr");
|
|
975
|
+
var outside = require_outside(), gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1604
976
|
module.exports = gtr;
|
|
1605
977
|
}
|
|
1606
978
|
});
|
|
@@ -1609,8 +981,7 @@ var require_gtr = __commonJS({
|
|
|
1609
981
|
var require_ltr = __commonJS({
|
|
1610
982
|
"../../node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1611
983
|
"use strict";
|
|
1612
|
-
var outside = require_outside();
|
|
1613
|
-
var ltr = /* @__PURE__ */ __name((version, range, options) => outside(version, range, "<", options), "ltr");
|
|
984
|
+
var outside = require_outside(), ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1614
985
|
module.exports = ltr;
|
|
1615
986
|
}
|
|
1616
987
|
});
|
|
@@ -1619,12 +990,7 @@ var require_ltr = __commonJS({
|
|
|
1619
990
|
var require_intersects = __commonJS({
|
|
1620
991
|
"../../node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1621
992
|
"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");
|
|
993
|
+
var Range = require_range(), intersects = (r1, r2, options) => (r1 = new Range(r1, options), r2 = new Range(r2, options), r1.intersects(r2, options));
|
|
1628
994
|
module.exports = intersects;
|
|
1629
995
|
}
|
|
1630
996
|
});
|
|
@@ -1633,47 +999,16 @@ var require_intersects = __commonJS({
|
|
|
1633
999
|
var require_simplify = __commonJS({
|
|
1634
1000
|
"../../node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1635
1001
|
"use strict";
|
|
1636
|
-
var satisfies = require_satisfies();
|
|
1637
|
-
var compare = require_compare();
|
|
1002
|
+
var satisfies = require_satisfies(), compare = require_compare();
|
|
1638
1003
|
module.exports = (versions, range, options) => {
|
|
1639
|
-
|
|
1640
|
-
let
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
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
|
-
}
|
|
1657
|
-
}
|
|
1658
|
-
if (first) {
|
|
1659
|
-
set.push([first, null]);
|
|
1660
|
-
}
|
|
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);
|
|
1004
|
+
let set = [], first = null, prev = null, v = versions.sort((a, b) => compare(a, b, options));
|
|
1005
|
+
for (let version of v)
|
|
1006
|
+
satisfies(version, range, options) ? (prev = version, first || (first = version)) : (prev && set.push([first, prev]), prev = null, first = null);
|
|
1007
|
+
first && set.push([first, null]);
|
|
1008
|
+
let ranges = [];
|
|
1009
|
+
for (let [min, max] of set)
|
|
1010
|
+
min === max ? ranges.push(min) : !max && min === v[0] ? ranges.push("*") : max ? min === v[0] ? ranges.push(`<=${max}`) : ranges.push(`${min} - ${max}`) : ranges.push(`>=${min}`);
|
|
1011
|
+
let simplified = ranges.join(" || "), original = typeof range.raw == "string" ? range.raw : String(range);
|
|
1677
1012
|
return simplified.length < original.length ? simplified : range;
|
|
1678
1013
|
};
|
|
1679
1014
|
}
|
|
@@ -1683,160 +1018,86 @@ var require_simplify = __commonJS({
|
|
|
1683
1018
|
var require_subset = __commonJS({
|
|
1684
1019
|
"../../node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1685
1020
|
"use strict";
|
|
1686
|
-
var Range = require_range()
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
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) {
|
|
1021
|
+
var Range = require_range(), Comparator = require_comparator(), { ANY } = Comparator, satisfies = require_satisfies(), compare = require_compare(), subset = (sub, dom, options = {}) => {
|
|
1022
|
+
if (sub === dom)
|
|
1023
|
+
return !0;
|
|
1024
|
+
sub = new Range(sub, options), dom = new Range(dom, options);
|
|
1025
|
+
let sawNonNull = !1;
|
|
1026
|
+
OUTER: for (let simpleSub of sub.set) {
|
|
1027
|
+
for (let simpleDom of dom.set) {
|
|
1028
|
+
let isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1029
|
+
if (sawNonNull = sawNonNull || isSub !== null, isSub)
|
|
1703
1030
|
continue OUTER;
|
|
1704
|
-
}
|
|
1705
1031
|
}
|
|
1706
|
-
if (sawNonNull)
|
|
1707
|
-
return
|
|
1708
|
-
}
|
|
1709
|
-
}
|
|
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;
|
|
1032
|
+
if (sawNonNull)
|
|
1033
|
+
return !1;
|
|
1717
1034
|
}
|
|
1035
|
+
return !0;
|
|
1036
|
+
}, minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")], minimumVersion = [new Comparator(">=0.0.0")], simpleSubset = (sub, dom, options) => {
|
|
1037
|
+
if (sub === dom)
|
|
1038
|
+
return !0;
|
|
1718
1039
|
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1719
|
-
if (dom.length === 1 && dom[0].semver === ANY)
|
|
1720
|
-
return
|
|
1721
|
-
|
|
1722
|
-
sub = minimumVersionWithPreRelease;
|
|
1723
|
-
} else {
|
|
1724
|
-
sub = minimumVersion;
|
|
1725
|
-
}
|
|
1040
|
+
if (dom.length === 1 && dom[0].semver === ANY)
|
|
1041
|
+
return !0;
|
|
1042
|
+
options.includePrerelease ? sub = minimumVersionWithPreRelease : sub = minimumVersion;
|
|
1726
1043
|
}
|
|
1727
1044
|
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1728
|
-
if (options.includePrerelease)
|
|
1729
|
-
return
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
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);
|
|
1741
|
-
} else {
|
|
1742
|
-
eqSet.add(c.semver);
|
|
1743
|
-
}
|
|
1744
|
-
}
|
|
1745
|
-
if (eqSet.size > 1) {
|
|
1045
|
+
if (options.includePrerelease)
|
|
1046
|
+
return !0;
|
|
1047
|
+
dom = minimumVersion;
|
|
1048
|
+
}
|
|
1049
|
+
let eqSet = /* @__PURE__ */ new Set(), gt, lt;
|
|
1050
|
+
for (let c of sub)
|
|
1051
|
+
c.operator === ">" || c.operator === ">=" ? gt = higherGT(gt, c, options) : c.operator === "<" || c.operator === "<=" ? lt = lowerLT(lt, c, options) : eqSet.add(c.semver);
|
|
1052
|
+
if (eqSet.size > 1)
|
|
1746
1053
|
return null;
|
|
1747
|
-
}
|
|
1748
1054
|
let gtltComp;
|
|
1749
1055
|
if (gt && lt) {
|
|
1750
|
-
gtltComp = compare(gt.semver, lt.semver, options)
|
|
1751
|
-
if (gtltComp > 0) {
|
|
1056
|
+
if (gtltComp = compare(gt.semver, lt.semver, options), gtltComp > 0)
|
|
1752
1057
|
return null;
|
|
1753
|
-
|
|
1058
|
+
if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<="))
|
|
1754
1059
|
return null;
|
|
1755
|
-
}
|
|
1756
1060
|
}
|
|
1757
|
-
for (
|
|
1758
|
-
if (gt && !satisfies(eq, String(gt), options))
|
|
1759
|
-
return null;
|
|
1760
|
-
}
|
|
1761
|
-
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1061
|
+
for (let eq of eqSet) {
|
|
1062
|
+
if (gt && !satisfies(eq, String(gt), options) || lt && !satisfies(eq, String(lt), options))
|
|
1762
1063
|
return null;
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
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)) {
|
|
1793
|
-
return false;
|
|
1794
|
-
}
|
|
1064
|
+
for (let c of dom)
|
|
1065
|
+
if (!satisfies(eq, String(c), options))
|
|
1066
|
+
return !1;
|
|
1067
|
+
return !0;
|
|
1068
|
+
}
|
|
1069
|
+
let higher, lower, hasDomLT, hasDomGT, needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : !1, needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : !1;
|
|
1070
|
+
needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0 && (needDomLTPre = !1);
|
|
1071
|
+
for (let c of dom) {
|
|
1072
|
+
if (hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=", hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=", gt) {
|
|
1073
|
+
if (needDomGTPre && c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch && (needDomGTPre = !1), c.operator === ">" || c.operator === ">=") {
|
|
1074
|
+
if (higher = higherGT(gt, c, options), higher === c && higher !== gt)
|
|
1075
|
+
return !1;
|
|
1076
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options))
|
|
1077
|
+
return !1;
|
|
1795
1078
|
}
|
|
1796
1079
|
if (lt) {
|
|
1797
|
-
if (needDomLTPre) {
|
|
1798
|
-
if (
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
}
|
|
1810
|
-
}
|
|
1811
|
-
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1812
|
-
return false;
|
|
1813
|
-
}
|
|
1814
|
-
}
|
|
1815
|
-
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1816
|
-
return false;
|
|
1817
|
-
}
|
|
1818
|
-
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1819
|
-
return false;
|
|
1820
|
-
}
|
|
1821
|
-
if (needDomGTPre || needDomLTPre) {
|
|
1822
|
-
return false;
|
|
1823
|
-
}
|
|
1824
|
-
return true;
|
|
1825
|
-
}, "simpleSubset");
|
|
1826
|
-
var higherGT = /* @__PURE__ */ __name((a, b, options) => {
|
|
1827
|
-
if (!a) {
|
|
1080
|
+
if (needDomLTPre && c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch && (needDomLTPre = !1), c.operator === "<" || c.operator === "<=") {
|
|
1081
|
+
if (lower = lowerLT(lt, c, options), lower === c && lower !== lt)
|
|
1082
|
+
return !1;
|
|
1083
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options))
|
|
1084
|
+
return !1;
|
|
1085
|
+
}
|
|
1086
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0)
|
|
1087
|
+
return !1;
|
|
1088
|
+
}
|
|
1089
|
+
return !(gt && hasDomLT && !lt && gtltComp !== 0 || lt && hasDomGT && !gt && gtltComp !== 0 || needDomGTPre || needDomLTPre);
|
|
1090
|
+
}, higherGT = (a, b, options) => {
|
|
1091
|
+
if (!a)
|
|
1828
1092
|
return b;
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
var lowerLT = /* @__PURE__ */ __name((a, b, options) => {
|
|
1834
|
-
if (!a) {
|
|
1093
|
+
let comp = compare(a.semver, b.semver, options);
|
|
1094
|
+
return comp > 0 ? a : comp < 0 || b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1095
|
+
}, lowerLT = (a, b, options) => {
|
|
1096
|
+
if (!a)
|
|
1835
1097
|
return b;
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
}, "lowerLT");
|
|
1098
|
+
let comp = compare(a.semver, b.semver, options);
|
|
1099
|
+
return comp < 0 ? a : comp > 0 || b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1100
|
+
};
|
|
1840
1101
|
module.exports = subset;
|
|
1841
1102
|
}
|
|
1842
1103
|
});
|
|
@@ -1845,47 +1106,7 @@ var require_subset = __commonJS({
|
|
|
1845
1106
|
var require_semver2 = __commonJS({
|
|
1846
1107
|
"../../node_modules/semver/index.js"(exports, module) {
|
|
1847
1108
|
"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();
|
|
1876
|
-
var Range = require_range();
|
|
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();
|
|
1109
|
+
var internalRe = require_re(), constants = require_constants(), SemVer = require_semver(), identifiers = require_identifiers(), parse2 = require_parse(), valid = require_valid(), clean = require_clean(), inc = require_inc(), diff = require_diff(), major = require_major(), minor = require_minor(), patch = require_patch(), prerelease = require_prerelease(), compare = require_compare(), rcompare = require_rcompare(), compareLoose = require_compare_loose(), compareBuild = require_compare_build(), sort = require_sort(), rsort = require_rsort(), gt = require_gt(), lt = require_lt(), eq = require_eq(), neq = require_neq(), gte = require_gte(), lte = require_lte(), cmp = require_cmp(), coerce = require_coerce(), Comparator = require_comparator(), Range = require_range(), satisfies = require_satisfies(), toComparators = require_to_comparators(), maxSatisfying = require_max_satisfying(), minSatisfying = require_min_satisfying(), minVersion = require_min_version(), validRange = require_valid2(), outside = require_outside(), gtr = require_gtr(), ltr = require_ltr(), intersects = require_intersects(), simplifyRange = require_simplify(), subset = require_subset();
|
|
1889
1110
|
module.exports = {
|
|
1890
1111
|
parse: parse2,
|
|
1891
1112
|
valid,
|
|
@@ -1939,11 +1160,7 @@ var require_semver2 = __commonJS({
|
|
|
1939
1160
|
// ../../node_modules/lilconfig/src/index.js
|
|
1940
1161
|
var require_src = __commonJS({
|
|
1941
1162
|
"../../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;
|
|
1163
|
+
var path2 = __require("path"), fs = __require("fs"), os = __require("os"), url = __require("url"), fsReadFileAsync = fs.promises.readFile;
|
|
1947
1164
|
function getDefaultSearchPlaces(name, sync) {
|
|
1948
1165
|
return [
|
|
1949
1166
|
"package.json",
|
|
@@ -1961,40 +1178,27 @@ var require_src = __commonJS({
|
|
|
1961
1178
|
...sync ? [] : [`${name}.config.mjs`]
|
|
1962
1179
|
];
|
|
1963
1180
|
}
|
|
1964
|
-
__name(getDefaultSearchPlaces, "getDefaultSearchPlaces");
|
|
1965
1181
|
function parentDir(p) {
|
|
1966
1182
|
return path2.dirname(p) || path2.sep;
|
|
1967
1183
|
}
|
|
1968
|
-
|
|
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({
|
|
1184
|
+
var jsonLoader = (_, content) => JSON.parse(content), requireFunc = typeof __webpack_require__ == "function" ? __non_webpack_require__ : __require, defaultLoadersSync = Object.freeze({
|
|
1972
1185
|
".js": requireFunc,
|
|
1973
1186
|
".json": requireFunc,
|
|
1974
1187
|
".cjs": requireFunc,
|
|
1975
1188
|
noExt: jsonLoader
|
|
1976
1189
|
});
|
|
1977
1190
|
module.exports.defaultLoadersSync = defaultLoadersSync;
|
|
1978
|
-
var dynamicImport =
|
|
1191
|
+
var dynamicImport = async (id) => {
|
|
1979
1192
|
try {
|
|
1980
|
-
|
|
1981
|
-
const mod = await import(
|
|
1982
|
-
/* webpackIgnore: true */
|
|
1983
|
-
fileUrl
|
|
1984
|
-
);
|
|
1985
|
-
return mod.default;
|
|
1193
|
+
return (await import(url.pathToFileURL(id).href)).default;
|
|
1986
1194
|
} catch (e) {
|
|
1987
1195
|
try {
|
|
1988
1196
|
return requireFunc(id);
|
|
1989
1197
|
} catch (requireE) {
|
|
1990
|
-
|
|
1991
|
-
throw e;
|
|
1992
|
-
}
|
|
1993
|
-
throw requireE;
|
|
1198
|
+
throw requireE.code === "ERR_REQUIRE_ESM" || requireE instanceof SyntaxError && requireE.toString().includes("Cannot use import statement outside a module") ? e : requireE;
|
|
1994
1199
|
}
|
|
1995
1200
|
}
|
|
1996
|
-
},
|
|
1997
|
-
var defaultLoaders = Object.freeze({
|
|
1201
|
+
}, defaultLoaders = Object.freeze({
|
|
1998
1202
|
".js": dynamicImport,
|
|
1999
1203
|
".mjs": dynamicImport,
|
|
2000
1204
|
".cjs": dynamicImport,
|
|
@@ -2003,12 +1207,12 @@ var require_src = __commonJS({
|
|
|
2003
1207
|
});
|
|
2004
1208
|
module.exports.defaultLoaders = defaultLoaders;
|
|
2005
1209
|
function getOptions(name, options, sync) {
|
|
2006
|
-
|
|
1210
|
+
let conf = {
|
|
2007
1211
|
stopDir: os.homedir(),
|
|
2008
1212
|
searchPlaces: getDefaultSearchPlaces(name, sync),
|
|
2009
|
-
ignoreEmptySearchPlaces:
|
|
2010
|
-
cache:
|
|
2011
|
-
transform:
|
|
1213
|
+
ignoreEmptySearchPlaces: !0,
|
|
1214
|
+
cache: !0,
|
|
1215
|
+
transform: (x) => x,
|
|
2012
1216
|
packageProp: [name],
|
|
2013
1217
|
...options,
|
|
2014
1218
|
loaders: {
|
|
@@ -2016,44 +1220,32 @@ var require_src = __commonJS({
|
|
|
2016
1220
|
...options.loaders
|
|
2017
1221
|
}
|
|
2018
1222
|
};
|
|
2019
|
-
conf.searchPlaces.forEach((place) => {
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
if (!loader2) {
|
|
1223
|
+
return conf.searchPlaces.forEach((place) => {
|
|
1224
|
+
let key = path2.extname(place) || "noExt", loader2 = conf.loaders[key];
|
|
1225
|
+
if (!loader2)
|
|
2023
1226
|
throw new Error(`Missing loader for extension "${place}"`);
|
|
2024
|
-
|
|
2025
|
-
if (typeof loader2 !== "function") {
|
|
1227
|
+
if (typeof loader2 != "function")
|
|
2026
1228
|
throw new Error(
|
|
2027
1229
|
`Loader for extension "${place}" is not a function: Received ${typeof loader2}.`
|
|
2028
1230
|
);
|
|
2029
|
-
|
|
2030
|
-
});
|
|
2031
|
-
return conf;
|
|
1231
|
+
}), conf;
|
|
2032
1232
|
}
|
|
2033
|
-
__name(getOptions, "getOptions");
|
|
2034
1233
|
function getPackageProp(props, obj) {
|
|
2035
|
-
|
|
2036
|
-
return (Array.isArray(props) ? props : props.split(".")).reduce(
|
|
1234
|
+
return typeof props == "string" && props in obj ? obj[props] : (Array.isArray(props) ? props : props.split(".")).reduce(
|
|
2037
1235
|
(acc, prop) => acc === void 0 ? acc : acc[prop],
|
|
2038
1236
|
obj
|
|
2039
1237
|
) || null;
|
|
2040
1238
|
}
|
|
2041
|
-
__name(getPackageProp, "getPackageProp");
|
|
2042
1239
|
function validateFilePath(filepath) {
|
|
2043
1240
|
if (!filepath) throw new Error("load must pass a non-empty string");
|
|
2044
1241
|
}
|
|
2045
|
-
__name(validateFilePath, "validateFilePath");
|
|
2046
1242
|
function validateLoader(loader2, ext) {
|
|
2047
1243
|
if (!loader2) throw new Error(`No loader specified for extension "${ext}"`);
|
|
2048
|
-
if (typeof loader2
|
|
1244
|
+
if (typeof loader2 != "function") throw new Error("loader is not a function");
|
|
2049
1245
|
}
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
return res;
|
|
2054
|
-
}, "makeEmplace");
|
|
2055
|
-
module.exports.lilconfig = /* @__PURE__ */ __name(function lilconfig(name, options) {
|
|
2056
|
-
const {
|
|
1246
|
+
var makeEmplace = (enableCache) => (c, filepath, res) => (enableCache && c.set(filepath, res), res);
|
|
1247
|
+
module.exports.lilconfig = function(name, options) {
|
|
1248
|
+
let {
|
|
2057
1249
|
ignoreEmptySearchPlaces,
|
|
2058
1250
|
loaders,
|
|
2059
1251
|
packageProp,
|
|
@@ -2061,84 +1253,65 @@ var require_src = __commonJS({
|
|
|
2061
1253
|
stopDir,
|
|
2062
1254
|
transform,
|
|
2063
1255
|
cache
|
|
2064
|
-
} = getOptions(name, options ?? {},
|
|
2065
|
-
const searchCache = /* @__PURE__ */ new Map();
|
|
2066
|
-
const loadCache = /* @__PURE__ */ new Map();
|
|
2067
|
-
const emplace = makeEmplace(cache);
|
|
1256
|
+
} = getOptions(name, options ?? {}, !1), searchCache = /* @__PURE__ */ new Map(), loadCache = /* @__PURE__ */ new Map(), emplace = makeEmplace(cache);
|
|
2068
1257
|
return {
|
|
2069
1258
|
async search(searchFrom = process.cwd()) {
|
|
2070
|
-
|
|
1259
|
+
let result = {
|
|
2071
1260
|
config: null,
|
|
2072
1261
|
filepath: ""
|
|
2073
|
-
};
|
|
2074
|
-
|
|
2075
|
-
let dir = searchFrom;
|
|
2076
|
-
dirLoop: while (true) {
|
|
1262
|
+
}, visited = /* @__PURE__ */ new Set(), dir = searchFrom;
|
|
1263
|
+
dirLoop: for (; ; ) {
|
|
2077
1264
|
if (cache) {
|
|
2078
|
-
|
|
1265
|
+
let r = searchCache.get(dir);
|
|
2079
1266
|
if (r !== void 0) {
|
|
2080
|
-
for (
|
|
1267
|
+
for (let p of visited) searchCache.set(p, r);
|
|
2081
1268
|
return r;
|
|
2082
1269
|
}
|
|
2083
1270
|
visited.add(dir);
|
|
2084
1271
|
}
|
|
2085
|
-
for (
|
|
2086
|
-
|
|
1272
|
+
for (let searchPlace of searchPlaces) {
|
|
1273
|
+
let filepath = path2.join(dir, searchPlace);
|
|
2087
1274
|
try {
|
|
2088
1275
|
await fs.promises.access(filepath);
|
|
2089
1276
|
} catch {
|
|
2090
1277
|
continue;
|
|
2091
1278
|
}
|
|
2092
|
-
|
|
2093
|
-
const loaderKey = path2.extname(searchPlace) || "noExt";
|
|
2094
|
-
const loader2 = loaders[loaderKey];
|
|
1279
|
+
let content = String(await fsReadFileAsync(filepath)), loaderKey = path2.extname(searchPlace) || "noExt", loader2 = loaders[loaderKey];
|
|
2095
1280
|
if (searchPlace === "package.json") {
|
|
2096
|
-
|
|
2097
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
1281
|
+
let pkg = await loader2(filepath, content), maybeConfig = getPackageProp(packageProp, pkg);
|
|
2098
1282
|
if (maybeConfig != null) {
|
|
2099
|
-
result.config = maybeConfig;
|
|
2100
|
-
result.filepath = filepath;
|
|
1283
|
+
result.config = maybeConfig, result.filepath = filepath;
|
|
2101
1284
|
break dirLoop;
|
|
2102
1285
|
}
|
|
2103
1286
|
continue;
|
|
2104
1287
|
}
|
|
2105
|
-
|
|
2106
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
result.config = void 0;
|
|
2110
|
-
} else {
|
|
2111
|
-
validateLoader(loader2, loaderKey);
|
|
2112
|
-
result.config = await loader2(filepath, content);
|
|
1288
|
+
let isEmpty = content.trim() === "";
|
|
1289
|
+
if (!(isEmpty && ignoreEmptySearchPlaces)) {
|
|
1290
|
+
isEmpty ? (result.isEmpty = !0, result.config = void 0) : (validateLoader(loader2, loaderKey), result.config = await loader2(filepath, content)), result.filepath = filepath;
|
|
1291
|
+
break dirLoop;
|
|
2113
1292
|
}
|
|
2114
|
-
result.filepath = filepath;
|
|
2115
|
-
break dirLoop;
|
|
2116
1293
|
}
|
|
2117
1294
|
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
2118
1295
|
dir = parentDir(dir);
|
|
2119
1296
|
}
|
|
2120
|
-
|
|
1297
|
+
let transformed = (
|
|
2121
1298
|
// not found
|
|
2122
1299
|
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
2123
1300
|
);
|
|
2124
|
-
if (cache)
|
|
2125
|
-
for (
|
|
2126
|
-
}
|
|
1301
|
+
if (cache)
|
|
1302
|
+
for (let p of visited) searchCache.set(p, transformed);
|
|
2127
1303
|
return transformed;
|
|
2128
1304
|
},
|
|
2129
1305
|
async load(filepath) {
|
|
2130
1306
|
validateFilePath(filepath);
|
|
2131
|
-
|
|
2132
|
-
if (cache && loadCache.has(absPath))
|
|
1307
|
+
let absPath = path2.resolve(process.cwd(), filepath);
|
|
1308
|
+
if (cache && loadCache.has(absPath))
|
|
2133
1309
|
return loadCache.get(absPath);
|
|
2134
|
-
}
|
|
2135
|
-
const { base, ext } = path2.parse(absPath);
|
|
2136
|
-
const loaderKey = ext || "noExt";
|
|
2137
|
-
const loader2 = loaders[loaderKey];
|
|
1310
|
+
let { base, ext } = path2.parse(absPath), loaderKey = ext || "noExt", loader2 = loaders[loaderKey];
|
|
2138
1311
|
validateLoader(loader2, loaderKey);
|
|
2139
|
-
|
|
1312
|
+
let content = String(await fsReadFileAsync(absPath));
|
|
2140
1313
|
if (base === "package.json") {
|
|
2141
|
-
|
|
1314
|
+
let pkg = await loader2(absPath, content);
|
|
2142
1315
|
return emplace(
|
|
2143
1316
|
loadCache,
|
|
2144
1317
|
absPath,
|
|
@@ -2148,44 +1321,37 @@ var require_src = __commonJS({
|
|
|
2148
1321
|
})
|
|
2149
1322
|
);
|
|
2150
1323
|
}
|
|
2151
|
-
|
|
1324
|
+
let result = {
|
|
2152
1325
|
config: null,
|
|
2153
1326
|
filepath: absPath
|
|
2154
|
-
};
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
})
|
|
2165
|
-
);
|
|
2166
|
-
result.config = isEmpty ? void 0 : await loader2(absPath, content);
|
|
2167
|
-
return emplace(
|
|
1327
|
+
}, isEmpty = content.trim() === "";
|
|
1328
|
+
return isEmpty && ignoreEmptySearchPlaces ? emplace(
|
|
1329
|
+
loadCache,
|
|
1330
|
+
absPath,
|
|
1331
|
+
transform({
|
|
1332
|
+
config: void 0,
|
|
1333
|
+
filepath: absPath,
|
|
1334
|
+
isEmpty: !0
|
|
1335
|
+
})
|
|
1336
|
+
) : (result.config = isEmpty ? void 0 : await loader2(absPath, content), emplace(
|
|
2168
1337
|
loadCache,
|
|
2169
1338
|
absPath,
|
|
2170
1339
|
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
2171
|
-
);
|
|
1340
|
+
));
|
|
2172
1341
|
},
|
|
2173
1342
|
clearLoadCache() {
|
|
2174
|
-
|
|
1343
|
+
cache && loadCache.clear();
|
|
2175
1344
|
},
|
|
2176
1345
|
clearSearchCache() {
|
|
2177
|
-
|
|
1346
|
+
cache && searchCache.clear();
|
|
2178
1347
|
},
|
|
2179
1348
|
clearCaches() {
|
|
2180
|
-
|
|
2181
|
-
loadCache.clear();
|
|
2182
|
-
searchCache.clear();
|
|
2183
|
-
}
|
|
1349
|
+
cache && (loadCache.clear(), searchCache.clear());
|
|
2184
1350
|
}
|
|
2185
1351
|
};
|
|
2186
|
-
}
|
|
2187
|
-
module.exports.lilconfigSync =
|
|
2188
|
-
|
|
1352
|
+
};
|
|
1353
|
+
module.exports.lilconfigSync = function(name, options) {
|
|
1354
|
+
let {
|
|
2189
1355
|
ignoreEmptySearchPlaces,
|
|
2190
1356
|
loaders,
|
|
2191
1357
|
packageProp,
|
|
@@ -2193,173 +1359,138 @@ var require_src = __commonJS({
|
|
|
2193
1359
|
stopDir,
|
|
2194
1360
|
transform,
|
|
2195
1361
|
cache
|
|
2196
|
-
} = getOptions(name, options ?? {},
|
|
2197
|
-
const searchCache = /* @__PURE__ */ new Map();
|
|
2198
|
-
const loadCache = /* @__PURE__ */ new Map();
|
|
2199
|
-
const emplace = makeEmplace(cache);
|
|
1362
|
+
} = getOptions(name, options ?? {}, !0), searchCache = /* @__PURE__ */ new Map(), loadCache = /* @__PURE__ */ new Map(), emplace = makeEmplace(cache);
|
|
2200
1363
|
return {
|
|
2201
1364
|
search(searchFrom = process.cwd()) {
|
|
2202
|
-
|
|
1365
|
+
let result = {
|
|
2203
1366
|
config: null,
|
|
2204
1367
|
filepath: ""
|
|
2205
|
-
};
|
|
2206
|
-
|
|
2207
|
-
let dir = searchFrom;
|
|
2208
|
-
dirLoop: while (true) {
|
|
1368
|
+
}, visited = /* @__PURE__ */ new Set(), dir = searchFrom;
|
|
1369
|
+
dirLoop: for (; ; ) {
|
|
2209
1370
|
if (cache) {
|
|
2210
|
-
|
|
1371
|
+
let r = searchCache.get(dir);
|
|
2211
1372
|
if (r !== void 0) {
|
|
2212
|
-
for (
|
|
1373
|
+
for (let p of visited) searchCache.set(p, r);
|
|
2213
1374
|
return r;
|
|
2214
1375
|
}
|
|
2215
1376
|
visited.add(dir);
|
|
2216
1377
|
}
|
|
2217
|
-
for (
|
|
2218
|
-
|
|
1378
|
+
for (let searchPlace of searchPlaces) {
|
|
1379
|
+
let filepath = path2.join(dir, searchPlace);
|
|
2219
1380
|
try {
|
|
2220
1381
|
fs.accessSync(filepath);
|
|
2221
1382
|
} catch {
|
|
2222
1383
|
continue;
|
|
2223
1384
|
}
|
|
2224
|
-
|
|
2225
|
-
const loader2 = loaders[loaderKey];
|
|
2226
|
-
const content = String(fs.readFileSync(filepath));
|
|
1385
|
+
let loaderKey = path2.extname(searchPlace) || "noExt", loader2 = loaders[loaderKey], content = String(fs.readFileSync(filepath));
|
|
2227
1386
|
if (searchPlace === "package.json") {
|
|
2228
|
-
|
|
2229
|
-
const maybeConfig = getPackageProp(packageProp, pkg);
|
|
1387
|
+
let pkg = loader2(filepath, content), maybeConfig = getPackageProp(packageProp, pkg);
|
|
2230
1388
|
if (maybeConfig != null) {
|
|
2231
|
-
result.config = maybeConfig;
|
|
2232
|
-
result.filepath = filepath;
|
|
1389
|
+
result.config = maybeConfig, result.filepath = filepath;
|
|
2233
1390
|
break dirLoop;
|
|
2234
1391
|
}
|
|
2235
1392
|
continue;
|
|
2236
1393
|
}
|
|
2237
|
-
|
|
2238
|
-
if (isEmpty && ignoreEmptySearchPlaces)
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
result.config = void 0;
|
|
2242
|
-
} else {
|
|
2243
|
-
validateLoader(loader2, loaderKey);
|
|
2244
|
-
result.config = loader2(filepath, content);
|
|
1394
|
+
let isEmpty = content.trim() === "";
|
|
1395
|
+
if (!(isEmpty && ignoreEmptySearchPlaces)) {
|
|
1396
|
+
isEmpty ? (result.isEmpty = !0, result.config = void 0) : (validateLoader(loader2, loaderKey), result.config = loader2(filepath, content)), result.filepath = filepath;
|
|
1397
|
+
break dirLoop;
|
|
2245
1398
|
}
|
|
2246
|
-
result.filepath = filepath;
|
|
2247
|
-
break dirLoop;
|
|
2248
1399
|
}
|
|
2249
1400
|
if (dir === stopDir || dir === parentDir(dir)) break dirLoop;
|
|
2250
1401
|
dir = parentDir(dir);
|
|
2251
1402
|
}
|
|
2252
|
-
|
|
1403
|
+
let transformed = (
|
|
2253
1404
|
// not found
|
|
2254
1405
|
result.filepath === "" && result.config === null ? transform(null) : transform(result)
|
|
2255
1406
|
);
|
|
2256
|
-
if (cache)
|
|
2257
|
-
for (
|
|
2258
|
-
}
|
|
1407
|
+
if (cache)
|
|
1408
|
+
for (let p of visited) searchCache.set(p, transformed);
|
|
2259
1409
|
return transformed;
|
|
2260
1410
|
},
|
|
2261
1411
|
load(filepath) {
|
|
2262
1412
|
validateFilePath(filepath);
|
|
2263
|
-
|
|
2264
|
-
if (cache && loadCache.has(absPath))
|
|
1413
|
+
let absPath = path2.resolve(process.cwd(), filepath);
|
|
1414
|
+
if (cache && loadCache.has(absPath))
|
|
2265
1415
|
return loadCache.get(absPath);
|
|
2266
|
-
}
|
|
2267
|
-
const { base, ext } = path2.parse(absPath);
|
|
2268
|
-
const loaderKey = ext || "noExt";
|
|
2269
|
-
const loader2 = loaders[loaderKey];
|
|
1416
|
+
let { base, ext } = path2.parse(absPath), loaderKey = ext || "noExt", loader2 = loaders[loaderKey];
|
|
2270
1417
|
validateLoader(loader2, loaderKey);
|
|
2271
|
-
|
|
1418
|
+
let content = String(fs.readFileSync(absPath));
|
|
2272
1419
|
if (base === "package.json") {
|
|
2273
|
-
|
|
1420
|
+
let pkg = loader2(absPath, content);
|
|
2274
1421
|
return transform({
|
|
2275
1422
|
config: getPackageProp(packageProp, pkg),
|
|
2276
1423
|
filepath: absPath
|
|
2277
1424
|
});
|
|
2278
1425
|
}
|
|
2279
|
-
|
|
1426
|
+
let result = {
|
|
2280
1427
|
config: null,
|
|
2281
1428
|
filepath: absPath
|
|
2282
|
-
};
|
|
2283
|
-
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
absPath,
|
|
2288
|
-
|
|
2289
|
-
|
|
2290
|
-
|
|
2291
|
-
|
|
2292
|
-
})
|
|
2293
|
-
);
|
|
2294
|
-
result.config = isEmpty ? void 0 : loader2(absPath, content);
|
|
2295
|
-
return emplace(
|
|
1429
|
+
}, isEmpty = content.trim() === "";
|
|
1430
|
+
return isEmpty && ignoreEmptySearchPlaces ? emplace(
|
|
1431
|
+
loadCache,
|
|
1432
|
+
absPath,
|
|
1433
|
+
transform({
|
|
1434
|
+
filepath: absPath,
|
|
1435
|
+
config: void 0,
|
|
1436
|
+
isEmpty: !0
|
|
1437
|
+
})
|
|
1438
|
+
) : (result.config = isEmpty ? void 0 : loader2(absPath, content), emplace(
|
|
2296
1439
|
loadCache,
|
|
2297
1440
|
absPath,
|
|
2298
1441
|
transform(isEmpty ? { ...result, isEmpty, config: void 0 } : result)
|
|
2299
|
-
);
|
|
1442
|
+
));
|
|
2300
1443
|
},
|
|
2301
1444
|
clearLoadCache() {
|
|
2302
|
-
|
|
1445
|
+
cache && loadCache.clear();
|
|
2303
1446
|
},
|
|
2304
1447
|
clearSearchCache() {
|
|
2305
|
-
|
|
1448
|
+
cache && searchCache.clear();
|
|
2306
1449
|
},
|
|
2307
1450
|
clearCaches() {
|
|
2308
|
-
|
|
2309
|
-
loadCache.clear();
|
|
2310
|
-
searchCache.clear();
|
|
2311
|
-
}
|
|
1451
|
+
cache && (loadCache.clear(), searchCache.clear());
|
|
2312
1452
|
}
|
|
2313
1453
|
};
|
|
2314
|
-
}
|
|
1454
|
+
};
|
|
2315
1455
|
}
|
|
2316
1456
|
});
|
|
2317
1457
|
|
|
2318
1458
|
// ../../node_modules/postcss-load-config/src/req.js
|
|
2319
1459
|
var require_req = __commonJS({
|
|
2320
1460
|
"../../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 = [];
|
|
1461
|
+
var { createRequire: createRequire3 } = __require("node:module"), { pathToFileURL: pathToFileURL2 } = __require("node:url"), TS_EXT_RE = /\.[mc]?ts$/, tsx, jiti, importError = [];
|
|
2327
1462
|
async function req(name, rootFile = __filename) {
|
|
2328
1463
|
let url = createRequire3(rootFile).resolve(name);
|
|
2329
1464
|
try {
|
|
2330
1465
|
return (await import(`${pathToFileURL2(url)}?t=${Date.now()}`)).default;
|
|
2331
1466
|
} catch (err) {
|
|
2332
|
-
if (!TS_EXT_RE.test(url))
|
|
1467
|
+
if (!TS_EXT_RE.test(url))
|
|
2333
1468
|
throw err;
|
|
2334
|
-
}
|
|
2335
1469
|
}
|
|
2336
|
-
if (tsx === void 0)
|
|
1470
|
+
if (tsx === void 0)
|
|
2337
1471
|
try {
|
|
2338
1472
|
tsx = await import("tsx/cjs/api");
|
|
2339
1473
|
} catch (error) {
|
|
2340
1474
|
importError.push(error);
|
|
2341
1475
|
}
|
|
2342
|
-
}
|
|
2343
1476
|
if (tsx) {
|
|
2344
1477
|
let loaded = tsx.require(name, rootFile);
|
|
2345
1478
|
return loaded && "__esModule" in loaded ? loaded.default : loaded;
|
|
2346
1479
|
}
|
|
2347
|
-
if (jiti === void 0)
|
|
1480
|
+
if (jiti === void 0)
|
|
2348
1481
|
try {
|
|
2349
|
-
jiti = (await import("./_node-chunks/jiti-
|
|
1482
|
+
jiti = (await import("./_node-chunks/jiti-VJSHM3WA.js")).default;
|
|
2350
1483
|
} catch (error) {
|
|
2351
1484
|
importError.push(error);
|
|
2352
1485
|
}
|
|
2353
|
-
|
|
2354
|
-
|
|
2355
|
-
return jiti(rootFile, { interopDefault: true })(name);
|
|
2356
|
-
}
|
|
1486
|
+
if (jiti)
|
|
1487
|
+
return jiti(rootFile, { interopDefault: !0 })(name);
|
|
2357
1488
|
throw new Error(
|
|
2358
1489
|
`'tsx' or 'jiti' is required for the TypeScript configuration files. Make sure it is installed
|
|
2359
|
-
Error: ${importError.map((error) => error.message).join(
|
|
1490
|
+
Error: ${importError.map((error) => error.message).join(`
|
|
1491
|
+
`)}`
|
|
2360
1492
|
);
|
|
2361
1493
|
}
|
|
2362
|
-
__name(req, "req");
|
|
2363
1494
|
module.exports = req;
|
|
2364
1495
|
}
|
|
2365
1496
|
});
|
|
@@ -2369,7 +1500,7 @@ var require_options = __commonJS({
|
|
|
2369
1500
|
"../../node_modules/postcss-load-config/src/options.js"(exports, module) {
|
|
2370
1501
|
var req = require_req();
|
|
2371
1502
|
async function options(config2, file) {
|
|
2372
|
-
if (config2.parser && typeof config2.parser
|
|
1503
|
+
if (config2.parser && typeof config2.parser == "string")
|
|
2373
1504
|
try {
|
|
2374
1505
|
config2.parser = await req(config2.parser, file);
|
|
2375
1506
|
} catch (err) {
|
|
@@ -2379,8 +1510,7 @@ var require_options = __commonJS({
|
|
|
2379
1510
|
(@${file})`
|
|
2380
1511
|
);
|
|
2381
1512
|
}
|
|
2382
|
-
|
|
2383
|
-
if (config2.syntax && typeof config2.syntax === "string") {
|
|
1513
|
+
if (config2.syntax && typeof config2.syntax == "string")
|
|
2384
1514
|
try {
|
|
2385
1515
|
config2.syntax = await req(config2.syntax, file);
|
|
2386
1516
|
} catch (err) {
|
|
@@ -2390,8 +1520,7 @@ var require_options = __commonJS({
|
|
|
2390
1520
|
(@${file})`
|
|
2391
1521
|
);
|
|
2392
1522
|
}
|
|
2393
|
-
|
|
2394
|
-
if (config2.stringifier && typeof config2.stringifier === "string") {
|
|
1523
|
+
if (config2.stringifier && typeof config2.stringifier == "string")
|
|
2395
1524
|
try {
|
|
2396
1525
|
config2.stringifier = await req(config2.stringifier, file);
|
|
2397
1526
|
} catch (err) {
|
|
@@ -2401,10 +1530,8 @@ var require_options = __commonJS({
|
|
|
2401
1530
|
(@${file})`
|
|
2402
1531
|
);
|
|
2403
1532
|
}
|
|
2404
|
-
}
|
|
2405
1533
|
return config2;
|
|
2406
1534
|
}
|
|
2407
|
-
__name(options, "options");
|
|
2408
1535
|
module.exports = options;
|
|
2409
1536
|
}
|
|
2410
1537
|
});
|
|
@@ -2415,11 +1542,7 @@ var require_plugins = __commonJS({
|
|
|
2415
1542
|
var req = require_req();
|
|
2416
1543
|
async function load(plugin, options, file) {
|
|
2417
1544
|
try {
|
|
2418
|
-
|
|
2419
|
-
return await req(plugin, file);
|
|
2420
|
-
} else {
|
|
2421
|
-
return (await req(plugin, file))(options);
|
|
2422
|
-
}
|
|
1545
|
+
return options == null || Object.keys(options).length === 0 ? await req(plugin, file) : (await req(plugin, file))(options);
|
|
2423
1546
|
} catch (err) {
|
|
2424
1547
|
throw new Error(
|
|
2425
1548
|
`Loading PostCSS Plugin failed: ${err.message}
|
|
@@ -2428,41 +1551,17 @@ var require_plugins = __commonJS({
|
|
|
2428
1551
|
);
|
|
2429
1552
|
}
|
|
2430
1553
|
}
|
|
2431
|
-
__name(load, "load");
|
|
2432
1554
|
async function plugins(config2, file) {
|
|
2433
1555
|
let list = [];
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
return options !== false;
|
|
2439
|
-
}).map(([plugin, options]) => {
|
|
2440
|
-
return load(plugin, options, file);
|
|
2441
|
-
});
|
|
2442
|
-
list = await Promise.all(list);
|
|
2443
|
-
}
|
|
2444
|
-
if (list.length && list.length > 0) {
|
|
2445
|
-
list.forEach((plugin, i) => {
|
|
2446
|
-
if (plugin.default) {
|
|
2447
|
-
plugin = plugin.default;
|
|
2448
|
-
}
|
|
2449
|
-
if (plugin.postcss === true) {
|
|
2450
|
-
plugin = plugin();
|
|
2451
|
-
} else if (plugin.postcss) {
|
|
2452
|
-
plugin = plugin.postcss;
|
|
2453
|
-
}
|
|
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}]
|
|
1556
|
+
return Array.isArray(config2.plugins) ? list = config2.plugins.filter(Boolean) : (list = Object.entries(config2.plugins).filter(([, options]) => options !== !1).map(([plugin, options]) => load(plugin, options, file)), list = await Promise.all(list)), list.length && list.length > 0 && list.forEach((plugin, i) => {
|
|
1557
|
+
if (plugin.default && (plugin = plugin.default), plugin.postcss === !0 ? plugin = plugin() : plugin.postcss && (plugin = plugin.postcss), !(typeof plugin == "object" && Array.isArray(plugin.plugins) || typeof plugin == "object" && plugin.postcssPlugin || typeof plugin == "function"))
|
|
1558
|
+
throw new TypeError(
|
|
1559
|
+
`Invalid PostCSS Plugin found at: plugins[${i}]
|
|
2457
1560
|
|
|
2458
1561
|
(@${file})`
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
});
|
|
2462
|
-
}
|
|
2463
|
-
return list;
|
|
1562
|
+
);
|
|
1563
|
+
}), list;
|
|
2464
1564
|
}
|
|
2465
|
-
__name(plugins, "plugins");
|
|
2466
1565
|
module.exports = plugins;
|
|
2467
1566
|
}
|
|
2468
1567
|
});
|
|
@@ -2470,66 +1569,43 @@ var require_plugins = __commonJS({
|
|
|
2470
1569
|
// ../../node_modules/postcss-load-config/src/index.js
|
|
2471
1570
|
var require_src2 = __commonJS({
|
|
2472
1571
|
"../../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");
|
|
1572
|
+
var { resolve: resolve2 } = __require("node:path"), config2 = require_src(), loadOptions = require_options(), loadPlugins = require_plugins(), req = require_req(), interopRequireDefault = (obj) => obj && obj.__esModule ? obj : { default: obj };
|
|
2479
1573
|
async function processResult(ctx, result) {
|
|
2480
|
-
let file = result.filepath || "";
|
|
2481
|
-
|
|
2482
|
-
if (typeof projectConfig === "function") {
|
|
2483
|
-
projectConfig = projectConfig(ctx);
|
|
2484
|
-
} else {
|
|
2485
|
-
projectConfig = Object.assign({}, projectConfig, ctx);
|
|
2486
|
-
}
|
|
2487
|
-
if (!projectConfig.plugins) {
|
|
2488
|
-
projectConfig.plugins = [];
|
|
2489
|
-
}
|
|
1574
|
+
let file = result.filepath || "", projectConfig = interopRequireDefault(result.config).default || {};
|
|
1575
|
+
typeof projectConfig == "function" ? projectConfig = projectConfig(ctx) : projectConfig = Object.assign({}, projectConfig, ctx), projectConfig.plugins || (projectConfig.plugins = []);
|
|
2490
1576
|
let res = {
|
|
2491
1577
|
file,
|
|
2492
1578
|
options: await loadOptions(projectConfig, file),
|
|
2493
1579
|
plugins: await loadPlugins(projectConfig, file)
|
|
2494
1580
|
};
|
|
2495
|
-
delete projectConfig.plugins;
|
|
2496
|
-
return res;
|
|
1581
|
+
return delete projectConfig.plugins, res;
|
|
2497
1582
|
}
|
|
2498
|
-
__name(processResult, "processResult");
|
|
2499
1583
|
function createContext(ctx) {
|
|
2500
|
-
ctx = Object.assign(
|
|
1584
|
+
return ctx = Object.assign(
|
|
2501
1585
|
{
|
|
2502
1586
|
cwd: process.cwd(),
|
|
2503
1587
|
env: process.env.NODE_ENV
|
|
2504
1588
|
},
|
|
2505
1589
|
ctx
|
|
2506
|
-
);
|
|
2507
|
-
if (!ctx.env) {
|
|
2508
|
-
process.env.NODE_ENV = "development";
|
|
2509
|
-
}
|
|
2510
|
-
return ctx;
|
|
1590
|
+
), ctx.env || (process.env.NODE_ENV = "development"), ctx;
|
|
2511
1591
|
}
|
|
2512
|
-
__name(createContext, "createContext");
|
|
2513
1592
|
async function loader2(filepath) {
|
|
2514
1593
|
return req(filepath);
|
|
2515
1594
|
}
|
|
2516
|
-
__name(loader2, "loader");
|
|
2517
1595
|
var yaml;
|
|
2518
1596
|
async function yamlLoader(_, content) {
|
|
2519
|
-
if (!yaml)
|
|
1597
|
+
if (!yaml)
|
|
2520
1598
|
try {
|
|
2521
|
-
yaml = await import("./_node-chunks/dist-
|
|
1599
|
+
yaml = await import("./_node-chunks/dist-K7J2QH6T.js");
|
|
2522
1600
|
} catch (e) {
|
|
2523
1601
|
throw new Error(
|
|
2524
1602
|
`'yaml' is required for the YAML configuration files. Make sure it is installed
|
|
2525
1603
|
Error: ${e.message}`
|
|
2526
1604
|
);
|
|
2527
1605
|
}
|
|
2528
|
-
}
|
|
2529
1606
|
return yaml.parse(content);
|
|
2530
1607
|
}
|
|
2531
|
-
|
|
2532
|
-
var withLoaders2 = /* @__PURE__ */ __name((options = {}) => {
|
|
1608
|
+
var withLoaders2 = (options = {}) => {
|
|
2533
1609
|
let moduleName = "postcss";
|
|
2534
1610
|
return {
|
|
2535
1611
|
...options,
|
|
@@ -2565,18 +1641,14 @@ Error: ${e.message}`
|
|
|
2565
1641
|
`${moduleName}.config.mjs`
|
|
2566
1642
|
]
|
|
2567
1643
|
};
|
|
2568
|
-
}
|
|
1644
|
+
};
|
|
2569
1645
|
function rc(ctx, path2, options) {
|
|
2570
|
-
ctx = createContext(ctx)
|
|
2571
|
-
|
|
2572
|
-
return config2.lilconfig("postcss", withLoaders2(options)).search(path2).then((result) => {
|
|
2573
|
-
if (!result) {
|
|
1646
|
+
return ctx = createContext(ctx), path2 = path2 ? resolve2(path2) : process.cwd(), config2.lilconfig("postcss", withLoaders2(options)).search(path2).then((result) => {
|
|
1647
|
+
if (!result)
|
|
2574
1648
|
throw new Error(`No PostCSS Config found in: ${path2}`);
|
|
2575
|
-
}
|
|
2576
1649
|
return processResult(ctx, result);
|
|
2577
1650
|
});
|
|
2578
1651
|
}
|
|
2579
|
-
__name(rc, "rc");
|
|
2580
1652
|
module.exports = rc;
|
|
2581
1653
|
}
|
|
2582
1654
|
});
|
|
@@ -2589,8 +1661,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
|
2589
1661
|
import { viteFinal as reactViteFinal } from "@storybook/react-vite/preset";
|
|
2590
1662
|
|
|
2591
1663
|
// src/find-postcss-config.ts
|
|
2592
|
-
var import_lilconfig = __toESM(require_src(), 1);
|
|
2593
|
-
var import_postcss_load_config = __toESM(require_src2(), 1);
|
|
1664
|
+
var import_lilconfig = __toESM(require_src(), 1), import_postcss_load_config = __toESM(require_src2(), 1);
|
|
2594
1665
|
import { readFile, writeFile } from "node:fs/promises";
|
|
2595
1666
|
import { createRequire } from "node:module";
|
|
2596
1667
|
import { getProjectRoot } from "storybook/internal/common";
|
|
@@ -2599,9 +1670,8 @@ var require2 = createRequire(import.meta.url);
|
|
|
2599
1670
|
async function loader(filepath) {
|
|
2600
1671
|
return require2(filepath);
|
|
2601
1672
|
}
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
const moduleName = "postcss";
|
|
1673
|
+
var withLoaders = (options = {}) => {
|
|
1674
|
+
let moduleName = "postcss";
|
|
2605
1675
|
return {
|
|
2606
1676
|
...options,
|
|
2607
1677
|
loaders: {
|
|
@@ -2632,49 +1702,37 @@ var withLoaders = /* @__PURE__ */ __name((options = {}) => {
|
|
|
2632
1702
|
`${moduleName}.config.mjs`
|
|
2633
1703
|
]
|
|
2634
1704
|
};
|
|
2635
|
-
}
|
|
1705
|
+
};
|
|
2636
1706
|
async function postCssFindConfig(path2, options = {}) {
|
|
2637
|
-
|
|
1707
|
+
let result = await import_lilconfig.default.lilconfig("postcss", withLoaders(options)).search(path2);
|
|
2638
1708
|
return result ? result.filepath : null;
|
|
2639
1709
|
}
|
|
2640
|
-
|
|
2641
|
-
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
return true;
|
|
2645
|
-
}
|
|
1710
|
+
var normalizePostCssConfig = async (searchPath) => {
|
|
1711
|
+
let configPath = await postCssFindConfig(searchPath);
|
|
1712
|
+
if (!configPath)
|
|
1713
|
+
return !0;
|
|
2646
1714
|
let error;
|
|
2647
1715
|
try {
|
|
2648
|
-
await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() });
|
|
2649
|
-
return true;
|
|
1716
|
+
return await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() }), !0;
|
|
2650
1717
|
} catch (e) {
|
|
2651
|
-
|
|
2652
|
-
error = e;
|
|
2653
|
-
}
|
|
2654
|
-
}
|
|
2655
|
-
if (!error) {
|
|
2656
|
-
return true;
|
|
2657
|
-
}
|
|
2658
|
-
if (error.message.includes("No PostCSS Config found")) {
|
|
2659
|
-
return true;
|
|
1718
|
+
e instanceof Error && (error = e);
|
|
2660
1719
|
}
|
|
1720
|
+
if (!error || error.message.includes("No PostCSS Config found"))
|
|
1721
|
+
return !0;
|
|
2661
1722
|
if (error.message.includes("Invalid PostCSS Plugin found")) {
|
|
2662
|
-
|
|
1723
|
+
let originalContent = await readFile(configPath, "utf8");
|
|
2663
1724
|
try {
|
|
2664
|
-
|
|
1725
|
+
let modifiedContent = originalContent.replace(
|
|
2665
1726
|
'plugins: ["@tailwindcss/postcss"]',
|
|
2666
1727
|
'plugins: { "@tailwindcss/postcss": {} }'
|
|
2667
1728
|
);
|
|
2668
|
-
await writeFile(configPath, modifiedContent, "utf8");
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
} catch (e) {
|
|
2672
|
-
await writeFile(configPath, originalContent, "utf8");
|
|
2673
|
-
throw new IncompatiblePostCssConfigError({ error });
|
|
1729
|
+
return await writeFile(configPath, modifiedContent, "utf8"), await (0, import_postcss_load_config.default)({}, searchPath, { stopDir: getProjectRoot() }), !0;
|
|
1730
|
+
} catch {
|
|
1731
|
+
throw await writeFile(configPath, originalContent, "utf8"), new IncompatiblePostCssConfigError({ error });
|
|
2674
1732
|
}
|
|
2675
1733
|
}
|
|
2676
|
-
return
|
|
2677
|
-
}
|
|
1734
|
+
return !1;
|
|
1735
|
+
};
|
|
2678
1736
|
|
|
2679
1737
|
// src/utils.ts
|
|
2680
1738
|
import { readFileSync } from "node:fs";
|
|
@@ -2687,503 +1745,226 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
2687
1745
|
import assert from "node:assert";
|
|
2688
1746
|
import v8 from "node:v8";
|
|
2689
1747
|
import { format, inspect } from "node:util";
|
|
2690
|
-
var own$1 = {}.hasOwnProperty
|
|
2691
|
-
var classRegExp = /^([A-Z][a-z\d]*)+$/;
|
|
2692
|
-
var kTypes = /* @__PURE__ */ new Set([
|
|
1748
|
+
var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
|
|
2693
1749
|
"string",
|
|
2694
1750
|
"function",
|
|
2695
1751
|
"number",
|
|
2696
1752
|
"object",
|
|
2697
|
-
// Accept 'Function' and 'Object' as alternative to the lower cased version.
|
|
2698
1753
|
"Function",
|
|
2699
1754
|
"Object",
|
|
2700
1755
|
"boolean",
|
|
2701
1756
|
"bigint",
|
|
2702
1757
|
"symbol"
|
|
2703
|
-
]);
|
|
2704
|
-
var messages = /* @__PURE__ */ new Map();
|
|
2705
|
-
var nodeInternalPrefix = "__node_internal_";
|
|
2706
|
-
var userStackTraceLimit;
|
|
1758
|
+
]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
|
|
2707
1759
|
function formatList(array, type = "and") {
|
|
2708
1760
|
return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
|
|
2709
1761
|
}
|
|
2710
|
-
__name(formatList, "formatList");
|
|
2711
1762
|
function createError(sym, value, constructor) {
|
|
2712
|
-
messages.set(sym, value);
|
|
2713
|
-
return makeNodeErrorWithCode(constructor, sym);
|
|
1763
|
+
return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
|
|
2714
1764
|
}
|
|
2715
|
-
__name(createError, "createError");
|
|
2716
1765
|
function makeNodeErrorWithCode(Base, key) {
|
|
2717
|
-
return
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
Object.defineProperties(error, {
|
|
2724
|
-
// Note: no need to implement `kIsNodeError` symbol, would be hard,
|
|
2725
|
-
// probably.
|
|
1766
|
+
return function(...parameters) {
|
|
1767
|
+
let limit = Error.stackTraceLimit;
|
|
1768
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
|
|
1769
|
+
let error = new Base();
|
|
1770
|
+
isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
|
|
1771
|
+
let message = getMessage(key, parameters, error);
|
|
1772
|
+
return Object.defineProperties(error, {
|
|
2726
1773
|
message: {
|
|
2727
1774
|
value: message,
|
|
2728
|
-
enumerable:
|
|
2729
|
-
writable:
|
|
2730
|
-
configurable:
|
|
1775
|
+
enumerable: !1,
|
|
1776
|
+
writable: !0,
|
|
1777
|
+
configurable: !0
|
|
2731
1778
|
},
|
|
2732
1779
|
toString: {
|
|
2733
|
-
/** @this {Error} */
|
|
2734
1780
|
value() {
|
|
2735
1781
|
return `${this.name} [${key}]: ${this.message}`;
|
|
2736
1782
|
},
|
|
2737
|
-
enumerable:
|
|
2738
|
-
writable:
|
|
2739
|
-
configurable:
|
|
1783
|
+
enumerable: !1,
|
|
1784
|
+
writable: !0,
|
|
1785
|
+
configurable: !0
|
|
2740
1786
|
}
|
|
2741
|
-
});
|
|
2742
|
-
|
|
2743
|
-
error.code = key;
|
|
2744
|
-
return error;
|
|
2745
|
-
}, "NodeError");
|
|
1787
|
+
}), captureLargerStackTrace(error), error.code = key, error;
|
|
1788
|
+
};
|
|
2746
1789
|
}
|
|
2747
|
-
__name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
|
|
2748
1790
|
function isErrorStackTraceLimitWritable() {
|
|
2749
1791
|
try {
|
|
2750
|
-
if (v8.startupSnapshot.isBuildingSnapshot())
|
|
2751
|
-
return false;
|
|
2752
|
-
}
|
|
1792
|
+
if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
|
|
2753
1793
|
} catch {
|
|
2754
1794
|
}
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
return Object.isExtensible(Error);
|
|
2758
|
-
}
|
|
2759
|
-
return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
1795
|
+
let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
|
|
1796
|
+
return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
|
|
2760
1797
|
}
|
|
2761
|
-
__name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
|
|
2762
1798
|
function hideStackFrames(wrappedFunction) {
|
|
2763
|
-
|
|
2764
|
-
Object.defineProperty(wrappedFunction, "name", { value: hidden });
|
|
2765
|
-
return wrappedFunction;
|
|
1799
|
+
let hidden = nodeInternalPrefix + wrappedFunction.name;
|
|
1800
|
+
return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
|
|
2766
1801
|
}
|
|
2767
|
-
__name(hideStackFrames, "hideStackFrames");
|
|
2768
1802
|
var captureLargerStackTrace = hideStackFrames(function(error) {
|
|
2769
|
-
|
|
2770
|
-
|
|
2771
|
-
userStackTraceLimit = Error.stackTraceLimit;
|
|
2772
|
-
Error.stackTraceLimit = Number.POSITIVE_INFINITY;
|
|
2773
|
-
}
|
|
2774
|
-
Error.captureStackTrace(error);
|
|
2775
|
-
if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
|
|
2776
|
-
return error;
|
|
1803
|
+
let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
|
|
1804
|
+
return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
|
|
2777
1805
|
});
|
|
2778
1806
|
function getMessage(key, parameters, self) {
|
|
2779
|
-
|
|
2780
|
-
assert(message !== void 0, "expected `message` to be found")
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
|
|
2786
|
-
);
|
|
2787
|
-
return Reflect.apply(message, self, parameters);
|
|
2788
|
-
}
|
|
2789
|
-
const regex = /%[dfijoOs]/g;
|
|
2790
|
-
let expectedLength = 0;
|
|
2791
|
-
while (regex.exec(message) !== null) expectedLength++;
|
|
2792
|
-
assert(
|
|
2793
|
-
expectedLength === parameters.length,
|
|
2794
|
-
`Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
|
|
2795
|
-
);
|
|
2796
|
-
if (parameters.length === 0) return message;
|
|
2797
|
-
parameters.unshift(message);
|
|
2798
|
-
return Reflect.apply(format, null, parameters);
|
|
1807
|
+
let message = messages.get(key);
|
|
1808
|
+
if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
|
|
1809
|
+
return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
|
|
1810
|
+
let regex = /%[dfijoOs]/g, expectedLength = 0;
|
|
1811
|
+
for (; regex.exec(message) !== null; ) expectedLength++;
|
|
1812
|
+
return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
|
|
2799
1813
|
}
|
|
2800
|
-
__name(getMessage, "getMessage");
|
|
2801
1814
|
function determineSpecificType(value) {
|
|
2802
|
-
if (value
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
}
|
|
2808
|
-
if (typeof value === "object") {
|
|
2809
|
-
if (value.constructor && value.constructor.name) {
|
|
2810
|
-
return `an instance of ${value.constructor.name}`;
|
|
2811
|
-
}
|
|
2812
|
-
return `${inspect(value, { depth: -1 })}`;
|
|
2813
|
-
}
|
|
2814
|
-
let inspected = inspect(value, { colors: false });
|
|
2815
|
-
if (inspected.length > 28) {
|
|
2816
|
-
inspected = `${inspected.slice(0, 25)}...`;
|
|
2817
|
-
}
|
|
2818
|
-
return `type ${typeof value} (${inspected})`;
|
|
1815
|
+
if (value == null) return String(value);
|
|
1816
|
+
if (typeof value == "function" && value.name) return `function ${value.name}`;
|
|
1817
|
+
if (typeof value == "object")
|
|
1818
|
+
return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
|
|
1819
|
+
let inspected = inspect(value, { colors: !1 });
|
|
1820
|
+
return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
|
|
2819
1821
|
}
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
"
|
|
2823
|
-
(name
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2830
|
-
|
|
2831
|
-
|
|
2832
|
-
|
|
2833
|
-
|
|
2834
|
-
|
|
2835
|
-
|
|
2836
|
-
|
|
2837
|
-
|
|
2838
|
-
const other = [];
|
|
2839
|
-
for (const value of expected) {
|
|
2840
|
-
assert(
|
|
2841
|
-
typeof value === "string",
|
|
2842
|
-
"All expected entries have to be of type string"
|
|
2843
|
-
);
|
|
2844
|
-
if (kTypes.has(value)) {
|
|
2845
|
-
types.push(value.toLowerCase());
|
|
2846
|
-
} else if (classRegExp.exec(value) === null) {
|
|
2847
|
-
assert(
|
|
2848
|
-
value !== "object",
|
|
2849
|
-
'The value "object" should be written as "Object"'
|
|
2850
|
-
);
|
|
2851
|
-
other.push(value);
|
|
2852
|
-
} else {
|
|
2853
|
-
instances.push(value);
|
|
2854
|
-
}
|
|
2855
|
-
}
|
|
2856
|
-
if (instances.length > 0) {
|
|
2857
|
-
const pos = types.indexOf("object");
|
|
2858
|
-
if (pos !== -1) {
|
|
2859
|
-
types.slice(pos, 1);
|
|
2860
|
-
instances.push("Object");
|
|
2861
|
-
}
|
|
2862
|
-
}
|
|
2863
|
-
if (types.length > 0) {
|
|
2864
|
-
message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
|
|
2865
|
-
types,
|
|
2866
|
-
"or"
|
|
2867
|
-
)}`;
|
|
2868
|
-
if (instances.length > 0 || other.length > 0) message += " or ";
|
|
2869
|
-
}
|
|
2870
|
-
if (instances.length > 0) {
|
|
2871
|
-
message += `an instance of ${formatList(instances, "or")}`;
|
|
2872
|
-
if (other.length > 0) message += " or ";
|
|
2873
|
-
}
|
|
2874
|
-
if (other.length > 0) {
|
|
2875
|
-
if (other.length > 1) {
|
|
2876
|
-
message += `one of ${formatList(other, "or")}`;
|
|
2877
|
-
} else {
|
|
2878
|
-
if (other[0]?.toLowerCase() !== other[0]) message += "an ";
|
|
2879
|
-
message += `${other[0]}`;
|
|
2880
|
-
}
|
|
2881
|
-
}
|
|
2882
|
-
message += `. Received ${determineSpecificType(actual)}`;
|
|
2883
|
-
return message;
|
|
2884
|
-
},
|
|
2885
|
-
TypeError
|
|
2886
|
-
);
|
|
2887
|
-
var ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
1822
|
+
var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
|
|
1823
|
+
assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
|
|
1824
|
+
let message = "The ";
|
|
1825
|
+
if (name.endsWith(" argument")) message += `${name} `;
|
|
1826
|
+
else {
|
|
1827
|
+
let type = name.includes(".") ? "property" : "argument";
|
|
1828
|
+
message += `"${name}" ${type} `;
|
|
1829
|
+
}
|
|
1830
|
+
message += "must be ";
|
|
1831
|
+
let types = [], instances = [], other = [];
|
|
1832
|
+
for (let value of expected)
|
|
1833
|
+
assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
|
|
1834
|
+
if (instances.length > 0) {
|
|
1835
|
+
let pos = types.indexOf("object");
|
|
1836
|
+
pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
|
|
1837
|
+
}
|
|
1838
|
+
return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
|
|
1839
|
+
}, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
|
|
2888
1840
|
"ERR_INVALID_MODULE_SPECIFIER",
|
|
2889
1841
|
/**
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
(request, reason, base) => {
|
|
2895
|
-
return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
|
|
2896
|
-
},
|
|
1842
|
+
* @param {string} request
|
|
1843
|
+
* @param {string} reason
|
|
1844
|
+
* @param {string} [base]
|
|
1845
|
+
*/
|
|
1846
|
+
(request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
|
|
2897
1847
|
TypeError
|
|
2898
|
-
)
|
|
2899
|
-
|
|
2900
|
-
"
|
|
2901
|
-
|
|
2902
|
-
return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
|
|
2903
|
-
},
|
|
2904
|
-
Error
|
|
2905
|
-
);
|
|
2906
|
-
var ERR_INVALID_PACKAGE_TARGET = createError(
|
|
2907
|
-
"ERR_INVALID_PACKAGE_TARGET",
|
|
2908
|
-
(packagePath, key, target, isImport = false, base) => {
|
|
2909
|
-
const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
2910
|
-
if (key === ".") {
|
|
2911
|
-
assert(isImport === false);
|
|
2912
|
-
return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
2913
|
-
}
|
|
2914
|
-
return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
|
|
2915
|
-
target
|
|
2916
|
-
)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
2917
|
-
},
|
|
2918
|
-
Error
|
|
2919
|
-
);
|
|
2920
|
-
var ERR_MODULE_NOT_FOUND = createError(
|
|
2921
|
-
"ERR_MODULE_NOT_FOUND",
|
|
2922
|
-
(path2, base, exactUrl = false) => {
|
|
2923
|
-
return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
|
|
2924
|
-
},
|
|
2925
|
-
Error
|
|
2926
|
-
);
|
|
2927
|
-
createError(
|
|
2928
|
-
"ERR_NETWORK_IMPORT_DISALLOWED",
|
|
2929
|
-
"import of '%s' by %s is not supported: %s",
|
|
2930
|
-
Error
|
|
2931
|
-
);
|
|
2932
|
-
var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
|
|
2933
|
-
"ERR_PACKAGE_IMPORT_NOT_DEFINED",
|
|
2934
|
-
(specifier, packagePath, base) => {
|
|
2935
|
-
return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
|
|
2936
|
-
},
|
|
2937
|
-
TypeError
|
|
2938
|
-
);
|
|
2939
|
-
var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
1848
|
+
), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
|
|
1849
|
+
let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
|
|
1850
|
+
return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
|
|
1851
|
+
}, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
|
|
2940
1852
|
"ERR_PACKAGE_PATH_NOT_EXPORTED",
|
|
2941
1853
|
/**
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
(packagePath, subpath, base) => {
|
|
2947
|
-
if (subpath === ".")
|
|
2948
|
-
return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
2949
|
-
return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
|
|
2950
|
-
},
|
|
1854
|
+
* @param {string} packagePath
|
|
1855
|
+
* @param {string} subpath
|
|
1856
|
+
* @param {string} [base]
|
|
1857
|
+
*/
|
|
1858
|
+
(packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
|
|
2951
1859
|
Error
|
|
2952
|
-
)
|
|
2953
|
-
|
|
2954
|
-
"
|
|
2955
|
-
|
|
2956
|
-
Error
|
|
2957
|
-
);
|
|
2958
|
-
var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
|
|
2959
|
-
"ERR_UNSUPPORTED_RESOLVE_REQUEST",
|
|
2960
|
-
'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
|
|
2961
|
-
TypeError
|
|
2962
|
-
);
|
|
2963
|
-
var ERR_UNKNOWN_FILE_EXTENSION = createError(
|
|
2964
|
-
"ERR_UNKNOWN_FILE_EXTENSION",
|
|
2965
|
-
(extension, path2) => {
|
|
2966
|
-
return `Unknown file extension "${extension}" for ${path2}`;
|
|
2967
|
-
},
|
|
2968
|
-
TypeError
|
|
2969
|
-
);
|
|
2970
|
-
createError(
|
|
2971
|
-
"ERR_INVALID_ARG_VALUE",
|
|
2972
|
-
(name, value, reason = "is invalid") => {
|
|
2973
|
-
let inspected = inspect(value);
|
|
2974
|
-
if (inspected.length > 128) {
|
|
2975
|
-
inspected = `${inspected.slice(0, 128)}...`;
|
|
2976
|
-
}
|
|
2977
|
-
const type = name.includes(".") ? "property" : "argument";
|
|
2978
|
-
return `The ${type} '${name}' ${reason}. Received ${inspected}`;
|
|
2979
|
-
},
|
|
2980
|
-
TypeError
|
|
2981
|
-
// Note: extra classes have been shaken out.
|
|
2982
|
-
// , RangeError
|
|
2983
|
-
);
|
|
2984
|
-
var hasOwnProperty$1 = {}.hasOwnProperty;
|
|
1860
|
+
), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
|
|
1861
|
+
let inspected = inspect(value);
|
|
1862
|
+
return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
|
|
1863
|
+
}, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
|
|
2985
1864
|
var hasOwnProperty = {}.hasOwnProperty;
|
|
2986
|
-
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
|
|
2987
|
-
var
|
|
2988
|
-
var isWindows = (() => process.platform === "win32")();
|
|
2989
|
-
var globalCache = (() => (
|
|
2990
|
-
// eslint-disable-next-line unicorn/no-unreadable-iife
|
|
2991
|
-
globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
|
|
2992
|
-
))();
|
|
1865
|
+
var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
|
|
1866
|
+
var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
|
|
2993
1867
|
|
|
2994
1868
|
// ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
|
|
2995
1869
|
var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
|
2996
1870
|
function normalizeWindowsPath(input = "") {
|
|
2997
|
-
|
|
2998
|
-
return input;
|
|
2999
|
-
}
|
|
3000
|
-
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
1871
|
+
return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
|
3001
1872
|
}
|
|
3002
|
-
|
|
3003
|
-
var
|
|
3004
|
-
|
|
3005
|
-
var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
3006
|
-
var normalize = /* @__PURE__ */ __name(function(path2) {
|
|
3007
|
-
if (path2.length === 0) {
|
|
1873
|
+
var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
|
1874
|
+
var normalize = function(path2) {
|
|
1875
|
+
if (path2.length === 0)
|
|
3008
1876
|
return ".";
|
|
3009
|
-
}
|
|
3010
1877
|
path2 = normalizeWindowsPath(path2);
|
|
3011
|
-
|
|
3012
|
-
|
|
3013
|
-
|
|
3014
|
-
|
|
3015
|
-
if (path2.length === 0) {
|
|
3016
|
-
if (isPathAbsolute) {
|
|
3017
|
-
return "/";
|
|
3018
|
-
}
|
|
3019
|
-
return trailingSeparator ? "./" : ".";
|
|
3020
|
-
}
|
|
3021
|
-
if (trailingSeparator) {
|
|
3022
|
-
path2 += "/";
|
|
3023
|
-
}
|
|
3024
|
-
if (_DRIVE_LETTER_RE.test(path2)) {
|
|
3025
|
-
path2 += "/";
|
|
3026
|
-
}
|
|
3027
|
-
if (isUNCPath) {
|
|
3028
|
-
if (!isPathAbsolute) {
|
|
3029
|
-
return `//./${path2}`;
|
|
3030
|
-
}
|
|
3031
|
-
return `//${path2}`;
|
|
3032
|
-
}
|
|
3033
|
-
return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
|
|
3034
|
-
}, "normalize");
|
|
3035
|
-
var join = /* @__PURE__ */ __name(function(...arguments_) {
|
|
3036
|
-
if (arguments_.length === 0) {
|
|
1878
|
+
let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
|
|
1879
|
+
return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
|
|
1880
|
+
}, join = function(...arguments_) {
|
|
1881
|
+
if (arguments_.length === 0)
|
|
3037
1882
|
return ".";
|
|
3038
|
-
}
|
|
3039
1883
|
let joined;
|
|
3040
|
-
for (
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
} else {
|
|
3045
|
-
joined += `/${argument}`;
|
|
3046
|
-
}
|
|
3047
|
-
}
|
|
3048
|
-
}
|
|
3049
|
-
if (joined === void 0) {
|
|
3050
|
-
return ".";
|
|
3051
|
-
}
|
|
3052
|
-
return normalize(joined.replace(/\/\/+/g, "/"));
|
|
3053
|
-
}, "join");
|
|
1884
|
+
for (let argument of arguments_)
|
|
1885
|
+
argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
|
|
1886
|
+
return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
|
|
1887
|
+
};
|
|
3054
1888
|
function normalizeString(path2, allowAboveRoot) {
|
|
3055
|
-
let res = "";
|
|
3056
|
-
let lastSegmentLength = 0;
|
|
3057
|
-
let lastSlash = -1;
|
|
3058
|
-
let dots = 0;
|
|
3059
|
-
let char = null;
|
|
1889
|
+
let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
|
|
3060
1890
|
for (let index = 0; index <= path2.length; ++index) {
|
|
3061
|
-
if (index < path2.length)
|
|
1891
|
+
if (index < path2.length)
|
|
3062
1892
|
char = path2[index];
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
1893
|
+
else {
|
|
1894
|
+
if (char === "/")
|
|
1895
|
+
break;
|
|
3066
1896
|
char = "/";
|
|
3067
1897
|
}
|
|
3068
1898
|
if (char === "/") {
|
|
3069
|
-
if (lastSlash === index - 1 || dots === 1)
|
|
3070
|
-
else if (dots === 2) {
|
|
1899
|
+
if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
|
|
3071
1900
|
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
|
3072
1901
|
if (res.length > 2) {
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
res = "";
|
|
3076
|
-
lastSegmentLength = 0;
|
|
3077
|
-
} else {
|
|
3078
|
-
res = res.slice(0, lastSlashIndex);
|
|
3079
|
-
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
|
3080
|
-
}
|
|
3081
|
-
lastSlash = index;
|
|
3082
|
-
dots = 0;
|
|
1902
|
+
let lastSlashIndex = res.lastIndexOf("/");
|
|
1903
|
+
lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
|
|
3083
1904
|
continue;
|
|
3084
1905
|
} else if (res.length > 0) {
|
|
3085
|
-
res = "";
|
|
3086
|
-
lastSegmentLength = 0;
|
|
3087
|
-
lastSlash = index;
|
|
3088
|
-
dots = 0;
|
|
1906
|
+
res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
|
|
3089
1907
|
continue;
|
|
3090
1908
|
}
|
|
3091
1909
|
}
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
if (res.length > 0) {
|
|
3098
|
-
res += `/${path2.slice(lastSlash + 1, index)}`;
|
|
3099
|
-
} else {
|
|
3100
|
-
res = path2.slice(lastSlash + 1, index);
|
|
3101
|
-
}
|
|
3102
|
-
lastSegmentLength = index - lastSlash - 1;
|
|
3103
|
-
}
|
|
3104
|
-
lastSlash = index;
|
|
3105
|
-
dots = 0;
|
|
3106
|
-
} else if (char === "." && dots !== -1) {
|
|
3107
|
-
++dots;
|
|
3108
|
-
} else {
|
|
3109
|
-
dots = -1;
|
|
3110
|
-
}
|
|
1910
|
+
allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
|
|
1911
|
+
} else
|
|
1912
|
+
res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
|
|
1913
|
+
lastSlash = index, dots = 0;
|
|
1914
|
+
} else char === "." && dots !== -1 ? ++dots : dots = -1;
|
|
3111
1915
|
}
|
|
3112
1916
|
return res;
|
|
3113
1917
|
}
|
|
3114
|
-
|
|
3115
|
-
var isAbsolute = /* @__PURE__ */ __name(function(p) {
|
|
1918
|
+
var isAbsolute = function(p) {
|
|
3116
1919
|
return _IS_ABSOLUTE_RE.test(p);
|
|
3117
|
-
}
|
|
3118
|
-
var dirname =
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
}
|
|
3123
|
-
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
3124
|
-
}, "dirname");
|
|
1920
|
+
};
|
|
1921
|
+
var dirname = function(p) {
|
|
1922
|
+
let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
|
1923
|
+
return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
|
1924
|
+
};
|
|
3125
1925
|
|
|
3126
1926
|
// ../../core/src/shared/utils/module.ts
|
|
3127
|
-
var importMetaResolve =
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
);
|
|
3132
|
-
|
|
1927
|
+
var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
|
|
1928
|
+
"importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
|
|
1929
|
+
), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
|
|
1930
|
+
try {
|
|
1931
|
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
1932
|
+
} catch {
|
|
1933
|
+
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"))));
|
|
3133
1934
|
}
|
|
3134
|
-
|
|
3135
|
-
}, "importMetaResolve");
|
|
3136
|
-
var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
|
|
3137
|
-
return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
|
|
3138
|
-
}, "resolvePackageDir");
|
|
1935
|
+
};
|
|
3139
1936
|
|
|
3140
1937
|
// src/utils.ts
|
|
3141
|
-
var getNextjsVersion =
|
|
1938
|
+
var getNextjsVersion = () => JSON.parse(readFileSync(join2(resolvePackageDir("next"), "package.json"), "utf8")).version;
|
|
3142
1939
|
|
|
3143
1940
|
// src/preset.ts
|
|
3144
|
-
var require3 = createRequire2(import.meta.url)
|
|
3145
|
-
|
|
3146
|
-
var core = /* @__PURE__ */ __name(async (config2, options) => {
|
|
3147
|
-
const framework = await options.presets.apply("framework");
|
|
1941
|
+
var require3 = createRequire2(import.meta.url), vitePluginStorybookNextjs = require3("vite-plugin-storybook-nextjs"), core = async (config2, options) => {
|
|
1942
|
+
let framework = await options.presets.apply("framework");
|
|
3148
1943
|
return {
|
|
3149
1944
|
...config2,
|
|
3150
1945
|
builder: {
|
|
3151
1946
|
name: fileURLToPath2(import.meta.resolve("@storybook/builder-vite")),
|
|
3152
1947
|
options: {
|
|
3153
|
-
...typeof framework
|
|
1948
|
+
...typeof framework == "string" ? {} : framework.options.builder || {}
|
|
3154
1949
|
}
|
|
3155
1950
|
},
|
|
3156
1951
|
renderer: fileURLToPath2(import.meta.resolve("@storybook/react/preset"))
|
|
3157
1952
|
};
|
|
3158
|
-
},
|
|
3159
|
-
|
|
3160
|
-
const annotations = [
|
|
1953
|
+
}, previewAnnotations = (entry = []) => {
|
|
1954
|
+
let annotations = [
|
|
3161
1955
|
...entry,
|
|
3162
1956
|
fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/preview"))
|
|
3163
|
-
];
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
if (!isNext16orNewer) {
|
|
3167
|
-
annotations.push(fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/config/preview")));
|
|
3168
|
-
}
|
|
3169
|
-
return annotations;
|
|
3170
|
-
}, "previewAnnotations");
|
|
3171
|
-
var optimizeViteDeps = [
|
|
1957
|
+
], nextjsVersion = getNextjsVersion();
|
|
1958
|
+
return import_semver.default.gte(nextjsVersion, "16.0.0") || annotations.push(fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/config/preview"))), annotations;
|
|
1959
|
+
}, optimizeViteDeps = [
|
|
3172
1960
|
"@storybook/nextjs-vite/navigation.mock",
|
|
3173
1961
|
"@storybook/nextjs-vite/router.mock",
|
|
3174
1962
|
"@storybook/nextjs-vite > styled-jsx",
|
|
3175
1963
|
"@storybook/nextjs-vite > styled-jsx/style"
|
|
3176
|
-
]
|
|
3177
|
-
|
|
3178
|
-
|
|
3179
|
-
|
|
3180
|
-
const searchPath = typeof inlineOptions === "string" ? inlineOptions : config2.root;
|
|
3181
|
-
if (searchPath) {
|
|
3182
|
-
await normalizePostCssConfig(searchPath);
|
|
3183
|
-
}
|
|
3184
|
-
const { nextConfigPath, image = {} } = await options.presets.apply("frameworkOptions");
|
|
3185
|
-
const nextDir = nextConfigPath ? dirname2(nextConfigPath) : void 0;
|
|
3186
|
-
const vitePluginOptions = {
|
|
1964
|
+
], viteFinal = async (config2, options) => {
|
|
1965
|
+
let reactConfig = await reactViteFinal(config2, options), inlineOptions = config2.css?.postcss, searchPath = typeof inlineOptions == "string" ? inlineOptions : config2.root;
|
|
1966
|
+
searchPath && await normalizePostCssConfig(searchPath);
|
|
1967
|
+
let { nextConfigPath, image = {} } = await options.presets.apply("frameworkOptions"), nextDir = nextConfigPath ? dirname2(nextConfigPath) : void 0, vitePluginOptions = {
|
|
3187
1968
|
image,
|
|
3188
1969
|
dir: nextDir
|
|
3189
1970
|
};
|
|
@@ -3200,7 +1981,7 @@ var viteFinal = /* @__PURE__ */ __name(async (config2, options) => {
|
|
|
3200
1981
|
},
|
|
3201
1982
|
plugins: [...reactConfig?.plugins ?? [], vitePluginStorybookNextjs(vitePluginOptions)]
|
|
3202
1983
|
};
|
|
3203
|
-
}
|
|
1984
|
+
};
|
|
3204
1985
|
export {
|
|
3205
1986
|
core,
|
|
3206
1987
|
optimizeViteDeps,
|