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