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