vite-plugin-storybook-nextjs 1.1.2--canary.31.ce898c2.0 → 2.0.0--canary.33.a61ad85.0
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/index.cjs +1961 -44
- package/dist/index.js +1958 -41
- package/dist/mocks/storybook.global.cjs +1945 -29
- package/dist/mocks/storybook.global.d.cts +1 -2
- package/dist/mocks/storybook.global.d.ts +1 -2
- package/dist/mocks/storybook.global.js +1944 -27
- package/dist/plugins/next-image/alias/next-image.d.cts +17 -17
- package/dist/plugins/next-image/alias/next-image.d.ts +17 -17
- package/dist/plugins/next-mocks/alias/cache/index.cjs +8 -2
- package/dist/plugins/next-mocks/alias/cache/index.d.cts +5 -1
- package/dist/plugins/next-mocks/alias/cache/index.d.ts +5 -1
- package/dist/plugins/next-mocks/alias/cache/index.js +2 -2
- package/dist/plugins/next-mocks/alias/headers/cookies.cjs +8 -8
- package/dist/plugins/next-mocks/alias/headers/cookies.js +7 -7
- package/dist/plugins/next-mocks/alias/headers/headers.cjs +1 -1
- package/dist/plugins/next-mocks/alias/headers/headers.js +1 -1
- package/dist/plugins/next-mocks/alias/headers/index.cjs +12 -8
- package/dist/plugins/next-mocks/alias/headers/index.d.cts +3 -2
- package/dist/plugins/next-mocks/alias/headers/index.d.ts +3 -2
- package/dist/plugins/next-mocks/alias/headers/index.js +8 -7
- package/dist/plugins/next-mocks/alias/navigation/index.cjs +1 -1
- package/dist/plugins/next-mocks/alias/navigation/index.d.cts +1 -1
- package/dist/plugins/next-mocks/alias/navigation/index.d.ts +1 -1
- package/dist/plugins/next-mocks/alias/navigation/index.js +1 -1
- package/dist/plugins/next-mocks/alias/router/index.cjs +1 -1
- package/dist/plugins/next-mocks/alias/router/index.d.cts +3 -4
- package/dist/plugins/next-mocks/alias/router/index.d.ts +3 -4
- package/dist/plugins/next-mocks/alias/router/index.js +1 -1
- package/dist/plugins/next-mocks/compatibility/draft-mode.compat.cjs +10 -0
- package/dist/plugins/next-mocks/compatibility/draft-mode.compat.d.cts +1 -0
- package/dist/plugins/next-mocks/compatibility/draft-mode.compat.d.ts +1 -0
- package/dist/plugins/next-mocks/compatibility/draft-mode.compat.js +1 -0
- package/package.json +13 -12
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import path2, { resolve, join } from 'node:path';
|
|
1
|
+
import path2, { resolve, join, sep } from 'node:path';
|
|
2
2
|
import { createRequire } from 'node:module';
|
|
3
3
|
import { getDefineEnv } from 'next/dist/build/webpack/plugins/define-env-plugin.js';
|
|
4
4
|
import fs3 from 'node:fs';
|
|
@@ -25,7 +25,1879 @@ import { cpus } from 'node:os';
|
|
|
25
25
|
import { decode } from 'node:querystring';
|
|
26
26
|
import imageSizeOf from 'image-size';
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
var __create = Object.create;
|
|
29
|
+
var __defProp = Object.defineProperty;
|
|
30
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
31
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
32
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
33
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
34
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
35
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
36
|
+
};
|
|
37
|
+
var __copyProps = (to, from, except, desc) => {
|
|
38
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
39
|
+
for (let key of __getOwnPropNames(from))
|
|
40
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
41
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
42
|
+
}
|
|
43
|
+
return to;
|
|
44
|
+
};
|
|
45
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
46
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
47
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
48
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
49
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
50
|
+
__defProp(target, "default", { value: mod, enumerable: true }) ,
|
|
51
|
+
mod
|
|
52
|
+
));
|
|
53
|
+
|
|
54
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js
|
|
55
|
+
var require_constants = __commonJS({
|
|
56
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/constants.js"(exports, module) {
|
|
57
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
58
|
+
var MAX_LENGTH = 256;
|
|
59
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
60
|
+
9007199254740991;
|
|
61
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
62
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
63
|
+
var RELEASE_TYPES = [
|
|
64
|
+
"major",
|
|
65
|
+
"premajor",
|
|
66
|
+
"minor",
|
|
67
|
+
"preminor",
|
|
68
|
+
"patch",
|
|
69
|
+
"prepatch",
|
|
70
|
+
"prerelease"
|
|
71
|
+
];
|
|
72
|
+
module.exports = {
|
|
73
|
+
MAX_LENGTH,
|
|
74
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
75
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
76
|
+
MAX_SAFE_INTEGER,
|
|
77
|
+
RELEASE_TYPES,
|
|
78
|
+
SEMVER_SPEC_VERSION,
|
|
79
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
80
|
+
FLAG_LOOSE: 2
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js
|
|
86
|
+
var require_debug = __commonJS({
|
|
87
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/debug.js"(exports, module) {
|
|
88
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
89
|
+
};
|
|
90
|
+
module.exports = debug;
|
|
91
|
+
}
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js
|
|
95
|
+
var require_re = __commonJS({
|
|
96
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/re.js"(exports, module) {
|
|
97
|
+
var {
|
|
98
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
99
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
100
|
+
MAX_LENGTH
|
|
101
|
+
} = require_constants();
|
|
102
|
+
var debug = require_debug();
|
|
103
|
+
exports = module.exports = {};
|
|
104
|
+
var re = exports.re = [];
|
|
105
|
+
var safeRe = exports.safeRe = [];
|
|
106
|
+
var src = exports.src = [];
|
|
107
|
+
var t = exports.t = {};
|
|
108
|
+
var R = 0;
|
|
109
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
110
|
+
var safeRegexReplacements = [
|
|
111
|
+
["\\s", 1],
|
|
112
|
+
["\\d", MAX_LENGTH],
|
|
113
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
114
|
+
];
|
|
115
|
+
var makeSafeRegex = (value) => {
|
|
116
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
117
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
118
|
+
}
|
|
119
|
+
return value;
|
|
120
|
+
};
|
|
121
|
+
var createToken = (name, value, isGlobal) => {
|
|
122
|
+
const safe = makeSafeRegex(value);
|
|
123
|
+
const index = R++;
|
|
124
|
+
debug(name, index, value);
|
|
125
|
+
t[name] = index;
|
|
126
|
+
src[index] = value;
|
|
127
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
128
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
129
|
+
};
|
|
130
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
131
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
132
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
133
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
134
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
135
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NUMERICIDENTIFIER]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
136
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NUMERICIDENTIFIERLOOSE]}|${src[t.NONNUMERICIDENTIFIER]})`);
|
|
137
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
138
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
139
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
140
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
141
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
142
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
143
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
144
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
145
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
146
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
147
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
148
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
149
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
150
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
151
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
152
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
153
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
154
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
155
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
156
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
157
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
158
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
159
|
+
exports.tildeTrimReplace = "$1~";
|
|
160
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
161
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
162
|
+
createToken("LONECARET", "(?:\\^)");
|
|
163
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
164
|
+
exports.caretTrimReplace = "$1^";
|
|
165
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
166
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
167
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
168
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
169
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
170
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
171
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
172
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
173
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
174
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
175
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js
|
|
180
|
+
var require_parse_options = __commonJS({
|
|
181
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
182
|
+
var looseOption = Object.freeze({ loose: true });
|
|
183
|
+
var emptyOpts = Object.freeze({});
|
|
184
|
+
var parseOptions = (options) => {
|
|
185
|
+
if (!options) {
|
|
186
|
+
return emptyOpts;
|
|
187
|
+
}
|
|
188
|
+
if (typeof options !== "object") {
|
|
189
|
+
return looseOption;
|
|
190
|
+
}
|
|
191
|
+
return options;
|
|
192
|
+
};
|
|
193
|
+
module.exports = parseOptions;
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js
|
|
198
|
+
var require_identifiers = __commonJS({
|
|
199
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
200
|
+
var numeric = /^[0-9]+$/;
|
|
201
|
+
var compareIdentifiers = (a, b) => {
|
|
202
|
+
const anum = numeric.test(a);
|
|
203
|
+
const bnum = numeric.test(b);
|
|
204
|
+
if (anum && bnum) {
|
|
205
|
+
a = +a;
|
|
206
|
+
b = +b;
|
|
207
|
+
}
|
|
208
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
209
|
+
};
|
|
210
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
211
|
+
module.exports = {
|
|
212
|
+
compareIdentifiers,
|
|
213
|
+
rcompareIdentifiers
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
|
|
218
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js
|
|
219
|
+
var require_semver = __commonJS({
|
|
220
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/semver.js"(exports, module) {
|
|
221
|
+
var debug = require_debug();
|
|
222
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
223
|
+
var { safeRe: re, t } = require_re();
|
|
224
|
+
var parseOptions = require_parse_options();
|
|
225
|
+
var { compareIdentifiers } = require_identifiers();
|
|
226
|
+
var SemVer = class _SemVer {
|
|
227
|
+
constructor(version, options) {
|
|
228
|
+
options = parseOptions(options);
|
|
229
|
+
if (version instanceof _SemVer) {
|
|
230
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
231
|
+
return version;
|
|
232
|
+
} else {
|
|
233
|
+
version = version.version;
|
|
234
|
+
}
|
|
235
|
+
} else if (typeof version !== "string") {
|
|
236
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
237
|
+
}
|
|
238
|
+
if (version.length > MAX_LENGTH) {
|
|
239
|
+
throw new TypeError(
|
|
240
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
241
|
+
);
|
|
242
|
+
}
|
|
243
|
+
debug("SemVer", version, options);
|
|
244
|
+
this.options = options;
|
|
245
|
+
this.loose = !!options.loose;
|
|
246
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
247
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
248
|
+
if (!m) {
|
|
249
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
250
|
+
}
|
|
251
|
+
this.raw = version;
|
|
252
|
+
this.major = +m[1];
|
|
253
|
+
this.minor = +m[2];
|
|
254
|
+
this.patch = +m[3];
|
|
255
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
256
|
+
throw new TypeError("Invalid major version");
|
|
257
|
+
}
|
|
258
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
259
|
+
throw new TypeError("Invalid minor version");
|
|
260
|
+
}
|
|
261
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
262
|
+
throw new TypeError("Invalid patch version");
|
|
263
|
+
}
|
|
264
|
+
if (!m[4]) {
|
|
265
|
+
this.prerelease = [];
|
|
266
|
+
} else {
|
|
267
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
268
|
+
if (/^[0-9]+$/.test(id)) {
|
|
269
|
+
const num = +id;
|
|
270
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
271
|
+
return num;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
return id;
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
278
|
+
this.format();
|
|
279
|
+
}
|
|
280
|
+
format() {
|
|
281
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
282
|
+
if (this.prerelease.length) {
|
|
283
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
284
|
+
}
|
|
285
|
+
return this.version;
|
|
286
|
+
}
|
|
287
|
+
toString() {
|
|
288
|
+
return this.version;
|
|
289
|
+
}
|
|
290
|
+
compare(other) {
|
|
291
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
292
|
+
if (!(other instanceof _SemVer)) {
|
|
293
|
+
if (typeof other === "string" && other === this.version) {
|
|
294
|
+
return 0;
|
|
295
|
+
}
|
|
296
|
+
other = new _SemVer(other, this.options);
|
|
297
|
+
}
|
|
298
|
+
if (other.version === this.version) {
|
|
299
|
+
return 0;
|
|
300
|
+
}
|
|
301
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
302
|
+
}
|
|
303
|
+
compareMain(other) {
|
|
304
|
+
if (!(other instanceof _SemVer)) {
|
|
305
|
+
other = new _SemVer(other, this.options);
|
|
306
|
+
}
|
|
307
|
+
return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
|
|
308
|
+
}
|
|
309
|
+
comparePre(other) {
|
|
310
|
+
if (!(other instanceof _SemVer)) {
|
|
311
|
+
other = new _SemVer(other, this.options);
|
|
312
|
+
}
|
|
313
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
314
|
+
return -1;
|
|
315
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
316
|
+
return 1;
|
|
317
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
318
|
+
return 0;
|
|
319
|
+
}
|
|
320
|
+
let i = 0;
|
|
321
|
+
do {
|
|
322
|
+
const a = this.prerelease[i];
|
|
323
|
+
const b = other.prerelease[i];
|
|
324
|
+
debug("prerelease compare", i, a, b);
|
|
325
|
+
if (a === void 0 && b === void 0) {
|
|
326
|
+
return 0;
|
|
327
|
+
} else if (b === void 0) {
|
|
328
|
+
return 1;
|
|
329
|
+
} else if (a === void 0) {
|
|
330
|
+
return -1;
|
|
331
|
+
} else if (a === b) {
|
|
332
|
+
continue;
|
|
333
|
+
} else {
|
|
334
|
+
return compareIdentifiers(a, b);
|
|
335
|
+
}
|
|
336
|
+
} while (++i);
|
|
337
|
+
}
|
|
338
|
+
compareBuild(other) {
|
|
339
|
+
if (!(other instanceof _SemVer)) {
|
|
340
|
+
other = new _SemVer(other, this.options);
|
|
341
|
+
}
|
|
342
|
+
let i = 0;
|
|
343
|
+
do {
|
|
344
|
+
const a = this.build[i];
|
|
345
|
+
const b = other.build[i];
|
|
346
|
+
debug("build compare", i, a, b);
|
|
347
|
+
if (a === void 0 && b === void 0) {
|
|
348
|
+
return 0;
|
|
349
|
+
} else if (b === void 0) {
|
|
350
|
+
return 1;
|
|
351
|
+
} else if (a === void 0) {
|
|
352
|
+
return -1;
|
|
353
|
+
} else if (a === b) {
|
|
354
|
+
continue;
|
|
355
|
+
} else {
|
|
356
|
+
return compareIdentifiers(a, b);
|
|
357
|
+
}
|
|
358
|
+
} while (++i);
|
|
359
|
+
}
|
|
360
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
361
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
362
|
+
inc(release, identifier, identifierBase) {
|
|
363
|
+
switch (release) {
|
|
364
|
+
case "premajor":
|
|
365
|
+
this.prerelease.length = 0;
|
|
366
|
+
this.patch = 0;
|
|
367
|
+
this.minor = 0;
|
|
368
|
+
this.major++;
|
|
369
|
+
this.inc("pre", identifier, identifierBase);
|
|
370
|
+
break;
|
|
371
|
+
case "preminor":
|
|
372
|
+
this.prerelease.length = 0;
|
|
373
|
+
this.patch = 0;
|
|
374
|
+
this.minor++;
|
|
375
|
+
this.inc("pre", identifier, identifierBase);
|
|
376
|
+
break;
|
|
377
|
+
case "prepatch":
|
|
378
|
+
this.prerelease.length = 0;
|
|
379
|
+
this.inc("patch", identifier, identifierBase);
|
|
380
|
+
this.inc("pre", identifier, identifierBase);
|
|
381
|
+
break;
|
|
382
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
383
|
+
// prepatch.
|
|
384
|
+
case "prerelease":
|
|
385
|
+
if (this.prerelease.length === 0) {
|
|
386
|
+
this.inc("patch", identifier, identifierBase);
|
|
387
|
+
}
|
|
388
|
+
this.inc("pre", identifier, identifierBase);
|
|
389
|
+
break;
|
|
390
|
+
case "major":
|
|
391
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
392
|
+
this.major++;
|
|
393
|
+
}
|
|
394
|
+
this.minor = 0;
|
|
395
|
+
this.patch = 0;
|
|
396
|
+
this.prerelease = [];
|
|
397
|
+
break;
|
|
398
|
+
case "minor":
|
|
399
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
400
|
+
this.minor++;
|
|
401
|
+
}
|
|
402
|
+
this.patch = 0;
|
|
403
|
+
this.prerelease = [];
|
|
404
|
+
break;
|
|
405
|
+
case "patch":
|
|
406
|
+
if (this.prerelease.length === 0) {
|
|
407
|
+
this.patch++;
|
|
408
|
+
}
|
|
409
|
+
this.prerelease = [];
|
|
410
|
+
break;
|
|
411
|
+
// This probably shouldn't be used publicly.
|
|
412
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
413
|
+
case "pre": {
|
|
414
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
415
|
+
if (!identifier && identifierBase === false) {
|
|
416
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
417
|
+
}
|
|
418
|
+
if (this.prerelease.length === 0) {
|
|
419
|
+
this.prerelease = [base];
|
|
420
|
+
} else {
|
|
421
|
+
let i = this.prerelease.length;
|
|
422
|
+
while (--i >= 0) {
|
|
423
|
+
if (typeof this.prerelease[i] === "number") {
|
|
424
|
+
this.prerelease[i]++;
|
|
425
|
+
i = -2;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
if (i === -1) {
|
|
429
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
430
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
431
|
+
}
|
|
432
|
+
this.prerelease.push(base);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (identifier) {
|
|
436
|
+
let prerelease = [identifier, base];
|
|
437
|
+
if (identifierBase === false) {
|
|
438
|
+
prerelease = [identifier];
|
|
439
|
+
}
|
|
440
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
441
|
+
if (isNaN(this.prerelease[1])) {
|
|
442
|
+
this.prerelease = prerelease;
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
this.prerelease = prerelease;
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
break;
|
|
449
|
+
}
|
|
450
|
+
default:
|
|
451
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
452
|
+
}
|
|
453
|
+
this.raw = this.format();
|
|
454
|
+
if (this.build.length) {
|
|
455
|
+
this.raw += `+${this.build.join(".")}`;
|
|
456
|
+
}
|
|
457
|
+
return this;
|
|
458
|
+
}
|
|
459
|
+
};
|
|
460
|
+
module.exports = SemVer;
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js
|
|
465
|
+
var require_parse = __commonJS({
|
|
466
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/parse.js"(exports, module) {
|
|
467
|
+
var SemVer = require_semver();
|
|
468
|
+
var parse = (version, options, throwErrors = false) => {
|
|
469
|
+
if (version instanceof SemVer) {
|
|
470
|
+
return version;
|
|
471
|
+
}
|
|
472
|
+
try {
|
|
473
|
+
return new SemVer(version, options);
|
|
474
|
+
} catch (er) {
|
|
475
|
+
if (!throwErrors) {
|
|
476
|
+
return null;
|
|
477
|
+
}
|
|
478
|
+
throw er;
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
module.exports = parse;
|
|
482
|
+
}
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js
|
|
486
|
+
var require_valid = __commonJS({
|
|
487
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/valid.js"(exports, module) {
|
|
488
|
+
var parse = require_parse();
|
|
489
|
+
var valid = (version, options) => {
|
|
490
|
+
const v = parse(version, options);
|
|
491
|
+
return v ? v.version : null;
|
|
492
|
+
};
|
|
493
|
+
module.exports = valid;
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
|
|
497
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js
|
|
498
|
+
var require_clean = __commonJS({
|
|
499
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/clean.js"(exports, module) {
|
|
500
|
+
var parse = require_parse();
|
|
501
|
+
var clean = (version, options) => {
|
|
502
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
503
|
+
return s ? s.version : null;
|
|
504
|
+
};
|
|
505
|
+
module.exports = clean;
|
|
506
|
+
}
|
|
507
|
+
});
|
|
508
|
+
|
|
509
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/inc.js
|
|
510
|
+
var require_inc = __commonJS({
|
|
511
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/inc.js"(exports, module) {
|
|
512
|
+
var SemVer = require_semver();
|
|
513
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
514
|
+
if (typeof options === "string") {
|
|
515
|
+
identifierBase = identifier;
|
|
516
|
+
identifier = options;
|
|
517
|
+
options = void 0;
|
|
518
|
+
}
|
|
519
|
+
try {
|
|
520
|
+
return new SemVer(
|
|
521
|
+
version instanceof SemVer ? version.version : version,
|
|
522
|
+
options
|
|
523
|
+
).inc(release, identifier, identifierBase).version;
|
|
524
|
+
} catch (er) {
|
|
525
|
+
return null;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
module.exports = inc;
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/diff.js
|
|
533
|
+
var require_diff = __commonJS({
|
|
534
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/diff.js"(exports, module) {
|
|
535
|
+
var parse = require_parse();
|
|
536
|
+
var diff = (version1, version2) => {
|
|
537
|
+
const v1 = parse(version1, null, true);
|
|
538
|
+
const v2 = parse(version2, null, true);
|
|
539
|
+
const comparison = v1.compare(v2);
|
|
540
|
+
if (comparison === 0) {
|
|
541
|
+
return null;
|
|
542
|
+
}
|
|
543
|
+
const v1Higher = comparison > 0;
|
|
544
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
545
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
546
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
547
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
548
|
+
if (lowHasPre && !highHasPre) {
|
|
549
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
550
|
+
return "major";
|
|
551
|
+
}
|
|
552
|
+
if (highVersion.patch) {
|
|
553
|
+
return "patch";
|
|
554
|
+
}
|
|
555
|
+
if (highVersion.minor) {
|
|
556
|
+
return "minor";
|
|
557
|
+
}
|
|
558
|
+
return "major";
|
|
559
|
+
}
|
|
560
|
+
const prefix = highHasPre ? "pre" : "";
|
|
561
|
+
if (v1.major !== v2.major) {
|
|
562
|
+
return prefix + "major";
|
|
563
|
+
}
|
|
564
|
+
if (v1.minor !== v2.minor) {
|
|
565
|
+
return prefix + "minor";
|
|
566
|
+
}
|
|
567
|
+
if (v1.patch !== v2.patch) {
|
|
568
|
+
return prefix + "patch";
|
|
569
|
+
}
|
|
570
|
+
return "prerelease";
|
|
571
|
+
};
|
|
572
|
+
module.exports = diff;
|
|
573
|
+
}
|
|
574
|
+
});
|
|
575
|
+
|
|
576
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/major.js
|
|
577
|
+
var require_major = __commonJS({
|
|
578
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/major.js"(exports, module) {
|
|
579
|
+
var SemVer = require_semver();
|
|
580
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
581
|
+
module.exports = major;
|
|
582
|
+
}
|
|
583
|
+
});
|
|
584
|
+
|
|
585
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/minor.js
|
|
586
|
+
var require_minor = __commonJS({
|
|
587
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/minor.js"(exports, module) {
|
|
588
|
+
var SemVer = require_semver();
|
|
589
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
590
|
+
module.exports = minor;
|
|
591
|
+
}
|
|
592
|
+
});
|
|
593
|
+
|
|
594
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/patch.js
|
|
595
|
+
var require_patch = __commonJS({
|
|
596
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/patch.js"(exports, module) {
|
|
597
|
+
var SemVer = require_semver();
|
|
598
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
599
|
+
module.exports = patch;
|
|
600
|
+
}
|
|
601
|
+
});
|
|
602
|
+
|
|
603
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/prerelease.js
|
|
604
|
+
var require_prerelease = __commonJS({
|
|
605
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
606
|
+
var parse = require_parse();
|
|
607
|
+
var prerelease = (version, options) => {
|
|
608
|
+
const parsed = parse(version, options);
|
|
609
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
610
|
+
};
|
|
611
|
+
module.exports = prerelease;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare.js
|
|
616
|
+
var require_compare = __commonJS({
|
|
617
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare.js"(exports, module) {
|
|
618
|
+
var SemVer = require_semver();
|
|
619
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
620
|
+
module.exports = compare;
|
|
621
|
+
}
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rcompare.js
|
|
625
|
+
var require_rcompare = __commonJS({
|
|
626
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
627
|
+
var compare = require_compare();
|
|
628
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
629
|
+
module.exports = rcompare;
|
|
630
|
+
}
|
|
631
|
+
});
|
|
632
|
+
|
|
633
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-loose.js
|
|
634
|
+
var require_compare_loose = __commonJS({
|
|
635
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
636
|
+
var compare = require_compare();
|
|
637
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
638
|
+
module.exports = compareLoose;
|
|
639
|
+
}
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-build.js
|
|
643
|
+
var require_compare_build = __commonJS({
|
|
644
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
645
|
+
var SemVer = require_semver();
|
|
646
|
+
var compareBuild = (a, b, loose) => {
|
|
647
|
+
const versionA = new SemVer(a, loose);
|
|
648
|
+
const versionB = new SemVer(b, loose);
|
|
649
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
650
|
+
};
|
|
651
|
+
module.exports = compareBuild;
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/sort.js
|
|
656
|
+
var require_sort = __commonJS({
|
|
657
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/sort.js"(exports, module) {
|
|
658
|
+
var compareBuild = require_compare_build();
|
|
659
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
660
|
+
module.exports = sort;
|
|
661
|
+
}
|
|
662
|
+
});
|
|
663
|
+
|
|
664
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rsort.js
|
|
665
|
+
var require_rsort = __commonJS({
|
|
666
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
667
|
+
var compareBuild = require_compare_build();
|
|
668
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
669
|
+
module.exports = rsort;
|
|
670
|
+
}
|
|
671
|
+
});
|
|
672
|
+
|
|
673
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gt.js
|
|
674
|
+
var require_gt = __commonJS({
|
|
675
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gt.js"(exports, module) {
|
|
676
|
+
var compare = require_compare();
|
|
677
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
678
|
+
module.exports = gt;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lt.js
|
|
683
|
+
var require_lt = __commonJS({
|
|
684
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lt.js"(exports, module) {
|
|
685
|
+
var compare = require_compare();
|
|
686
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
687
|
+
module.exports = lt;
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
|
|
691
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/eq.js
|
|
692
|
+
var require_eq = __commonJS({
|
|
693
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/eq.js"(exports, module) {
|
|
694
|
+
var compare = require_compare();
|
|
695
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
696
|
+
module.exports = eq;
|
|
697
|
+
}
|
|
698
|
+
});
|
|
699
|
+
|
|
700
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/neq.js
|
|
701
|
+
var require_neq = __commonJS({
|
|
702
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/neq.js"(exports, module) {
|
|
703
|
+
var compare = require_compare();
|
|
704
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
705
|
+
module.exports = neq;
|
|
706
|
+
}
|
|
707
|
+
});
|
|
708
|
+
|
|
709
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gte.js
|
|
710
|
+
var require_gte = __commonJS({
|
|
711
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/gte.js"(exports, module) {
|
|
712
|
+
var compare = require_compare();
|
|
713
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
714
|
+
module.exports = gte;
|
|
715
|
+
}
|
|
716
|
+
});
|
|
717
|
+
|
|
718
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lte.js
|
|
719
|
+
var require_lte = __commonJS({
|
|
720
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/lte.js"(exports, module) {
|
|
721
|
+
var compare = require_compare();
|
|
722
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
723
|
+
module.exports = lte;
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
|
|
727
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/cmp.js
|
|
728
|
+
var require_cmp = __commonJS({
|
|
729
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
730
|
+
var eq = require_eq();
|
|
731
|
+
var neq = require_neq();
|
|
732
|
+
var gt = require_gt();
|
|
733
|
+
var gte = require_gte();
|
|
734
|
+
var lt = require_lt();
|
|
735
|
+
var lte = require_lte();
|
|
736
|
+
var cmp = (a, op, b, loose) => {
|
|
737
|
+
switch (op) {
|
|
738
|
+
case "===":
|
|
739
|
+
if (typeof a === "object") {
|
|
740
|
+
a = a.version;
|
|
741
|
+
}
|
|
742
|
+
if (typeof b === "object") {
|
|
743
|
+
b = b.version;
|
|
744
|
+
}
|
|
745
|
+
return a === b;
|
|
746
|
+
case "!==":
|
|
747
|
+
if (typeof a === "object") {
|
|
748
|
+
a = a.version;
|
|
749
|
+
}
|
|
750
|
+
if (typeof b === "object") {
|
|
751
|
+
b = b.version;
|
|
752
|
+
}
|
|
753
|
+
return a !== b;
|
|
754
|
+
case "":
|
|
755
|
+
case "=":
|
|
756
|
+
case "==":
|
|
757
|
+
return eq(a, b, loose);
|
|
758
|
+
case "!=":
|
|
759
|
+
return neq(a, b, loose);
|
|
760
|
+
case ">":
|
|
761
|
+
return gt(a, b, loose);
|
|
762
|
+
case ">=":
|
|
763
|
+
return gte(a, b, loose);
|
|
764
|
+
case "<":
|
|
765
|
+
return lt(a, b, loose);
|
|
766
|
+
case "<=":
|
|
767
|
+
return lte(a, b, loose);
|
|
768
|
+
default:
|
|
769
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
770
|
+
}
|
|
771
|
+
};
|
|
772
|
+
module.exports = cmp;
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/coerce.js
|
|
777
|
+
var require_coerce = __commonJS({
|
|
778
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
779
|
+
var SemVer = require_semver();
|
|
780
|
+
var parse = require_parse();
|
|
781
|
+
var { safeRe: re, t } = require_re();
|
|
782
|
+
var coerce = (version, options) => {
|
|
783
|
+
if (version instanceof SemVer) {
|
|
784
|
+
return version;
|
|
785
|
+
}
|
|
786
|
+
if (typeof version === "number") {
|
|
787
|
+
version = String(version);
|
|
788
|
+
}
|
|
789
|
+
if (typeof version !== "string") {
|
|
790
|
+
return null;
|
|
791
|
+
}
|
|
792
|
+
options = options || {};
|
|
793
|
+
let match = null;
|
|
794
|
+
if (!options.rtl) {
|
|
795
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
796
|
+
} else {
|
|
797
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
798
|
+
let next;
|
|
799
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
800
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
801
|
+
match = next;
|
|
802
|
+
}
|
|
803
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
804
|
+
}
|
|
805
|
+
coerceRtlRegex.lastIndex = -1;
|
|
806
|
+
}
|
|
807
|
+
if (match === null) {
|
|
808
|
+
return null;
|
|
809
|
+
}
|
|
810
|
+
const major = match[2];
|
|
811
|
+
const minor = match[3] || "0";
|
|
812
|
+
const patch = match[4] || "0";
|
|
813
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
814
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
815
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
816
|
+
};
|
|
817
|
+
module.exports = coerce;
|
|
818
|
+
}
|
|
819
|
+
});
|
|
820
|
+
|
|
821
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/lrucache.js
|
|
822
|
+
var require_lrucache = __commonJS({
|
|
823
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
824
|
+
var LRUCache = class {
|
|
825
|
+
constructor() {
|
|
826
|
+
this.max = 1e3;
|
|
827
|
+
this.map = /* @__PURE__ */ new Map();
|
|
828
|
+
}
|
|
829
|
+
get(key) {
|
|
830
|
+
const value = this.map.get(key);
|
|
831
|
+
if (value === void 0) {
|
|
832
|
+
return void 0;
|
|
833
|
+
} else {
|
|
834
|
+
this.map.delete(key);
|
|
835
|
+
this.map.set(key, value);
|
|
836
|
+
return value;
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
delete(key) {
|
|
840
|
+
return this.map.delete(key);
|
|
841
|
+
}
|
|
842
|
+
set(key, value) {
|
|
843
|
+
const deleted = this.delete(key);
|
|
844
|
+
if (!deleted && value !== void 0) {
|
|
845
|
+
if (this.map.size >= this.max) {
|
|
846
|
+
const firstKey = this.map.keys().next().value;
|
|
847
|
+
this.delete(firstKey);
|
|
848
|
+
}
|
|
849
|
+
this.map.set(key, value);
|
|
850
|
+
}
|
|
851
|
+
return this;
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
module.exports = LRUCache;
|
|
855
|
+
}
|
|
856
|
+
});
|
|
857
|
+
|
|
858
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/range.js
|
|
859
|
+
var require_range = __commonJS({
|
|
860
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/range.js"(exports, module) {
|
|
861
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
862
|
+
var Range = class _Range {
|
|
863
|
+
constructor(range, options) {
|
|
864
|
+
options = parseOptions(options);
|
|
865
|
+
if (range instanceof _Range) {
|
|
866
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
867
|
+
return range;
|
|
868
|
+
} else {
|
|
869
|
+
return new _Range(range.raw, options);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
if (range instanceof Comparator) {
|
|
873
|
+
this.raw = range.value;
|
|
874
|
+
this.set = [[range]];
|
|
875
|
+
this.formatted = void 0;
|
|
876
|
+
return this;
|
|
877
|
+
}
|
|
878
|
+
this.options = options;
|
|
879
|
+
this.loose = !!options.loose;
|
|
880
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
881
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
882
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
883
|
+
if (!this.set.length) {
|
|
884
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
885
|
+
}
|
|
886
|
+
if (this.set.length > 1) {
|
|
887
|
+
const first = this.set[0];
|
|
888
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
889
|
+
if (this.set.length === 0) {
|
|
890
|
+
this.set = [first];
|
|
891
|
+
} else if (this.set.length > 1) {
|
|
892
|
+
for (const c of this.set) {
|
|
893
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
894
|
+
this.set = [c];
|
|
895
|
+
break;
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
this.formatted = void 0;
|
|
901
|
+
}
|
|
902
|
+
get range() {
|
|
903
|
+
if (this.formatted === void 0) {
|
|
904
|
+
this.formatted = "";
|
|
905
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
906
|
+
if (i > 0) {
|
|
907
|
+
this.formatted += "||";
|
|
908
|
+
}
|
|
909
|
+
const comps = this.set[i];
|
|
910
|
+
for (let k = 0; k < comps.length; k++) {
|
|
911
|
+
if (k > 0) {
|
|
912
|
+
this.formatted += " ";
|
|
913
|
+
}
|
|
914
|
+
this.formatted += comps[k].toString().trim();
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return this.formatted;
|
|
919
|
+
}
|
|
920
|
+
format() {
|
|
921
|
+
return this.range;
|
|
922
|
+
}
|
|
923
|
+
toString() {
|
|
924
|
+
return this.range;
|
|
925
|
+
}
|
|
926
|
+
parseRange(range) {
|
|
927
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
928
|
+
const memoKey = memoOpts + ":" + range;
|
|
929
|
+
const cached = cache.get(memoKey);
|
|
930
|
+
if (cached) {
|
|
931
|
+
return cached;
|
|
932
|
+
}
|
|
933
|
+
const loose = this.options.loose;
|
|
934
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
935
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
936
|
+
debug("hyphen replace", range);
|
|
937
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
938
|
+
debug("comparator trim", range);
|
|
939
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
940
|
+
debug("tilde trim", range);
|
|
941
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
942
|
+
debug("caret trim", range);
|
|
943
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
944
|
+
if (loose) {
|
|
945
|
+
rangeList = rangeList.filter((comp) => {
|
|
946
|
+
debug("loose invalid filter", comp, this.options);
|
|
947
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
948
|
+
});
|
|
949
|
+
}
|
|
950
|
+
debug("range list", rangeList);
|
|
951
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
952
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
953
|
+
for (const comp of comparators) {
|
|
954
|
+
if (isNullSet(comp)) {
|
|
955
|
+
return [comp];
|
|
956
|
+
}
|
|
957
|
+
rangeMap.set(comp.value, comp);
|
|
958
|
+
}
|
|
959
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
960
|
+
rangeMap.delete("");
|
|
961
|
+
}
|
|
962
|
+
const result = [...rangeMap.values()];
|
|
963
|
+
cache.set(memoKey, result);
|
|
964
|
+
return result;
|
|
965
|
+
}
|
|
966
|
+
intersects(range, options) {
|
|
967
|
+
if (!(range instanceof _Range)) {
|
|
968
|
+
throw new TypeError("a Range is required");
|
|
969
|
+
}
|
|
970
|
+
return this.set.some((thisComparators) => {
|
|
971
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
972
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
973
|
+
return rangeComparators.every((rangeComparator) => {
|
|
974
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
975
|
+
});
|
|
976
|
+
});
|
|
977
|
+
});
|
|
978
|
+
});
|
|
979
|
+
}
|
|
980
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
981
|
+
test(version) {
|
|
982
|
+
if (!version) {
|
|
983
|
+
return false;
|
|
984
|
+
}
|
|
985
|
+
if (typeof version === "string") {
|
|
986
|
+
try {
|
|
987
|
+
version = new SemVer(version, this.options);
|
|
988
|
+
} catch (er) {
|
|
989
|
+
return false;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
993
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
994
|
+
return true;
|
|
995
|
+
}
|
|
996
|
+
}
|
|
997
|
+
return false;
|
|
998
|
+
}
|
|
999
|
+
};
|
|
1000
|
+
module.exports = Range;
|
|
1001
|
+
var LRU = require_lrucache();
|
|
1002
|
+
var cache = new LRU();
|
|
1003
|
+
var parseOptions = require_parse_options();
|
|
1004
|
+
var Comparator = require_comparator();
|
|
1005
|
+
var debug = require_debug();
|
|
1006
|
+
var SemVer = require_semver();
|
|
1007
|
+
var {
|
|
1008
|
+
safeRe: re,
|
|
1009
|
+
t,
|
|
1010
|
+
comparatorTrimReplace,
|
|
1011
|
+
tildeTrimReplace,
|
|
1012
|
+
caretTrimReplace
|
|
1013
|
+
} = require_re();
|
|
1014
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1015
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1016
|
+
var isAny = (c) => c.value === "";
|
|
1017
|
+
var isSatisfiable = (comparators, options) => {
|
|
1018
|
+
let result = true;
|
|
1019
|
+
const remainingComparators = comparators.slice();
|
|
1020
|
+
let testComparator = remainingComparators.pop();
|
|
1021
|
+
while (result && remainingComparators.length) {
|
|
1022
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1023
|
+
return testComparator.intersects(otherComparator, options);
|
|
1024
|
+
});
|
|
1025
|
+
testComparator = remainingComparators.pop();
|
|
1026
|
+
}
|
|
1027
|
+
return result;
|
|
1028
|
+
};
|
|
1029
|
+
var parseComparator = (comp, options) => {
|
|
1030
|
+
debug("comp", comp, options);
|
|
1031
|
+
comp = replaceCarets(comp, options);
|
|
1032
|
+
debug("caret", comp);
|
|
1033
|
+
comp = replaceTildes(comp, options);
|
|
1034
|
+
debug("tildes", comp);
|
|
1035
|
+
comp = replaceXRanges(comp, options);
|
|
1036
|
+
debug("xrange", comp);
|
|
1037
|
+
comp = replaceStars(comp, options);
|
|
1038
|
+
debug("stars", comp);
|
|
1039
|
+
return comp;
|
|
1040
|
+
};
|
|
1041
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1042
|
+
var replaceTildes = (comp, options) => {
|
|
1043
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1044
|
+
};
|
|
1045
|
+
var replaceTilde = (comp, options) => {
|
|
1046
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1047
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1048
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1049
|
+
let ret;
|
|
1050
|
+
if (isX(M)) {
|
|
1051
|
+
ret = "";
|
|
1052
|
+
} else if (isX(m)) {
|
|
1053
|
+
ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
1054
|
+
} else if (isX(p)) {
|
|
1055
|
+
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1056
|
+
} else if (pr) {
|
|
1057
|
+
debug("replaceTilde pr", pr);
|
|
1058
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1059
|
+
} else {
|
|
1060
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1061
|
+
}
|
|
1062
|
+
debug("tilde return", ret);
|
|
1063
|
+
return ret;
|
|
1064
|
+
});
|
|
1065
|
+
};
|
|
1066
|
+
var replaceCarets = (comp, options) => {
|
|
1067
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1068
|
+
};
|
|
1069
|
+
var replaceCaret = (comp, options) => {
|
|
1070
|
+
debug("caret", comp, options);
|
|
1071
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1072
|
+
const z = options.includePrerelease ? "-0" : "";
|
|
1073
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1074
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1075
|
+
let ret;
|
|
1076
|
+
if (isX(M)) {
|
|
1077
|
+
ret = "";
|
|
1078
|
+
} else if (isX(m)) {
|
|
1079
|
+
ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
1080
|
+
} else if (isX(p)) {
|
|
1081
|
+
if (M === "0") {
|
|
1082
|
+
ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
1083
|
+
} else {
|
|
1084
|
+
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1085
|
+
}
|
|
1086
|
+
} else if (pr) {
|
|
1087
|
+
debug("replaceCaret pr", pr);
|
|
1088
|
+
if (M === "0") {
|
|
1089
|
+
if (m === "0") {
|
|
1090
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1091
|
+
} else {
|
|
1092
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1093
|
+
}
|
|
1094
|
+
} else {
|
|
1095
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1096
|
+
}
|
|
1097
|
+
} else {
|
|
1098
|
+
debug("no pr");
|
|
1099
|
+
if (M === "0") {
|
|
1100
|
+
if (m === "0") {
|
|
1101
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
1102
|
+
} else {
|
|
1103
|
+
ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
1104
|
+
}
|
|
1105
|
+
} else {
|
|
1106
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1107
|
+
}
|
|
1108
|
+
}
|
|
1109
|
+
debug("caret return", ret);
|
|
1110
|
+
return ret;
|
|
1111
|
+
});
|
|
1112
|
+
};
|
|
1113
|
+
var replaceXRanges = (comp, options) => {
|
|
1114
|
+
debug("replaceXRanges", comp, options);
|
|
1115
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1116
|
+
};
|
|
1117
|
+
var replaceXRange = (comp, options) => {
|
|
1118
|
+
comp = comp.trim();
|
|
1119
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1120
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1121
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1122
|
+
const xM = isX(M);
|
|
1123
|
+
const xm = xM || isX(m);
|
|
1124
|
+
const xp = xm || isX(p);
|
|
1125
|
+
const anyX = xp;
|
|
1126
|
+
if (gtlt === "=" && anyX) {
|
|
1127
|
+
gtlt = "";
|
|
1128
|
+
}
|
|
1129
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1130
|
+
if (xM) {
|
|
1131
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1132
|
+
ret = "<0.0.0-0";
|
|
1133
|
+
} else {
|
|
1134
|
+
ret = "*";
|
|
1135
|
+
}
|
|
1136
|
+
} else if (gtlt && anyX) {
|
|
1137
|
+
if (xm) {
|
|
1138
|
+
m = 0;
|
|
1139
|
+
}
|
|
1140
|
+
p = 0;
|
|
1141
|
+
if (gtlt === ">") {
|
|
1142
|
+
gtlt = ">=";
|
|
1143
|
+
if (xm) {
|
|
1144
|
+
M = +M + 1;
|
|
1145
|
+
m = 0;
|
|
1146
|
+
p = 0;
|
|
1147
|
+
} else {
|
|
1148
|
+
m = +m + 1;
|
|
1149
|
+
p = 0;
|
|
1150
|
+
}
|
|
1151
|
+
} else if (gtlt === "<=") {
|
|
1152
|
+
gtlt = "<";
|
|
1153
|
+
if (xm) {
|
|
1154
|
+
M = +M + 1;
|
|
1155
|
+
} else {
|
|
1156
|
+
m = +m + 1;
|
|
1157
|
+
}
|
|
1158
|
+
}
|
|
1159
|
+
if (gtlt === "<") {
|
|
1160
|
+
pr = "-0";
|
|
1161
|
+
}
|
|
1162
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1163
|
+
} else if (xm) {
|
|
1164
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1165
|
+
} else if (xp) {
|
|
1166
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1167
|
+
}
|
|
1168
|
+
debug("xRange return", ret);
|
|
1169
|
+
return ret;
|
|
1170
|
+
});
|
|
1171
|
+
};
|
|
1172
|
+
var replaceStars = (comp, options) => {
|
|
1173
|
+
debug("replaceStars", comp, options);
|
|
1174
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1175
|
+
};
|
|
1176
|
+
var replaceGTE0 = (comp, options) => {
|
|
1177
|
+
debug("replaceGTE0", comp, options);
|
|
1178
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1179
|
+
};
|
|
1180
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1181
|
+
if (isX(fM)) {
|
|
1182
|
+
from = "";
|
|
1183
|
+
} else if (isX(fm)) {
|
|
1184
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1185
|
+
} else if (isX(fp)) {
|
|
1186
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1187
|
+
} else if (fpr) {
|
|
1188
|
+
from = `>=${from}`;
|
|
1189
|
+
} else {
|
|
1190
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1191
|
+
}
|
|
1192
|
+
if (isX(tM)) {
|
|
1193
|
+
to = "";
|
|
1194
|
+
} else if (isX(tm)) {
|
|
1195
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1196
|
+
} else if (isX(tp)) {
|
|
1197
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1198
|
+
} else if (tpr) {
|
|
1199
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1200
|
+
} else if (incPr) {
|
|
1201
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1202
|
+
} else {
|
|
1203
|
+
to = `<=${to}`;
|
|
1204
|
+
}
|
|
1205
|
+
return `${from} ${to}`.trim();
|
|
1206
|
+
};
|
|
1207
|
+
var testSet = (set, version, options) => {
|
|
1208
|
+
for (let i = 0; i < set.length; i++) {
|
|
1209
|
+
if (!set[i].test(version)) {
|
|
1210
|
+
return false;
|
|
1211
|
+
}
|
|
1212
|
+
}
|
|
1213
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1214
|
+
for (let i = 0; i < set.length; i++) {
|
|
1215
|
+
debug(set[i].semver);
|
|
1216
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1217
|
+
continue;
|
|
1218
|
+
}
|
|
1219
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1220
|
+
const allowed = set[i].semver;
|
|
1221
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1222
|
+
return true;
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
}
|
|
1226
|
+
return false;
|
|
1227
|
+
}
|
|
1228
|
+
return true;
|
|
1229
|
+
};
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/comparator.js
|
|
1234
|
+
var require_comparator = __commonJS({
|
|
1235
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1236
|
+
var ANY = Symbol("SemVer ANY");
|
|
1237
|
+
var Comparator = class _Comparator {
|
|
1238
|
+
static get ANY() {
|
|
1239
|
+
return ANY;
|
|
1240
|
+
}
|
|
1241
|
+
constructor(comp, options) {
|
|
1242
|
+
options = parseOptions(options);
|
|
1243
|
+
if (comp instanceof _Comparator) {
|
|
1244
|
+
if (comp.loose === !!options.loose) {
|
|
1245
|
+
return comp;
|
|
1246
|
+
} else {
|
|
1247
|
+
comp = comp.value;
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1251
|
+
debug("comparator", comp, options);
|
|
1252
|
+
this.options = options;
|
|
1253
|
+
this.loose = !!options.loose;
|
|
1254
|
+
this.parse(comp);
|
|
1255
|
+
if (this.semver === ANY) {
|
|
1256
|
+
this.value = "";
|
|
1257
|
+
} else {
|
|
1258
|
+
this.value = this.operator + this.semver.version;
|
|
1259
|
+
}
|
|
1260
|
+
debug("comp", this);
|
|
1261
|
+
}
|
|
1262
|
+
parse(comp) {
|
|
1263
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1264
|
+
const m = comp.match(r);
|
|
1265
|
+
if (!m) {
|
|
1266
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1267
|
+
}
|
|
1268
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1269
|
+
if (this.operator === "=") {
|
|
1270
|
+
this.operator = "";
|
|
1271
|
+
}
|
|
1272
|
+
if (!m[2]) {
|
|
1273
|
+
this.semver = ANY;
|
|
1274
|
+
} else {
|
|
1275
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1276
|
+
}
|
|
1277
|
+
}
|
|
1278
|
+
toString() {
|
|
1279
|
+
return this.value;
|
|
1280
|
+
}
|
|
1281
|
+
test(version) {
|
|
1282
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1283
|
+
if (this.semver === ANY || version === ANY) {
|
|
1284
|
+
return true;
|
|
1285
|
+
}
|
|
1286
|
+
if (typeof version === "string") {
|
|
1287
|
+
try {
|
|
1288
|
+
version = new SemVer(version, this.options);
|
|
1289
|
+
} catch (er) {
|
|
1290
|
+
return false;
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1294
|
+
}
|
|
1295
|
+
intersects(comp, options) {
|
|
1296
|
+
if (!(comp instanceof _Comparator)) {
|
|
1297
|
+
throw new TypeError("a Comparator is required");
|
|
1298
|
+
}
|
|
1299
|
+
if (this.operator === "") {
|
|
1300
|
+
if (this.value === "") {
|
|
1301
|
+
return true;
|
|
1302
|
+
}
|
|
1303
|
+
return new Range(comp.value, options).test(this.value);
|
|
1304
|
+
} else if (comp.operator === "") {
|
|
1305
|
+
if (comp.value === "") {
|
|
1306
|
+
return true;
|
|
1307
|
+
}
|
|
1308
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1309
|
+
}
|
|
1310
|
+
options = parseOptions(options);
|
|
1311
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1312
|
+
return false;
|
|
1313
|
+
}
|
|
1314
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1315
|
+
return false;
|
|
1316
|
+
}
|
|
1317
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1318
|
+
return true;
|
|
1319
|
+
}
|
|
1320
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1321
|
+
return true;
|
|
1322
|
+
}
|
|
1323
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1324
|
+
return true;
|
|
1325
|
+
}
|
|
1326
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1327
|
+
return true;
|
|
1328
|
+
}
|
|
1329
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1330
|
+
return true;
|
|
1331
|
+
}
|
|
1332
|
+
return false;
|
|
1333
|
+
}
|
|
1334
|
+
};
|
|
1335
|
+
module.exports = Comparator;
|
|
1336
|
+
var parseOptions = require_parse_options();
|
|
1337
|
+
var { safeRe: re, t } = require_re();
|
|
1338
|
+
var cmp = require_cmp();
|
|
1339
|
+
var debug = require_debug();
|
|
1340
|
+
var SemVer = require_semver();
|
|
1341
|
+
var Range = require_range();
|
|
1342
|
+
}
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/satisfies.js
|
|
1346
|
+
var require_satisfies = __commonJS({
|
|
1347
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1348
|
+
var Range = require_range();
|
|
1349
|
+
var satisfies = (version, range, options) => {
|
|
1350
|
+
try {
|
|
1351
|
+
range = new Range(range, options);
|
|
1352
|
+
} catch (er) {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
return range.test(version);
|
|
1356
|
+
};
|
|
1357
|
+
module.exports = satisfies;
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/to-comparators.js
|
|
1362
|
+
var require_to_comparators = __commonJS({
|
|
1363
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1364
|
+
var Range = require_range();
|
|
1365
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1366
|
+
module.exports = toComparators;
|
|
1367
|
+
}
|
|
1368
|
+
});
|
|
1369
|
+
|
|
1370
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/max-satisfying.js
|
|
1371
|
+
var require_max_satisfying = __commonJS({
|
|
1372
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1373
|
+
var SemVer = require_semver();
|
|
1374
|
+
var Range = require_range();
|
|
1375
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1376
|
+
let max = null;
|
|
1377
|
+
let maxSV = null;
|
|
1378
|
+
let rangeObj = null;
|
|
1379
|
+
try {
|
|
1380
|
+
rangeObj = new Range(range, options);
|
|
1381
|
+
} catch (er) {
|
|
1382
|
+
return null;
|
|
1383
|
+
}
|
|
1384
|
+
versions.forEach((v) => {
|
|
1385
|
+
if (rangeObj.test(v)) {
|
|
1386
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1387
|
+
max = v;
|
|
1388
|
+
maxSV = new SemVer(max, options);
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
});
|
|
1392
|
+
return max;
|
|
1393
|
+
};
|
|
1394
|
+
module.exports = maxSatisfying;
|
|
1395
|
+
}
|
|
1396
|
+
});
|
|
1397
|
+
|
|
1398
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-satisfying.js
|
|
1399
|
+
var require_min_satisfying = __commonJS({
|
|
1400
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1401
|
+
var SemVer = require_semver();
|
|
1402
|
+
var Range = require_range();
|
|
1403
|
+
var minSatisfying = (versions, range, options) => {
|
|
1404
|
+
let min = null;
|
|
1405
|
+
let minSV = null;
|
|
1406
|
+
let rangeObj = null;
|
|
1407
|
+
try {
|
|
1408
|
+
rangeObj = new Range(range, options);
|
|
1409
|
+
} catch (er) {
|
|
1410
|
+
return null;
|
|
1411
|
+
}
|
|
1412
|
+
versions.forEach((v) => {
|
|
1413
|
+
if (rangeObj.test(v)) {
|
|
1414
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1415
|
+
min = v;
|
|
1416
|
+
minSV = new SemVer(min, options);
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
return min;
|
|
1421
|
+
};
|
|
1422
|
+
module.exports = minSatisfying;
|
|
1423
|
+
}
|
|
1424
|
+
});
|
|
1425
|
+
|
|
1426
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-version.js
|
|
1427
|
+
var require_min_version = __commonJS({
|
|
1428
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1429
|
+
var SemVer = require_semver();
|
|
1430
|
+
var Range = require_range();
|
|
1431
|
+
var gt = require_gt();
|
|
1432
|
+
var minVersion = (range, loose) => {
|
|
1433
|
+
range = new Range(range, loose);
|
|
1434
|
+
let minver = new SemVer("0.0.0");
|
|
1435
|
+
if (range.test(minver)) {
|
|
1436
|
+
return minver;
|
|
1437
|
+
}
|
|
1438
|
+
minver = new SemVer("0.0.0-0");
|
|
1439
|
+
if (range.test(minver)) {
|
|
1440
|
+
return minver;
|
|
1441
|
+
}
|
|
1442
|
+
minver = null;
|
|
1443
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1444
|
+
const comparators = range.set[i];
|
|
1445
|
+
let setMin = null;
|
|
1446
|
+
comparators.forEach((comparator) => {
|
|
1447
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1448
|
+
switch (comparator.operator) {
|
|
1449
|
+
case ">":
|
|
1450
|
+
if (compver.prerelease.length === 0) {
|
|
1451
|
+
compver.patch++;
|
|
1452
|
+
} else {
|
|
1453
|
+
compver.prerelease.push(0);
|
|
1454
|
+
}
|
|
1455
|
+
compver.raw = compver.format();
|
|
1456
|
+
/* fallthrough */
|
|
1457
|
+
case "":
|
|
1458
|
+
case ">=":
|
|
1459
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1460
|
+
setMin = compver;
|
|
1461
|
+
}
|
|
1462
|
+
break;
|
|
1463
|
+
case "<":
|
|
1464
|
+
case "<=":
|
|
1465
|
+
break;
|
|
1466
|
+
/* istanbul ignore next */
|
|
1467
|
+
default:
|
|
1468
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1471
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1472
|
+
minver = setMin;
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
if (minver && range.test(minver)) {
|
|
1476
|
+
return minver;
|
|
1477
|
+
}
|
|
1478
|
+
return null;
|
|
1479
|
+
};
|
|
1480
|
+
module.exports = minVersion;
|
|
1481
|
+
}
|
|
1482
|
+
});
|
|
1483
|
+
|
|
1484
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js
|
|
1485
|
+
var require_valid2 = __commonJS({
|
|
1486
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1487
|
+
var Range = require_range();
|
|
1488
|
+
var validRange = (range, options) => {
|
|
1489
|
+
try {
|
|
1490
|
+
return new Range(range, options).range || "*";
|
|
1491
|
+
} catch (er) {
|
|
1492
|
+
return null;
|
|
1493
|
+
}
|
|
1494
|
+
};
|
|
1495
|
+
module.exports = validRange;
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/outside.js
|
|
1500
|
+
var require_outside = __commonJS({
|
|
1501
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1502
|
+
var SemVer = require_semver();
|
|
1503
|
+
var Comparator = require_comparator();
|
|
1504
|
+
var { ANY } = Comparator;
|
|
1505
|
+
var Range = require_range();
|
|
1506
|
+
var satisfies = require_satisfies();
|
|
1507
|
+
var gt = require_gt();
|
|
1508
|
+
var lt = require_lt();
|
|
1509
|
+
var lte = require_lte();
|
|
1510
|
+
var gte = require_gte();
|
|
1511
|
+
var outside = (version, range, hilo, options) => {
|
|
1512
|
+
version = new SemVer(version, options);
|
|
1513
|
+
range = new Range(range, options);
|
|
1514
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1515
|
+
switch (hilo) {
|
|
1516
|
+
case ">":
|
|
1517
|
+
gtfn = gt;
|
|
1518
|
+
ltefn = lte;
|
|
1519
|
+
ltfn = lt;
|
|
1520
|
+
comp = ">";
|
|
1521
|
+
ecomp = ">=";
|
|
1522
|
+
break;
|
|
1523
|
+
case "<":
|
|
1524
|
+
gtfn = lt;
|
|
1525
|
+
ltefn = gte;
|
|
1526
|
+
ltfn = gt;
|
|
1527
|
+
comp = "<";
|
|
1528
|
+
ecomp = "<=";
|
|
1529
|
+
break;
|
|
1530
|
+
default:
|
|
1531
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1532
|
+
}
|
|
1533
|
+
if (satisfies(version, range, options)) {
|
|
1534
|
+
return false;
|
|
1535
|
+
}
|
|
1536
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1537
|
+
const comparators = range.set[i];
|
|
1538
|
+
let high = null;
|
|
1539
|
+
let low = null;
|
|
1540
|
+
comparators.forEach((comparator) => {
|
|
1541
|
+
if (comparator.semver === ANY) {
|
|
1542
|
+
comparator = new Comparator(">=0.0.0");
|
|
1543
|
+
}
|
|
1544
|
+
high = high || comparator;
|
|
1545
|
+
low = low || comparator;
|
|
1546
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1547
|
+
high = comparator;
|
|
1548
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1549
|
+
low = comparator;
|
|
1550
|
+
}
|
|
1551
|
+
});
|
|
1552
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1553
|
+
return false;
|
|
1554
|
+
}
|
|
1555
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1556
|
+
return false;
|
|
1557
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1558
|
+
return false;
|
|
1559
|
+
}
|
|
1560
|
+
}
|
|
1561
|
+
return true;
|
|
1562
|
+
};
|
|
1563
|
+
module.exports = outside;
|
|
1564
|
+
}
|
|
1565
|
+
});
|
|
1566
|
+
|
|
1567
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/gtr.js
|
|
1568
|
+
var require_gtr = __commonJS({
|
|
1569
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1570
|
+
var outside = require_outside();
|
|
1571
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1572
|
+
module.exports = gtr;
|
|
1573
|
+
}
|
|
1574
|
+
});
|
|
1575
|
+
|
|
1576
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/ltr.js
|
|
1577
|
+
var require_ltr = __commonJS({
|
|
1578
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1579
|
+
var outside = require_outside();
|
|
1580
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1581
|
+
module.exports = ltr;
|
|
1582
|
+
}
|
|
1583
|
+
});
|
|
1584
|
+
|
|
1585
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/intersects.js
|
|
1586
|
+
var require_intersects = __commonJS({
|
|
1587
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1588
|
+
var Range = require_range();
|
|
1589
|
+
var intersects = (r1, r2, options) => {
|
|
1590
|
+
r1 = new Range(r1, options);
|
|
1591
|
+
r2 = new Range(r2, options);
|
|
1592
|
+
return r1.intersects(r2, options);
|
|
1593
|
+
};
|
|
1594
|
+
module.exports = intersects;
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
|
|
1598
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/simplify.js
|
|
1599
|
+
var require_simplify = __commonJS({
|
|
1600
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1601
|
+
var satisfies = require_satisfies();
|
|
1602
|
+
var compare = require_compare();
|
|
1603
|
+
module.exports = (versions, range, options) => {
|
|
1604
|
+
const set = [];
|
|
1605
|
+
let first = null;
|
|
1606
|
+
let prev = null;
|
|
1607
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1608
|
+
for (const version of v) {
|
|
1609
|
+
const included2 = satisfies(version, range, options);
|
|
1610
|
+
if (included2) {
|
|
1611
|
+
prev = version;
|
|
1612
|
+
if (!first) {
|
|
1613
|
+
first = version;
|
|
1614
|
+
}
|
|
1615
|
+
} else {
|
|
1616
|
+
if (prev) {
|
|
1617
|
+
set.push([first, prev]);
|
|
1618
|
+
}
|
|
1619
|
+
prev = null;
|
|
1620
|
+
first = null;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
if (first) {
|
|
1624
|
+
set.push([first, null]);
|
|
1625
|
+
}
|
|
1626
|
+
const ranges = [];
|
|
1627
|
+
for (const [min, max] of set) {
|
|
1628
|
+
if (min === max) {
|
|
1629
|
+
ranges.push(min);
|
|
1630
|
+
} else if (!max && min === v[0]) {
|
|
1631
|
+
ranges.push("*");
|
|
1632
|
+
} else if (!max) {
|
|
1633
|
+
ranges.push(`>=${min}`);
|
|
1634
|
+
} else if (min === v[0]) {
|
|
1635
|
+
ranges.push(`<=${max}`);
|
|
1636
|
+
} else {
|
|
1637
|
+
ranges.push(`${min} - ${max}`);
|
|
1638
|
+
}
|
|
1639
|
+
}
|
|
1640
|
+
const simplified = ranges.join(" || ");
|
|
1641
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1642
|
+
return simplified.length < original.length ? simplified : range;
|
|
1643
|
+
};
|
|
1644
|
+
}
|
|
1645
|
+
});
|
|
1646
|
+
|
|
1647
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/subset.js
|
|
1648
|
+
var require_subset = __commonJS({
|
|
1649
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1650
|
+
var Range = require_range();
|
|
1651
|
+
var Comparator = require_comparator();
|
|
1652
|
+
var { ANY } = Comparator;
|
|
1653
|
+
var satisfies = require_satisfies();
|
|
1654
|
+
var compare = require_compare();
|
|
1655
|
+
var subset = (sub, dom, options = {}) => {
|
|
1656
|
+
if (sub === dom) {
|
|
1657
|
+
return true;
|
|
1658
|
+
}
|
|
1659
|
+
sub = new Range(sub, options);
|
|
1660
|
+
dom = new Range(dom, options);
|
|
1661
|
+
let sawNonNull = false;
|
|
1662
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1663
|
+
for (const simpleDom of dom.set) {
|
|
1664
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1665
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1666
|
+
if (isSub) {
|
|
1667
|
+
continue OUTER;
|
|
1668
|
+
}
|
|
1669
|
+
}
|
|
1670
|
+
if (sawNonNull) {
|
|
1671
|
+
return false;
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
return true;
|
|
1675
|
+
};
|
|
1676
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1677
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1678
|
+
var simpleSubset = (sub, dom, options) => {
|
|
1679
|
+
if (sub === dom) {
|
|
1680
|
+
return true;
|
|
1681
|
+
}
|
|
1682
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1683
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1684
|
+
return true;
|
|
1685
|
+
} else if (options.includePrerelease) {
|
|
1686
|
+
sub = minimumVersionWithPreRelease;
|
|
1687
|
+
} else {
|
|
1688
|
+
sub = minimumVersion;
|
|
1689
|
+
}
|
|
1690
|
+
}
|
|
1691
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1692
|
+
if (options.includePrerelease) {
|
|
1693
|
+
return true;
|
|
1694
|
+
} else {
|
|
1695
|
+
dom = minimumVersion;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1699
|
+
let gt, lt;
|
|
1700
|
+
for (const c of sub) {
|
|
1701
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1702
|
+
gt = higherGT(gt, c, options);
|
|
1703
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1704
|
+
lt = lowerLT(lt, c, options);
|
|
1705
|
+
} else {
|
|
1706
|
+
eqSet.add(c.semver);
|
|
1707
|
+
}
|
|
1708
|
+
}
|
|
1709
|
+
if (eqSet.size > 1) {
|
|
1710
|
+
return null;
|
|
1711
|
+
}
|
|
1712
|
+
let gtltComp;
|
|
1713
|
+
if (gt && lt) {
|
|
1714
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1715
|
+
if (gtltComp > 0) {
|
|
1716
|
+
return null;
|
|
1717
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1718
|
+
return null;
|
|
1719
|
+
}
|
|
1720
|
+
}
|
|
1721
|
+
for (const eq of eqSet) {
|
|
1722
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1723
|
+
return null;
|
|
1724
|
+
}
|
|
1725
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1726
|
+
return null;
|
|
1727
|
+
}
|
|
1728
|
+
for (const c of dom) {
|
|
1729
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1730
|
+
return false;
|
|
1731
|
+
}
|
|
1732
|
+
}
|
|
1733
|
+
return true;
|
|
1734
|
+
}
|
|
1735
|
+
let higher, lower;
|
|
1736
|
+
let hasDomLT, hasDomGT;
|
|
1737
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1738
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1739
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1740
|
+
needDomLTPre = false;
|
|
1741
|
+
}
|
|
1742
|
+
for (const c of dom) {
|
|
1743
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1744
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1745
|
+
if (gt) {
|
|
1746
|
+
if (needDomGTPre) {
|
|
1747
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1748
|
+
needDomGTPre = false;
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1752
|
+
higher = higherGT(gt, c, options);
|
|
1753
|
+
if (higher === c && higher !== gt) {
|
|
1754
|
+
return false;
|
|
1755
|
+
}
|
|
1756
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) {
|
|
1757
|
+
return false;
|
|
1758
|
+
}
|
|
1759
|
+
}
|
|
1760
|
+
if (lt) {
|
|
1761
|
+
if (needDomLTPre) {
|
|
1762
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1763
|
+
needDomLTPre = false;
|
|
1764
|
+
}
|
|
1765
|
+
}
|
|
1766
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1767
|
+
lower = lowerLT(lt, c, options);
|
|
1768
|
+
if (lower === c && lower !== lt) {
|
|
1769
|
+
return false;
|
|
1770
|
+
}
|
|
1771
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) {
|
|
1772
|
+
return false;
|
|
1773
|
+
}
|
|
1774
|
+
}
|
|
1775
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1776
|
+
return false;
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1780
|
+
return false;
|
|
1781
|
+
}
|
|
1782
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1783
|
+
return false;
|
|
1784
|
+
}
|
|
1785
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1786
|
+
return false;
|
|
1787
|
+
}
|
|
1788
|
+
return true;
|
|
1789
|
+
};
|
|
1790
|
+
var higherGT = (a, b, options) => {
|
|
1791
|
+
if (!a) {
|
|
1792
|
+
return b;
|
|
1793
|
+
}
|
|
1794
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1795
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1796
|
+
};
|
|
1797
|
+
var lowerLT = (a, b, options) => {
|
|
1798
|
+
if (!a) {
|
|
1799
|
+
return b;
|
|
1800
|
+
}
|
|
1801
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1802
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1803
|
+
};
|
|
1804
|
+
module.exports = subset;
|
|
1805
|
+
}
|
|
1806
|
+
});
|
|
1807
|
+
|
|
1808
|
+
// node_modules/.pnpm/semver@7.6.3/node_modules/semver/index.js
|
|
1809
|
+
var require_semver2 = __commonJS({
|
|
1810
|
+
"node_modules/.pnpm/semver@7.6.3/node_modules/semver/index.js"(exports, module) {
|
|
1811
|
+
var internalRe = require_re();
|
|
1812
|
+
var constants = require_constants();
|
|
1813
|
+
var SemVer = require_semver();
|
|
1814
|
+
var identifiers = require_identifiers();
|
|
1815
|
+
var parse = require_parse();
|
|
1816
|
+
var valid = require_valid();
|
|
1817
|
+
var clean = require_clean();
|
|
1818
|
+
var inc = require_inc();
|
|
1819
|
+
var diff = require_diff();
|
|
1820
|
+
var major = require_major();
|
|
1821
|
+
var minor = require_minor();
|
|
1822
|
+
var patch = require_patch();
|
|
1823
|
+
var prerelease = require_prerelease();
|
|
1824
|
+
var compare = require_compare();
|
|
1825
|
+
var rcompare = require_rcompare();
|
|
1826
|
+
var compareLoose = require_compare_loose();
|
|
1827
|
+
var compareBuild = require_compare_build();
|
|
1828
|
+
var sort = require_sort();
|
|
1829
|
+
var rsort = require_rsort();
|
|
1830
|
+
var gt = require_gt();
|
|
1831
|
+
var lt = require_lt();
|
|
1832
|
+
var eq = require_eq();
|
|
1833
|
+
var neq = require_neq();
|
|
1834
|
+
var gte = require_gte();
|
|
1835
|
+
var lte = require_lte();
|
|
1836
|
+
var cmp = require_cmp();
|
|
1837
|
+
var coerce = require_coerce();
|
|
1838
|
+
var Comparator = require_comparator();
|
|
1839
|
+
var Range = require_range();
|
|
1840
|
+
var satisfies = require_satisfies();
|
|
1841
|
+
var toComparators = require_to_comparators();
|
|
1842
|
+
var maxSatisfying = require_max_satisfying();
|
|
1843
|
+
var minSatisfying = require_min_satisfying();
|
|
1844
|
+
var minVersion = require_min_version();
|
|
1845
|
+
var validRange = require_valid2();
|
|
1846
|
+
var outside = require_outside();
|
|
1847
|
+
var gtr = require_gtr();
|
|
1848
|
+
var ltr = require_ltr();
|
|
1849
|
+
var intersects = require_intersects();
|
|
1850
|
+
var simplifyRange = require_simplify();
|
|
1851
|
+
var subset = require_subset();
|
|
1852
|
+
module.exports = {
|
|
1853
|
+
parse,
|
|
1854
|
+
valid,
|
|
1855
|
+
clean,
|
|
1856
|
+
inc,
|
|
1857
|
+
diff,
|
|
1858
|
+
major,
|
|
1859
|
+
minor,
|
|
1860
|
+
patch,
|
|
1861
|
+
prerelease,
|
|
1862
|
+
compare,
|
|
1863
|
+
rcompare,
|
|
1864
|
+
compareLoose,
|
|
1865
|
+
compareBuild,
|
|
1866
|
+
sort,
|
|
1867
|
+
rsort,
|
|
1868
|
+
gt,
|
|
1869
|
+
lt,
|
|
1870
|
+
eq,
|
|
1871
|
+
neq,
|
|
1872
|
+
gte,
|
|
1873
|
+
lte,
|
|
1874
|
+
cmp,
|
|
1875
|
+
coerce,
|
|
1876
|
+
Comparator,
|
|
1877
|
+
Range,
|
|
1878
|
+
satisfies,
|
|
1879
|
+
toComparators,
|
|
1880
|
+
maxSatisfying,
|
|
1881
|
+
minSatisfying,
|
|
1882
|
+
minVersion,
|
|
1883
|
+
validRange,
|
|
1884
|
+
outside,
|
|
1885
|
+
gtr,
|
|
1886
|
+
ltr,
|
|
1887
|
+
intersects,
|
|
1888
|
+
simplifyRange,
|
|
1889
|
+
subset,
|
|
1890
|
+
SemVer,
|
|
1891
|
+
re: internalRe.re,
|
|
1892
|
+
src: internalRe.src,
|
|
1893
|
+
tokens: internalRe.t,
|
|
1894
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
1895
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
1896
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1897
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1898
|
+
};
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
29
1901
|
var nextDistPath = /(next[\\/]dist[\\/]shared[\\/]lib)|(next[\\/]dist[\\/]client)|(next[\\/]dist[\\/]pages)/;
|
|
30
1902
|
var { loadEnvConfig } = nextEnv.default || nextEnv;
|
|
31
1903
|
async function loadEnvironmentConfig(dir, dev) {
|
|
@@ -872,42 +2744,87 @@ function vitePluginNextImage(nextConfigResolver) {
|
|
|
872
2744
|
}
|
|
873
2745
|
};
|
|
874
2746
|
}
|
|
2747
|
+
|
|
2748
|
+
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
2749
|
+
var import_semver = __toESM(require_semver2());
|
|
875
2750
|
var require5 = createRequire(import.meta.url);
|
|
876
|
-
var
|
|
2751
|
+
var getNextjsVersion = () => require5(scopedResolve("next/package.json")).version;
|
|
2752
|
+
var scopedResolve = (id) => {
|
|
2753
|
+
let scopedModulePath;
|
|
2754
|
+
try {
|
|
2755
|
+
scopedModulePath = require5.resolve(id, { paths: [resolve()] });
|
|
2756
|
+
} catch (e) {
|
|
2757
|
+
scopedModulePath = require5.resolve(id);
|
|
2758
|
+
}
|
|
2759
|
+
const idWithNativePathSep = id.replace(/\//g, sep);
|
|
2760
|
+
if (scopedModulePath.endsWith(idWithNativePathSep)) {
|
|
2761
|
+
return scopedModulePath;
|
|
2762
|
+
}
|
|
2763
|
+
const moduleFolderStrPosition = scopedModulePath.lastIndexOf(idWithNativePathSep);
|
|
2764
|
+
const beginningOfMainScriptPath = moduleFolderStrPosition + id.length;
|
|
2765
|
+
return scopedModulePath.substring(0, beginningOfMainScriptPath);
|
|
2766
|
+
};
|
|
2767
|
+
|
|
2768
|
+
// src/plugins/next-mocks/compatibility/compatibility-map.ts
|
|
2769
|
+
var require6 = createRequire(import.meta.url);
|
|
2770
|
+
var getEntryPoint2 = (subPath, env) => require6.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
2771
|
+
var mapping = (env) => ({
|
|
2772
|
+
"<15.0.0": {
|
|
2773
|
+
"next/dist/server/request/headers": "next/dist/client/components/headers",
|
|
2774
|
+
// this path only exists from Next 15 onwards
|
|
2775
|
+
"next/dist/server/request/draft-mode": getEntryPoint2(
|
|
2776
|
+
"draft-mode.compat",
|
|
2777
|
+
env
|
|
2778
|
+
)
|
|
2779
|
+
}
|
|
2780
|
+
});
|
|
2781
|
+
var getCompatibilityAliases = (env) => {
|
|
2782
|
+
const version = getNextjsVersion();
|
|
2783
|
+
const result = {};
|
|
2784
|
+
const compatMap = mapping(env);
|
|
2785
|
+
Object.keys(compatMap).forEach((key) => {
|
|
2786
|
+
if (import_semver.default.intersects(version, key)) {
|
|
2787
|
+
Object.assign(result, compatMap[key]);
|
|
2788
|
+
}
|
|
2789
|
+
});
|
|
2790
|
+
return result;
|
|
2791
|
+
};
|
|
2792
|
+
|
|
2793
|
+
// src/plugins/next-mocks/plugin.ts
|
|
2794
|
+
var require7 = createRequire(import.meta.url);
|
|
2795
|
+
var getEntryPoint3 = (subPath, env) => require7.resolve(`${VITEST_PLUGIN_NAME}/${env}/mocks/${subPath}`);
|
|
877
2796
|
var getAlias2 = (env) => ({
|
|
878
|
-
"next/headers":
|
|
879
|
-
"@storybook/nextjs/headers.mock":
|
|
880
|
-
"@storybook/nextjs-vite/headers.mock":
|
|
881
|
-
"@storybook/experimental-nextjs-vite/headers.mock":
|
|
2797
|
+
"next/headers": getEntryPoint3("headers", env),
|
|
2798
|
+
"@storybook/nextjs/headers.mock": getEntryPoint3("headers", env),
|
|
2799
|
+
"@storybook/nextjs-vite/headers.mock": getEntryPoint3("headers", env),
|
|
2800
|
+
"@storybook/experimental-nextjs-vite/headers.mock": getEntryPoint3(
|
|
882
2801
|
"headers",
|
|
883
2802
|
env
|
|
884
2803
|
),
|
|
885
|
-
"next/navigation":
|
|
886
|
-
"@storybook/nextjs/navigation.mock":
|
|
887
|
-
"@storybook/nextjs-vite/navigation.mock":
|
|
888
|
-
"@storybook/experimental-nextjs-vite/navigation.mock":
|
|
2804
|
+
"next/navigation": getEntryPoint3("navigation", env),
|
|
2805
|
+
"@storybook/nextjs/navigation.mock": getEntryPoint3("navigation", env),
|
|
2806
|
+
"@storybook/nextjs-vite/navigation.mock": getEntryPoint3("navigation", env),
|
|
2807
|
+
"@storybook/experimental-nextjs-vite/navigation.mock": getEntryPoint3(
|
|
889
2808
|
"navigation",
|
|
890
2809
|
env
|
|
891
2810
|
),
|
|
892
|
-
"next/router":
|
|
893
|
-
"@storybook/nextjs/router.mock":
|
|
894
|
-
"@storybook/nextjs-vite/router.mock":
|
|
895
|
-
"@storybook/experimental-nextjs-vite/router.mock":
|
|
2811
|
+
"next/router": getEntryPoint3("router", env),
|
|
2812
|
+
"@storybook/nextjs/router.mock": getEntryPoint3("router", env),
|
|
2813
|
+
"@storybook/nextjs-vite/router.mock": getEntryPoint3("router", env),
|
|
2814
|
+
"@storybook/experimental-nextjs-vite/router.mock": getEntryPoint3(
|
|
896
2815
|
"router",
|
|
897
2816
|
env
|
|
898
2817
|
),
|
|
899
|
-
"next/cache":
|
|
900
|
-
"@storybook/nextjs/cache.mock":
|
|
901
|
-
"@storybook/nextjs-vite/cache.mock":
|
|
902
|
-
"@storybook/experimental-nextjs-vite/cache.mock":
|
|
903
|
-
"server-only":
|
|
904
|
-
"@opentelemetry/api":
|
|
2818
|
+
"next/cache": getEntryPoint3("cache", env),
|
|
2819
|
+
"@storybook/nextjs/cache.mock": getEntryPoint3("cache", env),
|
|
2820
|
+
"@storybook/nextjs-vite/cache.mock": getEntryPoint3("cache", env),
|
|
2821
|
+
"@storybook/experimental-nextjs-vite/cache.mock": getEntryPoint3("cache", env),
|
|
2822
|
+
"server-only": getEntryPoint3("server-only", env),
|
|
2823
|
+
"@opentelemetry/api": require7.resolve(
|
|
905
2824
|
"next/dist/compiled/@opentelemetry/api"
|
|
906
2825
|
),
|
|
907
|
-
"
|
|
908
|
-
|
|
909
|
-
"styled-jsx": path2.dirname(require5.resolve("styled-jsx/package.json")),
|
|
910
|
-
"next/dynamic": getEntryPoint2("dynamic", env)
|
|
2826
|
+
"next/dynamic": getEntryPoint3("dynamic", env),
|
|
2827
|
+
...getCompatibilityAliases(env)
|
|
911
2828
|
});
|
|
912
2829
|
var vitePluginNextMocks = () => ({
|
|
913
2830
|
name: "vite-plugin-next-mocks",
|
|
@@ -922,7 +2839,7 @@ var vitePluginNextMocks = () => ({
|
|
|
922
2839
|
});
|
|
923
2840
|
|
|
924
2841
|
// src/index.ts
|
|
925
|
-
var
|
|
2842
|
+
var require8 = createRequire(import.meta.url);
|
|
926
2843
|
var loadConfig = (
|
|
927
2844
|
// biome-ignore lint/suspicious/noExplicitAny: CJS support
|
|
928
2845
|
nextServerConfig.default || nextServerConfig
|
|
@@ -944,33 +2861,33 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
944
2861
|
alias: [
|
|
945
2862
|
{
|
|
946
2863
|
find: /^react$/,
|
|
947
|
-
replacement:
|
|
2864
|
+
replacement: require8.resolve("next/dist/compiled/react")
|
|
948
2865
|
},
|
|
949
2866
|
{
|
|
950
2867
|
find: /^react-dom$/,
|
|
951
|
-
replacement:
|
|
2868
|
+
replacement: require8.resolve("next/dist/compiled/react-dom")
|
|
952
2869
|
},
|
|
953
2870
|
{
|
|
954
2871
|
find: /^react-dom\/server$/,
|
|
955
|
-
replacement:
|
|
2872
|
+
replacement: require8.resolve(
|
|
956
2873
|
"next/dist/compiled/react-dom/server.browser.js"
|
|
957
2874
|
)
|
|
958
2875
|
},
|
|
959
2876
|
{
|
|
960
2877
|
find: /^react-dom\/test-utils$/,
|
|
961
|
-
replacement:
|
|
2878
|
+
replacement: require8.resolve(
|
|
962
2879
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
963
2880
|
)
|
|
964
2881
|
},
|
|
965
2882
|
{
|
|
966
2883
|
find: /^react-dom\/client$/,
|
|
967
|
-
replacement:
|
|
2884
|
+
replacement: require8.resolve(
|
|
968
2885
|
"next/dist/compiled/react-dom/client.js"
|
|
969
2886
|
)
|
|
970
2887
|
},
|
|
971
2888
|
{
|
|
972
2889
|
find: /^react-dom\/cjs\/react-dom\.development\.js$/,
|
|
973
|
-
replacement:
|
|
2890
|
+
replacement: require8.resolve(
|
|
974
2891
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
975
2892
|
)
|
|
976
2893
|
}
|
|
@@ -990,26 +2907,26 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
990
2907
|
},
|
|
991
2908
|
test: {
|
|
992
2909
|
alias: {
|
|
993
|
-
"react/jsx-dev-runtime":
|
|
2910
|
+
"react/jsx-dev-runtime": require8.resolve(
|
|
994
2911
|
"next/dist/compiled/react/jsx-dev-runtime.js"
|
|
995
2912
|
),
|
|
996
|
-
"react/jsx-runtime":
|
|
2913
|
+
"react/jsx-runtime": require8.resolve(
|
|
997
2914
|
"next/dist/compiled/react/jsx-runtime.js"
|
|
998
2915
|
),
|
|
999
|
-
react:
|
|
1000
|
-
"react-dom/server":
|
|
2916
|
+
react: require8.resolve("next/dist/compiled/react"),
|
|
2917
|
+
"react-dom/server": require8.resolve(
|
|
1001
2918
|
executionEnvironment === "node" ? "next/dist/compiled/react-dom/server.js" : "next/dist/compiled/react-dom/server.browser.js"
|
|
1002
2919
|
),
|
|
1003
|
-
"react-dom/test-utils":
|
|
2920
|
+
"react-dom/test-utils": require8.resolve(
|
|
1004
2921
|
"next/dist/compiled/react-dom/cjs/react-dom-test-utils.production.js"
|
|
1005
2922
|
),
|
|
1006
|
-
"react-dom/cjs/react-dom.development.js":
|
|
2923
|
+
"react-dom/cjs/react-dom.development.js": require8.resolve(
|
|
1007
2924
|
"next/dist/compiled/react-dom/cjs/react-dom.development.js"
|
|
1008
2925
|
),
|
|
1009
|
-
"react-dom/client":
|
|
2926
|
+
"react-dom/client": require8.resolve(
|
|
1010
2927
|
"next/dist/compiled/react-dom/client.js"
|
|
1011
2928
|
),
|
|
1012
|
-
"react-dom":
|
|
2929
|
+
"react-dom": require8.resolve("next/dist/compiled/react-dom")
|
|
1013
2930
|
}
|
|
1014
2931
|
}
|
|
1015
2932
|
};
|
|
@@ -1017,7 +2934,7 @@ function VitePlugin({ dir = process.cwd() } = {}) {
|
|
|
1017
2934
|
configResolved(config) {
|
|
1018
2935
|
if (isVitestEnv && !config.test?.browser?.enabled) {
|
|
1019
2936
|
config.test.setupFiles = [
|
|
1020
|
-
|
|
2937
|
+
require8.resolve("./mocks/storybook.global.js"),
|
|
1021
2938
|
...config.test?.setupFiles ?? []
|
|
1022
2939
|
];
|
|
1023
2940
|
}
|