@stardeck-customer-apps/compose 0.3.0 → 0.5.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 +6 -1
- package/dist/cli.js +2102 -24
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +2103 -25
- package/dist/index.mjs +2115 -14
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,3 +1,2023 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
+
mod
|
|
25
|
+
));
|
|
26
|
+
|
|
27
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js
|
|
28
|
+
var require_constants = __commonJS({
|
|
29
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/constants.js"(exports, module) {
|
|
30
|
+
"use strict";
|
|
31
|
+
var SEMVER_SPEC_VERSION = "2.0.0";
|
|
32
|
+
var MAX_LENGTH = 256;
|
|
33
|
+
var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
34
|
+
9007199254740991;
|
|
35
|
+
var MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
36
|
+
var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
37
|
+
var RELEASE_TYPES = [
|
|
38
|
+
"major",
|
|
39
|
+
"premajor",
|
|
40
|
+
"minor",
|
|
41
|
+
"preminor",
|
|
42
|
+
"patch",
|
|
43
|
+
"prepatch",
|
|
44
|
+
"prerelease"
|
|
45
|
+
];
|
|
46
|
+
module.exports = {
|
|
47
|
+
MAX_LENGTH,
|
|
48
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
49
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
50
|
+
MAX_SAFE_INTEGER,
|
|
51
|
+
RELEASE_TYPES,
|
|
52
|
+
SEMVER_SPEC_VERSION,
|
|
53
|
+
FLAG_INCLUDE_PRERELEASE: 1,
|
|
54
|
+
FLAG_LOOSE: 2
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js
|
|
60
|
+
var require_debug = __commonJS({
|
|
61
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/debug.js"(exports, module) {
|
|
62
|
+
"use strict";
|
|
63
|
+
var debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
64
|
+
};
|
|
65
|
+
module.exports = debug;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js
|
|
70
|
+
var require_re = __commonJS({
|
|
71
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/re.js"(exports, module) {
|
|
72
|
+
"use strict";
|
|
73
|
+
var {
|
|
74
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
75
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
76
|
+
MAX_LENGTH
|
|
77
|
+
} = require_constants();
|
|
78
|
+
var debug = require_debug();
|
|
79
|
+
exports = module.exports = {};
|
|
80
|
+
var re = exports.re = [];
|
|
81
|
+
var safeRe = exports.safeRe = [];
|
|
82
|
+
var src = exports.src = [];
|
|
83
|
+
var safeSrc = exports.safeSrc = [];
|
|
84
|
+
var t = exports.t = {};
|
|
85
|
+
var R = 0;
|
|
86
|
+
var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
87
|
+
var safeRegexReplacements = [
|
|
88
|
+
["\\s", 1],
|
|
89
|
+
["\\d", MAX_LENGTH],
|
|
90
|
+
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
91
|
+
];
|
|
92
|
+
var makeSafeRegex = (value) => {
|
|
93
|
+
for (const [token, max] of safeRegexReplacements) {
|
|
94
|
+
value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
|
|
95
|
+
}
|
|
96
|
+
return value;
|
|
97
|
+
};
|
|
98
|
+
var createToken = (name, value, isGlobal) => {
|
|
99
|
+
const safe = makeSafeRegex(value);
|
|
100
|
+
const index = R++;
|
|
101
|
+
debug(name, index, value);
|
|
102
|
+
t[name] = index;
|
|
103
|
+
src[index] = value;
|
|
104
|
+
safeSrc[index] = safe;
|
|
105
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
106
|
+
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
107
|
+
};
|
|
108
|
+
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
109
|
+
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
110
|
+
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
111
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
112
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
113
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
114
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
115
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
116
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
117
|
+
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
118
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
119
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
120
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
121
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
122
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
123
|
+
createToken("GTLT", "((?:<|>)?=?)");
|
|
124
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
125
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
126
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
127
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
128
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
129
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
130
|
+
createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
131
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
132
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
133
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
134
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
135
|
+
createToken("LONETILDE", "(?:~>?)");
|
|
136
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
137
|
+
exports.tildeTrimReplace = "$1~";
|
|
138
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
139
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
140
|
+
createToken("LONECARET", "(?:\\^)");
|
|
141
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
142
|
+
exports.caretTrimReplace = "$1^";
|
|
143
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
144
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
145
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
146
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
147
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
148
|
+
exports.comparatorTrimReplace = "$1$2$3";
|
|
149
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
150
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
151
|
+
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
152
|
+
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
153
|
+
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js
|
|
158
|
+
var require_parse_options = __commonJS({
|
|
159
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/parse-options.js"(exports, module) {
|
|
160
|
+
"use strict";
|
|
161
|
+
var looseOption = Object.freeze({ loose: true });
|
|
162
|
+
var emptyOpts = Object.freeze({});
|
|
163
|
+
var parseOptions = (options) => {
|
|
164
|
+
if (!options) {
|
|
165
|
+
return emptyOpts;
|
|
166
|
+
}
|
|
167
|
+
if (typeof options !== "object") {
|
|
168
|
+
return looseOption;
|
|
169
|
+
}
|
|
170
|
+
return options;
|
|
171
|
+
};
|
|
172
|
+
module.exports = parseOptions;
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js
|
|
177
|
+
var require_identifiers = __commonJS({
|
|
178
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/identifiers.js"(exports, module) {
|
|
179
|
+
"use strict";
|
|
180
|
+
var numeric = /^[0-9]+$/;
|
|
181
|
+
var compareIdentifiers = (a, b) => {
|
|
182
|
+
if (typeof a === "number" && typeof b === "number") {
|
|
183
|
+
return a === b ? 0 : a < b ? -1 : 1;
|
|
184
|
+
}
|
|
185
|
+
const anum = numeric.test(a);
|
|
186
|
+
const bnum = numeric.test(b);
|
|
187
|
+
if (anum && bnum) {
|
|
188
|
+
a = +a;
|
|
189
|
+
b = +b;
|
|
190
|
+
}
|
|
191
|
+
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
192
|
+
};
|
|
193
|
+
var rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
194
|
+
module.exports = {
|
|
195
|
+
compareIdentifiers,
|
|
196
|
+
rcompareIdentifiers
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
|
|
201
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js
|
|
202
|
+
var require_semver = __commonJS({
|
|
203
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/semver.js"(exports, module) {
|
|
204
|
+
"use strict";
|
|
205
|
+
var debug = require_debug();
|
|
206
|
+
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
207
|
+
var { safeRe: re, t } = require_re();
|
|
208
|
+
var parseOptions = require_parse_options();
|
|
209
|
+
var { compareIdentifiers } = require_identifiers();
|
|
210
|
+
var isPrereleaseIdentifier = (prerelease, identifier) => {
|
|
211
|
+
const identifiers = identifier.split(".");
|
|
212
|
+
if (identifiers.length > prerelease.length) {
|
|
213
|
+
return false;
|
|
214
|
+
}
|
|
215
|
+
for (let i = 0; i < identifiers.length; i++) {
|
|
216
|
+
if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
|
|
217
|
+
return false;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
return true;
|
|
221
|
+
};
|
|
222
|
+
var SemVer = class _SemVer {
|
|
223
|
+
constructor(version, options) {
|
|
224
|
+
options = parseOptions(options);
|
|
225
|
+
if (version instanceof _SemVer) {
|
|
226
|
+
if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) {
|
|
227
|
+
return version;
|
|
228
|
+
} else {
|
|
229
|
+
version = version.version;
|
|
230
|
+
}
|
|
231
|
+
} else if (typeof version !== "string") {
|
|
232
|
+
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
233
|
+
}
|
|
234
|
+
if (version.length > MAX_LENGTH) {
|
|
235
|
+
throw new TypeError(
|
|
236
|
+
`version is longer than ${MAX_LENGTH} characters`
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
debug("SemVer", version, options);
|
|
240
|
+
this.options = options;
|
|
241
|
+
this.loose = !!options.loose;
|
|
242
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
243
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
244
|
+
if (!m) {
|
|
245
|
+
throw new TypeError(`Invalid Version: ${version}`);
|
|
246
|
+
}
|
|
247
|
+
this.raw = version;
|
|
248
|
+
this.major = +m[1];
|
|
249
|
+
this.minor = +m[2];
|
|
250
|
+
this.patch = +m[3];
|
|
251
|
+
if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
|
|
252
|
+
throw new TypeError("Invalid major version");
|
|
253
|
+
}
|
|
254
|
+
if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
|
|
255
|
+
throw new TypeError("Invalid minor version");
|
|
256
|
+
}
|
|
257
|
+
if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
|
|
258
|
+
throw new TypeError("Invalid patch version");
|
|
259
|
+
}
|
|
260
|
+
if (!m[4]) {
|
|
261
|
+
this.prerelease = [];
|
|
262
|
+
} else {
|
|
263
|
+
this.prerelease = m[4].split(".").map((id) => {
|
|
264
|
+
if (/^[0-9]+$/.test(id)) {
|
|
265
|
+
const num = +id;
|
|
266
|
+
if (num >= 0 && num < MAX_SAFE_INTEGER) {
|
|
267
|
+
return num;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
return id;
|
|
271
|
+
});
|
|
272
|
+
}
|
|
273
|
+
this.build = m[5] ? m[5].split(".") : [];
|
|
274
|
+
this.format();
|
|
275
|
+
}
|
|
276
|
+
format() {
|
|
277
|
+
this.version = `${this.major}.${this.minor}.${this.patch}`;
|
|
278
|
+
if (this.prerelease.length) {
|
|
279
|
+
this.version += `-${this.prerelease.join(".")}`;
|
|
280
|
+
}
|
|
281
|
+
return this.version;
|
|
282
|
+
}
|
|
283
|
+
toString() {
|
|
284
|
+
return this.version;
|
|
285
|
+
}
|
|
286
|
+
compare(other) {
|
|
287
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
288
|
+
if (!(other instanceof _SemVer)) {
|
|
289
|
+
if (typeof other === "string" && other === this.version) {
|
|
290
|
+
return 0;
|
|
291
|
+
}
|
|
292
|
+
other = new _SemVer(other, this.options);
|
|
293
|
+
}
|
|
294
|
+
if (other.version === this.version) {
|
|
295
|
+
return 0;
|
|
296
|
+
}
|
|
297
|
+
return this.compareMain(other) || this.comparePre(other);
|
|
298
|
+
}
|
|
299
|
+
compareMain(other) {
|
|
300
|
+
if (!(other instanceof _SemVer)) {
|
|
301
|
+
other = new _SemVer(other, this.options);
|
|
302
|
+
}
|
|
303
|
+
if (this.major < other.major) {
|
|
304
|
+
return -1;
|
|
305
|
+
}
|
|
306
|
+
if (this.major > other.major) {
|
|
307
|
+
return 1;
|
|
308
|
+
}
|
|
309
|
+
if (this.minor < other.minor) {
|
|
310
|
+
return -1;
|
|
311
|
+
}
|
|
312
|
+
if (this.minor > other.minor) {
|
|
313
|
+
return 1;
|
|
314
|
+
}
|
|
315
|
+
if (this.patch < other.patch) {
|
|
316
|
+
return -1;
|
|
317
|
+
}
|
|
318
|
+
if (this.patch > other.patch) {
|
|
319
|
+
return 1;
|
|
320
|
+
}
|
|
321
|
+
return 0;
|
|
322
|
+
}
|
|
323
|
+
comparePre(other) {
|
|
324
|
+
if (!(other instanceof _SemVer)) {
|
|
325
|
+
other = new _SemVer(other, this.options);
|
|
326
|
+
}
|
|
327
|
+
if (this.prerelease.length && !other.prerelease.length) {
|
|
328
|
+
return -1;
|
|
329
|
+
} else if (!this.prerelease.length && other.prerelease.length) {
|
|
330
|
+
return 1;
|
|
331
|
+
} else if (!this.prerelease.length && !other.prerelease.length) {
|
|
332
|
+
return 0;
|
|
333
|
+
}
|
|
334
|
+
let i = 0;
|
|
335
|
+
do {
|
|
336
|
+
const a = this.prerelease[i];
|
|
337
|
+
const b = other.prerelease[i];
|
|
338
|
+
debug("prerelease compare", i, a, b);
|
|
339
|
+
if (a === void 0 && b === void 0) {
|
|
340
|
+
return 0;
|
|
341
|
+
} else if (b === void 0) {
|
|
342
|
+
return 1;
|
|
343
|
+
} else if (a === void 0) {
|
|
344
|
+
return -1;
|
|
345
|
+
} else if (a === b) {
|
|
346
|
+
continue;
|
|
347
|
+
} else {
|
|
348
|
+
return compareIdentifiers(a, b);
|
|
349
|
+
}
|
|
350
|
+
} while (++i);
|
|
351
|
+
}
|
|
352
|
+
compareBuild(other) {
|
|
353
|
+
if (!(other instanceof _SemVer)) {
|
|
354
|
+
other = new _SemVer(other, this.options);
|
|
355
|
+
}
|
|
356
|
+
let i = 0;
|
|
357
|
+
do {
|
|
358
|
+
const a = this.build[i];
|
|
359
|
+
const b = other.build[i];
|
|
360
|
+
debug("build compare", i, a, b);
|
|
361
|
+
if (a === void 0 && b === void 0) {
|
|
362
|
+
return 0;
|
|
363
|
+
} else if (b === void 0) {
|
|
364
|
+
return 1;
|
|
365
|
+
} else if (a === void 0) {
|
|
366
|
+
return -1;
|
|
367
|
+
} else if (a === b) {
|
|
368
|
+
continue;
|
|
369
|
+
} else {
|
|
370
|
+
return compareIdentifiers(a, b);
|
|
371
|
+
}
|
|
372
|
+
} while (++i);
|
|
373
|
+
}
|
|
374
|
+
// preminor will bump the version up to the next minor release, and immediately
|
|
375
|
+
// down to pre-release. premajor and prepatch work the same way.
|
|
376
|
+
inc(release, identifier, identifierBase) {
|
|
377
|
+
if (release.startsWith("pre")) {
|
|
378
|
+
if (!identifier && identifierBase === false) {
|
|
379
|
+
throw new Error("invalid increment argument: identifier is empty");
|
|
380
|
+
}
|
|
381
|
+
if (identifier) {
|
|
382
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
383
|
+
if (!match || match[1] !== identifier) {
|
|
384
|
+
throw new Error(`invalid identifier: ${identifier}`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
switch (release) {
|
|
389
|
+
case "premajor":
|
|
390
|
+
this.prerelease.length = 0;
|
|
391
|
+
this.patch = 0;
|
|
392
|
+
this.minor = 0;
|
|
393
|
+
this.major++;
|
|
394
|
+
this.inc("pre", identifier, identifierBase);
|
|
395
|
+
break;
|
|
396
|
+
case "preminor":
|
|
397
|
+
this.prerelease.length = 0;
|
|
398
|
+
this.patch = 0;
|
|
399
|
+
this.minor++;
|
|
400
|
+
this.inc("pre", identifier, identifierBase);
|
|
401
|
+
break;
|
|
402
|
+
case "prepatch":
|
|
403
|
+
this.prerelease.length = 0;
|
|
404
|
+
this.inc("patch", identifier, identifierBase);
|
|
405
|
+
this.inc("pre", identifier, identifierBase);
|
|
406
|
+
break;
|
|
407
|
+
// If the input is a non-prerelease version, this acts the same as
|
|
408
|
+
// prepatch.
|
|
409
|
+
case "prerelease":
|
|
410
|
+
if (this.prerelease.length === 0) {
|
|
411
|
+
this.inc("patch", identifier, identifierBase);
|
|
412
|
+
}
|
|
413
|
+
this.inc("pre", identifier, identifierBase);
|
|
414
|
+
break;
|
|
415
|
+
case "release":
|
|
416
|
+
if (this.prerelease.length === 0) {
|
|
417
|
+
throw new Error(`version ${this.raw} is not a prerelease`);
|
|
418
|
+
}
|
|
419
|
+
this.prerelease.length = 0;
|
|
420
|
+
break;
|
|
421
|
+
case "major":
|
|
422
|
+
if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
|
|
423
|
+
this.major++;
|
|
424
|
+
}
|
|
425
|
+
this.minor = 0;
|
|
426
|
+
this.patch = 0;
|
|
427
|
+
this.prerelease = [];
|
|
428
|
+
break;
|
|
429
|
+
case "minor":
|
|
430
|
+
if (this.patch !== 0 || this.prerelease.length === 0) {
|
|
431
|
+
this.minor++;
|
|
432
|
+
}
|
|
433
|
+
this.patch = 0;
|
|
434
|
+
this.prerelease = [];
|
|
435
|
+
break;
|
|
436
|
+
case "patch":
|
|
437
|
+
if (this.prerelease.length === 0) {
|
|
438
|
+
this.patch++;
|
|
439
|
+
}
|
|
440
|
+
this.prerelease = [];
|
|
441
|
+
break;
|
|
442
|
+
// This probably shouldn't be used publicly.
|
|
443
|
+
// 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
|
|
444
|
+
case "pre": {
|
|
445
|
+
const base = Number(identifierBase) ? 1 : 0;
|
|
446
|
+
if (this.prerelease.length === 0) {
|
|
447
|
+
this.prerelease = [base];
|
|
448
|
+
} else {
|
|
449
|
+
let i = this.prerelease.length;
|
|
450
|
+
while (--i >= 0) {
|
|
451
|
+
if (typeof this.prerelease[i] === "number") {
|
|
452
|
+
this.prerelease[i]++;
|
|
453
|
+
i = -2;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
if (i === -1) {
|
|
457
|
+
if (identifier === this.prerelease.join(".") && identifierBase === false) {
|
|
458
|
+
throw new Error("invalid increment argument: identifier already exists");
|
|
459
|
+
}
|
|
460
|
+
this.prerelease.push(base);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
if (identifier) {
|
|
464
|
+
let prerelease = [identifier, base];
|
|
465
|
+
if (identifierBase === false) {
|
|
466
|
+
prerelease = [identifier];
|
|
467
|
+
}
|
|
468
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
469
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
470
|
+
if (isNaN(prereleaseBase)) {
|
|
471
|
+
this.prerelease = prerelease;
|
|
472
|
+
}
|
|
473
|
+
} else {
|
|
474
|
+
this.prerelease = prerelease;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
break;
|
|
478
|
+
}
|
|
479
|
+
default:
|
|
480
|
+
throw new Error(`invalid increment argument: ${release}`);
|
|
481
|
+
}
|
|
482
|
+
this.raw = this.format();
|
|
483
|
+
if (this.build.length) {
|
|
484
|
+
this.raw += `+${this.build.join(".")}`;
|
|
485
|
+
}
|
|
486
|
+
return this;
|
|
487
|
+
}
|
|
488
|
+
};
|
|
489
|
+
module.exports = SemVer;
|
|
490
|
+
}
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js
|
|
494
|
+
var require_parse = __commonJS({
|
|
495
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/parse.js"(exports, module) {
|
|
496
|
+
"use strict";
|
|
497
|
+
var SemVer = require_semver();
|
|
498
|
+
var parse = (version, options, throwErrors = false) => {
|
|
499
|
+
if (version instanceof SemVer) {
|
|
500
|
+
return version;
|
|
501
|
+
}
|
|
502
|
+
try {
|
|
503
|
+
return new SemVer(version, options);
|
|
504
|
+
} catch (er) {
|
|
505
|
+
if (!throwErrors) {
|
|
506
|
+
return null;
|
|
507
|
+
}
|
|
508
|
+
throw er;
|
|
509
|
+
}
|
|
510
|
+
};
|
|
511
|
+
module.exports = parse;
|
|
512
|
+
}
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js
|
|
516
|
+
var require_valid = __commonJS({
|
|
517
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/valid.js"(exports, module) {
|
|
518
|
+
"use strict";
|
|
519
|
+
var parse = require_parse();
|
|
520
|
+
var valid = (version, options) => {
|
|
521
|
+
const v = parse(version, options);
|
|
522
|
+
return v ? v.version : null;
|
|
523
|
+
};
|
|
524
|
+
module.exports = valid;
|
|
525
|
+
}
|
|
526
|
+
});
|
|
527
|
+
|
|
528
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js
|
|
529
|
+
var require_clean = __commonJS({
|
|
530
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/clean.js"(exports, module) {
|
|
531
|
+
"use strict";
|
|
532
|
+
var parse = require_parse();
|
|
533
|
+
var clean = (version, options) => {
|
|
534
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
535
|
+
return s ? s.version : null;
|
|
536
|
+
};
|
|
537
|
+
module.exports = clean;
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js
|
|
542
|
+
var require_inc = __commonJS({
|
|
543
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/inc.js"(exports, module) {
|
|
544
|
+
"use strict";
|
|
545
|
+
var SemVer = require_semver();
|
|
546
|
+
var inc = (version, release, options, identifier, identifierBase) => {
|
|
547
|
+
if (typeof options === "string") {
|
|
548
|
+
identifierBase = identifier;
|
|
549
|
+
identifier = options;
|
|
550
|
+
options = void 0;
|
|
551
|
+
}
|
|
552
|
+
try {
|
|
553
|
+
return new SemVer(
|
|
554
|
+
version instanceof SemVer ? version.version : version,
|
|
555
|
+
options
|
|
556
|
+
).inc(release, identifier, identifierBase).version;
|
|
557
|
+
} catch (er) {
|
|
558
|
+
return null;
|
|
559
|
+
}
|
|
560
|
+
};
|
|
561
|
+
module.exports = inc;
|
|
562
|
+
}
|
|
563
|
+
});
|
|
564
|
+
|
|
565
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js
|
|
566
|
+
var require_diff = __commonJS({
|
|
567
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/diff.js"(exports, module) {
|
|
568
|
+
"use strict";
|
|
569
|
+
var parse = require_parse();
|
|
570
|
+
var diff = (version1, version2) => {
|
|
571
|
+
const v1 = parse(version1, null, true);
|
|
572
|
+
const v2 = parse(version2, null, true);
|
|
573
|
+
const comparison = v1.compare(v2);
|
|
574
|
+
if (comparison === 0) {
|
|
575
|
+
return null;
|
|
576
|
+
}
|
|
577
|
+
const v1Higher = comparison > 0;
|
|
578
|
+
const highVersion = v1Higher ? v1 : v2;
|
|
579
|
+
const lowVersion = v1Higher ? v2 : v1;
|
|
580
|
+
const highHasPre = !!highVersion.prerelease.length;
|
|
581
|
+
const lowHasPre = !!lowVersion.prerelease.length;
|
|
582
|
+
if (lowHasPre && !highHasPre) {
|
|
583
|
+
if (!lowVersion.patch && !lowVersion.minor) {
|
|
584
|
+
return "major";
|
|
585
|
+
}
|
|
586
|
+
if (lowVersion.compareMain(highVersion) === 0) {
|
|
587
|
+
if (lowVersion.minor && !lowVersion.patch) {
|
|
588
|
+
return "minor";
|
|
589
|
+
}
|
|
590
|
+
return "patch";
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
const prefix = highHasPre ? "pre" : "";
|
|
594
|
+
if (v1.major !== v2.major) {
|
|
595
|
+
return prefix + "major";
|
|
596
|
+
}
|
|
597
|
+
if (v1.minor !== v2.minor) {
|
|
598
|
+
return prefix + "minor";
|
|
599
|
+
}
|
|
600
|
+
if (v1.patch !== v2.patch) {
|
|
601
|
+
return prefix + "patch";
|
|
602
|
+
}
|
|
603
|
+
return "prerelease";
|
|
604
|
+
};
|
|
605
|
+
module.exports = diff;
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
|
|
609
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js
|
|
610
|
+
var require_major = __commonJS({
|
|
611
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/major.js"(exports, module) {
|
|
612
|
+
"use strict";
|
|
613
|
+
var SemVer = require_semver();
|
|
614
|
+
var major = (a, loose) => new SemVer(a, loose).major;
|
|
615
|
+
module.exports = major;
|
|
616
|
+
}
|
|
617
|
+
});
|
|
618
|
+
|
|
619
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js
|
|
620
|
+
var require_minor = __commonJS({
|
|
621
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/minor.js"(exports, module) {
|
|
622
|
+
"use strict";
|
|
623
|
+
var SemVer = require_semver();
|
|
624
|
+
var minor = (a, loose) => new SemVer(a, loose).minor;
|
|
625
|
+
module.exports = minor;
|
|
626
|
+
}
|
|
627
|
+
});
|
|
628
|
+
|
|
629
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js
|
|
630
|
+
var require_patch = __commonJS({
|
|
631
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/patch.js"(exports, module) {
|
|
632
|
+
"use strict";
|
|
633
|
+
var SemVer = require_semver();
|
|
634
|
+
var patch = (a, loose) => new SemVer(a, loose).patch;
|
|
635
|
+
module.exports = patch;
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js
|
|
640
|
+
var require_prerelease = __commonJS({
|
|
641
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/prerelease.js"(exports, module) {
|
|
642
|
+
"use strict";
|
|
643
|
+
var parse = require_parse();
|
|
644
|
+
var prerelease = (version, options) => {
|
|
645
|
+
const parsed = parse(version, options);
|
|
646
|
+
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
647
|
+
};
|
|
648
|
+
module.exports = prerelease;
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
|
|
652
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js
|
|
653
|
+
var require_compare = __commonJS({
|
|
654
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare.js"(exports, module) {
|
|
655
|
+
"use strict";
|
|
656
|
+
var SemVer = require_semver();
|
|
657
|
+
var compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
658
|
+
module.exports = compare;
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js
|
|
663
|
+
var require_rcompare = __commonJS({
|
|
664
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rcompare.js"(exports, module) {
|
|
665
|
+
"use strict";
|
|
666
|
+
var compare = require_compare();
|
|
667
|
+
var rcompare = (a, b, loose) => compare(b, a, loose);
|
|
668
|
+
module.exports = rcompare;
|
|
669
|
+
}
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js
|
|
673
|
+
var require_compare_loose = __commonJS({
|
|
674
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-loose.js"(exports, module) {
|
|
675
|
+
"use strict";
|
|
676
|
+
var compare = require_compare();
|
|
677
|
+
var compareLoose = (a, b) => compare(a, b, true);
|
|
678
|
+
module.exports = compareLoose;
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
|
|
682
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js
|
|
683
|
+
var require_compare_build = __commonJS({
|
|
684
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/compare-build.js"(exports, module) {
|
|
685
|
+
"use strict";
|
|
686
|
+
var SemVer = require_semver();
|
|
687
|
+
var compareBuild = (a, b, loose) => {
|
|
688
|
+
const versionA = new SemVer(a, loose);
|
|
689
|
+
const versionB = new SemVer(b, loose);
|
|
690
|
+
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
691
|
+
};
|
|
692
|
+
module.exports = compareBuild;
|
|
693
|
+
}
|
|
694
|
+
});
|
|
695
|
+
|
|
696
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js
|
|
697
|
+
var require_sort = __commonJS({
|
|
698
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/sort.js"(exports, module) {
|
|
699
|
+
"use strict";
|
|
700
|
+
var compareBuild = require_compare_build();
|
|
701
|
+
var sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
702
|
+
module.exports = sort;
|
|
703
|
+
}
|
|
704
|
+
});
|
|
705
|
+
|
|
706
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js
|
|
707
|
+
var require_rsort = __commonJS({
|
|
708
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/rsort.js"(exports, module) {
|
|
709
|
+
"use strict";
|
|
710
|
+
var compareBuild = require_compare_build();
|
|
711
|
+
var rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
712
|
+
module.exports = rsort;
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js
|
|
717
|
+
var require_gt = __commonJS({
|
|
718
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gt.js"(exports, module) {
|
|
719
|
+
"use strict";
|
|
720
|
+
var compare = require_compare();
|
|
721
|
+
var gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
722
|
+
module.exports = gt;
|
|
723
|
+
}
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js
|
|
727
|
+
var require_lt = __commonJS({
|
|
728
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lt.js"(exports, module) {
|
|
729
|
+
"use strict";
|
|
730
|
+
var compare = require_compare();
|
|
731
|
+
var lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
732
|
+
module.exports = lt;
|
|
733
|
+
}
|
|
734
|
+
});
|
|
735
|
+
|
|
736
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js
|
|
737
|
+
var require_eq = __commonJS({
|
|
738
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/eq.js"(exports, module) {
|
|
739
|
+
"use strict";
|
|
740
|
+
var compare = require_compare();
|
|
741
|
+
var eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
742
|
+
module.exports = eq;
|
|
743
|
+
}
|
|
744
|
+
});
|
|
745
|
+
|
|
746
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js
|
|
747
|
+
var require_neq = __commonJS({
|
|
748
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/neq.js"(exports, module) {
|
|
749
|
+
"use strict";
|
|
750
|
+
var compare = require_compare();
|
|
751
|
+
var neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
752
|
+
module.exports = neq;
|
|
753
|
+
}
|
|
754
|
+
});
|
|
755
|
+
|
|
756
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js
|
|
757
|
+
var require_gte = __commonJS({
|
|
758
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/gte.js"(exports, module) {
|
|
759
|
+
"use strict";
|
|
760
|
+
var compare = require_compare();
|
|
761
|
+
var gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
762
|
+
module.exports = gte;
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
|
|
766
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js
|
|
767
|
+
var require_lte = __commonJS({
|
|
768
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/lte.js"(exports, module) {
|
|
769
|
+
"use strict";
|
|
770
|
+
var compare = require_compare();
|
|
771
|
+
var lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
772
|
+
module.exports = lte;
|
|
773
|
+
}
|
|
774
|
+
});
|
|
775
|
+
|
|
776
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js
|
|
777
|
+
var require_cmp = __commonJS({
|
|
778
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/cmp.js"(exports, module) {
|
|
779
|
+
"use strict";
|
|
780
|
+
var eq = require_eq();
|
|
781
|
+
var neq = require_neq();
|
|
782
|
+
var gt = require_gt();
|
|
783
|
+
var gte = require_gte();
|
|
784
|
+
var lt = require_lt();
|
|
785
|
+
var lte = require_lte();
|
|
786
|
+
var cmp = (a, op, b, loose) => {
|
|
787
|
+
switch (op) {
|
|
788
|
+
case "===":
|
|
789
|
+
if (typeof a === "object") {
|
|
790
|
+
a = a.version;
|
|
791
|
+
}
|
|
792
|
+
if (typeof b === "object") {
|
|
793
|
+
b = b.version;
|
|
794
|
+
}
|
|
795
|
+
return a === b;
|
|
796
|
+
case "!==":
|
|
797
|
+
if (typeof a === "object") {
|
|
798
|
+
a = a.version;
|
|
799
|
+
}
|
|
800
|
+
if (typeof b === "object") {
|
|
801
|
+
b = b.version;
|
|
802
|
+
}
|
|
803
|
+
return a !== b;
|
|
804
|
+
case "":
|
|
805
|
+
case "=":
|
|
806
|
+
case "==":
|
|
807
|
+
return eq(a, b, loose);
|
|
808
|
+
case "!=":
|
|
809
|
+
return neq(a, b, loose);
|
|
810
|
+
case ">":
|
|
811
|
+
return gt(a, b, loose);
|
|
812
|
+
case ">=":
|
|
813
|
+
return gte(a, b, loose);
|
|
814
|
+
case "<":
|
|
815
|
+
return lt(a, b, loose);
|
|
816
|
+
case "<=":
|
|
817
|
+
return lte(a, b, loose);
|
|
818
|
+
default:
|
|
819
|
+
throw new TypeError(`Invalid operator: ${op}`);
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
module.exports = cmp;
|
|
823
|
+
}
|
|
824
|
+
});
|
|
825
|
+
|
|
826
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js
|
|
827
|
+
var require_coerce = __commonJS({
|
|
828
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/coerce.js"(exports, module) {
|
|
829
|
+
"use strict";
|
|
830
|
+
var SemVer = require_semver();
|
|
831
|
+
var parse = require_parse();
|
|
832
|
+
var { safeRe: re, t } = require_re();
|
|
833
|
+
var coerce = (version, options) => {
|
|
834
|
+
if (version instanceof SemVer) {
|
|
835
|
+
return version;
|
|
836
|
+
}
|
|
837
|
+
if (typeof version === "number") {
|
|
838
|
+
version = String(version);
|
|
839
|
+
}
|
|
840
|
+
if (typeof version !== "string") {
|
|
841
|
+
return null;
|
|
842
|
+
}
|
|
843
|
+
options = options || {};
|
|
844
|
+
let match = null;
|
|
845
|
+
if (!options.rtl) {
|
|
846
|
+
match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
847
|
+
} else {
|
|
848
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
849
|
+
let next;
|
|
850
|
+
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
851
|
+
if (!match || next.index + next[0].length !== match.index + match[0].length) {
|
|
852
|
+
match = next;
|
|
853
|
+
}
|
|
854
|
+
coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
|
|
855
|
+
}
|
|
856
|
+
coerceRtlRegex.lastIndex = -1;
|
|
857
|
+
}
|
|
858
|
+
if (match === null) {
|
|
859
|
+
return null;
|
|
860
|
+
}
|
|
861
|
+
const major = match[2];
|
|
862
|
+
const minor = match[3] || "0";
|
|
863
|
+
const patch = match[4] || "0";
|
|
864
|
+
const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
865
|
+
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
866
|
+
return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
|
|
867
|
+
};
|
|
868
|
+
module.exports = coerce;
|
|
869
|
+
}
|
|
870
|
+
});
|
|
871
|
+
|
|
872
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js
|
|
873
|
+
var require_truncate = __commonJS({
|
|
874
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/truncate.js"(exports, module) {
|
|
875
|
+
"use strict";
|
|
876
|
+
var parse = require_parse();
|
|
877
|
+
var constants = require_constants();
|
|
878
|
+
var SemVer = require_semver();
|
|
879
|
+
var truncate = (version, truncation, options) => {
|
|
880
|
+
if (!constants.RELEASE_TYPES.includes(truncation)) {
|
|
881
|
+
return null;
|
|
882
|
+
}
|
|
883
|
+
const clonedVersion = cloneInputVersion(version, options);
|
|
884
|
+
return clonedVersion && doTruncation(clonedVersion, truncation);
|
|
885
|
+
};
|
|
886
|
+
var cloneInputVersion = (version, options) => {
|
|
887
|
+
const versionStringToParse = version instanceof SemVer ? version.version : version;
|
|
888
|
+
return parse(versionStringToParse, options);
|
|
889
|
+
};
|
|
890
|
+
var doTruncation = (version, truncation) => {
|
|
891
|
+
if (isPrerelease(truncation)) {
|
|
892
|
+
return version.version;
|
|
893
|
+
}
|
|
894
|
+
version.prerelease = [];
|
|
895
|
+
switch (truncation) {
|
|
896
|
+
case "major":
|
|
897
|
+
version.minor = 0;
|
|
898
|
+
version.patch = 0;
|
|
899
|
+
break;
|
|
900
|
+
case "minor":
|
|
901
|
+
version.patch = 0;
|
|
902
|
+
break;
|
|
903
|
+
}
|
|
904
|
+
return version.format();
|
|
905
|
+
};
|
|
906
|
+
var isPrerelease = (type) => {
|
|
907
|
+
return type.startsWith("pre");
|
|
908
|
+
};
|
|
909
|
+
module.exports = truncate;
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
|
|
913
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js
|
|
914
|
+
var require_lrucache = __commonJS({
|
|
915
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/internal/lrucache.js"(exports, module) {
|
|
916
|
+
"use strict";
|
|
917
|
+
var LRUCache = class {
|
|
918
|
+
constructor() {
|
|
919
|
+
this.max = 1e3;
|
|
920
|
+
this.map = /* @__PURE__ */ new Map();
|
|
921
|
+
}
|
|
922
|
+
get(key) {
|
|
923
|
+
const value = this.map.get(key);
|
|
924
|
+
if (value === void 0) {
|
|
925
|
+
return void 0;
|
|
926
|
+
} else {
|
|
927
|
+
this.map.delete(key);
|
|
928
|
+
this.map.set(key, value);
|
|
929
|
+
return value;
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
delete(key) {
|
|
933
|
+
return this.map.delete(key);
|
|
934
|
+
}
|
|
935
|
+
set(key, value) {
|
|
936
|
+
const deleted = this.delete(key);
|
|
937
|
+
if (!deleted && value !== void 0) {
|
|
938
|
+
if (this.map.size >= this.max) {
|
|
939
|
+
const firstKey = this.map.keys().next().value;
|
|
940
|
+
this.delete(firstKey);
|
|
941
|
+
}
|
|
942
|
+
this.map.set(key, value);
|
|
943
|
+
}
|
|
944
|
+
return this;
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
module.exports = LRUCache;
|
|
948
|
+
}
|
|
949
|
+
});
|
|
950
|
+
|
|
951
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js
|
|
952
|
+
var require_range = __commonJS({
|
|
953
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/range.js"(exports, module) {
|
|
954
|
+
"use strict";
|
|
955
|
+
var SPACE_CHARACTERS = /\s+/g;
|
|
956
|
+
var Range = class _Range {
|
|
957
|
+
constructor(range, options) {
|
|
958
|
+
options = parseOptions(options);
|
|
959
|
+
if (range instanceof _Range) {
|
|
960
|
+
if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
|
|
961
|
+
return range;
|
|
962
|
+
} else {
|
|
963
|
+
return new _Range(range.raw, options);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
if (range instanceof Comparator) {
|
|
967
|
+
this.raw = range.value;
|
|
968
|
+
this.set = [[range]];
|
|
969
|
+
this.formatted = void 0;
|
|
970
|
+
return this;
|
|
971
|
+
}
|
|
972
|
+
this.options = options;
|
|
973
|
+
this.loose = !!options.loose;
|
|
974
|
+
this.includePrerelease = !!options.includePrerelease;
|
|
975
|
+
this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
|
|
976
|
+
this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c) => c.length);
|
|
977
|
+
if (!this.set.length) {
|
|
978
|
+
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
979
|
+
}
|
|
980
|
+
if (this.set.length > 1) {
|
|
981
|
+
const first = this.set[0];
|
|
982
|
+
this.set = this.set.filter((c) => !isNullSet(c[0]));
|
|
983
|
+
if (this.set.length === 0) {
|
|
984
|
+
this.set = [first];
|
|
985
|
+
} else if (this.set.length > 1) {
|
|
986
|
+
for (const c of this.set) {
|
|
987
|
+
if (c.length === 1 && isAny(c[0])) {
|
|
988
|
+
this.set = [c];
|
|
989
|
+
break;
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
this.formatted = void 0;
|
|
995
|
+
}
|
|
996
|
+
get range() {
|
|
997
|
+
if (this.formatted === void 0) {
|
|
998
|
+
this.formatted = "";
|
|
999
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1000
|
+
if (i > 0) {
|
|
1001
|
+
this.formatted += "||";
|
|
1002
|
+
}
|
|
1003
|
+
const comps = this.set[i];
|
|
1004
|
+
for (let k = 0; k < comps.length; k++) {
|
|
1005
|
+
if (k > 0) {
|
|
1006
|
+
this.formatted += " ";
|
|
1007
|
+
}
|
|
1008
|
+
this.formatted += comps[k].toString().trim();
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
}
|
|
1012
|
+
return this.formatted;
|
|
1013
|
+
}
|
|
1014
|
+
format() {
|
|
1015
|
+
return this.range;
|
|
1016
|
+
}
|
|
1017
|
+
toString() {
|
|
1018
|
+
return this.range;
|
|
1019
|
+
}
|
|
1020
|
+
parseRange(range) {
|
|
1021
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
1022
|
+
const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
|
|
1023
|
+
const memoKey = memoOpts + ":" + range;
|
|
1024
|
+
const cached = cache.get(memoKey);
|
|
1025
|
+
if (cached) {
|
|
1026
|
+
return cached;
|
|
1027
|
+
}
|
|
1028
|
+
const loose = this.options.loose;
|
|
1029
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
1030
|
+
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
1031
|
+
debug("hyphen replace", range);
|
|
1032
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
1033
|
+
debug("comparator trim", range);
|
|
1034
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
1035
|
+
debug("tilde trim", range);
|
|
1036
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
1037
|
+
debug("caret trim", range);
|
|
1038
|
+
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
1039
|
+
if (loose) {
|
|
1040
|
+
rangeList = rangeList.filter((comp) => {
|
|
1041
|
+
debug("loose invalid filter", comp, this.options);
|
|
1042
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
1043
|
+
});
|
|
1044
|
+
}
|
|
1045
|
+
debug("range list", rangeList);
|
|
1046
|
+
const rangeMap = /* @__PURE__ */ new Map();
|
|
1047
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
1048
|
+
for (const comp of comparators) {
|
|
1049
|
+
if (isNullSet(comp)) {
|
|
1050
|
+
return [comp];
|
|
1051
|
+
}
|
|
1052
|
+
rangeMap.set(comp.value, comp);
|
|
1053
|
+
}
|
|
1054
|
+
if (rangeMap.size > 1 && rangeMap.has("")) {
|
|
1055
|
+
rangeMap.delete("");
|
|
1056
|
+
}
|
|
1057
|
+
const result = [...rangeMap.values()];
|
|
1058
|
+
cache.set(memoKey, result);
|
|
1059
|
+
return result;
|
|
1060
|
+
}
|
|
1061
|
+
intersects(range, options) {
|
|
1062
|
+
if (!(range instanceof _Range)) {
|
|
1063
|
+
throw new TypeError("a Range is required");
|
|
1064
|
+
}
|
|
1065
|
+
return this.set.some((thisComparators) => {
|
|
1066
|
+
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
1067
|
+
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
1068
|
+
return rangeComparators.every((rangeComparator) => {
|
|
1069
|
+
return thisComparator.intersects(rangeComparator, options);
|
|
1070
|
+
});
|
|
1071
|
+
});
|
|
1072
|
+
});
|
|
1073
|
+
});
|
|
1074
|
+
}
|
|
1075
|
+
// if ANY of the sets match ALL of its comparators, then pass
|
|
1076
|
+
test(version) {
|
|
1077
|
+
if (!version) {
|
|
1078
|
+
return false;
|
|
1079
|
+
}
|
|
1080
|
+
if (typeof version === "string") {
|
|
1081
|
+
try {
|
|
1082
|
+
version = new SemVer(version, this.options);
|
|
1083
|
+
} catch (er) {
|
|
1084
|
+
return false;
|
|
1085
|
+
}
|
|
1086
|
+
}
|
|
1087
|
+
for (let i = 0; i < this.set.length; i++) {
|
|
1088
|
+
if (testSet(this.set[i], version, this.options)) {
|
|
1089
|
+
return true;
|
|
1090
|
+
}
|
|
1091
|
+
}
|
|
1092
|
+
return false;
|
|
1093
|
+
}
|
|
1094
|
+
};
|
|
1095
|
+
module.exports = Range;
|
|
1096
|
+
var LRU = require_lrucache();
|
|
1097
|
+
var cache = new LRU();
|
|
1098
|
+
var parseOptions = require_parse_options();
|
|
1099
|
+
var Comparator = require_comparator();
|
|
1100
|
+
var debug = require_debug();
|
|
1101
|
+
var SemVer = require_semver();
|
|
1102
|
+
var {
|
|
1103
|
+
safeRe: re,
|
|
1104
|
+
src,
|
|
1105
|
+
t,
|
|
1106
|
+
comparatorTrimReplace,
|
|
1107
|
+
tildeTrimReplace,
|
|
1108
|
+
caretTrimReplace
|
|
1109
|
+
} = require_re();
|
|
1110
|
+
var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
1111
|
+
var BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
1112
|
+
var isNullSet = (c) => c.value === "<0.0.0-0";
|
|
1113
|
+
var isAny = (c) => c.value === "";
|
|
1114
|
+
var isSatisfiable = (comparators, options) => {
|
|
1115
|
+
let result = true;
|
|
1116
|
+
const remainingComparators = comparators.slice();
|
|
1117
|
+
let testComparator = remainingComparators.pop();
|
|
1118
|
+
while (result && remainingComparators.length) {
|
|
1119
|
+
result = remainingComparators.every((otherComparator) => {
|
|
1120
|
+
return testComparator.intersects(otherComparator, options);
|
|
1121
|
+
});
|
|
1122
|
+
testComparator = remainingComparators.pop();
|
|
1123
|
+
}
|
|
1124
|
+
return result;
|
|
1125
|
+
};
|
|
1126
|
+
var parseComparator = (comp, options) => {
|
|
1127
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
1128
|
+
debug("comp", comp, options);
|
|
1129
|
+
comp = replaceCarets(comp, options);
|
|
1130
|
+
debug("caret", comp);
|
|
1131
|
+
comp = replaceTildes(comp, options);
|
|
1132
|
+
debug("tildes", comp);
|
|
1133
|
+
comp = replaceXRanges(comp, options);
|
|
1134
|
+
debug("xrange", comp);
|
|
1135
|
+
comp = replaceStars(comp, options);
|
|
1136
|
+
debug("stars", comp);
|
|
1137
|
+
return comp;
|
|
1138
|
+
};
|
|
1139
|
+
var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
1140
|
+
var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
1141
|
+
var replaceTildes = (comp, options) => {
|
|
1142
|
+
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
1143
|
+
};
|
|
1144
|
+
var replaceTilde = (comp, options) => {
|
|
1145
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1146
|
+
const z10 = options.includePrerelease ? "-0" : "";
|
|
1147
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1148
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
1149
|
+
let ret;
|
|
1150
|
+
if (isX(M)) {
|
|
1151
|
+
ret = "";
|
|
1152
|
+
} else if (isX(m)) {
|
|
1153
|
+
ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
|
|
1154
|
+
} else if (isX(p)) {
|
|
1155
|
+
ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
|
|
1156
|
+
} else if (pr) {
|
|
1157
|
+
debug("replaceTilde pr", pr);
|
|
1158
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1159
|
+
} else {
|
|
1160
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1161
|
+
}
|
|
1162
|
+
debug("tilde return", ret);
|
|
1163
|
+
return ret;
|
|
1164
|
+
});
|
|
1165
|
+
};
|
|
1166
|
+
var replaceCarets = (comp, options) => {
|
|
1167
|
+
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1168
|
+
};
|
|
1169
|
+
var replaceCaret = (comp, options) => {
|
|
1170
|
+
debug("caret", comp, options);
|
|
1171
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1172
|
+
const z10 = options.includePrerelease ? "-0" : "";
|
|
1173
|
+
return comp.replace(r, (_, M, m, p, pr) => {
|
|
1174
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
1175
|
+
let ret;
|
|
1176
|
+
if (isX(M)) {
|
|
1177
|
+
ret = "";
|
|
1178
|
+
} else if (isX(m)) {
|
|
1179
|
+
ret = `>=${M}.0.0${z10} <${+M + 1}.0.0-0`;
|
|
1180
|
+
} else if (isX(p)) {
|
|
1181
|
+
if (M === "0") {
|
|
1182
|
+
ret = `>=${M}.${m}.0${z10} <${M}.${+m + 1}.0-0`;
|
|
1183
|
+
} else {
|
|
1184
|
+
ret = `>=${M}.${m}.0${z10} <${+M + 1}.0.0-0`;
|
|
1185
|
+
}
|
|
1186
|
+
} else if (pr) {
|
|
1187
|
+
debug("replaceCaret pr", pr);
|
|
1188
|
+
if (M === "0") {
|
|
1189
|
+
if (m === "0") {
|
|
1190
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
1191
|
+
} else {
|
|
1192
|
+
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1193
|
+
}
|
|
1194
|
+
} else {
|
|
1195
|
+
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1196
|
+
}
|
|
1197
|
+
} else {
|
|
1198
|
+
debug("no pr");
|
|
1199
|
+
if (M === "0") {
|
|
1200
|
+
if (m === "0") {
|
|
1201
|
+
ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
|
|
1202
|
+
} else {
|
|
1203
|
+
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1204
|
+
}
|
|
1205
|
+
} else {
|
|
1206
|
+
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
debug("caret return", ret);
|
|
1210
|
+
return ret;
|
|
1211
|
+
});
|
|
1212
|
+
};
|
|
1213
|
+
var replaceXRanges = (comp, options) => {
|
|
1214
|
+
debug("replaceXRanges", comp, options);
|
|
1215
|
+
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1216
|
+
};
|
|
1217
|
+
var replaceXRange = (comp, options) => {
|
|
1218
|
+
comp = comp.trim();
|
|
1219
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1220
|
+
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1221
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1222
|
+
if (invalidXRangeOrder(M, m, p)) {
|
|
1223
|
+
return comp;
|
|
1224
|
+
}
|
|
1225
|
+
const xM = isX(M);
|
|
1226
|
+
const xm = xM || isX(m);
|
|
1227
|
+
const xp = xm || isX(p);
|
|
1228
|
+
const anyX = xp;
|
|
1229
|
+
if (gtlt === "=" && anyX) {
|
|
1230
|
+
gtlt = "";
|
|
1231
|
+
}
|
|
1232
|
+
pr = options.includePrerelease ? "-0" : "";
|
|
1233
|
+
if (xM) {
|
|
1234
|
+
if (gtlt === ">" || gtlt === "<") {
|
|
1235
|
+
ret = "<0.0.0-0";
|
|
1236
|
+
} else {
|
|
1237
|
+
ret = "*";
|
|
1238
|
+
}
|
|
1239
|
+
} else if (gtlt && anyX) {
|
|
1240
|
+
if (xm) {
|
|
1241
|
+
m = 0;
|
|
1242
|
+
}
|
|
1243
|
+
p = 0;
|
|
1244
|
+
if (gtlt === ">") {
|
|
1245
|
+
gtlt = ">=";
|
|
1246
|
+
if (xm) {
|
|
1247
|
+
M = +M + 1;
|
|
1248
|
+
m = 0;
|
|
1249
|
+
p = 0;
|
|
1250
|
+
} else {
|
|
1251
|
+
m = +m + 1;
|
|
1252
|
+
p = 0;
|
|
1253
|
+
}
|
|
1254
|
+
} else if (gtlt === "<=") {
|
|
1255
|
+
gtlt = "<";
|
|
1256
|
+
if (xm) {
|
|
1257
|
+
M = +M + 1;
|
|
1258
|
+
} else {
|
|
1259
|
+
m = +m + 1;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
if (gtlt === "<") {
|
|
1263
|
+
pr = "-0";
|
|
1264
|
+
}
|
|
1265
|
+
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
1266
|
+
} else if (xm) {
|
|
1267
|
+
ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
1268
|
+
} else if (xp) {
|
|
1269
|
+
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1270
|
+
}
|
|
1271
|
+
debug("xRange return", ret);
|
|
1272
|
+
return ret;
|
|
1273
|
+
});
|
|
1274
|
+
};
|
|
1275
|
+
var replaceStars = (comp, options) => {
|
|
1276
|
+
debug("replaceStars", comp, options);
|
|
1277
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
1278
|
+
};
|
|
1279
|
+
var replaceGTE0 = (comp, options) => {
|
|
1280
|
+
debug("replaceGTE0", comp, options);
|
|
1281
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1282
|
+
};
|
|
1283
|
+
var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
1284
|
+
if (isX(fM)) {
|
|
1285
|
+
from = "";
|
|
1286
|
+
} else if (isX(fm)) {
|
|
1287
|
+
from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
|
|
1288
|
+
} else if (isX(fp)) {
|
|
1289
|
+
from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
|
|
1290
|
+
} else if (fpr) {
|
|
1291
|
+
from = `>=${from}`;
|
|
1292
|
+
} else {
|
|
1293
|
+
from = `>=${from}${incPr ? "-0" : ""}`;
|
|
1294
|
+
}
|
|
1295
|
+
if (isX(tM)) {
|
|
1296
|
+
to = "";
|
|
1297
|
+
} else if (isX(tm)) {
|
|
1298
|
+
to = `<${+tM + 1}.0.0-0`;
|
|
1299
|
+
} else if (isX(tp)) {
|
|
1300
|
+
to = `<${tM}.${+tm + 1}.0-0`;
|
|
1301
|
+
} else if (tpr) {
|
|
1302
|
+
to = `<=${tM}.${tm}.${tp}-${tpr}`;
|
|
1303
|
+
} else if (incPr) {
|
|
1304
|
+
to = `<${tM}.${tm}.${+tp + 1}-0`;
|
|
1305
|
+
} else {
|
|
1306
|
+
to = `<=${to}`;
|
|
1307
|
+
}
|
|
1308
|
+
return `${from} ${to}`.trim();
|
|
1309
|
+
};
|
|
1310
|
+
var testSet = (set, version, options) => {
|
|
1311
|
+
for (let i = 0; i < set.length; i++) {
|
|
1312
|
+
if (!set[i].test(version)) {
|
|
1313
|
+
return false;
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
if (version.prerelease.length && !options.includePrerelease) {
|
|
1317
|
+
for (let i = 0; i < set.length; i++) {
|
|
1318
|
+
debug(set[i].semver);
|
|
1319
|
+
if (set[i].semver === Comparator.ANY) {
|
|
1320
|
+
continue;
|
|
1321
|
+
}
|
|
1322
|
+
if (set[i].semver.prerelease.length > 0) {
|
|
1323
|
+
const allowed = set[i].semver;
|
|
1324
|
+
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) {
|
|
1325
|
+
return true;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
return false;
|
|
1330
|
+
}
|
|
1331
|
+
return true;
|
|
1332
|
+
};
|
|
1333
|
+
}
|
|
1334
|
+
});
|
|
1335
|
+
|
|
1336
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js
|
|
1337
|
+
var require_comparator = __commonJS({
|
|
1338
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/classes/comparator.js"(exports, module) {
|
|
1339
|
+
"use strict";
|
|
1340
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
|
|
1341
|
+
var Comparator = class _Comparator {
|
|
1342
|
+
static get ANY() {
|
|
1343
|
+
return ANY;
|
|
1344
|
+
}
|
|
1345
|
+
constructor(comp, options) {
|
|
1346
|
+
options = parseOptions(options);
|
|
1347
|
+
if (comp instanceof _Comparator) {
|
|
1348
|
+
if (comp.loose === !!options.loose) {
|
|
1349
|
+
return comp;
|
|
1350
|
+
} else {
|
|
1351
|
+
comp = comp.value;
|
|
1352
|
+
}
|
|
1353
|
+
}
|
|
1354
|
+
comp = comp.trim().split(/\s+/).join(" ");
|
|
1355
|
+
debug("comparator", comp, options);
|
|
1356
|
+
this.options = options;
|
|
1357
|
+
this.loose = !!options.loose;
|
|
1358
|
+
this.parse(comp);
|
|
1359
|
+
if (this.semver === ANY) {
|
|
1360
|
+
this.value = "";
|
|
1361
|
+
} else {
|
|
1362
|
+
this.value = this.operator + this.semver.version;
|
|
1363
|
+
}
|
|
1364
|
+
debug("comp", this);
|
|
1365
|
+
}
|
|
1366
|
+
parse(comp) {
|
|
1367
|
+
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
1368
|
+
const m = comp.match(r);
|
|
1369
|
+
if (!m) {
|
|
1370
|
+
throw new TypeError(`Invalid comparator: ${comp}`);
|
|
1371
|
+
}
|
|
1372
|
+
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
1373
|
+
if (this.operator === "=") {
|
|
1374
|
+
this.operator = "";
|
|
1375
|
+
}
|
|
1376
|
+
if (!m[2]) {
|
|
1377
|
+
this.semver = ANY;
|
|
1378
|
+
} else {
|
|
1379
|
+
this.semver = new SemVer(m[2], this.options.loose);
|
|
1380
|
+
}
|
|
1381
|
+
}
|
|
1382
|
+
toString() {
|
|
1383
|
+
return this.value;
|
|
1384
|
+
}
|
|
1385
|
+
test(version) {
|
|
1386
|
+
debug("Comparator.test", version, this.options.loose);
|
|
1387
|
+
if (this.semver === ANY || version === ANY) {
|
|
1388
|
+
return true;
|
|
1389
|
+
}
|
|
1390
|
+
if (typeof version === "string") {
|
|
1391
|
+
try {
|
|
1392
|
+
version = new SemVer(version, this.options);
|
|
1393
|
+
} catch (er) {
|
|
1394
|
+
return false;
|
|
1395
|
+
}
|
|
1396
|
+
}
|
|
1397
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
1398
|
+
}
|
|
1399
|
+
intersects(comp, options) {
|
|
1400
|
+
if (!(comp instanceof _Comparator)) {
|
|
1401
|
+
throw new TypeError("a Comparator is required");
|
|
1402
|
+
}
|
|
1403
|
+
if (this.operator === "") {
|
|
1404
|
+
if (this.value === "") {
|
|
1405
|
+
return true;
|
|
1406
|
+
}
|
|
1407
|
+
return new Range(comp.value, options).test(this.value);
|
|
1408
|
+
} else if (comp.operator === "") {
|
|
1409
|
+
if (comp.value === "") {
|
|
1410
|
+
return true;
|
|
1411
|
+
}
|
|
1412
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1413
|
+
}
|
|
1414
|
+
options = parseOptions(options);
|
|
1415
|
+
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
|
|
1416
|
+
return false;
|
|
1417
|
+
}
|
|
1418
|
+
if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
|
|
1419
|
+
return false;
|
|
1420
|
+
}
|
|
1421
|
+
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
|
|
1422
|
+
return true;
|
|
1423
|
+
}
|
|
1424
|
+
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
|
|
1425
|
+
return true;
|
|
1426
|
+
}
|
|
1427
|
+
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
|
|
1428
|
+
return true;
|
|
1429
|
+
}
|
|
1430
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
|
|
1431
|
+
return true;
|
|
1432
|
+
}
|
|
1433
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
|
|
1434
|
+
return true;
|
|
1435
|
+
}
|
|
1436
|
+
return false;
|
|
1437
|
+
}
|
|
1438
|
+
};
|
|
1439
|
+
module.exports = Comparator;
|
|
1440
|
+
var parseOptions = require_parse_options();
|
|
1441
|
+
var { safeRe: re, t } = require_re();
|
|
1442
|
+
var cmp = require_cmp();
|
|
1443
|
+
var debug = require_debug();
|
|
1444
|
+
var SemVer = require_semver();
|
|
1445
|
+
var Range = require_range();
|
|
1446
|
+
}
|
|
1447
|
+
});
|
|
1448
|
+
|
|
1449
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js
|
|
1450
|
+
var require_satisfies = __commonJS({
|
|
1451
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/functions/satisfies.js"(exports, module) {
|
|
1452
|
+
"use strict";
|
|
1453
|
+
var Range = require_range();
|
|
1454
|
+
var satisfies = (version, range, options) => {
|
|
1455
|
+
try {
|
|
1456
|
+
range = new Range(range, options);
|
|
1457
|
+
} catch (er) {
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1460
|
+
return range.test(version);
|
|
1461
|
+
};
|
|
1462
|
+
module.exports = satisfies;
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
|
|
1466
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js
|
|
1467
|
+
var require_to_comparators = __commonJS({
|
|
1468
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/to-comparators.js"(exports, module) {
|
|
1469
|
+
"use strict";
|
|
1470
|
+
var Range = require_range();
|
|
1471
|
+
var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1472
|
+
module.exports = toComparators;
|
|
1473
|
+
}
|
|
1474
|
+
});
|
|
1475
|
+
|
|
1476
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js
|
|
1477
|
+
var require_max_satisfying = __commonJS({
|
|
1478
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
|
|
1479
|
+
"use strict";
|
|
1480
|
+
var SemVer = require_semver();
|
|
1481
|
+
var Range = require_range();
|
|
1482
|
+
var maxSatisfying = (versions, range, options) => {
|
|
1483
|
+
let max = null;
|
|
1484
|
+
let maxSV = null;
|
|
1485
|
+
let rangeObj = null;
|
|
1486
|
+
try {
|
|
1487
|
+
rangeObj = new Range(range, options);
|
|
1488
|
+
} catch (er) {
|
|
1489
|
+
return null;
|
|
1490
|
+
}
|
|
1491
|
+
versions.forEach((v) => {
|
|
1492
|
+
if (rangeObj.test(v)) {
|
|
1493
|
+
if (!max || maxSV.compare(v) === -1) {
|
|
1494
|
+
max = v;
|
|
1495
|
+
maxSV = new SemVer(max, options);
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
return max;
|
|
1500
|
+
};
|
|
1501
|
+
module.exports = maxSatisfying;
|
|
1502
|
+
}
|
|
1503
|
+
});
|
|
1504
|
+
|
|
1505
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js
|
|
1506
|
+
var require_min_satisfying = __commonJS({
|
|
1507
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
|
|
1508
|
+
"use strict";
|
|
1509
|
+
var SemVer = require_semver();
|
|
1510
|
+
var Range = require_range();
|
|
1511
|
+
var minSatisfying = (versions, range, options) => {
|
|
1512
|
+
let min = null;
|
|
1513
|
+
let minSV = null;
|
|
1514
|
+
let rangeObj = null;
|
|
1515
|
+
try {
|
|
1516
|
+
rangeObj = new Range(range, options);
|
|
1517
|
+
} catch (er) {
|
|
1518
|
+
return null;
|
|
1519
|
+
}
|
|
1520
|
+
versions.forEach((v) => {
|
|
1521
|
+
if (rangeObj.test(v)) {
|
|
1522
|
+
if (!min || minSV.compare(v) === 1) {
|
|
1523
|
+
min = v;
|
|
1524
|
+
minSV = new SemVer(min, options);
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
});
|
|
1528
|
+
return min;
|
|
1529
|
+
};
|
|
1530
|
+
module.exports = minSatisfying;
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
|
|
1534
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js
|
|
1535
|
+
var require_min_version = __commonJS({
|
|
1536
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/min-version.js"(exports, module) {
|
|
1537
|
+
"use strict";
|
|
1538
|
+
var SemVer = require_semver();
|
|
1539
|
+
var Range = require_range();
|
|
1540
|
+
var gt = require_gt();
|
|
1541
|
+
var minVersion = (range, loose) => {
|
|
1542
|
+
range = new Range(range, loose);
|
|
1543
|
+
let minver = new SemVer("0.0.0");
|
|
1544
|
+
if (range.test(minver)) {
|
|
1545
|
+
return minver;
|
|
1546
|
+
}
|
|
1547
|
+
minver = new SemVer("0.0.0-0");
|
|
1548
|
+
if (range.test(minver)) {
|
|
1549
|
+
return minver;
|
|
1550
|
+
}
|
|
1551
|
+
minver = null;
|
|
1552
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1553
|
+
const comparators = range.set[i];
|
|
1554
|
+
let setMin = null;
|
|
1555
|
+
comparators.forEach((comparator) => {
|
|
1556
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1557
|
+
switch (comparator.operator) {
|
|
1558
|
+
case ">":
|
|
1559
|
+
if (compver.prerelease.length === 0) {
|
|
1560
|
+
compver.patch++;
|
|
1561
|
+
} else {
|
|
1562
|
+
compver.prerelease.push(0);
|
|
1563
|
+
}
|
|
1564
|
+
compver.raw = compver.format();
|
|
1565
|
+
/* fallthrough */
|
|
1566
|
+
case "":
|
|
1567
|
+
case ">=":
|
|
1568
|
+
if (!setMin || gt(compver, setMin)) {
|
|
1569
|
+
setMin = compver;
|
|
1570
|
+
}
|
|
1571
|
+
break;
|
|
1572
|
+
case "<":
|
|
1573
|
+
case "<=":
|
|
1574
|
+
break;
|
|
1575
|
+
/* istanbul ignore next */
|
|
1576
|
+
default:
|
|
1577
|
+
throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1578
|
+
}
|
|
1579
|
+
});
|
|
1580
|
+
if (setMin && (!minver || gt(minver, setMin))) {
|
|
1581
|
+
minver = setMin;
|
|
1582
|
+
}
|
|
1583
|
+
}
|
|
1584
|
+
if (minver && range.test(minver)) {
|
|
1585
|
+
return minver;
|
|
1586
|
+
}
|
|
1587
|
+
return null;
|
|
1588
|
+
};
|
|
1589
|
+
module.exports = minVersion;
|
|
1590
|
+
}
|
|
1591
|
+
});
|
|
1592
|
+
|
|
1593
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js
|
|
1594
|
+
var require_valid2 = __commonJS({
|
|
1595
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/valid.js"(exports, module) {
|
|
1596
|
+
"use strict";
|
|
1597
|
+
var Range = require_range();
|
|
1598
|
+
var validRange = (range, options) => {
|
|
1599
|
+
try {
|
|
1600
|
+
return new Range(range, options).range || "*";
|
|
1601
|
+
} catch (er) {
|
|
1602
|
+
return null;
|
|
1603
|
+
}
|
|
1604
|
+
};
|
|
1605
|
+
module.exports = validRange;
|
|
1606
|
+
}
|
|
1607
|
+
});
|
|
1608
|
+
|
|
1609
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js
|
|
1610
|
+
var require_outside = __commonJS({
|
|
1611
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/outside.js"(exports, module) {
|
|
1612
|
+
"use strict";
|
|
1613
|
+
var SemVer = require_semver();
|
|
1614
|
+
var Comparator = require_comparator();
|
|
1615
|
+
var { ANY } = Comparator;
|
|
1616
|
+
var Range = require_range();
|
|
1617
|
+
var satisfies = require_satisfies();
|
|
1618
|
+
var gt = require_gt();
|
|
1619
|
+
var lt = require_lt();
|
|
1620
|
+
var lte = require_lte();
|
|
1621
|
+
var gte = require_gte();
|
|
1622
|
+
var outside = (version, range, hilo, options) => {
|
|
1623
|
+
version = new SemVer(version, options);
|
|
1624
|
+
range = new Range(range, options);
|
|
1625
|
+
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1626
|
+
switch (hilo) {
|
|
1627
|
+
case ">":
|
|
1628
|
+
gtfn = gt;
|
|
1629
|
+
ltefn = lte;
|
|
1630
|
+
ltfn = lt;
|
|
1631
|
+
comp = ">";
|
|
1632
|
+
ecomp = ">=";
|
|
1633
|
+
break;
|
|
1634
|
+
case "<":
|
|
1635
|
+
gtfn = lt;
|
|
1636
|
+
ltefn = gte;
|
|
1637
|
+
ltfn = gt;
|
|
1638
|
+
comp = "<";
|
|
1639
|
+
ecomp = "<=";
|
|
1640
|
+
break;
|
|
1641
|
+
default:
|
|
1642
|
+
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
1643
|
+
}
|
|
1644
|
+
if (satisfies(version, range, options)) {
|
|
1645
|
+
return false;
|
|
1646
|
+
}
|
|
1647
|
+
for (let i = 0; i < range.set.length; ++i) {
|
|
1648
|
+
const comparators = range.set[i];
|
|
1649
|
+
let high = null;
|
|
1650
|
+
let low = null;
|
|
1651
|
+
comparators.forEach((comparator) => {
|
|
1652
|
+
if (comparator.semver === ANY) {
|
|
1653
|
+
comparator = new Comparator(">=0.0.0");
|
|
1654
|
+
}
|
|
1655
|
+
high = high || comparator;
|
|
1656
|
+
low = low || comparator;
|
|
1657
|
+
if (gtfn(comparator.semver, high.semver, options)) {
|
|
1658
|
+
high = comparator;
|
|
1659
|
+
} else if (ltfn(comparator.semver, low.semver, options)) {
|
|
1660
|
+
low = comparator;
|
|
1661
|
+
}
|
|
1662
|
+
});
|
|
1663
|
+
if (high.operator === comp || high.operator === ecomp) {
|
|
1664
|
+
return false;
|
|
1665
|
+
}
|
|
1666
|
+
if ((!low.operator || low.operator === comp) && ltefn(version, low.semver)) {
|
|
1667
|
+
return false;
|
|
1668
|
+
} else if (low.operator === ecomp && ltfn(version, low.semver)) {
|
|
1669
|
+
return false;
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
return true;
|
|
1673
|
+
};
|
|
1674
|
+
module.exports = outside;
|
|
1675
|
+
}
|
|
1676
|
+
});
|
|
1677
|
+
|
|
1678
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js
|
|
1679
|
+
var require_gtr = __commonJS({
|
|
1680
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/gtr.js"(exports, module) {
|
|
1681
|
+
"use strict";
|
|
1682
|
+
var outside = require_outside();
|
|
1683
|
+
var gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1684
|
+
module.exports = gtr;
|
|
1685
|
+
}
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js
|
|
1689
|
+
var require_ltr = __commonJS({
|
|
1690
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/ltr.js"(exports, module) {
|
|
1691
|
+
"use strict";
|
|
1692
|
+
var outside = require_outside();
|
|
1693
|
+
var ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1694
|
+
module.exports = ltr;
|
|
1695
|
+
}
|
|
1696
|
+
});
|
|
1697
|
+
|
|
1698
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js
|
|
1699
|
+
var require_intersects = __commonJS({
|
|
1700
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/intersects.js"(exports, module) {
|
|
1701
|
+
"use strict";
|
|
1702
|
+
var Range = require_range();
|
|
1703
|
+
var intersects = (r1, r2, options) => {
|
|
1704
|
+
r1 = new Range(r1, options);
|
|
1705
|
+
r2 = new Range(r2, options);
|
|
1706
|
+
return r1.intersects(r2, options);
|
|
1707
|
+
};
|
|
1708
|
+
module.exports = intersects;
|
|
1709
|
+
}
|
|
1710
|
+
});
|
|
1711
|
+
|
|
1712
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js
|
|
1713
|
+
var require_simplify = __commonJS({
|
|
1714
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/simplify.js"(exports, module) {
|
|
1715
|
+
"use strict";
|
|
1716
|
+
var satisfies = require_satisfies();
|
|
1717
|
+
var compare = require_compare();
|
|
1718
|
+
module.exports = (versions, range, options) => {
|
|
1719
|
+
const set = [];
|
|
1720
|
+
let first = null;
|
|
1721
|
+
let prev = null;
|
|
1722
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1723
|
+
for (const version of v) {
|
|
1724
|
+
const included = satisfies(version, range, options);
|
|
1725
|
+
if (included) {
|
|
1726
|
+
prev = version;
|
|
1727
|
+
if (!first) {
|
|
1728
|
+
first = version;
|
|
1729
|
+
}
|
|
1730
|
+
} else {
|
|
1731
|
+
if (prev) {
|
|
1732
|
+
set.push([first, prev]);
|
|
1733
|
+
}
|
|
1734
|
+
prev = null;
|
|
1735
|
+
first = null;
|
|
1736
|
+
}
|
|
1737
|
+
}
|
|
1738
|
+
if (first) {
|
|
1739
|
+
set.push([first, null]);
|
|
1740
|
+
}
|
|
1741
|
+
const ranges = [];
|
|
1742
|
+
for (const [min, max] of set) {
|
|
1743
|
+
if (min === max) {
|
|
1744
|
+
ranges.push(min);
|
|
1745
|
+
} else if (!max && min === v[0]) {
|
|
1746
|
+
ranges.push("*");
|
|
1747
|
+
} else if (!max) {
|
|
1748
|
+
ranges.push(`>=${min}`);
|
|
1749
|
+
} else if (min === v[0]) {
|
|
1750
|
+
ranges.push(`<=${max}`);
|
|
1751
|
+
} else {
|
|
1752
|
+
ranges.push(`${min} - ${max}`);
|
|
1753
|
+
}
|
|
1754
|
+
}
|
|
1755
|
+
const simplified = ranges.join(" || ");
|
|
1756
|
+
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1757
|
+
return simplified.length < original.length ? simplified : range;
|
|
1758
|
+
};
|
|
1759
|
+
}
|
|
1760
|
+
});
|
|
1761
|
+
|
|
1762
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js
|
|
1763
|
+
var require_subset = __commonJS({
|
|
1764
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/ranges/subset.js"(exports, module) {
|
|
1765
|
+
"use strict";
|
|
1766
|
+
var Range = require_range();
|
|
1767
|
+
var Comparator = require_comparator();
|
|
1768
|
+
var { ANY } = Comparator;
|
|
1769
|
+
var satisfies = require_satisfies();
|
|
1770
|
+
var compare = require_compare();
|
|
1771
|
+
var subset = (sub, dom, options = {}) => {
|
|
1772
|
+
if (sub === dom) {
|
|
1773
|
+
return true;
|
|
1774
|
+
}
|
|
1775
|
+
sub = new Range(sub, options);
|
|
1776
|
+
dom = new Range(dom, options);
|
|
1777
|
+
let sawNonNull = false;
|
|
1778
|
+
OUTER: for (const simpleSub of sub.set) {
|
|
1779
|
+
for (const simpleDom of dom.set) {
|
|
1780
|
+
const isSub = simpleSubset(simpleSub, simpleDom, options);
|
|
1781
|
+
sawNonNull = sawNonNull || isSub !== null;
|
|
1782
|
+
if (isSub) {
|
|
1783
|
+
continue OUTER;
|
|
1784
|
+
}
|
|
1785
|
+
}
|
|
1786
|
+
if (sawNonNull) {
|
|
1787
|
+
return false;
|
|
1788
|
+
}
|
|
1789
|
+
}
|
|
1790
|
+
return true;
|
|
1791
|
+
};
|
|
1792
|
+
var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1793
|
+
var minimumVersion = [new Comparator(">=0.0.0")];
|
|
1794
|
+
var simpleSubset = (sub, dom, options) => {
|
|
1795
|
+
if (sub === dom) {
|
|
1796
|
+
return true;
|
|
1797
|
+
}
|
|
1798
|
+
if (sub.length === 1 && sub[0].semver === ANY) {
|
|
1799
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1800
|
+
return true;
|
|
1801
|
+
} else if (options.includePrerelease) {
|
|
1802
|
+
sub = minimumVersionWithPreRelease;
|
|
1803
|
+
} else {
|
|
1804
|
+
sub = minimumVersion;
|
|
1805
|
+
}
|
|
1806
|
+
}
|
|
1807
|
+
if (dom.length === 1 && dom[0].semver === ANY) {
|
|
1808
|
+
if (options.includePrerelease) {
|
|
1809
|
+
return true;
|
|
1810
|
+
} else {
|
|
1811
|
+
dom = minimumVersion;
|
|
1812
|
+
}
|
|
1813
|
+
}
|
|
1814
|
+
const eqSet = /* @__PURE__ */ new Set();
|
|
1815
|
+
let gt, lt;
|
|
1816
|
+
for (const c of sub) {
|
|
1817
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1818
|
+
gt = higherGT(gt, c, options);
|
|
1819
|
+
} else if (c.operator === "<" || c.operator === "<=") {
|
|
1820
|
+
lt = lowerLT(lt, c, options);
|
|
1821
|
+
} else {
|
|
1822
|
+
eqSet.add(c.semver);
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
if (eqSet.size > 1) {
|
|
1826
|
+
return null;
|
|
1827
|
+
}
|
|
1828
|
+
let gtltComp;
|
|
1829
|
+
if (gt && lt) {
|
|
1830
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1831
|
+
if (gtltComp > 0) {
|
|
1832
|
+
return null;
|
|
1833
|
+
} else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
|
|
1834
|
+
return null;
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
for (const eq of eqSet) {
|
|
1838
|
+
if (gt && !satisfies(eq, String(gt), options)) {
|
|
1839
|
+
return null;
|
|
1840
|
+
}
|
|
1841
|
+
if (lt && !satisfies(eq, String(lt), options)) {
|
|
1842
|
+
return null;
|
|
1843
|
+
}
|
|
1844
|
+
for (const c of dom) {
|
|
1845
|
+
if (!satisfies(eq, String(c), options)) {
|
|
1846
|
+
return false;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
return true;
|
|
1850
|
+
}
|
|
1851
|
+
let higher, lower;
|
|
1852
|
+
let hasDomLT, hasDomGT;
|
|
1853
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1854
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1855
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
|
|
1856
|
+
needDomLTPre = false;
|
|
1857
|
+
}
|
|
1858
|
+
for (const c of dom) {
|
|
1859
|
+
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1860
|
+
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1861
|
+
if (gt) {
|
|
1862
|
+
if (needDomGTPre) {
|
|
1863
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) {
|
|
1864
|
+
needDomGTPre = false;
|
|
1865
|
+
}
|
|
1866
|
+
}
|
|
1867
|
+
if (c.operator === ">" || c.operator === ">=") {
|
|
1868
|
+
higher = higherGT(gt, c, options);
|
|
1869
|
+
if (higher === c && higher !== gt) {
|
|
1870
|
+
return false;
|
|
1871
|
+
}
|
|
1872
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) {
|
|
1873
|
+
return false;
|
|
1874
|
+
}
|
|
1875
|
+
}
|
|
1876
|
+
if (lt) {
|
|
1877
|
+
if (needDomLTPre) {
|
|
1878
|
+
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) {
|
|
1879
|
+
needDomLTPre = false;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
if (c.operator === "<" || c.operator === "<=") {
|
|
1883
|
+
lower = lowerLT(lt, c, options);
|
|
1884
|
+
if (lower === c && lower !== lt) {
|
|
1885
|
+
return false;
|
|
1886
|
+
}
|
|
1887
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) {
|
|
1888
|
+
return false;
|
|
1889
|
+
}
|
|
1890
|
+
}
|
|
1891
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) {
|
|
1892
|
+
return false;
|
|
1893
|
+
}
|
|
1894
|
+
}
|
|
1895
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) {
|
|
1896
|
+
return false;
|
|
1897
|
+
}
|
|
1898
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) {
|
|
1899
|
+
return false;
|
|
1900
|
+
}
|
|
1901
|
+
if (needDomGTPre || needDomLTPre) {
|
|
1902
|
+
return false;
|
|
1903
|
+
}
|
|
1904
|
+
return true;
|
|
1905
|
+
};
|
|
1906
|
+
var higherGT = (a, b, options) => {
|
|
1907
|
+
if (!a) {
|
|
1908
|
+
return b;
|
|
1909
|
+
}
|
|
1910
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1911
|
+
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1912
|
+
};
|
|
1913
|
+
var lowerLT = (a, b, options) => {
|
|
1914
|
+
if (!a) {
|
|
1915
|
+
return b;
|
|
1916
|
+
}
|
|
1917
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1918
|
+
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1919
|
+
};
|
|
1920
|
+
module.exports = subset;
|
|
1921
|
+
}
|
|
1922
|
+
});
|
|
1923
|
+
|
|
1924
|
+
// ../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js
|
|
1925
|
+
var require_semver2 = __commonJS({
|
|
1926
|
+
"../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js"(exports, module) {
|
|
1927
|
+
"use strict";
|
|
1928
|
+
var internalRe = require_re();
|
|
1929
|
+
var constants = require_constants();
|
|
1930
|
+
var SemVer = require_semver();
|
|
1931
|
+
var identifiers = require_identifiers();
|
|
1932
|
+
var parse = require_parse();
|
|
1933
|
+
var valid = require_valid();
|
|
1934
|
+
var clean = require_clean();
|
|
1935
|
+
var inc = require_inc();
|
|
1936
|
+
var diff = require_diff();
|
|
1937
|
+
var major = require_major();
|
|
1938
|
+
var minor = require_minor();
|
|
1939
|
+
var patch = require_patch();
|
|
1940
|
+
var prerelease = require_prerelease();
|
|
1941
|
+
var compare = require_compare();
|
|
1942
|
+
var rcompare = require_rcompare();
|
|
1943
|
+
var compareLoose = require_compare_loose();
|
|
1944
|
+
var compareBuild = require_compare_build();
|
|
1945
|
+
var sort = require_sort();
|
|
1946
|
+
var rsort = require_rsort();
|
|
1947
|
+
var gt = require_gt();
|
|
1948
|
+
var lt = require_lt();
|
|
1949
|
+
var eq = require_eq();
|
|
1950
|
+
var neq = require_neq();
|
|
1951
|
+
var gte = require_gte();
|
|
1952
|
+
var lte = require_lte();
|
|
1953
|
+
var cmp = require_cmp();
|
|
1954
|
+
var coerce = require_coerce();
|
|
1955
|
+
var truncate = require_truncate();
|
|
1956
|
+
var Comparator = require_comparator();
|
|
1957
|
+
var Range = require_range();
|
|
1958
|
+
var satisfies = require_satisfies();
|
|
1959
|
+
var toComparators = require_to_comparators();
|
|
1960
|
+
var maxSatisfying = require_max_satisfying();
|
|
1961
|
+
var minSatisfying = require_min_satisfying();
|
|
1962
|
+
var minVersion = require_min_version();
|
|
1963
|
+
var validRange = require_valid2();
|
|
1964
|
+
var outside = require_outside();
|
|
1965
|
+
var gtr = require_gtr();
|
|
1966
|
+
var ltr = require_ltr();
|
|
1967
|
+
var intersects = require_intersects();
|
|
1968
|
+
var simplifyRange = require_simplify();
|
|
1969
|
+
var subset = require_subset();
|
|
1970
|
+
module.exports = {
|
|
1971
|
+
parse,
|
|
1972
|
+
valid,
|
|
1973
|
+
clean,
|
|
1974
|
+
inc,
|
|
1975
|
+
diff,
|
|
1976
|
+
major,
|
|
1977
|
+
minor,
|
|
1978
|
+
patch,
|
|
1979
|
+
prerelease,
|
|
1980
|
+
compare,
|
|
1981
|
+
rcompare,
|
|
1982
|
+
compareLoose,
|
|
1983
|
+
compareBuild,
|
|
1984
|
+
sort,
|
|
1985
|
+
rsort,
|
|
1986
|
+
gt,
|
|
1987
|
+
lt,
|
|
1988
|
+
eq,
|
|
1989
|
+
neq,
|
|
1990
|
+
gte,
|
|
1991
|
+
lte,
|
|
1992
|
+
cmp,
|
|
1993
|
+
coerce,
|
|
1994
|
+
truncate,
|
|
1995
|
+
Comparator,
|
|
1996
|
+
Range,
|
|
1997
|
+
satisfies,
|
|
1998
|
+
toComparators,
|
|
1999
|
+
maxSatisfying,
|
|
2000
|
+
minSatisfying,
|
|
2001
|
+
minVersion,
|
|
2002
|
+
validRange,
|
|
2003
|
+
outside,
|
|
2004
|
+
gtr,
|
|
2005
|
+
ltr,
|
|
2006
|
+
intersects,
|
|
2007
|
+
simplifyRange,
|
|
2008
|
+
subset,
|
|
2009
|
+
SemVer,
|
|
2010
|
+
re: internalRe.re,
|
|
2011
|
+
src: internalRe.src,
|
|
2012
|
+
tokens: internalRe.t,
|
|
2013
|
+
SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
|
|
2014
|
+
RELEASE_TYPES: constants.RELEASE_TYPES,
|
|
2015
|
+
compareIdentifiers: identifiers.compareIdentifiers,
|
|
2016
|
+
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
2017
|
+
};
|
|
2018
|
+
}
|
|
2019
|
+
});
|
|
2020
|
+
|
|
1
2021
|
// src/index.ts
|
|
2
2022
|
import { spawnSync as spawnSync2 } from "child_process";
|
|
3
2023
|
import fs2 from "fs";
|
|
@@ -276,6 +2296,14 @@ var datastoreRequirementSchema = z.object({
|
|
|
276
2296
|
id: tableNameSchema,
|
|
277
2297
|
/** "app" = this project's app-local store; "org" = an org-level shared store. */
|
|
278
2298
|
scope: z.enum(["app", "org"]).default("app"),
|
|
2299
|
+
/**
|
|
2300
|
+
* Which kind of connected store satisfies this requirement. A "database"
|
|
2301
|
+
* requirement only ever binds to a database store and a "storage" one
|
|
2302
|
+
* (file/object storage — uploads, images) only to a storage store; the
|
|
2303
|
+
* rail never crosses the two. Defaults to "database", the only kind the
|
|
2304
|
+
* rail resolved before this field existed.
|
|
2305
|
+
*/
|
|
2306
|
+
type: z.enum(["database", "storage"]).default("database"),
|
|
279
2307
|
/** true → install fails when no store resolves; false → binding omitted, module degrades. */
|
|
280
2308
|
required: z.boolean().default(true),
|
|
281
2309
|
/** Checked against the connected store's accessLevel at install. */
|
|
@@ -379,7 +2407,14 @@ var moduleManifestSchema = z.object({
|
|
|
379
2407
|
*/
|
|
380
2408
|
seeds: z.array(seedBundleSchema).optional(),
|
|
381
2409
|
/** npm packages the source imports beyond the base app. Names only; the rail installs each at the home app's range. */
|
|
382
|
-
packages: z.array(npmPackageNameSchema).optional()
|
|
2410
|
+
packages: z.array(npmPackageNameSchema).optional(),
|
|
2411
|
+
/**
|
|
2412
|
+
* UI-layer contract. `separable: true` asserts the Module's components/ and
|
|
2413
|
+
* routes/ hold presentation only — the Blueprint's
|
|
2414
|
+
* `module-boundaries/ui-layer` lint rule enforces it — so a fork may
|
|
2415
|
+
* soft-eject them. See docs/module-ui-soft-eject-plan.md.
|
|
2416
|
+
*/
|
|
2417
|
+
ui: z.object({ separable: z.boolean() }).strict().optional()
|
|
383
2418
|
}).strict().superRefine((manifest, ctx) => {
|
|
384
2419
|
if (manifest.uses.includes(manifest.name)) {
|
|
385
2420
|
ctx.addIssue({
|
|
@@ -2040,7 +4075,11 @@ var composeInputsSchema = z7.strictObject({
|
|
|
2040
4075
|
// A row with an empty binding key must not fail a deploy: the rail
|
|
2041
4076
|
// treats falsy as "no binding key", so normalise rather than reject.
|
|
2042
4077
|
bindingKey: z7.string().nullish().transform((value) => value || null),
|
|
2043
|
-
accessLevel: z7.enum(["read", "write", "admin"])
|
|
4078
|
+
accessLevel: z7.enum(["read", "write", "admin"]),
|
|
4079
|
+
// Defaulted so a file written before the platform emitted store types
|
|
4080
|
+
// (database rows only) still parses. The platform starts writing
|
|
4081
|
+
// storage rows, with `type` set, once forks run a compose that reads it.
|
|
4082
|
+
type: z7.enum(["database", "storage"]).default("database")
|
|
2044
4083
|
})
|
|
2045
4084
|
).default([]),
|
|
2046
4085
|
installs: z7.record(
|
|
@@ -2051,6 +4090,17 @@ var composeInputsSchema = z7.strictObject({
|
|
|
2051
4090
|
})
|
|
2052
4091
|
).default({})
|
|
2053
4092
|
});
|
|
4093
|
+
var STUB_IGNORE_PATH = "apps/web/src/app/.gitignore";
|
|
4094
|
+
var STUB_IGNORE_HEADER = "# Generated by stardeck-compose \u2014 Module-rail stubs are build outputs; do not edit or commit them.";
|
|
4095
|
+
function escapeStubIgnorePattern(pattern) {
|
|
4096
|
+
const escaped = pattern.replace(/[\\[\]*?]/g, (char) => `\\${char}`);
|
|
4097
|
+
return /^[#!]/.test(escaped) ? `\\${escaped}` : escaped;
|
|
4098
|
+
}
|
|
4099
|
+
function buildStubIgnore(artifactPaths) {
|
|
4100
|
+
const prefix = "apps/web/src/app/";
|
|
4101
|
+
const entries = artifactPaths.filter((artifact) => artifact.startsWith(prefix)).map((artifact) => escapeStubIgnorePattern(`/${artifact.slice(prefix.length)}`)).sort();
|
|
4102
|
+
return [STUB_IGNORE_HEADER, ...entries].join("\n") + "\n";
|
|
4103
|
+
}
|
|
2054
4104
|
|
|
2055
4105
|
// ../../packages/lib/src/shared/module-enablement.ts
|
|
2056
4106
|
function isModuleEnabledByList(raw, name, kindOf) {
|
|
@@ -3554,9 +5604,27 @@ function dirnamePosix(filePath) {
|
|
|
3554
5604
|
}
|
|
3555
5605
|
|
|
3556
5606
|
// ../../packages/lib/src/server/module-rail/compose-inputs.ts
|
|
5607
|
+
var import_semver = __toESM(require_semver2(), 1);
|
|
5608
|
+
var TYPED_STORES_MIN_COMPOSE_VERSION = "0.4.0";
|
|
5609
|
+
var COMPOSE_PACKAGE = "@stardeck-customer-apps/compose";
|
|
5610
|
+
var APP_PACKAGE_JSON_PATH = "apps/web/package.json";
|
|
5611
|
+
async function checkoutParsesTypedStores(sandbox) {
|
|
5612
|
+
try {
|
|
5613
|
+
if (!await sandbox.fileExists(APP_PACKAGE_JSON_PATH)) return false;
|
|
5614
|
+
const pkg = JSON.parse(await sandbox.readFile(APP_PACKAGE_JSON_PATH));
|
|
5615
|
+
const range = pkg.devDependencies?.[COMPOSE_PACKAGE] ?? pkg.dependencies?.[COMPOSE_PACKAGE];
|
|
5616
|
+
if (!range) return false;
|
|
5617
|
+
const lowest = import_semver.default.minVersion(range);
|
|
5618
|
+
return lowest != null && import_semver.default.gte(lowest, TYPED_STORES_MIN_COMPOSE_VERSION);
|
|
5619
|
+
} catch {
|
|
5620
|
+
return false;
|
|
5621
|
+
}
|
|
5622
|
+
}
|
|
3557
5623
|
async function buildComposeInputs(input) {
|
|
3558
|
-
const { db, projectId, deps } = input;
|
|
3559
|
-
|
|
5624
|
+
const { db, projectId, deps, typedStores } = input;
|
|
5625
|
+
console.log(`[ComposeInputs] project=${projectId} typedStores=${typedStores}`);
|
|
5626
|
+
const allStores = await deps.listConnectedStoresForProject(db, projectId);
|
|
5627
|
+
const connectedStores = typedStores ? allStores : allStores.filter((store) => store.type === "database");
|
|
3560
5628
|
const installRows = await Promise.all(
|
|
3561
5629
|
input.moduleNames.map(async (moduleName) => ({
|
|
3562
5630
|
moduleName,
|
|
@@ -3571,7 +5639,12 @@ async function buildComposeInputs(input) {
|
|
|
3571
5639
|
datastoreBindings: install.datastoreBindings ?? null
|
|
3572
5640
|
};
|
|
3573
5641
|
}
|
|
3574
|
-
|
|
5642
|
+
const parsed = composeInputsSchema.parse({ connectedStores, installs });
|
|
5643
|
+
if (typedStores) return parsed;
|
|
5644
|
+
return {
|
|
5645
|
+
...parsed,
|
|
5646
|
+
connectedStores: parsed.connectedStores.map(({ type: _type, ...store }) => store)
|
|
5647
|
+
};
|
|
3575
5648
|
}
|
|
3576
5649
|
|
|
3577
5650
|
// ../../packages/lib/src/shared/data-store-manifest.ts
|
|
@@ -3597,7 +5670,7 @@ function compareStores(a, b) {
|
|
|
3597
5670
|
function describeCandidates(stores) {
|
|
3598
5671
|
if (stores.length === 0) return "none";
|
|
3599
5672
|
return stores.map(
|
|
3600
|
-
(store) => `${store.storeId} (slug=${store.slug}, bindingKey=${store.bindingKey ?? "none"}, access=${store.accessLevel})`
|
|
5673
|
+
(store) => `${store.storeId} (type=${store.type}, slug=${store.slug}, bindingKey=${store.bindingKey ?? "none"}, access=${store.accessLevel})`
|
|
3601
5674
|
).join(", ");
|
|
3602
5675
|
}
|
|
3603
5676
|
function groupStoresById(stores) {
|
|
@@ -3628,14 +5701,15 @@ function accessLevelForBinding(group, binding) {
|
|
|
3628
5701
|
);
|
|
3629
5702
|
}
|
|
3630
5703
|
function resolveModuleDataStoreBindings(input) {
|
|
3631
|
-
const
|
|
3632
|
-
const storeGroups = groupStoresById(stores);
|
|
5704
|
+
const allStores = [...input.connectedStores].sort(compareStores);
|
|
3633
5705
|
const requirements = [...input.requirements].sort((a, b) => compareStrings(a.id, b.id));
|
|
3634
5706
|
const overrides = input.explicitOverrides ?? {};
|
|
3635
5707
|
const bindings = {};
|
|
3636
5708
|
const errors = [];
|
|
3637
|
-
const candidates = describeCandidates(stores);
|
|
3638
5709
|
for (const requirement of requirements) {
|
|
5710
|
+
const stores = allStores.filter((store) => store.type === requirement.type);
|
|
5711
|
+
const storeGroups = groupStoresById(stores);
|
|
5712
|
+
const candidates = describeCandidates(allStores);
|
|
3639
5713
|
const logicalSlug = dataStoreSlug(requirement.id);
|
|
3640
5714
|
let selected;
|
|
3641
5715
|
if (Object.prototype.hasOwnProperty.call(overrides, requirement.id)) {
|
|
@@ -3648,7 +5722,7 @@ function resolveModuleDataStoreBindings(input) {
|
|
|
3648
5722
|
moduleName: input.moduleName,
|
|
3649
5723
|
logicalId: requirement.id,
|
|
3650
5724
|
kind: "explicit-override",
|
|
3651
|
-
message: matches.length === 0 ? `Module "${input.moduleName}" data store "${requirement.id}" override "${override}" did not match a connected
|
|
5725
|
+
message: matches.length === 0 ? `Module "${input.moduleName}" data store "${requirement.id}" override "${override}" did not match a connected ${requirement.type} store; candidates: ${candidates}` : `Module "${input.moduleName}" data store "${requirement.id}" override "${override}" is ambiguous; matches: ${describeCandidates(matches.flatMap((group) => group.stores))}`
|
|
3652
5726
|
});
|
|
3653
5727
|
continue;
|
|
3654
5728
|
}
|
|
@@ -3659,6 +5733,8 @@ function resolveModuleDataStoreBindings(input) {
|
|
|
3659
5733
|
);
|
|
3660
5734
|
if (conventionMatches.length === 1) {
|
|
3661
5735
|
selected = conventionMatches[0];
|
|
5736
|
+
} else if (conventionMatches.length === 0 && requirement.type === "storage") {
|
|
5737
|
+
if (storeGroups.length === 1) selected = storeGroups[0];
|
|
3662
5738
|
} else if (conventionMatches.length === 0 && requirement.scope === "app") {
|
|
3663
5739
|
if (storeGroups.length === 1) {
|
|
3664
5740
|
selected = storeGroups[0];
|
|
@@ -4017,7 +6093,7 @@ async function resolveCompositionDataStoreBindings(context, presentNames, manife
|
|
|
4017
6093
|
if (modulesWithRequirements.length === 0) return bindingsByModule;
|
|
4018
6094
|
const deps = context.deps;
|
|
4019
6095
|
if (!deps) throw new Error("Module rail dependencies are required for data-store bindings");
|
|
4020
|
-
const connectedStores = await deps.
|
|
6096
|
+
const connectedStores = await deps.listConnectedStoresForProject(context.db, context.projectId);
|
|
4021
6097
|
const installs = await Promise.all(
|
|
4022
6098
|
modulesWithRequirements.map(
|
|
4023
6099
|
(moduleName) => deps.getModuleInstall(context.db, context.projectId, moduleName)
|
|
@@ -4295,7 +6371,8 @@ async function writeComposeInputs(target) {
|
|
|
4295
6371
|
db: target.db,
|
|
4296
6372
|
projectId: target.projectId,
|
|
4297
6373
|
deps: target.deps,
|
|
4298
|
-
moduleNames
|
|
6374
|
+
moduleNames,
|
|
6375
|
+
typedStores: await checkoutParsesTypedStores(target.sandbox)
|
|
4299
6376
|
});
|
|
4300
6377
|
const content = `${JSON.stringify(inputs, null, 2)}
|
|
4301
6378
|
`;
|
|
@@ -4307,6 +6384,21 @@ async function writeComposeInputs(target) {
|
|
|
4307
6384
|
);
|
|
4308
6385
|
return written;
|
|
4309
6386
|
}
|
|
6387
|
+
async function readStubIgnore(context) {
|
|
6388
|
+
const existing = await context.sandbox.fileExists(STUB_IGNORE_PATH) ? await context.sandbox.readFile(STUB_IGNORE_PATH) : null;
|
|
6389
|
+
if (existing !== null && existing.split("\n", 1)[0] !== STUB_IGNORE_HEADER) {
|
|
6390
|
+
throw new Error(
|
|
6391
|
+
`[ModuleRail] refusing to overwrite ${STUB_IGNORE_PATH}: it is not compose-generated (line 1 is not the generated header)`
|
|
6392
|
+
);
|
|
6393
|
+
}
|
|
6394
|
+
return existing;
|
|
6395
|
+
}
|
|
6396
|
+
async function writeStubIgnore(context, existing, artifactPaths) {
|
|
6397
|
+
const content = buildStubIgnore(artifactPaths);
|
|
6398
|
+
const written = existing === null || existing.trimEnd() !== content.trimEnd();
|
|
6399
|
+
if (written) await writeSandboxFileAtomic(context, STUB_IGNORE_PATH, content);
|
|
6400
|
+
return written;
|
|
6401
|
+
}
|
|
4310
6402
|
async function applyCompositionArtifactMutations(context, plan, existingFiles) {
|
|
4311
6403
|
const appliedWrites = [];
|
|
4312
6404
|
const appliedDeletes = [];
|
|
@@ -5171,9 +7263,17 @@ async function reconcileCompositionArtifacts(context, options = {}) {
|
|
|
5171
7263
|
deps
|
|
5172
7264
|
});
|
|
5173
7265
|
}
|
|
7266
|
+
const maintainIgnore = !options.dryRun && !options.enabledModulesRaw;
|
|
7267
|
+
const existingIgnore = maintainIgnore ? await readStubIgnore(context) : null;
|
|
5174
7268
|
if (changed && !options.dryRun) {
|
|
5175
7269
|
await applyCompositionArtifactMutations(context, planned.plan, existingFiles);
|
|
5176
7270
|
}
|
|
7271
|
+
if (maintainIgnore) {
|
|
7272
|
+
const wroteIgnore = await writeStubIgnore(context, existingIgnore, planned.plan.desiredPaths);
|
|
7273
|
+
console.log(
|
|
7274
|
+
`[ModuleRail] runId=${context.runId} stub ignore list entries=${planned.plan.desiredPaths.length} written=${wroteIgnore}`
|
|
7275
|
+
);
|
|
7276
|
+
}
|
|
5177
7277
|
return {
|
|
5178
7278
|
registryPath: planned.plan.registryPath,
|
|
5179
7279
|
writePaths: planned.plan.writes.map((w) => w.path),
|
|
@@ -5210,7 +7310,8 @@ function readComposeInputs(cwd) {
|
|
|
5210
7310
|
storeId: store.storeId,
|
|
5211
7311
|
slug: store.slug,
|
|
5212
7312
|
bindingKey: store.bindingKey ?? null,
|
|
5213
|
-
accessLevel: store.accessLevel
|
|
7313
|
+
accessLevel: store.accessLevel,
|
|
7314
|
+
type: store.type
|
|
5214
7315
|
})),
|
|
5215
7316
|
installs: parsed.data.installs
|
|
5216
7317
|
};
|
|
@@ -5344,7 +7445,7 @@ async function compose(options) {
|
|
|
5344
7445
|
const deps = {
|
|
5345
7446
|
sandbox,
|
|
5346
7447
|
getModuleInstall: async (_db, _projectId, moduleName) => inputs.installs[moduleName] ?? null,
|
|
5347
|
-
|
|
7448
|
+
listConnectedStoresForProject: async () => inputs.connectedStores
|
|
5348
7449
|
};
|
|
5349
7450
|
const context = {
|
|
5350
7451
|
db: {},
|