@voidzero-dev/vite-plus-core 0.0.0-0bfcc90f.20260209-0731
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/LICENSE +41 -0
- package/dist/pluginutils/filter/composable-filters.d.ts +90 -0
- package/dist/pluginutils/filter/composable-filters.js +256 -0
- package/dist/pluginutils/filter/filter-vite-plugins.d.ts +28 -0
- package/dist/pluginutils/filter/filter-vite-plugins.js +75 -0
- package/dist/pluginutils/filter/index.d.ts +3 -0
- package/dist/pluginutils/filter/index.js +3 -0
- package/dist/pluginutils/filter/simple-filters.d.ts +71 -0
- package/dist/pluginutils/filter/simple-filters.js +70 -0
- package/dist/pluginutils/index.d.ts +1 -0
- package/dist/pluginutils/index.js +1 -0
- package/dist/pluginutils/utils.d.ts +2 -0
- package/dist/pluginutils/utils.js +17 -0
- package/dist/rolldown/cli-setup.d.mts +1 -0
- package/dist/rolldown/cli-setup.mjs +17 -0
- package/dist/rolldown/cli.d.mts +1 -0
- package/dist/rolldown/cli.mjs +608 -0
- package/dist/rolldown/config.d.mts +7 -0
- package/dist/rolldown/config.mjs +10 -0
- package/dist/rolldown/experimental-index.d.mts +194 -0
- package/dist/rolldown/experimental-index.mjs +291 -0
- package/dist/rolldown/experimental-runtime-types.d.ts +98 -0
- package/dist/rolldown/filter-index.d.mts +197 -0
- package/dist/rolldown/filter-index.mjs +369 -0
- package/dist/rolldown/get-log-filter.d.mts +7 -0
- package/dist/rolldown/get-log-filter.mjs +47 -0
- package/dist/rolldown/index.d.mts +4 -0
- package/dist/rolldown/index.mjs +57 -0
- package/dist/rolldown/parallel-plugin-worker.d.mts +1 -0
- package/dist/rolldown/parallel-plugin-worker.mjs +32 -0
- package/dist/rolldown/parallel-plugin.d.mts +14 -0
- package/dist/rolldown/parallel-plugin.mjs +7 -0
- package/dist/rolldown/parse-ast-index.d.mts +8 -0
- package/dist/rolldown/parse-ast-index.mjs +47 -0
- package/dist/rolldown/plugins-index.d.mts +30 -0
- package/dist/rolldown/plugins-index.mjs +40 -0
- package/dist/rolldown/shared/binding-D-XMzSaG.d.mts +1665 -0
- package/dist/rolldown/shared/binding-DuOSzYPt.mjs +587 -0
- package/dist/rolldown/shared/bindingify-input-options-Bu6nUTgS.mjs +2257 -0
- package/dist/rolldown/shared/constructors-DZVRHTli.mjs +61 -0
- package/dist/rolldown/shared/constructors-KD7LvxpN.d.mts +28 -0
- package/dist/rolldown/shared/define-config-BVG4QvnP.mjs +7 -0
- package/dist/rolldown/shared/define-config-U4pj0ZDn.d.mts +3616 -0
- package/dist/rolldown/shared/load-config-O1K_tT_z.mjs +114 -0
- package/dist/rolldown/shared/logging-CE90D8JR.d.mts +50 -0
- package/dist/rolldown/shared/logs-NH298mHo.mjs +183 -0
- package/dist/rolldown/shared/misc-CCZIsXVO.mjs +22 -0
- package/dist/rolldown/shared/normalize-string-or-regex-DeZqg15i.mjs +61 -0
- package/dist/rolldown/shared/parse-DLraxqjd.mjs +56 -0
- package/dist/rolldown/shared/prompt-DeISmFRp.mjs +847 -0
- package/dist/rolldown/shared/rolldown-O0UKbTKf.mjs +42 -0
- package/dist/rolldown/shared/rolldown-build-BIs7C4B_.mjs +3354 -0
- package/dist/rolldown/shared/watch-DQXGaDjx.mjs +379 -0
- package/dist/tsdown/build-l5WhXg4M-BBPqZr0m.js +4933 -0
- package/dist/tsdown/chunk-CdeBBKNj.js +44 -0
- package/dist/tsdown/debug-Cb_Nqpo4-BueIRvg1.js +18 -0
- package/dist/tsdown/detect-CCATtVj7-B86m8IqW.js +165 -0
- package/dist/tsdown/dist-BUOkzr_P.js +201 -0
- package/dist/tsdown/dist-BVMGwPdF.js +32363 -0
- package/dist/tsdown/dist-dc0X0G6b.js +742 -0
- package/dist/tsdown/filename-7rlgePeo.js +31 -0
- package/dist/tsdown/index-node-BjDys8jy--sqPE5mM.js +251 -0
- package/dist/tsdown/index-types.d.ts +2163 -0
- package/dist/tsdown/index.js +14 -0
- package/dist/tsdown/main-d9yZSQqW.js +926 -0
- package/dist/tsdown/node-Cb5OsnKg.js +271 -0
- package/dist/tsdown/npm_cjs_chunk_chunk.cjs +11 -0
- package/dist/tsdown/npm_cjs_chunk_range.cjs +484 -0
- package/dist/tsdown/npm_cjs_chunk_semver.cjs +362 -0
- package/dist/tsdown/npm_entry_picomatch.cjs +1676 -0
- package/dist/tsdown/npm_entry_semver_functions_coerce.cjs +52 -0
- package/dist/tsdown/npm_entry_semver_functions_satisfies.cjs +23 -0
- package/dist/tsdown/npm_entry_semver_ranges_min-version.cjs +48 -0
- package/dist/tsdown/npm_entry_tree-kill.cjs +103 -0
- package/dist/tsdown/resolver-j7HY1N36-CIu_7LX6.js +20 -0
- package/dist/tsdown/run.js +537 -0
- package/dist/tsdown/tsc-context-BNYuT3cE.js +25 -0
- package/dist/tsdown/tsc-reo6aLWc.js +423 -0
- package/dist/vite/client/client.mjs +1140 -0
- package/dist/vite/client/env.mjs +19 -0
- package/dist/vite/client.d.ts +279 -0
- package/dist/vite/misc/false.d.ts +2 -0
- package/dist/vite/misc/false.js +1 -0
- package/dist/vite/misc/true.d.ts +2 -0
- package/dist/vite/misc/true.js +1 -0
- package/dist/vite/node/chunks/build2.js +5538 -0
- package/dist/vite/node/chunks/chunk.js +45 -0
- package/dist/vite/node/chunks/dist.js +6758 -0
- package/dist/vite/node/chunks/dist2.js +6651 -0
- package/dist/vite/node/chunks/fetchableEnvironments.js +41395 -0
- package/dist/vite/node/chunks/lib.js +377 -0
- package/dist/vite/node/chunks/logger.js +332 -0
- package/dist/vite/node/chunks/moduleRunnerTransport.d.ts +96 -0
- package/dist/vite/node/chunks/postcss-import.js +479 -0
- package/dist/vite/node/cli.js +699 -0
- package/dist/vite/node/index.d.ts +3807 -0
- package/dist/vite/node/index.js +15 -0
- package/dist/vite/node/internal.d.ts +2 -0
- package/dist/vite/node/internal.js +3 -0
- package/dist/vite/node/module-runner.d.ts +311 -0
- package/dist/vite/node/module-runner.js +1159 -0
- package/dist/vite/types/customEvent.d.ts +52 -0
- package/dist/vite/types/hmrPayload.d.ts +80 -0
- package/dist/vite/types/hot.d.ts +39 -0
- package/dist/vite/types/import-meta.d.ts +5 -0
- package/dist/vite/types/importGlob.d.ts +89 -0
- package/dist/vite/types/importMeta.d.ts +30 -0
- package/dist/vite/types/internal/cssPreprocessorOptions.d.ts +44 -0
- package/dist/vite/types/internal/esbuildOptions.d.ts +28 -0
- package/dist/vite/types/internal/lightningcssOptions.d.ts +18 -0
- package/dist/vite/types/internal/rollupTypeCompat.d.ts +24 -0
- package/dist/vite/types/internal/terserOptions.d.ts +11 -0
- package/dist/vite/types/metadata.d.ts +47 -0
- package/package.json +204 -0
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
const require_chunk = require('./npm_cjs_chunk_chunk.cjs');
|
|
2
|
+
|
|
3
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
|
|
4
|
+
var require_debug = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
5
|
+
const debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
6
|
+
module.exports = debug;
|
|
7
|
+
}));
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
|
|
11
|
+
var require_constants = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
12
|
+
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
13
|
+
const MAX_LENGTH = 256;
|
|
14
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
15
|
+
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
16
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
17
|
+
const RELEASE_TYPES = [
|
|
18
|
+
"major",
|
|
19
|
+
"premajor",
|
|
20
|
+
"minor",
|
|
21
|
+
"preminor",
|
|
22
|
+
"patch",
|
|
23
|
+
"prepatch",
|
|
24
|
+
"prerelease"
|
|
25
|
+
];
|
|
26
|
+
module.exports = {
|
|
27
|
+
MAX_LENGTH,
|
|
28
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
29
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
30
|
+
MAX_SAFE_INTEGER,
|
|
31
|
+
RELEASE_TYPES,
|
|
32
|
+
SEMVER_SPEC_VERSION,
|
|
33
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
34
|
+
FLAG_LOOSE: 2
|
|
35
|
+
};
|
|
36
|
+
}));
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
|
|
40
|
+
var require_re = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
41
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
42
|
+
const debug = require_debug();
|
|
43
|
+
exports = module.exports = {};
|
|
44
|
+
const re = exports.re = [];
|
|
45
|
+
const safeRe = exports.safeRe = [];
|
|
46
|
+
const src = exports.src = [];
|
|
47
|
+
const safeSrc = exports.safeSrc = [];
|
|
48
|
+
const t = exports.t = {};
|
|
49
|
+
let R = 0;
|
|
50
|
+
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
51
|
+
const safeRegexReplacements = [
|
|
52
|
+
["\\s", 1],
|
|
53
|
+
["\\d", MAX_LENGTH],
|
|
54
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
55
|
+
];
|
|
56
|
+
const makeSafeRegex = (value) => {
|
|
57
|
+
for (const [token, max] of safeRegexReplacements) value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
58
|
+
return value;
|
|
59
|
+
};
|
|
60
|
+
const createToken = (name, value, isGlobal) => {
|
|
61
|
+
const safe = makeSafeRegex(value);
|
|
62
|
+
const index = R++;
|
|
63
|
+
debug(name, index, value);
|
|
64
|
+
t[name] = index;
|
|
65
|
+
src[index] = value;
|
|
66
|
+
safeSrc[index] = safe;
|
|
67
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
68
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
69
|
+
};
|
|
70
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
71
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
72
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
73
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
74
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
75
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
76
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
77
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
78
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
79
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
80
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
81
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
82
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
83
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
84
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
85
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
86
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
87
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
88
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
89
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
90
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
91
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
92
|
+
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
93
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
94
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
95
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
96
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
97
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
98
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
99
|
+
exports.tildeTrimReplace = "$1~";
|
|
100
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
101
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
102
|
+
createToken("LONECARET", "(?:\\^)");
|
|
103
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
104
|
+
exports.caretTrimReplace = "$1^";
|
|
105
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
106
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
107
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
108
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
109
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
110
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
111
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
112
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
113
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
114
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
115
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
//#endregion
|
|
119
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
|
|
120
|
+
var require_parse_options = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
121
|
+
const looseOption = Object.freeze({ loose: true });
|
|
122
|
+
const emptyOpts = Object.freeze({});
|
|
123
|
+
const parseOptions = (options) => {
|
|
124
|
+
if (!options) return emptyOpts;
|
|
125
|
+
if (typeof options !== "object") return looseOption;
|
|
126
|
+
return options;
|
|
127
|
+
};
|
|
128
|
+
module.exports = parseOptions;
|
|
129
|
+
}));
|
|
130
|
+
|
|
131
|
+
//#endregion
|
|
132
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
|
|
133
|
+
var require_identifiers = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
134
|
+
const numeric = /^[0-9]+$/;
|
|
135
|
+
const compareIdentifiers = (a, b) => {
|
|
136
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
137
|
+
const anum = numeric.test(a);
|
|
138
|
+
const bnum = numeric.test(b);
|
|
139
|
+
if (anum && bnum) {
|
|
140
|
+
a = +a;
|
|
141
|
+
b = +b;
|
|
142
|
+
}
|
|
143
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
144
|
+
};
|
|
145
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
146
|
+
module.exports = {
|
|
147
|
+
compareIdentifiers,
|
|
148
|
+
rcompareIdentifiers
|
|
149
|
+
};
|
|
150
|
+
}));
|
|
151
|
+
|
|
152
|
+
//#endregion
|
|
153
|
+
//#region ../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
|
|
154
|
+
var require_semver = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
155
|
+
const debug = require_debug();
|
|
156
|
+
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
157
|
+
const { safeRe: re, t } = require_re();
|
|
158
|
+
const parseOptions = require_parse_options();
|
|
159
|
+
const { compareIdentifiers } = require_identifiers();
|
|
160
|
+
var SemVer = class SemVer {
|
|
161
|
+
constructor(version, options) {
|
|
162
|
+
options = parseOptions(options);
|
|
163
|
+
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
164
|
+
else version = version.version;
|
|
165
|
+
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
166
|
+
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
167
|
+
debug("SemVer", version, options);
|
|
168
|
+
this.options = options;
|
|
169
|
+
this.loose = !!options.loose;
|
|
170
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
171
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
172
|
+
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
173
|
+
this.raw = version;
|
|
174
|
+
this.major = +m[1];
|
|
175
|
+
this.minor = +m[2];
|
|
176
|
+
this.patch = +m[3];
|
|
177
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) throw new TypeError("Invalid major version");
|
|
178
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) throw new TypeError("Invalid minor version");
|
|
179
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) throw new TypeError("Invalid patch version");
|
|
180
|
+
if (!m[4]) this.prerelease = [];
|
|
181
|
+
else this.prerelease = m[4].split(".").map((id) => {
|
|
182
|
+
if (/^[0-9]+$/.test(id)) {
|
|
183
|
+
const num = +id;
|
|
184
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) return num;
|
|
185
|
+
}
|
|
186
|
+
return id;
|
|
187
|
+
});
|
|
188
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
189
|
+
this.format();
|
|
190
|
+
}
|
|
191
|
+
format() {
|
|
192
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
193
|
+
if (this.prerelease.length) this.version += `-${this.prerelease.join(".")}`;
|
|
194
|
+
return this.version;
|
|
195
|
+
}
|
|
196
|
+
toString() {
|
|
197
|
+
return this.version;
|
|
198
|
+
}
|
|
199
|
+
compare(other) {
|
|
200
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
201
|
+
if (!(other instanceof SemVer)) {
|
|
202
|
+
if (typeof other === "string" && other === this.version) return 0;
|
|
203
|
+
other = new SemVer(other, this.options);
|
|
204
|
+
}
|
|
205
|
+
if (other.version === this.version) return 0;
|
|
206
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
207
|
+
}
|
|
208
|
+
compareMain(other) {
|
|
209
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
210
|
+
if (this.major < other.major) return -1;
|
|
211
|
+
if (this.major > other.major) return 1;
|
|
212
|
+
if (this.minor < other.minor) return -1;
|
|
213
|
+
if (this.minor > other.minor) return 1;
|
|
214
|
+
if (this.patch < other.patch) return -1;
|
|
215
|
+
if (this.patch > other.patch) return 1;
|
|
216
|
+
return 0;
|
|
217
|
+
}
|
|
218
|
+
comparePre(other) {
|
|
219
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
220
|
+
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
221
|
+
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
222
|
+
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
223
|
+
let i = 0;
|
|
224
|
+
do {
|
|
225
|
+
const a = this.prerelease[i];
|
|
226
|
+
const b = other.prerelease[i];
|
|
227
|
+
debug("prerelease compare", i, a, b);
|
|
228
|
+
if (a === void 0 && b === void 0) return 0;
|
|
229
|
+
else if (b === void 0) return 1;
|
|
230
|
+
else if (a === void 0) return -1;
|
|
231
|
+
else if (a === b) continue;
|
|
232
|
+
else return compareIdentifiers(a, b);
|
|
233
|
+
} while (++i);
|
|
234
|
+
}
|
|
235
|
+
compareBuild(other) {
|
|
236
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
237
|
+
let i = 0;
|
|
238
|
+
do {
|
|
239
|
+
const a = this.build[i];
|
|
240
|
+
const b = other.build[i];
|
|
241
|
+
debug("build compare", i, a, b);
|
|
242
|
+
if (a === void 0 && b === void 0) return 0;
|
|
243
|
+
else if (b === void 0) return 1;
|
|
244
|
+
else if (a === void 0) return -1;
|
|
245
|
+
else if (a === b) continue;
|
|
246
|
+
else return compareIdentifiers(a, b);
|
|
247
|
+
} while (++i);
|
|
248
|
+
}
|
|
249
|
+
inc(release, identifier, identifierBase) {
|
|
250
|
+
if (release.startsWith("pre")) {
|
|
251
|
+
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
252
|
+
if (identifier) {
|
|
253
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
254
|
+
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
switch (release) {
|
|
258
|
+
case "premajor":
|
|
259
|
+
this.prerelease.length = 0;
|
|
260
|
+
this.patch = 0;
|
|
261
|
+
this.minor = 0;
|
|
262
|
+
this.major++;
|
|
263
|
+
this.inc("pre", identifier, identifierBase);
|
|
264
|
+
break;
|
|
265
|
+
case "preminor":
|
|
266
|
+
this.prerelease.length = 0;
|
|
267
|
+
this.patch = 0;
|
|
268
|
+
this.minor++;
|
|
269
|
+
this.inc("pre", identifier, identifierBase);
|
|
270
|
+
break;
|
|
271
|
+
case "prepatch":
|
|
272
|
+
this.prerelease.length = 0;
|
|
273
|
+
this.inc("patch", identifier, identifierBase);
|
|
274
|
+
this.inc("pre", identifier, identifierBase);
|
|
275
|
+
break;
|
|
276
|
+
case "prerelease":
|
|
277
|
+
if (this.prerelease.length === 0) this.inc("patch", identifier, identifierBase);
|
|
278
|
+
this.inc("pre", identifier, identifierBase);
|
|
279
|
+
break;
|
|
280
|
+
case "release":
|
|
281
|
+
if (this.prerelease.length === 0) throw new Error(`version ${this.raw} is not a prerelease`);
|
|
282
|
+
this.prerelease.length = 0;
|
|
283
|
+
break;
|
|
284
|
+
case "major":
|
|
285
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) this.major++;
|
|
286
|
+
this.minor = 0;
|
|
287
|
+
this.patch = 0;
|
|
288
|
+
this.prerelease = [];
|
|
289
|
+
break;
|
|
290
|
+
case "minor":
|
|
291
|
+
if (this.patch !== 0 || this.prerelease.length === 0) this.minor++;
|
|
292
|
+
this.patch = 0;
|
|
293
|
+
this.prerelease = [];
|
|
294
|
+
break;
|
|
295
|
+
case "patch":
|
|
296
|
+
if (this.prerelease.length === 0) this.patch++;
|
|
297
|
+
this.prerelease = [];
|
|
298
|
+
break;
|
|
299
|
+
case "pre": {
|
|
300
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
301
|
+
if (this.prerelease.length === 0) this.prerelease = [base];
|
|
302
|
+
else {
|
|
303
|
+
let i = this.prerelease.length;
|
|
304
|
+
while (--i >= 0) if (typeof this.prerelease[i] === "number") {
|
|
305
|
+
this.prerelease[i]++;
|
|
306
|
+
i = -2;
|
|
307
|
+
}
|
|
308
|
+
if (i === -1) {
|
|
309
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) throw new Error("invalid increment argument: identifier already exists");
|
|
310
|
+
this.prerelease.push(base);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
if (identifier) {
|
|
314
|
+
let prerelease = [identifier, base];
|
|
315
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
316
|
+
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
317
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
318
|
+
} else this.prerelease = prerelease;
|
|
319
|
+
}
|
|
320
|
+
break;
|
|
321
|
+
}
|
|
322
|
+
default: throw new Error(`invalid increment argument: ${release}`);
|
|
323
|
+
}
|
|
324
|
+
this.raw = this.format();
|
|
325
|
+
if (this.build.length) this.raw += `+${this.build.join(".")}`;
|
|
326
|
+
return this;
|
|
327
|
+
}
|
|
328
|
+
};
|
|
329
|
+
module.exports = SemVer;
|
|
330
|
+
}));
|
|
331
|
+
|
|
332
|
+
//#endregion
|
|
333
|
+
Object.defineProperty(exports, 'require_constants', {
|
|
334
|
+
enumerable: true,
|
|
335
|
+
get: function () {
|
|
336
|
+
return require_constants;
|
|
337
|
+
}
|
|
338
|
+
});
|
|
339
|
+
Object.defineProperty(exports, 'require_debug', {
|
|
340
|
+
enumerable: true,
|
|
341
|
+
get: function () {
|
|
342
|
+
return require_debug;
|
|
343
|
+
}
|
|
344
|
+
});
|
|
345
|
+
Object.defineProperty(exports, 'require_parse_options', {
|
|
346
|
+
enumerable: true,
|
|
347
|
+
get: function () {
|
|
348
|
+
return require_parse_options;
|
|
349
|
+
}
|
|
350
|
+
});
|
|
351
|
+
Object.defineProperty(exports, 'require_re', {
|
|
352
|
+
enumerable: true,
|
|
353
|
+
get: function () {
|
|
354
|
+
return require_re;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
Object.defineProperty(exports, 'require_semver', {
|
|
358
|
+
enumerable: true,
|
|
359
|
+
get: function () {
|
|
360
|
+
return require_semver;
|
|
361
|
+
}
|
|
362
|
+
});
|