varlock 0.5.0 → 0.6.1
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 +1 -1
- package/dist/auto-load.js +6 -6
- package/dist/{chunk-FR2ITGSD.js → chunk-2AGKN64R.js} +562 -248
- package/dist/chunk-2AGKN64R.js.map +1 -0
- package/dist/{chunk-I4RF33CD.js → chunk-3J7BFRB4.js} +372 -446
- package/dist/chunk-3J7BFRB4.js.map +1 -0
- package/dist/{chunk-NJ4ZGNLG.js → chunk-4JMFWK65.js} +5 -5
- package/dist/{chunk-NJ4ZGNLG.js.map → chunk-4JMFWK65.js.map} +1 -1
- package/dist/{chunk-TYIS6T2T.js → chunk-BC7LU4LG.js} +3 -3
- package/dist/{chunk-TYIS6T2T.js.map → chunk-BC7LU4LG.js.map} +1 -1
- package/dist/chunk-EXG5VPNZ.js +17 -0
- package/dist/chunk-EXG5VPNZ.js.map +1 -0
- package/dist/{chunk-PESGXOZ7.js → chunk-FYZ7LKLX.js} +27 -7
- package/dist/chunk-FYZ7LKLX.js.map +1 -0
- package/dist/{chunk-BMTZBDMN.js → chunk-G7FDCTNA.js} +8 -8
- package/dist/{chunk-BMTZBDMN.js.map → chunk-G7FDCTNA.js.map} +1 -1
- package/dist/{chunk-WAMBVZL2.js → chunk-IMB5QAZS.js} +38 -16
- package/dist/chunk-IMB5QAZS.js.map +1 -0
- package/dist/{chunk-2VSWBSVA.js → chunk-J7PA7B2U.js} +6 -81
- package/dist/chunk-J7PA7B2U.js.map +1 -0
- package/dist/{chunk-5XPR4NFR.js → chunk-JCJISIY6.js} +6 -6
- package/dist/{chunk-5XPR4NFR.js.map → chunk-JCJISIY6.js.map} +1 -1
- package/dist/{chunk-RTP55TZC.js → chunk-KKNNZWYD.js} +3 -3
- package/dist/{chunk-RTP55TZC.js.map → chunk-KKNNZWYD.js.map} +1 -1
- package/dist/{chunk-YWFNGAPT.js → chunk-KZNJYMRJ.js} +6 -6
- package/dist/{chunk-YWFNGAPT.js.map → chunk-KZNJYMRJ.js.map} +1 -1
- package/dist/{chunk-QQDWRXNU.js → chunk-LVZSZAKN.js} +3 -3
- package/dist/{chunk-QQDWRXNU.js.map → chunk-LVZSZAKN.js.map} +1 -1
- package/dist/{chunk-ZXJ4CEDK.js → chunk-MYHVSJ3X.js} +3 -3
- package/dist/{chunk-ZXJ4CEDK.js.map → chunk-MYHVSJ3X.js.map} +1 -1
- package/dist/{chunk-PZ7V7FPH.js → chunk-NPPZVF24.js} +4 -4
- package/dist/{chunk-PZ7V7FPH.js.map → chunk-NPPZVF24.js.map} +1 -1
- package/dist/{chunk-YO6TXNLA.js → chunk-PMBDCWD5.js} +6 -5
- package/dist/chunk-PMBDCWD5.js.map +1 -0
- package/dist/chunk-TLEEAUD7.js +68 -0
- package/dist/chunk-TLEEAUD7.js.map +1 -0
- package/dist/{chunk-Z4WJ7TLU.js → chunk-UVWLW5KD.js} +6 -6
- package/dist/{chunk-Z4WJ7TLU.js.map → chunk-UVWLW5KD.js.map} +1 -1
- package/dist/{chunk-MIBOBKI4.js → chunk-XLYSNOR3.js} +15 -3
- package/dist/chunk-XLYSNOR3.js.map +1 -0
- package/dist/{chunk-QC5HUCNV.js → chunk-ZLAUDWOL.js} +6 -6
- package/dist/{chunk-QC5HUCNV.js.map → chunk-ZLAUDWOL.js.map} +1 -1
- package/dist/cli/cli-executable.js +24 -24
- package/dist/cli/cli-executable.js.map +1 -1
- package/dist/config-item-NO5PKZRH.js +5 -0
- package/dist/{config-item-HIXQLW6F.js.map → config-item-NO5PKZRH.js.map} +1 -1
- package/dist/dotenv-compat.js +6 -6
- package/dist/{env-graph-BhsVU8Ff.d.ts → env-graph-Cz_c5P6Y.d.ts} +22 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +11 -11
- package/dist/init.command-AV4EWYIT.js +12 -0
- package/dist/{init.command-RB2RCZ55.js.map → init.command-AV4EWYIT.js.map} +1 -1
- package/dist/load.command-5JQUW3H7.js +11 -0
- package/dist/{load.command-JQTHKY6V.js.map → load.command-5JQUW3H7.js.map} +1 -1
- package/dist/plugin-lib.d.ts +2 -2
- package/dist/printenv.command-SBB6GVC2.js +12 -0
- package/dist/{printenv.command-OVRM4WEM.js.map → printenv.command-SBB6GVC2.js.map} +1 -1
- package/dist/run.command-HTGTG6ER.js +12 -0
- package/dist/{run.command-NOA2YFUR.js.map → run.command-HTGTG6ER.js.map} +1 -1
- package/dist/runtime/env.d.ts +7 -2
- package/dist/runtime/env.js +2 -2
- package/dist/runtime/init-edge.cjs +297 -0
- package/dist/runtime/init-edge.d.cts +1 -0
- package/dist/runtime/init-server.cjs +370 -0
- package/dist/runtime/init-server.d.cts +20 -0
- package/dist/runtime/patch-console.js +3 -3
- package/dist/runtime/patch-response.js +3 -3
- package/dist/runtime/patch-server-response.js +3 -3
- package/dist/scan.command-ADKVWN5T.js +13 -0
- package/dist/{scan.command-64YQENRC.js.map → scan.command-ADKVWN5T.js.map} +1 -1
- package/dist/telemetry.command-CQFTGXPF.js +11 -0
- package/dist/{telemetry.command-VSKBB3B6.js.map → telemetry.command-CQFTGXPF.js.map} +1 -1
- package/dist/typegen.command-A544SFYM.js +12 -0
- package/dist/{typegen.command-TQ35B6WK.js.map → typegen.command-A544SFYM.js.map} +1 -1
- package/package.json +11 -1
- package/dist/chunk-2VSWBSVA.js.map +0 -1
- package/dist/chunk-4SXLKBVL.js +0 -17
- package/dist/chunk-4SXLKBVL.js.map +0 -1
- package/dist/chunk-FR2ITGSD.js.map +0 -1
- package/dist/chunk-I4RF33CD.js.map +0 -1
- package/dist/chunk-MIBOBKI4.js.map +0 -1
- package/dist/chunk-PESGXOZ7.js.map +0 -1
- package/dist/chunk-UHUZMCOL.js +0 -156
- package/dist/chunk-UHUZMCOL.js.map +0 -1
- package/dist/chunk-WAMBVZL2.js.map +0 -1
- package/dist/chunk-YO6TXNLA.js.map +0 -1
- package/dist/config-item-HIXQLW6F.js +0 -5
- package/dist/init.command-RB2RCZ55.js +0 -12
- package/dist/load.command-JQTHKY6V.js +0 -11
- package/dist/printenv.command-OVRM4WEM.js +0 -12
- package/dist/run.command-NOA2YFUR.js +0 -12
- package/dist/scan.command-64YQENRC.js +0 -13
- package/dist/telemetry.command-VSKBB3B6.js +0 -11
- package/dist/typegen.command-TQ35B6WK.js +0 -12
|
@@ -1,16 +1,86 @@
|
|
|
1
1
|
import { createDebug } from './chunk-QZ6HBRJC.js';
|
|
2
2
|
import { __commonJS, __name, __toESM } from './chunk-6PEHRAEP.js';
|
|
3
|
-
import
|
|
4
|
-
import
|
|
3
|
+
import path2, { join } from 'path';
|
|
4
|
+
import fs2, { access } from 'fs/promises';
|
|
5
5
|
import os from 'os';
|
|
6
|
-
import
|
|
6
|
+
import fs4, { accessSync, existsSync } from 'fs';
|
|
7
7
|
import { exec } from 'child_process';
|
|
8
8
|
import { promisify } from 'util';
|
|
9
9
|
import { createRequire } from 'module';
|
|
10
|
-
import { pathToFileURL } from 'url';
|
|
11
10
|
import crypto from 'crypto';
|
|
12
11
|
import https from 'https';
|
|
13
|
-
import
|
|
12
|
+
import { AsyncLocalStorage } from 'async_hooks';
|
|
13
|
+
|
|
14
|
+
// ../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs
|
|
15
|
+
var require_ansis = __commonJS({
|
|
16
|
+
"../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.cjs"(exports$1, module) {
|
|
17
|
+
var e;
|
|
18
|
+
var t;
|
|
19
|
+
var r;
|
|
20
|
+
var { defineProperty: l, setPrototypeOf: n, create: o, keys: s } = Object;
|
|
21
|
+
var i = "";
|
|
22
|
+
var { round: c, max: a2 } = Math;
|
|
23
|
+
var p = /* @__PURE__ */ __name((e2) => {
|
|
24
|
+
let t2 = /([a-f\d]{3,6})/i.exec(e2)?.[1], r2 = t2?.length, l2 = parseInt(6 ^ r2 ? 3 ^ r2 ? "0" : t2[0] + t2[0] + t2[1] + t2[1] + t2[2] + t2[2] : t2, 16);
|
|
25
|
+
return [l2 >> 16 & 255, l2 >> 8 & 255, 255 & l2];
|
|
26
|
+
}, "p");
|
|
27
|
+
var u = /* @__PURE__ */ __name((e2, t2, r2) => e2 ^ t2 || t2 ^ r2 ? 16 + 36 * c(e2 / 51) + 6 * c(t2 / 51) + c(r2 / 51) : 8 > e2 ? 16 : e2 > 248 ? 231 : c(24 * (e2 - 8) / 247) + 232, "u");
|
|
28
|
+
var d = /* @__PURE__ */ __name((e2) => {
|
|
29
|
+
let t2, r2, l2, n2, o2;
|
|
30
|
+
return 8 > e2 ? 30 + e2 : 16 > e2 ? e2 - 8 + 90 : (232 > e2 ? (o2 = (e2 -= 16) % 36, t2 = (e2 / 36 | 0) / 5, r2 = (o2 / 6 | 0) / 5, l2 = o2 % 6 / 5) : t2 = r2 = l2 = (10 * (e2 - 232) + 8) / 255, n2 = 2 * a2(t2, r2, l2), n2 ? 30 + (c(l2) << 2 | c(r2) << 1 | c(t2)) + (2 ^ n2 ? 0 : 60) : 30);
|
|
31
|
+
}, "d");
|
|
32
|
+
var f = (() => {
|
|
33
|
+
let r2 = /* @__PURE__ */ __name((e2) => o2.some(((t2) => e2.test(t2))), "r"), l2 = globalThis, n2 = l2.process ?? {}, o2 = n2.argv ?? [], i2 = n2.env ?? {}, c2 = -1;
|
|
34
|
+
try {
|
|
35
|
+
e = "," + s(i2).join(",");
|
|
36
|
+
} catch (e2) {
|
|
37
|
+
i2 = {}, c2 = 0;
|
|
38
|
+
}
|
|
39
|
+
let a3 = "FORCE_COLOR", p2 = { false: 0, 0: 0, 1: 1, 2: 2, 3: 3 }[i2[a3]] ?? -1, u2 = a3 in i2 && p2 || r2(/^--color=?(true|always)?$/);
|
|
40
|
+
return u2 && (c2 = p2), ~c2 || (c2 = ((r3, l3, n3) => (t = r3.TERM, { "24bit": 3, truecolor: 3, ansi256: 2, ansi: 1 }[r3.COLORTERM] || (r3.CI ? /,GITHUB/.test(e) ? 3 : 1 : l3 && "dumb" !== t ? n3 ? 3 : /-256/.test(t) ? 2 : 1 : 0)))(i2, !!i2.PM2_HOME || i2.NEXT_RUNTIME?.includes("edge") || !!n2.stdout?.isTTY, "win32" === n2.platform)), !p2 || i2.NO_COLOR || r2(/^--(no-color|color=(false|never))$/) ? 0 : l2.window?.chrome || u2 && !c2 ? 3 : c2;
|
|
41
|
+
})();
|
|
42
|
+
var g = { open: i, close: i };
|
|
43
|
+
var h = 39;
|
|
44
|
+
var b = 49;
|
|
45
|
+
var O = {};
|
|
46
|
+
var m = /* @__PURE__ */ __name(({ p: e2 }, { open: t2, close: l2 }) => {
|
|
47
|
+
let o2 = /* @__PURE__ */ __name((e3, ...r2) => {
|
|
48
|
+
if (!e3) {
|
|
49
|
+
if (t2 && t2 === l2) return t2;
|
|
50
|
+
if ((e3 ?? i) === i) return i;
|
|
51
|
+
}
|
|
52
|
+
let n2, s3 = e3.raw ? String.raw({ raw: e3 }, ...r2) : i + e3, c3 = o2.p, a3 = c3.o, p2 = c3.c;
|
|
53
|
+
if (s3.includes("\x1B")) for (; c3; c3 = c3.p) {
|
|
54
|
+
let { open: e4, close: t3 } = c3, r3 = t3.length, l3 = i, o3 = 0;
|
|
55
|
+
if (r3) for (; ~(n2 = s3.indexOf(t3, o3)); o3 = n2 + r3) l3 += s3.slice(o3, n2) + e4;
|
|
56
|
+
s3 = l3 + s3.slice(o3);
|
|
57
|
+
}
|
|
58
|
+
return a3 + (s3.includes("\n") ? s3.replace(/(\r?\n)/g, p2 + "$1" + a3) : s3) + p2;
|
|
59
|
+
}, "o"), s2 = t2, c2 = l2;
|
|
60
|
+
return e2 && (s2 = e2.o + t2, c2 = l2 + e2.c), n(o2, r), o2.p = { open: t2, close: l2, o: s2, c: c2, p: e2 }, o2.open = s2, o2.close = c2, o2;
|
|
61
|
+
}, "m");
|
|
62
|
+
var w = new (/* @__PURE__ */ __name(function e2(t2 = f) {
|
|
63
|
+
let s2 = { Ansis: e2, level: t2, isSupported: /* @__PURE__ */ __name(() => a3, "isSupported"), strip: /* @__PURE__ */ __name((e3) => e3.replace(/[][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, i), "strip"), extend(e3) {
|
|
64
|
+
for (let t3 in e3) {
|
|
65
|
+
let r2 = e3[t3], l2 = (typeof r2)[0];
|
|
66
|
+
"s" === l2 ? (c2(t3, T(...p(r2))), c2(_3(t3), v(...p(r2)))) : c2(t3, r2, "f" === l2);
|
|
67
|
+
}
|
|
68
|
+
return r = o({}, O), n(s2, r), s2;
|
|
69
|
+
} }, c2 = /* @__PURE__ */ __name((e3, t3, r2) => {
|
|
70
|
+
O[e3] = { get() {
|
|
71
|
+
let n2 = r2 ? (...e4) => m(this, t3(...e4)) : m(this, t3);
|
|
72
|
+
return l(this, e3, { value: n2 }), n2;
|
|
73
|
+
} };
|
|
74
|
+
}, "c"), a3 = t2 > 0, w2 = /* @__PURE__ */ __name((e3, t3) => a3 ? { open: `\x1B[${e3}m`, close: `\x1B[${t3}m` } : g, "w"), y = /* @__PURE__ */ __name((e3) => (t3) => e3(...p(t3)), "y"), R = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(`${e3}8;2;${r2};${l2};${n2}`, t3), "R"), $ = /* @__PURE__ */ __name((e3, t3) => (r2, l2, n2) => w2(((e4, t4, r3) => d(u(e4, t4, r3)))(r2, l2, n2) + e3, t3), "$"), x = /* @__PURE__ */ __name((e3) => (t3, r2, l2) => e3(u(t3, r2, l2)), "x"), T = R(3, h), v = R(4, b), C = /* @__PURE__ */ __name((e3) => w2("38;5;" + e3, h), "C"), E = /* @__PURE__ */ __name((e3) => w2("48;5;" + e3, b), "E");
|
|
75
|
+
2 === t2 ? (T = x(C), v = x(E)) : 1 === t2 && (T = $(0, h), v = $(10, b), C = /* @__PURE__ */ __name((e3) => w2(d(e3), h), "C"), E = /* @__PURE__ */ __name((e3) => w2(d(e3) + 10, b), "E"));
|
|
76
|
+
let M, I = { fg: C, bg: E, rgb: T, bgRgb: v, hex: y(T), bgHex: y(v), visible: g, reset: w2(0, 0), bold: w2(1, 22), dim: w2(2, 22), italic: w2(3, 23), underline: w2(4, 24), inverse: w2(7, 27), hidden: w2(8, 28), strikethrough: w2(9, 29) }, _3 = /* @__PURE__ */ __name((e3) => "bg" + e3[0].toUpperCase() + e3.slice(1), "_"), k = "Bright";
|
|
77
|
+
return "black,red,green,yellow,blue,magenta,cyan,white,gray".split(",").map(((e3, t3) => {
|
|
78
|
+
M = _3(e3), 8 > t3 ? (I[e3 + k] = w2(90 + t3, h), I[M + k] = w2(100 + t3, b)) : t3 = 60, I[e3] = w2(30 + t3, h), I[M] = w2(40 + t3, b);
|
|
79
|
+
})), s2.extend(I);
|
|
80
|
+
}, "e"))();
|
|
81
|
+
module.exports = w, w.default = w;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
14
84
|
|
|
15
85
|
// ../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/constants.js
|
|
16
86
|
var require_constants = __commonJS({
|
|
@@ -46,9 +116,9 @@ var require_constants = __commonJS({
|
|
|
46
116
|
// ../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/debug.js
|
|
47
117
|
var require_debug = __commonJS({
|
|
48
118
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/debug.js"(exports$1, module) {
|
|
49
|
-
var
|
|
119
|
+
var debug2 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
|
|
50
120
|
};
|
|
51
|
-
module.exports =
|
|
121
|
+
module.exports = debug2;
|
|
52
122
|
}
|
|
53
123
|
});
|
|
54
124
|
|
|
@@ -60,7 +130,7 @@ var require_re = __commonJS({
|
|
|
60
130
|
MAX_SAFE_BUILD_LENGTH,
|
|
61
131
|
MAX_LENGTH
|
|
62
132
|
} = require_constants();
|
|
63
|
-
var
|
|
133
|
+
var debug2 = require_debug();
|
|
64
134
|
exports$1 = module.exports = {};
|
|
65
135
|
var re = exports$1.re = [];
|
|
66
136
|
var safeRe = exports$1.safeRe = [];
|
|
@@ -83,7 +153,7 @@ var require_re = __commonJS({
|
|
|
83
153
|
var createToken = /* @__PURE__ */ __name((name, value, isGlobal) => {
|
|
84
154
|
const safe = makeSafeRegex(value);
|
|
85
155
|
const index = R++;
|
|
86
|
-
|
|
156
|
+
debug2(name, index, value);
|
|
87
157
|
t[name] = index;
|
|
88
158
|
src[index] = value;
|
|
89
159
|
safeSrc[index] = safe;
|
|
@@ -161,19 +231,19 @@ var require_parse_options = __commonJS({
|
|
|
161
231
|
var require_identifiers = __commonJS({
|
|
162
232
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/internal/identifiers.js"(exports$1, module) {
|
|
163
233
|
var numeric = /^[0-9]+$/;
|
|
164
|
-
var compareIdentifiers = /* @__PURE__ */ __name((
|
|
165
|
-
if (typeof
|
|
166
|
-
return
|
|
234
|
+
var compareIdentifiers = /* @__PURE__ */ __name((a2, b) => {
|
|
235
|
+
if (typeof a2 === "number" && typeof b === "number") {
|
|
236
|
+
return a2 === b ? 0 : a2 < b ? -1 : 1;
|
|
167
237
|
}
|
|
168
|
-
const anum = numeric.test(
|
|
238
|
+
const anum = numeric.test(a2);
|
|
169
239
|
const bnum = numeric.test(b);
|
|
170
240
|
if (anum && bnum) {
|
|
171
|
-
|
|
241
|
+
a2 = +a2;
|
|
172
242
|
b = +b;
|
|
173
243
|
}
|
|
174
|
-
return
|
|
244
|
+
return a2 === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b ? -1 : 1;
|
|
175
245
|
}, "compareIdentifiers");
|
|
176
|
-
var rcompareIdentifiers = /* @__PURE__ */ __name((
|
|
246
|
+
var rcompareIdentifiers = /* @__PURE__ */ __name((a2, b) => compareIdentifiers(b, a2), "rcompareIdentifiers");
|
|
177
247
|
module.exports = {
|
|
178
248
|
compareIdentifiers,
|
|
179
249
|
rcompareIdentifiers
|
|
@@ -184,7 +254,7 @@ var require_identifiers = __commonJS({
|
|
|
184
254
|
// ../../node_modules/.bun/semver@7.7.4/node_modules/semver/classes/semver.js
|
|
185
255
|
var require_semver = __commonJS({
|
|
186
256
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/classes/semver.js"(exports$1, module) {
|
|
187
|
-
var
|
|
257
|
+
var debug2 = require_debug();
|
|
188
258
|
var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
189
259
|
var { safeRe: re, t } = require_re();
|
|
190
260
|
var parseOptions = require_parse_options();
|
|
@@ -209,7 +279,7 @@ var require_semver = __commonJS({
|
|
|
209
279
|
`version is longer than ${MAX_LENGTH} characters`
|
|
210
280
|
);
|
|
211
281
|
}
|
|
212
|
-
|
|
282
|
+
debug2("SemVer", version, options);
|
|
213
283
|
this.options = options;
|
|
214
284
|
this.loose = !!options.loose;
|
|
215
285
|
this.includePrerelease = !!options.includePrerelease;
|
|
@@ -257,7 +327,7 @@ var require_semver = __commonJS({
|
|
|
257
327
|
return this.version;
|
|
258
328
|
}
|
|
259
329
|
compare(other) {
|
|
260
|
-
|
|
330
|
+
debug2("SemVer.compare", this.version, this.options, other);
|
|
261
331
|
if (!(other instanceof _SemVer)) {
|
|
262
332
|
if (typeof other === "string" && other === this.version) {
|
|
263
333
|
return 0;
|
|
@@ -306,19 +376,19 @@ var require_semver = __commonJS({
|
|
|
306
376
|
}
|
|
307
377
|
let i = 0;
|
|
308
378
|
do {
|
|
309
|
-
const
|
|
379
|
+
const a2 = this.prerelease[i];
|
|
310
380
|
const b = other.prerelease[i];
|
|
311
|
-
|
|
312
|
-
if (
|
|
381
|
+
debug2("prerelease compare", i, a2, b);
|
|
382
|
+
if (a2 === void 0 && b === void 0) {
|
|
313
383
|
return 0;
|
|
314
384
|
} else if (b === void 0) {
|
|
315
385
|
return 1;
|
|
316
|
-
} else if (
|
|
386
|
+
} else if (a2 === void 0) {
|
|
317
387
|
return -1;
|
|
318
|
-
} else if (
|
|
388
|
+
} else if (a2 === b) {
|
|
319
389
|
continue;
|
|
320
390
|
} else {
|
|
321
|
-
return compareIdentifiers(
|
|
391
|
+
return compareIdentifiers(a2, b);
|
|
322
392
|
}
|
|
323
393
|
} while (++i);
|
|
324
394
|
}
|
|
@@ -328,19 +398,19 @@ var require_semver = __commonJS({
|
|
|
328
398
|
}
|
|
329
399
|
let i = 0;
|
|
330
400
|
do {
|
|
331
|
-
const
|
|
401
|
+
const a2 = this.build[i];
|
|
332
402
|
const b = other.build[i];
|
|
333
|
-
|
|
334
|
-
if (
|
|
403
|
+
debug2("build compare", i, a2, b);
|
|
404
|
+
if (a2 === void 0 && b === void 0) {
|
|
335
405
|
return 0;
|
|
336
406
|
} else if (b === void 0) {
|
|
337
407
|
return 1;
|
|
338
|
-
} else if (
|
|
408
|
+
} else if (a2 === void 0) {
|
|
339
409
|
return -1;
|
|
340
|
-
} else if (
|
|
410
|
+
} else if (a2 === b) {
|
|
341
411
|
continue;
|
|
342
412
|
} else {
|
|
343
|
-
return compareIdentifiers(
|
|
413
|
+
return compareIdentifiers(a2, b);
|
|
344
414
|
}
|
|
345
415
|
} while (++i);
|
|
346
416
|
}
|
|
@@ -577,7 +647,7 @@ var require_diff = __commonJS({
|
|
|
577
647
|
var require_major = __commonJS({
|
|
578
648
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/major.js"(exports$1, module) {
|
|
579
649
|
var SemVer = require_semver();
|
|
580
|
-
var major = /* @__PURE__ */ __name((
|
|
650
|
+
var major = /* @__PURE__ */ __name((a2, loose) => new SemVer(a2, loose).major, "major");
|
|
581
651
|
module.exports = major;
|
|
582
652
|
}
|
|
583
653
|
});
|
|
@@ -586,7 +656,7 @@ var require_major = __commonJS({
|
|
|
586
656
|
var require_minor = __commonJS({
|
|
587
657
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/minor.js"(exports$1, module) {
|
|
588
658
|
var SemVer = require_semver();
|
|
589
|
-
var minor = /* @__PURE__ */ __name((
|
|
659
|
+
var minor = /* @__PURE__ */ __name((a2, loose) => new SemVer(a2, loose).minor, "minor");
|
|
590
660
|
module.exports = minor;
|
|
591
661
|
}
|
|
592
662
|
});
|
|
@@ -595,7 +665,7 @@ var require_minor = __commonJS({
|
|
|
595
665
|
var require_patch = __commonJS({
|
|
596
666
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/patch.js"(exports$1, module) {
|
|
597
667
|
var SemVer = require_semver();
|
|
598
|
-
var patch = /* @__PURE__ */ __name((
|
|
668
|
+
var patch = /* @__PURE__ */ __name((a2, loose) => new SemVer(a2, loose).patch, "patch");
|
|
599
669
|
module.exports = patch;
|
|
600
670
|
}
|
|
601
671
|
});
|
|
@@ -616,7 +686,7 @@ var require_prerelease = __commonJS({
|
|
|
616
686
|
var require_compare = __commonJS({
|
|
617
687
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/compare.js"(exports$1, module) {
|
|
618
688
|
var SemVer = require_semver();
|
|
619
|
-
var compare = /* @__PURE__ */ __name((
|
|
689
|
+
var compare = /* @__PURE__ */ __name((a2, b, loose) => new SemVer(a2, loose).compare(new SemVer(b, loose)), "compare");
|
|
620
690
|
module.exports = compare;
|
|
621
691
|
}
|
|
622
692
|
});
|
|
@@ -625,7 +695,7 @@ var require_compare = __commonJS({
|
|
|
625
695
|
var require_rcompare = __commonJS({
|
|
626
696
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/rcompare.js"(exports$1, module) {
|
|
627
697
|
var compare = require_compare();
|
|
628
|
-
var rcompare = /* @__PURE__ */ __name((
|
|
698
|
+
var rcompare = /* @__PURE__ */ __name((a2, b, loose) => compare(b, a2, loose), "rcompare");
|
|
629
699
|
module.exports = rcompare;
|
|
630
700
|
}
|
|
631
701
|
});
|
|
@@ -634,7 +704,7 @@ var require_rcompare = __commonJS({
|
|
|
634
704
|
var require_compare_loose = __commonJS({
|
|
635
705
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/compare-loose.js"(exports$1, module) {
|
|
636
706
|
var compare = require_compare();
|
|
637
|
-
var compareLoose = /* @__PURE__ */ __name((
|
|
707
|
+
var compareLoose = /* @__PURE__ */ __name((a2, b) => compare(a2, b, true), "compareLoose");
|
|
638
708
|
module.exports = compareLoose;
|
|
639
709
|
}
|
|
640
710
|
});
|
|
@@ -643,8 +713,8 @@ var require_compare_loose = __commonJS({
|
|
|
643
713
|
var require_compare_build = __commonJS({
|
|
644
714
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/compare-build.js"(exports$1, module) {
|
|
645
715
|
var SemVer = require_semver();
|
|
646
|
-
var compareBuild = /* @__PURE__ */ __name((
|
|
647
|
-
const versionA = new SemVer(
|
|
716
|
+
var compareBuild = /* @__PURE__ */ __name((a2, b, loose) => {
|
|
717
|
+
const versionA = new SemVer(a2, loose);
|
|
648
718
|
const versionB = new SemVer(b, loose);
|
|
649
719
|
return versionA.compare(versionB) || versionA.compareBuild(versionB);
|
|
650
720
|
}, "compareBuild");
|
|
@@ -656,7 +726,7 @@ var require_compare_build = __commonJS({
|
|
|
656
726
|
var require_sort = __commonJS({
|
|
657
727
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/sort.js"(exports$1, module) {
|
|
658
728
|
var compareBuild = require_compare_build();
|
|
659
|
-
var sort = /* @__PURE__ */ __name((list, loose) => list.sort((
|
|
729
|
+
var sort = /* @__PURE__ */ __name((list, loose) => list.sort((a2, b) => compareBuild(a2, b, loose)), "sort");
|
|
660
730
|
module.exports = sort;
|
|
661
731
|
}
|
|
662
732
|
});
|
|
@@ -665,7 +735,7 @@ var require_sort = __commonJS({
|
|
|
665
735
|
var require_rsort = __commonJS({
|
|
666
736
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/rsort.js"(exports$1, module) {
|
|
667
737
|
var compareBuild = require_compare_build();
|
|
668
|
-
var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((
|
|
738
|
+
var rsort = /* @__PURE__ */ __name((list, loose) => list.sort((a2, b) => compareBuild(b, a2, loose)), "rsort");
|
|
669
739
|
module.exports = rsort;
|
|
670
740
|
}
|
|
671
741
|
});
|
|
@@ -674,7 +744,7 @@ var require_rsort = __commonJS({
|
|
|
674
744
|
var require_gt = __commonJS({
|
|
675
745
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/gt.js"(exports$1, module) {
|
|
676
746
|
var compare = require_compare();
|
|
677
|
-
var gt = /* @__PURE__ */ __name((
|
|
747
|
+
var gt = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) > 0, "gt");
|
|
678
748
|
module.exports = gt;
|
|
679
749
|
}
|
|
680
750
|
});
|
|
@@ -683,7 +753,7 @@ var require_gt = __commonJS({
|
|
|
683
753
|
var require_lt = __commonJS({
|
|
684
754
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/lt.js"(exports$1, module) {
|
|
685
755
|
var compare = require_compare();
|
|
686
|
-
var lt = /* @__PURE__ */ __name((
|
|
756
|
+
var lt = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) < 0, "lt");
|
|
687
757
|
module.exports = lt;
|
|
688
758
|
}
|
|
689
759
|
});
|
|
@@ -692,7 +762,7 @@ var require_lt = __commonJS({
|
|
|
692
762
|
var require_eq = __commonJS({
|
|
693
763
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/eq.js"(exports$1, module) {
|
|
694
764
|
var compare = require_compare();
|
|
695
|
-
var eq = /* @__PURE__ */ __name((
|
|
765
|
+
var eq = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) === 0, "eq");
|
|
696
766
|
module.exports = eq;
|
|
697
767
|
}
|
|
698
768
|
});
|
|
@@ -701,7 +771,7 @@ var require_eq = __commonJS({
|
|
|
701
771
|
var require_neq = __commonJS({
|
|
702
772
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/neq.js"(exports$1, module) {
|
|
703
773
|
var compare = require_compare();
|
|
704
|
-
var neq = /* @__PURE__ */ __name((
|
|
774
|
+
var neq = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) !== 0, "neq");
|
|
705
775
|
module.exports = neq;
|
|
706
776
|
}
|
|
707
777
|
});
|
|
@@ -710,7 +780,7 @@ var require_neq = __commonJS({
|
|
|
710
780
|
var require_gte = __commonJS({
|
|
711
781
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/gte.js"(exports$1, module) {
|
|
712
782
|
var compare = require_compare();
|
|
713
|
-
var gte = /* @__PURE__ */ __name((
|
|
783
|
+
var gte = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) >= 0, "gte");
|
|
714
784
|
module.exports = gte;
|
|
715
785
|
}
|
|
716
786
|
});
|
|
@@ -719,7 +789,7 @@ var require_gte = __commonJS({
|
|
|
719
789
|
var require_lte = __commonJS({
|
|
720
790
|
"../../node_modules/.bun/semver@7.7.4/node_modules/semver/functions/lte.js"(exports$1, module) {
|
|
721
791
|
var compare = require_compare();
|
|
722
|
-
var lte = /* @__PURE__ */ __name((
|
|
792
|
+
var lte = /* @__PURE__ */ __name((a2, b, loose) => compare(a2, b, loose) <= 0, "lte");
|
|
723
793
|
module.exports = lte;
|
|
724
794
|
}
|
|
725
795
|
});
|
|
@@ -733,38 +803,38 @@ var require_cmp = __commonJS({
|
|
|
733
803
|
var gte = require_gte();
|
|
734
804
|
var lt = require_lt();
|
|
735
805
|
var lte = require_lte();
|
|
736
|
-
var cmp = /* @__PURE__ */ __name((
|
|
806
|
+
var cmp = /* @__PURE__ */ __name((a2, op, b, loose) => {
|
|
737
807
|
switch (op) {
|
|
738
808
|
case "===":
|
|
739
|
-
if (typeof
|
|
740
|
-
|
|
809
|
+
if (typeof a2 === "object") {
|
|
810
|
+
a2 = a2.version;
|
|
741
811
|
}
|
|
742
812
|
if (typeof b === "object") {
|
|
743
813
|
b = b.version;
|
|
744
814
|
}
|
|
745
|
-
return
|
|
815
|
+
return a2 === b;
|
|
746
816
|
case "!==":
|
|
747
|
-
if (typeof
|
|
748
|
-
|
|
817
|
+
if (typeof a2 === "object") {
|
|
818
|
+
a2 = a2.version;
|
|
749
819
|
}
|
|
750
820
|
if (typeof b === "object") {
|
|
751
821
|
b = b.version;
|
|
752
822
|
}
|
|
753
|
-
return
|
|
823
|
+
return a2 !== b;
|
|
754
824
|
case "":
|
|
755
825
|
case "=":
|
|
756
826
|
case "==":
|
|
757
|
-
return eq(
|
|
827
|
+
return eq(a2, b, loose);
|
|
758
828
|
case "!=":
|
|
759
|
-
return neq(
|
|
829
|
+
return neq(a2, b, loose);
|
|
760
830
|
case ">":
|
|
761
|
-
return gt(
|
|
831
|
+
return gt(a2, b, loose);
|
|
762
832
|
case ">=":
|
|
763
|
-
return gte(
|
|
833
|
+
return gte(a2, b, loose);
|
|
764
834
|
case "<":
|
|
765
|
-
return lt(
|
|
835
|
+
return lt(a2, b, loose);
|
|
766
836
|
case "<=":
|
|
767
|
-
return lte(
|
|
837
|
+
return lte(a2, b, loose);
|
|
768
838
|
default:
|
|
769
839
|
throw new TypeError(`Invalid operator: ${op}`);
|
|
770
840
|
}
|
|
@@ -939,21 +1009,21 @@ var require_range = __commonJS({
|
|
|
939
1009
|
const loose = this.options.loose;
|
|
940
1010
|
const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE];
|
|
941
1011
|
range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
|
|
942
|
-
|
|
1012
|
+
debug2("hyphen replace", range);
|
|
943
1013
|
range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace);
|
|
944
|
-
|
|
1014
|
+
debug2("comparator trim", range);
|
|
945
1015
|
range = range.replace(re[t.TILDETRIM], tildeTrimReplace);
|
|
946
|
-
|
|
1016
|
+
debug2("tilde trim", range);
|
|
947
1017
|
range = range.replace(re[t.CARETTRIM], caretTrimReplace);
|
|
948
|
-
|
|
1018
|
+
debug2("caret trim", range);
|
|
949
1019
|
let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
|
|
950
1020
|
if (loose) {
|
|
951
1021
|
rangeList = rangeList.filter((comp) => {
|
|
952
|
-
|
|
1022
|
+
debug2("loose invalid filter", comp, this.options);
|
|
953
1023
|
return !!comp.match(re[t.COMPARATORLOOSE]);
|
|
954
1024
|
});
|
|
955
1025
|
}
|
|
956
|
-
|
|
1026
|
+
debug2("range list", rangeList);
|
|
957
1027
|
const rangeMap = /* @__PURE__ */ new Map();
|
|
958
1028
|
const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
|
|
959
1029
|
for (const comp of comparators) {
|
|
@@ -1008,7 +1078,7 @@ var require_range = __commonJS({
|
|
|
1008
1078
|
var cache = new LRU();
|
|
1009
1079
|
var parseOptions = require_parse_options();
|
|
1010
1080
|
var Comparator = require_comparator();
|
|
1011
|
-
var
|
|
1081
|
+
var debug2 = require_debug();
|
|
1012
1082
|
var SemVer = require_semver();
|
|
1013
1083
|
var {
|
|
1014
1084
|
safeRe: re,
|
|
@@ -1034,15 +1104,15 @@ var require_range = __commonJS({
|
|
|
1034
1104
|
}, "isSatisfiable");
|
|
1035
1105
|
var parseComparator = /* @__PURE__ */ __name((comp, options) => {
|
|
1036
1106
|
comp = comp.replace(re[t.BUILD], "");
|
|
1037
|
-
|
|
1107
|
+
debug2("comp", comp, options);
|
|
1038
1108
|
comp = replaceCarets(comp, options);
|
|
1039
|
-
|
|
1109
|
+
debug2("caret", comp);
|
|
1040
1110
|
comp = replaceTildes(comp, options);
|
|
1041
|
-
|
|
1111
|
+
debug2("tildes", comp);
|
|
1042
1112
|
comp = replaceXRanges(comp, options);
|
|
1043
|
-
|
|
1113
|
+
debug2("xrange", comp);
|
|
1044
1114
|
comp = replaceStars(comp, options);
|
|
1045
|
-
|
|
1115
|
+
debug2("stars", comp);
|
|
1046
1116
|
return comp;
|
|
1047
1117
|
}, "parseComparator");
|
|
1048
1118
|
var isX = /* @__PURE__ */ __name((id) => !id || id.toLowerCase() === "x" || id === "*", "isX");
|
|
@@ -1052,7 +1122,7 @@ var require_range = __commonJS({
|
|
|
1052
1122
|
var replaceTilde = /* @__PURE__ */ __name((comp, options) => {
|
|
1053
1123
|
const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE];
|
|
1054
1124
|
return comp.replace(r, (_3, M, m, p, pr) => {
|
|
1055
|
-
|
|
1125
|
+
debug2("tilde", comp, _3, M, m, p, pr);
|
|
1056
1126
|
let ret;
|
|
1057
1127
|
if (isX(M)) {
|
|
1058
1128
|
ret = "";
|
|
@@ -1061,12 +1131,12 @@ var require_range = __commonJS({
|
|
|
1061
1131
|
} else if (isX(p)) {
|
|
1062
1132
|
ret = `>=${M}.${m}.0 <${M}.${+m + 1}.0-0`;
|
|
1063
1133
|
} else if (pr) {
|
|
1064
|
-
|
|
1134
|
+
debug2("replaceTilde pr", pr);
|
|
1065
1135
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${+m + 1}.0-0`;
|
|
1066
1136
|
} else {
|
|
1067
1137
|
ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
|
|
1068
1138
|
}
|
|
1069
|
-
|
|
1139
|
+
debug2("tilde return", ret);
|
|
1070
1140
|
return ret;
|
|
1071
1141
|
});
|
|
1072
1142
|
}, "replaceTilde");
|
|
@@ -1074,11 +1144,11 @@ var require_range = __commonJS({
|
|
|
1074
1144
|
return comp.trim().split(/\s+/).map((c) => replaceCaret(c, options)).join(" ");
|
|
1075
1145
|
}, "replaceCarets");
|
|
1076
1146
|
var replaceCaret = /* @__PURE__ */ __name((comp, options) => {
|
|
1077
|
-
|
|
1147
|
+
debug2("caret", comp, options);
|
|
1078
1148
|
const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET];
|
|
1079
1149
|
const z = options.includePrerelease ? "-0" : "";
|
|
1080
1150
|
return comp.replace(r, (_3, M, m, p, pr) => {
|
|
1081
|
-
|
|
1151
|
+
debug2("caret", comp, _3, M, m, p, pr);
|
|
1082
1152
|
let ret;
|
|
1083
1153
|
if (isX(M)) {
|
|
1084
1154
|
ret = "";
|
|
@@ -1091,7 +1161,7 @@ var require_range = __commonJS({
|
|
|
1091
1161
|
ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`;
|
|
1092
1162
|
}
|
|
1093
1163
|
} else if (pr) {
|
|
1094
|
-
|
|
1164
|
+
debug2("replaceCaret pr", pr);
|
|
1095
1165
|
if (M === "0") {
|
|
1096
1166
|
if (m === "0") {
|
|
1097
1167
|
ret = `>=${M}.${m}.${p}-${pr} <${M}.${m}.${+p + 1}-0`;
|
|
@@ -1102,7 +1172,7 @@ var require_range = __commonJS({
|
|
|
1102
1172
|
ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
1103
1173
|
}
|
|
1104
1174
|
} else {
|
|
1105
|
-
|
|
1175
|
+
debug2("no pr");
|
|
1106
1176
|
if (M === "0") {
|
|
1107
1177
|
if (m === "0") {
|
|
1108
1178
|
ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
|
|
@@ -1113,19 +1183,19 @@ var require_range = __commonJS({
|
|
|
1113
1183
|
ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
1114
1184
|
}
|
|
1115
1185
|
}
|
|
1116
|
-
|
|
1186
|
+
debug2("caret return", ret);
|
|
1117
1187
|
return ret;
|
|
1118
1188
|
});
|
|
1119
1189
|
}, "replaceCaret");
|
|
1120
1190
|
var replaceXRanges = /* @__PURE__ */ __name((comp, options) => {
|
|
1121
|
-
|
|
1191
|
+
debug2("replaceXRanges", comp, options);
|
|
1122
1192
|
return comp.split(/\s+/).map((c) => replaceXRange(c, options)).join(" ");
|
|
1123
1193
|
}, "replaceXRanges");
|
|
1124
1194
|
var replaceXRange = /* @__PURE__ */ __name((comp, options) => {
|
|
1125
1195
|
comp = comp.trim();
|
|
1126
1196
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
1127
1197
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
1128
|
-
|
|
1198
|
+
debug2("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
1129
1199
|
const xM = isX(M);
|
|
1130
1200
|
const xm = xM || isX(m);
|
|
1131
1201
|
const xp = xm || isX(p);
|
|
@@ -1172,16 +1242,16 @@ var require_range = __commonJS({
|
|
|
1172
1242
|
} else if (xp) {
|
|
1173
1243
|
ret = `>=${M}.${m}.0${pr} <${M}.${+m + 1}.0-0`;
|
|
1174
1244
|
}
|
|
1175
|
-
|
|
1245
|
+
debug2("xRange return", ret);
|
|
1176
1246
|
return ret;
|
|
1177
1247
|
});
|
|
1178
1248
|
}, "replaceXRange");
|
|
1179
1249
|
var replaceStars = /* @__PURE__ */ __name((comp, options) => {
|
|
1180
|
-
|
|
1250
|
+
debug2("replaceStars", comp, options);
|
|
1181
1251
|
return comp.trim().replace(re[t.STAR], "");
|
|
1182
1252
|
}, "replaceStars");
|
|
1183
1253
|
var replaceGTE0 = /* @__PURE__ */ __name((comp, options) => {
|
|
1184
|
-
|
|
1254
|
+
debug2("replaceGTE0", comp, options);
|
|
1185
1255
|
return comp.trim().replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], "");
|
|
1186
1256
|
}, "replaceGTE0");
|
|
1187
1257
|
var hyphenReplace = /* @__PURE__ */ __name((incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
|
|
@@ -1219,7 +1289,7 @@ var require_range = __commonJS({
|
|
|
1219
1289
|
}
|
|
1220
1290
|
if (version.prerelease.length && !options.includePrerelease) {
|
|
1221
1291
|
for (let i = 0; i < set.length; i++) {
|
|
1222
|
-
|
|
1292
|
+
debug2(set[i].semver);
|
|
1223
1293
|
if (set[i].semver === Comparator.ANY) {
|
|
1224
1294
|
continue;
|
|
1225
1295
|
}
|
|
@@ -1258,7 +1328,7 @@ var require_comparator = __commonJS({
|
|
|
1258
1328
|
}
|
|
1259
1329
|
}
|
|
1260
1330
|
comp = comp.trim().split(/\s+/).join(" ");
|
|
1261
|
-
|
|
1331
|
+
debug2("comparator", comp, options);
|
|
1262
1332
|
this.options = options;
|
|
1263
1333
|
this.loose = !!options.loose;
|
|
1264
1334
|
this.parse(comp);
|
|
@@ -1267,7 +1337,7 @@ var require_comparator = __commonJS({
|
|
|
1267
1337
|
} else {
|
|
1268
1338
|
this.value = this.operator + this.semver.version;
|
|
1269
1339
|
}
|
|
1270
|
-
|
|
1340
|
+
debug2("comp", this);
|
|
1271
1341
|
}
|
|
1272
1342
|
parse(comp) {
|
|
1273
1343
|
const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR];
|
|
@@ -1289,7 +1359,7 @@ var require_comparator = __commonJS({
|
|
|
1289
1359
|
return this.value;
|
|
1290
1360
|
}
|
|
1291
1361
|
test(version) {
|
|
1292
|
-
|
|
1362
|
+
debug2("Comparator.test", version, this.options.loose);
|
|
1293
1363
|
if (this.semver === ANY || version === ANY) {
|
|
1294
1364
|
return true;
|
|
1295
1365
|
}
|
|
@@ -1346,7 +1416,7 @@ var require_comparator = __commonJS({
|
|
|
1346
1416
|
var parseOptions = require_parse_options();
|
|
1347
1417
|
var { safeRe: re, t } = require_re();
|
|
1348
1418
|
var cmp = require_cmp();
|
|
1349
|
-
var
|
|
1419
|
+
var debug2 = require_debug();
|
|
1350
1420
|
var SemVer = require_semver();
|
|
1351
1421
|
var Range = require_range();
|
|
1352
1422
|
}
|
|
@@ -1614,7 +1684,7 @@ var require_simplify = __commonJS({
|
|
|
1614
1684
|
const set = [];
|
|
1615
1685
|
let first = null;
|
|
1616
1686
|
let prev = null;
|
|
1617
|
-
const v = versions.sort((
|
|
1687
|
+
const v = versions.sort((a2, b) => compare(a2, b, options));
|
|
1618
1688
|
for (const version of v) {
|
|
1619
1689
|
const included = satisfies(version, range, options);
|
|
1620
1690
|
if (included) {
|
|
@@ -1797,19 +1867,19 @@ var require_subset = __commonJS({
|
|
|
1797
1867
|
}
|
|
1798
1868
|
return true;
|
|
1799
1869
|
}, "simpleSubset");
|
|
1800
|
-
var higherGT = /* @__PURE__ */ __name((
|
|
1801
|
-
if (!
|
|
1870
|
+
var higherGT = /* @__PURE__ */ __name((a2, b, options) => {
|
|
1871
|
+
if (!a2) {
|
|
1802
1872
|
return b;
|
|
1803
1873
|
}
|
|
1804
|
-
const comp = compare(
|
|
1805
|
-
return comp > 0 ?
|
|
1874
|
+
const comp = compare(a2.semver, b.semver, options);
|
|
1875
|
+
return comp > 0 ? a2 : comp < 0 ? b : b.operator === ">" && a2.operator === ">=" ? b : a2;
|
|
1806
1876
|
}, "higherGT");
|
|
1807
|
-
var lowerLT = /* @__PURE__ */ __name((
|
|
1808
|
-
if (!
|
|
1877
|
+
var lowerLT = /* @__PURE__ */ __name((a2, b, options) => {
|
|
1878
|
+
if (!a2) {
|
|
1809
1879
|
return b;
|
|
1810
1880
|
}
|
|
1811
|
-
const comp = compare(
|
|
1812
|
-
return comp < 0 ?
|
|
1881
|
+
const comp = compare(a2.semver, b.semver, options);
|
|
1882
|
+
return comp < 0 ? a2 : comp > 0 ? b : b.operator === "<" && a2.operator === "<=" ? b : a2;
|
|
1813
1883
|
}, "lowerLT");
|
|
1814
1884
|
module.exports = subset;
|
|
1815
1885
|
}
|
|
@@ -2608,13 +2678,13 @@ function sortBy(array, compareBy) {
|
|
|
2608
2678
|
compareMap.set(item, compareBy(item));
|
|
2609
2679
|
});
|
|
2610
2680
|
return array.concat().sort(
|
|
2611
|
-
(
|
|
2681
|
+
(a2, b) => compareMap.get(a2) - compareMap.get(b)
|
|
2612
2682
|
);
|
|
2613
2683
|
} else {
|
|
2614
2684
|
return array.concat().sort(
|
|
2615
|
-
(
|
|
2616
|
-
if (
|
|
2617
|
-
return b[compareBy] >
|
|
2685
|
+
(a2, b) => {
|
|
2686
|
+
if (a2[compareBy] > b[compareBy]) return 1;
|
|
2687
|
+
return b[compareBy] > a2[compareBy] ? -1 : 0;
|
|
2618
2688
|
}
|
|
2619
2689
|
);
|
|
2620
2690
|
}
|
|
@@ -2657,7 +2727,7 @@ function flatMap(array, fn) {
|
|
|
2657
2727
|
}
|
|
2658
2728
|
__name(flatMap, "flatMap");
|
|
2659
2729
|
function intersection(...arrays) {
|
|
2660
|
-
return arrays.reduce((
|
|
2730
|
+
return arrays.reduce((a2, b) => a2.filter((value) => b.includes(value)));
|
|
2661
2731
|
}
|
|
2662
2732
|
__name(intersection, "intersection");
|
|
2663
2733
|
function pick(obj, keys) {
|
|
@@ -2678,7 +2748,7 @@ var _ = {
|
|
|
2678
2748
|
compact,
|
|
2679
2749
|
keys: Object.keys,
|
|
2680
2750
|
values: Object.values,
|
|
2681
|
-
some: /* @__PURE__ */ __name((
|
|
2751
|
+
some: /* @__PURE__ */ __name((a2, fn) => a2.some(fn), "some"),
|
|
2682
2752
|
filter,
|
|
2683
2753
|
each,
|
|
2684
2754
|
castArray,
|
|
@@ -3437,27 +3507,27 @@ var peg$SyntaxError = class extends SyntaxError {
|
|
|
3437
3507
|
return str;
|
|
3438
3508
|
}
|
|
3439
3509
|
static buildMessage(expected, found) {
|
|
3440
|
-
function
|
|
3510
|
+
function hex2(ch) {
|
|
3441
3511
|
return ch.codePointAt(0).toString(16).toUpperCase();
|
|
3442
3512
|
}
|
|
3443
|
-
__name(
|
|
3444
|
-
__name2(
|
|
3513
|
+
__name(hex2, "hex");
|
|
3514
|
+
__name2(hex2, "hex");
|
|
3445
3515
|
const nonPrintable = Object.prototype.hasOwnProperty.call(RegExp.prototype, "unicode") ? new RegExp("[\\p{C}\\p{Mn}\\p{Mc}]", "gu") : null;
|
|
3446
3516
|
function unicodeEscape(s) {
|
|
3447
3517
|
if (nonPrintable) {
|
|
3448
|
-
return s.replace(nonPrintable, (ch) => "\\u{" +
|
|
3518
|
+
return s.replace(nonPrintable, (ch) => "\\u{" + hex2(ch) + "}");
|
|
3449
3519
|
}
|
|
3450
3520
|
return s;
|
|
3451
3521
|
}
|
|
3452
3522
|
__name(unicodeEscape, "unicodeEscape");
|
|
3453
3523
|
__name2(unicodeEscape, "unicodeEscape");
|
|
3454
3524
|
function literalEscape(s) {
|
|
3455
|
-
return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" +
|
|
3525
|
+
return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex2(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex2(ch)));
|
|
3456
3526
|
}
|
|
3457
3527
|
__name(literalEscape, "literalEscape");
|
|
3458
3528
|
__name2(literalEscape, "literalEscape");
|
|
3459
3529
|
function classEscape(s) {
|
|
3460
|
-
return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" +
|
|
3530
|
+
return unicodeEscape(s.replace(/\\/g, "\\\\").replace(/\]/g, "\\]").replace(/\^/g, "\\^").replace(/-/g, "\\-").replace(/\0/g, "\\0").replace(/\t/g, "\\t").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/[\x00-\x0F]/g, (ch) => "\\x0" + hex2(ch)).replace(/[\x10-\x1F\x7F-\x9F]/g, (ch) => "\\x" + hex2(ch)));
|
|
3461
3531
|
}
|
|
3462
3532
|
__name(classEscape, "classEscape");
|
|
3463
3533
|
__name2(classEscape, "classEscape");
|
|
@@ -8050,6 +8120,11 @@ function pathExistsSync(p) {
|
|
|
8050
8120
|
}
|
|
8051
8121
|
__name(pathExistsSync, "pathExistsSync");
|
|
8052
8122
|
|
|
8123
|
+
// ../../node_modules/.bun/ansis@4.2.0/node_modules/ansis/index.mjs
|
|
8124
|
+
var import_index = __toESM(require_ansis(), 1);
|
|
8125
|
+
var ansis_default = import_index.default;
|
|
8126
|
+
var { Ansis, fg, bg, rgb, bgRgb, hex, bgHex, reset, inverse, hidden, visible, bold, dim, italic, underline, strikethrough, black, red, green, yellow, blue, magenta, cyan, white, gray, redBright, greenBright, yellowBright, blueBright, magentaBright, cyanBright, whiteBright, bgBlack, bgRed, bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite, bgGray, bgRedBright, bgGreenBright, bgYellowBright, bgBlueBright, bgMagentaBright, bgCyanBright, bgWhiteBright } = import_index.default;
|
|
8127
|
+
|
|
8053
8128
|
// src/env-graph/lib/plugins.ts
|
|
8054
8129
|
var import_semver = __toESM(require_semver2(), 1);
|
|
8055
8130
|
function getUserVarlockDir() {
|
|
@@ -8339,7 +8414,7 @@ var builtInRootDecorators = [
|
|
|
8339
8414
|
if (!decVal.arrArgs || decVal.arrArgs.length === 0) {
|
|
8340
8415
|
throw new Error("@import decorator must have at least one argument - the path to import");
|
|
8341
8416
|
}
|
|
8342
|
-
if (decVal.arrArgs.some((
|
|
8417
|
+
if (decVal.arrArgs.some((a2) => !a2.isStatic)) {
|
|
8343
8418
|
throw new Error("@import decorator cannot use any dynamic values - all args must be static");
|
|
8344
8419
|
}
|
|
8345
8420
|
}, "process")
|
|
@@ -8426,7 +8501,7 @@ var builtInRootDecorators = [
|
|
|
8426
8501
|
dataSource._loadingError = err instanceof SchemaError ? err : new SchemaError(err);
|
|
8427
8502
|
return;
|
|
8428
8503
|
}
|
|
8429
|
-
const { ConfigItem: ConfigItem2 } = await import('./config-item-
|
|
8504
|
+
const { ConfigItem: ConfigItem2 } = await import('./config-item-NO5PKZRH.js');
|
|
8430
8505
|
for (const [key, entry] of Object.entries(entries)) {
|
|
8431
8506
|
const existsInSchema = key in graph.configSchema;
|
|
8432
8507
|
if (!existsInSchema && !createMissing) {
|
|
@@ -8502,8 +8577,8 @@ function parseRepoSlug(s) {
|
|
|
8502
8577
|
try {
|
|
8503
8578
|
if (trimmed.includes("://") || trimmed.startsWith("git@")) {
|
|
8504
8579
|
const url = new URL(trimmed.replace(/^git@([^:]+):/, "https://$1/"));
|
|
8505
|
-
const
|
|
8506
|
-
const parts =
|
|
8580
|
+
const path5 = url.pathname.replace(/^\/+/, "").replace(/\.git$/, "");
|
|
8581
|
+
const parts = path5.split("/");
|
|
8507
8582
|
if (parts.length >= 2) {
|
|
8508
8583
|
slug = `${parts[0]}/${parts[1]}`;
|
|
8509
8584
|
}
|
|
@@ -8605,9 +8680,9 @@ var PLATFORMS = [
|
|
|
8605
8680
|
isPR: "CI_MERGE_REQUEST_ID",
|
|
8606
8681
|
prNumber: "CI_MERGE_REQUEST_ID",
|
|
8607
8682
|
repo: /* @__PURE__ */ __name((env) => {
|
|
8608
|
-
const
|
|
8609
|
-
if (!
|
|
8610
|
-
const parts =
|
|
8683
|
+
const path5 = env.CI_PROJECT_PATH;
|
|
8684
|
+
if (!path5) return void 0;
|
|
8685
|
+
const parts = path5.split("/").filter(Boolean);
|
|
8611
8686
|
if (parts.length >= 2) {
|
|
8612
8687
|
return { owner: parts.slice(0, -1).join("/"), name: parts[parts.length - 1] };
|
|
8613
8688
|
}
|
|
@@ -9232,11 +9307,17 @@ var Resolver = class {
|
|
|
9232
9307
|
const resolvedValue = await this.def.resolve.call(this, this.meta);
|
|
9233
9308
|
return resolvedValue;
|
|
9234
9309
|
} catch (err) {
|
|
9235
|
-
if (err instanceof VarlockError
|
|
9236
|
-
|
|
9237
|
-
|
|
9238
|
-
err.
|
|
9239
|
-
|
|
9310
|
+
if (err instanceof VarlockError) {
|
|
9311
|
+
if (!this.def.name.startsWith("\0") && !err._resolverPrefixed) {
|
|
9312
|
+
err.message = `${this.def.name}(): ${err.message}`;
|
|
9313
|
+
err._resolverPrefixed = true;
|
|
9314
|
+
}
|
|
9315
|
+
if (!err.more?.location && this._parsedNode && this.dataSource) {
|
|
9316
|
+
const location = getErrorLocation(this.dataSource, this._parsedNode);
|
|
9317
|
+
if (location) {
|
|
9318
|
+
err.more ??= {};
|
|
9319
|
+
err.more.location = location;
|
|
9320
|
+
}
|
|
9240
9321
|
}
|
|
9241
9322
|
}
|
|
9242
9323
|
throw err;
|
|
@@ -9454,23 +9535,56 @@ var RemapResolver = createResolver({
|
|
|
9454
9535
|
name: "remap",
|
|
9455
9536
|
icon: "codicon:replace",
|
|
9456
9537
|
argsSchema: {
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9538
|
+
// supports both old key=value syntax and new positional syntax
|
|
9539
|
+
// old: remap($VAR, result1=match1, result2=match2) -- arrArgs has 1 item, objArgs has the mappings
|
|
9540
|
+
// new: remap($VAR, match1, result1, match2, result2, default?) -- arrArgs has 3+ items
|
|
9541
|
+
type: "mixed"
|
|
9460
9542
|
},
|
|
9461
9543
|
process() {
|
|
9462
|
-
|
|
9544
|
+
const isLegacyKeyValMode = this.objArgs !== void 0 && Object.keys(this.objArgs).length > 0;
|
|
9545
|
+
if (isLegacyKeyValMode) {
|
|
9546
|
+
if ((this.arrArgs?.length ?? 0) !== 1) {
|
|
9547
|
+
throw new SchemaError("expects exactly 1 positional argument followed by key=value remapping pairs");
|
|
9548
|
+
}
|
|
9549
|
+
if (Object.keys(this.objArgs).length === 0) {
|
|
9550
|
+
throw new SchemaError("expects at least 1 key=value remapping pair");
|
|
9551
|
+
}
|
|
9552
|
+
this._schemaErrors.push(new SchemaError("key=value syntax is deprecated", {
|
|
9553
|
+
isWarning: true,
|
|
9554
|
+
tip: "Use positional pairs instead: remap($VAR, match1, result1, match2, result2, ...)"
|
|
9555
|
+
}));
|
|
9556
|
+
} else {
|
|
9557
|
+
if ((this.arrArgs?.length ?? 0) < 3) {
|
|
9558
|
+
throw new SchemaError("expects at least 3 arguments: (value, match1, result1, ...)");
|
|
9559
|
+
}
|
|
9560
|
+
}
|
|
9561
|
+
return { isLegacyKeyValMode };
|
|
9463
9562
|
},
|
|
9464
|
-
async resolve(
|
|
9563
|
+
async resolve({ isLegacyKeyValMode }) {
|
|
9465
9564
|
const originalValue = await this.arrArgs[0].resolve();
|
|
9466
|
-
|
|
9467
|
-
const
|
|
9565
|
+
if (isLegacyKeyValMode) {
|
|
9566
|
+
for (const [remappedVal, matchValResolver] of Object.entries(this.objArgs)) {
|
|
9567
|
+
const matchVal = await matchValResolver.resolve();
|
|
9568
|
+
if (matchVal instanceof RegExp && originalValue !== void 0) {
|
|
9569
|
+
if (matchVal.test(String(originalValue))) return remappedVal;
|
|
9570
|
+
} else {
|
|
9571
|
+
if (matchVal === originalValue) return remappedVal;
|
|
9572
|
+
}
|
|
9573
|
+
}
|
|
9574
|
+
return originalValue;
|
|
9575
|
+
}
|
|
9576
|
+
const remainingArgs = this.arrArgs.slice(1);
|
|
9577
|
+
for (let i = 0; i + 1 < remainingArgs.length; i += 2) {
|
|
9578
|
+
const matchVal = await remainingArgs[i].resolve();
|
|
9468
9579
|
if (matchVal instanceof RegExp && originalValue !== void 0) {
|
|
9469
|
-
if (matchVal.test(String(originalValue))) return
|
|
9580
|
+
if (matchVal.test(String(originalValue))) return remainingArgs[i + 1].resolve();
|
|
9470
9581
|
} else {
|
|
9471
|
-
if (matchVal === originalValue) return
|
|
9582
|
+
if (matchVal === originalValue) return remainingArgs[i + 1].resolve();
|
|
9472
9583
|
}
|
|
9473
9584
|
}
|
|
9585
|
+
if (remainingArgs.length % 2 === 1) {
|
|
9586
|
+
return remainingArgs[remainingArgs.length - 1].resolve();
|
|
9587
|
+
}
|
|
9474
9588
|
return originalValue;
|
|
9475
9589
|
}
|
|
9476
9590
|
});
|
|
@@ -9539,6 +9653,27 @@ var IfResolver = createResolver({
|
|
|
9539
9653
|
}
|
|
9540
9654
|
}
|
|
9541
9655
|
});
|
|
9656
|
+
var IfsResolver = createResolver({
|
|
9657
|
+
name: "ifs",
|
|
9658
|
+
icon: "material-symbols:rule",
|
|
9659
|
+
argsSchema: {
|
|
9660
|
+
type: "array",
|
|
9661
|
+
arrayMinLength: 1
|
|
9662
|
+
},
|
|
9663
|
+
async resolve() {
|
|
9664
|
+
const args = this.arrArgs;
|
|
9665
|
+
for (let i = 0; i + 1 < args.length; i += 2) {
|
|
9666
|
+
const condition = await args[i].resolve();
|
|
9667
|
+
if (condition) {
|
|
9668
|
+
return args[i + 1].resolve();
|
|
9669
|
+
}
|
|
9670
|
+
}
|
|
9671
|
+
if (args.length % 2 === 1) {
|
|
9672
|
+
return args[args.length - 1].resolve();
|
|
9673
|
+
}
|
|
9674
|
+
return void 0;
|
|
9675
|
+
}
|
|
9676
|
+
});
|
|
9542
9677
|
var NotResolver = createResolver({
|
|
9543
9678
|
name: "not",
|
|
9544
9679
|
icon: "material-symbols:not-equal",
|
|
@@ -9586,6 +9721,7 @@ var BaseResolvers = [
|
|
|
9586
9721
|
RefResolver,
|
|
9587
9722
|
ExecResolver,
|
|
9588
9723
|
RemapResolver,
|
|
9724
|
+
IfsResolver,
|
|
9589
9725
|
ForEnvResolver,
|
|
9590
9726
|
EqResolver,
|
|
9591
9727
|
IfResolver,
|
|
@@ -9638,56 +9774,181 @@ function convertParsedValueToResolvers(value, dataSource, registeredResolvers) {
|
|
|
9638
9774
|
}
|
|
9639
9775
|
}
|
|
9640
9776
|
__name(convertParsedValueToResolvers, "convertParsedValueToResolvers");
|
|
9777
|
+
var debug = createDebug("varlock:workspace-utils");
|
|
9778
|
+
var JS_PACKAGE_MANAGERS = Object.freeze({
|
|
9779
|
+
npm: {
|
|
9780
|
+
name: "npm",
|
|
9781
|
+
lockfiles: ["package-lock.json"],
|
|
9782
|
+
add: "npm install",
|
|
9783
|
+
// add also works
|
|
9784
|
+
exec: "npm exec --",
|
|
9785
|
+
dlx: "npx"
|
|
9786
|
+
},
|
|
9787
|
+
pnpm: {
|
|
9788
|
+
name: "pnpm",
|
|
9789
|
+
lockfiles: ["pnpm-lock.yaml"],
|
|
9790
|
+
add: "pnpm add",
|
|
9791
|
+
exec: "pnpm exec",
|
|
9792
|
+
dlx: "pnpm dlx"
|
|
9793
|
+
},
|
|
9794
|
+
yarn: {
|
|
9795
|
+
name: "yarn",
|
|
9796
|
+
lockfiles: ["yarn.lock"],
|
|
9797
|
+
add: "yarn add",
|
|
9798
|
+
exec: "yarn exec --",
|
|
9799
|
+
dlx: "yarn dlx"
|
|
9800
|
+
},
|
|
9801
|
+
bun: {
|
|
9802
|
+
name: "bun",
|
|
9803
|
+
lockfiles: ["bun.lock", "bun.lockb"],
|
|
9804
|
+
add: "bun add",
|
|
9805
|
+
exec: "bun run",
|
|
9806
|
+
dlx: "bunx"
|
|
9807
|
+
},
|
|
9808
|
+
deno: {
|
|
9809
|
+
//! deno not fully supported yet
|
|
9810
|
+
name: "deno",
|
|
9811
|
+
lockfiles: ["deno.lock"],
|
|
9812
|
+
add: "deno add",
|
|
9813
|
+
// TODO: don't think these are quite right...
|
|
9814
|
+
exec: "deno run",
|
|
9815
|
+
dlx: "deno run"
|
|
9816
|
+
}
|
|
9817
|
+
});
|
|
9818
|
+
function detectWorkspaceInfo(opts) {
|
|
9819
|
+
debug("Detecting workspace info");
|
|
9820
|
+
let cwd = opts?.cwd || process.cwd();
|
|
9821
|
+
let multipleLockfilesDetected;
|
|
9822
|
+
let foundRootPath;
|
|
9823
|
+
let foundPm;
|
|
9824
|
+
do {
|
|
9825
|
+
debug(`> scanning ${cwd}`);
|
|
9826
|
+
const scanDir = cwd;
|
|
9827
|
+
let detectedPm;
|
|
9828
|
+
let pm;
|
|
9829
|
+
for (pm in JS_PACKAGE_MANAGERS) {
|
|
9830
|
+
const foundLockfile = JS_PACKAGE_MANAGERS[pm].lockfiles.find(
|
|
9831
|
+
(lockfile) => pathExistsSync(path2.join(scanDir, lockfile))
|
|
9832
|
+
);
|
|
9833
|
+
if (foundLockfile) {
|
|
9834
|
+
if (detectedPm) {
|
|
9835
|
+
debug(`> found multiple lockfiles: ${foundLockfile} and ${JS_PACKAGE_MANAGERS[detectedPm].lockfiles[0]}`);
|
|
9836
|
+
multipleLockfilesDetected = [detectedPm, pm];
|
|
9837
|
+
break;
|
|
9838
|
+
}
|
|
9839
|
+
debug(`> found ${foundLockfile}`);
|
|
9840
|
+
detectedPm = pm;
|
|
9841
|
+
}
|
|
9842
|
+
}
|
|
9843
|
+
if (detectedPm && !multipleLockfilesDetected) {
|
|
9844
|
+
foundRootPath = scanDir;
|
|
9845
|
+
foundPm = detectedPm;
|
|
9846
|
+
break;
|
|
9847
|
+
}
|
|
9848
|
+
if (multipleLockfilesDetected) break;
|
|
9849
|
+
const parentDir = path2.dirname(cwd);
|
|
9850
|
+
if (parentDir === cwd) break;
|
|
9851
|
+
cwd = parentDir;
|
|
9852
|
+
if (pathExistsSync(path2.join(cwd, ".git"))) break;
|
|
9853
|
+
} while (cwd);
|
|
9854
|
+
if (!foundPm) {
|
|
9855
|
+
if (process.env.npm_config_user_agent) {
|
|
9856
|
+
const pmFromAgent = process.env.npm_config_user_agent.split("/")[0];
|
|
9857
|
+
if (Object.keys(JS_PACKAGE_MANAGERS).includes(pmFromAgent)) {
|
|
9858
|
+
debug(`> found ${pmFromAgent} using npm_config_user_agent`);
|
|
9859
|
+
foundPm = pmFromAgent;
|
|
9860
|
+
foundRootPath = opts?.cwd || process.cwd();
|
|
9861
|
+
}
|
|
9862
|
+
}
|
|
9863
|
+
if (!foundPm && multipleLockfilesDetected) {
|
|
9864
|
+
debug(`> using ${multipleLockfilesDetected[0]} from multiple detected lockfiles`);
|
|
9865
|
+
foundPm = multipleLockfilesDetected[0];
|
|
9866
|
+
foundRootPath = cwd;
|
|
9867
|
+
}
|
|
9868
|
+
}
|
|
9869
|
+
if (!foundPm || !foundRootPath) {
|
|
9870
|
+
return void 0;
|
|
9871
|
+
}
|
|
9872
|
+
const packageManager = JS_PACKAGE_MANAGERS[foundPm];
|
|
9873
|
+
let isMonorepo = false;
|
|
9874
|
+
let monorepoTool;
|
|
9875
|
+
const rootPackageJsonPath = path2.join(foundRootPath, "package.json");
|
|
9876
|
+
if (pathExistsSync(rootPackageJsonPath)) {
|
|
9877
|
+
try {
|
|
9878
|
+
const packageJson = JSON.parse(fs4.readFileSync(rootPackageJsonPath, "utf-8"));
|
|
9879
|
+
if (packageJson.workspaces) isMonorepo = true;
|
|
9880
|
+
} catch {
|
|
9881
|
+
}
|
|
9882
|
+
}
|
|
9883
|
+
if (!isMonorepo && pathExistsSync(path2.join(foundRootPath, "pnpm-workspace.yaml"))) {
|
|
9884
|
+
isMonorepo = true;
|
|
9885
|
+
}
|
|
9886
|
+
if (pathExistsSync(path2.join(foundRootPath, "turbo.json"))) {
|
|
9887
|
+
monorepoTool = "turborepo";
|
|
9888
|
+
} else if (pathExistsSync(path2.join(foundRootPath, "nx.json"))) {
|
|
9889
|
+
monorepoTool = "nx";
|
|
9890
|
+
} else if (pathExistsSync(path2.join(foundRootPath, "lerna.json"))) {
|
|
9891
|
+
monorepoTool = "lerna";
|
|
9892
|
+
}
|
|
9893
|
+
if (monorepoTool) isMonorepo = true;
|
|
9894
|
+
return {
|
|
9895
|
+
packageManager,
|
|
9896
|
+
rootPath: foundRootPath,
|
|
9897
|
+
isMonorepo,
|
|
9898
|
+
monorepoTool
|
|
9899
|
+
};
|
|
9900
|
+
}
|
|
9901
|
+
__name(detectWorkspaceInfo, "detectWorkspaceInfo");
|
|
9902
|
+
var workspaceInfoStorage = new AsyncLocalStorage();
|
|
9903
|
+
function runWithWorkspaceInfo(fn, explicitInfo) {
|
|
9904
|
+
let cached;
|
|
9905
|
+
let detected = false;
|
|
9906
|
+
const getter = /* @__PURE__ */ __name(() => {
|
|
9907
|
+
if (!detected) {
|
|
9908
|
+
cached = explicitInfo ?? detectWorkspaceInfo();
|
|
9909
|
+
detected = true;
|
|
9910
|
+
}
|
|
9911
|
+
return cached;
|
|
9912
|
+
}, "getter");
|
|
9913
|
+
return workspaceInfoStorage.run(getter, fn);
|
|
9914
|
+
}
|
|
9915
|
+
__name(runWithWorkspaceInfo, "runWithWorkspaceInfo");
|
|
9916
|
+
function getWorkspaceInfo() {
|
|
9917
|
+
return workspaceInfoStorage.getStore()?.() ?? detectWorkspaceInfo();
|
|
9918
|
+
}
|
|
9919
|
+
__name(getWorkspaceInfo, "getWorkspaceInfo");
|
|
9641
9920
|
|
|
9642
9921
|
// src/env-graph/lib/plugins.ts
|
|
9643
9922
|
var importedPluginModulePaths = /* @__PURE__ */ new Set();
|
|
9644
|
-
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9923
|
+
var _cryptoShimApplied = false;
|
|
9924
|
+
function applyBunCryptoShim() {
|
|
9925
|
+
if (_cryptoShimApplied) return;
|
|
9926
|
+
_cryptoShimApplied = true;
|
|
9927
|
+
const globalCrypto = globalThis.crypto;
|
|
9928
|
+
if (globalCrypto && !globalCrypto.webcrypto) {
|
|
9929
|
+
try {
|
|
9930
|
+
Object.defineProperty(globalCrypto, "webcrypto", {
|
|
9931
|
+
get() {
|
|
9932
|
+
return globalCrypto;
|
|
9933
|
+
},
|
|
9934
|
+
configurable: true,
|
|
9935
|
+
enumerable: false
|
|
9936
|
+
});
|
|
9937
|
+
} catch {
|
|
9938
|
+
}
|
|
9649
9939
|
}
|
|
9650
9940
|
}
|
|
9651
|
-
__name(
|
|
9652
|
-
|
|
9653
|
-
|
|
9654
|
-
const
|
|
9655
|
-
const pluginDir =
|
|
9656
|
-
const
|
|
9657
|
-
|
|
9658
|
-
|
|
9659
|
-
|
|
9660
|
-
).replace(
|
|
9661
|
-
/^import\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm,
|
|
9662
|
-
'const $1 = __plugin_require__("$2");'
|
|
9663
|
-
).replace(
|
|
9664
|
-
/^import\s+(\{[^}]+\})\s+from\s+['"]([^'"]+)['"]\s*;?/gm,
|
|
9665
|
-
'const $1 = __plugin_require__("$2");'
|
|
9666
|
-
).replace(
|
|
9667
|
-
/^import\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm,
|
|
9668
|
-
'const $1 = __plugin_require__("$2");'
|
|
9669
|
-
).replace(
|
|
9670
|
-
/^import\s+['"]([^'"]+)['"]\s*;?/gm,
|
|
9671
|
-
'__plugin_require__("$1");'
|
|
9672
|
-
);
|
|
9673
|
-
transformed = transformed.replace(/import\.meta/g, "__plugin_import_meta__");
|
|
9674
|
-
const wrapped = `(async () => {
|
|
9675
|
-
${transformed}
|
|
9676
|
-
})()`;
|
|
9677
|
-
const context = vm.createContext(globalThis, {
|
|
9678
|
-
codeGeneration: { strings: true, wasm: true }
|
|
9679
|
-
});
|
|
9680
|
-
context.__plugin_require__ = pluginRequire;
|
|
9681
|
-
context.__plugin_import_meta__ = Object.freeze({
|
|
9682
|
-
url: fileUrl,
|
|
9683
|
-
dirname: pluginDir,
|
|
9684
|
-
filename: filePath
|
|
9685
|
-
});
|
|
9686
|
-
const script = new vm.Script(wrapped, { filename: filePath });
|
|
9687
|
-
const result = script.runInContext(context);
|
|
9688
|
-
await result;
|
|
9941
|
+
__name(applyBunCryptoShim, "applyBunCryptoShim");
|
|
9942
|
+
function loadPluginModule(filePath) {
|
|
9943
|
+
applyBunCryptoShim();
|
|
9944
|
+
const code = fs4.readFileSync(filePath, "utf-8");
|
|
9945
|
+
const pluginDir = path2.dirname(filePath);
|
|
9946
|
+
const moduleObj = { exports: {} };
|
|
9947
|
+
const requireFn = createRequire(filePath);
|
|
9948
|
+
const moduleFn = new Function("exports", "require", "module", "__filename", "__dirname", code);
|
|
9949
|
+
moduleFn(moduleObj.exports, requireFn, moduleObj, filePath, pluginDir);
|
|
9689
9950
|
}
|
|
9690
|
-
__name(
|
|
9951
|
+
__name(loadPluginModule, "loadPluginModule");
|
|
9691
9952
|
var VarlockPlugin = class {
|
|
9692
9953
|
static {
|
|
9693
9954
|
__name(this, "VarlockPlugin");
|
|
@@ -9722,6 +9983,7 @@ var VarlockPlugin = class {
|
|
|
9722
9983
|
this._icon = val;
|
|
9723
9984
|
}
|
|
9724
9985
|
loadingError;
|
|
9986
|
+
warnings = [];
|
|
9725
9987
|
localPath;
|
|
9726
9988
|
/** reference to the `@plugin()` decorator instance(s) that installed the plugin */
|
|
9727
9989
|
installDecoratorInstances = [];
|
|
@@ -9763,22 +10025,70 @@ var VarlockPlugin = class {
|
|
|
9763
10025
|
this.debug("registerResolverFunction", resolverDef.name);
|
|
9764
10026
|
this.resolverFunctions.push(resolverDef);
|
|
9765
10027
|
}
|
|
10028
|
+
/**
|
|
10029
|
+
* Declare standard env vars this plugin uses.
|
|
10030
|
+
* Set during plugin init — the loading infrastructure will automatically
|
|
10031
|
+
* check for these vars and generate warnings if they are detected but not wired up.
|
|
10032
|
+
*
|
|
10033
|
+
* `key` accepts a single env var name or an array of alternatives — the first match is used.
|
|
10034
|
+
* `dataType` is used to generate `# @type=...` schema lines for vars not in the schema.
|
|
10035
|
+
*/
|
|
10036
|
+
standardVars;
|
|
10037
|
+
/** called by the loading infrastructure — checks declared standardVars against the graph */
|
|
10038
|
+
_checkStandardVars(graph) {
|
|
10039
|
+
if (!this.standardVars) return;
|
|
10040
|
+
const { initDecorator, params } = this.standardVars;
|
|
10041
|
+
const resolved = Object.entries(params).map(([paramName, { key, dataType }]) => {
|
|
10042
|
+
const keys = Array.isArray(key) ? key : [key];
|
|
10043
|
+
const matchedKey = keys.find((k) => graph.overrideValues[k]);
|
|
10044
|
+
return {
|
|
10045
|
+
paramName,
|
|
10046
|
+
matchedKey,
|
|
10047
|
+
resolvedKey: matchedKey || keys[0],
|
|
10048
|
+
dataType
|
|
10049
|
+
};
|
|
10050
|
+
});
|
|
10051
|
+
const detected = resolved.filter((v) => v.matchedKey);
|
|
10052
|
+
if (detected.length === 0) return;
|
|
10053
|
+
const detectedKeys = detected.map((v) => v.matchedKey);
|
|
10054
|
+
const needsSchemaSet = new Set(
|
|
10055
|
+
detected.filter((v) => !(v.resolvedKey in graph.configSchema)).map((v) => v.resolvedKey)
|
|
10056
|
+
);
|
|
10057
|
+
const wiringParams = detected.map((v) => ansis_default.green(`${v.paramName}=$${v.resolvedKey}`)).join(", ");
|
|
10058
|
+
const tip = [
|
|
10059
|
+
"",
|
|
10060
|
+
"Include in your schema and use in plugin initialization:",
|
|
10061
|
+
"",
|
|
10062
|
+
` # ${initDecorator}(..., ${wiringParams})`,
|
|
10063
|
+
" # ---"
|
|
10064
|
+
];
|
|
10065
|
+
for (const v of detected) {
|
|
10066
|
+
const inSchema = !needsSchemaSet.has(v.resolvedKey);
|
|
10067
|
+
if (v.dataType) {
|
|
10068
|
+
const typeLine = ` # @type=${v.dataType}`;
|
|
10069
|
+
tip.push(inSchema ? typeLine : ansis_default.green(typeLine));
|
|
10070
|
+
}
|
|
10071
|
+
const itemLine = ` ${v.resolvedKey}=`;
|
|
10072
|
+
tip.push(inSchema ? itemLine : ansis_default.green(itemLine));
|
|
10073
|
+
}
|
|
10074
|
+
tip.push("");
|
|
10075
|
+
this.warnings.push(new SchemaError(
|
|
10076
|
+
`${detectedKeys.join(", ")} found in environment but not connected to plugin`,
|
|
10077
|
+
{ isWarning: true, tip }
|
|
10078
|
+
));
|
|
10079
|
+
}
|
|
9766
10080
|
get pluginFilePath() {
|
|
9767
10081
|
if (this.type === "single-file") return this.localPath;
|
|
9768
10082
|
const pluginExport = this._packageJson?.exports?.["./plugin"] || "";
|
|
9769
10083
|
if (!pluginExport) throw new Error("Plugin package.json is missing ./plugin export");
|
|
9770
|
-
return
|
|
10084
|
+
return path2.join(this.localPath, pluginExport);
|
|
9771
10085
|
}
|
|
9772
10086
|
async executePluginModule() {
|
|
9773
10087
|
globalThis.plugin = this;
|
|
9774
10088
|
try {
|
|
9775
10089
|
if (!await pathExists(this.pluginFilePath)) throw new Error(`Plugin file not found: ${this.pluginFilePath}`);
|
|
9776
10090
|
importedPluginModulePaths.add(this.pluginFilePath);
|
|
9777
|
-
|
|
9778
|
-
await loadPluginModuleInSEA(this.pluginFilePath);
|
|
9779
|
-
} else {
|
|
9780
|
-
await import(pathToFileURL(this.pluginFilePath).href);
|
|
9781
|
-
}
|
|
10091
|
+
loadPluginModule(this.pluginFilePath);
|
|
9782
10092
|
} catch (err) {
|
|
9783
10093
|
this.loadingError = err;
|
|
9784
10094
|
}
|
|
@@ -9786,9 +10096,9 @@ var VarlockPlugin = class {
|
|
|
9786
10096
|
}
|
|
9787
10097
|
};
|
|
9788
10098
|
async function initPluginFromLocalPath(localPath) {
|
|
9789
|
-
const stats = await
|
|
10099
|
+
const stats = await fs2.stat(localPath);
|
|
9790
10100
|
if (stats.isFile()) {
|
|
9791
|
-
const ext =
|
|
10101
|
+
const ext = path2.extname(localPath).toLowerCase();
|
|
9792
10102
|
if ([".js", ".cjs", ".mjs"].includes(ext) === false) {
|
|
9793
10103
|
throw new SchemaError(`Single-file plugin must be a .js, .cjs, or .mjs file: ${localPath}`);
|
|
9794
10104
|
}
|
|
@@ -9797,11 +10107,11 @@ async function initPluginFromLocalPath(localPath) {
|
|
|
9797
10107
|
localPath
|
|
9798
10108
|
});
|
|
9799
10109
|
} else if (stats.isDirectory()) {
|
|
9800
|
-
const pkgJsonPath =
|
|
10110
|
+
const pkgJsonPath = path2.join(localPath, "package.json");
|
|
9801
10111
|
if (!await pathExists(pkgJsonPath)) {
|
|
9802
10112
|
throw new SchemaError("Plugin is missing package.json file");
|
|
9803
10113
|
}
|
|
9804
|
-
const packageJsonContents = JSON.parse(await
|
|
10114
|
+
const packageJsonContents = JSON.parse(await fs2.readFile(pkgJsonPath, "utf-8"));
|
|
9805
10115
|
if (!packageJsonContents.exports?.["./plugin"]) {
|
|
9806
10116
|
throw new SchemaError('Plugin is missing "./plugin" export in package.json');
|
|
9807
10117
|
}
|
|
@@ -9864,24 +10174,24 @@ async function registerPluginInGraph(graph, plugin, pluginDecorator) {
|
|
|
9864
10174
|
__name(registerPluginInGraph, "registerPluginInGraph");
|
|
9865
10175
|
async function downloadPlugin(url) {
|
|
9866
10176
|
const exec2 = promisify(exec);
|
|
9867
|
-
const cacheDir =
|
|
9868
|
-
const indexPath =
|
|
9869
|
-
await
|
|
10177
|
+
const cacheDir = path2.join(getUserVarlockDir(), "plugins-cache");
|
|
10178
|
+
const indexPath = path2.join(cacheDir, "index.json");
|
|
10179
|
+
await fs2.mkdir(cacheDir, { recursive: true });
|
|
9870
10180
|
let index = {};
|
|
9871
10181
|
try {
|
|
9872
|
-
const indexRaw = await
|
|
10182
|
+
const indexRaw = await fs2.readFile(indexPath, "utf-8");
|
|
9873
10183
|
index = JSON.parse(indexRaw);
|
|
9874
10184
|
} catch {
|
|
9875
10185
|
}
|
|
9876
10186
|
if (index[url]) {
|
|
9877
|
-
const pluginDir =
|
|
9878
|
-
if (await
|
|
10187
|
+
const pluginDir = path2.join(cacheDir, index[url]);
|
|
10188
|
+
if (await fs2.stat(pluginDir).then(() => true, () => false)) {
|
|
9879
10189
|
return pluginDir;
|
|
9880
10190
|
}
|
|
9881
10191
|
}
|
|
9882
|
-
const tmpTgz =
|
|
10192
|
+
const tmpTgz = path2.join(cacheDir, `tmp-${crypto.randomBytes(8).toString("hex")}.tgz`);
|
|
9883
10193
|
await new Promise((resolve, reject) => {
|
|
9884
|
-
const file =
|
|
10194
|
+
const file = fs4.createWriteStream(tmpTgz);
|
|
9885
10195
|
https.get(url, (res) => {
|
|
9886
10196
|
if (res.statusCode !== 200) {
|
|
9887
10197
|
reject(new Error(`Failed to download plugin: ${res.statusCode}`));
|
|
@@ -9892,28 +10202,28 @@ async function downloadPlugin(url) {
|
|
|
9892
10202
|
file.on("error", reject);
|
|
9893
10203
|
}).on("error", reject);
|
|
9894
10204
|
});
|
|
9895
|
-
const tmpExtractDir =
|
|
9896
|
-
await
|
|
10205
|
+
const tmpExtractDir = path2.join(cacheDir, `tmp-extract-${crypto.randomBytes(8).toString("hex")}`);
|
|
10206
|
+
await fs2.mkdir(tmpExtractDir);
|
|
9897
10207
|
await exec2(`tar -xzf ${tmpTgz} -C ${tmpExtractDir}`);
|
|
9898
|
-
let pkgJsonPath =
|
|
9899
|
-
let pluginRoot =
|
|
9900
|
-
if (!await
|
|
9901
|
-
pkgJsonPath =
|
|
10208
|
+
let pkgJsonPath = path2.join(tmpExtractDir, "package", "package.json");
|
|
10209
|
+
let pluginRoot = path2.join(tmpExtractDir, "package");
|
|
10210
|
+
if (!await fs2.stat(pkgJsonPath).then(() => true, () => false)) {
|
|
10211
|
+
pkgJsonPath = path2.join(tmpExtractDir, "package.json");
|
|
9902
10212
|
pluginRoot = tmpExtractDir;
|
|
9903
|
-
if (!await
|
|
10213
|
+
if (!await fs2.stat(pkgJsonPath).then(() => true, () => false)) {
|
|
9904
10214
|
throw new Error("package.json not found in plugin tgz");
|
|
9905
10215
|
}
|
|
9906
10216
|
}
|
|
9907
|
-
const pkgJson = JSON.parse(await
|
|
10217
|
+
const pkgJson = JSON.parse(await fs2.readFile(pkgJsonPath, "utf-8"));
|
|
9908
10218
|
const safePackageName = (pkgJson.name || "").replaceAll("/", "-").replaceAll("@", "");
|
|
9909
10219
|
const dirName = `${safePackageName}_${pkgJson.version || ""}_${crypto.randomBytes(4).toString("hex")}`;
|
|
9910
|
-
const finalDir =
|
|
9911
|
-
await
|
|
9912
|
-
await
|
|
9913
|
-
await
|
|
9914
|
-
await
|
|
10220
|
+
const finalDir = path2.join(cacheDir, dirName);
|
|
10221
|
+
await fs2.rm(finalDir, { recursive: true, force: true });
|
|
10222
|
+
await fs2.rename(pluginRoot, finalDir);
|
|
10223
|
+
await fs2.rm(tmpTgz, { force: true });
|
|
10224
|
+
await fs2.rm(tmpExtractDir, { recursive: true, force: true });
|
|
9915
10225
|
index[url] = dirName;
|
|
9916
|
-
await
|
|
10226
|
+
await fs2.writeFile(indexPath, JSON.stringify(index, null, 2));
|
|
9917
10227
|
return finalDir;
|
|
9918
10228
|
}
|
|
9919
10229
|
__name(downloadPlugin, "downloadPlugin");
|
|
@@ -9926,7 +10236,7 @@ async function processPluginInstallDecorators(dataSource) {
|
|
|
9926
10236
|
dataSource._loadingError = new Error("@plugin can only be used from a file-based data source");
|
|
9927
10237
|
return;
|
|
9928
10238
|
}
|
|
9929
|
-
const dataSourceDir =
|
|
10239
|
+
const dataSourceDir = path2.dirname(dataSource.fullPath);
|
|
9930
10240
|
for (const pluginDecorator of installPluginDecorators) {
|
|
9931
10241
|
let pluginSrcPath;
|
|
9932
10242
|
try {
|
|
@@ -9936,7 +10246,7 @@ async function processPluginInstallDecorators(dataSource) {
|
|
|
9936
10246
|
throw new SchemaError("Bad @plugin - must provide a string source location");
|
|
9937
10247
|
}
|
|
9938
10248
|
if (pluginSourceDescriptor.startsWith("./") || pluginSourceDescriptor.startsWith("../") || pluginSourceDescriptor.startsWith("/")) {
|
|
9939
|
-
pluginSrcPath = pluginSourceDescriptor.startsWith("/") ? pluginSourceDescriptor :
|
|
10249
|
+
pluginSrcPath = pluginSourceDescriptor.startsWith("/") ? pluginSourceDescriptor : path2.resolve(dataSourceDir, pluginSourceDescriptor);
|
|
9940
10250
|
if (!await pathExists(pluginSrcPath)) {
|
|
9941
10251
|
throw new SchemaError(`Bad @plugin path: ${pluginSourceDescriptor}`);
|
|
9942
10252
|
}
|
|
@@ -9968,22 +10278,17 @@ async function processPluginInstallDecorators(dataSource) {
|
|
|
9968
10278
|
} else if (versionDescriptor === "") {
|
|
9969
10279
|
throw new SchemaError('Bad @plugin version descriptor - remove "@" or specify a valid version');
|
|
9970
10280
|
}
|
|
10281
|
+
const workspaceRootPath = getWorkspaceInfo()?.rootPath;
|
|
9971
10282
|
let currentDir = dataSourceDir;
|
|
9972
10283
|
let nodeModulesPath;
|
|
9973
10284
|
while (currentDir) {
|
|
9974
|
-
if (await pathExists(
|
|
9975
|
-
nodeModulesPath =
|
|
9976
|
-
break;
|
|
10285
|
+
if (!nodeModulesPath && await pathExists(path2.join(currentDir, "package.json"))) {
|
|
10286
|
+
nodeModulesPath = path2.join(currentDir, "node_modules");
|
|
9977
10287
|
}
|
|
9978
|
-
const
|
|
9979
|
-
if (
|
|
9980
|
-
|
|
9981
|
-
|
|
9982
|
-
if (nodeModulesPath) {
|
|
9983
|
-
const pluginPackagePath = path.join(nodeModulesPath, moduleName);
|
|
9984
|
-
if (await pathExists(pluginPackagePath)) {
|
|
9985
|
-
const pluginPackageJsonPath = path.join(pluginPackagePath, "package.json");
|
|
9986
|
-
const packageJsonString = await fs.readFile(pluginPackageJsonPath, "utf-8");
|
|
10288
|
+
const candidatePluginPath = path2.join(currentDir, "node_modules", moduleName);
|
|
10289
|
+
if (await pathExists(candidatePluginPath)) {
|
|
10290
|
+
const pluginPackageJsonPath = path2.join(candidatePluginPath, "package.json");
|
|
10291
|
+
const packageJsonString = await fs2.readFile(pluginPackageJsonPath, "utf-8");
|
|
9987
10292
|
const packageJson = JSON.parse(packageJsonString);
|
|
9988
10293
|
const packageVersion = packageJson.version;
|
|
9989
10294
|
if (versionDescriptor && !import_semver.default.satisfies(packageVersion, versionDescriptor)) {
|
|
@@ -9991,8 +10296,13 @@ async function processPluginInstallDecorators(dataSource) {
|
|
|
9991
10296
|
location: getErrorLocation(dataSource, pluginDecorator)
|
|
9992
10297
|
});
|
|
9993
10298
|
}
|
|
9994
|
-
pluginSrcPath =
|
|
10299
|
+
pluginSrcPath = candidatePluginPath;
|
|
10300
|
+
break;
|
|
9995
10301
|
}
|
|
10302
|
+
if (workspaceRootPath && currentDir === workspaceRootPath) break;
|
|
10303
|
+
const parentDir = path2.dirname(currentDir);
|
|
10304
|
+
if (parentDir === currentDir) break;
|
|
10305
|
+
currentDir = parentDir;
|
|
9996
10306
|
}
|
|
9997
10307
|
if (!pluginSrcPath) {
|
|
9998
10308
|
if (!versionDescriptor) {
|
|
@@ -10109,6 +10419,7 @@ var EnvGraphDataSource2 = class {
|
|
|
10109
10419
|
*/
|
|
10110
10420
|
get isEnvSpecific() {
|
|
10111
10421
|
if (this.applyForEnv && !this.isImport) return true;
|
|
10422
|
+
if (this.type === "overrides") return true;
|
|
10112
10423
|
if (this._hasConditionalDisable) return true;
|
|
10113
10424
|
if (this.importMeta?.isConditionallyEnabled) return true;
|
|
10114
10425
|
if (this.parent?.isEnvSpecific) return true;
|
|
@@ -10253,9 +10564,9 @@ var EnvGraphDataSource2 = class {
|
|
|
10253
10564
|
if (!(this instanceof FileBasedDataSource)) {
|
|
10254
10565
|
throw new Error("@import of files can only be used from a file-based data source");
|
|
10255
10566
|
}
|
|
10256
|
-
fullImportPath =
|
|
10567
|
+
fullImportPath = path2.resolve(this.fullPath, "..", importPath);
|
|
10257
10568
|
} else if (importPath.startsWith("~/") || importPath === "~") {
|
|
10258
|
-
fullImportPath =
|
|
10569
|
+
fullImportPath = path2.join(os.homedir(), importPath.slice(1));
|
|
10259
10570
|
} else if (importPath.startsWith("/")) {
|
|
10260
10571
|
fullImportPath = importPath;
|
|
10261
10572
|
}
|
|
@@ -10271,7 +10582,7 @@ var EnvGraphDataSource2 = class {
|
|
|
10271
10582
|
throw new Error("expected @import allowMissing parameter to be a boolean");
|
|
10272
10583
|
}
|
|
10273
10584
|
if (fullImportPath) {
|
|
10274
|
-
const fileName =
|
|
10585
|
+
const fileName = path2.basename(fullImportPath);
|
|
10275
10586
|
if (this.graph.virtualImports) {
|
|
10276
10587
|
if (importPath.endsWith("/")) {
|
|
10277
10588
|
const dirExists = Object.keys(this.graph.virtualImports).some((p) => p.startsWith(fullImportPath));
|
|
@@ -10298,7 +10609,7 @@ var EnvGraphDataSource2 = class {
|
|
|
10298
10609
|
await this.addChild(source, { isImport: true, importKeys, isConditionallyEnabled });
|
|
10299
10610
|
}
|
|
10300
10611
|
} else {
|
|
10301
|
-
const fsStat = await tryCatch(async () =>
|
|
10612
|
+
const fsStat = await tryCatch(async () => fs2.stat(fullImportPath), (_err) => {
|
|
10302
10613
|
});
|
|
10303
10614
|
if (!fsStat && allowMissing) continue;
|
|
10304
10615
|
if (!fsStat) {
|
|
@@ -10433,8 +10744,8 @@ var FileBasedDataSource = class extends EnvGraphDataSource2 {
|
|
|
10433
10744
|
constructor(fullPath, opts) {
|
|
10434
10745
|
super();
|
|
10435
10746
|
this.fullPath = fullPath;
|
|
10436
|
-
this.fileName =
|
|
10437
|
-
this.relativePath =
|
|
10747
|
+
this.fileName = path2.basename(fullPath);
|
|
10748
|
+
this.relativePath = path2.relative(process.cwd(), fullPath);
|
|
10438
10749
|
if (opts?.overrideContents) {
|
|
10439
10750
|
this.rawContents = opts.overrideContents;
|
|
10440
10751
|
}
|
|
@@ -10467,7 +10778,7 @@ var FileBasedDataSource = class extends EnvGraphDataSource2 {
|
|
|
10467
10778
|
this._loadingError = new Error(`File does not exist: ${this.fullPath}`);
|
|
10468
10779
|
return;
|
|
10469
10780
|
}
|
|
10470
|
-
this.rawContents = await
|
|
10781
|
+
this.rawContents = await fs2.readFile(this.fullPath, "utf8");
|
|
10471
10782
|
}
|
|
10472
10783
|
if (this.rawContents) await this._parseContents();
|
|
10473
10784
|
}
|
|
@@ -10567,7 +10878,7 @@ var DirectoryDataSource = class extends EnvGraphDataSource2 {
|
|
|
10567
10878
|
schemaDataSource;
|
|
10568
10879
|
async addAutoLoadedFile(fileName) {
|
|
10569
10880
|
if (!this.graph) throw new Error("expected graph to be set");
|
|
10570
|
-
const filePath =
|
|
10881
|
+
const filePath = path2.join(this.basePath, fileName);
|
|
10571
10882
|
if (this.graph.virtualImports) {
|
|
10572
10883
|
if (this.graph.virtualImports[filePath]) {
|
|
10573
10884
|
const source2 = new DotEnvFileDataSource(filePath, { overrideContents: this.graph.virtualImports[filePath] });
|
|
@@ -10671,15 +10982,15 @@ var iconCacheFolderInit = false;
|
|
|
10671
10982
|
var iconInMemoryCache = {};
|
|
10672
10983
|
async function fetchIconSvg(iconifyName, color = "808080", iconCacheFolder = "/tmp/varlock-icon-cache") {
|
|
10673
10984
|
if (!iconCacheFolderInit) {
|
|
10674
|
-
|
|
10985
|
+
fs4.mkdirSync(iconCacheFolder, { recursive: true });
|
|
10675
10986
|
iconCacheFolderInit = true;
|
|
10676
10987
|
}
|
|
10677
10988
|
const iconPath = `${iconCacheFolder}/${iconifyName}-${ICON_SIZE}.svg`;
|
|
10678
10989
|
let svgSrc;
|
|
10679
10990
|
if (iconInMemoryCache[iconPath]) {
|
|
10680
10991
|
svgSrc = iconInMemoryCache[iconPath];
|
|
10681
|
-
} else if (
|
|
10682
|
-
const svgFileBuffer = await
|
|
10992
|
+
} else if (fs4.existsSync(iconPath)) {
|
|
10993
|
+
const svgFileBuffer = await fs4.promises.readFile(iconPath, "utf-8");
|
|
10683
10994
|
svgSrc = svgFileBuffer.toString();
|
|
10684
10995
|
iconInMemoryCache[iconPath] = svgSrc;
|
|
10685
10996
|
} else {
|
|
@@ -10691,7 +11002,7 @@ async function fetchIconSvg(iconifyName, color = "808080", iconCacheFolder = "/t
|
|
|
10691
11002
|
}
|
|
10692
11003
|
if (!svgSrc) return;
|
|
10693
11004
|
if (svgSrc) {
|
|
10694
|
-
await
|
|
11005
|
+
await fs4.promises.writeFile(iconPath, svgSrc, "utf-8");
|
|
10695
11006
|
iconInMemoryCache[iconPath] = svgSrc;
|
|
10696
11007
|
}
|
|
10697
11008
|
}
|
|
@@ -10813,7 +11124,7 @@ async function generateTypes(graph, lang, typesPath) {
|
|
|
10813
11124
|
items.push(await configItem.getTypeGenInfo());
|
|
10814
11125
|
}
|
|
10815
11126
|
const tsSrc = await generateTsTypesSrc(items);
|
|
10816
|
-
await
|
|
11127
|
+
await fs4.promises.writeFile(typesPath, tsSrc, "utf-8");
|
|
10817
11128
|
}
|
|
10818
11129
|
__name(generateTypes, "generateTypes");
|
|
10819
11130
|
|
|
@@ -10842,7 +11153,7 @@ var EnvGraph2 = class {
|
|
|
10842
11153
|
setVirtualImports(basePath, files) {
|
|
10843
11154
|
this.virtualImports = {};
|
|
10844
11155
|
for (const [fileName, fileContents] of Object.entries(files)) {
|
|
10845
|
-
this.virtualImports[
|
|
11156
|
+
this.virtualImports[path2.join(basePath, fileName)] = fileContents;
|
|
10846
11157
|
}
|
|
10847
11158
|
}
|
|
10848
11159
|
get sortedDataSources() {
|
|
@@ -10963,6 +11274,9 @@ var EnvGraph2 = class {
|
|
|
10963
11274
|
for (const plugin of this.plugins) {
|
|
10964
11275
|
if (plugin.loadingError) return;
|
|
10965
11276
|
}
|
|
11277
|
+
for (const plugin of this.plugins) {
|
|
11278
|
+
plugin._checkStandardVars(this);
|
|
11279
|
+
}
|
|
10966
11280
|
for (const key in this.configSchema) {
|
|
10967
11281
|
if (isBuiltinVar(key)) this.registerBuiltinVar(key);
|
|
10968
11282
|
}
|
|
@@ -10971,7 +11285,7 @@ var EnvGraph2 = class {
|
|
|
10971
11285
|
if (source.disabled) continue;
|
|
10972
11286
|
for (const decInstance of source.rootDecorators) {
|
|
10973
11287
|
await decInstance.process();
|
|
10974
|
-
if (decInstance.schemaErrors.
|
|
11288
|
+
if (decInstance.schemaErrors.some((e) => !e.isWarning)) processingError = true;
|
|
10975
11289
|
}
|
|
10976
11290
|
}
|
|
10977
11291
|
for (const itemKey in this.configSchema) {
|
|
@@ -11045,7 +11359,7 @@ var EnvGraph2 = class {
|
|
|
11045
11359
|
const resolveItem = /* @__PURE__ */ __name(async (itemKey) => {
|
|
11046
11360
|
if (itemsToResolveStatus[itemKey] !== false) return;
|
|
11047
11361
|
const item = this.configSchema[itemKey];
|
|
11048
|
-
if (item.errors.
|
|
11362
|
+
if (item.errors.some((e) => !e.isWarning)) {
|
|
11049
11363
|
markItemCompleted(itemKey);
|
|
11050
11364
|
return;
|
|
11051
11365
|
}
|
|
@@ -11102,7 +11416,7 @@ var EnvGraph2 = class {
|
|
|
11102
11416
|
serializedGraph.sources.push({
|
|
11103
11417
|
label: source.label,
|
|
11104
11418
|
enabled: !source.disabled,
|
|
11105
|
-
path: source instanceof FileBasedDataSource ?
|
|
11419
|
+
path: source instanceof FileBasedDataSource ? path2.relative(this.basePath ?? "", source.fullPath) : void 0
|
|
11106
11420
|
});
|
|
11107
11421
|
}
|
|
11108
11422
|
for (const itemKey of this.sortedConfigKeys) {
|
|
@@ -11143,7 +11457,7 @@ var EnvGraph2 = class {
|
|
|
11143
11457
|
if (typeGenSettings.obj.lang !== "ts") throw new Error(`@generateTypes - unsupported language: ${typeGenSettings.obj.lang}`);
|
|
11144
11458
|
if (!typeGenSettings.obj.path) throw new Error("@generateTypes - must set `path` arg");
|
|
11145
11459
|
if (!my_dash_default.isString(typeGenSettings.obj.path)) throw new Error("@generateTypes - `path` arg must be a string");
|
|
11146
|
-
const outputPath = generateTypesDec.dataSource instanceof FileBasedDataSource ?
|
|
11460
|
+
const outputPath = generateTypesDec.dataSource instanceof FileBasedDataSource ? path2.resolve(generateTypesDec.dataSource.fullPath, "..", typeGenSettings.obj.path) : typeGenSettings.obj.path;
|
|
11147
11461
|
await this.generateTypes(typeGenSettings.obj.lang, outputPath);
|
|
11148
11462
|
generatedCount++;
|
|
11149
11463
|
}
|
|
@@ -11515,10 +11829,10 @@ var ConfigItem = class {
|
|
|
11515
11829
|
get isCoerced() {
|
|
11516
11830
|
return this.resolvedRawValue !== this.resolvedValue;
|
|
11517
11831
|
}
|
|
11518
|
-
async resolve(
|
|
11519
|
-
if (this._schemaErrors.
|
|
11520
|
-
if (this.resolverSchemaErrors.
|
|
11521
|
-
if (
|
|
11832
|
+
async resolve(reset2 = false) {
|
|
11833
|
+
if (this._schemaErrors.some((e) => !e.isWarning)) return;
|
|
11834
|
+
if (this.resolverSchemaErrors.some((e) => !e.isWarning)) return;
|
|
11835
|
+
if (reset2) {
|
|
11522
11836
|
this.isResolved = false;
|
|
11523
11837
|
this.isValidated = false;
|
|
11524
11838
|
this.resolutionError = void 0;
|
|
@@ -11767,6 +12081,6 @@ var ConfigItem = class {
|
|
|
11767
12081
|
};
|
|
11768
12082
|
//! these are probably not relevant anymore, or needs to move to a plugin layer?
|
|
11769
12083
|
|
|
11770
|
-
export { CoercionError, ConfigItem, ConfigLoadError, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, ParsedEnvSpecStaticValue, ResolutionError, SchemaError, ValidationError, VarlockError, envSpecUpdater, getUserVarlockDir, my_dash_default, parseEnvSpecDotEnvFile, pathExists,
|
|
11771
|
-
//# sourceMappingURL=chunk-
|
|
11772
|
-
//# sourceMappingURL=chunk-
|
|
12084
|
+
export { CoercionError, ConfigItem, ConfigLoadError, DirectoryDataSource, DotEnvFileDataSource, EnvGraph2 as EnvGraph, ParsedEnvSpecStaticValue, ResolutionError, SchemaError, ValidationError, VarlockError, ansis_default, detectWorkspaceInfo, envSpecUpdater, getUserVarlockDir, my_dash_default, parseEnvSpecDotEnvFile, pathExists, require_semver2 as require_semver, runWithWorkspaceInfo, tryCatch };
|
|
12085
|
+
//# sourceMappingURL=chunk-2AGKN64R.js.map
|
|
12086
|
+
//# sourceMappingURL=chunk-2AGKN64R.js.map
|