@storybook/addon-vitest 0.0.0-pr-31819-sha-ce979aac → 0.0.0-pr-32207-sha-0c91842b

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.
Files changed (41) hide show
  1. package/dist/chunk-55WZLVGN.mjs +11 -0
  2. package/dist/chunk-JKRQGT2U.mjs +10 -0
  3. package/dist/index.js +6 -9
  4. package/dist/index.mjs +5 -0
  5. package/dist/manager.js +8 -7516
  6. package/dist/node/coverage-reporter.d.ts +184 -0
  7. package/dist/node/coverage-reporter.js +4 -1898
  8. package/dist/node/coverage-reporter.mjs +12 -0
  9. package/dist/node/vitest.d.ts +2 -0
  10. package/dist/node/vitest.js +17 -740
  11. package/dist/node/vitest.mjs +19 -0
  12. package/dist/postinstall.js +88 -2076
  13. package/dist/preset.js +31 -360
  14. package/dist/vitest-plugin/global-setup.d.ts +6 -0
  15. package/dist/vitest-plugin/global-setup.js +6 -200
  16. package/dist/vitest-plugin/global-setup.mjs +13 -0
  17. package/dist/vitest-plugin/index.js +43 -3823
  18. package/dist/vitest-plugin/index.mjs +28 -0
  19. package/dist/vitest-plugin/setup-file.d.ts +14 -0
  20. package/dist/vitest-plugin/setup-file.js +8 -30
  21. package/dist/vitest-plugin/setup-file.mjs +9 -0
  22. package/dist/vitest-plugin/test-utils.d.ts +20 -0
  23. package/dist/vitest-plugin/test-utils.js +8 -102
  24. package/dist/vitest-plugin/test-utils.mjs +8 -0
  25. package/manager.js +1 -1
  26. package/manager.mjs +1 -0
  27. package/package.json +89 -16
  28. package/postinstall.js +1 -0
  29. package/postinstall.mjs +1 -0
  30. package/preset.js +1 -1
  31. package/preset.mjs +1 -0
  32. package/dist/_browser-chunks/chunk-JFJ5UJ7Q.js +0 -11
  33. package/dist/_browser-chunks/chunk-PMYV6BH2.js +0 -76
  34. package/dist/_node-chunks/chunk-D4CVZ2A5.js +0 -6873
  35. package/dist/_node-chunks/chunk-FR6PHJQR.js +0 -103
  36. package/dist/_node-chunks/chunk-JLLE6IPH.js +0 -2264
  37. package/dist/_node-chunks/chunk-KEKT6COE.js +0 -55
  38. package/dist/_node-chunks/chunk-P3GZWY77.js +0 -481
  39. package/dist/_node-chunks/chunk-PGWYH2KL.js +0 -247
  40. package/dist/_node-chunks/chunk-Y3OYEWER.js +0 -295
  41. package/dist/_node-chunks/chunk-ZMZQPT42.js +0 -91
