@stardeck-customer-apps/compose 0.4.0 → 0.6.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/SKILL.md +13 -2
- package/dist/cli.js +2157 -26
- package/dist/index.js +2158 -27
- package/dist/index.mjs +2170 -16
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5,6 +5,9 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
+
};
|
|
8
11
|
var __export = (target, all) => {
|
|
9
12
|
for (var name in all)
|
|
10
13
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -15,17 +18,2011 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
18
|
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
19
|
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
20
|
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
+
mod
|
|
30
|
+
));
|
|
31
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
32
|
+
|
|
33
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
|
|
34
|
+
var require_constants = __commonJS({
|
|
35
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports2, module2) {
|
|
36
|
+
"use strict";
|
|
37
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
38
|
+
var MAX_LENGTH = 256;
|
|
39
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
40
|
+
9007199254740991;
|
|
41
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
42
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
43
|
+
var RELEASE_TYPES = [
|
|
44
|
+
"major",
|
|
45
|
+
"premajor",
|
|
46
|
+
"minor",
|
|
47
|
+
"preminor",
|
|
48
|
+
"patch",
|
|
49
|
+
"prepatch",
|
|
50
|
+
"prerelease"
|
|
51
|
+
];
|
|
52
|
+
module2.exports = {
|
|
53
|
+
MAX_LENGTH,
|
|
54
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
55
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
56
|
+
MAX_SAFE_INTEGER,
|
|
57
|
+
RELEASE_TYPES,
|
|
58
|
+
SEMVER_SPEC_VERSION,
|
|
59
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
60
|
+
FLAG_LOOSE: 2
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
|
|
66
|
+
var require_debug = __commonJS({
|
|
67
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports2, module2) {
|
|
68
|
+
"use strict";
|
|
69
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
70
|
+
};
|
|
71
|
+
module2.exports = debug;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
|
|
76
|
+
var require_re = __commonJS({
|
|
77
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports2, module2) {
|
|
78
|
+
"use strict";
|
|
79
|
+
var {
|
|
80
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
81
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
82
|
+
MAX_LENGTH
|
|
83
|
+
} = require_constants();
|
|
84
|
+
var debug = require_debug();
|
|
85
|
+
exports2 = module2.exports = {};
|
|
86
|
+
var re = exports2.re = [];
|
|
87
|
+
var safeRe = exports2.safeRe = [];
|
|
88
|
+
var src = exports2.src = [];
|
|
89
|
+
var safeSrc = exports2.safeSrc = [];
|
|
90
|
+
var t = exports2.t = {};
|
|
91
|
+
var R = 0;
|
|
92
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
93
|
+
var safeRegexReplacements = [
|
|
94
|
+
["\\s", 1],
|
|
95
|
+
["\\d", MAX_LENGTH],
|
|
96
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
97
|
+
];
|
|
98
|
+
var makeSafeRegex = (value) => {
|
|
99
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
100
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
101
|
+
}
|
|
102
|
+
return value;
|
|
103
|
+
};
|
|
104
|
+
var createToken = (name, value, isGlobal) => {
|
|
105
|
+
const safe = makeSafeRegex(value);
|
|
106
|
+
const index = R++;
|
|
107
|
+
debug(name, index, value);
|
|
108
|
+
t[name] = index;
|
|
109
|
+
src[index] = value;
|
|
110
|
+
safeSrc[index] = safe;
|
|
111
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
112
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
113
|
+
};
|
|
114
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
115
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
116
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
117
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
118
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
119
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
120
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
121
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
122
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
123
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
124
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
125
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
126
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
127
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
128
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
129
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
130
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
131
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
132
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
133
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
134
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
135
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
136
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
137
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
138
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
139
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
140
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
141
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
142
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
143
|
+
exports2.tildeTrimReplace = "$1~";
|
|
144
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
145
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
146
|
+
createToken("LONECARET", "(?:\\^)");
|
|
147
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
148
|
+
exports2.caretTrimReplace = "$1^";
|
|
149
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
150
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
151
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
152
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
153
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
154
|
+
exports2.comparatorTrimReplace = "$1$2$3";
|
|
155
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
156
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
157
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
158
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
159
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
|
|
164
|
+
var require_parse_options = __commonJS({
|
|
165
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports2, module2) {
|
|
166
|
+
"use strict";
|
|
167
|
+
var looseOption = Object.freeze({ loose: true });
|
|
168
|
+
var emptyOpts = Object.freeze({});
|
|
169
|
+
var parseOptions = (options) => {
|
|
170
|
+
if (!options) {
|
|
171
|
+
return emptyOpts;
|
|
172
|
+
}
|
|
173
|
+
if (typeof options !== "object") {
|
|
174
|
+
return looseOption;
|
|
175
|
+
}
|
|
176
|
+
return options;
|
|
177
|
+
};
|
|
178
|
+
module2.exports = parseOptions;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
|
|
183
|
+
var require_identifiers = __commonJS({
|
|
184
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports2, module2) {
|
|
185
|
+
"use strict";
|
|
186
|
+
var numeric = /^[0-9]+$/;
|
|
187
|
+
var compareIdentifiers = (a, b) => {
|
|
188
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
189
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
190
|
+
}
|
|
191
|
+
const anum = numeric.test(a);
|
|
192
|
+
const bnum = numeric.test(b);
|
|
193
|
+
if (anum && bnum) {
|
|
194
|
+
a = +a;
|
|
195
|
+
b = +b;
|
|
196
|
+
}
|
|
197
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
198
|
+
};
|
|
199
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
200
|
+
module2.exports = {
|
|
201
|
+
compareIdentifiers,
|
|
202
|
+
rcompareIdentifiers
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
|
|
208
|
+
var require_semver = __commonJS({
|
|
209
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports2, module2) {
|
|
210
|
+
"use strict";
|
|
211
|
+
var debug = require_debug();
|
|
212
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
213
|
+
var { safeRe: re, t } = require_re();
|
|
214
|
+
var parseOptions = require_parse_options();
|
|
215
|
+
var { compareIdentifiers } = require_identifiers();
|
|
216
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
217
|
+
const identifiers = identifier.split(".");
|
|
218
|
+
if (identifiers.length > prerelease.length) {
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
222
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
223
|
+
return false;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
return true;
|
|
227
|
+
};
|
|
228
|
+
var SemVer = class _SemVer {
|
|
229
|
+
constructor(version, options) {
|
|
230
|
+
options = parseOptions(options);
|
|
231
|
+
if (version instanceof _SemVer) {
|
|
232
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
233
|
+
return version;
|
|
234
|
+
} else {
|
|
235
|
+
version = version.version;
|
|
236
|
+
}
|
|
237
|
+
} else if (typeof version !== "string") {
|
|
238
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
239
|
+
}
|
|
240
|
+
if (version.length > MAX_LENGTH) {
|
|
241
|
+
throw new TypeError(
|
|
242
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
243
|
+
);
|
|
244
|
+
}
|
|
245
|
+
debug("SemVer", version, options);
|
|
246
|
+
this.options = options;
|
|
247
|
+
this.loose = !!options.loose;
|
|
248
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
249
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
250
|
+
if (!m) {
|
|
251
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
252
|
+
}
|
|
253
|
+
this.raw = version;
|
|
254
|
+
this.major = +m[1];
|
|
255
|
+
this.minor = +m[2];
|
|
256
|
+
this.patch = +m[3];
|
|
257
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
258
|
+
throw new TypeError("Invalid major version");
|
|
259
|
+
}
|
|
260
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
261
|
+
throw new TypeError("Invalid minor version");
|
|
262
|
+
}
|
|
263
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
264
|
+
throw new TypeError("Invalid patch version");
|
|
265
|
+
}
|
|
266
|
+
if (!m[4]) {
|
|
267
|
+
this.prerelease = [];
|
|
268
|
+
} else {
|
|
269
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
270
|
+
if (/^[0-9]+$/.test(id)) {
|
|
271
|
+
const num = +id;
|
|
272
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
273
|
+
return num;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
return id;
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
280
|
+
this.format();
|
|
281
|
+
}
|
|
282
|
+
format() {
|
|
283
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
284
|
+
if (this.prerelease.length) {
|
|
285
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
286
|
+
}
|
|
287
|
+
return this.version;
|
|
288
|
+
}
|
|
289
|
+
toString() {
|
|
290
|
+
return this.version;
|
|
291
|
+
}
|
|
292
|
+
compare(other) {
|
|
293
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
294
|
+
if (!(other instanceof _SemVer)) {
|
|
295
|
+
if (typeof other === "string" && other === this.version) {
|
|
296
|
+
return 0;
|
|
297
|
+
}
|
|
298
|
+
other = new _SemVer(other, this.options);
|
|
299
|
+
}
|
|
300
|
+
if (other.version === this.version) {
|
|
301
|
+
return 0;
|
|
302
|
+
}
|
|
303
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
304
|
+
}
|
|
305
|
+
compareMain(other) {
|
|
306
|
+
if (!(other instanceof _SemVer)) {
|
|
307
|
+
other = new _SemVer(other, this.options);
|
|
308
|
+
}
|
|
309
|
+
if (this.major < other.major) {
|
|
310
|
+
return -1;
|
|
311
|
+
}
|
|
312
|
+
if (this.major > other.major) {
|
|
313
|
+
return 1;
|
|
314
|
+
}
|
|
315
|
+
if (this.minor < other.minor) {
|
|
316
|
+
return -1;
|
|
317
|
+
}
|
|
318
|
+
if (this.minor > other.minor) {
|
|
319
|
+
return 1;
|
|
320
|
+
}
|
|
321
|
+
if (this.patch < other.patch) {
|
|
322
|
+
return -1;
|
|
323
|
+
}
|
|
324
|
+
if (this.patch > other.patch) {
|
|
325
|
+
return 1;
|
|
326
|
+
}
|
|
327
|
+
return 0;
|
|
328
|
+
}
|
|
329
|
+
comparePre(other) {
|
|
330
|
+
if (!(other instanceof _SemVer)) {
|
|
331
|
+
other = new _SemVer(other, this.options);
|
|
332
|
+
}
|
|
333
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
334
|
+
return -1;
|
|
335
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
336
|
+
return 1;
|
|
337
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
338
|
+
return 0;
|
|
339
|
+
}
|
|
340
|
+
let i = 0;
|
|
341
|
+
do {
|
|
342
|
+
const a = this.prerelease[i];
|
|
343
|
+
const b = other.prerelease[i];
|
|
344
|
+
debug("prerelease compare", i, a, b);
|
|
345
|
+
if (a === void 0 && b === void 0) {
|
|
346
|
+
return 0;
|
|
347
|
+
} else if (b === void 0) {
|
|
348
|
+
return 1;
|
|
349
|
+
} else if (a === void 0) {
|
|
350
|
+
return -1;
|
|
351
|
+
} else if (a === b) {
|
|
352
|
+
continue;
|
|
353
|
+
} else {
|
|
354
|
+
return compareIdentifiers(a, b);
|
|
355
|
+
}
|
|
356
|
+
} while (++i);
|
|
357
|
+
}
|
|
358
|
+
compareBuild(other) {
|
|
359
|
+
if (!(other instanceof _SemVer)) {
|
|
360
|
+
other = new _SemVer(other, this.options);
|
|
361
|
+
}
|
|
362
|
+
let i = 0;
|
|
363
|
+
do {
|
|
364
|
+
const a = this.build[i];
|
|
365
|
+
const b = other.build[i];
|
|
366
|
+
debug("build compare", i, a, b);
|
|
367
|
+
if (a === void 0 && b === void 0) {
|
|
368
|
+
return 0;
|
|
369
|
+
} else if (b === void 0) {
|
|
370
|
+
return 1;
|
|
371
|
+
} else if (a === void 0) {
|
|
372
|
+
return -1;
|
|
373
|
+
} else if (a === b) {
|
|
374
|
+
continue;
|
|
375
|
+
} else {
|
|
376
|
+
return compareIdentifiers(a, b);
|
|
377
|
+
}
|
|
378
|
+
} while (++i);
|
|
379
|
+
}
|
|
380
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
381
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
382
|
+
inc(release, identifier, identifierBase) {
|
|
383
|
+
if (release.startsWith("pre")) {
|
|
384
|
+
if (!identifier && identifierBase === false) {
|
|
385
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
386
|
+
}
|
|
387
|
+
if (identifier) {
|
|
388
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
389
|
+
if (!match || match[1] !== identifier) {
|
|
390
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
switch (release) {
|
|
395
|
+
case "premajor":
|
|
396
|
+
this.prerelease.length = 0;
|
|
397
|
+
this.patch = 0;
|
|
398
|
+
this.minor = 0;
|
|
399
|
+
this.major++;
|
|
400
|
+
this.inc("pre", identifier, identifierBase);
|
|
401
|
+
break;
|
|
402
|
+
case "preminor":
|
|
403
|
+
this.prerelease.length = 0;
|
|
404
|
+
this.patch = 0;
|
|
405
|
+
this.minor++;
|
|
406
|
+
this.inc("pre", identifier, identifierBase);
|
|
407
|
+
break;
|
|
408
|
+
case "prepatch":
|
|
409
|
+
this.prerelease.length = 0;
|
|
410
|
+
this.inc("patch", identifier, identifierBase);
|
|
411
|
+
this.inc("pre", identifier, identifierBase);
|
|
412
|
+
break;
|
|
413
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
414
|
+
// prepatch.
|
|
415
|
+
case "prerelease":
|
|
416
|
+
if (this.prerelease.length === 0) {
|
|
417
|
+
this.inc("patch", identifier, identifierBase);
|
|
418
|
+
}
|
|
419
|
+
this.inc("pre", identifier, identifierBase);
|
|
420
|
+
break;
|
|
421
|
+
case "release":
|
|
422
|
+
if (this.prerelease.length === 0) {
|
|
423
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
424
|
+
}
|
|
425
|
+
this.prerelease.length = 0;
|
|
426
|
+
break;
|
|
427
|
+
case "major":
|
|
428
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
429
|
+
this.major++;
|
|
430
|
+
}
|
|
431
|
+
this.minor = 0;
|
|
432
|
+
this.patch = 0;
|
|
433
|
+
this.prerelease = [];
|
|
434
|
+
break;
|
|
435
|
+
case "minor":
|
|
436
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
437
|
+
this.minor++;
|
|
438
|
+
}
|
|
439
|
+
this.patch = 0;
|
|
440
|
+
this.prerelease = [];
|
|
441
|
+
break;
|
|
442
|
+
case "patch":
|
|
443
|
+
if (this.prerelease.length === 0) {
|
|
444
|
+
this.patch++;
|
|
445
|
+
}
|
|
446
|
+
this.prerelease = [];
|
|
447
|
+
break;
|
|
448
|
+
// This probably shouldn't be used publicly.
|
|
449
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
450
|
+
case "pre": {
|
|
451
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
452
|
+
if (this.prerelease.length === 0) {
|
|
453
|
+
this.prerelease = [base];
|
|
454
|
+
} else {
|
|
455
|
+
let i = this.prerelease.length;
|
|
456
|
+
while (--i >= 0) {
|
|
457
|
+
if (typeof this.prerelease[i] === "number") {
|
|
458
|
+
this.prerelease[i]++;
|
|
459
|
+
i = -2;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
if (i === -1) {
|
|
463
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
464
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
465
|
+
}
|
|
466
|
+
this.prerelease.push(base);
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (identifier) {
|
|
470
|
+
let prerelease = [identifier, base];
|
|
471
|
+
if (identifierBase === false) {
|
|
472
|
+
prerelease = [identifier];
|
|
473
|
+
}
|
|
474
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
475
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
476
|
+
if (isNaN(prereleaseBase)) {
|
|
477
|
+
this.prerelease = prerelease;
|
|
478
|
+
}
|
|
479
|
+
} else {
|
|
480
|
+
this.prerelease = prerelease;
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
break;
|
|
484
|
+
}
|
|
485
|
+
default:
|
|
486
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
487
|
+
}
|
|
488
|
+
this.raw = this.format();
|
|
489
|
+
if (this.build.length) {
|
|
490
|
+
this.raw += `+${this.build.join(".")}`;
|
|
491
|
+
}
|
|
492
|
+
return this;
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
module2.exports = SemVer;
|
|
496
|
+
}
|
|
497
|
+
});
|
|
498
|
+
|
|
499
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
|
|
500
|
+
var require_parse = __commonJS({
|
|
501
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports2, module2) {
|
|
502
|
+
"use strict";
|
|
503
|
+
var SemVer = require_semver();
|
|
504
|
+
var parse = (version, options, throwErrors = false) => {
|
|
505
|
+
if (version instanceof SemVer) {
|
|
506
|
+
return version;
|
|
507
|
+
}
|
|
508
|
+
try {
|
|
509
|
+
return new SemVer(version, options);
|
|
510
|
+
} catch (er) {
|
|
511
|
+
if (!throwErrors) {
|
|
512
|
+
return null;
|
|
513
|
+
}
|
|
514
|
+
throw er;
|
|
515
|
+
}
|
|
516
|
+
};
|
|
517
|
+
module2.exports = parse;
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
|
|
522
|
+
var require_valid = __commonJS({
|
|
523
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports2, module2) {
|
|
524
|
+
"use strict";
|
|
525
|
+
var parse = require_parse();
|
|
526
|
+
var valid = (version, options) => {
|
|
527
|
+
const v = parse(version, options);
|
|
528
|
+
return v ? v.version : null;
|
|
529
|
+
};
|
|
530
|
+
module2.exports = valid;
|
|
531
|
+
}
|
|
532
|
+
});
|
|
533
|
+
|
|
534
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
|
|
535
|
+
var require_clean = __commonJS({
|
|
536
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports2, module2) {
|
|
537
|
+
"use strict";
|
|
538
|
+
var parse = require_parse();
|
|
539
|
+
var clean = (version, options) => {
|
|
540
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
541
|
+
return s ? s.version : null;
|
|
542
|
+
};
|
|
543
|
+
module2.exports = clean;
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
|
|
547
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
|
|
548
|
+
var require_inc = __commonJS({
|
|
549
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports2, module2) {
|
|
550
|
+
"use strict";
|
|
551
|
+
var SemVer = require_semver();
|
|
552
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
553
|
+
if (typeof options === "string") {
|
|
554
|
+
identifierBase = identifier;
|
|
555
|
+
identifier = options;
|
|
556
|
+
options = void 0;
|
|
557
|
+
}
|
|
558
|
+
try {
|
|
559
|
+
return new SemVer(
|
|
560
|
+
version instanceof SemVer ? version.version : version,
|
|
561
|
+
options
|
|
562
|
+
).inc(release, identifier, identifierBase).version;
|
|
563
|
+
} catch (er) {
|
|
564
|
+
return null;
|
|
565
|
+
}
|
|
566
|
+
};
|
|
567
|
+
module2.exports = inc;
|
|
568
|
+
}
|
|
569
|
+
});
|
|
570
|
+
|
|
571
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
|
|
572
|
+
var require_diff = __commonJS({
|
|
573
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports2, module2) {
|
|
574
|
+
"use strict";
|
|
575
|
+
var parse = require_parse();
|
|
576
|
+
var diff = (version1, version2) => {
|
|
577
|
+
const v1 = parse(version1, null, true);
|
|
578
|
+
const v2 = parse(version2, null, true);
|
|
579
|
+
const comparison = v1.compare(v2);
|
|
580
|
+
if (comparison === 0) {
|
|
581
|
+
return null;
|
|
582
|
+
}
|
|
583
|
+
const v1Higher = comparison > 0;
|
|
584
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
585
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
586
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
587
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
588
|
+
if (lowHasPre && !highHasPre) {
|
|
589
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
590
|
+
return "major";
|
|
591
|
+
}
|
|
592
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
593
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
594
|
+
return "minor";
|
|
595
|
+
}
|
|
596
|
+
return "patch";
|
|
597
|
+
}
|
|
598
|
+
}
|
|
599
|
+
const prefix = highHasPre ? "pre" : "";
|
|
600
|
+
if (v1.major !== v2.major) {
|
|
601
|
+
return prefix + "major";
|
|
602
|
+
}
|
|
603
|
+
if (v1.minor !== v2.minor) {
|
|
604
|
+
return prefix + "minor";
|
|
605
|
+
}
|
|
606
|
+
if (v1.patch !== v2.patch) {
|
|
607
|
+
return prefix + "patch";
|
|
608
|
+
}
|
|
609
|
+
return "prerelease";
|
|
610
|
+
};
|
|
611
|
+
module2.exports = diff;
|
|
612
|
+
}
|
|
613
|
+
});
|
|
614
|
+
|
|
615
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
|
|
616
|
+
var require_major = __commonJS({
|
|
617
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports2, module2) {
|
|
618
|
+
"use strict";
|
|
619
|
+
var SemVer = require_semver();
|
|
620
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
621
|
+
module2.exports = major;
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
|
|
626
|
+
var require_minor = __commonJS({
|
|
627
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports2, module2) {
|
|
628
|
+
"use strict";
|
|
629
|
+
var SemVer = require_semver();
|
|
630
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
631
|
+
module2.exports = minor;
|
|
632
|
+
}
|
|
633
|
+
});
|
|
634
|
+
|
|
635
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
|
|
636
|
+
var require_patch = __commonJS({
|
|
637
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports2, module2) {
|
|
638
|
+
"use strict";
|
|
639
|
+
var SemVer = require_semver();
|
|
640
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
641
|
+
module2.exports = patch;
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
|
|
645
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
|
|
646
|
+
var require_prerelease = __commonJS({
|
|
647
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports2, module2) {
|
|
648
|
+
"use strict";
|
|
649
|
+
var parse = require_parse();
|
|
650
|
+
var prerelease = (version, options) => {
|
|
651
|
+
const parsed = parse(version, options);
|
|
652
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
653
|
+
};
|
|
654
|
+
module2.exports = prerelease;
|
|
655
|
+
}
|
|
656
|
+
});
|
|
657
|
+
|
|
658
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
|
|
659
|
+
var require_compare = __commonJS({
|
|
660
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports2, module2) {
|
|
661
|
+
"use strict";
|
|
662
|
+
var SemVer = require_semver();
|
|
663
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
664
|
+
module2.exports = compare;
|
|
665
|
+
}
|
|
666
|
+
});
|
|
667
|
+
|
|
668
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
|
|
669
|
+
var require_rcompare = __commonJS({
|
|
670
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports2, module2) {
|
|
671
|
+
"use strict";
|
|
672
|
+
var compare = require_compare();
|
|
673
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
674
|
+
module2.exports = rcompare;
|
|
675
|
+
}
|
|
676
|
+
});
|
|
677
|
+
|
|
678
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
|
|
679
|
+
var require_compare_loose = __commonJS({
|
|
680
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports2, module2) {
|
|
681
|
+
"use strict";
|
|
682
|
+
var compare = require_compare();
|
|
683
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
684
|
+
module2.exports = compareLoose;
|
|
685
|
+
}
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
|
|
689
|
+
var require_compare_build = __commonJS({
|
|
690
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports2, module2) {
|
|
691
|
+
"use strict";
|
|
692
|
+
var SemVer = require_semver();
|
|
693
|
+
var compareBuild = (a, b, loose) => {
|
|
694
|
+
const versionA = new SemVer(a, loose);
|
|
695
|
+
const versionB = new SemVer(b, loose);
|
|
696
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
697
|
+
};
|
|
698
|
+
module2.exports = compareBuild;
|
|
699
|
+
}
|
|
700
|
+
});
|
|
701
|
+
|
|
702
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
|
|
703
|
+
var require_sort = __commonJS({
|
|
704
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports2, module2) {
|
|
705
|
+
"use strict";
|
|
706
|
+
var compareBuild = require_compare_build();
|
|
707
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
708
|
+
module2.exports = sort;
|
|
709
|
+
}
|
|
710
|
+
});
|
|
711
|
+
|
|
712
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
|
|
713
|
+
var require_rsort = __commonJS({
|
|
714
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports2, module2) {
|
|
715
|
+
"use strict";
|
|
716
|
+
var compareBuild = require_compare_build();
|
|
717
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
718
|
+
module2.exports = rsort;
|
|
719
|
+
}
|
|
720
|
+
});
|
|
721
|
+
|
|
722
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
|
|
723
|
+
var require_gt = __commonJS({
|
|
724
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports2, module2) {
|
|
725
|
+
"use strict";
|
|
726
|
+
var compare = require_compare();
|
|
727
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
728
|
+
module2.exports = gt;
|
|
729
|
+
}
|
|
730
|
+
});
|
|
731
|
+
|
|
732
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
|
|
733
|
+
var require_lt = __commonJS({
|
|
734
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports2, module2) {
|
|
735
|
+
"use strict";
|
|
736
|
+
var compare = require_compare();
|
|
737
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
738
|
+
module2.exports = lt;
|
|
739
|
+
}
|
|
740
|
+
});
|
|
741
|
+
|
|
742
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
|
|
743
|
+
var require_eq = __commonJS({
|
|
744
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports2, module2) {
|
|
745
|
+
"use strict";
|
|
746
|
+
var compare = require_compare();
|
|
747
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
748
|
+
module2.exports = eq;
|
|
749
|
+
}
|
|
750
|
+
});
|
|
751
|
+
|
|
752
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
|
|
753
|
+
var require_neq = __commonJS({
|
|
754
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports2, module2) {
|
|
755
|
+
"use strict";
|
|
756
|
+
var compare = require_compare();
|
|
757
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
758
|
+
module2.exports = neq;
|
|
759
|
+
}
|
|
760
|
+
});
|
|
761
|
+
|
|
762
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
|
|
763
|
+
var require_gte = __commonJS({
|
|
764
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports2, module2) {
|
|
765
|
+
"use strict";
|
|
766
|
+
var compare = require_compare();
|
|
767
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
768
|
+
module2.exports = gte;
|
|
769
|
+
}
|
|
770
|
+
});
|
|
771
|
+
|
|
772
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
|
|
773
|
+
var require_lte = __commonJS({
|
|
774
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports2, module2) {
|
|
775
|
+
"use strict";
|
|
776
|
+
var compare = require_compare();
|
|
777
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
778
|
+
module2.exports = lte;
|
|
779
|
+
}
|
|
780
|
+
});
|
|
781
|
+
|
|
782
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
|
|
783
|
+
var require_cmp = __commonJS({
|
|
784
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports2, module2) {
|
|
785
|
+
"use strict";
|
|
786
|
+
var eq = require_eq();
|
|
787
|
+
var neq = require_neq();
|
|
788
|
+
var gt = require_gt();
|
|
789
|
+
var gte = require_gte();
|
|
790
|
+
var lt = require_lt();
|
|
791
|
+
var lte = require_lte();
|
|
792
|
+
var cmp = (a, op, b, loose) => {
|
|
793
|
+
switch (op) {
|
|
794
|
+
case "===":
|
|
795
|
+
if (typeof a === "object") {
|
|
796
|
+
a = a.version;
|
|
797
|
+
}
|
|
798
|
+
if (typeof b === "object") {
|
|
799
|
+
b = b.version;
|
|
800
|
+
}
|
|
801
|
+
return a === b;
|
|
802
|
+
case "!==":
|
|
803
|
+
if (typeof a === "object") {
|
|
804
|
+
a = a.version;
|
|
805
|
+
}
|
|
806
|
+
if (typeof b === "object") {
|
|
807
|
+
b = b.version;
|
|
808
|
+
}
|
|
809
|
+
return a !== b;
|
|
810
|
+
case "":
|
|
811
|
+
case "=":
|
|
812
|
+
case "==":
|
|
813
|
+
return eq(a, b, loose);
|
|
814
|
+
case "!=":
|
|
815
|
+
return neq(a, b, loose);
|
|
816
|
+
case ">":
|
|
817
|
+
return gt(a, b, loose);
|
|
818
|
+
case ">=":
|
|
819
|
+
return gte(a, b, loose);
|
|
820
|
+
case "<":
|
|
821
|
+
return lt(a, b, loose);
|
|
822
|
+
case "<=":
|
|
823
|
+
return lte(a, b, loose);
|
|
824
|
+
default:
|
|
825
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
module2.exports = cmp;
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
|
|
832
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
|
|
833
|
+
var require_coerce = __commonJS({
|
|
834
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports2, module2) {
|
|
835
|
+
"use strict";
|
|
836
|
+
var SemVer = require_semver();
|
|
837
|
+
var parse = require_parse();
|
|
838
|
+
var { safeRe: re, t } = require_re();
|
|
839
|
+
var coerce = (version, options) => {
|
|
840
|
+
if (version instanceof SemVer) {
|
|
841
|
+
return version;
|
|
842
|
+
}
|
|
843
|
+
if (typeof version === "number") {
|
|
844
|
+
version = String(version);
|
|
845
|
+
}
|
|
846
|
+
if (typeof version !== "string") {
|
|
847
|
+
return null;
|
|
848
|
+
}
|
|
849
|
+
options = options || {};
|
|
850
|
+
let match = null;
|
|
851
|
+
if (!options.rtl) {
|
|
852
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
853
|
+
} else {
|
|
854
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
855
|
+
let next;
|
|
856
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
857
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
858
|
+
match = next;
|
|
859
|
+
}
|
|
860
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
861
|
+
}
|
|
862
|
+
coerceRtlRegex.lastIndex = -1;
|
|
863
|
+
}
|
|
864
|
+
if (match === null) {
|
|
865
|
+
return null;
|
|
866
|
+
}
|
|
867
|
+
const major = match[2];
|
|
868
|
+
const minor = match[3] || "0";
|
|
869
|
+
const patch = match[4] || "0";
|
|
870
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
871
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
872
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
873
|
+
};
|
|
874
|
+
module2.exports = coerce;
|
|
875
|
+
}
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
|
|
879
|
+
var require_truncate = __commonJS({
|
|
880
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports2, module2) {
|
|
881
|
+
"use strict";
|
|
882
|
+
var parse = require_parse();
|
|
883
|
+
var constants = require_constants();
|
|
884
|
+
var SemVer = require_semver();
|
|
885
|
+
var truncate = (version, truncation, options) => {
|
|
886
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) {
|
|
887
|
+
return null;
|
|
888
|
+
}
|
|
889
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
890
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
891
|
+
};
|
|
892
|
+
var cloneInputVersion = (version, options) => {
|
|
893
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
894
|
+
return parse(versionStringToParse, options);
|
|
895
|
+
};
|
|
896
|
+
var doTruncation = (version, truncation) => {
|
|
897
|
+
if (isPrerelease(truncation)) {
|
|
898
|
+
return version.version;
|
|
899
|
+
}
|
|
900
|
+
version.prerelease = [];
|
|
901
|
+
switch (truncation) {
|
|
902
|
+
case "major":
|
|
903
|
+
version.minor = 0;
|
|
904
|
+
version.patch = 0;
|
|
905
|
+
break;
|
|
906
|
+
case "minor":
|
|
907
|
+
version.patch = 0;
|
|
908
|
+
break;
|
|
909
|
+
}
|
|
910
|
+
return version.format();
|
|
911
|
+
};
|
|
912
|
+
var isPrerelease = (type) => {
|
|
913
|
+
return type.startsWith("pre");
|
|
914
|
+
};
|
|
915
|
+
module2.exports = truncate;
|
|
916
|
+
}
|
|
917
|
+
});
|
|
918
|
+
|
|
919
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
|
|
920
|
+
var require_lrucache = __commonJS({
|
|
921
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports2, module2) {
|
|
922
|
+
"use strict";
|
|
923
|
+
var LRUCache = class {
|
|
924
|
+
constructor() {
|
|
925
|
+
this.max = 1e3;
|
|
926
|
+
this.map = /* @__PURE__ */ new Map();
|
|
927
|
+
}
|
|
928
|
+
get(key) {
|
|
929
|
+
const value = this.map.get(key);
|
|
930
|
+
if (value === void 0) {
|
|
931
|
+
return void 0;
|
|
932
|
+
} else {
|
|
933
|
+
this.map.delete(key);
|
|
934
|
+
this.map.set(key, value);
|
|
935
|
+
return value;
|
|
936
|
+
}
|
|
937
|
+
}
|
|
938
|
+
delete(key) {
|
|
939
|
+
return this.map.delete(key);
|
|
940
|
+
}
|
|
941
|
+
set(key, value) {
|
|
942
|
+
const deleted = this.delete(key);
|
|
943
|
+
if (!deleted && value !== void 0) {
|
|
944
|
+
if (this.map.size >= this.max) {
|
|
945
|
+
const firstKey = this.map.keys().next().value;
|
|
946
|
+
this.delete(firstKey);
|
|
947
|
+
}
|
|
948
|
+
this.map.set(key, value);
|
|
949
|
+
}
|
|
950
|
+
return this;
|
|
951
|
+
}
|
|
952
|
+
};
|
|
953
|
+
module2.exports = LRUCache;
|
|
954
|
+
}
|
|
955
|
+
});
|
|
956
|
+
|
|
957
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
|
|
958
|
+
var require_range = __commonJS({
|
|
959
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports2, module2) {
|
|
960
|
+
"use strict";
|
|
961
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
962
|
+
var Range = class _Range {
|
|
963
|
+
constructor(range, options) {
|
|
964
|
+
options = parseOptions(options);
|
|
965
|
+
if (range instanceof _Range) {
|
|
966
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
967
|
+
return range;
|
|
968
|
+
} else {
|
|
969
|
+
return new _Range(range.raw, options);
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
if (range instanceof Comparator) {
|
|
973
|
+
this.raw = range.value;
|
|
974
|
+
this.set = [[range]];
|
|
975
|
+
this.formatted = void 0;
|
|
976
|
+
return this;
|
|
977
|
+
}
|
|
978
|
+
this.options = options;
|
|
979
|
+
this.loose = !!options.loose;
|
|
980
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
981
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
982
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
983
|
+
if (!this.set.length) {
|
|
984
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
985
|
+
}
|
|
986
|
+
if (this.set.length > 1) {
|
|
987
|
+
const first = this.set[0];
|
|
988
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
989
|
+
if (this.set.length === 0) {
|
|
990
|
+
this.set = [first];
|
|
991
|
+
} else if (this.set.length > 1) {
|
|
992
|
+
for (const c of this.set) {
|
|
993
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
994
|
+
this.set = [c];
|
|
995
|
+
break;
|
|
996
|
+
}
|
|
997
|
+
}
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
this.formatted = void 0;
|
|
1001
|
+
}
|
|
1002
|
+
get range() {
|
|
1003
|
+
if (this.formatted === void 0) {
|
|
1004
|
+
this.formatted = "";
|
|
1005
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1006
|
+
if (i > 0) {
|
|
1007
|
+
this.formatted += "||";
|
|
1008
|
+
}
|
|
1009
|
+
const comps = this.set[i];
|
|
1010
|
+
for (let k = 0; k < comps.length; k++) {
|
|
1011
|
+
if (k > 0) {
|
|
1012
|
+
this.formatted += " ";
|
|
1013
|
+
}
|
|
1014
|
+
this.formatted += comps[k].toString().trim();
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
return this.formatted;
|
|
1019
|
+
}
|
|
1020
|
+
format() {
|
|
1021
|
+
return this.range;
|
|
1022
|
+
}
|
|
1023
|
+
toString() {
|
|
1024
|
+
return this.range;
|
|
1025
|
+
}
|
|
1026
|
+
parseRange(range) {
|
|
1027
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
1028
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1029
|
+
const memoKey = memoOpts + ":" + range;
|
|
1030
|
+
const cached = cache.get(memoKey);
|
|
1031
|
+
if (cached) {
|
|
1032
|
+
return cached;
|
|
1033
|
+
}
|
|
1034
|
+
const loose = this.options.loose;
|
|
1035
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1036
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1037
|
+
debug("hyphen replace", range);
|
|
1038
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1039
|
+
debug("comparator trim", range);
|
|
1040
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1041
|
+
debug("tilde trim", range);
|
|
1042
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1043
|
+
debug("caret trim", range);
|
|
1044
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1045
|
+
if (loose) {
|
|
1046
|
+
rangeList = rangeList.filter((comp) => {
|
|
1047
|
+
debug("loose invalid filter", comp, this.options);
|
|
1048
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1049
|
+
});
|
|
1050
|
+
}
|
|
1051
|
+
debug("range list", rangeList);
|
|
1052
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
1053
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
1054
|
+
for (const comp of comparators) {
|
|
1055
|
+
if (isNullSet(comp)) {
|
|
1056
|
+
return [comp];
|
|
1057
|
+
}
|
|
1058
|
+
rangeMap.set(comp.value, comp);
|
|
1059
|
+
}
|
|
1060
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
1061
|
+
rangeMap.delete("");
|
|
1062
|
+
}
|
|
1063
|
+
const result = [...rangeMap.values()];
|
|
1064
|
+
cache.set(memoKey, result);
|
|
1065
|
+
return result;
|
|
1066
|
+
}
|
|
1067
|
+
intersects(range, options) {
|
|
1068
|
+
if (!(range instanceof _Range)) {
|
|
1069
|
+
throw new TypeError("a Range is required");
|
|
1070
|
+
}
|
|
1071
|
+
return this.set.some((thisComparators) => {
|
|
1072
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1073
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1074
|
+
return rangeComparators.every((rangeComparator) => {
|
|
1075
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
1076
|
+
});
|
|
1077
|
+
});
|
|
1078
|
+
});
|
|
1079
|
+
});
|
|
1080
|
+
}
|
|
1081
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1082
|
+
test(version) {
|
|
1083
|
+
if (!version) {
|
|
1084
|
+
return false;
|
|
1085
|
+
}
|
|
1086
|
+
if (typeof version === "string") {
|
|
1087
|
+
try {
|
|
1088
|
+
version = new SemVer(version, this.options);
|
|
1089
|
+
} catch (er) {
|
|
1090
|
+
return false;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1094
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
1095
|
+
return true;
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return false;
|
|
1099
|
+
}
|
|
1100
|
+
};
|
|
1101
|
+
module2.exports = Range;
|
|
1102
|
+
var LRU = require_lrucache();
|
|
1103
|
+
var cache = new LRU();
|
|
1104
|
+
var parseOptions = require_parse_options();
|
|
1105
|
+
var Comparator = require_comparator();
|
|
1106
|
+
var debug = require_debug();
|
|
1107
|
+
var SemVer = require_semver();
|
|
1108
|
+
var {
|
|
1109
|
+
safeRe: re,
|
|
1110
|
+
src,
|
|
1111
|
+
t,
|
|
1112
|
+
comparatorTrimReplace,
|
|
1113
|
+
tildeTrimReplace,
|
|
1114
|
+
caretTrimReplace
|
|
1115
|
+
} = require_re();
|
|
1116
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1117
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
1118
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1119
|
+
var isAny = (c) => c.value === "";
|
|
1120
|
+
var isSatisfiable = (comparators, options) => {
|
|
1121
|
+
let result = true;
|
|
1122
|
+
const remainingComparators = comparators.slice();
|
|
1123
|
+
let testComparator = remainingComparators.pop();
|
|
1124
|
+
while (result && remainingComparators.length) {
|
|
1125
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1126
|
+
return testComparator.intersects(otherComparator, options);
|
|
1127
|
+
});
|
|
1128
|
+
testComparator = remainingComparators.pop();
|
|
1129
|
+
}
|
|
1130
|
+
return result;
|
|
1131
|
+
};
|
|
1132
|
+
var parseComparator = (comp, options) => {
|
|
1133
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
1134
|
+
debug("comp", comp, options);
|
|
1135
|
+
comp = replaceCarets(comp, options);
|
|
1136
|
+
debug("caret", comp);
|
|
1137
|
+
comp = replaceTildes(comp, options);
|
|
1138
|
+
debug("tildes", comp);
|
|
1139
|
+
comp = replaceXRanges(comp, options);
|
|
1140
|
+
debug("xrange", comp);
|
|
1141
|
+
comp = replaceStars(comp, options);
|
|
1142
|
+
debug("stars", comp);
|
|
1143
|
+
return comp;
|
|
1144
|
+
};
|
|
1145
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1146
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
1147
|
+
var replaceTildes = (comp, options) => {
|
|
1148
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1149
|
+
};
|
|
1150
|
+
var replaceTilde = (comp, options) => {
|
|
1151
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1152
|
+
const z10 = options.includePrerelease ? "-0" : "";
|
|
1153
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1154
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1155
|
+
let ret;
|
|
1156
|
+
if (isX(M)) {
|
|
1157
|
+
ret = "";
|
|
1158
|
+
} else if (isX(m)) {
|
|
1159
|
+
ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
|
|
1160
|
+
} else if (isX(p)) {
|
|
1161
|
+
ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
|
|
1162
|
+
} else if (pr) {
|
|
1163
|
+
debug("replaceTilde pr", pr);
|
|
1164
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1165
|
+
} else {
|
|
1166
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1167
|
+
}
|
|
1168
|
+
debug("tilde return", ret);
|
|
1169
|
+
return ret;
|
|
1170
|
+
});
|
|
1171
|
+
};
|
|
1172
|
+
var replaceCarets = (comp, options) => {
|
|
1173
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1174
|
+
};
|
|
1175
|
+
var replaceCaret = (comp, options) => {
|
|
1176
|
+
debug("caret", comp, options);
|
|
1177
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1178
|
+
const z10 = options.includePrerelease ? "-0" : "";
|
|
1179
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1180
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1181
|
+
let ret;
|
|
1182
|
+
if (isX(M)) {
|
|
1183
|
+
ret = "";
|
|
1184
|
+
} else if (isX(m)) {
|
|
1185
|
+
ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
|
|
1186
|
+
} else if (isX(p)) {
|
|
1187
|
+
if (M === "0") {
|
|
1188
|
+
ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
|
|
1189
|
+
} else {
|
|
1190
|
+
ret = `>=${M}.${m}.0${z10} <${+M + 1}.0.0-0`;
|
|
1191
|
+
}
|
|
1192
|
+
} else if (pr) {
|
|
1193
|
+
debug("replaceCaret pr", pr);
|
|
1194
|
+
if (M === "0") {
|
|
1195
|
+
if (m === "0") {
|
|
1196
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1197
|
+
} else {
|
|
1198
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1199
|
+
}
|
|
1200
|
+
} else {
|
|
1201
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1202
|
+
}
|
|
1203
|
+
} else {
|
|
1204
|
+
debug("no pr");
|
|
1205
|
+
if (M === "0") {
|
|
1206
|
+
if (m === "0") {
|
|
1207
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
1208
|
+
} else {
|
|
1209
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1210
|
+
}
|
|
1211
|
+
} else {
|
|
1212
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
debug("caret return", ret);
|
|
1216
|
+
return ret;
|
|
1217
|
+
});
|
|
1218
|
+
};
|
|
1219
|
+
var replaceXRanges = (comp, options) => {
|
|
1220
|
+
debug("replaceXRanges", comp, options);
|
|
1221
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1222
|
+
};
|
|
1223
|
+
var replaceXRange = (comp, options) => {
|
|
1224
|
+
comp = comp.trim();
|
|
1225
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1226
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1227
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1228
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
1229
|
+
return comp;
|
|
1230
|
+
}
|
|
1231
|
+
const xM = isX(M);
|
|
1232
|
+
const xm = xM || isX(m);
|
|
1233
|
+
const xp = xm || isX(p);
|
|
1234
|
+
const anyX = xp;
|
|
1235
|
+
if (gtlt === "=" && anyX) {
|
|
1236
|
+
gtlt = "";
|
|
1237
|
+
}
|
|
1238
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1239
|
+
if (xM) {
|
|
1240
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1241
|
+
ret = "<0.0.0-0";
|
|
1242
|
+
} else {
|
|
1243
|
+
ret = "*";
|
|
1244
|
+
}
|
|
1245
|
+
} else if (gtlt && anyX) {
|
|
1246
|
+
if (xm) {
|
|
1247
|
+
m = 0;
|
|
1248
|
+
}
|
|
1249
|
+
p = 0;
|
|
1250
|
+
if (gtlt === ">") {
|
|
1251
|
+
gtlt = ">=";
|
|
1252
|
+
if (xm) {
|
|
1253
|
+
M = +M + 1;
|
|
1254
|
+
m = 0;
|
|
1255
|
+
p = 0;
|
|
1256
|
+
} else {
|
|
1257
|
+
m = +m + 1;
|
|
1258
|
+
p = 0;
|
|
1259
|
+
}
|
|
1260
|
+
} else if (gtlt === "<=") {
|
|
1261
|
+
gtlt = "<";
|
|
1262
|
+
if (xm) {
|
|
1263
|
+
M = +M + 1;
|
|
1264
|
+
} else {
|
|
1265
|
+
m = +m + 1;
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
if (gtlt === "<") {
|
|
1269
|
+
pr = "-0";
|
|
1270
|
+
}
|
|
1271
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1272
|
+
} else if (xm) {
|
|
1273
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1274
|
+
} else if (xp) {
|
|
1275
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1276
|
+
}
|
|
1277
|
+
debug("xRange return", ret);
|
|
1278
|
+
return ret;
|
|
1279
|
+
});
|
|
1280
|
+
};
|
|
1281
|
+
var replaceStars = (comp, options) => {
|
|
1282
|
+
debug("replaceStars", comp, options);
|
|
1283
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1284
|
+
};
|
|
1285
|
+
var replaceGTE0 = (comp, options) => {
|
|
1286
|
+
debug("replaceGTE0", comp, options);
|
|
1287
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1288
|
+
};
|
|
1289
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1290
|
+
if (isX(fM)) {
|
|
1291
|
+
from = "";
|
|
1292
|
+
} else if (isX(fm)) {
|
|
1293
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1294
|
+
} else if (isX(fp)) {
|
|
1295
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1296
|
+
} else if (fpr) {
|
|
1297
|
+
from = `>=${from}`;
|
|
1298
|
+
} else {
|
|
1299
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1300
|
+
}
|
|
1301
|
+
if (isX(tM)) {
|
|
1302
|
+
to = "";
|
|
1303
|
+
} else if (isX(tm)) {
|
|
1304
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1305
|
+
} else if (isX(tp)) {
|
|
1306
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1307
|
+
} else if (tpr) {
|
|
1308
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1309
|
+
} else if (incPr) {
|
|
1310
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1311
|
+
} else {
|
|
1312
|
+
to = `<=${to}`;
|
|
1313
|
+
}
|
|
1314
|
+
return `${from} ${to}`.trim();
|
|
1315
|
+
};
|
|
1316
|
+
var testSet = (set, version, options) => {
|
|
1317
|
+
for (let i = 0; i < set.length; i++) {
|
|
1318
|
+
if (!set[i].test(version)) {
|
|
1319
|
+
return false;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1323
|
+
for (let i = 0; i < set.length; i++) {
|
|
1324
|
+
debug(set[i].semver);
|
|
1325
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1326
|
+
continue;
|
|
1327
|
+
}
|
|
1328
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1329
|
+
const allowed = set[i].semver;
|
|
1330
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1331
|
+
return true;
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
}
|
|
1335
|
+
return false;
|
|
1336
|
+
}
|
|
1337
|
+
return true;
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1340
|
+
});
|
|
1341
|
+
|
|
1342
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
|
|
1343
|
+
var require_comparator = __commonJS({
|
|
1344
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports2, module2) {
|
|
1345
|
+
"use strict";
|
|
1346
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1347
|
+
var Comparator = class _Comparator {
|
|
1348
|
+
static get ANY() {
|
|
1349
|
+
return ANY;
|
|
1350
|
+
}
|
|
1351
|
+
constructor(comp, options) {
|
|
1352
|
+
options = parseOptions(options);
|
|
1353
|
+
if (comp instanceof _Comparator) {
|
|
1354
|
+
if (comp.loose === !!options.loose) {
|
|
1355
|
+
return comp;
|
|
1356
|
+
} else {
|
|
1357
|
+
comp = comp.value;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1361
|
+
debug("comparator", comp, options);
|
|
1362
|
+
this.options = options;
|
|
1363
|
+
this.loose = !!options.loose;
|
|
1364
|
+
this.parse(comp);
|
|
1365
|
+
if (this.semver === ANY) {
|
|
1366
|
+
this.value = "";
|
|
1367
|
+
} else {
|
|
1368
|
+
this.value = this.operator + this.semver.version;
|
|
1369
|
+
}
|
|
1370
|
+
debug("comp", this);
|
|
1371
|
+
}
|
|
1372
|
+
parse(comp) {
|
|
1373
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1374
|
+
const m = comp.match(r);
|
|
1375
|
+
if (!m) {
|
|
1376
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1377
|
+
}
|
|
1378
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1379
|
+
if (this.operator === "=") {
|
|
1380
|
+
this.operator = "";
|
|
1381
|
+
}
|
|
1382
|
+
if (!m[2]) {
|
|
1383
|
+
this.semver = ANY;
|
|
1384
|
+
} else {
|
|
1385
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
toString() {
|
|
1389
|
+
return this.value;
|
|
1390
|
+
}
|
|
1391
|
+
test(version) {
|
|
1392
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1393
|
+
if (this.semver === ANY || version === ANY) {
|
|
1394
|
+
return true;
|
|
1395
|
+
}
|
|
1396
|
+
if (typeof version === "string") {
|
|
1397
|
+
try {
|
|
1398
|
+
version = new SemVer(version, this.options);
|
|
1399
|
+
} catch (er) {
|
|
1400
|
+
return false;
|
|
1401
|
+
}
|
|
1402
|
+
}
|
|
1403
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1404
|
+
}
|
|
1405
|
+
intersects(comp, options) {
|
|
1406
|
+
if (!(comp instanceof _Comparator)) {
|
|
1407
|
+
throw new TypeError("a Comparator is required");
|
|
1408
|
+
}
|
|
1409
|
+
if (this.operator === "") {
|
|
1410
|
+
if (this.value === "") {
|
|
1411
|
+
return true;
|
|
1412
|
+
}
|
|
1413
|
+
return new Range(comp.value, options).test(this.value);
|
|
1414
|
+
} else if (comp.operator === "") {
|
|
1415
|
+
if (comp.value === "") {
|
|
1416
|
+
return true;
|
|
1417
|
+
}
|
|
1418
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1419
|
+
}
|
|
1420
|
+
options = parseOptions(options);
|
|
1421
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1422
|
+
return false;
|
|
1423
|
+
}
|
|
1424
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1425
|
+
return false;
|
|
1426
|
+
}
|
|
1427
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1428
|
+
return true;
|
|
1429
|
+
}
|
|
1430
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1431
|
+
return true;
|
|
1432
|
+
}
|
|
1433
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1434
|
+
return true;
|
|
1435
|
+
}
|
|
1436
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1437
|
+
return true;
|
|
1438
|
+
}
|
|
1439
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1440
|
+
return true;
|
|
1441
|
+
}
|
|
1442
|
+
return false;
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
module2.exports = Comparator;
|
|
1446
|
+
var parseOptions = require_parse_options();
|
|
1447
|
+
var { safeRe: re, t } = require_re();
|
|
1448
|
+
var cmp = require_cmp();
|
|
1449
|
+
var debug = require_debug();
|
|
1450
|
+
var SemVer = require_semver();
|
|
1451
|
+
var Range = require_range();
|
|
1452
|
+
}
|
|
1453
|
+
});
|
|
1454
|
+
|
|
1455
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
|
|
1456
|
+
var require_satisfies = __commonJS({
|
|
1457
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports2, module2) {
|
|
1458
|
+
"use strict";
|
|
1459
|
+
var Range = require_range();
|
|
1460
|
+
var satisfies = (version, range, options) => {
|
|
1461
|
+
try {
|
|
1462
|
+
range = new Range(range, options);
|
|
1463
|
+
} catch (er) {
|
|
1464
|
+
return false;
|
|
1465
|
+
}
|
|
1466
|
+
return range.test(version);
|
|
1467
|
+
};
|
|
1468
|
+
module2.exports = satisfies;
|
|
1469
|
+
}
|
|
1470
|
+
});
|
|
1471
|
+
|
|
1472
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
|
|
1473
|
+
var require_to_comparators = __commonJS({
|
|
1474
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports2, module2) {
|
|
1475
|
+
"use strict";
|
|
1476
|
+
var Range = require_range();
|
|
1477
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1478
|
+
module2.exports = toComparators;
|
|
1479
|
+
}
|
|
1480
|
+
});
|
|
1481
|
+
|
|
1482
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
|
|
1483
|
+
var require_max_satisfying = __commonJS({
|
|
1484
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports2, module2) {
|
|
1485
|
+
"use strict";
|
|
1486
|
+
var SemVer = require_semver();
|
|
1487
|
+
var Range = require_range();
|
|
1488
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1489
|
+
let max = null;
|
|
1490
|
+
let maxSV = null;
|
|
1491
|
+
let rangeObj = null;
|
|
1492
|
+
try {
|
|
1493
|
+
rangeObj = new Range(range, options);
|
|
1494
|
+
} catch (er) {
|
|
1495
|
+
return null;
|
|
1496
|
+
}
|
|
1497
|
+
versions.forEach((v) => {
|
|
1498
|
+
if (rangeObj.test(v)) {
|
|
1499
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1500
|
+
max = v;
|
|
1501
|
+
maxSV = new SemVer(max, options);
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
});
|
|
1505
|
+
return max;
|
|
1506
|
+
};
|
|
1507
|
+
module2.exports = maxSatisfying;
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
|
|
1511
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
|
|
1512
|
+
var require_min_satisfying = __commonJS({
|
|
1513
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports2, module2) {
|
|
1514
|
+
"use strict";
|
|
1515
|
+
var SemVer = require_semver();
|
|
1516
|
+
var Range = require_range();
|
|
1517
|
+
var minSatisfying = (versions, range, options) => {
|
|
1518
|
+
let min = null;
|
|
1519
|
+
let minSV = null;
|
|
1520
|
+
let rangeObj = null;
|
|
1521
|
+
try {
|
|
1522
|
+
rangeObj = new Range(range, options);
|
|
1523
|
+
} catch (er) {
|
|
1524
|
+
return null;
|
|
1525
|
+
}
|
|
1526
|
+
versions.forEach((v) => {
|
|
1527
|
+
if (rangeObj.test(v)) {
|
|
1528
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1529
|
+
min = v;
|
|
1530
|
+
minSV = new SemVer(min, options);
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
});
|
|
1534
|
+
return min;
|
|
1535
|
+
};
|
|
1536
|
+
module2.exports = minSatisfying;
|
|
1537
|
+
}
|
|
1538
|
+
});
|
|
1539
|
+
|
|
1540
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
|
|
1541
|
+
var require_min_version = __commonJS({
|
|
1542
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports2, module2) {
|
|
1543
|
+
"use strict";
|
|
1544
|
+
var SemVer = require_semver();
|
|
1545
|
+
var Range = require_range();
|
|
1546
|
+
var gt = require_gt();
|
|
1547
|
+
var minVersion = (range, loose) => {
|
|
1548
|
+
range = new Range(range, loose);
|
|
1549
|
+
let minver = new SemVer("0.0.0");
|
|
1550
|
+
if (range.test(minver)) {
|
|
1551
|
+
return minver;
|
|
1552
|
+
}
|
|
1553
|
+
minver = new SemVer("0.0.0-0");
|
|
1554
|
+
if (range.test(minver)) {
|
|
1555
|
+
return minver;
|
|
1556
|
+
}
|
|
1557
|
+
minver = null;
|
|
1558
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1559
|
+
const comparators = range.set[i];
|
|
1560
|
+
let setMin = null;
|
|
1561
|
+
comparators.forEach((comparator) => {
|
|
1562
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1563
|
+
switch (comparator.operator) {
|
|
1564
|
+
case ">":
|
|
1565
|
+
if (compver.prerelease.length === 0) {
|
|
1566
|
+
compver.patch++;
|
|
1567
|
+
} else {
|
|
1568
|
+
compver.prerelease.push(0);
|
|
1569
|
+
}
|
|
1570
|
+
compver.raw = compver.format();
|
|
1571
|
+
/* fallthrough */
|
|
1572
|
+
case "":
|
|
1573
|
+
case ">=":
|
|
1574
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1575
|
+
setMin = compver;
|
|
1576
|
+
}
|
|
1577
|
+
break;
|
|
1578
|
+
case "<":
|
|
1579
|
+
case "<=":
|
|
1580
|
+
break;
|
|
1581
|
+
/* istanbul ignore next */
|
|
1582
|
+
default:
|
|
1583
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1584
|
+
}
|
|
1585
|
+
});
|
|
1586
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1587
|
+
minver = setMin;
|
|
1588
|
+
}
|
|
1589
|
+
}
|
|
1590
|
+
if (minver && range.test(minver)) {
|
|
1591
|
+
return minver;
|
|
1592
|
+
}
|
|
1593
|
+
return null;
|
|
1594
|
+
};
|
|
1595
|
+
module2.exports = minVersion;
|
|
1596
|
+
}
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1599
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
|
|
1600
|
+
var require_valid2 = __commonJS({
|
|
1601
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports2, module2) {
|
|
1602
|
+
"use strict";
|
|
1603
|
+
var Range = require_range();
|
|
1604
|
+
var validRange = (range, options) => {
|
|
1605
|
+
try {
|
|
1606
|
+
return new Range(range, options).range || "*";
|
|
1607
|
+
} catch (er) {
|
|
1608
|
+
return null;
|
|
1609
|
+
}
|
|
1610
|
+
};
|
|
1611
|
+
module2.exports = validRange;
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
|
|
1615
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
|
|
1616
|
+
var require_outside = __commonJS({
|
|
1617
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports2, module2) {
|
|
1618
|
+
"use strict";
|
|
1619
|
+
var SemVer = require_semver();
|
|
1620
|
+
var Comparator = require_comparator();
|
|
1621
|
+
var { ANY } = Comparator;
|
|
1622
|
+
var Range = require_range();
|
|
1623
|
+
var satisfies = require_satisfies();
|
|
1624
|
+
var gt = require_gt();
|
|
1625
|
+
var lt = require_lt();
|
|
1626
|
+
var lte = require_lte();
|
|
1627
|
+
var gte = require_gte();
|
|
1628
|
+
var outside = (version, range, hilo, options) => {
|
|
1629
|
+
version = new SemVer(version, options);
|
|
1630
|
+
range = new Range(range, options);
|
|
1631
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1632
|
+
switch (hilo) {
|
|
1633
|
+
case ">":
|
|
1634
|
+
gtfn = gt;
|
|
1635
|
+
ltefn = lte;
|
|
1636
|
+
ltfn = lt;
|
|
1637
|
+
comp = ">";
|
|
1638
|
+
ecomp = ">=";
|
|
1639
|
+
break;
|
|
1640
|
+
case "<":
|
|
1641
|
+
gtfn = lt;
|
|
1642
|
+
ltefn = gte;
|
|
1643
|
+
ltfn = gt;
|
|
1644
|
+
comp = "<";
|
|
1645
|
+
ecomp = "<=";
|
|
1646
|
+
break;
|
|
1647
|
+
default:
|
|
1648
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1649
|
+
}
|
|
1650
|
+
if (satisfies(version, range, options)) {
|
|
1651
|
+
return false;
|
|
1652
|
+
}
|
|
1653
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1654
|
+
const comparators = range.set[i];
|
|
1655
|
+
let high = null;
|
|
1656
|
+
let low = null;
|
|
1657
|
+
comparators.forEach((comparator) => {
|
|
1658
|
+
if (comparator.semver === ANY) {
|
|
1659
|
+
comparator = new Comparator(">=0.0.0");
|
|
1660
|
+
}
|
|
1661
|
+
high = high || comparator;
|
|
1662
|
+
low = low || comparator;
|
|
1663
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1664
|
+
high = comparator;
|
|
1665
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1666
|
+
low = comparator;
|
|
1667
|
+
}
|
|
1668
|
+
});
|
|
1669
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1670
|
+
return false;
|
|
1671
|
+
}
|
|
1672
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1673
|
+
return false;
|
|
1674
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1675
|
+
return false;
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
return true;
|
|
1679
|
+
};
|
|
1680
|
+
module2.exports = outside;
|
|
1681
|
+
}
|
|
1682
|
+
});
|
|
1683
|
+
|
|
1684
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
|
|
1685
|
+
var require_gtr = __commonJS({
|
|
1686
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports2, module2) {
|
|
1687
|
+
"use strict";
|
|
1688
|
+
var outside = require_outside();
|
|
1689
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1690
|
+
module2.exports = gtr;
|
|
1691
|
+
}
|
|
1692
|
+
});
|
|
1693
|
+
|
|
1694
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
|
|
1695
|
+
var require_ltr = __commonJS({
|
|
1696
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports2, module2) {
|
|
1697
|
+
"use strict";
|
|
1698
|
+
var outside = require_outside();
|
|
1699
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1700
|
+
module2.exports = ltr;
|
|
1701
|
+
}
|
|
1702
|
+
});
|
|
1703
|
+
|
|
1704
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
|
|
1705
|
+
var require_intersects = __commonJS({
|
|
1706
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports2, module2) {
|
|
1707
|
+
"use strict";
|
|
1708
|
+
var Range = require_range();
|
|
1709
|
+
var intersects = (r1, r2, options) => {
|
|
1710
|
+
r1 = new Range(r1, options);
|
|
1711
|
+
r2 = new Range(r2, options);
|
|
1712
|
+
return r1.intersects(r2, options);
|
|
1713
|
+
};
|
|
1714
|
+
module2.exports = intersects;
|
|
1715
|
+
}
|
|
1716
|
+
});
|
|
1717
|
+
|
|
1718
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
|
|
1719
|
+
var require_simplify = __commonJS({
|
|
1720
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports2, module2) {
|
|
1721
|
+
"use strict";
|
|
1722
|
+
var satisfies = require_satisfies();
|
|
1723
|
+
var compare = require_compare();
|
|
1724
|
+
module2.exports = (versions, range, options) => {
|
|
1725
|
+
const set = [];
|
|
1726
|
+
let first = null;
|
|
1727
|
+
let prev = null;
|
|
1728
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1729
|
+
for (const version of v) {
|
|
1730
|
+
const included = satisfies(version, range, options);
|
|
1731
|
+
if (included) {
|
|
1732
|
+
prev = version;
|
|
1733
|
+
if (!first) {
|
|
1734
|
+
first = version;
|
|
1735
|
+
}
|
|
1736
|
+
} else {
|
|
1737
|
+
if (prev) {
|
|
1738
|
+
set.push([first, prev]);
|
|
1739
|
+
}
|
|
1740
|
+
prev = null;
|
|
1741
|
+
first = null;
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
if (first) {
|
|
1745
|
+
set.push([first, null]);
|
|
1746
|
+
}
|
|
1747
|
+
const ranges = [];
|
|
1748
|
+
for (const [min, max] of set) {
|
|
1749
|
+
if (min === max) {
|
|
1750
|
+
ranges.push(min);
|
|
1751
|
+
} else if (!max && min === v[0]) {
|
|
1752
|
+
ranges.push("*");
|
|
1753
|
+
} else if (!max) {
|
|
1754
|
+
ranges.push(`>=${min}`);
|
|
1755
|
+
} else if (min === v[0]) {
|
|
1756
|
+
ranges.push(`<=${max}`);
|
|
1757
|
+
} else {
|
|
1758
|
+
ranges.push(`${min} - ${max}`);
|
|
1759
|
+
}
|
|
1760
|
+
}
|
|
1761
|
+
const simplified = ranges.join(" || ");
|
|
1762
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1763
|
+
return simplified.length < original.length ? simplified : range;
|
|
1764
|
+
};
|
|
1765
|
+
}
|
|
1766
|
+
});
|
|
1767
|
+
|
|
1768
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
|
|
1769
|
+
var require_subset = __commonJS({
|
|
1770
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports2, module2) {
|
|
1771
|
+
"use strict";
|
|
1772
|
+
var Range = require_range();
|
|
1773
|
+
var Comparator = require_comparator();
|
|
1774
|
+
var { ANY } = Comparator;
|
|
1775
|
+
var satisfies = require_satisfies();
|
|
1776
|
+
var compare = require_compare();
|
|
1777
|
+
var subset = (sub, dom, options = {}) => {
|
|
1778
|
+
if (sub === dom) {
|
|
1779
|
+
return true;
|
|
1780
|
+
}
|
|
1781
|
+
sub = new Range(sub, options);
|
|
1782
|
+
dom = new Range(dom, options);
|
|
1783
|
+
let sawNonNull = false;
|
|
1784
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1785
|
+
for (const simpleDom of dom.set) {
|
|
1786
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1787
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1788
|
+
if (isSub) {
|
|
1789
|
+
continue OUTER;
|
|
1790
|
+
}
|
|
1791
|
+
}
|
|
1792
|
+
if (sawNonNull) {
|
|
1793
|
+
return false;
|
|
1794
|
+
}
|
|
1795
|
+
}
|
|
1796
|
+
return true;
|
|
1797
|
+
};
|
|
1798
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1799
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1800
|
+
var simpleSubset = (sub, dom, options) => {
|
|
1801
|
+
if (sub === dom) {
|
|
1802
|
+
return true;
|
|
1803
|
+
}
|
|
1804
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1805
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1806
|
+
return true;
|
|
1807
|
+
} else if (options.includePrerelease) {
|
|
1808
|
+
sub = minimumVersionWithPreRelease;
|
|
1809
|
+
} else {
|
|
1810
|
+
sub = minimumVersion;
|
|
1811
|
+
}
|
|
1812
|
+
}
|
|
1813
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1814
|
+
if (options.includePrerelease) {
|
|
1815
|
+
return true;
|
|
1816
|
+
} else {
|
|
1817
|
+
dom = minimumVersion;
|
|
1818
|
+
}
|
|
1819
|
+
}
|
|
1820
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1821
|
+
let gt, lt;
|
|
1822
|
+
for (const c of sub) {
|
|
1823
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1824
|
+
gt = higherGT(gt, c, options);
|
|
1825
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1826
|
+
lt = lowerLT(lt, c, options);
|
|
1827
|
+
} else {
|
|
1828
|
+
eqSet.add(c.semver);
|
|
1829
|
+
}
|
|
1830
|
+
}
|
|
1831
|
+
if (eqSet.size > 1) {
|
|
1832
|
+
return null;
|
|
1833
|
+
}
|
|
1834
|
+
let gtltComp;
|
|
1835
|
+
if (gt && lt) {
|
|
1836
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1837
|
+
if (gtltComp > 0) {
|
|
1838
|
+
return null;
|
|
1839
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1840
|
+
return null;
|
|
1841
|
+
}
|
|
1842
|
+
}
|
|
1843
|
+
for (const eq of eqSet) {
|
|
1844
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1845
|
+
return null;
|
|
1846
|
+
}
|
|
1847
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1848
|
+
return null;
|
|
1849
|
+
}
|
|
1850
|
+
for (const c of dom) {
|
|
1851
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1852
|
+
return false;
|
|
1853
|
+
}
|
|
1854
|
+
}
|
|
1855
|
+
return true;
|
|
1856
|
+
}
|
|
1857
|
+
let higher, lower;
|
|
1858
|
+
let hasDomLT, hasDomGT;
|
|
1859
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1860
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1861
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1862
|
+
needDomLTPre = false;
|
|
1863
|
+
}
|
|
1864
|
+
for (const c of dom) {
|
|
1865
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1866
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1867
|
+
if (gt) {
|
|
1868
|
+
if (needDomGTPre) {
|
|
1869
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1870
|
+
needDomGTPre = false;
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1874
|
+
higher = higherGT(gt, c, options);
|
|
1875
|
+
if (higher === c && higher !== gt) {
|
|
1876
|
+
return false;
|
|
1877
|
+
}
|
|
1878
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
1879
|
+
return false;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
if (lt) {
|
|
1883
|
+
if (needDomLTPre) {
|
|
1884
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1885
|
+
needDomLTPre = false;
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1889
|
+
lower = lowerLT(lt, c, options);
|
|
1890
|
+
if (lower === c && lower !== lt) {
|
|
1891
|
+
return false;
|
|
1892
|
+
}
|
|
1893
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
1894
|
+
return false;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1898
|
+
return false;
|
|
1899
|
+
}
|
|
1900
|
+
}
|
|
1901
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1902
|
+
return false;
|
|
1903
|
+
}
|
|
1904
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1905
|
+
return false;
|
|
1906
|
+
}
|
|
1907
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1908
|
+
return false;
|
|
1909
|
+
}
|
|
1910
|
+
return true;
|
|
1911
|
+
};
|
|
1912
|
+
var higherGT = (a, b, options) => {
|
|
1913
|
+
if (!a) {
|
|
1914
|
+
return b;
|
|
1915
|
+
}
|
|
1916
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1917
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1918
|
+
};
|
|
1919
|
+
var lowerLT = (a, b, options) => {
|
|
1920
|
+
if (!a) {
|
|
1921
|
+
return b;
|
|
1922
|
+
}
|
|
1923
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1924
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1925
|
+
};
|
|
1926
|
+
module2.exports = subset;
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
|
|
1930
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
|
|
1931
|
+
var require_semver2 = __commonJS({
|
|
1932
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports2, module2) {
|
|
1933
|
+
"use strict";
|
|
1934
|
+
var internalRe = require_re();
|
|
1935
|
+
var constants = require_constants();
|
|
1936
|
+
var SemVer = require_semver();
|
|
1937
|
+
var identifiers = require_identifiers();
|
|
1938
|
+
var parse = require_parse();
|
|
1939
|
+
var valid = require_valid();
|
|
1940
|
+
var clean = require_clean();
|
|
1941
|
+
var inc = require_inc();
|
|
1942
|
+
var diff = require_diff();
|
|
1943
|
+
var major = require_major();
|
|
1944
|
+
var minor = require_minor();
|
|
1945
|
+
var patch = require_patch();
|
|
1946
|
+
var prerelease = require_prerelease();
|
|
1947
|
+
var compare = require_compare();
|
|
1948
|
+
var rcompare = require_rcompare();
|
|
1949
|
+
var compareLoose = require_compare_loose();
|
|
1950
|
+
var compareBuild = require_compare_build();
|
|
1951
|
+
var sort = require_sort();
|
|
1952
|
+
var rsort = require_rsort();
|
|
1953
|
+
var gt = require_gt();
|
|
1954
|
+
var lt = require_lt();
|
|
1955
|
+
var eq = require_eq();
|
|
1956
|
+
var neq = require_neq();
|
|
1957
|
+
var gte = require_gte();
|
|
1958
|
+
var lte = require_lte();
|
|
1959
|
+
var cmp = require_cmp();
|
|
1960
|
+
var coerce = require_coerce();
|
|
1961
|
+
var truncate = require_truncate();
|
|
1962
|
+
var Comparator = require_comparator();
|
|
1963
|
+
var Range = require_range();
|
|
1964
|
+
var satisfies = require_satisfies();
|
|
1965
|
+
var toComparators = require_to_comparators();
|
|
1966
|
+
var maxSatisfying = require_max_satisfying();
|
|
1967
|
+
var minSatisfying = require_min_satisfying();
|
|
1968
|
+
var minVersion = require_min_version();
|
|
1969
|
+
var validRange = require_valid2();
|
|
1970
|
+
var outside = require_outside();
|
|
1971
|
+
var gtr = require_gtr();
|
|
1972
|
+
var ltr = require_ltr();
|
|
1973
|
+
var intersects = require_intersects();
|
|
1974
|
+
var simplifyRange = require_simplify();
|
|
1975
|
+
var subset = require_subset();
|
|
1976
|
+
module2.exports = {
|
|
1977
|
+
parse,
|
|
1978
|
+
valid,
|
|
1979
|
+
clean,
|
|
1980
|
+
inc,
|
|
1981
|
+
diff,
|
|
1982
|
+
major,
|
|
1983
|
+
minor,
|
|
1984
|
+
patch,
|
|
1985
|
+
prerelease,
|
|
1986
|
+
compare,
|
|
1987
|
+
rcompare,
|
|
1988
|
+
compareLoose,
|
|
1989
|
+
compareBuild,
|
|
1990
|
+
sort,
|
|
1991
|
+
rsort,
|
|
1992
|
+
gt,
|
|
1993
|
+
lt,
|
|
1994
|
+
eq,
|
|
1995
|
+
neq,
|
|
1996
|
+
gte,
|
|
1997
|
+
lte,
|
|
1998
|
+
cmp,
|
|
1999
|
+
coerce,
|
|
2000
|
+
truncate,
|
|
2001
|
+
Comparator,
|
|
2002
|
+
Range,
|
|
2003
|
+
satisfies,
|
|
2004
|
+
toComparators,
|
|
2005
|
+
maxSatisfying,
|
|
2006
|
+
minSatisfying,
|
|
2007
|
+
minVersion,
|
|
2008
|
+
validRange,
|
|
2009
|
+
outside,
|
|
2010
|
+
gtr,
|
|
2011
|
+
ltr,
|
|
2012
|
+
intersects,
|
|
2013
|
+
simplifyRange,
|
|
2014
|
+
subset,
|
|
2015
|
+
SemVer,
|
|
2016
|
+
re: internalRe.re,
|
|
2017
|
+
src: internalRe.src,
|
|
2018
|
+
tokens: internalRe.t,
|
|
2019
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
2020
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
2021
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2022
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2023
|
+
};
|
|
2024
|
+
}
|
|
2025
|
+
});
|
|
29
2026
|
|
|
30
2027
|
// src/index.ts
|
|
31
2028
|
var index_exports = {};
|
|
@@ -425,7 +2422,14 @@ var moduleManifestSchema = import_zod.z.object({
|
|
|
425
2422
|
*/
|
|
426
2423
|
seeds: import_zod.z.array(seedBundleSchema).optional(),
|
|
427
2424
|
/** npm packages the source imports beyond the base app. Names only; the rail installs each at the home app's range. */
|
|
428
|
-
packages: import_zod.z.array(npmPackageNameSchema).optional()
|
|
2425
|
+
packages: import_zod.z.array(npmPackageNameSchema).optional(),
|
|
2426
|
+
/**
|
|
2427
|
+
* UI-layer contract. `separable: true` asserts the Module's components/ and
|
|
2428
|
+
* routes/ hold presentation only — the Blueprint's
|
|
2429
|
+
* `module-boundaries/ui-layer` lint rule enforces it — so a fork may
|
|
2430
|
+
* soft-eject them. See docs/module-ui-soft-eject-plan.md.
|
|
2431
|
+
*/
|
|
2432
|
+
ui: import_zod.z.object({ separable: import_zod.z.boolean() }).strict().optional()
|
|
429
2433
|
}).strict().superRefine((manifest, ctx) => {
|
|
430
2434
|
if (manifest.uses.includes(manifest.name)) {
|
|
431
2435
|
ctx.addIssue({
|
|
@@ -2272,6 +4276,40 @@ function cloneTree(value) {
|
|
|
2272
4276
|
}
|
|
2273
4277
|
return clone;
|
|
2274
4278
|
}
|
|
4279
|
+
function collectLeafPaths(value, path3, out) {
|
|
4280
|
+
if (typeof value === "string") {
|
|
4281
|
+
out.push(path3);
|
|
4282
|
+
return;
|
|
4283
|
+
}
|
|
4284
|
+
assertMessageTree(value, path3);
|
|
4285
|
+
for (const [key, child] of Object.entries(value)) collectLeafPaths(child, `${path3}.${key}`, out);
|
|
4286
|
+
}
|
|
4287
|
+
function overrideInto(target, source, owner, path3, missing) {
|
|
4288
|
+
for (const [key, value] of Object.entries(source)) {
|
|
4289
|
+
const nextPath = path3 ? `${path3}.${key}` : key;
|
|
4290
|
+
if (!Object.prototype.hasOwnProperty.call(target, key)) {
|
|
4291
|
+
collectLeafPaths(value, nextPath, missing);
|
|
4292
|
+
continue;
|
|
4293
|
+
}
|
|
4294
|
+
const existing = target[key];
|
|
4295
|
+
if (typeof value === "string") {
|
|
4296
|
+
if (typeof existing !== "string") {
|
|
4297
|
+
throw new Error(
|
|
4298
|
+
`[ModuleRail] composition artifacts: i18n merge conflict at ${nextPath}: ${owner} has string leaf but another owner has an object`
|
|
4299
|
+
);
|
|
4300
|
+
}
|
|
4301
|
+
target[key] = value;
|
|
4302
|
+
continue;
|
|
4303
|
+
}
|
|
4304
|
+
assertMessageTree(value, nextPath);
|
|
4305
|
+
if (typeof existing === "string") {
|
|
4306
|
+
throw new Error(
|
|
4307
|
+
`[ModuleRail] composition artifacts: i18n merge conflict at ${nextPath}: ${owner} has object but another owner has a string leaf`
|
|
4308
|
+
);
|
|
4309
|
+
}
|
|
4310
|
+
overrideInto(existing, value, owner, nextPath, missing);
|
|
4311
|
+
}
|
|
4312
|
+
}
|
|
2275
4313
|
function composeLocaleMessagesForPlan(layers) {
|
|
2276
4314
|
const result = createMessageTree();
|
|
2277
4315
|
const leafOwners = /* @__PURE__ */ new Map();
|
|
@@ -2323,7 +4361,17 @@ function composeLocaleMessagesForPlan(layers) {
|
|
|
2323
4361
|
}
|
|
2324
4362
|
for (const layer of layers) {
|
|
2325
4363
|
assertMessageTree(layer.messages, layer.owner);
|
|
2326
|
-
|
|
4364
|
+
if (!layer.override) {
|
|
4365
|
+
mergeInto(result, cloneTree(layer.messages), layer.owner, "");
|
|
4366
|
+
continue;
|
|
4367
|
+
}
|
|
4368
|
+
const missing = [];
|
|
4369
|
+
overrideInto(result, cloneTree(layer.messages), layer.owner, "", missing);
|
|
4370
|
+
if (missing.length > 0) {
|
|
4371
|
+
throw new Error(
|
|
4372
|
+
`[ModuleRail] composition artifacts: i18n override in ${layer.owner} replaces keys that no Module or substrate defines: ${missing.join(", ")}`
|
|
4373
|
+
);
|
|
4374
|
+
}
|
|
2327
4375
|
}
|
|
2328
4376
|
return result;
|
|
2329
4377
|
}
|
|
@@ -2502,6 +4550,7 @@ function emitModuleI18nGenTs(input) {
|
|
|
2502
4550
|
);
|
|
2503
4551
|
}
|
|
2504
4552
|
const targetLocales = substrate.map((l) => l.locale);
|
|
4553
|
+
const overrideByLocale = indexOverrideLocales(input.overrideLocales ?? [], targetLocales);
|
|
2505
4554
|
const installed = new Set(input.registry.modules.map((m) => m.name));
|
|
2506
4555
|
const allLayers = input.moduleLayers ? [...input.moduleLayers] : deriveModuleLocaleLayers(input.registry, input.facts);
|
|
2507
4556
|
const layers = allLayers.filter((layer) => installed.has(layer.owner.split("/")[0]));
|
|
@@ -2522,19 +4571,38 @@ function emitModuleI18nGenTs(input) {
|
|
|
2522
4571
|
const messages = layer.localeMessages[locale] ?? (locale === "en" ? layer.enMessages : layer.enMessages);
|
|
2523
4572
|
composeLayers.push({ owner: layer.sourceLabel, messages });
|
|
2524
4573
|
}
|
|
4574
|
+
const override = overrideByLocale.get(locale);
|
|
4575
|
+
if (override) {
|
|
4576
|
+
composeLayers.push({
|
|
4577
|
+
owner: overrideOwner(locale),
|
|
4578
|
+
messages: override.messages,
|
|
4579
|
+
override: true
|
|
4580
|
+
});
|
|
4581
|
+
}
|
|
2525
4582
|
composeLocaleMessagesForPlan(composeLayers);
|
|
2526
4583
|
}
|
|
2527
4584
|
const composeImport = 'import { composeLocaleMessages } from "@/lib/i18n/compose-messages";';
|
|
2528
4585
|
const moduleJsonImports = [];
|
|
2529
4586
|
const relativeSubstrateImports = [];
|
|
2530
4587
|
const substrateIdentByLocale = {};
|
|
4588
|
+
const overrideIdentByLocale = {};
|
|
2531
4589
|
targetLocales.forEach((locale, localeIdx) => {
|
|
2532
4590
|
const ident = `i18nSubstrateLoc${localeIdx}`;
|
|
2533
4591
|
relativeSubstrateImports.push(
|
|
2534
4592
|
`import ${ident} from ${JSON.stringify(`./lib/i18n/substrate/${locale}.json`)};`
|
|
2535
4593
|
);
|
|
2536
4594
|
substrateIdentByLocale[locale] = ident;
|
|
4595
|
+
if (overrideByLocale.has(locale)) {
|
|
4596
|
+
const overrideIdent = `i18nOverrideLoc${localeIdx}`;
|
|
4597
|
+
relativeSubstrateImports.push(
|
|
4598
|
+
`import ${overrideIdent} from ${JSON.stringify(`./${overrideOwner(locale)}`)};`
|
|
4599
|
+
);
|
|
4600
|
+
overrideIdentByLocale[locale] = overrideIdent;
|
|
4601
|
+
}
|
|
2537
4602
|
});
|
|
4603
|
+
relativeSubstrateImports.sort(
|
|
4604
|
+
(a, b) => compareImportSpecifiers(a.match(/ from (.+);$/)[1], b.match(/ from (.+);$/)[1])
|
|
4605
|
+
);
|
|
2538
4606
|
const layerIdents = [];
|
|
2539
4607
|
layers.forEach((layer, layerIdx) => {
|
|
2540
4608
|
const localeIdents = {};
|
|
@@ -2568,15 +4636,29 @@ function emitModuleI18nGenTs(input) {
|
|
|
2568
4636
|
(layer) => ` { owner: ${JSON.stringify(layer.owner)}, messages: ${layer.localeIdents[locale]} },`
|
|
2569
4637
|
)
|
|
2570
4638
|
];
|
|
4639
|
+
const overrideIdent = overrideIdentByLocale[locale];
|
|
4640
|
+
const messageLines = overrideIdent ? [
|
|
4641
|
+
" messages: composeLocaleMessages([",
|
|
4642
|
+
" ...[",
|
|
4643
|
+
...layerLines,
|
|
4644
|
+
" ].map((layer) => ({",
|
|
4645
|
+
" ...layer,",
|
|
4646
|
+
' disabled: layer.owner !== "substrate" && !layer.owner.split("/").every(enabled),',
|
|
4647
|
+
" })),",
|
|
4648
|
+
` { owner: ${JSON.stringify(overrideOwner(locale))}, messages: ${overrideIdent}, override: true },`,
|
|
4649
|
+
" ]),"
|
|
4650
|
+
] : [
|
|
4651
|
+
" messages: composeLocaleMessages([",
|
|
4652
|
+
...layerLines,
|
|
4653
|
+
" ].filter((layer) =>",
|
|
4654
|
+
' layer.owner === "substrate" || layer.owner.split("/").every(enabled)',
|
|
4655
|
+
" )),"
|
|
4656
|
+
];
|
|
2571
4657
|
bundleBlocks.push(
|
|
2572
4658
|
[
|
|
2573
4659
|
` ${JSON.stringify(locale)}: {`,
|
|
2574
4660
|
` locale: ${JSON.stringify(locale)},`,
|
|
2575
|
-
|
|
2576
|
-
...layerLines,
|
|
2577
|
-
" ].filter((layer) =>",
|
|
2578
|
-
' layer.owner === "substrate" || layer.owner.split("/").every(enabled)',
|
|
2579
|
-
" )),",
|
|
4661
|
+
...messageLines,
|
|
2580
4662
|
" }"
|
|
2581
4663
|
].join("\n")
|
|
2582
4664
|
);
|
|
@@ -2621,6 +4703,26 @@ function emitModuleI18nGenTs(input) {
|
|
|
2621
4703
|
""
|
|
2622
4704
|
].join("\n");
|
|
2623
4705
|
}
|
|
4706
|
+
function indexOverrideLocales(overrideLocales, targetLocales) {
|
|
4707
|
+
const byLocale = /* @__PURE__ */ new Map();
|
|
4708
|
+
for (const layer of overrideLocales) {
|
|
4709
|
+
if (!isValidLocaleBasename(layer.locale)) {
|
|
4710
|
+
throw new Error(
|
|
4711
|
+
`[ModuleRail] composition artifacts: unsafe override locale basename "${layer.locale}"`
|
|
4712
|
+
);
|
|
4713
|
+
}
|
|
4714
|
+
if (!targetLocales.includes(layer.locale)) {
|
|
4715
|
+
throw new Error(
|
|
4716
|
+
`[ModuleRail] composition artifacts: ${overrideOwner(layer.locale)} has no matching lib/i18n/substrate/${layer.locale}.json; add that substrate file to make ${layer.locale} an app locale`
|
|
4717
|
+
);
|
|
4718
|
+
}
|
|
4719
|
+
byLocale.set(layer.locale, layer);
|
|
4720
|
+
}
|
|
4721
|
+
return byLocale;
|
|
4722
|
+
}
|
|
4723
|
+
function overrideOwner(locale) {
|
|
4724
|
+
return `lib/i18n/overrides/${locale}.json`;
|
|
4725
|
+
}
|
|
2624
4726
|
function deriveModuleLocaleLayers(registry, facts) {
|
|
2625
4727
|
const layers = [];
|
|
2626
4728
|
const installed = new Set(registry.modules.map((m) => m.name));
|
|
@@ -3499,7 +5601,8 @@ function planCompositionArtifacts(input) {
|
|
|
3499
5601
|
registry: input.registry,
|
|
3500
5602
|
facts: compositionEntryFacts,
|
|
3501
5603
|
substrateLocales,
|
|
3502
|
-
moduleLayers: input.moduleLocaleLayers
|
|
5604
|
+
moduleLayers: input.moduleLocaleLayers,
|
|
5605
|
+
overrideLocales: input.overrideLocales
|
|
3503
5606
|
});
|
|
3504
5607
|
initContent = emitModuleInitServerGenTs({
|
|
3505
5608
|
registry: input.registry,
|
|
@@ -3615,11 +5718,27 @@ function dirnamePosix(filePath) {
|
|
|
3615
5718
|
}
|
|
3616
5719
|
|
|
3617
5720
|
// ../../packages/lib/src/server/module-rail/compose-inputs.ts
|
|
5721
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
5722
|
+
var TYPED_STORES_MIN_COMPOSE_VERSION = "0.4.0";
|
|
5723
|
+
var COMPOSE_PACKAGE = "@stardeck-customer-apps/compose";
|
|
5724
|
+
var APP_PACKAGE_JSON_PATH = "apps/web/package.json";
|
|
5725
|
+
async function checkoutParsesTypedStores(sandbox) {
|
|
5726
|
+
try {
|
|
5727
|
+
if (!await sandbox.fileExists(APP_PACKAGE_JSON_PATH)) return false;
|
|
5728
|
+
const pkg = JSON.parse(await sandbox.readFile(APP_PACKAGE_JSON_PATH));
|
|
5729
|
+
const range = pkg.devDependencies?.[COMPOSE_PACKAGE] ?? pkg.dependencies?.[COMPOSE_PACKAGE];
|
|
5730
|
+
if (!range) return false;
|
|
5731
|
+
const lowest = import_semver.default.minVersion(range);
|
|
5732
|
+
return lowest != null && import_semver.default.gte(lowest, TYPED_STORES_MIN_COMPOSE_VERSION);
|
|
5733
|
+
} catch {
|
|
5734
|
+
return false;
|
|
5735
|
+
}
|
|
5736
|
+
}
|
|
3618
5737
|
async function buildComposeInputs(input) {
|
|
3619
|
-
const { db, projectId, deps } = input;
|
|
3620
|
-
|
|
3621
|
-
|
|
3622
|
-
);
|
|
5738
|
+
const { db, projectId, deps, typedStores } = input;
|
|
5739
|
+
console.log(`[ComposeInputs] project=${projectId} typedStores=${typedStores}`);
|
|
5740
|
+
const allStores = await deps.listConnectedStoresForProject(db, projectId);
|
|
5741
|
+
const connectedStores = typedStores ? allStores : allStores.filter((store) => store.type === "database");
|
|
3623
5742
|
const installRows = await Promise.all(
|
|
3624
5743
|
input.moduleNames.map(async (moduleName) => ({
|
|
3625
5744
|
moduleName,
|
|
@@ -3635,6 +5754,7 @@ async function buildComposeInputs(input) {
|
|
|
3635
5754
|
};
|
|
3636
5755
|
}
|
|
3637
5756
|
const parsed = composeInputsSchema.parse({ connectedStores, installs });
|
|
5757
|
+
if (typedStores) return parsed;
|
|
3638
5758
|
return {
|
|
3639
5759
|
...parsed,
|
|
3640
5760
|
connectedStores: parsed.connectedStores.map(({ type: _type, ...store }) => store)
|
|
@@ -4365,7 +6485,8 @@ async function writeComposeInputs(target) {
|
|
|
4365
6485
|
db: target.db,
|
|
4366
6486
|
projectId: target.projectId,
|
|
4367
6487
|
deps: target.deps,
|
|
4368
|
-
moduleNames
|
|
6488
|
+
moduleNames,
|
|
6489
|
+
typedStores: await checkoutParsesTypedStores(target.sandbox)
|
|
4369
6490
|
});
|
|
4370
6491
|
const content = `${JSON.stringify(inputs, null, 2)}
|
|
4371
6492
|
`;
|
|
@@ -4826,7 +6947,8 @@ async function collectCompositionEntryFacts(context, registry) {
|
|
|
4826
6947
|
`[ModuleRail] runId=${context.runId} collecting composition entry facts modules=${registry.modules.length}`
|
|
4827
6948
|
);
|
|
4828
6949
|
const substrateDir = `${APP_PACKAGE_DIR}/src/lib/i18n/substrate`;
|
|
4829
|
-
const
|
|
6950
|
+
const overridesDir = `${APP_PACKAGE_DIR}/src/lib/i18n/overrides`;
|
|
6951
|
+
const localeDirs = [substrateDir, overridesDir];
|
|
4830
6952
|
const conventionalPaths = [];
|
|
4831
6953
|
for (const mod of registry.modules) {
|
|
4832
6954
|
const modulePath = `${MODULES_SANDBOX_DIR}/${mod.name}`;
|
|
@@ -4877,6 +6999,12 @@ async function collectCompositionEntryFacts(context, registry) {
|
|
|
4877
6999
|
messages: await readJsonObjectFile(localePath, files)
|
|
4878
7000
|
});
|
|
4879
7001
|
}
|
|
7002
|
+
const overrideLocales = [];
|
|
7003
|
+
for (const locale of localesByDir.get(overridesDir) ?? []) {
|
|
7004
|
+
const localePath = `${overridesDir}/${locale}.json`;
|
|
7005
|
+
assertRealLocaleJsonFilePresence(localePath, localePresences.get(localePath) ?? "unreadable");
|
|
7006
|
+
overrideLocales.push({ locale, messages: await readJsonObjectFile(localePath, files) });
|
|
7007
|
+
}
|
|
4880
7008
|
const facts = [];
|
|
4881
7009
|
const moduleLocaleLayers = [];
|
|
4882
7010
|
for (const mod of registry.modules) {
|
|
@@ -5003,9 +7131,9 @@ async function collectCompositionEntryFacts(context, registry) {
|
|
|
5003
7131
|
facts.sort((a, b) => a.moduleName.localeCompare(b.moduleName));
|
|
5004
7132
|
moduleLocaleLayers.sort((a, b) => a.sourceLabel.localeCompare(b.sourceLabel));
|
|
5005
7133
|
console.log(
|
|
5006
|
-
`[ModuleRail] runId=${context.runId} composition entry facts modules=${facts.length} substrateLocales=${substrateLocales.length} moduleLocaleLayers=${moduleLocaleLayers.length}`
|
|
7134
|
+
`[ModuleRail] runId=${context.runId} composition entry facts modules=${facts.length} substrateLocales=${substrateLocales.length} overrideLocales=${overrideLocales.map((layer) => layer.locale).join(",") || "none"} moduleLocaleLayers=${moduleLocaleLayers.length}`
|
|
5007
7135
|
);
|
|
5008
|
-
return { facts, substrateLocales, moduleLocaleLayers };
|
|
7136
|
+
return { facts, substrateLocales, overrideLocales, moduleLocaleLayers };
|
|
5009
7137
|
}
|
|
5010
7138
|
function selectComposedModules(presentNames, manifestsByName, enabledRaw) {
|
|
5011
7139
|
if (enabledRaw) {
|
|
@@ -5145,6 +7273,7 @@ async function reconcileCompositionArtifacts(context, options = {}) {
|
|
|
5145
7273
|
const {
|
|
5146
7274
|
facts: compositionEntryFacts,
|
|
5147
7275
|
substrateLocales,
|
|
7276
|
+
overrideLocales,
|
|
5148
7277
|
moduleLocaleLayers
|
|
5149
7278
|
} = await collectCompositionEntryFacts(context, registry);
|
|
5150
7279
|
const candidatePaths = /* @__PURE__ */ new Set([
|
|
@@ -5167,6 +7296,7 @@ async function reconcileCompositionArtifacts(context, options = {}) {
|
|
|
5167
7296
|
existingAppRoutes,
|
|
5168
7297
|
compositionEntryFacts,
|
|
5169
7298
|
substrateLocales,
|
|
7299
|
+
overrideLocales,
|
|
5170
7300
|
moduleLocaleLayers,
|
|
5171
7301
|
moduleDataStoreBindings
|
|
5172
7302
|
});
|
|
@@ -5235,6 +7365,7 @@ async function reconcileCompositionArtifacts(context, options = {}) {
|
|
|
5235
7365
|
existingAppRoutes,
|
|
5236
7366
|
compositionEntryFacts,
|
|
5237
7367
|
substrateLocales,
|
|
7368
|
+
overrideLocales,
|
|
5238
7369
|
moduleLocaleLayers,
|
|
5239
7370
|
moduleDataStoreBindings
|
|
5240
7371
|
});
|