@wise/wds-codemods 1.0.0 → 1.1.0-experimental-71771a8
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/README.md +128 -86
- package/dist/constants-CcE2TmzN.js +59 -0
- package/dist/constants-CcE2TmzN.js.map +1 -0
- package/dist/{helpers-auDAwIcO.js → helpers-LWyJOzUP.js} +625 -592
- package/dist/helpers-LWyJOzUP.js.map +1 -0
- package/dist/index.js +87 -46
- package/dist/index.js.map +1 -1
- package/dist/transforms/button/transformer.js +3 -8
- package/dist/transforms/button/transformer.js.map +1 -1
- package/dist/transforms/list-item/config.json/config.json +6 -0
- package/dist/transforms/list-item/transformer.js +426 -0
- package/dist/transforms/list-item/transformer.js.map +1 -0
- package/package.json +46 -38
- package/dist/helpers-auDAwIcO.js.map +0 -1
- /package/dist/transforms/button/{config.json → config.json/config.json} +0 -0
|
@@ -1,47 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
13
|
-
key = keys[i];
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
15
|
-
get: ((k) => from[k]).bind(null, key),
|
|
16
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
return to;
|
|
20
|
-
};
|
|
21
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
22
|
-
value: mod,
|
|
23
|
-
enumerable: true
|
|
24
|
-
}) : target, mod));
|
|
25
|
-
|
|
26
|
-
//#endregion
|
|
1
|
+
const require_constants$1 = require('./constants-CcE2TmzN.js');
|
|
27
2
|
let node_child_process = require("node:child_process");
|
|
28
|
-
node_child_process = __toESM(node_child_process);
|
|
29
3
|
let node_fs_promises = require("node:fs/promises");
|
|
30
|
-
node_fs_promises = __toESM(node_fs_promises);
|
|
4
|
+
node_fs_promises = require_constants$1.__toESM(node_fs_promises);
|
|
31
5
|
let node_path = require("node:path");
|
|
32
|
-
node_path = __toESM(node_path);
|
|
33
|
-
let
|
|
34
|
-
__inquirer_prompts = __toESM(__inquirer_prompts);
|
|
6
|
+
node_path = require_constants$1.__toESM(node_path);
|
|
7
|
+
let _inquirer_prompts = require("@inquirer/prompts");
|
|
35
8
|
let node_fs = require("node:fs");
|
|
36
|
-
node_fs = __toESM(node_fs);
|
|
9
|
+
node_fs = require_constants$1.__toESM(node_fs);
|
|
10
|
+
let node_util = require("node:util");
|
|
37
11
|
|
|
38
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
39
|
-
var require_constants = /* @__PURE__ */
|
|
12
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
|
|
13
|
+
var require_constants = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
40
14
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
41
|
-
const MAX_LENGTH
|
|
42
|
-
const MAX_SAFE_INTEGER
|
|
43
|
-
const MAX_SAFE_COMPONENT_LENGTH
|
|
44
|
-
const MAX_SAFE_BUILD_LENGTH
|
|
15
|
+
const MAX_LENGTH = 256;
|
|
16
|
+
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || 9007199254740991;
|
|
17
|
+
const MAX_SAFE_COMPONENT_LENGTH = 16;
|
|
18
|
+
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
|
|
45
19
|
const RELEASE_TYPES = [
|
|
46
20
|
"major",
|
|
47
21
|
"premajor",
|
|
@@ -52,40 +26,40 @@ var require_constants = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@
|
|
|
52
26
|
"prerelease"
|
|
53
27
|
];
|
|
54
28
|
module.exports = {
|
|
55
|
-
MAX_LENGTH
|
|
56
|
-
MAX_SAFE_COMPONENT_LENGTH
|
|
57
|
-
MAX_SAFE_BUILD_LENGTH
|
|
58
|
-
MAX_SAFE_INTEGER
|
|
29
|
+
MAX_LENGTH,
|
|
30
|
+
MAX_SAFE_COMPONENT_LENGTH,
|
|
31
|
+
MAX_SAFE_BUILD_LENGTH,
|
|
32
|
+
MAX_SAFE_INTEGER,
|
|
59
33
|
RELEASE_TYPES,
|
|
60
34
|
SEMVER_SPEC_VERSION,
|
|
61
35
|
FLAG_INCLUDE_PRERELEASE: 1,
|
|
62
36
|
FLAG_LOOSE: 2
|
|
63
37
|
};
|
|
64
|
-
})
|
|
38
|
+
}));
|
|
65
39
|
|
|
66
40
|
//#endregion
|
|
67
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
68
|
-
var require_debug = /* @__PURE__ */
|
|
69
|
-
const debug
|
|
70
|
-
module.exports = debug
|
|
71
|
-
})
|
|
41
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
|
|
42
|
+
var require_debug = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
43
|
+
const debug = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
|
|
44
|
+
module.exports = debug;
|
|
45
|
+
}));
|
|
72
46
|
|
|
73
47
|
//#endregion
|
|
74
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
75
|
-
var require_re = /* @__PURE__ */
|
|
76
|
-
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH
|
|
77
|
-
const debug
|
|
48
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
|
|
49
|
+
var require_re = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
50
|
+
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
51
|
+
const debug = require_debug();
|
|
78
52
|
exports = module.exports = {};
|
|
79
|
-
const re
|
|
53
|
+
const re = exports.re = [];
|
|
80
54
|
const safeRe = exports.safeRe = [];
|
|
81
55
|
const src = exports.src = [];
|
|
82
56
|
const safeSrc = exports.safeSrc = [];
|
|
83
|
-
const t
|
|
57
|
+
const t = exports.t = {};
|
|
84
58
|
let R = 0;
|
|
85
59
|
const LETTERDASHNUMBER = "[a-zA-Z0-9-]";
|
|
86
60
|
const safeRegexReplacements = [
|
|
87
61
|
["\\s", 1],
|
|
88
|
-
["\\d", MAX_LENGTH
|
|
62
|
+
["\\d", MAX_LENGTH],
|
|
89
63
|
[LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
|
|
90
64
|
];
|
|
91
65
|
const makeSafeRegex = (value) => {
|
|
@@ -95,79 +69,80 @@ var require_re = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.2/n
|
|
|
95
69
|
const createToken = (name, value, isGlobal) => {
|
|
96
70
|
const safe = makeSafeRegex(value);
|
|
97
71
|
const index = R++;
|
|
98
|
-
debug
|
|
99
|
-
t
|
|
72
|
+
debug(name, index, value);
|
|
73
|
+
t[name] = index;
|
|
100
74
|
src[index] = value;
|
|
101
75
|
safeSrc[index] = safe;
|
|
102
|
-
re
|
|
76
|
+
re[index] = new RegExp(value, isGlobal ? "g" : void 0);
|
|
103
77
|
safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
|
|
104
78
|
};
|
|
105
79
|
createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
|
|
106
80
|
createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
|
|
107
81
|
createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
|
|
108
|
-
createToken("MAINVERSION", `(${src[t
|
|
109
|
-
createToken("MAINVERSIONLOOSE", `(${src[t
|
|
110
|
-
createToken("PRERELEASEIDENTIFIER", `(?:${src[t
|
|
111
|
-
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t
|
|
112
|
-
createToken("PRERELEASE", `(?:-(${src[t
|
|
113
|
-
createToken("PRERELEASELOOSE", `(?:-?(${src[t
|
|
82
|
+
createToken("MAINVERSION", `(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})\\.(${src[t.NUMERICIDENTIFIER]})`);
|
|
83
|
+
createToken("MAINVERSIONLOOSE", `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})\\.(${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
84
|
+
createToken("PRERELEASEIDENTIFIER", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIER]})`);
|
|
85
|
+
createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t.NONNUMERICIDENTIFIER]}|${src[t.NUMERICIDENTIFIERLOOSE]})`);
|
|
86
|
+
createToken("PRERELEASE", `(?:-(${src[t.PRERELEASEIDENTIFIER]}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`);
|
|
87
|
+
createToken("PRERELEASELOOSE", `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`);
|
|
114
88
|
createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
|
|
115
|
-
createToken("BUILD", `(?:\\+(${src[t
|
|
116
|
-
createToken("FULLPLAIN", `v?${src[t
|
|
117
|
-
createToken("FULL", `^${src[t
|
|
118
|
-
createToken("LOOSEPLAIN", `[v=\\s]*${src[t
|
|
119
|
-
createToken("LOOSE", `^${src[t
|
|
89
|
+
createToken("BUILD", `(?:\\+(${src[t.BUILDIDENTIFIER]}(?:\\.${src[t.BUILDIDENTIFIER]})*))`);
|
|
90
|
+
createToken("FULLPLAIN", `v?${src[t.MAINVERSION]}${src[t.PRERELEASE]}?${src[t.BUILD]}?`);
|
|
91
|
+
createToken("FULL", `^${src[t.FULLPLAIN]}$`);
|
|
92
|
+
createToken("LOOSEPLAIN", `[v=\\s]*${src[t.MAINVERSIONLOOSE]}${src[t.PRERELEASELOOSE]}?${src[t.BUILD]}?`);
|
|
93
|
+
createToken("LOOSE", `^${src[t.LOOSEPLAIN]}$`);
|
|
120
94
|
createToken("GTLT", "((?:<|>)?=?)");
|
|
121
|
-
createToken("XRANGEIDENTIFIERLOOSE", `${src[t
|
|
122
|
-
createToken("XRANGEIDENTIFIER", `${src[t
|
|
123
|
-
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t
|
|
124
|
-
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t
|
|
125
|
-
createToken("XRANGE", `^${src[t
|
|
126
|
-
createToken("XRANGELOOSE", `^${src[t
|
|
95
|
+
createToken("XRANGEIDENTIFIERLOOSE", `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
|
|
96
|
+
createToken("XRANGEIDENTIFIER", `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`);
|
|
97
|
+
createToken("XRANGEPLAIN", `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:\\.(${src[t.XRANGEIDENTIFIER]})(?:${src[t.PRERELEASE]})?${src[t.BUILD]}?)?)?`);
|
|
98
|
+
createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})(?:${src[t.PRERELEASELOOSE]})?${src[t.BUILD]}?)?)?`);
|
|
99
|
+
createToken("XRANGE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`);
|
|
100
|
+
createToken("XRANGELOOSE", `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`);
|
|
127
101
|
createToken("COERCEPLAIN", `(^|[^\\d])(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
|
|
128
|
-
createToken("COERCE", `${src[t
|
|
129
|
-
createToken("COERCEFULL", src[t
|
|
130
|
-
createToken("COERCERTL", src[t
|
|
131
|
-
createToken("COERCERTLFULL", src[t
|
|
102
|
+
createToken("COERCE", `${src[t.COERCEPLAIN]}(?:$|[^\\d])`);
|
|
103
|
+
createToken("COERCEFULL", src[t.COERCEPLAIN] + `(?:${src[t.PRERELEASE]})?(?:${src[t.BUILD]})?(?:$|[^\\d])`);
|
|
104
|
+
createToken("COERCERTL", src[t.COERCE], true);
|
|
105
|
+
createToken("COERCERTLFULL", src[t.COERCEFULL], true);
|
|
132
106
|
createToken("LONETILDE", "(?:~>?)");
|
|
133
|
-
createToken("TILDETRIM", `(\\s*)${src[t
|
|
107
|
+
createToken("TILDETRIM", `(\\s*)${src[t.LONETILDE]}\\s+`, true);
|
|
134
108
|
exports.tildeTrimReplace = "$1~";
|
|
135
|
-
createToken("TILDE", `^${src[t
|
|
136
|
-
createToken("TILDELOOSE", `^${src[t
|
|
109
|
+
createToken("TILDE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`);
|
|
110
|
+
createToken("TILDELOOSE", `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
137
111
|
createToken("LONECARET", "(?:\\^)");
|
|
138
|
-
createToken("CARETTRIM", `(\\s*)${src[t
|
|
112
|
+
createToken("CARETTRIM", `(\\s*)${src[t.LONECARET]}\\s+`, true);
|
|
139
113
|
exports.caretTrimReplace = "$1^";
|
|
140
|
-
createToken("CARET", `^${src[t
|
|
141
|
-
createToken("CARETLOOSE", `^${src[t
|
|
142
|
-
createToken("COMPARATORLOOSE", `^${src[t
|
|
143
|
-
createToken("COMPARATOR", `^${src[t
|
|
144
|
-
createToken("COMPARATORTRIM", `(\\s*)${src[t
|
|
114
|
+
createToken("CARET", `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`);
|
|
115
|
+
createToken("CARETLOOSE", `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`);
|
|
116
|
+
createToken("COMPARATORLOOSE", `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`);
|
|
117
|
+
createToken("COMPARATOR", `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`);
|
|
118
|
+
createToken("COMPARATORTRIM", `(\\s*)${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true);
|
|
145
119
|
exports.comparatorTrimReplace = "$1$2$3";
|
|
146
|
-
createToken("HYPHENRANGE", `^\\s*(${src[t
|
|
147
|
-
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t
|
|
120
|
+
createToken("HYPHENRANGE", `^\\s*(${src[t.XRANGEPLAIN]})\\s+-\\s+(${src[t.XRANGEPLAIN]})\\s*$`);
|
|
121
|
+
createToken("HYPHENRANGELOOSE", `^\\s*(${src[t.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t.XRANGEPLAINLOOSE]})\\s*$`);
|
|
148
122
|
createToken("STAR", "(<|>)?=?\\s*\\*");
|
|
149
123
|
createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
|
|
150
124
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
151
|
-
})
|
|
125
|
+
}));
|
|
152
126
|
|
|
153
127
|
//#endregion
|
|
154
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
155
|
-
var require_parse_options = /* @__PURE__ */
|
|
128
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
|
|
129
|
+
var require_parse_options = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
156
130
|
const looseOption = Object.freeze({ loose: true });
|
|
157
131
|
const emptyOpts = Object.freeze({});
|
|
158
|
-
const parseOptions
|
|
132
|
+
const parseOptions = (options) => {
|
|
159
133
|
if (!options) return emptyOpts;
|
|
160
134
|
if (typeof options !== "object") return looseOption;
|
|
161
135
|
return options;
|
|
162
136
|
};
|
|
163
|
-
module.exports = parseOptions
|
|
164
|
-
})
|
|
137
|
+
module.exports = parseOptions;
|
|
138
|
+
}));
|
|
165
139
|
|
|
166
140
|
//#endregion
|
|
167
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
168
|
-
var require_identifiers = /* @__PURE__ */
|
|
141
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
|
|
142
|
+
var require_identifiers = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
169
143
|
const numeric = /^[0-9]+$/;
|
|
170
|
-
const compareIdentifiers
|
|
144
|
+
const compareIdentifiers = (a, b) => {
|
|
145
|
+
if (typeof a === "number" && typeof b === "number") return a === b ? 0 : a < b ? -1 : 1;
|
|
171
146
|
const anum = numeric.test(a);
|
|
172
147
|
const bnum = numeric.test(b);
|
|
173
148
|
if (anum && bnum) {
|
|
@@ -176,33 +151,33 @@ var require_identifiers = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semve
|
|
|
176
151
|
}
|
|
177
152
|
return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
|
|
178
153
|
};
|
|
179
|
-
const rcompareIdentifiers = (a, b) => compareIdentifiers
|
|
154
|
+
const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a);
|
|
180
155
|
module.exports = {
|
|
181
|
-
compareIdentifiers
|
|
156
|
+
compareIdentifiers,
|
|
182
157
|
rcompareIdentifiers
|
|
183
158
|
};
|
|
184
|
-
})
|
|
159
|
+
}));
|
|
185
160
|
|
|
186
161
|
//#endregion
|
|
187
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
188
|
-
var require_semver$1 = /* @__PURE__ */
|
|
189
|
-
const debug
|
|
162
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
|
|
163
|
+
var require_semver$1 = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
164
|
+
const debug = require_debug();
|
|
190
165
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
191
|
-
const { safeRe: re
|
|
192
|
-
const parseOptions
|
|
166
|
+
const { safeRe: re, t } = require_re();
|
|
167
|
+
const parseOptions = require_parse_options();
|
|
193
168
|
const { compareIdentifiers } = require_identifiers();
|
|
194
|
-
var SemVer
|
|
169
|
+
var SemVer = class SemVer {
|
|
195
170
|
constructor(version, options) {
|
|
196
|
-
options = parseOptions
|
|
197
|
-
if (version instanceof SemVer
|
|
171
|
+
options = parseOptions(options);
|
|
172
|
+
if (version instanceof SemVer) if (version.loose === !!options.loose && version.includePrerelease === !!options.includePrerelease) return version;
|
|
198
173
|
else version = version.version;
|
|
199
174
|
else if (typeof version !== "string") throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`);
|
|
200
175
|
if (version.length > MAX_LENGTH) throw new TypeError(`version is longer than ${MAX_LENGTH} characters`);
|
|
201
|
-
debug
|
|
176
|
+
debug("SemVer", version, options);
|
|
202
177
|
this.options = options;
|
|
203
178
|
this.loose = !!options.loose;
|
|
204
179
|
this.includePrerelease = !!options.includePrerelease;
|
|
205
|
-
const m = version.trim().match(options.loose ? re
|
|
180
|
+
const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]);
|
|
206
181
|
if (!m) throw new TypeError(`Invalid Version: ${version}`);
|
|
207
182
|
this.raw = version;
|
|
208
183
|
this.major = +m[1];
|
|
@@ -231,20 +206,26 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
231
206
|
return this.version;
|
|
232
207
|
}
|
|
233
208
|
compare(other) {
|
|
234
|
-
debug
|
|
235
|
-
if (!(other instanceof SemVer
|
|
209
|
+
debug("SemVer.compare", this.version, this.options, other);
|
|
210
|
+
if (!(other instanceof SemVer)) {
|
|
236
211
|
if (typeof other === "string" && other === this.version) return 0;
|
|
237
|
-
other = new SemVer
|
|
212
|
+
other = new SemVer(other, this.options);
|
|
238
213
|
}
|
|
239
214
|
if (other.version === this.version) return 0;
|
|
240
215
|
return this.compareMain(other) || this.comparePre(other);
|
|
241
216
|
}
|
|
242
217
|
compareMain(other) {
|
|
243
|
-
if (!(other instanceof SemVer
|
|
244
|
-
|
|
218
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
219
|
+
if (this.major < other.major) return -1;
|
|
220
|
+
if (this.major > other.major) return 1;
|
|
221
|
+
if (this.minor < other.minor) return -1;
|
|
222
|
+
if (this.minor > other.minor) return 1;
|
|
223
|
+
if (this.patch < other.patch) return -1;
|
|
224
|
+
if (this.patch > other.patch) return 1;
|
|
225
|
+
return 0;
|
|
245
226
|
}
|
|
246
227
|
comparePre(other) {
|
|
247
|
-
if (!(other instanceof SemVer
|
|
228
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
248
229
|
if (this.prerelease.length && !other.prerelease.length) return -1;
|
|
249
230
|
else if (!this.prerelease.length && other.prerelease.length) return 1;
|
|
250
231
|
else if (!this.prerelease.length && !other.prerelease.length) return 0;
|
|
@@ -252,7 +233,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
252
233
|
do {
|
|
253
234
|
const a = this.prerelease[i];
|
|
254
235
|
const b = other.prerelease[i];
|
|
255
|
-
debug
|
|
236
|
+
debug("prerelease compare", i, a, b);
|
|
256
237
|
if (a === void 0 && b === void 0) return 0;
|
|
257
238
|
else if (b === void 0) return 1;
|
|
258
239
|
else if (a === void 0) return -1;
|
|
@@ -261,12 +242,12 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
261
242
|
} while (++i);
|
|
262
243
|
}
|
|
263
244
|
compareBuild(other) {
|
|
264
|
-
if (!(other instanceof SemVer
|
|
245
|
+
if (!(other instanceof SemVer)) other = new SemVer(other, this.options);
|
|
265
246
|
let i = 0;
|
|
266
247
|
do {
|
|
267
248
|
const a = this.build[i];
|
|
268
249
|
const b = other.build[i];
|
|
269
|
-
debug
|
|
250
|
+
debug("build compare", i, a, b);
|
|
270
251
|
if (a === void 0 && b === void 0) return 0;
|
|
271
252
|
else if (b === void 0) return 1;
|
|
272
253
|
else if (a === void 0) return -1;
|
|
@@ -278,7 +259,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
278
259
|
if (release.startsWith("pre")) {
|
|
279
260
|
if (!identifier && identifierBase === false) throw new Error("invalid increment argument: identifier is empty");
|
|
280
261
|
if (identifier) {
|
|
281
|
-
const match = `-${identifier}`.match(this.options.loose ? re
|
|
262
|
+
const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE]);
|
|
282
263
|
if (!match || match[1] !== identifier) throw new Error(`invalid identifier: ${identifier}`);
|
|
283
264
|
}
|
|
284
265
|
}
|
|
@@ -339,11 +320,11 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
339
320
|
}
|
|
340
321
|
}
|
|
341
322
|
if (identifier) {
|
|
342
|
-
let prerelease
|
|
343
|
-
if (identifierBase === false) prerelease
|
|
323
|
+
let prerelease = [identifier, base];
|
|
324
|
+
if (identifierBase === false) prerelease = [identifier];
|
|
344
325
|
if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
|
|
345
|
-
if (isNaN(this.prerelease[1])) this.prerelease = prerelease
|
|
346
|
-
} else this.prerelease = prerelease
|
|
326
|
+
if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
|
|
327
|
+
} else this.prerelease = prerelease;
|
|
347
328
|
}
|
|
348
329
|
break;
|
|
349
330
|
}
|
|
@@ -354,73 +335,73 @@ var require_semver$1 = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
354
335
|
return this;
|
|
355
336
|
}
|
|
356
337
|
};
|
|
357
|
-
module.exports = SemVer
|
|
358
|
-
})
|
|
338
|
+
module.exports = SemVer;
|
|
339
|
+
}));
|
|
359
340
|
|
|
360
341
|
//#endregion
|
|
361
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
362
|
-
var require_parse = /* @__PURE__ */
|
|
363
|
-
const SemVer
|
|
364
|
-
const parse
|
|
365
|
-
if (version instanceof SemVer
|
|
342
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
|
|
343
|
+
var require_parse = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
344
|
+
const SemVer = require_semver$1();
|
|
345
|
+
const parse = (version, options, throwErrors = false) => {
|
|
346
|
+
if (version instanceof SemVer) return version;
|
|
366
347
|
try {
|
|
367
|
-
return new SemVer
|
|
348
|
+
return new SemVer(version, options);
|
|
368
349
|
} catch (er) {
|
|
369
350
|
if (!throwErrors) return null;
|
|
370
351
|
throw er;
|
|
371
352
|
}
|
|
372
353
|
};
|
|
373
|
-
module.exports = parse
|
|
374
|
-
})
|
|
354
|
+
module.exports = parse;
|
|
355
|
+
}));
|
|
375
356
|
|
|
376
357
|
//#endregion
|
|
377
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
378
|
-
var require_valid$1 = /* @__PURE__ */
|
|
379
|
-
const parse
|
|
380
|
-
const valid
|
|
381
|
-
const v = parse
|
|
358
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
|
|
359
|
+
var require_valid$1 = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
360
|
+
const parse = require_parse();
|
|
361
|
+
const valid = (version, options) => {
|
|
362
|
+
const v = parse(version, options);
|
|
382
363
|
return v ? v.version : null;
|
|
383
364
|
};
|
|
384
|
-
module.exports = valid
|
|
385
|
-
})
|
|
365
|
+
module.exports = valid;
|
|
366
|
+
}));
|
|
386
367
|
|
|
387
368
|
//#endregion
|
|
388
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
389
|
-
var require_clean = /* @__PURE__ */
|
|
390
|
-
const parse
|
|
391
|
-
const clean
|
|
392
|
-
const s = parse
|
|
369
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
|
|
370
|
+
var require_clean = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
371
|
+
const parse = require_parse();
|
|
372
|
+
const clean = (version, options) => {
|
|
373
|
+
const s = parse(version.trim().replace(/^[=v]+/, ""), options);
|
|
393
374
|
return s ? s.version : null;
|
|
394
375
|
};
|
|
395
|
-
module.exports = clean
|
|
396
|
-
})
|
|
376
|
+
module.exports = clean;
|
|
377
|
+
}));
|
|
397
378
|
|
|
398
379
|
//#endregion
|
|
399
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
400
|
-
var require_inc = /* @__PURE__ */
|
|
401
|
-
const SemVer
|
|
402
|
-
const inc
|
|
380
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
|
|
381
|
+
var require_inc = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
382
|
+
const SemVer = require_semver$1();
|
|
383
|
+
const inc = (version, release, options, identifier, identifierBase) => {
|
|
403
384
|
if (typeof options === "string") {
|
|
404
385
|
identifierBase = identifier;
|
|
405
386
|
identifier = options;
|
|
406
387
|
options = void 0;
|
|
407
388
|
}
|
|
408
389
|
try {
|
|
409
|
-
return new SemVer
|
|
390
|
+
return new SemVer(version instanceof SemVer ? version.version : version, options).inc(release, identifier, identifierBase).version;
|
|
410
391
|
} catch (er) {
|
|
411
392
|
return null;
|
|
412
393
|
}
|
|
413
394
|
};
|
|
414
|
-
module.exports = inc
|
|
415
|
-
})
|
|
395
|
+
module.exports = inc;
|
|
396
|
+
}));
|
|
416
397
|
|
|
417
398
|
//#endregion
|
|
418
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
419
|
-
var require_diff = /* @__PURE__ */
|
|
420
|
-
const parse
|
|
421
|
-
const diff
|
|
422
|
-
const v1 = parse
|
|
423
|
-
const v2 = parse
|
|
399
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
|
|
400
|
+
var require_diff = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
401
|
+
const parse = require_parse();
|
|
402
|
+
const diff = (version1, version2) => {
|
|
403
|
+
const v1 = parse(version1, null, true);
|
|
404
|
+
const v2 = parse(version2, null, true);
|
|
424
405
|
const comparison = v1.compare(v2);
|
|
425
406
|
if (comparison === 0) return null;
|
|
426
407
|
const v1Higher = comparison > 0;
|
|
@@ -440,154 +421,154 @@ var require_diff = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.2
|
|
|
440
421
|
if (v1.patch !== v2.patch) return prefix + "patch";
|
|
441
422
|
return "prerelease";
|
|
442
423
|
};
|
|
443
|
-
module.exports = diff
|
|
444
|
-
})
|
|
424
|
+
module.exports = diff;
|
|
425
|
+
}));
|
|
445
426
|
|
|
446
427
|
//#endregion
|
|
447
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
448
|
-
var require_major = /* @__PURE__ */
|
|
449
|
-
const SemVer
|
|
450
|
-
const major
|
|
451
|
-
module.exports = major
|
|
452
|
-
})
|
|
428
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
|
|
429
|
+
var require_major = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
430
|
+
const SemVer = require_semver$1();
|
|
431
|
+
const major = (a, loose) => new SemVer(a, loose).major;
|
|
432
|
+
module.exports = major;
|
|
433
|
+
}));
|
|
453
434
|
|
|
454
435
|
//#endregion
|
|
455
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
456
|
-
var require_minor = /* @__PURE__ */
|
|
457
|
-
const SemVer
|
|
458
|
-
const minor
|
|
459
|
-
module.exports = minor
|
|
460
|
-
})
|
|
436
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
|
|
437
|
+
var require_minor = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
438
|
+
const SemVer = require_semver$1();
|
|
439
|
+
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
440
|
+
module.exports = minor;
|
|
441
|
+
}));
|
|
461
442
|
|
|
462
443
|
//#endregion
|
|
463
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
464
|
-
var require_patch = /* @__PURE__ */
|
|
465
|
-
const SemVer
|
|
466
|
-
const patch
|
|
467
|
-
module.exports = patch
|
|
468
|
-
})
|
|
444
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
|
|
445
|
+
var require_patch = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
446
|
+
const SemVer = require_semver$1();
|
|
447
|
+
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
448
|
+
module.exports = patch;
|
|
449
|
+
}));
|
|
469
450
|
|
|
470
451
|
//#endregion
|
|
471
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
472
|
-
var require_prerelease = /* @__PURE__ */
|
|
473
|
-
const parse
|
|
474
|
-
const prerelease
|
|
475
|
-
const parsed = parse
|
|
452
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
|
|
453
|
+
var require_prerelease = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
454
|
+
const parse = require_parse();
|
|
455
|
+
const prerelease = (version, options) => {
|
|
456
|
+
const parsed = parse(version, options);
|
|
476
457
|
return parsed && parsed.prerelease.length ? parsed.prerelease : null;
|
|
477
458
|
};
|
|
478
|
-
module.exports = prerelease
|
|
479
|
-
})
|
|
459
|
+
module.exports = prerelease;
|
|
460
|
+
}));
|
|
480
461
|
|
|
481
462
|
//#endregion
|
|
482
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
483
|
-
var require_compare = /* @__PURE__ */
|
|
484
|
-
const SemVer
|
|
485
|
-
const compare
|
|
486
|
-
module.exports = compare
|
|
487
|
-
})
|
|
463
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
|
|
464
|
+
var require_compare = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
465
|
+
const SemVer = require_semver$1();
|
|
466
|
+
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
467
|
+
module.exports = compare;
|
|
468
|
+
}));
|
|
488
469
|
|
|
489
470
|
//#endregion
|
|
490
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
491
|
-
var require_rcompare = /* @__PURE__ */
|
|
492
|
-
const compare
|
|
493
|
-
const rcompare
|
|
494
|
-
module.exports = rcompare
|
|
495
|
-
})
|
|
471
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
|
|
472
|
+
var require_rcompare = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
473
|
+
const compare = require_compare();
|
|
474
|
+
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
475
|
+
module.exports = rcompare;
|
|
476
|
+
}));
|
|
496
477
|
|
|
497
478
|
//#endregion
|
|
498
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
499
|
-
var require_compare_loose = /* @__PURE__ */
|
|
500
|
-
const compare
|
|
501
|
-
const compareLoose
|
|
502
|
-
module.exports = compareLoose
|
|
503
|
-
})
|
|
479
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
|
|
480
|
+
var require_compare_loose = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
481
|
+
const compare = require_compare();
|
|
482
|
+
const compareLoose = (a, b) => compare(a, b, true);
|
|
483
|
+
module.exports = compareLoose;
|
|
484
|
+
}));
|
|
504
485
|
|
|
505
486
|
//#endregion
|
|
506
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
507
|
-
var require_compare_build = /* @__PURE__ */
|
|
508
|
-
const SemVer
|
|
509
|
-
const compareBuild
|
|
510
|
-
const versionA = new SemVer
|
|
511
|
-
const versionB = new SemVer
|
|
487
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
|
|
488
|
+
var require_compare_build = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
489
|
+
const SemVer = require_semver$1();
|
|
490
|
+
const compareBuild = (a, b, loose) => {
|
|
491
|
+
const versionA = new SemVer(a, loose);
|
|
492
|
+
const versionB = new SemVer(b, loose);
|
|
512
493
|
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
513
494
|
};
|
|
514
|
-
module.exports = compareBuild
|
|
515
|
-
})
|
|
495
|
+
module.exports = compareBuild;
|
|
496
|
+
}));
|
|
516
497
|
|
|
517
498
|
//#endregion
|
|
518
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
519
|
-
var require_sort = /* @__PURE__ */
|
|
520
|
-
const compareBuild
|
|
521
|
-
const sort
|
|
522
|
-
module.exports = sort
|
|
523
|
-
})
|
|
499
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
|
|
500
|
+
var require_sort = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
501
|
+
const compareBuild = require_compare_build();
|
|
502
|
+
const sort = (list$1, loose) => list$1.sort((a, b) => compareBuild(a, b, loose));
|
|
503
|
+
module.exports = sort;
|
|
504
|
+
}));
|
|
524
505
|
|
|
525
506
|
//#endregion
|
|
526
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
527
|
-
var require_rsort = /* @__PURE__ */
|
|
528
|
-
const compareBuild
|
|
529
|
-
const rsort
|
|
530
|
-
module.exports = rsort
|
|
531
|
-
})
|
|
507
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
|
|
508
|
+
var require_rsort = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
509
|
+
const compareBuild = require_compare_build();
|
|
510
|
+
const rsort = (list$1, loose) => list$1.sort((a, b) => compareBuild(b, a, loose));
|
|
511
|
+
module.exports = rsort;
|
|
512
|
+
}));
|
|
532
513
|
|
|
533
514
|
//#endregion
|
|
534
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
535
|
-
var require_gt = /* @__PURE__ */
|
|
536
|
-
const compare
|
|
537
|
-
const gt
|
|
538
|
-
module.exports = gt
|
|
539
|
-
})
|
|
515
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
|
|
516
|
+
var require_gt = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
517
|
+
const compare = require_compare();
|
|
518
|
+
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
519
|
+
module.exports = gt;
|
|
520
|
+
}));
|
|
540
521
|
|
|
541
522
|
//#endregion
|
|
542
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
543
|
-
var require_lt = /* @__PURE__ */
|
|
544
|
-
const compare
|
|
545
|
-
const lt
|
|
546
|
-
module.exports = lt
|
|
547
|
-
})
|
|
523
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
|
|
524
|
+
var require_lt = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
525
|
+
const compare = require_compare();
|
|
526
|
+
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
527
|
+
module.exports = lt;
|
|
528
|
+
}));
|
|
548
529
|
|
|
549
530
|
//#endregion
|
|
550
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
551
|
-
var require_eq = /* @__PURE__ */
|
|
552
|
-
const compare
|
|
553
|
-
const eq
|
|
554
|
-
module.exports = eq
|
|
555
|
-
})
|
|
531
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
|
|
532
|
+
var require_eq = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
533
|
+
const compare = require_compare();
|
|
534
|
+
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
535
|
+
module.exports = eq;
|
|
536
|
+
}));
|
|
556
537
|
|
|
557
538
|
//#endregion
|
|
558
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
559
|
-
var require_neq = /* @__PURE__ */
|
|
560
|
-
const compare
|
|
561
|
-
const neq
|
|
562
|
-
module.exports = neq
|
|
563
|
-
})
|
|
539
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
|
|
540
|
+
var require_neq = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
541
|
+
const compare = require_compare();
|
|
542
|
+
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
543
|
+
module.exports = neq;
|
|
544
|
+
}));
|
|
564
545
|
|
|
565
546
|
//#endregion
|
|
566
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
567
|
-
var require_gte = /* @__PURE__ */
|
|
568
|
-
const compare
|
|
569
|
-
const gte
|
|
570
|
-
module.exports = gte
|
|
571
|
-
})
|
|
547
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
|
|
548
|
+
var require_gte = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
549
|
+
const compare = require_compare();
|
|
550
|
+
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
551
|
+
module.exports = gte;
|
|
552
|
+
}));
|
|
572
553
|
|
|
573
554
|
//#endregion
|
|
574
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
575
|
-
var require_lte = /* @__PURE__ */
|
|
576
|
-
const compare
|
|
577
|
-
const lte
|
|
578
|
-
module.exports = lte
|
|
579
|
-
})
|
|
555
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
|
|
556
|
+
var require_lte = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
557
|
+
const compare = require_compare();
|
|
558
|
+
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
559
|
+
module.exports = lte;
|
|
560
|
+
}));
|
|
580
561
|
|
|
581
562
|
//#endregion
|
|
582
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
583
|
-
var require_cmp = /* @__PURE__ */
|
|
584
|
-
const eq
|
|
585
|
-
const neq
|
|
586
|
-
const gt
|
|
587
|
-
const gte
|
|
588
|
-
const lt
|
|
589
|
-
const lte
|
|
590
|
-
const cmp
|
|
563
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
|
|
564
|
+
var require_cmp = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
565
|
+
const eq = require_eq();
|
|
566
|
+
const neq = require_neq();
|
|
567
|
+
const gt = require_gt();
|
|
568
|
+
const gte = require_gte();
|
|
569
|
+
const lt = require_lt();
|
|
570
|
+
const lte = require_lte();
|
|
571
|
+
const cmp = (a, op, b, loose) => {
|
|
591
572
|
switch (op) {
|
|
592
573
|
case "===":
|
|
593
574
|
if (typeof a === "object") a = a.version;
|
|
@@ -599,33 +580,33 @@ var require_cmp = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.2/
|
|
|
599
580
|
return a !== b;
|
|
600
581
|
case "":
|
|
601
582
|
case "=":
|
|
602
|
-
case "==": return eq
|
|
603
|
-
case "!=": return neq
|
|
604
|
-
case ">": return gt
|
|
605
|
-
case ">=": return gte
|
|
606
|
-
case "<": return lt
|
|
607
|
-
case "<=": return lte
|
|
583
|
+
case "==": return eq(a, b, loose);
|
|
584
|
+
case "!=": return neq(a, b, loose);
|
|
585
|
+
case ">": return gt(a, b, loose);
|
|
586
|
+
case ">=": return gte(a, b, loose);
|
|
587
|
+
case "<": return lt(a, b, loose);
|
|
588
|
+
case "<=": return lte(a, b, loose);
|
|
608
589
|
default: throw new TypeError(`Invalid operator: ${op}`);
|
|
609
590
|
}
|
|
610
591
|
};
|
|
611
|
-
module.exports = cmp
|
|
612
|
-
})
|
|
592
|
+
module.exports = cmp;
|
|
593
|
+
}));
|
|
613
594
|
|
|
614
595
|
//#endregion
|
|
615
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
616
|
-
var require_coerce = /* @__PURE__ */
|
|
617
|
-
const SemVer
|
|
618
|
-
const parse
|
|
619
|
-
const { safeRe: re
|
|
620
|
-
const coerce
|
|
621
|
-
if (version instanceof SemVer
|
|
596
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
|
|
597
|
+
var require_coerce = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
598
|
+
const SemVer = require_semver$1();
|
|
599
|
+
const parse = require_parse();
|
|
600
|
+
const { safeRe: re, t } = require_re();
|
|
601
|
+
const coerce = (version, options) => {
|
|
602
|
+
if (version instanceof SemVer) return version;
|
|
622
603
|
if (typeof version === "number") version = String(version);
|
|
623
604
|
if (typeof version !== "string") return null;
|
|
624
605
|
options = options || {};
|
|
625
606
|
let match = null;
|
|
626
|
-
if (!options.rtl) match = version.match(options.includePrerelease ? re
|
|
607
|
+
if (!options.rtl) match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]);
|
|
627
608
|
else {
|
|
628
|
-
const coerceRtlRegex = options.includePrerelease ? re
|
|
609
|
+
const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL];
|
|
629
610
|
let next;
|
|
630
611
|
while ((next = coerceRtlRegex.exec(version)) && (!match || match.index + match[0].length !== version.length)) {
|
|
631
612
|
if (!match || next.index + next[0].length !== match.index + match[0].length) match = next;
|
|
@@ -634,19 +615,15 @@ var require_coerce = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7
|
|
|
634
615
|
coerceRtlRegex.lastIndex = -1;
|
|
635
616
|
}
|
|
636
617
|
if (match === null) return null;
|
|
637
|
-
const major
|
|
638
|
-
|
|
639
|
-
const patch$2 = match[4] || "0";
|
|
640
|
-
const prerelease$2 = options.includePrerelease && match[5] ? `-${match[5]}` : "";
|
|
641
|
-
const build = options.includePrerelease && match[6] ? `+${match[6]}` : "";
|
|
642
|
-
return parse$1(`${major$2}.${minor$2}.${patch$2}${prerelease$2}${build}`, options);
|
|
618
|
+
const major = match[2];
|
|
619
|
+
return parse(`${major}.${match[3] || "0"}.${match[4] || "0"}${options.includePrerelease && match[5] ? `-${match[5]}` : ""}${options.includePrerelease && match[6] ? `+${match[6]}` : ""}`, options);
|
|
643
620
|
};
|
|
644
|
-
module.exports = coerce
|
|
645
|
-
})
|
|
621
|
+
module.exports = coerce;
|
|
622
|
+
}));
|
|
646
623
|
|
|
647
624
|
//#endregion
|
|
648
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
649
|
-
var require_lrucache = /* @__PURE__ */
|
|
625
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
|
|
626
|
+
var require_lrucache = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
650
627
|
var LRUCache = class {
|
|
651
628
|
constructor() {
|
|
652
629
|
this.max = 1e3;
|
|
@@ -676,18 +653,18 @@ var require_lrucache = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
676
653
|
}
|
|
677
654
|
};
|
|
678
655
|
module.exports = LRUCache;
|
|
679
|
-
})
|
|
656
|
+
}));
|
|
680
657
|
|
|
681
658
|
//#endregion
|
|
682
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
683
|
-
var require_range = /* @__PURE__ */
|
|
659
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
|
|
660
|
+
var require_range = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
684
661
|
const SPACE_CHARACTERS = /\s+/g;
|
|
685
|
-
var Range
|
|
662
|
+
var Range = class Range {
|
|
686
663
|
constructor(range, options) {
|
|
687
|
-
options = parseOptions
|
|
688
|
-
if (range instanceof Range
|
|
689
|
-
else return new Range
|
|
690
|
-
if (range instanceof Comparator
|
|
664
|
+
options = parseOptions(options);
|
|
665
|
+
if (range instanceof Range) if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) return range;
|
|
666
|
+
else return new Range(range.raw, options);
|
|
667
|
+
if (range instanceof Comparator) {
|
|
691
668
|
this.raw = range.value;
|
|
692
669
|
this.set = [[range]];
|
|
693
670
|
this.formatted = void 0;
|
|
@@ -737,23 +714,23 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
737
714
|
const cached = cache.get(memoKey);
|
|
738
715
|
if (cached) return cached;
|
|
739
716
|
const loose = this.options.loose;
|
|
740
|
-
const hr = loose ? re
|
|
717
|
+
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
741
718
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
742
|
-
debug
|
|
743
|
-
range = range.replace(re
|
|
744
|
-
debug
|
|
745
|
-
range = range.replace(re
|
|
746
|
-
debug
|
|
747
|
-
range = range.replace(re
|
|
748
|
-
debug
|
|
719
|
+
debug("hyphen replace", range);
|
|
720
|
+
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
721
|
+
debug("comparator trim", range);
|
|
722
|
+
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
723
|
+
debug("tilde trim", range);
|
|
724
|
+
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
725
|
+
debug("caret trim", range);
|
|
749
726
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
750
727
|
if (loose) rangeList = rangeList.filter((comp) => {
|
|
751
|
-
debug
|
|
752
|
-
return !!comp.match(re
|
|
728
|
+
debug("loose invalid filter", comp, this.options);
|
|
729
|
+
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
753
730
|
});
|
|
754
|
-
debug
|
|
731
|
+
debug("range list", rangeList);
|
|
755
732
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
756
|
-
const comparators = rangeList.map((comp) => new Comparator
|
|
733
|
+
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
757
734
|
for (const comp of comparators) {
|
|
758
735
|
if (isNullSet(comp)) return [comp];
|
|
759
736
|
rangeMap.set(comp.value, comp);
|
|
@@ -764,7 +741,7 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
764
741
|
return result;
|
|
765
742
|
}
|
|
766
743
|
intersects(range, options) {
|
|
767
|
-
if (!(range instanceof Range
|
|
744
|
+
if (!(range instanceof Range)) throw new TypeError("a Range is required");
|
|
768
745
|
return this.set.some((thisComparators) => {
|
|
769
746
|
return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
|
|
770
747
|
return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
|
|
@@ -778,7 +755,7 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
778
755
|
test(version) {
|
|
779
756
|
if (!version) return false;
|
|
780
757
|
if (typeof version === "string") try {
|
|
781
|
-
version = new SemVer
|
|
758
|
+
version = new SemVer(version, this.options);
|
|
782
759
|
} catch (er) {
|
|
783
760
|
return false;
|
|
784
761
|
}
|
|
@@ -786,13 +763,13 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
786
763
|
return false;
|
|
787
764
|
}
|
|
788
765
|
};
|
|
789
|
-
module.exports = Range
|
|
766
|
+
module.exports = Range;
|
|
790
767
|
const cache = new (require_lrucache())();
|
|
791
|
-
const parseOptions
|
|
792
|
-
const Comparator
|
|
793
|
-
const debug
|
|
794
|
-
const SemVer
|
|
795
|
-
const { safeRe: re
|
|
768
|
+
const parseOptions = require_parse_options();
|
|
769
|
+
const Comparator = require_comparator();
|
|
770
|
+
const debug = require_debug();
|
|
771
|
+
const SemVer = require_semver$1();
|
|
772
|
+
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
796
773
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
797
774
|
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
798
775
|
const isAny = (c) => c.value === "";
|
|
@@ -809,15 +786,16 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
809
786
|
return result;
|
|
810
787
|
};
|
|
811
788
|
const parseComparator = (comp, options) => {
|
|
812
|
-
|
|
789
|
+
comp = comp.replace(re[t.BUILD], "");
|
|
790
|
+
debug("comp", comp, options);
|
|
813
791
|
comp = replaceCarets(comp, options);
|
|
814
|
-
debug
|
|
792
|
+
debug("caret", comp);
|
|
815
793
|
comp = replaceTildes(comp, options);
|
|
816
|
-
debug
|
|
794
|
+
debug("tildes", comp);
|
|
817
795
|
comp = replaceXRanges(comp, options);
|
|
818
|
-
debug
|
|
796
|
+
debug("xrange", comp);
|
|
819
797
|
comp = replaceStars(comp, options);
|
|
820
|
-
debug
|
|
798
|
+
debug("stars", comp);
|
|
821
799
|
return comp;
|
|
822
800
|
};
|
|
823
801
|
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
@@ -825,18 +803,18 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
825
803
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
826
804
|
};
|
|
827
805
|
const replaceTilde = (comp, options) => {
|
|
828
|
-
const r = options.loose ? re
|
|
806
|
+
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
829
807
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
830
|
-
debug
|
|
808
|
+
debug("tilde", comp, _, M, m, p, pr);
|
|
831
809
|
let ret;
|
|
832
810
|
if (isX(M)) ret = "";
|
|
833
811
|
else if (isX(m)) ret = `>=${M}.0.0 <${+M + 1}.0.0-0`;
|
|
834
812
|
else if (isX(p)) ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
835
813
|
else if (pr) {
|
|
836
|
-
debug
|
|
814
|
+
debug("replaceTilde pr", pr);
|
|
837
815
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
838
816
|
} else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
839
|
-
debug
|
|
817
|
+
debug("tilde return", ret);
|
|
840
818
|
return ret;
|
|
841
819
|
});
|
|
842
820
|
};
|
|
@@ -844,40 +822,40 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
844
822
|
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
845
823
|
};
|
|
846
824
|
const replaceCaret = (comp, options) => {
|
|
847
|
-
debug
|
|
848
|
-
const r = options.loose ? re
|
|
825
|
+
debug("caret", comp, options);
|
|
826
|
+
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
849
827
|
const z = options.includePrerelease ? "-0" : "";
|
|
850
828
|
return comp.replace(r, (_, M, m, p, pr) => {
|
|
851
|
-
debug
|
|
829
|
+
debug("caret", comp, _, M, m, p, pr);
|
|
852
830
|
let ret;
|
|
853
831
|
if (isX(M)) ret = "";
|
|
854
832
|
else if (isX(m)) ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`;
|
|
855
833
|
else if (isX(p)) if (M === "0") ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`;
|
|
856
834
|
else ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
857
835
|
else if (pr) {
|
|
858
|
-
debug
|
|
836
|
+
debug("replaceCaret pr", pr);
|
|
859
837
|
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
860
838
|
else ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
861
839
|
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
862
840
|
} else {
|
|
863
|
-
debug
|
|
841
|
+
debug("no pr");
|
|
864
842
|
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
865
843
|
else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
|
|
866
844
|
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
867
845
|
}
|
|
868
|
-
debug
|
|
846
|
+
debug("caret return", ret);
|
|
869
847
|
return ret;
|
|
870
848
|
});
|
|
871
849
|
};
|
|
872
850
|
const replaceXRanges = (comp, options) => {
|
|
873
|
-
debug
|
|
851
|
+
debug("replaceXRanges", comp, options);
|
|
874
852
|
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
875
853
|
};
|
|
876
854
|
const replaceXRange = (comp, options) => {
|
|
877
855
|
comp = comp.trim();
|
|
878
|
-
const r = options.loose ? re
|
|
856
|
+
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
879
857
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
880
|
-
debug
|
|
858
|
+
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
881
859
|
const xM = isX(M);
|
|
882
860
|
const xm = xM || isX(m);
|
|
883
861
|
const xp = xm || isX(p);
|
|
@@ -908,17 +886,17 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
908
886
|
ret = `${gtlt + M}.${m}.${p}${pr}`;
|
|
909
887
|
} else if (xm) ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`;
|
|
910
888
|
else if (xp) ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
911
|
-
debug
|
|
889
|
+
debug("xRange return", ret);
|
|
912
890
|
return ret;
|
|
913
891
|
});
|
|
914
892
|
};
|
|
915
893
|
const replaceStars = (comp, options) => {
|
|
916
|
-
debug
|
|
917
|
-
return comp.trim().replace(re
|
|
894
|
+
debug("replaceStars", comp, options);
|
|
895
|
+
return comp.trim().replace(re[t.STAR], "");
|
|
918
896
|
};
|
|
919
897
|
const replaceGTE0 = (comp, options) => {
|
|
920
|
-
debug
|
|
921
|
-
return comp.trim().replace(re
|
|
898
|
+
debug("replaceGTE0", comp, options);
|
|
899
|
+
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
922
900
|
};
|
|
923
901
|
const hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
924
902
|
if (isX(fM)) from = "";
|
|
@@ -938,8 +916,8 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
938
916
|
for (let i = 0; i < set.length; i++) if (!set[i].test(version)) return false;
|
|
939
917
|
if (version.prerelease.length && !options.includePrerelease) {
|
|
940
918
|
for (let i = 0; i < set.length; i++) {
|
|
941
|
-
debug
|
|
942
|
-
if (set[i].semver === Comparator
|
|
919
|
+
debug(set[i].semver);
|
|
920
|
+
if (set[i].semver === Comparator.ANY) continue;
|
|
943
921
|
if (set[i].semver.prerelease.length > 0) {
|
|
944
922
|
const allowed = set[i].semver;
|
|
945
923
|
if (allowed.major === version.major && allowed.minor === version.minor && allowed.patch === version.patch) return true;
|
|
@@ -949,26 +927,26 @@ var require_range = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7.
|
|
|
949
927
|
}
|
|
950
928
|
return true;
|
|
951
929
|
};
|
|
952
|
-
})
|
|
930
|
+
}));
|
|
953
931
|
|
|
954
932
|
//#endregion
|
|
955
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
956
|
-
var require_comparator = /* @__PURE__ */
|
|
957
|
-
const ANY
|
|
958
|
-
var Comparator
|
|
933
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
|
|
934
|
+
var require_comparator = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
935
|
+
const ANY = Symbol("SemVer ANY");
|
|
936
|
+
var Comparator = class Comparator {
|
|
959
937
|
static get ANY() {
|
|
960
|
-
return ANY
|
|
938
|
+
return ANY;
|
|
961
939
|
}
|
|
962
940
|
constructor(comp, options) {
|
|
963
941
|
options = parseOptions(options);
|
|
964
|
-
if (comp instanceof Comparator
|
|
942
|
+
if (comp instanceof Comparator) if (comp.loose === !!options.loose) return comp;
|
|
965
943
|
else comp = comp.value;
|
|
966
944
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
967
945
|
debug("comparator", comp, options);
|
|
968
946
|
this.options = options;
|
|
969
947
|
this.loose = !!options.loose;
|
|
970
948
|
this.parse(comp);
|
|
971
|
-
if (this.semver === ANY
|
|
949
|
+
if (this.semver === ANY) this.value = "";
|
|
972
950
|
else this.value = this.operator + this.semver.version;
|
|
973
951
|
debug("comp", this);
|
|
974
952
|
}
|
|
@@ -978,30 +956,30 @@ var require_comparator = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver
|
|
|
978
956
|
if (!m) throw new TypeError(`Invalid comparator: ${comp}`);
|
|
979
957
|
this.operator = m[1] !== void 0 ? m[1] : "";
|
|
980
958
|
if (this.operator === "=") this.operator = "";
|
|
981
|
-
if (!m[2]) this.semver = ANY
|
|
982
|
-
else this.semver = new SemVer
|
|
959
|
+
if (!m[2]) this.semver = ANY;
|
|
960
|
+
else this.semver = new SemVer(m[2], this.options.loose);
|
|
983
961
|
}
|
|
984
962
|
toString() {
|
|
985
963
|
return this.value;
|
|
986
964
|
}
|
|
987
965
|
test(version) {
|
|
988
966
|
debug("Comparator.test", version, this.options.loose);
|
|
989
|
-
if (this.semver === ANY
|
|
967
|
+
if (this.semver === ANY || version === ANY) return true;
|
|
990
968
|
if (typeof version === "string") try {
|
|
991
|
-
version = new SemVer
|
|
969
|
+
version = new SemVer(version, this.options);
|
|
992
970
|
} catch (er) {
|
|
993
971
|
return false;
|
|
994
972
|
}
|
|
995
|
-
return cmp
|
|
973
|
+
return cmp(version, this.operator, this.semver, this.options);
|
|
996
974
|
}
|
|
997
975
|
intersects(comp, options) {
|
|
998
|
-
if (!(comp instanceof Comparator
|
|
976
|
+
if (!(comp instanceof Comparator)) throw new TypeError("a Comparator is required");
|
|
999
977
|
if (this.operator === "") {
|
|
1000
978
|
if (this.value === "") return true;
|
|
1001
|
-
return new Range
|
|
979
|
+
return new Range(comp.value, options).test(this.value);
|
|
1002
980
|
} else if (comp.operator === "") {
|
|
1003
981
|
if (comp.value === "") return true;
|
|
1004
|
-
return new Range
|
|
982
|
+
return new Range(this.value, options).test(comp.semver);
|
|
1005
983
|
}
|
|
1006
984
|
options = parseOptions(options);
|
|
1007
985
|
if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) return false;
|
|
@@ -1009,54 +987,54 @@ var require_comparator = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver
|
|
|
1009
987
|
if (this.operator.startsWith(">") && comp.operator.startsWith(">")) return true;
|
|
1010
988
|
if (this.operator.startsWith("<") && comp.operator.startsWith("<")) return true;
|
|
1011
989
|
if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) return true;
|
|
1012
|
-
if (cmp
|
|
1013
|
-
if (cmp
|
|
990
|
+
if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) return true;
|
|
991
|
+
if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) return true;
|
|
1014
992
|
return false;
|
|
1015
993
|
}
|
|
1016
994
|
};
|
|
1017
|
-
module.exports = Comparator
|
|
995
|
+
module.exports = Comparator;
|
|
1018
996
|
const parseOptions = require_parse_options();
|
|
1019
997
|
const { safeRe: re, t } = require_re();
|
|
1020
|
-
const cmp
|
|
998
|
+
const cmp = require_cmp();
|
|
1021
999
|
const debug = require_debug();
|
|
1022
|
-
const SemVer
|
|
1023
|
-
const Range
|
|
1024
|
-
})
|
|
1000
|
+
const SemVer = require_semver$1();
|
|
1001
|
+
const Range = require_range();
|
|
1002
|
+
}));
|
|
1025
1003
|
|
|
1026
1004
|
//#endregion
|
|
1027
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1028
|
-
var require_satisfies = /* @__PURE__ */
|
|
1029
|
-
const Range
|
|
1030
|
-
const satisfies
|
|
1005
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
|
|
1006
|
+
var require_satisfies = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1007
|
+
const Range = require_range();
|
|
1008
|
+
const satisfies = (version, range, options) => {
|
|
1031
1009
|
try {
|
|
1032
|
-
range = new Range
|
|
1010
|
+
range = new Range(range, options);
|
|
1033
1011
|
} catch (er) {
|
|
1034
1012
|
return false;
|
|
1035
1013
|
}
|
|
1036
1014
|
return range.test(version);
|
|
1037
1015
|
};
|
|
1038
|
-
module.exports = satisfies
|
|
1039
|
-
})
|
|
1016
|
+
module.exports = satisfies;
|
|
1017
|
+
}));
|
|
1040
1018
|
|
|
1041
1019
|
//#endregion
|
|
1042
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1043
|
-
var require_to_comparators = /* @__PURE__ */
|
|
1044
|
-
const Range
|
|
1045
|
-
const toComparators
|
|
1046
|
-
module.exports = toComparators
|
|
1047
|
-
})
|
|
1020
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
|
|
1021
|
+
var require_to_comparators = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1022
|
+
const Range = require_range();
|
|
1023
|
+
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
1024
|
+
module.exports = toComparators;
|
|
1025
|
+
}));
|
|
1048
1026
|
|
|
1049
1027
|
//#endregion
|
|
1050
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1051
|
-
var require_max_satisfying = /* @__PURE__ */
|
|
1052
|
-
const SemVer
|
|
1053
|
-
const Range
|
|
1054
|
-
const maxSatisfying
|
|
1028
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
|
|
1029
|
+
var require_max_satisfying = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1030
|
+
const SemVer = require_semver$1();
|
|
1031
|
+
const Range = require_range();
|
|
1032
|
+
const maxSatisfying = (versions, range, options) => {
|
|
1055
1033
|
let max = null;
|
|
1056
1034
|
let maxSV = null;
|
|
1057
1035
|
let rangeObj = null;
|
|
1058
1036
|
try {
|
|
1059
|
-
rangeObj = new Range
|
|
1037
|
+
rangeObj = new Range(range, options);
|
|
1060
1038
|
} catch (er) {
|
|
1061
1039
|
return null;
|
|
1062
1040
|
}
|
|
@@ -1064,26 +1042,26 @@ var require_max_satisfying = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/se
|
|
|
1064
1042
|
if (rangeObj.test(v)) {
|
|
1065
1043
|
if (!max || maxSV.compare(v) === -1) {
|
|
1066
1044
|
max = v;
|
|
1067
|
-
maxSV = new SemVer
|
|
1045
|
+
maxSV = new SemVer(max, options);
|
|
1068
1046
|
}
|
|
1069
1047
|
}
|
|
1070
1048
|
});
|
|
1071
1049
|
return max;
|
|
1072
1050
|
};
|
|
1073
|
-
module.exports = maxSatisfying
|
|
1074
|
-
})
|
|
1051
|
+
module.exports = maxSatisfying;
|
|
1052
|
+
}));
|
|
1075
1053
|
|
|
1076
1054
|
//#endregion
|
|
1077
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1078
|
-
var require_min_satisfying = /* @__PURE__ */
|
|
1079
|
-
const SemVer
|
|
1080
|
-
const Range
|
|
1081
|
-
const minSatisfying
|
|
1055
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
|
|
1056
|
+
var require_min_satisfying = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1057
|
+
const SemVer = require_semver$1();
|
|
1058
|
+
const Range = require_range();
|
|
1059
|
+
const minSatisfying = (versions, range, options) => {
|
|
1082
1060
|
let min = null;
|
|
1083
1061
|
let minSV = null;
|
|
1084
1062
|
let rangeObj = null;
|
|
1085
1063
|
try {
|
|
1086
|
-
rangeObj = new Range
|
|
1064
|
+
rangeObj = new Range(range, options);
|
|
1087
1065
|
} catch (er) {
|
|
1088
1066
|
return null;
|
|
1089
1067
|
}
|
|
@@ -1091,33 +1069,33 @@ var require_min_satisfying = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/se
|
|
|
1091
1069
|
if (rangeObj.test(v)) {
|
|
1092
1070
|
if (!min || minSV.compare(v) === 1) {
|
|
1093
1071
|
min = v;
|
|
1094
|
-
minSV = new SemVer
|
|
1072
|
+
minSV = new SemVer(min, options);
|
|
1095
1073
|
}
|
|
1096
1074
|
}
|
|
1097
1075
|
});
|
|
1098
1076
|
return min;
|
|
1099
1077
|
};
|
|
1100
|
-
module.exports = minSatisfying
|
|
1101
|
-
})
|
|
1078
|
+
module.exports = minSatisfying;
|
|
1079
|
+
}));
|
|
1102
1080
|
|
|
1103
1081
|
//#endregion
|
|
1104
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1105
|
-
var require_min_version = /* @__PURE__ */
|
|
1106
|
-
const SemVer
|
|
1107
|
-
const Range
|
|
1108
|
-
const gt
|
|
1109
|
-
const minVersion
|
|
1110
|
-
range = new Range
|
|
1111
|
-
let minver = new SemVer
|
|
1082
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
|
|
1083
|
+
var require_min_version = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1084
|
+
const SemVer = require_semver$1();
|
|
1085
|
+
const Range = require_range();
|
|
1086
|
+
const gt = require_gt();
|
|
1087
|
+
const minVersion = (range, loose) => {
|
|
1088
|
+
range = new Range(range, loose);
|
|
1089
|
+
let minver = new SemVer("0.0.0");
|
|
1112
1090
|
if (range.test(minver)) return minver;
|
|
1113
|
-
minver = new SemVer
|
|
1091
|
+
minver = new SemVer("0.0.0-0");
|
|
1114
1092
|
if (range.test(minver)) return minver;
|
|
1115
1093
|
minver = null;
|
|
1116
1094
|
for (let i = 0; i < range.set.length; ++i) {
|
|
1117
1095
|
const comparators = range.set[i];
|
|
1118
1096
|
let setMin = null;
|
|
1119
1097
|
comparators.forEach((comparator) => {
|
|
1120
|
-
const compver = new SemVer
|
|
1098
|
+
const compver = new SemVer(comparator.semver.version);
|
|
1121
1099
|
switch (comparator.operator) {
|
|
1122
1100
|
case ">":
|
|
1123
1101
|
if (compver.prerelease.length === 0) compver.patch++;
|
|
@@ -1125,75 +1103,75 @@ var require_min_version = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semve
|
|
|
1125
1103
|
compver.raw = compver.format();
|
|
1126
1104
|
case "":
|
|
1127
1105
|
case ">=":
|
|
1128
|
-
if (!setMin || gt
|
|
1106
|
+
if (!setMin || gt(compver, setMin)) setMin = compver;
|
|
1129
1107
|
break;
|
|
1130
1108
|
case "<":
|
|
1131
1109
|
case "<=": break;
|
|
1132
1110
|
default: throw new Error(`Unexpected operation: ${comparator.operator}`);
|
|
1133
1111
|
}
|
|
1134
1112
|
});
|
|
1135
|
-
if (setMin && (!minver || gt
|
|
1113
|
+
if (setMin && (!minver || gt(minver, setMin))) minver = setMin;
|
|
1136
1114
|
}
|
|
1137
1115
|
if (minver && range.test(minver)) return minver;
|
|
1138
1116
|
return null;
|
|
1139
1117
|
};
|
|
1140
|
-
module.exports = minVersion
|
|
1141
|
-
})
|
|
1118
|
+
module.exports = minVersion;
|
|
1119
|
+
}));
|
|
1142
1120
|
|
|
1143
1121
|
//#endregion
|
|
1144
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1145
|
-
var require_valid = /* @__PURE__ */
|
|
1146
|
-
const Range
|
|
1147
|
-
const validRange
|
|
1122
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
|
|
1123
|
+
var require_valid = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1124
|
+
const Range = require_range();
|
|
1125
|
+
const validRange = (range, options) => {
|
|
1148
1126
|
try {
|
|
1149
|
-
return new Range
|
|
1127
|
+
return new Range(range, options).range || "*";
|
|
1150
1128
|
} catch (er) {
|
|
1151
1129
|
return null;
|
|
1152
1130
|
}
|
|
1153
1131
|
};
|
|
1154
|
-
module.exports = validRange
|
|
1155
|
-
})
|
|
1132
|
+
module.exports = validRange;
|
|
1133
|
+
}));
|
|
1156
1134
|
|
|
1157
1135
|
//#endregion
|
|
1158
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1159
|
-
var require_outside = /* @__PURE__ */
|
|
1160
|
-
const SemVer
|
|
1161
|
-
const Comparator
|
|
1162
|
-
const { ANY
|
|
1163
|
-
const Range
|
|
1164
|
-
const satisfies
|
|
1165
|
-
const gt
|
|
1166
|
-
const lt
|
|
1167
|
-
const lte
|
|
1168
|
-
const gte
|
|
1169
|
-
const outside
|
|
1170
|
-
version = new SemVer
|
|
1171
|
-
range = new Range
|
|
1136
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
|
|
1137
|
+
var require_outside = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1138
|
+
const SemVer = require_semver$1();
|
|
1139
|
+
const Comparator = require_comparator();
|
|
1140
|
+
const { ANY } = Comparator;
|
|
1141
|
+
const Range = require_range();
|
|
1142
|
+
const satisfies = require_satisfies();
|
|
1143
|
+
const gt = require_gt();
|
|
1144
|
+
const lt = require_lt();
|
|
1145
|
+
const lte = require_lte();
|
|
1146
|
+
const gte = require_gte();
|
|
1147
|
+
const outside = (version, range, hilo, options) => {
|
|
1148
|
+
version = new SemVer(version, options);
|
|
1149
|
+
range = new Range(range, options);
|
|
1172
1150
|
let gtfn, ltefn, ltfn, comp, ecomp;
|
|
1173
1151
|
switch (hilo) {
|
|
1174
1152
|
case ">":
|
|
1175
|
-
gtfn = gt
|
|
1176
|
-
ltefn = lte
|
|
1177
|
-
ltfn = lt
|
|
1153
|
+
gtfn = gt;
|
|
1154
|
+
ltefn = lte;
|
|
1155
|
+
ltfn = lt;
|
|
1178
1156
|
comp = ">";
|
|
1179
1157
|
ecomp = ">=";
|
|
1180
1158
|
break;
|
|
1181
1159
|
case "<":
|
|
1182
|
-
gtfn = lt
|
|
1183
|
-
ltefn = gte
|
|
1184
|
-
ltfn = gt
|
|
1160
|
+
gtfn = lt;
|
|
1161
|
+
ltefn = gte;
|
|
1162
|
+
ltfn = gt;
|
|
1185
1163
|
comp = "<";
|
|
1186
1164
|
ecomp = "<=";
|
|
1187
1165
|
break;
|
|
1188
1166
|
default: throw new TypeError("Must provide a hilo val of \"<\" or \">\"");
|
|
1189
1167
|
}
|
|
1190
|
-
if (satisfies
|
|
1168
|
+
if (satisfies(version, range, options)) return false;
|
|
1191
1169
|
for (let i = 0; i < range.set.length; ++i) {
|
|
1192
1170
|
const comparators = range.set[i];
|
|
1193
1171
|
let high = null;
|
|
1194
1172
|
let low = null;
|
|
1195
1173
|
comparators.forEach((comparator) => {
|
|
1196
|
-
if (comparator.semver === ANY
|
|
1174
|
+
if (comparator.semver === ANY) comparator = new Comparator(">=0.0.0");
|
|
1197
1175
|
high = high || comparator;
|
|
1198
1176
|
low = low || comparator;
|
|
1199
1177
|
if (gtfn(comparator.semver, high.semver, options)) high = comparator;
|
|
@@ -1205,48 +1183,48 @@ var require_outside = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.
|
|
|
1205
1183
|
}
|
|
1206
1184
|
return true;
|
|
1207
1185
|
};
|
|
1208
|
-
module.exports = outside
|
|
1209
|
-
})
|
|
1186
|
+
module.exports = outside;
|
|
1187
|
+
}));
|
|
1210
1188
|
|
|
1211
1189
|
//#endregion
|
|
1212
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1213
|
-
var require_gtr = /* @__PURE__ */
|
|
1214
|
-
const outside
|
|
1215
|
-
const gtr
|
|
1216
|
-
module.exports = gtr
|
|
1217
|
-
})
|
|
1190
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
|
|
1191
|
+
var require_gtr = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1192
|
+
const outside = require_outside();
|
|
1193
|
+
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
1194
|
+
module.exports = gtr;
|
|
1195
|
+
}));
|
|
1218
1196
|
|
|
1219
1197
|
//#endregion
|
|
1220
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1221
|
-
var require_ltr = /* @__PURE__ */
|
|
1222
|
-
const outside
|
|
1223
|
-
const ltr
|
|
1224
|
-
module.exports = ltr
|
|
1225
|
-
})
|
|
1198
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
|
|
1199
|
+
var require_ltr = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1200
|
+
const outside = require_outside();
|
|
1201
|
+
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
1202
|
+
module.exports = ltr;
|
|
1203
|
+
}));
|
|
1226
1204
|
|
|
1227
1205
|
//#endregion
|
|
1228
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1229
|
-
var require_intersects = /* @__PURE__ */
|
|
1230
|
-
const Range
|
|
1231
|
-
const intersects
|
|
1232
|
-
r1 = new Range
|
|
1233
|
-
r2 = new Range
|
|
1206
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
|
|
1207
|
+
var require_intersects = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1208
|
+
const Range = require_range();
|
|
1209
|
+
const intersects = (r1, r2, options) => {
|
|
1210
|
+
r1 = new Range(r1, options);
|
|
1211
|
+
r2 = new Range(r2, options);
|
|
1234
1212
|
return r1.intersects(r2, options);
|
|
1235
1213
|
};
|
|
1236
|
-
module.exports = intersects
|
|
1237
|
-
})
|
|
1214
|
+
module.exports = intersects;
|
|
1215
|
+
}));
|
|
1238
1216
|
|
|
1239
1217
|
//#endregion
|
|
1240
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1241
|
-
var require_simplify = /* @__PURE__ */
|
|
1242
|
-
const satisfies
|
|
1243
|
-
const compare
|
|
1218
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
|
|
1219
|
+
var require_simplify = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1220
|
+
const satisfies = require_satisfies();
|
|
1221
|
+
const compare = require_compare();
|
|
1244
1222
|
module.exports = (versions, range, options) => {
|
|
1245
1223
|
const set = [];
|
|
1246
1224
|
let first = null;
|
|
1247
1225
|
let prev = null;
|
|
1248
|
-
const v = versions.sort((a, b) => compare
|
|
1249
|
-
for (const version of v) if (satisfies
|
|
1226
|
+
const v = versions.sort((a, b) => compare(a, b, options));
|
|
1227
|
+
for (const version of v) if (satisfies(version, range, options)) {
|
|
1250
1228
|
prev = version;
|
|
1251
1229
|
if (!first) first = version;
|
|
1252
1230
|
} else {
|
|
@@ -1265,20 +1243,20 @@ var require_simplify = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7
|
|
|
1265
1243
|
const original = typeof range.raw === "string" ? range.raw : String(range);
|
|
1266
1244
|
return simplified.length < original.length ? simplified : range;
|
|
1267
1245
|
};
|
|
1268
|
-
})
|
|
1246
|
+
}));
|
|
1269
1247
|
|
|
1270
1248
|
//#endregion
|
|
1271
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1272
|
-
var require_subset = /* @__PURE__ */
|
|
1273
|
-
const Range
|
|
1274
|
-
const Comparator
|
|
1275
|
-
const { ANY } = Comparator
|
|
1276
|
-
const satisfies
|
|
1277
|
-
const compare
|
|
1278
|
-
const subset
|
|
1249
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
|
|
1250
|
+
var require_subset = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1251
|
+
const Range = require_range();
|
|
1252
|
+
const Comparator = require_comparator();
|
|
1253
|
+
const { ANY } = Comparator;
|
|
1254
|
+
const satisfies = require_satisfies();
|
|
1255
|
+
const compare = require_compare();
|
|
1256
|
+
const subset = (sub, dom, options = {}) => {
|
|
1279
1257
|
if (sub === dom) return true;
|
|
1280
|
-
sub = new Range
|
|
1281
|
-
dom = new Range
|
|
1258
|
+
sub = new Range(sub, options);
|
|
1259
|
+
dom = new Range(dom, options);
|
|
1282
1260
|
let sawNonNull = false;
|
|
1283
1261
|
OUTER: for (const simpleSub of sub.set) {
|
|
1284
1262
|
for (const simpleDom of dom.set) {
|
|
@@ -1290,8 +1268,8 @@ var require_subset = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7
|
|
|
1290
1268
|
}
|
|
1291
1269
|
return true;
|
|
1292
1270
|
};
|
|
1293
|
-
const minimumVersionWithPreRelease = [new Comparator
|
|
1294
|
-
const minimumVersion = [new Comparator
|
|
1271
|
+
const minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
|
|
1272
|
+
const minimumVersion = [new Comparator(">=0.0.0")];
|
|
1295
1273
|
const simpleSubset = (sub, dom, options) => {
|
|
1296
1274
|
if (sub === dom) return true;
|
|
1297
1275
|
if (sub.length === 1 && sub[0].semver === ANY) if (dom.length === 1 && dom[0].semver === ANY) return true;
|
|
@@ -1300,72 +1278,72 @@ var require_subset = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7
|
|
|
1300
1278
|
if (dom.length === 1 && dom[0].semver === ANY) if (options.includePrerelease) return true;
|
|
1301
1279
|
else dom = minimumVersion;
|
|
1302
1280
|
const eqSet = /* @__PURE__ */ new Set();
|
|
1303
|
-
let gt
|
|
1304
|
-
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt
|
|
1305
|
-
else if (c.operator === "<" || c.operator === "<=") lt
|
|
1281
|
+
let gt, lt;
|
|
1282
|
+
for (const c of sub) if (c.operator === ">" || c.operator === ">=") gt = higherGT(gt, c, options);
|
|
1283
|
+
else if (c.operator === "<" || c.operator === "<=") lt = lowerLT(lt, c, options);
|
|
1306
1284
|
else eqSet.add(c.semver);
|
|
1307
1285
|
if (eqSet.size > 1) return null;
|
|
1308
1286
|
let gtltComp;
|
|
1309
|
-
if (gt
|
|
1310
|
-
gtltComp = compare
|
|
1287
|
+
if (gt && lt) {
|
|
1288
|
+
gtltComp = compare(gt.semver, lt.semver, options);
|
|
1311
1289
|
if (gtltComp > 0) return null;
|
|
1312
|
-
else if (gtltComp === 0 && (gt
|
|
1290
|
+
else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) return null;
|
|
1313
1291
|
}
|
|
1314
|
-
for (const eq
|
|
1315
|
-
if (gt
|
|
1316
|
-
if (lt
|
|
1317
|
-
for (const c of dom) if (!satisfies
|
|
1292
|
+
for (const eq of eqSet) {
|
|
1293
|
+
if (gt && !satisfies(eq, String(gt), options)) return null;
|
|
1294
|
+
if (lt && !satisfies(eq, String(lt), options)) return null;
|
|
1295
|
+
for (const c of dom) if (!satisfies(eq, String(c), options)) return false;
|
|
1318
1296
|
return true;
|
|
1319
1297
|
}
|
|
1320
1298
|
let higher, lower;
|
|
1321
1299
|
let hasDomLT, hasDomGT;
|
|
1322
|
-
let needDomLTPre = lt
|
|
1323
|
-
let needDomGTPre = gt
|
|
1324
|
-
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt
|
|
1300
|
+
let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
|
|
1301
|
+
let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
|
|
1302
|
+
if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) needDomLTPre = false;
|
|
1325
1303
|
for (const c of dom) {
|
|
1326
1304
|
hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">=";
|
|
1327
1305
|
hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<=";
|
|
1328
|
-
if (gt
|
|
1306
|
+
if (gt) {
|
|
1329
1307
|
if (needDomGTPre) {
|
|
1330
1308
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) needDomGTPre = false;
|
|
1331
1309
|
}
|
|
1332
1310
|
if (c.operator === ">" || c.operator === ">=") {
|
|
1333
|
-
higher = higherGT(gt
|
|
1334
|
-
if (higher === c && higher !== gt
|
|
1335
|
-
} else if (gt
|
|
1311
|
+
higher = higherGT(gt, c, options);
|
|
1312
|
+
if (higher === c && higher !== gt) return false;
|
|
1313
|
+
} else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
|
|
1336
1314
|
}
|
|
1337
|
-
if (lt
|
|
1315
|
+
if (lt) {
|
|
1338
1316
|
if (needDomLTPre) {
|
|
1339
1317
|
if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomLTPre.major && c.semver.minor === needDomLTPre.minor && c.semver.patch === needDomLTPre.patch) needDomLTPre = false;
|
|
1340
1318
|
}
|
|
1341
1319
|
if (c.operator === "<" || c.operator === "<=") {
|
|
1342
|
-
lower = lowerLT(lt
|
|
1343
|
-
if (lower === c && lower !== lt
|
|
1344
|
-
} else if (lt
|
|
1320
|
+
lower = lowerLT(lt, c, options);
|
|
1321
|
+
if (lower === c && lower !== lt) return false;
|
|
1322
|
+
} else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
|
|
1345
1323
|
}
|
|
1346
|
-
if (!c.operator && (lt
|
|
1324
|
+
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
1347
1325
|
}
|
|
1348
|
-
if (gt
|
|
1349
|
-
if (lt
|
|
1326
|
+
if (gt && hasDomLT && !lt && gtltComp !== 0) return false;
|
|
1327
|
+
if (lt && hasDomGT && !gt && gtltComp !== 0) return false;
|
|
1350
1328
|
if (needDomGTPre || needDomLTPre) return false;
|
|
1351
1329
|
return true;
|
|
1352
1330
|
};
|
|
1353
1331
|
const higherGT = (a, b, options) => {
|
|
1354
1332
|
if (!a) return b;
|
|
1355
|
-
const comp = compare
|
|
1333
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1356
1334
|
return comp > 0 ? a : comp < 0 ? b : b.operator === ">" && a.operator === ">=" ? b : a;
|
|
1357
1335
|
};
|
|
1358
1336
|
const lowerLT = (a, b, options) => {
|
|
1359
1337
|
if (!a) return b;
|
|
1360
|
-
const comp = compare
|
|
1338
|
+
const comp = compare(a.semver, b.semver, options);
|
|
1361
1339
|
return comp < 0 ? a : comp > 0 ? b : b.operator === "<" && a.operator === "<=" ? b : a;
|
|
1362
1340
|
};
|
|
1363
|
-
module.exports = subset
|
|
1364
|
-
})
|
|
1341
|
+
module.exports = subset;
|
|
1342
|
+
}));
|
|
1365
1343
|
|
|
1366
1344
|
//#endregion
|
|
1367
|
-
//#region node_modules/.pnpm/semver@7.7.
|
|
1368
|
-
var require_semver = /* @__PURE__ */
|
|
1345
|
+
//#region node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
|
|
1346
|
+
var require_semver = /* @__PURE__ */ require_constants$1.__commonJSMin(((exports, module) => {
|
|
1369
1347
|
const internalRe = require_re();
|
|
1370
1348
|
const constants = require_constants();
|
|
1371
1349
|
const SemVer = require_semver$1();
|
|
@@ -1454,10 +1432,11 @@ var require_semver = /* @__PURE__ */ __commonJS({ "node_modules/.pnpm/semver@7.7
|
|
|
1454
1432
|
compareIdentifiers: identifiers.compareIdentifiers,
|
|
1455
1433
|
rcompareIdentifiers: identifiers.rcompareIdentifiers
|
|
1456
1434
|
};
|
|
1457
|
-
})
|
|
1435
|
+
}));
|
|
1458
1436
|
|
|
1459
1437
|
//#endregion
|
|
1460
1438
|
//#region src/controller/helpers/getCodemodConfig.ts
|
|
1439
|
+
/** Retrieves a JSON object from a file path, returning null if the file does not exist */
|
|
1461
1440
|
const getJsonFromPath = (baseDir, fileName) => {
|
|
1462
1441
|
const jsonPath = (0, node_path.join)(baseDir, fileName);
|
|
1463
1442
|
try {
|
|
@@ -1467,18 +1446,17 @@ const getJsonFromPath = (baseDir, fileName) => {
|
|
|
1467
1446
|
throw new Error(`Error reading ${jsonPath}`);
|
|
1468
1447
|
}
|
|
1469
1448
|
};
|
|
1470
|
-
function getCodemodConfig(codemodPath
|
|
1471
|
-
const { throwOnError = false } = options;
|
|
1449
|
+
function getCodemodConfig(codemodPath) {
|
|
1472
1450
|
try {
|
|
1473
1451
|
return getJsonFromPath((0, node_path.dirname)(codemodPath), "config.json");
|
|
1474
|
-
} catch
|
|
1475
|
-
|
|
1476
|
-
return null;
|
|
1452
|
+
} catch {
|
|
1453
|
+
throw new Error(`Error reading codemod config for ${codemodPath}`);
|
|
1477
1454
|
}
|
|
1478
1455
|
}
|
|
1479
1456
|
|
|
1480
1457
|
//#endregion
|
|
1481
1458
|
//#region src/controller/helpers/repository.ts
|
|
1459
|
+
const execAsync = (0, node_util.promisify)(node_child_process.exec);
|
|
1482
1460
|
/**
|
|
1483
1461
|
* Finds the root of the project by looking for the `.git` directory.
|
|
1484
1462
|
*/
|
|
@@ -1503,9 +1481,9 @@ function findProjectRoot() {
|
|
|
1503
1481
|
* the presence of `package.json` files and them optimistically
|
|
1504
1482
|
* containing a `@transferwise/components` string.
|
|
1505
1483
|
* */
|
|
1506
|
-
function findPackages() {
|
|
1484
|
+
async function findPackages() {
|
|
1507
1485
|
try {
|
|
1508
|
-
const
|
|
1486
|
+
const { stdout } = await execAsync([
|
|
1509
1487
|
"find ./",
|
|
1510
1488
|
"-type f",
|
|
1511
1489
|
"-name \"package.json\"",
|
|
@@ -1515,7 +1493,8 @@ function findPackages() {
|
|
|
1515
1493
|
].join(" "), {
|
|
1516
1494
|
cwd: findProjectRoot(),
|
|
1517
1495
|
encoding: "utf8"
|
|
1518
|
-
})
|
|
1496
|
+
});
|
|
1497
|
+
const packages = stdout.trim().split("\n").filter(Boolean).map(node_path.default.dirname);
|
|
1519
1498
|
if (packages.length === 0) throw new Error();
|
|
1520
1499
|
return packages;
|
|
1521
1500
|
} catch {
|
|
@@ -1553,9 +1532,7 @@ const renderTable = (data, indexHeading = "index") => {
|
|
|
1553
1532
|
const endSeparator = `└${firstCellLine}┴${remainingLines.join("┴")}┘`;
|
|
1554
1533
|
const formatRow = (cells) => {
|
|
1555
1534
|
return `│${cells.map((cell, index) => {
|
|
1556
|
-
const
|
|
1557
|
-
const displayWidth = getDisplayWidth(cell);
|
|
1558
|
-
const padding = width - displayWidth;
|
|
1535
|
+
const padding = columnWidths[index] - getDisplayWidth(cell);
|
|
1559
1536
|
return ` ${cell}${" ".repeat(Math.max(0, padding))} `;
|
|
1560
1537
|
}).join("│")}│`;
|
|
1561
1538
|
};
|
|
@@ -1570,7 +1547,7 @@ const renderTable = (data, indexHeading = "index") => {
|
|
|
1570
1547
|
|
|
1571
1548
|
//#endregion
|
|
1572
1549
|
//#region src/controller/helpers/dependencyChecks.ts
|
|
1573
|
-
var import_semver = /* @__PURE__ */ __toESM(require_semver());
|
|
1550
|
+
var import_semver = /* @__PURE__ */ require_constants$1.__toESM(require_semver());
|
|
1574
1551
|
/**
|
|
1575
1552
|
* Checks if the installed version satisfies the given version requirement.
|
|
1576
1553
|
*/
|
|
@@ -1598,8 +1575,7 @@ function getVersionFromNodeModules(packagePath, packageName) {
|
|
|
1598
1575
|
function findClosestPackageJson(currentPath) {
|
|
1599
1576
|
const resolvedPath = (0, node_path.resolve)(currentPath);
|
|
1600
1577
|
const projectRoot = findProjectRoot();
|
|
1601
|
-
|
|
1602
|
-
if ((0, node_fs.existsSync)(packageJsonPath)) return resolvedPath;
|
|
1578
|
+
if ((0, node_fs.existsSync)((0, node_path.join)(resolvedPath, "package.json"))) return resolvedPath;
|
|
1603
1579
|
if (projectRoot && resolvedPath === projectRoot) return null;
|
|
1604
1580
|
const parentPath = (0, node_path.dirname)(resolvedPath);
|
|
1605
1581
|
if (parentPath === resolvedPath) return null;
|
|
@@ -1610,22 +1586,20 @@ function findClosestPackageJson(currentPath) {
|
|
|
1610
1586
|
*/
|
|
1611
1587
|
const assessPrerequisites = (packagePath, codemodPath) => {
|
|
1612
1588
|
try {
|
|
1613
|
-
const
|
|
1614
|
-
OK: "\x1B[32m✔\x1B[0m",
|
|
1615
|
-
FAIL: "\x1B[31m✗\x1B[0m"
|
|
1616
|
-
};
|
|
1617
|
-
const codemodConfig = getJsonFromPath((0, node_path.dirname)(codemodPath), "config.json");
|
|
1589
|
+
const codemodConfig = getCodemodConfig(codemodPath);
|
|
1618
1590
|
const resolvedPackagePath = (0, node_path.resolve)(process.cwd(), packagePath);
|
|
1619
1591
|
const actualPackagePath = (0, node_fs.existsSync)((0, node_path.join)(resolvedPackagePath, "package.json")) ? resolvedPackagePath : findClosestPackageJson(resolvedPackagePath);
|
|
1620
1592
|
if (!actualPackagePath) {
|
|
1621
|
-
console.error(`${
|
|
1593
|
+
console.error(`${require_constants$1.CONSOLE_ICONS.error} \x1b[1mCould not find a package.json in or above ${packagePath}\x1b[0m`);
|
|
1622
1594
|
return false;
|
|
1623
1595
|
}
|
|
1624
|
-
if (actualPackagePath !== resolvedPackagePath) console.info(
|
|
1625
|
-
const
|
|
1596
|
+
if (actualPackagePath !== resolvedPackagePath) console.info(`${require_constants$1.CONSOLE_ICONS.info} Using package.json from ${actualPackagePath} for dependency checks`);
|
|
1597
|
+
const packageJson = getJsonFromPath(actualPackagePath, "package.json");
|
|
1598
|
+
if (!packageJson) return false;
|
|
1599
|
+
const { dependencies = {}, peerDependencies = {} } = packageJson;
|
|
1626
1600
|
const comparisons = {};
|
|
1627
1601
|
let isCompliant = true;
|
|
1628
|
-
if (codemodConfig
|
|
1602
|
+
if (codemodConfig?.prerequisites) Object.entries(codemodConfig.prerequisites).forEach(([name, versionRequirement]) => {
|
|
1629
1603
|
const nodeModulesVersion = getVersionFromNodeModules(actualPackagePath, name);
|
|
1630
1604
|
const isDependencySatisfied = isVersionSatisfied(dependencies[name], versionRequirement);
|
|
1631
1605
|
const isPeerDependencySatisfied = isVersionSatisfied(peerDependencies[name], versionRequirement);
|
|
@@ -1634,14 +1608,14 @@ const assessPrerequisites = (packagePath, codemodPath) => {
|
|
|
1634
1608
|
isCompliant = false;
|
|
1635
1609
|
comparisons[name] = {
|
|
1636
1610
|
required: versionRequirement,
|
|
1637
|
-
dependencies: isDependencySatisfied ?
|
|
1638
|
-
peerDependencies: isPeerDependencySatisfied ?
|
|
1639
|
-
node_modules: isInstalledSatisfied ?
|
|
1611
|
+
dependencies: isDependencySatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${dependencies[name] || "N/A"}`,
|
|
1612
|
+
peerDependencies: isPeerDependencySatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${peerDependencies[name] || "N/A"}`,
|
|
1613
|
+
node_modules: isInstalledSatisfied ? require_constants$1.CONSOLE_ICONS.success : `${require_constants$1.CONSOLE_ICONS.error} ${nodeModulesVersion || "N/A"}`
|
|
1640
1614
|
};
|
|
1641
1615
|
}
|
|
1642
1616
|
});
|
|
1643
1617
|
if (!isCompliant) {
|
|
1644
|
-
console.info(`${
|
|
1618
|
+
console.info(`${require_constants$1.CONSOLE_ICONS.error} \x1b[31mPrerequisite check failed -\x1b[0m \x1b[2m${packagePath}\x1b[0m`);
|
|
1645
1619
|
renderTable(comparisons, "package");
|
|
1646
1620
|
return false;
|
|
1647
1621
|
}
|
|
@@ -1651,6 +1625,53 @@ const assessPrerequisites = (packagePath, codemodPath) => {
|
|
|
1651
1625
|
return false;
|
|
1652
1626
|
}
|
|
1653
1627
|
};
|
|
1628
|
+
/**
|
|
1629
|
+
* Batch prerequisite assessment across multiple target paths.
|
|
1630
|
+
* - Resolves each target to its effective package root (closest package.json)
|
|
1631
|
+
* - Deduplicates by package root and checks each unique root once
|
|
1632
|
+
* - Logs a concise summary; detailed table is logged by assessPrerequisites on failure
|
|
1633
|
+
*/
|
|
1634
|
+
const assessPrerequisitesBatch = (targetPaths, codemodPath, spinnies) => {
|
|
1635
|
+
const packageRootToTargets = /* @__PURE__ */ new Map();
|
|
1636
|
+
const failedTargetsNoPackage = [];
|
|
1637
|
+
for (const target of targetPaths) {
|
|
1638
|
+
const resolved = (0, node_path.resolve)(process.cwd(), target);
|
|
1639
|
+
const actual = (0, node_fs.existsSync)((0, node_path.join)(resolved, "package.json")) ? resolved : findClosestPackageJson(resolved);
|
|
1640
|
+
if (actual) {
|
|
1641
|
+
const list$1 = packageRootToTargets.get(actual) ?? [];
|
|
1642
|
+
list$1.push(target);
|
|
1643
|
+
packageRootToTargets.set(target, list$1);
|
|
1644
|
+
} else failedTargetsNoPackage.push(target);
|
|
1645
|
+
}
|
|
1646
|
+
let allPassed = true;
|
|
1647
|
+
const results = /* @__PURE__ */ new Map();
|
|
1648
|
+
for (const [pkgRoot] of packageRootToTargets.entries()) {
|
|
1649
|
+
const passed = assessPrerequisites(pkgRoot, codemodPath);
|
|
1650
|
+
results.set(pkgRoot, passed);
|
|
1651
|
+
if (!passed) allPassed = false;
|
|
1652
|
+
}
|
|
1653
|
+
const totalTargets = targetPaths.length;
|
|
1654
|
+
const uniquePackages = packageRootToTargets.size;
|
|
1655
|
+
const passedCount = Array.from(results.values()).filter(Boolean).length;
|
|
1656
|
+
const failedCount = uniquePackages - passedCount;
|
|
1657
|
+
if (failedTargetsNoPackage.length || !passedCount) if (!passedCount) spinnies.fail("prerequisite-check", { text: "All targets failed prerequisite checks" });
|
|
1658
|
+
else {
|
|
1659
|
+
spinnies.fail("prerequisite-check", { text: `No package.json found for ${failedTargetsNoPackage.length} target${failedTargetsNoPackage.length !== 1 ? "s" : ""} (searching upwards to project root).` });
|
|
1660
|
+
failedTargetsNoPackage.forEach((t) => console.error(`- ${t}`));
|
|
1661
|
+
}
|
|
1662
|
+
else {
|
|
1663
|
+
const failedPart = failedCount > 0 ? `, \x1b[31m${failedCount} failed\x1b[0m` : "";
|
|
1664
|
+
spinnies.succeed("prerequisite-check", { text: `\x1b[0mChecked ${totalTargets} target${totalTargets !== 1 ? "s" : ""} across ${uniquePackages} package${uniquePackages !== 1 ? "s" : ""}:\x1b[0m \x1b[32m${passedCount} passed\x1b[0m${failedPart}` });
|
|
1665
|
+
}
|
|
1666
|
+
const failedPackageRoots = Array.from(results.entries()).filter(([, ok]) => !ok).map(([root]) => root);
|
|
1667
|
+
return {
|
|
1668
|
+
allPassed,
|
|
1669
|
+
results,
|
|
1670
|
+
packageRootToTargets,
|
|
1671
|
+
failedPackageRoots,
|
|
1672
|
+
failedTargetsNoPackage
|
|
1673
|
+
};
|
|
1674
|
+
};
|
|
1654
1675
|
|
|
1655
1676
|
//#endregion
|
|
1656
1677
|
//#region src/controller/helpers/getOptions.ts
|
|
@@ -1714,23 +1735,22 @@ const queryPackages = async (packages) => {
|
|
|
1714
1735
|
const message = "Path to run codemod on:";
|
|
1715
1736
|
const nonRootPackages = packages.filter((pkg) => pkg !== "." && pkg !== "./");
|
|
1716
1737
|
if (packages.length === 1 && (packages[0] === "." || packages[0] === "./")) {
|
|
1717
|
-
if (await (0,
|
|
1738
|
+
if (await (0, _inquirer_prompts.confirm)({
|
|
1718
1739
|
message: "Do you want to target a specific folder instead of the entire project?",
|
|
1719
1740
|
default: false
|
|
1720
1741
|
})) {
|
|
1721
|
-
const customPath = await (0,
|
|
1742
|
+
const customPath = await (0, _inquirer_prompts.search)({
|
|
1722
1743
|
message: "Enter the folder path (relative to project root):",
|
|
1723
1744
|
source: async (searchInput) => {
|
|
1724
|
-
|
|
1725
|
-
return getDirectoryChoices(rootPath, searchInput || "").map((choice) => ({
|
|
1745
|
+
return getDirectoryChoices(process.cwd(), searchInput || "").map((choice) => ({
|
|
1726
1746
|
name: choice === "." ? ". (entire project)" : choice,
|
|
1727
1747
|
value: choice,
|
|
1728
1748
|
description: choice === "." ? "Target the entire project" : `Target ${choice} directory`
|
|
1729
1749
|
}));
|
|
1730
1750
|
},
|
|
1731
|
-
validate: (path$
|
|
1732
|
-
if (!path$
|
|
1733
|
-
const fullPath = (0, node_path.join)(process.cwd(), path$
|
|
1751
|
+
validate: (path$4) => {
|
|
1752
|
+
if (!path$4?.trim()) return "Path cannot be empty";
|
|
1753
|
+
const fullPath = (0, node_path.join)(process.cwd(), path$4);
|
|
1734
1754
|
if (!(0, node_fs.existsSync)(fullPath)) return "Folder does not exist";
|
|
1735
1755
|
if (!(0, node_fs.statSync)(fullPath).isDirectory()) return "Path must be a directory";
|
|
1736
1756
|
return true;
|
|
@@ -1742,7 +1762,7 @@ const queryPackages = async (packages) => {
|
|
|
1742
1762
|
logToInquirer(message, packages[0] === "./" ? "." : packages[0]);
|
|
1743
1763
|
return [packages[0] === "./" ? "." : packages[0]];
|
|
1744
1764
|
}
|
|
1745
|
-
if (nonRootPackages.length >= 1) return (0,
|
|
1765
|
+
if (nonRootPackages.length >= 1) return (0, _inquirer_prompts.checkbox)({
|
|
1746
1766
|
required: true,
|
|
1747
1767
|
message: "Select packages to transform:",
|
|
1748
1768
|
choices: nonRootPackages.map((file) => ({
|
|
@@ -1762,7 +1782,7 @@ const determineTransformer = async ({ candidate, transformFiles }) => {
|
|
|
1762
1782
|
logToInquirer(codemodMessage, candidate);
|
|
1763
1783
|
return candidate;
|
|
1764
1784
|
}
|
|
1765
|
-
return (0,
|
|
1785
|
+
return (0, _inquirer_prompts.select)({
|
|
1766
1786
|
message: codemodMessage,
|
|
1767
1787
|
choices: transformFiles.map((file) => ({
|
|
1768
1788
|
name: file,
|
|
@@ -1794,7 +1814,7 @@ const determineIsDryMode = async (args) => {
|
|
|
1794
1814
|
logToInquirer(message, "Yes");
|
|
1795
1815
|
return true;
|
|
1796
1816
|
}
|
|
1797
|
-
return (0,
|
|
1817
|
+
return (0, _inquirer_prompts.confirm)({
|
|
1798
1818
|
message,
|
|
1799
1819
|
default: false
|
|
1800
1820
|
});
|
|
@@ -1808,7 +1828,7 @@ const determineIsPrint = async (args) => {
|
|
|
1808
1828
|
logToInquirer(message, "Yes");
|
|
1809
1829
|
return true;
|
|
1810
1830
|
}
|
|
1811
|
-
return (0,
|
|
1831
|
+
return (0, _inquirer_prompts.confirm)({
|
|
1812
1832
|
message,
|
|
1813
1833
|
default: false
|
|
1814
1834
|
});
|
|
@@ -1826,12 +1846,12 @@ const determineIgnorePatterns = async (args) => {
|
|
|
1826
1846
|
if (ignorePattern) {
|
|
1827
1847
|
logToInquirer(message, ignorePattern);
|
|
1828
1848
|
userPatterns = ignorePattern;
|
|
1829
|
-
} else userPatterns = await (0,
|
|
1849
|
+
} else userPatterns = await (0, _inquirer_prompts.input)({
|
|
1830
1850
|
message,
|
|
1831
1851
|
validate: () => true
|
|
1832
1852
|
});
|
|
1833
1853
|
const allPatterns = [...ALWAYS_IGNORED_FOLDERS];
|
|
1834
|
-
if (userPatterns
|
|
1854
|
+
if (userPatterns?.trim()) allPatterns.push(...userPatterns.split(",").map((p) => p.trim()));
|
|
1835
1855
|
return allPatterns.join(",");
|
|
1836
1856
|
};
|
|
1837
1857
|
/**
|
|
@@ -1847,35 +1867,28 @@ const determineGitIgnore = async (args) => {
|
|
|
1847
1867
|
logToInquirer(message, "No");
|
|
1848
1868
|
return false;
|
|
1849
1869
|
}
|
|
1850
|
-
return (0,
|
|
1870
|
+
return (0, _inquirer_prompts.confirm)({
|
|
1851
1871
|
message,
|
|
1852
1872
|
default: true
|
|
1853
1873
|
});
|
|
1854
1874
|
};
|
|
1855
|
-
async function getOptions({ transformFiles, packages, root, preselectedTransformFile }) {
|
|
1875
|
+
async function getOptions({ transformFiles, transformerType, packages, root, preselectedTransformFile }) {
|
|
1856
1876
|
const args = process.argv.slice(2);
|
|
1857
1877
|
if (preselectedTransformFile && args[0] === preselectedTransformFile) args.shift();
|
|
1858
|
-
const transformFile = preselectedTransformFile || await determineTransformer({
|
|
1859
|
-
candidate: args[0] ?? "",
|
|
1860
|
-
transformFiles
|
|
1861
|
-
});
|
|
1862
|
-
const pathCandidate = preselectedTransformFile ? args[0] ?? "" : args[1] ?? "";
|
|
1863
|
-
const targetPaths = await determinePaths({
|
|
1864
|
-
candidate: pathCandidate,
|
|
1865
|
-
root,
|
|
1866
|
-
packages
|
|
1867
|
-
});
|
|
1868
|
-
const isDry = await determineIsDryMode(args);
|
|
1869
|
-
const isPrint = await determineIsPrint(args);
|
|
1870
|
-
const ignorePatterns = await determineIgnorePatterns(args);
|
|
1871
|
-
const useGitIgnore = await determineGitIgnore(args);
|
|
1872
1878
|
return {
|
|
1873
|
-
transformFile
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
+
transformFile: preselectedTransformFile || await determineTransformer({
|
|
1880
|
+
candidate: args[0] ?? "",
|
|
1881
|
+
transformFiles
|
|
1882
|
+
}),
|
|
1883
|
+
targetPaths: await determinePaths({
|
|
1884
|
+
candidate: preselectedTransformFile ? args[0] ?? "" : args[1] ?? "",
|
|
1885
|
+
root,
|
|
1886
|
+
packages
|
|
1887
|
+
}),
|
|
1888
|
+
isDry: transformerType === "jscodeshift" ? await determineIsDryMode(args) : false,
|
|
1889
|
+
isPrint: await determineIsPrint(args),
|
|
1890
|
+
ignorePatterns: transformerType === "claude" ? ALWAYS_IGNORED_FOLDERS.join(",") : await determineIgnorePatterns(args),
|
|
1891
|
+
useGitIgnore: transformerType === "jscodeshift" ? await determineGitIgnore(args) : true
|
|
1879
1892
|
};
|
|
1880
1893
|
}
|
|
1881
1894
|
var getOptions_default = getOptions;
|
|
@@ -1927,7 +1940,7 @@ var reportManualReview_default = reportManualReview;
|
|
|
1927
1940
|
//#region src/controller/helpers/runTransformPrompts.ts
|
|
1928
1941
|
async function askPrompt(p) {
|
|
1929
1942
|
switch (p.type) {
|
|
1930
|
-
case "select": return (0,
|
|
1943
|
+
case "select": return (0, _inquirer_prompts.select)({
|
|
1931
1944
|
message: p.message,
|
|
1932
1945
|
choices: (p.choices ?? []).map((c) => ({
|
|
1933
1946
|
name: c.name,
|
|
@@ -1935,12 +1948,12 @@ async function askPrompt(p) {
|
|
|
1935
1948
|
})),
|
|
1936
1949
|
default: p.default
|
|
1937
1950
|
});
|
|
1938
|
-
case "confirm": return (0,
|
|
1951
|
+
case "confirm": return (0, _inquirer_prompts.confirm)({
|
|
1939
1952
|
message: p.message,
|
|
1940
1953
|
default: typeof p.default === "boolean" ? p.default : false
|
|
1941
1954
|
});
|
|
1942
1955
|
case "input":
|
|
1943
|
-
default: return (0,
|
|
1956
|
+
default: return (0, _inquirer_prompts.input)({
|
|
1944
1957
|
message: p.message,
|
|
1945
1958
|
default: p.default ?? ""
|
|
1946
1959
|
});
|
|
@@ -1963,16 +1976,24 @@ async function runTransformPrompts(codemodPath) {
|
|
|
1963
1976
|
}
|
|
1964
1977
|
|
|
1965
1978
|
//#endregion
|
|
1966
|
-
|
|
1979
|
+
//#region src/controller/helpers/validateClaudeConfig.ts
|
|
1980
|
+
const CLAUDE_SETTINGS_FILE = ".claude/settings.json";
|
|
1981
|
+
function validateClaudeConfig() {
|
|
1982
|
+
const claudeSettingsPath = node_path.default.resolve(process.env.HOME || "", CLAUDE_SETTINGS_FILE);
|
|
1983
|
+
if (!node_fs.default.existsSync(claudeSettingsPath)) throw new Error(`${require_constants$1.CONSOLE_ICONS.error} Claude Code is not configured. Expected settings file at: ${claudeSettingsPath}. Please follow the setup instructions:\n https://transferwise.atlassian.net/wiki/spaces/GenAIP/pages/3709765113/Configuring+Claude+Code\n`);
|
|
1984
|
+
}
|
|
1985
|
+
|
|
1986
|
+
//#endregion
|
|
1987
|
+
Object.defineProperty(exports, 'assessPrerequisites', {
|
|
1967
1988
|
enumerable: true,
|
|
1968
1989
|
get: function () {
|
|
1969
|
-
return
|
|
1990
|
+
return assessPrerequisites;
|
|
1970
1991
|
}
|
|
1971
1992
|
});
|
|
1972
|
-
Object.defineProperty(exports, '
|
|
1993
|
+
Object.defineProperty(exports, 'assessPrerequisitesBatch', {
|
|
1973
1994
|
enumerable: true,
|
|
1974
1995
|
get: function () {
|
|
1975
|
-
return
|
|
1996
|
+
return assessPrerequisitesBatch;
|
|
1976
1997
|
}
|
|
1977
1998
|
});
|
|
1978
1999
|
Object.defineProperty(exports, 'findPackages', {
|
|
@@ -1987,6 +2008,12 @@ Object.defineProperty(exports, 'findProjectRoot', {
|
|
|
1987
2008
|
return findProjectRoot;
|
|
1988
2009
|
}
|
|
1989
2010
|
});
|
|
2011
|
+
Object.defineProperty(exports, 'getCodemodConfig', {
|
|
2012
|
+
enumerable: true,
|
|
2013
|
+
get: function () {
|
|
2014
|
+
return getCodemodConfig;
|
|
2015
|
+
}
|
|
2016
|
+
});
|
|
1990
2017
|
Object.defineProperty(exports, 'getOptions_default', {
|
|
1991
2018
|
enumerable: true,
|
|
1992
2019
|
get: function () {
|
|
@@ -2017,4 +2044,10 @@ Object.defineProperty(exports, 'runTransformPrompts', {
|
|
|
2017
2044
|
return runTransformPrompts;
|
|
2018
2045
|
}
|
|
2019
2046
|
});
|
|
2020
|
-
|
|
2047
|
+
Object.defineProperty(exports, 'validateClaudeConfig', {
|
|
2048
|
+
enumerable: true,
|
|
2049
|
+
get: function () {
|
|
2050
|
+
return validateClaudeConfig;
|
|
2051
|
+
}
|
|
2052
|
+
});
|
|
2053
|
+
//# sourceMappingURL=helpers-LWyJOzUP.js.map
|