@platforma-sdk/block-tools 2.1.11 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +113 -71
- package/dist/cli.mjs.map +1 -1
- package/dist/cmd/index.d.ts +2 -0
- package/dist/cmd/index.d.ts.map +1 -1
- package/dist/cmd/publish.d.ts +11 -0
- package/dist/cmd/publish.d.ts.map +1 -0
- package/dist/config-B1U40s2a.js +3 -0
- package/dist/config-B1U40s2a.js.map +1 -0
- package/dist/config-YukCegnp.mjs +1587 -0
- package/dist/config-YukCegnp.mjs.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +170 -38
- package/dist/index.mjs.map +1 -1
- package/dist/io/folder_reader.d.ts +24 -0
- package/dist/io/folder_reader.d.ts.map +1 -0
- package/dist/io/index.d.ts +3 -0
- package/dist/io/index.d.ts.map +1 -0
- package/dist/io/storage.d.ts.map +1 -0
- package/dist/lib.d.ts +1 -0
- package/dist/lib.d.ts.map +1 -1
- package/dist/registry_v1/config_schema.d.ts +13 -13
- package/dist/registry_v1/registry.d.ts +1 -1
- package/dist/registry_v1/registry.d.ts.map +1 -1
- package/dist/registry_v1/v1_repo_schema.d.ts +1 -1
- package/dist/registry_v1/v1_repo_schema.d.ts.map +1 -1
- package/dist/v2/build_dist.d.ts +2 -1
- package/dist/v2/build_dist.d.ts.map +1 -1
- package/dist/v2/index.d.ts +1 -0
- package/dist/v2/index.d.ts.map +1 -1
- package/dist/v2/model/block_components.d.ts +170 -178
- package/dist/v2/model/block_components.d.ts.map +1 -1
- package/dist/v2/model/block_description.d.ts +2873 -0
- package/dist/v2/model/block_description.d.ts.map +1 -0
- package/dist/v2/model/{meta.d.ts → block_meta.d.ts} +555 -3
- package/dist/v2/model/block_meta.d.ts.map +1 -0
- package/dist/v2/model/content_conversion.d.ts +7 -2
- package/dist/v2/model/content_conversion.d.ts.map +1 -1
- package/dist/v2/model/index.d.ts +3 -2079
- package/dist/v2/model/index.d.ts.map +1 -1
- package/dist/v2/registry/index.d.ts +4 -0
- package/dist/v2/registry/index.d.ts.map +1 -0
- package/dist/v2/registry/registry.d.ts +16 -0
- package/dist/v2/registry/registry.d.ts.map +1 -0
- package/dist/v2/registry/registry_reader.d.ts +12 -0
- package/dist/v2/registry/registry_reader.d.ts.map +1 -0
- package/dist/v2/registry/schema_internal.d.ts +7 -0
- package/dist/v2/registry/schema_internal.d.ts.map +1 -0
- package/dist/v2/registry/schema_public.d.ts +4499 -0
- package/dist/v2/registry/schema_public.d.ts.map +1 -0
- package/package.json +8 -5
- package/src/cmd/build-meta.ts +2 -2
- package/src/cmd/index.ts +2 -0
- package/src/cmd/publish.ts +69 -0
- package/src/io/folder_reader.test.ts +21 -0
- package/src/io/folder_reader.ts +77 -0
- package/src/io/index.ts +2 -0
- package/src/lib.ts +1 -0
- package/src/registry_v1/config.ts +1 -1
- package/src/registry_v1/registry.test.ts +1 -1
- package/src/registry_v1/registry.ts +1 -1
- package/src/registry_v1/v1_repo_schema.ts +1 -1
- package/src/v2/build_dist.ts +16 -12
- package/src/v2/index.ts +1 -0
- package/src/v2/model/block_components.ts +14 -10
- package/src/v2/model/block_description.ts +49 -0
- package/src/v2/model/{meta.ts → block_meta.ts} +23 -5
- package/src/v2/model/content_conversion.ts +78 -10
- package/src/v2/model/index.ts +3 -44
- package/src/v2/registry/index.ts +3 -0
- package/src/v2/registry/registry.ts +240 -0
- package/src/v2/registry/registry_reader.ts +71 -0
- package/src/v2/registry/schema_internal.ts +13 -0
- package/src/v2/registry/schema_public.ts +112 -0
- package/dist/config-Br5DwFuM.mjs +0 -1317
- package/dist/config-Br5DwFuM.mjs.map +0 -1
- package/dist/config-DMAm68Pm.js +0 -3
- package/dist/config-DMAm68Pm.js.map +0 -1
- package/dist/lib/storage.d.ts.map +0 -1
- package/dist/v2/model/common.d.ts +0 -3
- package/dist/v2/model/common.d.ts.map +0 -1
- package/dist/v2/model/content_types.d.ts +0 -478
- package/dist/v2/model/content_types.d.ts.map +0 -1
- package/dist/v2/model/meta.d.ts.map +0 -1
- package/dist/v2/registry/schema.d.ts +0 -15
- package/dist/v2/registry/schema.d.ts.map +0 -1
- package/src/v2/model/common.ts +0 -2
- package/src/v2/model/content_types.ts +0 -233
- package/src/v2/registry/schema.ts +0 -29
- /package/dist/{lib → io}/storage.d.ts +0 -0
- /package/src/{lib → io}/storage.test.ts +0 -0
- /package/src/{lib → io}/storage.ts +0 -0
package/dist/config-Br5DwFuM.mjs
DELETED
|
@@ -1,1317 +0,0 @@
|
|
|
1
|
-
var Ft = Object.defineProperty;
|
|
2
|
-
var Dt = (r, e, t) => e in r ? Ft(r, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : r[e] = t;
|
|
3
|
-
var q = (r, e, t) => Dt(r, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
-
import B from "node:fs/promises";
|
|
5
|
-
import k from "node:path";
|
|
6
|
-
import { z as P } from "zod";
|
|
7
|
-
import * as jt from "mime-types";
|
|
8
|
-
import * as _t from "tar";
|
|
9
|
-
import { tryResolve as at } from "@milaboratories/resolve-helper";
|
|
10
|
-
import { BlockComponents as ge, ContentAbsoluteBinaryLocal as Re, ContentAbsoluteFolder as bt, BlockComponentsManifest as ot, ContentRelativeBinary as Fe, BlockPackMeta as ve, ContentAbsoluteTextLocal as ct, BlockPackMetaEmbeddedContent as Gt, DescriptionContentText as Ut, DescriptionContentBinary as Bt, CreateBlockPackDescriptionSchema as we, BlockPackMetaManifest as Vt, BlockPackDescriptionFromPackageJsonRaw as lt, SemVer as Ie } from "@milaboratories/pl-model-middle-layer";
|
|
11
|
-
import { notEmpty as ft } from "@milaboratories/ts-helpers";
|
|
12
|
-
import xt from "yaml";
|
|
13
|
-
import * as De from "node:os";
|
|
14
|
-
import { randomUUID as Xt } from "node:crypto";
|
|
15
|
-
import G from "node:path/posix";
|
|
16
|
-
import { S3 as Mt, paginateListObjectsV2 as zt } from "@aws-sdk/client-s3";
|
|
17
|
-
import * as H from "node:fs";
|
|
18
|
-
function Ht(r) {
|
|
19
|
-
return P.string().transform((e, t) => {
|
|
20
|
-
const s = at(r, e);
|
|
21
|
-
return s === void 0 ? (t.addIssue({
|
|
22
|
-
code: P.ZodIssueCode.custom,
|
|
23
|
-
message: `Can't resolve ${e} against ${r}`
|
|
24
|
-
}), P.NEVER) : {
|
|
25
|
-
type: "absolute-file",
|
|
26
|
-
file: s
|
|
27
|
-
};
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
function Jt(r, ...e) {
|
|
31
|
-
return P.string().transform((t, s) => {
|
|
32
|
-
const a = t.endsWith("/") ? t : `${t}/`;
|
|
33
|
-
for (const o of e) {
|
|
34
|
-
const c = at(r, a + o);
|
|
35
|
-
if (c !== void 0) {
|
|
36
|
-
if (!c.endsWith(o))
|
|
37
|
-
throw new Error(`Unexpected resolve result ${c} with index file ${o}`);
|
|
38
|
-
return {
|
|
39
|
-
type: "absolute-folder",
|
|
40
|
-
folder: c.slice(0, c.length - o.length)
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return s.addIssue({
|
|
45
|
-
code: P.ZodIssueCode.custom,
|
|
46
|
-
message: `Can't resolve ${t} folder against ${r}, no index file found (${e.join(", ")})`
|
|
47
|
-
}), P.NEVER;
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function je(r) {
|
|
51
|
-
return (e) => e.type === "relative" ? { type: "absolute-file", file: k.resolve(r, e.path) } : e;
|
|
52
|
-
}
|
|
53
|
-
function Wt() {
|
|
54
|
-
return async (r) => r.type === "absolute-file" ? await B.readFile(r.file, { encoding: "utf-8" }) : r.content;
|
|
55
|
-
}
|
|
56
|
-
function qt() {
|
|
57
|
-
return async (r) => {
|
|
58
|
-
if (r.type === "absolute-file") {
|
|
59
|
-
const e = jt.lookup(r.file);
|
|
60
|
-
if (!e) throw new Error(`Can't recognize mime type of the file: ${r.file}.`);
|
|
61
|
-
return {
|
|
62
|
-
type: "explicit-base64",
|
|
63
|
-
mimeType: e,
|
|
64
|
-
content: await B.readFile(r.file, { encoding: "base64" })
|
|
65
|
-
};
|
|
66
|
-
} else return r;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function Ee(r, e) {
|
|
70
|
-
return async (t) => {
|
|
71
|
-
if (t.type === "absolute-file") {
|
|
72
|
-
const s = k.basename(t.file), a = k.resolve(r, s);
|
|
73
|
-
return e == null || e.push(s), await B.cp(t.file, a), { type: "relative", path: s };
|
|
74
|
-
} else return t;
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
function Yt(r, e, t) {
|
|
78
|
-
if (!e.endsWith(".tgz")) throw new Error(`Unexpected tgz file name: ${e}`);
|
|
79
|
-
return async (s) => {
|
|
80
|
-
const a = k.resolve(r, e);
|
|
81
|
-
return await _t.create(
|
|
82
|
-
{
|
|
83
|
-
gzip: !0,
|
|
84
|
-
file: a,
|
|
85
|
-
cwd: s.folder
|
|
86
|
-
},
|
|
87
|
-
[s.folder]
|
|
88
|
-
), t == null || t.push(e), { type: "relative", path: e };
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
function _e(r) {
|
|
92
|
-
const e = r.endsWith("/") ? r : `${r}/`;
|
|
93
|
-
return (t) => t.type === "relative" ? { type: "absolute-url", url: e + t.path } : t;
|
|
94
|
-
}
|
|
95
|
-
function Kt(r) {
|
|
96
|
-
return ge(
|
|
97
|
-
Ht(r),
|
|
98
|
-
Jt(r, "index.html")
|
|
99
|
-
);
|
|
100
|
-
}
|
|
101
|
-
function Zt(r, e) {
|
|
102
|
-
return ge(
|
|
103
|
-
Re.transform(Ee(r, e)),
|
|
104
|
-
bt.transform(Yt(r, "ui.tgz", e))
|
|
105
|
-
).pipe(ot);
|
|
106
|
-
}
|
|
107
|
-
function Li(r) {
|
|
108
|
-
return ge(
|
|
109
|
-
Fe.transform(_e(r)),
|
|
110
|
-
Fe.transform(_e(r))
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
function Qt(r) {
|
|
114
|
-
return ve(
|
|
115
|
-
Ut.transform(je(r)),
|
|
116
|
-
Bt.transform(je(r))
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
function er(r, e) {
|
|
120
|
-
return ve(
|
|
121
|
-
ct.transform(Ee(r, e)),
|
|
122
|
-
Re.transform(Ee(r, e))
|
|
123
|
-
);
|
|
124
|
-
}
|
|
125
|
-
const Pi = ve(
|
|
126
|
-
ct.transform(Wt()),
|
|
127
|
-
Re.transform(qt())
|
|
128
|
-
).pipe(Gt);
|
|
129
|
-
function ut(r) {
|
|
130
|
-
return we(
|
|
131
|
-
Kt(r),
|
|
132
|
-
Qt(r)
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
function tr(r, e) {
|
|
136
|
-
return we(
|
|
137
|
-
Zt(r, e),
|
|
138
|
-
//BlockPackMetaToExplicit
|
|
139
|
-
er(r, e)
|
|
140
|
-
).pipe(ht);
|
|
141
|
-
}
|
|
142
|
-
const ht = we(
|
|
143
|
-
ot,
|
|
144
|
-
Vt
|
|
145
|
-
), rr = ht.extend({
|
|
146
|
-
schema: P.literal("v1"),
|
|
147
|
-
files: P.array(P.string())
|
|
148
|
-
}), sr = "manifest.json";
|
|
149
|
-
async function Ai(r, e) {
|
|
150
|
-
await B.mkdir(e, { recursive: !0 });
|
|
151
|
-
const t = [], s = await tr(e, t).parseAsync(
|
|
152
|
-
r
|
|
153
|
-
), a = rr.parse({
|
|
154
|
-
schema: "v1",
|
|
155
|
-
...s,
|
|
156
|
-
files: t
|
|
157
|
-
});
|
|
158
|
-
return await B.writeFile(k.resolve(e, sr), JSON.stringify(a)), a;
|
|
159
|
-
}
|
|
160
|
-
async function Ne(r, e) {
|
|
161
|
-
try {
|
|
162
|
-
return e(await B.readFile(r));
|
|
163
|
-
} catch (t) {
|
|
164
|
-
if (t.code == "ENOENT") return;
|
|
165
|
-
throw new Error("", { cause: t });
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
const $e = "block", nr = /(?:@[a-zA-Z0-9-.]+\/)?(?<organization>[a-zA-Z0-9-]+)\.(?<name>[a-zA-Z0-9-]+)/;
|
|
169
|
-
function pt(r) {
|
|
170
|
-
const e = r.match(nr);
|
|
171
|
-
if (!e)
|
|
172
|
-
throw new Error(
|
|
173
|
-
`Malformed package name (${r}), can't infer organization and block pack name.`
|
|
174
|
-
);
|
|
175
|
-
const { name: t, organization: s } = e.groups;
|
|
176
|
-
return { name: t, organization: s };
|
|
177
|
-
}
|
|
178
|
-
async function Ti(r) {
|
|
179
|
-
const e = k.resolve(r, "package.json");
|
|
180
|
-
try {
|
|
181
|
-
const t = await Ne(
|
|
182
|
-
e,
|
|
183
|
-
(c) => JSON.parse(c.toString("utf-8"))
|
|
184
|
-
);
|
|
185
|
-
if (t === void 0) return;
|
|
186
|
-
const s = t[$e];
|
|
187
|
-
if (s === void 0) return;
|
|
188
|
-
const a = {
|
|
189
|
-
...lt.parse(s),
|
|
190
|
-
id: {
|
|
191
|
-
...pt(
|
|
192
|
-
ft(t.name, `"name" not found in ${e}`)
|
|
193
|
-
),
|
|
194
|
-
version: Ie.parse(t.version)
|
|
195
|
-
}
|
|
196
|
-
}, o = await ut(r).safeParseAsync(a);
|
|
197
|
-
return o.success ? o.data : void 0;
|
|
198
|
-
} catch {
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
async function ir(r) {
|
|
203
|
-
const e = k.resolve(r, "package.json"), t = JSON.parse(await B.readFile(e, { encoding: "utf-8" })), s = t[$e];
|
|
204
|
-
if (s === void 0)
|
|
205
|
-
throw new Error(
|
|
206
|
-
`Block description (field ${$e}) not found in ${e}.`
|
|
207
|
-
);
|
|
208
|
-
return {
|
|
209
|
-
...lt.parse(s),
|
|
210
|
-
id: {
|
|
211
|
-
...pt(
|
|
212
|
-
ft(t.name, `"name" not found in ${e}`)
|
|
213
|
-
),
|
|
214
|
-
version: Ie.parse(t.version)
|
|
215
|
-
}
|
|
216
|
-
};
|
|
217
|
-
}
|
|
218
|
-
async function yi(r) {
|
|
219
|
-
const e = await ir(r);
|
|
220
|
-
return await ut(r).parseAsync(e);
|
|
221
|
-
}
|
|
222
|
-
const ar = P.string().regex(/^(?:s3:|file:)/), or = P.object({
|
|
223
|
-
organization: P.string(),
|
|
224
|
-
package: P.string(),
|
|
225
|
-
version: Ie.optional(),
|
|
226
|
-
files: P.record(P.string().regex(/^[^\/]+$/), P.string()).default({}),
|
|
227
|
-
meta: P.object({}).passthrough()
|
|
228
|
-
}), cr = P.object({
|
|
229
|
-
registries: P.record(P.string(), ar).default({}),
|
|
230
|
-
registry: P.string().optional()
|
|
231
|
-
}), Et = cr.merge(or).required(
|
|
232
|
-
{ registry: !0, version: !0 }
|
|
233
|
-
), Se = Et.partial().required({
|
|
234
|
-
registries: !0,
|
|
235
|
-
files: !0
|
|
236
|
-
}), lr = "pl.package.json", fr = "pl.package.yaml";
|
|
237
|
-
function ur(r) {
|
|
238
|
-
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
239
|
-
}
|
|
240
|
-
var me = { exports: {} };
|
|
241
|
-
const hr = "2.0.0", $t = 256, pr = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
|
|
242
|
-
9007199254740991, Er = 16, $r = $t - 6, mr = [
|
|
243
|
-
"major",
|
|
244
|
-
"premajor",
|
|
245
|
-
"minor",
|
|
246
|
-
"preminor",
|
|
247
|
-
"patch",
|
|
248
|
-
"prepatch",
|
|
249
|
-
"prerelease"
|
|
250
|
-
];
|
|
251
|
-
var ee = {
|
|
252
|
-
MAX_LENGTH: $t,
|
|
253
|
-
MAX_SAFE_COMPONENT_LENGTH: Er,
|
|
254
|
-
MAX_SAFE_BUILD_LENGTH: $r,
|
|
255
|
-
MAX_SAFE_INTEGER: pr,
|
|
256
|
-
RELEASE_TYPES: mr,
|
|
257
|
-
SEMVER_SPEC_VERSION: hr,
|
|
258
|
-
FLAG_INCLUDE_PRERELEASE: 1,
|
|
259
|
-
FLAG_LOOSE: 2
|
|
260
|
-
};
|
|
261
|
-
const dr = typeof process == "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...r) => console.error("SEMVER", ...r) : () => {
|
|
262
|
-
};
|
|
263
|
-
var te = dr;
|
|
264
|
-
(function(r, e) {
|
|
265
|
-
const {
|
|
266
|
-
MAX_SAFE_COMPONENT_LENGTH: t,
|
|
267
|
-
MAX_SAFE_BUILD_LENGTH: s,
|
|
268
|
-
MAX_LENGTH: a
|
|
269
|
-
} = ee, o = te;
|
|
270
|
-
e = r.exports = {};
|
|
271
|
-
const c = e.re = [], v = e.safeRe = [], n = e.src = [], i = e.t = {};
|
|
272
|
-
let f = 0;
|
|
273
|
-
const p = "[a-zA-Z0-9-]", N = [
|
|
274
|
-
["\\s", 1],
|
|
275
|
-
["\\d", a],
|
|
276
|
-
[p, s]
|
|
277
|
-
], E = (C) => {
|
|
278
|
-
for (const [T, L] of N)
|
|
279
|
-
C = C.split(`${T}*`).join(`${T}{0,${L}}`).split(`${T}+`).join(`${T}{1,${L}}`);
|
|
280
|
-
return C;
|
|
281
|
-
}, u = (C, T, L) => {
|
|
282
|
-
const y = E(T), I = f++;
|
|
283
|
-
o(C, I, T), i[C] = I, n[I] = T, c[I] = new RegExp(T, L ? "g" : void 0), v[I] = new RegExp(y, L ? "g" : void 0);
|
|
284
|
-
};
|
|
285
|
-
u("NUMERICIDENTIFIER", "0|[1-9]\\d*"), u("NUMERICIDENTIFIERLOOSE", "\\d+"), u("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${p}*`), u("MAINVERSION", `(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})\\.(${n[i.NUMERICIDENTIFIER]})`), u("MAINVERSIONLOOSE", `(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})\\.(${n[i.NUMERICIDENTIFIERLOOSE]})`), u("PRERELEASEIDENTIFIER", `(?:${n[i.NUMERICIDENTIFIER]}|${n[i.NONNUMERICIDENTIFIER]})`), u("PRERELEASEIDENTIFIERLOOSE", `(?:${n[i.NUMERICIDENTIFIERLOOSE]}|${n[i.NONNUMERICIDENTIFIER]})`), u("PRERELEASE", `(?:-(${n[i.PRERELEASEIDENTIFIER]}(?:\\.${n[i.PRERELEASEIDENTIFIER]})*))`), u("PRERELEASELOOSE", `(?:-?(${n[i.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${n[i.PRERELEASEIDENTIFIERLOOSE]})*))`), u("BUILDIDENTIFIER", `${p}+`), u("BUILD", `(?:\\+(${n[i.BUILDIDENTIFIER]}(?:\\.${n[i.BUILDIDENTIFIER]})*))`), u("FULLPLAIN", `v?${n[i.MAINVERSION]}${n[i.PRERELEASE]}?${n[i.BUILD]}?`), u("FULL", `^${n[i.FULLPLAIN]}$`), u("LOOSEPLAIN", `[v=\\s]*${n[i.MAINVERSIONLOOSE]}${n[i.PRERELEASELOOSE]}?${n[i.BUILD]}?`), u("LOOSE", `^${n[i.LOOSEPLAIN]}$`), u("GTLT", "((?:<|>)?=?)"), u("XRANGEIDENTIFIERLOOSE", `${n[i.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`), u("XRANGEIDENTIFIER", `${n[i.NUMERICIDENTIFIER]}|x|X|\\*`), u("XRANGEPLAIN", `[v=\\s]*(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:\\.(${n[i.XRANGEIDENTIFIER]})(?:${n[i.PRERELEASE]})?${n[i.BUILD]}?)?)?`), u("XRANGEPLAINLOOSE", `[v=\\s]*(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:\\.(${n[i.XRANGEIDENTIFIERLOOSE]})(?:${n[i.PRERELEASELOOSE]})?${n[i.BUILD]}?)?)?`), u("XRANGE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAIN]}$`), u("XRANGELOOSE", `^${n[i.GTLT]}\\s*${n[i.XRANGEPLAINLOOSE]}$`), u("COERCEPLAIN", `(^|[^\\d])(\\d{1,${t}})(?:\\.(\\d{1,${t}}))?(?:\\.(\\d{1,${t}}))?`), u("COERCE", `${n[i.COERCEPLAIN]}(?:$|[^\\d])`), u("COERCEFULL", n[i.COERCEPLAIN] + `(?:${n[i.PRERELEASE]})?(?:${n[i.BUILD]})?(?:$|[^\\d])`), u("COERCERTL", n[i.COERCE], !0), u("COERCERTLFULL", n[i.COERCEFULL], !0), u("LONETILDE", "(?:~>?)"), u("TILDETRIM", `(\\s*)${n[i.LONETILDE]}\\s+`, !0), e.tildeTrimReplace = "$1~", u("TILDE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAIN]}$`), u("TILDELOOSE", `^${n[i.LONETILDE]}${n[i.XRANGEPLAINLOOSE]}$`), u("LONECARET", "(?:\\^)"), u("CARETTRIM", `(\\s*)${n[i.LONECARET]}\\s+`, !0), e.caretTrimReplace = "$1^", u("CARET", `^${n[i.LONECARET]}${n[i.XRANGEPLAIN]}$`), u("CARETLOOSE", `^${n[i.LONECARET]}${n[i.XRANGEPLAINLOOSE]}$`), u("COMPARATORLOOSE", `^${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]})$|^$`), u("COMPARATOR", `^${n[i.GTLT]}\\s*(${n[i.FULLPLAIN]})$|^$`), u("COMPARATORTRIM", `(\\s*)${n[i.GTLT]}\\s*(${n[i.LOOSEPLAIN]}|${n[i.XRANGEPLAIN]})`, !0), e.comparatorTrimReplace = "$1$2$3", u("HYPHENRANGE", `^\\s*(${n[i.XRANGEPLAIN]})\\s+-\\s+(${n[i.XRANGEPLAIN]})\\s*$`), u("HYPHENRANGELOOSE", `^\\s*(${n[i.XRANGEPLAINLOOSE]})\\s+-\\s+(${n[i.XRANGEPLAINLOOSE]})\\s*$`), u("STAR", "(<|>)?=?\\s*\\*"), u("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$"), u("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
286
|
-
})(me, me.exports);
|
|
287
|
-
var W = me.exports;
|
|
288
|
-
const gr = Object.freeze({ loose: !0 }), Rr = Object.freeze({}), vr = (r) => r ? typeof r != "object" ? gr : r : Rr;
|
|
289
|
-
var Oe = vr;
|
|
290
|
-
const be = /^[0-9]+$/, mt = (r, e) => {
|
|
291
|
-
const t = be.test(r), s = be.test(e);
|
|
292
|
-
return t && s && (r = +r, e = +e), r === e ? 0 : t && !s ? -1 : s && !t ? 1 : r < e ? -1 : 1;
|
|
293
|
-
}, wr = (r, e) => mt(e, r);
|
|
294
|
-
var dt = {
|
|
295
|
-
compareIdentifiers: mt,
|
|
296
|
-
rcompareIdentifiers: wr
|
|
297
|
-
};
|
|
298
|
-
const Y = te, { MAX_LENGTH: Ge, MAX_SAFE_INTEGER: K } = ee, { safeRe: Ue, t: Be } = W, Ir = Oe, { compareIdentifiers: V } = dt;
|
|
299
|
-
let Nr = class b {
|
|
300
|
-
constructor(e, t) {
|
|
301
|
-
if (t = Ir(t), e instanceof b) {
|
|
302
|
-
if (e.loose === !!t.loose && e.includePrerelease === !!t.includePrerelease)
|
|
303
|
-
return e;
|
|
304
|
-
e = e.version;
|
|
305
|
-
} else if (typeof e != "string")
|
|
306
|
-
throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);
|
|
307
|
-
if (e.length > Ge)
|
|
308
|
-
throw new TypeError(
|
|
309
|
-
`version is longer than ${Ge} characters`
|
|
310
|
-
);
|
|
311
|
-
Y("SemVer", e, t), this.options = t, this.loose = !!t.loose, this.includePrerelease = !!t.includePrerelease;
|
|
312
|
-
const s = e.trim().match(t.loose ? Ue[Be.LOOSE] : Ue[Be.FULL]);
|
|
313
|
-
if (!s)
|
|
314
|
-
throw new TypeError(`Invalid Version: ${e}`);
|
|
315
|
-
if (this.raw = e, this.major = +s[1], this.minor = +s[2], this.patch = +s[3], this.major > K || this.major < 0)
|
|
316
|
-
throw new TypeError("Invalid major version");
|
|
317
|
-
if (this.minor > K || this.minor < 0)
|
|
318
|
-
throw new TypeError("Invalid minor version");
|
|
319
|
-
if (this.patch > K || this.patch < 0)
|
|
320
|
-
throw new TypeError("Invalid patch version");
|
|
321
|
-
s[4] ? this.prerelease = s[4].split(".").map((a) => {
|
|
322
|
-
if (/^[0-9]+$/.test(a)) {
|
|
323
|
-
const o = +a;
|
|
324
|
-
if (o >= 0 && o < K)
|
|
325
|
-
return o;
|
|
326
|
-
}
|
|
327
|
-
return a;
|
|
328
|
-
}) : this.prerelease = [], this.build = s[5] ? s[5].split(".") : [], this.format();
|
|
329
|
-
}
|
|
330
|
-
format() {
|
|
331
|
-
return this.version = `${this.major}.${this.minor}.${this.patch}`, this.prerelease.length && (this.version += `-${this.prerelease.join(".")}`), this.version;
|
|
332
|
-
}
|
|
333
|
-
toString() {
|
|
334
|
-
return this.version;
|
|
335
|
-
}
|
|
336
|
-
compare(e) {
|
|
337
|
-
if (Y("SemVer.compare", this.version, this.options, e), !(e instanceof b)) {
|
|
338
|
-
if (typeof e == "string" && e === this.version)
|
|
339
|
-
return 0;
|
|
340
|
-
e = new b(e, this.options);
|
|
341
|
-
}
|
|
342
|
-
return e.version === this.version ? 0 : this.compareMain(e) || this.comparePre(e);
|
|
343
|
-
}
|
|
344
|
-
compareMain(e) {
|
|
345
|
-
return e instanceof b || (e = new b(e, this.options)), V(this.major, e.major) || V(this.minor, e.minor) || V(this.patch, e.patch);
|
|
346
|
-
}
|
|
347
|
-
comparePre(e) {
|
|
348
|
-
if (e instanceof b || (e = new b(e, this.options)), this.prerelease.length && !e.prerelease.length)
|
|
349
|
-
return -1;
|
|
350
|
-
if (!this.prerelease.length && e.prerelease.length)
|
|
351
|
-
return 1;
|
|
352
|
-
if (!this.prerelease.length && !e.prerelease.length)
|
|
353
|
-
return 0;
|
|
354
|
-
let t = 0;
|
|
355
|
-
do {
|
|
356
|
-
const s = this.prerelease[t], a = e.prerelease[t];
|
|
357
|
-
if (Y("prerelease compare", t, s, a), s === void 0 && a === void 0)
|
|
358
|
-
return 0;
|
|
359
|
-
if (a === void 0)
|
|
360
|
-
return 1;
|
|
361
|
-
if (s === void 0)
|
|
362
|
-
return -1;
|
|
363
|
-
if (s === a)
|
|
364
|
-
continue;
|
|
365
|
-
return V(s, a);
|
|
366
|
-
} while (++t);
|
|
367
|
-
}
|
|
368
|
-
compareBuild(e) {
|
|
369
|
-
e instanceof b || (e = new b(e, this.options));
|
|
370
|
-
let t = 0;
|
|
371
|
-
do {
|
|
372
|
-
const s = this.build[t], a = e.build[t];
|
|
373
|
-
if (Y("build compare", t, s, a), s === void 0 && a === void 0)
|
|
374
|
-
return 0;
|
|
375
|
-
if (a === void 0)
|
|
376
|
-
return 1;
|
|
377
|
-
if (s === void 0)
|
|
378
|
-
return -1;
|
|
379
|
-
if (s === a)
|
|
380
|
-
continue;
|
|
381
|
-
return V(s, a);
|
|
382
|
-
} while (++t);
|
|
383
|
-
}
|
|
384
|
-
// preminor will bump the version up to the next minor release, and immediately
|
|
385
|
-
// down to pre-release. premajor and prepatch work the same way.
|
|
386
|
-
inc(e, t, s) {
|
|
387
|
-
switch (e) {
|
|
388
|
-
case "premajor":
|
|
389
|
-
this.prerelease.length = 0, this.patch = 0, this.minor = 0, this.major++, this.inc("pre", t, s);
|
|
390
|
-
break;
|
|
391
|
-
case "preminor":
|
|
392
|
-
this.prerelease.length = 0, this.patch = 0, this.minor++, this.inc("pre", t, s);
|
|
393
|
-
break;
|
|
394
|
-
case "prepatch":
|
|
395
|
-
this.prerelease.length = 0, this.inc("patch", t, s), this.inc("pre", t, s);
|
|
396
|
-
break;
|
|
397
|
-
case "prerelease":
|
|
398
|
-
this.prerelease.length === 0 && this.inc("patch", t, s), this.inc("pre", t, s);
|
|
399
|
-
break;
|
|
400
|
-
case "major":
|
|
401
|
-
(this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) && this.major++, this.minor = 0, this.patch = 0, this.prerelease = [];
|
|
402
|
-
break;
|
|
403
|
-
case "minor":
|
|
404
|
-
(this.patch !== 0 || this.prerelease.length === 0) && this.minor++, this.patch = 0, this.prerelease = [];
|
|
405
|
-
break;
|
|
406
|
-
case "patch":
|
|
407
|
-
this.prerelease.length === 0 && this.patch++, this.prerelease = [];
|
|
408
|
-
break;
|
|
409
|
-
case "pre": {
|
|
410
|
-
const a = Number(s) ? 1 : 0;
|
|
411
|
-
if (!t && s === !1)
|
|
412
|
-
throw new Error("invalid increment argument: identifier is empty");
|
|
413
|
-
if (this.prerelease.length === 0)
|
|
414
|
-
this.prerelease = [a];
|
|
415
|
-
else {
|
|
416
|
-
let o = this.prerelease.length;
|
|
417
|
-
for (; --o >= 0; )
|
|
418
|
-
typeof this.prerelease[o] == "number" && (this.prerelease[o]++, o = -2);
|
|
419
|
-
if (o === -1) {
|
|
420
|
-
if (t === this.prerelease.join(".") && s === !1)
|
|
421
|
-
throw new Error("invalid increment argument: identifier already exists");
|
|
422
|
-
this.prerelease.push(a);
|
|
423
|
-
}
|
|
424
|
-
}
|
|
425
|
-
if (t) {
|
|
426
|
-
let o = [t, a];
|
|
427
|
-
s === !1 && (o = [t]), V(this.prerelease[0], t) === 0 ? isNaN(this.prerelease[1]) && (this.prerelease = o) : this.prerelease = o;
|
|
428
|
-
}
|
|
429
|
-
break;
|
|
430
|
-
}
|
|
431
|
-
default:
|
|
432
|
-
throw new Error(`invalid increment argument: ${e}`);
|
|
433
|
-
}
|
|
434
|
-
return this.raw = this.format(), this.build.length && (this.raw += `+${this.build.join(".")}`), this;
|
|
435
|
-
}
|
|
436
|
-
};
|
|
437
|
-
var F = Nr;
|
|
438
|
-
const Ve = F, Sr = (r, e, t = !1) => {
|
|
439
|
-
if (r instanceof Ve)
|
|
440
|
-
return r;
|
|
441
|
-
try {
|
|
442
|
-
return new Ve(r, e);
|
|
443
|
-
} catch (s) {
|
|
444
|
-
if (!t)
|
|
445
|
-
return null;
|
|
446
|
-
throw s;
|
|
447
|
-
}
|
|
448
|
-
};
|
|
449
|
-
var x = Sr;
|
|
450
|
-
const Or = x, Lr = (r, e) => {
|
|
451
|
-
const t = Or(r, e);
|
|
452
|
-
return t ? t.version : null;
|
|
453
|
-
};
|
|
454
|
-
var Pr = Lr;
|
|
455
|
-
const Ar = x, Tr = (r, e) => {
|
|
456
|
-
const t = Ar(r.trim().replace(/^[=v]+/, ""), e);
|
|
457
|
-
return t ? t.version : null;
|
|
458
|
-
};
|
|
459
|
-
var yr = Tr;
|
|
460
|
-
const xe = F, kr = (r, e, t, s, a) => {
|
|
461
|
-
typeof t == "string" && (a = s, s = t, t = void 0);
|
|
462
|
-
try {
|
|
463
|
-
return new xe(
|
|
464
|
-
r instanceof xe ? r.version : r,
|
|
465
|
-
t
|
|
466
|
-
).inc(e, s, a).version;
|
|
467
|
-
} catch {
|
|
468
|
-
return null;
|
|
469
|
-
}
|
|
470
|
-
};
|
|
471
|
-
var Cr = kr;
|
|
472
|
-
const Xe = x, Fr = (r, e) => {
|
|
473
|
-
const t = Xe(r, null, !0), s = Xe(e, null, !0), a = t.compare(s);
|
|
474
|
-
if (a === 0)
|
|
475
|
-
return null;
|
|
476
|
-
const o = a > 0, c = o ? t : s, v = o ? s : t, n = !!c.prerelease.length;
|
|
477
|
-
if (!!v.prerelease.length && !n)
|
|
478
|
-
return !v.patch && !v.minor ? "major" : c.patch ? "patch" : c.minor ? "minor" : "major";
|
|
479
|
-
const f = n ? "pre" : "";
|
|
480
|
-
return t.major !== s.major ? f + "major" : t.minor !== s.minor ? f + "minor" : t.patch !== s.patch ? f + "patch" : "prerelease";
|
|
481
|
-
};
|
|
482
|
-
var Dr = Fr;
|
|
483
|
-
const jr = F, _r = (r, e) => new jr(r, e).major;
|
|
484
|
-
var br = _r;
|
|
485
|
-
const Gr = F, Ur = (r, e) => new Gr(r, e).minor;
|
|
486
|
-
var Br = Ur;
|
|
487
|
-
const Vr = F, xr = (r, e) => new Vr(r, e).patch;
|
|
488
|
-
var Xr = xr;
|
|
489
|
-
const Mr = x, zr = (r, e) => {
|
|
490
|
-
const t = Mr(r, e);
|
|
491
|
-
return t && t.prerelease.length ? t.prerelease : null;
|
|
492
|
-
};
|
|
493
|
-
var Hr = zr;
|
|
494
|
-
const Me = F, Jr = (r, e, t) => new Me(r, t).compare(new Me(e, t));
|
|
495
|
-
var j = Jr;
|
|
496
|
-
const Wr = j, qr = (r, e, t) => Wr(e, r, t);
|
|
497
|
-
var Yr = qr;
|
|
498
|
-
const Kr = j, Zr = (r, e) => Kr(r, e, !0);
|
|
499
|
-
var Qr = Zr;
|
|
500
|
-
const ze = F, es = (r, e, t) => {
|
|
501
|
-
const s = new ze(r, t), a = new ze(e, t);
|
|
502
|
-
return s.compare(a) || s.compareBuild(a);
|
|
503
|
-
};
|
|
504
|
-
var Le = es;
|
|
505
|
-
const ts = Le, rs = (r, e) => r.sort((t, s) => ts(t, s, e));
|
|
506
|
-
var ss = rs;
|
|
507
|
-
const ns = Le, is = (r, e) => r.sort((t, s) => ns(s, t, e));
|
|
508
|
-
var as = is;
|
|
509
|
-
const os = j, cs = (r, e, t) => os(r, e, t) > 0;
|
|
510
|
-
var re = cs;
|
|
511
|
-
const ls = j, fs = (r, e, t) => ls(r, e, t) < 0;
|
|
512
|
-
var Pe = fs;
|
|
513
|
-
const us = j, hs = (r, e, t) => us(r, e, t) === 0;
|
|
514
|
-
var gt = hs;
|
|
515
|
-
const ps = j, Es = (r, e, t) => ps(r, e, t) !== 0;
|
|
516
|
-
var Rt = Es;
|
|
517
|
-
const $s = j, ms = (r, e, t) => $s(r, e, t) >= 0;
|
|
518
|
-
var Ae = ms;
|
|
519
|
-
const ds = j, gs = (r, e, t) => ds(r, e, t) <= 0;
|
|
520
|
-
var Te = gs;
|
|
521
|
-
const Rs = gt, vs = Rt, ws = re, Is = Ae, Ns = Pe, Ss = Te, Os = (r, e, t, s) => {
|
|
522
|
-
switch (e) {
|
|
523
|
-
case "===":
|
|
524
|
-
return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r === t;
|
|
525
|
-
case "!==":
|
|
526
|
-
return typeof r == "object" && (r = r.version), typeof t == "object" && (t = t.version), r !== t;
|
|
527
|
-
case "":
|
|
528
|
-
case "=":
|
|
529
|
-
case "==":
|
|
530
|
-
return Rs(r, t, s);
|
|
531
|
-
case "!=":
|
|
532
|
-
return vs(r, t, s);
|
|
533
|
-
case ">":
|
|
534
|
-
return ws(r, t, s);
|
|
535
|
-
case ">=":
|
|
536
|
-
return Is(r, t, s);
|
|
537
|
-
case "<":
|
|
538
|
-
return Ns(r, t, s);
|
|
539
|
-
case "<=":
|
|
540
|
-
return Ss(r, t, s);
|
|
541
|
-
default:
|
|
542
|
-
throw new TypeError(`Invalid operator: ${e}`);
|
|
543
|
-
}
|
|
544
|
-
};
|
|
545
|
-
var vt = Os;
|
|
546
|
-
const Ls = F, Ps = x, { safeRe: Z, t: Q } = W, As = (r, e) => {
|
|
547
|
-
if (r instanceof Ls)
|
|
548
|
-
return r;
|
|
549
|
-
if (typeof r == "number" && (r = String(r)), typeof r != "string")
|
|
550
|
-
return null;
|
|
551
|
-
e = e || {};
|
|
552
|
-
let t = null;
|
|
553
|
-
if (!e.rtl)
|
|
554
|
-
t = r.match(e.includePrerelease ? Z[Q.COERCEFULL] : Z[Q.COERCE]);
|
|
555
|
-
else {
|
|
556
|
-
const n = e.includePrerelease ? Z[Q.COERCERTLFULL] : Z[Q.COERCERTL];
|
|
557
|
-
let i;
|
|
558
|
-
for (; (i = n.exec(r)) && (!t || t.index + t[0].length !== r.length); )
|
|
559
|
-
(!t || i.index + i[0].length !== t.index + t[0].length) && (t = i), n.lastIndex = i.index + i[1].length + i[2].length;
|
|
560
|
-
n.lastIndex = -1;
|
|
561
|
-
}
|
|
562
|
-
if (t === null)
|
|
563
|
-
return null;
|
|
564
|
-
const s = t[2], a = t[3] || "0", o = t[4] || "0", c = e.includePrerelease && t[5] ? `-${t[5]}` : "", v = e.includePrerelease && t[6] ? `+${t[6]}` : "";
|
|
565
|
-
return Ps(`${s}.${a}.${o}${c}${v}`, e);
|
|
566
|
-
};
|
|
567
|
-
var Ts = As;
|
|
568
|
-
class ys {
|
|
569
|
-
constructor() {
|
|
570
|
-
this.max = 1e3, this.map = /* @__PURE__ */ new Map();
|
|
571
|
-
}
|
|
572
|
-
get(e) {
|
|
573
|
-
const t = this.map.get(e);
|
|
574
|
-
if (t !== void 0)
|
|
575
|
-
return this.map.delete(e), this.map.set(e, t), t;
|
|
576
|
-
}
|
|
577
|
-
delete(e) {
|
|
578
|
-
return this.map.delete(e);
|
|
579
|
-
}
|
|
580
|
-
set(e, t) {
|
|
581
|
-
if (!this.delete(e) && t !== void 0) {
|
|
582
|
-
if (this.map.size >= this.max) {
|
|
583
|
-
const a = this.map.keys().next().value;
|
|
584
|
-
this.delete(a);
|
|
585
|
-
}
|
|
586
|
-
this.map.set(e, t);
|
|
587
|
-
}
|
|
588
|
-
return this;
|
|
589
|
-
}
|
|
590
|
-
}
|
|
591
|
-
var ks = ys, ae, He;
|
|
592
|
-
function _() {
|
|
593
|
-
if (He) return ae;
|
|
594
|
-
He = 1;
|
|
595
|
-
const r = /\s+/g;
|
|
596
|
-
class e {
|
|
597
|
-
constructor(l, d) {
|
|
598
|
-
if (d = a(d), l instanceof e)
|
|
599
|
-
return l.loose === !!d.loose && l.includePrerelease === !!d.includePrerelease ? l : new e(l.raw, d);
|
|
600
|
-
if (l instanceof o)
|
|
601
|
-
return this.raw = l.value, this.set = [[l]], this.formatted = void 0, this;
|
|
602
|
-
if (this.options = d, this.loose = !!d.loose, this.includePrerelease = !!d.includePrerelease, this.raw = l.trim().replace(r, " "), this.set = this.raw.split("||").map(($) => this.parseRange($.trim())).filter(($) => $.length), !this.set.length)
|
|
603
|
-
throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
|
|
604
|
-
if (this.set.length > 1) {
|
|
605
|
-
const $ = this.set[0];
|
|
606
|
-
if (this.set = this.set.filter((g) => !C(g[0])), this.set.length === 0)
|
|
607
|
-
this.set = [$];
|
|
608
|
-
else if (this.set.length > 1) {
|
|
609
|
-
for (const g of this.set)
|
|
610
|
-
if (g.length === 1 && T(g[0])) {
|
|
611
|
-
this.set = [g];
|
|
612
|
-
break;
|
|
613
|
-
}
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
|
-
this.formatted = void 0;
|
|
617
|
-
}
|
|
618
|
-
get range() {
|
|
619
|
-
if (this.formatted === void 0) {
|
|
620
|
-
this.formatted = "";
|
|
621
|
-
for (let l = 0; l < this.set.length; l++) {
|
|
622
|
-
l > 0 && (this.formatted += "||");
|
|
623
|
-
const d = this.set[l];
|
|
624
|
-
for (let $ = 0; $ < d.length; $++)
|
|
625
|
-
$ > 0 && (this.formatted += " "), this.formatted += d[$].toString().trim();
|
|
626
|
-
}
|
|
627
|
-
}
|
|
628
|
-
return this.formatted;
|
|
629
|
-
}
|
|
630
|
-
format() {
|
|
631
|
-
return this.range;
|
|
632
|
-
}
|
|
633
|
-
toString() {
|
|
634
|
-
return this.range;
|
|
635
|
-
}
|
|
636
|
-
parseRange(l) {
|
|
637
|
-
const $ = ((this.options.includePrerelease && E) | (this.options.loose && u)) + ":" + l, g = s.get($);
|
|
638
|
-
if (g)
|
|
639
|
-
return g;
|
|
640
|
-
const m = this.options.loose, R = m ? n[i.HYPHENRANGELOOSE] : n[i.HYPHENRANGE];
|
|
641
|
-
l = l.replace(R, kt(this.options.includePrerelease)), c("hyphen replace", l), l = l.replace(n[i.COMPARATORTRIM], f), c("comparator trim", l), l = l.replace(n[i.TILDETRIM], p), c("tilde trim", l), l = l.replace(n[i.CARETTRIM], N), c("caret trim", l);
|
|
642
|
-
let S = l.split(" ").map((A) => y(A, this.options)).join(" ").split(/\s+/).map((A) => yt(A, this.options));
|
|
643
|
-
m && (S = S.filter((A) => (c("loose invalid filter", A, this.options), !!A.match(n[i.COMPARATORLOOSE])))), c("range list", S);
|
|
644
|
-
const w = /* @__PURE__ */ new Map(), O = S.map((A) => new o(A, this.options));
|
|
645
|
-
for (const A of O) {
|
|
646
|
-
if (C(A))
|
|
647
|
-
return [A];
|
|
648
|
-
w.set(A.value, A);
|
|
649
|
-
}
|
|
650
|
-
w.size > 1 && w.has("") && w.delete("");
|
|
651
|
-
const D = [...w.values()];
|
|
652
|
-
return s.set($, D), D;
|
|
653
|
-
}
|
|
654
|
-
intersects(l, d) {
|
|
655
|
-
if (!(l instanceof e))
|
|
656
|
-
throw new TypeError("a Range is required");
|
|
657
|
-
return this.set.some(($) => L($, d) && l.set.some((g) => L(g, d) && $.every((m) => g.every((R) => m.intersects(R, d)))));
|
|
658
|
-
}
|
|
659
|
-
// if ANY of the sets match ALL of its comparators, then pass
|
|
660
|
-
test(l) {
|
|
661
|
-
if (!l)
|
|
662
|
-
return !1;
|
|
663
|
-
if (typeof l == "string")
|
|
664
|
-
try {
|
|
665
|
-
l = new v(l, this.options);
|
|
666
|
-
} catch {
|
|
667
|
-
return !1;
|
|
668
|
-
}
|
|
669
|
-
for (let d = 0; d < this.set.length; d++)
|
|
670
|
-
if (Ct(this.set[d], l, this.options))
|
|
671
|
-
return !0;
|
|
672
|
-
return !1;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
ae = e;
|
|
676
|
-
const t = ks, s = new t(), a = Oe, o = se(), c = te, v = F, {
|
|
677
|
-
safeRe: n,
|
|
678
|
-
t: i,
|
|
679
|
-
comparatorTrimReplace: f,
|
|
680
|
-
tildeTrimReplace: p,
|
|
681
|
-
caretTrimReplace: N
|
|
682
|
-
} = W, { FLAG_INCLUDE_PRERELEASE: E, FLAG_LOOSE: u } = ee, C = (h) => h.value === "<0.0.0-0", T = (h) => h.value === "", L = (h, l) => {
|
|
683
|
-
let d = !0;
|
|
684
|
-
const $ = h.slice();
|
|
685
|
-
let g = $.pop();
|
|
686
|
-
for (; d && $.length; )
|
|
687
|
-
d = $.every((m) => g.intersects(m, l)), g = $.pop();
|
|
688
|
-
return d;
|
|
689
|
-
}, y = (h, l) => (c("comp", h, l), h = Ot(h, l), c("caret", h), h = X(h, l), c("tildes", h), h = Pt(h, l), c("xrange", h), h = Tt(h, l), c("stars", h), h), I = (h) => !h || h.toLowerCase() === "x" || h === "*", X = (h, l) => h.trim().split(/\s+/).map((d) => M(d, l)).join(" "), M = (h, l) => {
|
|
690
|
-
const d = l.loose ? n[i.TILDELOOSE] : n[i.TILDE];
|
|
691
|
-
return h.replace(d, ($, g, m, R, S) => {
|
|
692
|
-
c("tilde", h, $, g, m, R, S);
|
|
693
|
-
let w;
|
|
694
|
-
return I(g) ? w = "" : I(m) ? w = `>=${g}.0.0 <${+g + 1}.0.0-0` : I(R) ? w = `>=${g}.${m}.0 <${g}.${+m + 1}.0-0` : S ? (c("replaceTilde pr", S), w = `>=${g}.${m}.${R}-${S} <${g}.${+m + 1}.0-0`) : w = `>=${g}.${m}.${R} <${g}.${+m + 1}.0-0`, c("tilde return", w), w;
|
|
695
|
-
});
|
|
696
|
-
}, Ot = (h, l) => h.trim().split(/\s+/).map((d) => Lt(d, l)).join(" "), Lt = (h, l) => {
|
|
697
|
-
c("caret", h, l);
|
|
698
|
-
const d = l.loose ? n[i.CARETLOOSE] : n[i.CARET], $ = l.includePrerelease ? "-0" : "";
|
|
699
|
-
return h.replace(d, (g, m, R, S, w) => {
|
|
700
|
-
c("caret", h, g, m, R, S, w);
|
|
701
|
-
let O;
|
|
702
|
-
return I(m) ? O = "" : I(R) ? O = `>=${m}.0.0${$} <${+m + 1}.0.0-0` : I(S) ? m === "0" ? O = `>=${m}.${R}.0${$} <${m}.${+R + 1}.0-0` : O = `>=${m}.${R}.0${$} <${+m + 1}.0.0-0` : w ? (c("replaceCaret pr", w), m === "0" ? R === "0" ? O = `>=${m}.${R}.${S}-${w} <${m}.${R}.${+S + 1}-0` : O = `>=${m}.${R}.${S}-${w} <${m}.${+R + 1}.0-0` : O = `>=${m}.${R}.${S}-${w} <${+m + 1}.0.0-0`) : (c("no pr"), m === "0" ? R === "0" ? O = `>=${m}.${R}.${S}${$} <${m}.${R}.${+S + 1}-0` : O = `>=${m}.${R}.${S}${$} <${m}.${+R + 1}.0-0` : O = `>=${m}.${R}.${S} <${+m + 1}.0.0-0`), c("caret return", O), O;
|
|
703
|
-
});
|
|
704
|
-
}, Pt = (h, l) => (c("replaceXRanges", h, l), h.split(/\s+/).map((d) => At(d, l)).join(" ")), At = (h, l) => {
|
|
705
|
-
h = h.trim();
|
|
706
|
-
const d = l.loose ? n[i.XRANGELOOSE] : n[i.XRANGE];
|
|
707
|
-
return h.replace(d, ($, g, m, R, S, w) => {
|
|
708
|
-
c("xRange", h, $, g, m, R, S, w);
|
|
709
|
-
const O = I(m), D = O || I(R), A = D || I(S), z = A;
|
|
710
|
-
return g === "=" && z && (g = ""), w = l.includePrerelease ? "-0" : "", O ? g === ">" || g === "<" ? $ = "<0.0.0-0" : $ = "*" : g && z ? (D && (R = 0), S = 0, g === ">" ? (g = ">=", D ? (m = +m + 1, R = 0, S = 0) : (R = +R + 1, S = 0)) : g === "<=" && (g = "<", D ? m = +m + 1 : R = +R + 1), g === "<" && (w = "-0"), $ = `${g + m}.${R}.${S}${w}`) : D ? $ = `>=${m}.0.0${w} <${+m + 1}.0.0-0` : A && ($ = `>=${m}.${R}.0${w} <${m}.${+R + 1}.0-0`), c("xRange return", $), $;
|
|
711
|
-
});
|
|
712
|
-
}, Tt = (h, l) => (c("replaceStars", h, l), h.trim().replace(n[i.STAR], "")), yt = (h, l) => (c("replaceGTE0", h, l), h.trim().replace(n[l.includePrerelease ? i.GTE0PRE : i.GTE0], "")), kt = (h) => (l, d, $, g, m, R, S, w, O, D, A, z) => (I($) ? d = "" : I(g) ? d = `>=${$}.0.0${h ? "-0" : ""}` : I(m) ? d = `>=${$}.${g}.0${h ? "-0" : ""}` : R ? d = `>=${d}` : d = `>=${d}${h ? "-0" : ""}`, I(O) ? w = "" : I(D) ? w = `<${+O + 1}.0.0-0` : I(A) ? w = `<${O}.${+D + 1}.0-0` : z ? w = `<=${O}.${D}.${A}-${z}` : h ? w = `<${O}.${D}.${+A + 1}-0` : w = `<=${w}`, `${d} ${w}`.trim()), Ct = (h, l, d) => {
|
|
713
|
-
for (let $ = 0; $ < h.length; $++)
|
|
714
|
-
if (!h[$].test(l))
|
|
715
|
-
return !1;
|
|
716
|
-
if (l.prerelease.length && !d.includePrerelease) {
|
|
717
|
-
for (let $ = 0; $ < h.length; $++)
|
|
718
|
-
if (c(h[$].semver), h[$].semver !== o.ANY && h[$].semver.prerelease.length > 0) {
|
|
719
|
-
const g = h[$].semver;
|
|
720
|
-
if (g.major === l.major && g.minor === l.minor && g.patch === l.patch)
|
|
721
|
-
return !0;
|
|
722
|
-
}
|
|
723
|
-
return !1;
|
|
724
|
-
}
|
|
725
|
-
return !0;
|
|
726
|
-
};
|
|
727
|
-
return ae;
|
|
728
|
-
}
|
|
729
|
-
var oe, Je;
|
|
730
|
-
function se() {
|
|
731
|
-
if (Je) return oe;
|
|
732
|
-
Je = 1;
|
|
733
|
-
const r = Symbol("SemVer ANY");
|
|
734
|
-
class e {
|
|
735
|
-
static get ANY() {
|
|
736
|
-
return r;
|
|
737
|
-
}
|
|
738
|
-
constructor(f, p) {
|
|
739
|
-
if (p = t(p), f instanceof e) {
|
|
740
|
-
if (f.loose === !!p.loose)
|
|
741
|
-
return f;
|
|
742
|
-
f = f.value;
|
|
743
|
-
}
|
|
744
|
-
f = f.trim().split(/\s+/).join(" "), c("comparator", f, p), this.options = p, this.loose = !!p.loose, this.parse(f), this.semver === r ? this.value = "" : this.value = this.operator + this.semver.version, c("comp", this);
|
|
745
|
-
}
|
|
746
|
-
parse(f) {
|
|
747
|
-
const p = this.options.loose ? s[a.COMPARATORLOOSE] : s[a.COMPARATOR], N = f.match(p);
|
|
748
|
-
if (!N)
|
|
749
|
-
throw new TypeError(`Invalid comparator: ${f}`);
|
|
750
|
-
this.operator = N[1] !== void 0 ? N[1] : "", this.operator === "=" && (this.operator = ""), N[2] ? this.semver = new v(N[2], this.options.loose) : this.semver = r;
|
|
751
|
-
}
|
|
752
|
-
toString() {
|
|
753
|
-
return this.value;
|
|
754
|
-
}
|
|
755
|
-
test(f) {
|
|
756
|
-
if (c("Comparator.test", f, this.options.loose), this.semver === r || f === r)
|
|
757
|
-
return !0;
|
|
758
|
-
if (typeof f == "string")
|
|
759
|
-
try {
|
|
760
|
-
f = new v(f, this.options);
|
|
761
|
-
} catch {
|
|
762
|
-
return !1;
|
|
763
|
-
}
|
|
764
|
-
return o(f, this.operator, this.semver, this.options);
|
|
765
|
-
}
|
|
766
|
-
intersects(f, p) {
|
|
767
|
-
if (!(f instanceof e))
|
|
768
|
-
throw new TypeError("a Comparator is required");
|
|
769
|
-
return this.operator === "" ? this.value === "" ? !0 : new n(f.value, p).test(this.value) : f.operator === "" ? f.value === "" ? !0 : new n(this.value, p).test(f.semver) : (p = t(p), p.includePrerelease && (this.value === "<0.0.0-0" || f.value === "<0.0.0-0") || !p.includePrerelease && (this.value.startsWith("<0.0.0") || f.value.startsWith("<0.0.0")) ? !1 : !!(this.operator.startsWith(">") && f.operator.startsWith(">") || this.operator.startsWith("<") && f.operator.startsWith("<") || this.semver.version === f.semver.version && this.operator.includes("=") && f.operator.includes("=") || o(this.semver, "<", f.semver, p) && this.operator.startsWith(">") && f.operator.startsWith("<") || o(this.semver, ">", f.semver, p) && this.operator.startsWith("<") && f.operator.startsWith(">")));
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
oe = e;
|
|
773
|
-
const t = Oe, { safeRe: s, t: a } = W, o = vt, c = te, v = F, n = _();
|
|
774
|
-
return oe;
|
|
775
|
-
}
|
|
776
|
-
const Cs = _(), Fs = (r, e, t) => {
|
|
777
|
-
try {
|
|
778
|
-
e = new Cs(e, t);
|
|
779
|
-
} catch {
|
|
780
|
-
return !1;
|
|
781
|
-
}
|
|
782
|
-
return e.test(r);
|
|
783
|
-
};
|
|
784
|
-
var ne = Fs;
|
|
785
|
-
const Ds = _(), js = (r, e) => new Ds(r, e).set.map((t) => t.map((s) => s.value).join(" ").trim().split(" "));
|
|
786
|
-
var _s = js;
|
|
787
|
-
const bs = F, Gs = _(), Us = (r, e, t) => {
|
|
788
|
-
let s = null, a = null, o = null;
|
|
789
|
-
try {
|
|
790
|
-
o = new Gs(e, t);
|
|
791
|
-
} catch {
|
|
792
|
-
return null;
|
|
793
|
-
}
|
|
794
|
-
return r.forEach((c) => {
|
|
795
|
-
o.test(c) && (!s || a.compare(c) === -1) && (s = c, a = new bs(s, t));
|
|
796
|
-
}), s;
|
|
797
|
-
};
|
|
798
|
-
var Bs = Us;
|
|
799
|
-
const Vs = F, xs = _(), Xs = (r, e, t) => {
|
|
800
|
-
let s = null, a = null, o = null;
|
|
801
|
-
try {
|
|
802
|
-
o = new xs(e, t);
|
|
803
|
-
} catch {
|
|
804
|
-
return null;
|
|
805
|
-
}
|
|
806
|
-
return r.forEach((c) => {
|
|
807
|
-
o.test(c) && (!s || a.compare(c) === 1) && (s = c, a = new Vs(s, t));
|
|
808
|
-
}), s;
|
|
809
|
-
};
|
|
810
|
-
var Ms = Xs;
|
|
811
|
-
const ce = F, zs = _(), We = re, Hs = (r, e) => {
|
|
812
|
-
r = new zs(r, e);
|
|
813
|
-
let t = new ce("0.0.0");
|
|
814
|
-
if (r.test(t) || (t = new ce("0.0.0-0"), r.test(t)))
|
|
815
|
-
return t;
|
|
816
|
-
t = null;
|
|
817
|
-
for (let s = 0; s < r.set.length; ++s) {
|
|
818
|
-
const a = r.set[s];
|
|
819
|
-
let o = null;
|
|
820
|
-
a.forEach((c) => {
|
|
821
|
-
const v = new ce(c.semver.version);
|
|
822
|
-
switch (c.operator) {
|
|
823
|
-
case ">":
|
|
824
|
-
v.prerelease.length === 0 ? v.patch++ : v.prerelease.push(0), v.raw = v.format();
|
|
825
|
-
case "":
|
|
826
|
-
case ">=":
|
|
827
|
-
(!o || We(v, o)) && (o = v);
|
|
828
|
-
break;
|
|
829
|
-
case "<":
|
|
830
|
-
case "<=":
|
|
831
|
-
break;
|
|
832
|
-
default:
|
|
833
|
-
throw new Error(`Unexpected operation: ${c.operator}`);
|
|
834
|
-
}
|
|
835
|
-
}), o && (!t || We(t, o)) && (t = o);
|
|
836
|
-
}
|
|
837
|
-
return t && r.test(t) ? t : null;
|
|
838
|
-
};
|
|
839
|
-
var Js = Hs;
|
|
840
|
-
const Ws = _(), qs = (r, e) => {
|
|
841
|
-
try {
|
|
842
|
-
return new Ws(r, e).range || "*";
|
|
843
|
-
} catch {
|
|
844
|
-
return null;
|
|
845
|
-
}
|
|
846
|
-
};
|
|
847
|
-
var Ys = qs;
|
|
848
|
-
const Ks = F, wt = se(), { ANY: Zs } = wt, Qs = _(), en = ne, qe = re, Ye = Pe, tn = Te, rn = Ae, sn = (r, e, t, s) => {
|
|
849
|
-
r = new Ks(r, s), e = new Qs(e, s);
|
|
850
|
-
let a, o, c, v, n;
|
|
851
|
-
switch (t) {
|
|
852
|
-
case ">":
|
|
853
|
-
a = qe, o = tn, c = Ye, v = ">", n = ">=";
|
|
854
|
-
break;
|
|
855
|
-
case "<":
|
|
856
|
-
a = Ye, o = rn, c = qe, v = "<", n = "<=";
|
|
857
|
-
break;
|
|
858
|
-
default:
|
|
859
|
-
throw new TypeError('Must provide a hilo val of "<" or ">"');
|
|
860
|
-
}
|
|
861
|
-
if (en(r, e, s))
|
|
862
|
-
return !1;
|
|
863
|
-
for (let i = 0; i < e.set.length; ++i) {
|
|
864
|
-
const f = e.set[i];
|
|
865
|
-
let p = null, N = null;
|
|
866
|
-
if (f.forEach((E) => {
|
|
867
|
-
E.semver === Zs && (E = new wt(">=0.0.0")), p = p || E, N = N || E, a(E.semver, p.semver, s) ? p = E : c(E.semver, N.semver, s) && (N = E);
|
|
868
|
-
}), p.operator === v || p.operator === n || (!N.operator || N.operator === v) && o(r, N.semver))
|
|
869
|
-
return !1;
|
|
870
|
-
if (N.operator === n && c(r, N.semver))
|
|
871
|
-
return !1;
|
|
872
|
-
}
|
|
873
|
-
return !0;
|
|
874
|
-
};
|
|
875
|
-
var ye = sn;
|
|
876
|
-
const nn = ye, an = (r, e, t) => nn(r, e, ">", t);
|
|
877
|
-
var on = an;
|
|
878
|
-
const cn = ye, ln = (r, e, t) => cn(r, e, "<", t);
|
|
879
|
-
var fn = ln;
|
|
880
|
-
const Ke = _(), un = (r, e, t) => (r = new Ke(r, t), e = new Ke(e, t), r.intersects(e, t));
|
|
881
|
-
var hn = un;
|
|
882
|
-
const pn = ne, En = j;
|
|
883
|
-
var $n = (r, e, t) => {
|
|
884
|
-
const s = [];
|
|
885
|
-
let a = null, o = null;
|
|
886
|
-
const c = r.sort((f, p) => En(f, p, t));
|
|
887
|
-
for (const f of c)
|
|
888
|
-
pn(f, e, t) ? (o = f, a || (a = f)) : (o && s.push([a, o]), o = null, a = null);
|
|
889
|
-
a && s.push([a, null]);
|
|
890
|
-
const v = [];
|
|
891
|
-
for (const [f, p] of s)
|
|
892
|
-
f === p ? v.push(f) : !p && f === c[0] ? v.push("*") : p ? f === c[0] ? v.push(`<=${p}`) : v.push(`${f} - ${p}`) : v.push(`>=${f}`);
|
|
893
|
-
const n = v.join(" || "), i = typeof e.raw == "string" ? e.raw : String(e);
|
|
894
|
-
return n.length < i.length ? n : e;
|
|
895
|
-
};
|
|
896
|
-
const Ze = _(), ke = se(), { ANY: le } = ke, J = ne, Ce = j, mn = (r, e, t = {}) => {
|
|
897
|
-
if (r === e)
|
|
898
|
-
return !0;
|
|
899
|
-
r = new Ze(r, t), e = new Ze(e, t);
|
|
900
|
-
let s = !1;
|
|
901
|
-
e: for (const a of r.set) {
|
|
902
|
-
for (const o of e.set) {
|
|
903
|
-
const c = gn(a, o, t);
|
|
904
|
-
if (s = s || c !== null, c)
|
|
905
|
-
continue e;
|
|
906
|
-
}
|
|
907
|
-
if (s)
|
|
908
|
-
return !1;
|
|
909
|
-
}
|
|
910
|
-
return !0;
|
|
911
|
-
}, dn = [new ke(">=0.0.0-0")], Qe = [new ke(">=0.0.0")], gn = (r, e, t) => {
|
|
912
|
-
if (r === e)
|
|
913
|
-
return !0;
|
|
914
|
-
if (r.length === 1 && r[0].semver === le) {
|
|
915
|
-
if (e.length === 1 && e[0].semver === le)
|
|
916
|
-
return !0;
|
|
917
|
-
t.includePrerelease ? r = dn : r = Qe;
|
|
918
|
-
}
|
|
919
|
-
if (e.length === 1 && e[0].semver === le) {
|
|
920
|
-
if (t.includePrerelease)
|
|
921
|
-
return !0;
|
|
922
|
-
e = Qe;
|
|
923
|
-
}
|
|
924
|
-
const s = /* @__PURE__ */ new Set();
|
|
925
|
-
let a, o;
|
|
926
|
-
for (const E of r)
|
|
927
|
-
E.operator === ">" || E.operator === ">=" ? a = et(a, E, t) : E.operator === "<" || E.operator === "<=" ? o = tt(o, E, t) : s.add(E.semver);
|
|
928
|
-
if (s.size > 1)
|
|
929
|
-
return null;
|
|
930
|
-
let c;
|
|
931
|
-
if (a && o) {
|
|
932
|
-
if (c = Ce(a.semver, o.semver, t), c > 0)
|
|
933
|
-
return null;
|
|
934
|
-
if (c === 0 && (a.operator !== ">=" || o.operator !== "<="))
|
|
935
|
-
return null;
|
|
936
|
-
}
|
|
937
|
-
for (const E of s) {
|
|
938
|
-
if (a && !J(E, String(a), t) || o && !J(E, String(o), t))
|
|
939
|
-
return null;
|
|
940
|
-
for (const u of e)
|
|
941
|
-
if (!J(E, String(u), t))
|
|
942
|
-
return !1;
|
|
943
|
-
return !0;
|
|
944
|
-
}
|
|
945
|
-
let v, n, i, f, p = o && !t.includePrerelease && o.semver.prerelease.length ? o.semver : !1, N = a && !t.includePrerelease && a.semver.prerelease.length ? a.semver : !1;
|
|
946
|
-
p && p.prerelease.length === 1 && o.operator === "<" && p.prerelease[0] === 0 && (p = !1);
|
|
947
|
-
for (const E of e) {
|
|
948
|
-
if (f = f || E.operator === ">" || E.operator === ">=", i = i || E.operator === "<" || E.operator === "<=", a) {
|
|
949
|
-
if (N && E.semver.prerelease && E.semver.prerelease.length && E.semver.major === N.major && E.semver.minor === N.minor && E.semver.patch === N.patch && (N = !1), E.operator === ">" || E.operator === ">=") {
|
|
950
|
-
if (v = et(a, E, t), v === E && v !== a)
|
|
951
|
-
return !1;
|
|
952
|
-
} else if (a.operator === ">=" && !J(a.semver, String(E), t))
|
|
953
|
-
return !1;
|
|
954
|
-
}
|
|
955
|
-
if (o) {
|
|
956
|
-
if (p && E.semver.prerelease && E.semver.prerelease.length && E.semver.major === p.major && E.semver.minor === p.minor && E.semver.patch === p.patch && (p = !1), E.operator === "<" || E.operator === "<=") {
|
|
957
|
-
if (n = tt(o, E, t), n === E && n !== o)
|
|
958
|
-
return !1;
|
|
959
|
-
} else if (o.operator === "<=" && !J(o.semver, String(E), t))
|
|
960
|
-
return !1;
|
|
961
|
-
}
|
|
962
|
-
if (!E.operator && (o || a) && c !== 0)
|
|
963
|
-
return !1;
|
|
964
|
-
}
|
|
965
|
-
return !(a && i && !o && c !== 0 || o && f && !a && c !== 0 || N || p);
|
|
966
|
-
}, et = (r, e, t) => {
|
|
967
|
-
if (!r)
|
|
968
|
-
return e;
|
|
969
|
-
const s = Ce(r.semver, e.semver, t);
|
|
970
|
-
return s > 0 ? r : s < 0 || e.operator === ">" && r.operator === ">=" ? e : r;
|
|
971
|
-
}, tt = (r, e, t) => {
|
|
972
|
-
if (!r)
|
|
973
|
-
return e;
|
|
974
|
-
const s = Ce(r.semver, e.semver, t);
|
|
975
|
-
return s < 0 ? r : s > 0 || e.operator === "<" && r.operator === "<=" ? e : r;
|
|
976
|
-
};
|
|
977
|
-
var Rn = mn;
|
|
978
|
-
const fe = W, rt = ee, vn = F, st = dt, wn = x, In = Pr, Nn = yr, Sn = Cr, On = Dr, Ln = br, Pn = Br, An = Xr, Tn = Hr, yn = j, kn = Yr, Cn = Qr, Fn = Le, Dn = ss, jn = as, _n = re, bn = Pe, Gn = gt, Un = Rt, Bn = Ae, Vn = Te, xn = vt, Xn = Ts, Mn = se(), zn = _(), Hn = ne, Jn = _s, Wn = Bs, qn = Ms, Yn = Js, Kn = Ys, Zn = ye, Qn = on, ei = fn, ti = hn, ri = $n, si = Rn;
|
|
979
|
-
var ni = {
|
|
980
|
-
parse: wn,
|
|
981
|
-
valid: In,
|
|
982
|
-
clean: Nn,
|
|
983
|
-
inc: Sn,
|
|
984
|
-
diff: On,
|
|
985
|
-
major: Ln,
|
|
986
|
-
minor: Pn,
|
|
987
|
-
patch: An,
|
|
988
|
-
prerelease: Tn,
|
|
989
|
-
compare: yn,
|
|
990
|
-
rcompare: kn,
|
|
991
|
-
compareLoose: Cn,
|
|
992
|
-
compareBuild: Fn,
|
|
993
|
-
sort: Dn,
|
|
994
|
-
rsort: jn,
|
|
995
|
-
gt: _n,
|
|
996
|
-
lt: bn,
|
|
997
|
-
eq: Gn,
|
|
998
|
-
neq: Un,
|
|
999
|
-
gte: Bn,
|
|
1000
|
-
lte: Vn,
|
|
1001
|
-
cmp: xn,
|
|
1002
|
-
coerce: Xn,
|
|
1003
|
-
Comparator: Mn,
|
|
1004
|
-
Range: zn,
|
|
1005
|
-
satisfies: Hn,
|
|
1006
|
-
toComparators: Jn,
|
|
1007
|
-
maxSatisfying: Wn,
|
|
1008
|
-
minSatisfying: qn,
|
|
1009
|
-
minVersion: Yn,
|
|
1010
|
-
validRange: Kn,
|
|
1011
|
-
outside: Zn,
|
|
1012
|
-
gtr: Qn,
|
|
1013
|
-
ltr: ei,
|
|
1014
|
-
intersects: ti,
|
|
1015
|
-
simplifyRange: ri,
|
|
1016
|
-
subset: si,
|
|
1017
|
-
SemVer: vn,
|
|
1018
|
-
re: fe.re,
|
|
1019
|
-
src: fe.src,
|
|
1020
|
-
tokens: fe.t,
|
|
1021
|
-
SEMVER_SPEC_VERSION: rt.SEMVER_SPEC_VERSION,
|
|
1022
|
-
RELEASE_TYPES: rt.RELEASE_TYPES,
|
|
1023
|
-
compareIdentifiers: st.compareIdentifiers,
|
|
1024
|
-
rcompareIdentifiers: st.rcompareIdentifiers
|
|
1025
|
-
};
|
|
1026
|
-
const ii = /* @__PURE__ */ ur(ni), ie = "v1/";
|
|
1027
|
-
function ki(r) {
|
|
1028
|
-
return `${ie}${r.organization}/${r.package}/${r.version}`;
|
|
1029
|
-
}
|
|
1030
|
-
function It(r, e) {
|
|
1031
|
-
return `${ie}${r.organization}/${r.package}/${r.version}/${e}`;
|
|
1032
|
-
}
|
|
1033
|
-
function nt(r) {
|
|
1034
|
-
return `${ie}${r.organization}/${r.package}/overview.json`;
|
|
1035
|
-
}
|
|
1036
|
-
const ue = `${ie}overview.json`, Nt = "meta.json", de = "_updates_v1/per_package_version/";
|
|
1037
|
-
function ai(r, e) {
|
|
1038
|
-
return `${de}${r.organization}/${r.package}/${r.version}/${e}`;
|
|
1039
|
-
}
|
|
1040
|
-
const oi = /(?<packageKeyWithoutVersion>(?<organization>[^\/]+)\/(?<pkg>[^\/]+))\/(?<version>[^\/]+)\/(?<seed>[^\/]+)$/, St = "_updates_v1/_global_update_in", it = "_updates_v1/_global_update_out";
|
|
1041
|
-
class ci {
|
|
1042
|
-
constructor(e, t) {
|
|
1043
|
-
this.storage = e, this.logger = t;
|
|
1044
|
-
}
|
|
1045
|
-
constructNewPackage(e) {
|
|
1046
|
-
return new li(this.storage, e);
|
|
1047
|
-
}
|
|
1048
|
-
async updateRegistry() {
|
|
1049
|
-
var c, v, n, i, f, p, N, E;
|
|
1050
|
-
(c = this.logger) == null || c.info("Initiating registry refresh...");
|
|
1051
|
-
const e = /* @__PURE__ */ new Map(), t = [], s = await this.storage.listFiles(de);
|
|
1052
|
-
(v = this.logger) == null || v.info("Packages to be updated:");
|
|
1053
|
-
for (const u of s) {
|
|
1054
|
-
const C = u.match(oi);
|
|
1055
|
-
if (!C) continue;
|
|
1056
|
-
t.push(u);
|
|
1057
|
-
const { packageKeyWithoutVersion: T, organization: L, pkg: y, version: I, seed: X } = C.groups;
|
|
1058
|
-
let M = e.get(T);
|
|
1059
|
-
M ? M.versions.has(I) || M.versions.add(I) : e.set(T, {
|
|
1060
|
-
package: { organization: L, package: y },
|
|
1061
|
-
versions: /* @__PURE__ */ new Set([I])
|
|
1062
|
-
}), (n = this.logger) == null || n.info(` - ${L}:${y}:${I}`);
|
|
1063
|
-
}
|
|
1064
|
-
const a = await this.storage.getFile(ue);
|
|
1065
|
-
let o = a === void 0 ? [] : JSON.parse(a.toString());
|
|
1066
|
-
(i = this.logger) == null || i.info(`Global overview loaded, ${o.length} records`);
|
|
1067
|
-
for (const [, u] of e.entries()) {
|
|
1068
|
-
const C = nt(u.package), T = await this.storage.getFile(C);
|
|
1069
|
-
let L = T === void 0 ? [] : JSON.parse(T.toString());
|
|
1070
|
-
(f = this.logger) == null || f.info(
|
|
1071
|
-
`Updating ${u.package.organization}:${u.package.package} overview, ${L.length} records`
|
|
1072
|
-
), L = L.filter((y) => !u.versions.has(y.version));
|
|
1073
|
-
for (const [y] of u.versions.entries()) {
|
|
1074
|
-
const I = y.toString(), X = await this.storage.getFile(
|
|
1075
|
-
It(
|
|
1076
|
-
{
|
|
1077
|
-
...u.package,
|
|
1078
|
-
version: I
|
|
1079
|
-
},
|
|
1080
|
-
Nt
|
|
1081
|
-
)
|
|
1082
|
-
);
|
|
1083
|
-
X && L.push({ version: I, meta: JSON.parse(X.toString()) });
|
|
1084
|
-
}
|
|
1085
|
-
L.sort((y, I) => ii.compare(I.version, y.version)), await this.storage.putFile(C, Buffer.from(JSON.stringify(L))), (p = this.logger) == null || p.info(`Done (${L.length} records)`), o = o.filter(
|
|
1086
|
-
(y) => y.organization !== u.package.organization || y.package !== u.package.package
|
|
1087
|
-
), o.push({
|
|
1088
|
-
organization: u.package.organization,
|
|
1089
|
-
package: u.package.package,
|
|
1090
|
-
allVersions: L.map((y) => y.version).reverse(),
|
|
1091
|
-
latestVersion: L[0].version,
|
|
1092
|
-
latestMeta: L[0].meta
|
|
1093
|
-
});
|
|
1094
|
-
}
|
|
1095
|
-
await this.storage.putFile(ue, Buffer.from(JSON.stringify(o))), (N = this.logger) == null || N.info(`Global overview updated (${o.length} records)`), await this.storage.deleteFiles(...t.map((u) => `${de}${u}`)), (E = this.logger) == null || E.info("Version update requests cleared");
|
|
1096
|
-
}
|
|
1097
|
-
async updateIfNeeded(e = !1) {
|
|
1098
|
-
var a, o;
|
|
1099
|
-
(a = this.logger) == null || a.info("Checking if registry requires refresh...");
|
|
1100
|
-
const t = await this.storage.getFile(St), s = await this.storage.getFile(it);
|
|
1101
|
-
!e && t === void 0 && s === void 0 || !e && t !== void 0 && s !== void 0 && t.equals(s) || (await this.updateRegistry(), t && (await this.storage.putFile(it, t), (o = this.logger) == null || o.info("Refresh finished")));
|
|
1102
|
-
}
|
|
1103
|
-
async getPackageOverview(e) {
|
|
1104
|
-
const t = await this.storage.getFile(nt(e));
|
|
1105
|
-
if (t !== void 0)
|
|
1106
|
-
return JSON.parse(t.toString());
|
|
1107
|
-
}
|
|
1108
|
-
async getGlobalOverview() {
|
|
1109
|
-
const e = await this.storage.getFile(ue);
|
|
1110
|
-
if (e !== void 0)
|
|
1111
|
-
return JSON.parse(e.toString());
|
|
1112
|
-
}
|
|
1113
|
-
}
|
|
1114
|
-
class li {
|
|
1115
|
-
constructor(e, t) {
|
|
1116
|
-
q(this, "metaAdded", !1);
|
|
1117
|
-
q(this, "seed", Xt());
|
|
1118
|
-
this.storage = e, this.name = t;
|
|
1119
|
-
}
|
|
1120
|
-
async addFile(e, t) {
|
|
1121
|
-
await this.storage.putFile(It(this.name, e), t);
|
|
1122
|
-
}
|
|
1123
|
-
async writeMeta(e) {
|
|
1124
|
-
await this.addFile(Nt, Buffer.from(JSON.stringify(e))), this.metaAdded = !0;
|
|
1125
|
-
}
|
|
1126
|
-
async finish() {
|
|
1127
|
-
if (!this.metaAdded) throw new Error("meta not added");
|
|
1128
|
-
await this.storage.putFile(ai(this.name, this.seed), Buffer.of(0)), await this.storage.putFile(St, Buffer.from(this.seed));
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
class fi {
|
|
1132
|
-
constructor(e, t, s) {
|
|
1133
|
-
this.client = e, this.bucket = t, this.root = s;
|
|
1134
|
-
}
|
|
1135
|
-
async getFile(e) {
|
|
1136
|
-
try {
|
|
1137
|
-
return Buffer.from(
|
|
1138
|
-
await (await this.client.getObject({
|
|
1139
|
-
Bucket: this.bucket,
|
|
1140
|
-
Key: G.join(this.root, e)
|
|
1141
|
-
})).Body.transformToByteArray()
|
|
1142
|
-
);
|
|
1143
|
-
} catch (t) {
|
|
1144
|
-
if (t.name === "NoSuchKey") return;
|
|
1145
|
-
throw t;
|
|
1146
|
-
}
|
|
1147
|
-
}
|
|
1148
|
-
async listFiles(e) {
|
|
1149
|
-
const t = G.join(this.root, e), s = zt(
|
|
1150
|
-
{ client: this.client },
|
|
1151
|
-
{
|
|
1152
|
-
Bucket: this.bucket,
|
|
1153
|
-
Prefix: t
|
|
1154
|
-
}
|
|
1155
|
-
), a = [];
|
|
1156
|
-
for await (const o of s)
|
|
1157
|
-
a.push(...o.Contents.map((c) => G.relative(t, c.Key)));
|
|
1158
|
-
return a;
|
|
1159
|
-
}
|
|
1160
|
-
async putFile(e, t) {
|
|
1161
|
-
await this.client.putObject({
|
|
1162
|
-
Bucket: this.bucket,
|
|
1163
|
-
Key: G.join(this.root, e),
|
|
1164
|
-
Body: t
|
|
1165
|
-
});
|
|
1166
|
-
}
|
|
1167
|
-
async deleteFiles(...e) {
|
|
1168
|
-
const t = await this.client.deleteObjects({
|
|
1169
|
-
Bucket: this.bucket,
|
|
1170
|
-
Delete: {
|
|
1171
|
-
Objects: e.map((s) => ({
|
|
1172
|
-
Key: G.join(this.root, s)
|
|
1173
|
-
}))
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
if (t.Errors !== void 0 && t.Errors.length > 0)
|
|
1177
|
-
throw new Error(`Errors encountered while deleting files: ${t.Errors.join(`
|
|
1178
|
-
`)}`);
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
class ui {
|
|
1182
|
-
constructor(e) {
|
|
1183
|
-
/** Absolute path */
|
|
1184
|
-
q(this, "root");
|
|
1185
|
-
this.root = k.resolve(e);
|
|
1186
|
-
}
|
|
1187
|
-
toAbsolutePath(e) {
|
|
1188
|
-
if (G.isAbsolute(e)) throw new Error("absolute path");
|
|
1189
|
-
return k.resolve(this.root, e.split(G.sep).join(k.sep));
|
|
1190
|
-
}
|
|
1191
|
-
async getFile(e) {
|
|
1192
|
-
try {
|
|
1193
|
-
return await H.promises.readFile(this.toAbsolutePath(e));
|
|
1194
|
-
} catch (t) {
|
|
1195
|
-
if (t.code == "ENOENT") return;
|
|
1196
|
-
throw new Error("", { cause: t });
|
|
1197
|
-
}
|
|
1198
|
-
}
|
|
1199
|
-
async listFiles(e) {
|
|
1200
|
-
try {
|
|
1201
|
-
const t = this.toAbsolutePath(e);
|
|
1202
|
-
return (await H.promises.readdir(t, { recursive: !0, withFileTypes: !0 })).filter((s) => s.isFile()).map(
|
|
1203
|
-
(s) => k.relative(t, k.resolve(s.path, s.name)).split(k.sep).join(G.sep)
|
|
1204
|
-
);
|
|
1205
|
-
} catch (t) {
|
|
1206
|
-
if (t.code == "ENOENT") return [];
|
|
1207
|
-
throw new Error("", { cause: t });
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1210
|
-
async putFile(e, t) {
|
|
1211
|
-
const s = this.toAbsolutePath(e);
|
|
1212
|
-
await H.promises.mkdir(k.dirname(s), { recursive: !0 }), await H.promises.writeFile(s, t);
|
|
1213
|
-
}
|
|
1214
|
-
async deleteFiles(...e) {
|
|
1215
|
-
for (const t of e) await H.promises.rm(this.toAbsolutePath(t));
|
|
1216
|
-
}
|
|
1217
|
-
}
|
|
1218
|
-
function hi(r) {
|
|
1219
|
-
const e = new URL(r, `file:${k.resolve(".").split(k.sep).join(G.sep)}/`);
|
|
1220
|
-
switch (e.protocol) {
|
|
1221
|
-
case "file:":
|
|
1222
|
-
const t = k.resolve(e.pathname);
|
|
1223
|
-
return new ui(t);
|
|
1224
|
-
case "s3:":
|
|
1225
|
-
const s = {}, a = e.searchParams.get("region");
|
|
1226
|
-
a && (s.region = a);
|
|
1227
|
-
const o = e.hostname;
|
|
1228
|
-
return new fi(new Mt(s), o, e.pathname.replace(/^\//, ""));
|
|
1229
|
-
default:
|
|
1230
|
-
throw new Error(`Unknown protocol: ${e.protocol}`);
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
function U(r, e) {
|
|
1234
|
-
return e === void 0 ? r : {
|
|
1235
|
-
...r,
|
|
1236
|
-
...e,
|
|
1237
|
-
registries: { ...r.registries, ...e.registries },
|
|
1238
|
-
files: { ...r.files, ...e.files }
|
|
1239
|
-
};
|
|
1240
|
-
}
|
|
1241
|
-
async function he(r) {
|
|
1242
|
-
return Ne(r, (e) => Se.parse(JSON.parse(e.toString())));
|
|
1243
|
-
}
|
|
1244
|
-
async function pe(r) {
|
|
1245
|
-
return Ne(r, (e) => Se.parse(xt.parse(e.toString())));
|
|
1246
|
-
}
|
|
1247
|
-
async function pi() {
|
|
1248
|
-
let r = Se.parse({});
|
|
1249
|
-
return r = U(r, await he("./.pl.reg.json")), r = U(r, await pe("./.pl.reg.yaml")), r = U(r, await he(`${De.homedir()}/.pl.reg.json`)), r = U(r, await pe(`${De.homedir()}/.pl.reg.yaml`)), r = U(r, await he(lr)), r = U(r, await pe(fr)), r;
|
|
1250
|
-
}
|
|
1251
|
-
class Ei {
|
|
1252
|
-
constructor(e) {
|
|
1253
|
-
this.conf = e;
|
|
1254
|
-
}
|
|
1255
|
-
createRegistry(e) {
|
|
1256
|
-
let t = this.conf.registry;
|
|
1257
|
-
if (!t.startsWith("file:") && !t.startsWith("s3:")) {
|
|
1258
|
-
const s = this.conf.registries[t];
|
|
1259
|
-
if (!s) throw new Error(`Registry with alias "${t}" not found`);
|
|
1260
|
-
t = s;
|
|
1261
|
-
}
|
|
1262
|
-
return new ci(hi(t), e);
|
|
1263
|
-
}
|
|
1264
|
-
get fullPackageName() {
|
|
1265
|
-
return {
|
|
1266
|
-
organization: this.conf.organization,
|
|
1267
|
-
package: this.conf.package,
|
|
1268
|
-
version: this.conf.version
|
|
1269
|
-
};
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
async function Ci(r) {
|
|
1273
|
-
const e = await pi();
|
|
1274
|
-
return new Ei(
|
|
1275
|
-
Et.parse(U(e, r))
|
|
1276
|
-
);
|
|
1277
|
-
}
|
|
1278
|
-
export {
|
|
1279
|
-
Ee as A,
|
|
1280
|
-
Pi as B,
|
|
1281
|
-
Yt as C,
|
|
1282
|
-
_e as D,
|
|
1283
|
-
$e as E,
|
|
1284
|
-
pt as F,
|
|
1285
|
-
ue as G,
|
|
1286
|
-
Ti as H,
|
|
1287
|
-
Nt as M,
|
|
1288
|
-
Se as P,
|
|
1289
|
-
ut as R,
|
|
1290
|
-
Qt as a,
|
|
1291
|
-
yi as b,
|
|
1292
|
-
Ai as c,
|
|
1293
|
-
or as d,
|
|
1294
|
-
lr as e,
|
|
1295
|
-
fr as f,
|
|
1296
|
-
Ci as g,
|
|
1297
|
-
cr as h,
|
|
1298
|
-
Et as i,
|
|
1299
|
-
Ei as j,
|
|
1300
|
-
nt as k,
|
|
1301
|
-
ir as l,
|
|
1302
|
-
It as m,
|
|
1303
|
-
tr as n,
|
|
1304
|
-
ht as o,
|
|
1305
|
-
ki as p,
|
|
1306
|
-
rr as q,
|
|
1307
|
-
sr as r,
|
|
1308
|
-
Kt as s,
|
|
1309
|
-
Zt as t,
|
|
1310
|
-
Li as u,
|
|
1311
|
-
Ht as v,
|
|
1312
|
-
Jt as w,
|
|
1313
|
-
je as x,
|
|
1314
|
-
Wt as y,
|
|
1315
|
-
qt as z
|
|
1316
|
-
};
|
|
1317
|
-
//# sourceMappingURL=config-Br5DwFuM.mjs.map
|