@@ -1,55 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_swf2eloes58 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_swf2eloes58 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_swf2eloes58 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_swf2eloes58.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_swf2eloes58.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_swf2eloes58.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- var __create = Object.create;
13
- var __defProp = Object.defineProperty;
14
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
15
- var __getOwnPropNames = Object.getOwnPropertyNames;
16
- var __getProtoOf = Object.getPrototypeOf;
17
- var __hasOwnProp = Object.prototype.hasOwnProperty;
18
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
19
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
20
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
21
- }) : x)(function(x) {
22
- if (typeof require !== "undefined") return require.apply(this, arguments);
23
- throw Error('Dynamic require of "' + x + '" is not supported');
24
- });
25
- var __commonJS = (cb, mod) => function __require2() {
26
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
27
- };
28
- var __export = (target, all) => {
29
- for (var name in all)
30
- __defProp(target, name, { get: all[name], enumerable: true });
31
- };
32
- var __copyProps = (to, from, except, desc) => {
33
- if (from && typeof from === "object" || typeof from === "function") {
34
- for (let key of __getOwnPropNames(from))
35
- if (!__hasOwnProp.call(to, key) && key !== except)
36
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
37
- }
38
- return to;
39
- };
40
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
41
- // If the importer is in node compatibility mode or this is not an ESM
42
- // file that has been converted to a CommonJS file using a Babel-
43
- // compatible transform (i.e. "__esModule" has not been set), then set
44
- // "default" to the CommonJS "module.exports" for node compatibility.
45
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
46
- mod
47
- ));
48
-
49
- export {
50
- __name,
51
- __require,
52
- __commonJS,
53
- __export,
54
- __toESM
55
- };
@@ -1,481 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_swf2eloes58 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_swf2eloes58 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_swf2eloes58 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_swf2eloes58.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_swf2eloes58.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_swf2eloes58.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __commonJS,
14
- __name
15
- } from "./chunk-KEKT6COE.js";
16
-
17
- // ../../node_modules/semver/internal/constants.js
18
- var require_constants = __commonJS({
19
- "../../node_modules/semver/internal/constants.js"(exports, module) {
20
- "use strict";
21
- var SEMVER_SPEC_VERSION = "2.0.0";
22
- var MAX_LENGTH = 256;
23
- var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
24
- 9007199254740991;
25
- var MAX_SAFE_COMPONENT_LENGTH = 16;
26
- var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
27
- var RELEASE_TYPES = [
28
- "major",
29
- "premajor",
30
- "minor",
31
- "preminor",
32
- "patch",
33
- "prepatch",
34
- "prerelease"
35
- ];
36
- module.exports = {
37
- MAX_LENGTH,
38
- MAX_SAFE_COMPONENT_LENGTH,
39
- MAX_SAFE_BUILD_LENGTH,
40
- MAX_SAFE_INTEGER,
41
- RELEASE_TYPES,
42
- SEMVER_SPEC_VERSION,
43
- FLAG_INCLUDE_PRERELEASE: 1,
44
- FLAG_LOOSE: 2
45
- };
46
- }
47
- });
48
-
49
- // ../../node_modules/semver/internal/debug.js
50
- var require_debug = __commonJS({
51
- "../../node_modules/semver/internal/debug.js"(exports, module) {
52
- "use strict";
53
- var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
54
- };
55
- module.exports = debug;
56
- }
57
- });
58
-
59
- // ../../node_modules/semver/internal/re.js
60
- var require_re = __commonJS({
61
- "../../node_modules/semver/internal/re.js"(exports, module) {
62
- "use strict";
63
- var {
64
- MAX_SAFE_COMPONENT_LENGTH,
65
- MAX_SAFE_BUILD_LENGTH,
66
- MAX_LENGTH
67
- } = require_constants();
68
- var debug = require_debug();
69
- exports = module.exports = {};
70
- var re = exports.re = [];
71
- var safeRe = exports.safeRe = [];
72
- var src = exports.src = [];
73
- var safeSrc = exports.safeSrc = [];
74
- var t = exports.t = {};
75
- var R = 0;
76
- var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
77
- var safeRegexReplacements = [
78
- ["\\s", 1],
79
- ["\\d", MAX_LENGTH],
80
- [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
81
- ];
82
- var makeSafeRegex = /* @__PURE__ */ __name((value) => {
83
- for (const [token, max] of safeRegexReplacements) {
84
- value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
85
- }
86
- return value;
87
- }, "makeSafeRegex");
88
- var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
89
- const safe = makeSafeRegex(value);
90
- const index = R++;
91
- debug(name, index, value);
92
- t[name] = index;
93
- src[index] = value;
94
- safeSrc[index] = safe;
95
- re[index] = new RegExp(value, isGlobal ? "g" : void 0);
96
- safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
97
- }, "createToken");
98
- createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
99
- createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
100
- createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
101
- createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
102
- createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
103
- createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
104
- createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
105
- createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
106
- createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
107
- createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
108
- createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
109
- createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
110
- createToken("FULL", `^${src[t.FULLPLAIN]}$`);
111
- createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
112
- createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
113
- createToken("GTLT", "((?:<|>)?=?)");
114
- createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
115
- createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
116
- createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
117
- createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
118
- createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
119
- createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
120
- createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
121
- createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
122
- createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
123
- createToken("COERCERTL", src[t.COERCE], true);
124
- createToken("COERCERTLFULL", src[t.COERCEFULL], true);
125
- createToken("LONETILDE", "(?:~>?)");
126
- createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
127
- exports.tildeTrimReplace = "$1~";
128
- createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
129
- createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
130
- createToken("LONECARET", "(?:\\^)");
131
- createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
132
- exports.caretTrimReplace = "$1^";
133
- createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
134
- createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
135
- createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
136
- createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
137
- createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
138
- exports.comparatorTrimReplace = "$1$2$3";
139
- createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
140
- createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
141
- createToken("STAR", "(<|>)?=?\\s*\\*");
142
- createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
143
- createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
144
- }
145
- });
146
-
147
- // ../../node_modules/semver/internal/identifiers.js
148
- var require_identifiers = __commonJS({
149
- "../../node_modules/semver/internal/identifiers.js"(exports, module) {
150
- "use strict";
151
- var numeric = /^[0-9]+$/;
152
- var compareIdentifiers = /* @__PURE__ */ __name((a, b) => {
153
- const anum = numeric.test(a);
154
- const bnum = numeric.test(b);
155
- if (anum && bnum) {
156
- a = +a;
157
- b = +b;
158
- }
159
- return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
160
- }, "compareIdentifiers");
161
- var rcompareIdentifiers = /* @__PURE__ */ __name((a, b) => compareIdentifiers(b, a), "rcompareIdentifiers");
162
- module.exports = {
163
- compareIdentifiers,
164
- rcompareIdentifiers
165
- };
166
- }
167
- });
168
-
169
- // ../../node_modules/semver/internal/parse-options.js
170
- var require_parse_options = __commonJS({
171
- "../../node_modules/semver/internal/parse-options.js"(exports, module) {
172
- "use strict";
173
- var looseOption = Object.freeze({ loose: true });
174
- var emptyOpts = Object.freeze({});
175
- var parseOptions = /* @__PURE__ */ __name((options) => {
176
- if (!options) {
177
- return emptyOpts;
178
- }
179
- if (typeof options !== "object") {
180
- return looseOption;
181
- }
182
- return options;
183
- }, "parseOptions");
184
- module.exports = parseOptions;
185
- }
186
- });
187
-
188
- // ../../node_modules/semver/classes/semver.js
189
- var require_semver = __commonJS({
190
- "../../node_modules/semver/classes/semver.js"(exports, module) {
191
- "use strict";
192
- var debug = require_debug();
193
- var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
194
- var { safeRe: re, t } = require_re();
195
- var parseOptions = require_parse_options();
196
- var { compareIdentifiers } = require_identifiers();
197
- var SemVer = class _SemVer {
198
- static {
199
- __name(this, "SemVer");
200
- }
201
- constructor(version, options) {
202
- options = parseOptions(options);
203
- if (version instanceof _SemVer) {
204
- if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
205
- return version;
206
- } else {
207
- version = version.version;
208
- }
209
- } else if (typeof version !== "string") {
210
- throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
211
- }
212
- if (version.length > MAX_LENGTH) {
213
- throw new TypeError(
214
- `version is longer than ${MAX_LENGTH} characters`
215
- );
216
- }
217
- debug("SemVer", version, options);
218
- this.options = options;
219
- this.loose = !!options.loose;
220
- this.includePrerelease = !!options.includePrerelease;
221
- const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
222
- if (!m) {
223
- throw new TypeError(`Invalid Version: ${version}`);
224
- }
225
- this.raw = version;
226
- this.major = +m[1];
227
- this.minor = +m[2];
228
- this.patch = +m[3];
229
- if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
230
- throw new TypeError("Invalid major version");
231
- }
232
- if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
233
- throw new TypeError("Invalid minor version");
234
- }
235
- if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
236
- throw new TypeError("Invalid patch version");
237
- }
238
- if (!m[4]) {
239
- this.prerelease = [];
240
- } else {
241
- this.prerelease = m[4].split(".").map((id) => {
242
- if (/^[0-9]+$/.test(id)) {
243
- const num = +id;
244
- if (num >= 0 && num < MAX_SAFE_INTEGER) {
245
- return num;
246
- }
247
- }
248
- return id;
249
- });
250
- }
251
- this.build = m[5] ? m[5].split(".") : [];
252
- this.format();
253
- }
254
- format() {
255
- this.version = `${this.major}.${this.minor}.${this.patch}`;
256
- if (this.prerelease.length) {
257
- this.version += `-${this.prerelease.join(".")}`;
258
- }
259
- return this.version;
260
- }
261
- toString() {
262
- return this.version;
263
- }
264
- compare(other) {
265
- debug("SemVer.compare", this.version, this.options, other);
266
- if (!(other instanceof _SemVer)) {
267
- if (typeof other === "string" && other === this.version) {
268
- return 0;
269
- }
270
- other = new _SemVer(other, this.options);
271
- }
272
- if (other.version === this.version) {
273
- return 0;
274
- }
275
- return this.compareMain(other) || this.comparePre(other);
276
- }
277
- compareMain(other) {
278
- if (!(other instanceof _SemVer)) {
279
- other = new _SemVer(other, this.options);
280
- }
281
- return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
282
- }
283
- comparePre(other) {
284
- if (!(other instanceof _SemVer)) {
285
- other = new _SemVer(other, this.options);
286
- }
287
- if (this.prerelease.length && !other.prerelease.length) {
288
- return -1;
289
- } else if (!this.prerelease.length && other.prerelease.length) {
290
- return 1;
291
- } else if (!this.prerelease.length && !other.prerelease.length) {
292
- return 0;
293
- }
294
- let i = 0;
295
- do {
296
- const a = this.prerelease[i];
297
- const b = other.prerelease[i];
298
- debug("prerelease compare", i, a, b);
299
- if (a === void 0 && b === void 0) {
300
- return 0;
301
- } else if (b === void 0) {
302
- return 1;
303
- } else if (a === void 0) {
304
- return -1;
305
- } else if (a === b) {
306
- continue;
307
- } else {
308
- return compareIdentifiers(a, b);
309
- }
310
- } while (++i);
311
- }
312
- compareBuild(other) {
313
- if (!(other instanceof _SemVer)) {
314
- other = new _SemVer(other, this.options);
315
- }
316
- let i = 0;
317
- do {
318
- const a = this.build[i];
319
- const b = other.build[i];
320
- debug("build compare", i, a, b);
321
- if (a === void 0 && b === void 0) {
322
- return 0;
323
- } else if (b === void 0) {
324
- return 1;
325
- } else if (a === void 0) {
326
- return -1;
327
- } else if (a === b) {
328
- continue;
329
- } else {
330
- return compareIdentifiers(a, b);
331
- }
332
- } while (++i);
333
- }
334
- // preminor will bump the version up to the next minor release, and immediately
335
- // down to pre-release. premajor and prepatch work the same way.
336
- inc(release, identifier, identifierBase) {
337
- if (release.startsWith("pre")) {
338
- if (!identifier && identifierBase === false) {
339
- throw new Error("invalid increment argument: identifier is empty");
340
- }
341
- if (identifier) {
342
- const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
343
- if (!match || match[1] !== identifier) {
344
- throw new Error(`invalid identifier: ${identifier}`);
345
- }
346
- }
347
- }
348
- switch (release) {
349
- case "premajor":
350
- this.prerelease.length = 0;
351
- this.patch = 0;
352
- this.minor = 0;
353
- this.major++;
354
- this.inc("pre", identifier, identifierBase);
355
- break;
356
- case "preminor":
357
- this.prerelease.length = 0;
358
- this.patch = 0;
359
- this.minor++;
360
- this.inc("pre", identifier, identifierBase);
361
- break;
362
- case "prepatch":
363
- this.prerelease.length = 0;
364
- this.inc("patch", identifier, identifierBase);
365
- this.inc("pre", identifier, identifierBase);
366
- break;
367
- // If the input is a non-prerelease version, this acts the same as
368
- // prepatch.
369
- case "prerelease":
370
- if (this.prerelease.length === 0) {
371
- this.inc("patch", identifier, identifierBase);
372
- }
373
- this.inc("pre", identifier, identifierBase);
374
- break;
375
- case "release":
376
- if (this.prerelease.length === 0) {
377
- throw new Error(`version ${this.raw} is not a prerelease`);
378
- }
379
- this.prerelease.length = 0;
380
- break;
381
- case "major":
382
- if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
383
- this.major++;
384
- }
385
- this.minor = 0;
386
- this.patch = 0;
387
- this.prerelease = [];
388
- break;
389
- case "minor":
390
- if (this.patch !== 0 || this.prerelease.length === 0) {
391
- this.minor++;
392
- }
393
- this.patch = 0;
394
- this.prerelease = [];
395
- break;
396
- case "patch":
397
- if (this.prerelease.length === 0) {
398
- this.patch++;
399
- }
400
- this.prerelease = [];
401
- break;
402
- // This probably shouldn't be used publicly.
403
- // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
404
- case "pre": {
405
- const base = Number(identifierBase) ? 1 : 0;
406
- if (this.prerelease.length === 0) {
407
- this.prerelease = [base];
408
- } else {
409
- let i = this.prerelease.length;
410
- while (--i >= 0) {
411
- if (typeof this.prerelease[i] === "number") {
412
- this.prerelease[i]++;
413
- i = -2;
414
- }
415
- }
416
- if (i === -1) {
417
- if (identifier === this.prerelease.join(".") && identifierBase === false) {
418
- throw new Error("invalid increment argument: identifier already exists");
419
- }
420
- this.prerelease.push(base);
421
- }
422
- }
423
- if (identifier) {
424
- let prerelease = [identifier, base];
425
- if (identifierBase === false) {
426
- prerelease = [identifier];
427
- }
428
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
429
- if (isNaN(this.prerelease[1])) {
430
- this.prerelease = prerelease;
431
- }
432
- } else {
433
- this.prerelease = prerelease;
434
- }
435
- }
436
- break;
437
- }
438
- default:
439
- throw new Error(`invalid increment argument: ${release}`);
440
- }
441
- this.raw = this.format();
442
- if (this.build.length) {
443
- this.raw += `+${this.build.join(".")}`;
444
- }
445
- return this;
446
- }
447
- };
448
- module.exports = SemVer;
449
- }
450
- });
451
-
452
- // ../../node_modules/semver/functions/compare.js
453
- var require_compare = __commonJS({
454
- "../../node_modules/semver/functions/compare.js"(exports, module) {
455
- "use strict";
456
- var SemVer = require_semver();
457
- var compare = /* @__PURE__ */ __name((a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose)), "compare");
458
- module.exports = compare;
459
- }
460
- });
461
-
462
- // ../../node_modules/semver/functions/gte.js
463
- var require_gte = __commonJS({
464
- "../../node_modules/semver/functions/gte.js"(exports, module) {
465
- "use strict";
466
- var compare = require_compare();
467
- var gte = /* @__PURE__ */ __name((a, b, loose) => compare(a, b, loose) >= 0, "gte");
468
- module.exports = gte;
469
- }
470
- });
471
-
472
- export {
473
- require_constants,
474
- require_debug,
475
- require_re,
476
- require_parse_options,
477
- require_identifiers,
478
- require_semver,
479
- require_compare,
480
- require_gte
481
- };