@gql.tada/cli-utils 1.7.4 → 1.8.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/CHANGELOG.md +35 -0
- package/dist/chunks/index-chunk.js +735 -561
- package/dist/chunks/index-chunk.js.map +1 -1
- package/dist/chunks/index-chunk.mjs +951 -777
- package/dist/chunks/index-chunk.mjs.map +1 -1
- package/dist/chunks/runner-chunk.js +912 -880
- package/dist/chunks/runner-chunk.js.map +1 -1
- package/dist/chunks/runner-chunk.mjs +45 -13
- package/dist/chunks/runner-chunk.mjs.map +1 -1
- package/dist/chunks/thread-chunk.js +472 -476
- package/dist/chunks/thread-chunk.js.map +1 -1
- package/dist/chunks/thread-chunk.mjs +494 -498
- package/dist/chunks/thread-chunk.mjs.map +1 -1
- package/dist/chunks/thread-chunk2.js +528 -171
- package/dist/chunks/thread-chunk2.js.map +1 -1
- package/dist/chunks/thread-chunk2.mjs +529 -180
- package/dist/chunks/thread-chunk2.mjs.map +1 -1
- package/dist/chunks/thread-chunk3.js +45 -33
- package/dist/chunks/thread-chunk3.js.map +1 -1
- package/dist/chunks/thread-chunk3.mjs +51 -39
- package/dist/chunks/thread-chunk3.mjs.map +1 -1
- package/dist/gql-tada-cli.d.ts +6 -0
- package/package.json +4 -4
|
@@ -54,9 +54,9 @@ var f;
|
|
|
54
54
|
t[t.CustomNode = 3] = "CustomNode";
|
|
55
55
|
}(f || (f = {}));
|
|
56
56
|
|
|
57
|
-
var
|
|
57
|
+
var p = -1;
|
|
58
58
|
|
|
59
|
-
var
|
|
59
|
+
var g = /^(-h|--help)(?:=([0-9]+))?$/;
|
|
60
60
|
|
|
61
61
|
var h = /^(--[a-z]+(?:-[a-z]+)*|-[a-zA-Z]+)$/;
|
|
62
62
|
|
|
@@ -121,14 +121,14 @@ var whileRunning = t => `While running ${t.filter((t => t !== d.EndOfInput && t
|
|
|
121
121
|
}
|
|
122
122
|
})).join(" ")}`;
|
|
123
123
|
|
|
124
|
-
var
|
|
124
|
+
var w = Array(80).fill("━");
|
|
125
125
|
|
|
126
|
-
for (var
|
|
127
|
-
|
|
126
|
+
for (var S = 0; S <= 24; ++S) {
|
|
127
|
+
w[w.length - S] = `[38;5;${232 + S}m━`;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
var b = {
|
|
131
|
-
header: t => `[1m━━━ ${t}${t.length < 75 ? ` ${
|
|
131
|
+
header: t => `[1m━━━ ${t}${t.length < 75 ? ` ${w.slice(t.length + 5).join("")}` : ":"}[0m`,
|
|
132
132
|
bold: t => `[1m${t}[22m`,
|
|
133
133
|
error: t => `[31m[1m${t}[22m[39m`,
|
|
134
134
|
code: t => `[36m${t}[39m`
|
|
@@ -242,7 +242,7 @@ class Command {
|
|
|
242
242
|
var t = this.constructor.schema;
|
|
243
243
|
if (Array.isArray(t)) {
|
|
244
244
|
var {isDict: r, isUnknown: i, applyCascade: n} = await Promise.resolve().then((function() {
|
|
245
|
-
return
|
|
245
|
+
return z;
|
|
246
246
|
}));
|
|
247
247
|
var a = [];
|
|
248
248
|
var o = [];
|
|
@@ -286,7 +286,7 @@ var C = {
|
|
|
286
286
|
positionals: [],
|
|
287
287
|
options: [],
|
|
288
288
|
remainder: null,
|
|
289
|
-
selectedIndex:
|
|
289
|
+
selectedIndex: p,
|
|
290
290
|
tokens: []
|
|
291
291
|
};
|
|
292
292
|
|
|
@@ -343,13 +343,13 @@ function runMachineInternal(t, r, i = !1) {
|
|
|
343
343
|
var c = o - 1;
|
|
344
344
|
debug(` Processing ${JSON.stringify(s)}`);
|
|
345
345
|
var u = [];
|
|
346
|
-
for (var {node:
|
|
347
|
-
debug(` Current node is ${
|
|
348
|
-
var h = t.nodes[
|
|
349
|
-
if (
|
|
346
|
+
for (var {node: p, state: g} of n) {
|
|
347
|
+
debug(` Current node is ${p}`);
|
|
348
|
+
var h = t.nodes[p];
|
|
349
|
+
if (p === f.ErrorNode) {
|
|
350
350
|
u.push({
|
|
351
|
-
node:
|
|
352
|
-
state:
|
|
351
|
+
node: p,
|
|
352
|
+
state: g
|
|
353
353
|
});
|
|
354
354
|
continue;
|
|
355
355
|
}
|
|
@@ -358,12 +358,12 @@ function runMachineInternal(t, r, i = !1) {
|
|
|
358
358
|
if (!i || o < a.length - 1 || v) {
|
|
359
359
|
if (v) {
|
|
360
360
|
var m = h.statics[s];
|
|
361
|
-
for (var {to:
|
|
361
|
+
for (var {to: w, reducer: S} of m) {
|
|
362
362
|
u.push({
|
|
363
|
-
node:
|
|
364
|
-
state: void 0 !==
|
|
363
|
+
node: w,
|
|
364
|
+
state: void 0 !== S ? execute(O, S, g, s, c) : g
|
|
365
365
|
});
|
|
366
|
-
debug(` Static transition to ${
|
|
366
|
+
debug(` Static transition to ${w} found`);
|
|
367
367
|
}
|
|
368
368
|
} else {
|
|
369
369
|
debug(" No static transition found");
|
|
@@ -378,7 +378,7 @@ function runMachineInternal(t, r, i = !1) {
|
|
|
378
378
|
for (var {to: E, reducer: k} of h.statics[x]) {
|
|
379
379
|
u.push({
|
|
380
380
|
node: E,
|
|
381
|
-
state: void 0 !== k ? execute(
|
|
381
|
+
state: void 0 !== k ? execute(O, k, g, s, c) : g
|
|
382
382
|
});
|
|
383
383
|
debug(` Static transition to ${E} found`);
|
|
384
384
|
}
|
|
@@ -387,7 +387,7 @@ function runMachineInternal(t, r, i = !1) {
|
|
|
387
387
|
u.push({
|
|
388
388
|
node: N,
|
|
389
389
|
state: {
|
|
390
|
-
...
|
|
390
|
+
...g,
|
|
391
391
|
remainder: x.slice(s.length)
|
|
392
392
|
}
|
|
393
393
|
});
|
|
@@ -402,10 +402,10 @@ function runMachineInternal(t, r, i = !1) {
|
|
|
402
402
|
}
|
|
403
403
|
if (!l) {
|
|
404
404
|
for (var [I, {to: T, reducer: P}] of h.dynamics) {
|
|
405
|
-
if (execute(
|
|
405
|
+
if (execute($, I, g, s, c)) {
|
|
406
406
|
u.push({
|
|
407
407
|
node: T,
|
|
408
|
-
state: void 0 !== P ? execute(
|
|
408
|
+
state: void 0 !== P ? execute(O, P, g, s, c) : g
|
|
409
409
|
});
|
|
410
410
|
debug(` Dynamic transition to ${T} found (via ${I})`);
|
|
411
411
|
}
|
|
@@ -449,7 +449,7 @@ function runMachine(t, r, {endToken: i = d.EndOfInput} = {}) {
|
|
|
449
449
|
if (0 === i.length) {
|
|
450
450
|
throw new Error;
|
|
451
451
|
}
|
|
452
|
-
var n = i.filter((t => t.selectedIndex ===
|
|
452
|
+
var n = i.filter((t => t.selectedIndex === p || t.requiredOptions.every((r => r.some((r => t.options.find((t => t.name === r))))))));
|
|
453
453
|
if (0 === n.length) {
|
|
454
454
|
throw new UnknownSyntaxError(t, i.map((t => ({
|
|
455
455
|
usage: t.candidateUsage,
|
|
@@ -478,7 +478,7 @@ function runMachine(t, r, {endToken: i = d.EndOfInput} = {}) {
|
|
|
478
478
|
var r = [];
|
|
479
479
|
var i = [];
|
|
480
480
|
for (var n of t) {
|
|
481
|
-
if (n.selectedIndex ===
|
|
481
|
+
if (n.selectedIndex === p) {
|
|
482
482
|
i.push(n);
|
|
483
483
|
} else {
|
|
484
484
|
r.push(n);
|
|
@@ -576,7 +576,7 @@ function execute(t, r, i, n, a) {
|
|
|
576
576
|
}
|
|
577
577
|
}
|
|
578
578
|
|
|
579
|
-
var
|
|
579
|
+
var $ = {
|
|
580
580
|
always: () => !0,
|
|
581
581
|
isOptionLike: (t, r) => !t.ignoreOptions && "-" !== r && r.startsWith("-"),
|
|
582
582
|
isNotOptionLike: (t, r) => t.ignoreOptions || "-" === r || !r.startsWith("-"),
|
|
@@ -587,12 +587,12 @@ var O = {
|
|
|
587
587
|
return !t.ignoreOptions && !!o && h.test(o[1]) && n.has(o[1]) && a.filter((t => t.nameSet.includes(o[1]))).every((t => t.allowBinding));
|
|
588
588
|
},
|
|
589
589
|
isNegatedOption: (t, r, i, n) => !t.ignoreOptions && r === `--no-${n.slice(2)}`,
|
|
590
|
-
isHelp: (t, r) => !t.ignoreOptions &&
|
|
590
|
+
isHelp: (t, r) => !t.ignoreOptions && g.test(r),
|
|
591
591
|
isUnsupportedOption: (t, r, i, n) => !t.ignoreOptions && r.startsWith("-") && h.test(r) && !n.has(r),
|
|
592
592
|
isInvalidOption: (t, r) => !t.ignoreOptions && r.startsWith("-") && !h.test(r)
|
|
593
593
|
};
|
|
594
594
|
|
|
595
|
-
var
|
|
595
|
+
var O = {
|
|
596
596
|
setCandidateState: (t, r, i, n) => ({
|
|
597
597
|
...t,
|
|
598
598
|
...n
|
|
@@ -789,7 +789,7 @@ var $ = {
|
|
|
789
789
|
ignoreOptions: !0
|
|
790
790
|
}),
|
|
791
791
|
useHelp: (t, r, i, n) => {
|
|
792
|
-
var [, , a] = r.match(
|
|
792
|
+
var [, , a] = r.match(g);
|
|
793
793
|
if (void 0 !== a) {
|
|
794
794
|
return {
|
|
795
795
|
...t,
|
|
@@ -937,17 +937,17 @@ class CommandBuilder {
|
|
|
937
937
|
for (var f = 0; f < s; ++f) {
|
|
938
938
|
d.push(` #${f}`);
|
|
939
939
|
}
|
|
940
|
-
var
|
|
940
|
+
var p = `${o.join(",")}${d.join("")}`;
|
|
941
941
|
if (!r && c) {
|
|
942
942
|
n.push({
|
|
943
943
|
preferredName: a,
|
|
944
944
|
nameSet: o,
|
|
945
|
-
definition:
|
|
945
|
+
definition: p,
|
|
946
946
|
description: c,
|
|
947
947
|
required: u
|
|
948
948
|
});
|
|
949
949
|
} else {
|
|
950
|
-
i.push(u ? `<${
|
|
950
|
+
i.push(u ? `<${p}>` : `[${p}]`);
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
i.push(...this.arity.leading.map((t => `<${t}>`)));
|
|
@@ -995,13 +995,13 @@ class CommandBuilder {
|
|
|
995
995
|
l = c;
|
|
996
996
|
}
|
|
997
997
|
for (var u = 0; u < s.length; ++u) {
|
|
998
|
-
var
|
|
998
|
+
var g = injectNode(t, {
|
|
999
999
|
dynamics: [],
|
|
1000
1000
|
shortcuts: [],
|
|
1001
1001
|
statics: {}
|
|
1002
1002
|
});
|
|
1003
|
-
registerStatic(t, l, s[u],
|
|
1004
|
-
l =
|
|
1003
|
+
registerStatic(t, l, s[u], g, "pushPath");
|
|
1004
|
+
l = g;
|
|
1005
1005
|
if (u + 1 < s.length) {
|
|
1006
1006
|
var h = injectNode(t, {
|
|
1007
1007
|
dynamics: [],
|
|
@@ -1009,7 +1009,7 @@ class CommandBuilder {
|
|
|
1009
1009
|
statics: {}
|
|
1010
1010
|
});
|
|
1011
1011
|
registerDynamic(t, l, "isHelp", h, [ "useHelp", this.cliIndex ]);
|
|
1012
|
-
registerStatic(t, h, d.EndOfInput, f.SuccessNode, [ "setSelectedIndex",
|
|
1012
|
+
registerStatic(t, h, d.EndOfInput, f.SuccessNode, [ "setSelectedIndex", p ]);
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
if (this.arity.leading.length > 0 || !this.arity.proxy) {
|
|
@@ -1020,7 +1020,7 @@ class CommandBuilder {
|
|
|
1020
1020
|
});
|
|
1021
1021
|
registerDynamic(t, l, "isHelp", v, [ "useHelp", this.cliIndex ]);
|
|
1022
1022
|
registerDynamic(t, v, "always", v, "pushExtra");
|
|
1023
|
-
registerStatic(t, v, d.EndOfInput, f.SuccessNode, [ "setSelectedIndex",
|
|
1023
|
+
registerStatic(t, v, d.EndOfInput, f.SuccessNode, [ "setSelectedIndex", p ]);
|
|
1024
1024
|
this.registerOptions(t, l);
|
|
1025
1025
|
}
|
|
1026
1026
|
if (this.arity.leading.length > 0) {
|
|
@@ -1029,22 +1029,22 @@ class CommandBuilder {
|
|
|
1029
1029
|
}
|
|
1030
1030
|
var m = l;
|
|
1031
1031
|
for (var y = 0; y < this.arity.leading.length; ++y) {
|
|
1032
|
-
var
|
|
1032
|
+
var w = injectNode(t, {
|
|
1033
1033
|
dynamics: [],
|
|
1034
1034
|
shortcuts: [],
|
|
1035
1035
|
statics: {}
|
|
1036
1036
|
});
|
|
1037
1037
|
if (!this.arity.proxy || y + 1 !== this.arity.leading.length) {
|
|
1038
|
-
this.registerOptions(t,
|
|
1038
|
+
this.registerOptions(t, w);
|
|
1039
1039
|
}
|
|
1040
1040
|
if (this.arity.trailing.length > 0 || y + 1 !== this.arity.leading.length) {
|
|
1041
|
-
registerStatic(t,
|
|
1042
|
-
registerStatic(t,
|
|
1041
|
+
registerStatic(t, w, d.EndOfInput, f.ErrorNode, [ "setError", "Not enough positional arguments" ]);
|
|
1042
|
+
registerStatic(t, w, d.EndOfPartialInput, f.SuccessNode, [ "setSelectedIndex", this.cliIndex ]);
|
|
1043
1043
|
}
|
|
1044
|
-
registerDynamic(t, m, "isNotOptionLike",
|
|
1045
|
-
m =
|
|
1044
|
+
registerDynamic(t, m, "isNotOptionLike", w, "pushPositional");
|
|
1045
|
+
m = w;
|
|
1046
1046
|
}
|
|
1047
|
-
var
|
|
1047
|
+
var S = m;
|
|
1048
1048
|
if (this.arity.extra === k || this.arity.extra.length > 0) {
|
|
1049
1049
|
var b = injectNode(t, {
|
|
1050
1050
|
dynamics: [],
|
|
@@ -1074,19 +1074,19 @@ class CommandBuilder {
|
|
|
1074
1074
|
if (!this.arity.proxy || E > 0) {
|
|
1075
1075
|
this.registerOptions(t, C);
|
|
1076
1076
|
}
|
|
1077
|
-
registerDynamic(t,
|
|
1077
|
+
registerDynamic(t, S, a, C, "pushExtra");
|
|
1078
1078
|
registerShortcut(t, C, b);
|
|
1079
|
-
|
|
1079
|
+
S = C;
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
1082
|
-
|
|
1082
|
+
S = b;
|
|
1083
1083
|
}
|
|
1084
1084
|
if (this.arity.trailing.length > 0) {
|
|
1085
|
-
registerStatic(t,
|
|
1086
|
-
registerStatic(t,
|
|
1085
|
+
registerStatic(t, S, d.EndOfInput, f.ErrorNode, [ "setError", "Not enough positional arguments" ]);
|
|
1086
|
+
registerStatic(t, S, d.EndOfPartialInput, f.SuccessNode, [ "setSelectedIndex", this.cliIndex ]);
|
|
1087
1087
|
}
|
|
1088
|
-
var
|
|
1089
|
-
for (var
|
|
1088
|
+
var $ = S;
|
|
1089
|
+
for (var O = 0; O < this.arity.trailing.length; ++O) {
|
|
1090
1090
|
var N = injectNode(t, {
|
|
1091
1091
|
dynamics: [],
|
|
1092
1092
|
shortcuts: [],
|
|
@@ -1095,16 +1095,16 @@ class CommandBuilder {
|
|
|
1095
1095
|
if (!this.arity.proxy) {
|
|
1096
1096
|
this.registerOptions(t, N);
|
|
1097
1097
|
}
|
|
1098
|
-
if (
|
|
1098
|
+
if (O + 1 < this.arity.trailing.length) {
|
|
1099
1099
|
registerStatic(t, N, d.EndOfInput, f.ErrorNode, [ "setError", "Not enough positional arguments" ]);
|
|
1100
1100
|
registerStatic(t, N, d.EndOfPartialInput, f.SuccessNode, [ "setSelectedIndex", this.cliIndex ]);
|
|
1101
1101
|
}
|
|
1102
|
-
registerDynamic(t,
|
|
1103
|
-
|
|
1102
|
+
registerDynamic(t, $, "isNotOptionLike", N, "pushPositional");
|
|
1103
|
+
$ = N;
|
|
1104
1104
|
}
|
|
1105
|
-
registerDynamic(t,
|
|
1106
|
-
registerStatic(t,
|
|
1107
|
-
registerStatic(t,
|
|
1105
|
+
registerDynamic(t, $, a, f.ErrorNode, [ "setError", "Extraneous positional argument" ]);
|
|
1106
|
+
registerStatic(t, $, d.EndOfInput, f.SuccessNode, [ "setSelectedIndex", this.cliIndex ]);
|
|
1107
|
+
registerStatic(t, $, d.EndOfPartialInput, f.SuccessNode, [ "setSelectedIndex", this.cliIndex ]);
|
|
1108
1108
|
}
|
|
1109
1109
|
return {
|
|
1110
1110
|
machine: t,
|
|
@@ -1228,14 +1228,14 @@ class CliBuilder {
|
|
|
1228
1228
|
while (n.shortcuts.length > 0) {
|
|
1229
1229
|
var {to: u} = n.shortcuts.shift();
|
|
1230
1230
|
var d = t.nodes[u];
|
|
1231
|
-
for (var [f,
|
|
1232
|
-
var
|
|
1231
|
+
for (var [f, p] of Object.entries(d.statics)) {
|
|
1232
|
+
var g = !Object.prototype.hasOwnProperty.call(n.statics, f) ? n.statics[f] = [] : n.statics[f];
|
|
1233
1233
|
var _loop = function(t) {
|
|
1234
|
-
if (!
|
|
1235
|
-
|
|
1234
|
+
if (!g.some((({to: r}) => t.to === r))) {
|
|
1235
|
+
g.push(t);
|
|
1236
1236
|
}
|
|
1237
1237
|
};
|
|
1238
|
-
for (var h of
|
|
1238
|
+
for (var h of p) {
|
|
1239
1239
|
_loop(h);
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
@@ -1379,7 +1379,7 @@ class Cli {
|
|
|
1379
1379
|
...Cli.defaultContext,
|
|
1380
1380
|
...n
|
|
1381
1381
|
};
|
|
1382
|
-
if (l.selectedIndex ===
|
|
1382
|
+
if (l.selectedIndex === p) {
|
|
1383
1383
|
var u = HelpCommand.from(l, o);
|
|
1384
1384
|
u.context = c;
|
|
1385
1385
|
u.tokens = l.tokens;
|
|
@@ -1390,17 +1390,17 @@ class Cli {
|
|
|
1390
1390
|
if (void 0 === f) {
|
|
1391
1391
|
throw new Error("Assertion failed: Expected the command class to have been registered.");
|
|
1392
1392
|
}
|
|
1393
|
-
var
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1393
|
+
var g = new d;
|
|
1394
|
+
g.context = c;
|
|
1395
|
+
g.tokens = l.tokens;
|
|
1396
|
+
g.path = l.path;
|
|
1397
1397
|
try {
|
|
1398
1398
|
for (var [h, {transformer: v}] of f.specs.entries()) {
|
|
1399
|
-
|
|
1399
|
+
g[h] = v(f.builder, h, l, c);
|
|
1400
1400
|
}
|
|
1401
|
-
return
|
|
1401
|
+
return g;
|
|
1402
1402
|
} catch (t) {
|
|
1403
|
-
t[N] =
|
|
1403
|
+
t[N] = g;
|
|
1404
1404
|
throw t;
|
|
1405
1405
|
}
|
|
1406
1406
|
}
|
|
@@ -1544,11 +1544,11 @@ class Cli {
|
|
|
1544
1544
|
var d = "";
|
|
1545
1545
|
if (!u) {
|
|
1546
1546
|
var f = new Map;
|
|
1547
|
-
for (var [
|
|
1548
|
-
if (void 0 ===
|
|
1547
|
+
for (var [p, {index: g}] of this.registrations.entries()) {
|
|
1548
|
+
if (void 0 === p.usage) {
|
|
1549
1549
|
continue;
|
|
1550
1550
|
}
|
|
1551
|
-
var h = void 0 !==
|
|
1551
|
+
var h = void 0 !== p.usage.category ? formatMarkdownish(p.usage.category, {
|
|
1552
1552
|
format: this.format(r),
|
|
1553
1553
|
paragraphs: !1
|
|
1554
1554
|
}) : null;
|
|
@@ -1556,9 +1556,9 @@ class Cli {
|
|
|
1556
1556
|
if (void 0 === v) {
|
|
1557
1557
|
f.set(h, v = []);
|
|
1558
1558
|
}
|
|
1559
|
-
var {usage: m} = this.getUsageByIndex(
|
|
1559
|
+
var {usage: m} = this.getUsageByIndex(g);
|
|
1560
1560
|
v.push({
|
|
1561
|
-
commandClass:
|
|
1561
|
+
commandClass: p,
|
|
1562
1562
|
usage: m
|
|
1563
1563
|
});
|
|
1564
1564
|
}
|
|
@@ -1574,12 +1574,12 @@ class Cli {
|
|
|
1574
1574
|
caseFirst: "upper"
|
|
1575
1575
|
});
|
|
1576
1576
|
}));
|
|
1577
|
-
var
|
|
1578
|
-
var
|
|
1579
|
-
if (
|
|
1580
|
-
if (
|
|
1577
|
+
var w = void 0 !== this.binaryLabel;
|
|
1578
|
+
var S = void 0 !== this.binaryVersion;
|
|
1579
|
+
if (w || S) {
|
|
1580
|
+
if (w && S) {
|
|
1581
1581
|
d += `${this.format(r).header(`${this.binaryLabel} - ${this.binaryVersion}`)}\n\n`;
|
|
1582
|
-
} else if (
|
|
1582
|
+
} else if (w) {
|
|
1583
1583
|
d += `${this.format(r).header(`${this.binaryLabel}`)}\n`;
|
|
1584
1584
|
} else {
|
|
1585
1585
|
d += `${this.format(r).header(`${this.binaryVersion}`)}\n`;
|
|
@@ -1596,11 +1596,11 @@ class Cli {
|
|
|
1596
1596
|
var E = null !== b ? b.trim() : "General commands";
|
|
1597
1597
|
d += "\n";
|
|
1598
1598
|
d += `${this.format(r).header(`${E}`)}\n`;
|
|
1599
|
-
for (var {commandClass: C, usage:
|
|
1600
|
-
var
|
|
1599
|
+
for (var {commandClass: C, usage: $} of x) {
|
|
1600
|
+
var O = C.usage.description || "undocumented";
|
|
1601
1601
|
d += "\n";
|
|
1602
|
-
d += ` ${this.format(r).bold(
|
|
1603
|
-
d += ` ${formatMarkdownish(
|
|
1602
|
+
d += ` ${this.format(r).bold($)}\n`;
|
|
1603
|
+
d += ` ${formatMarkdownish(O, {
|
|
1604
1604
|
format: this.format(r),
|
|
1605
1605
|
paragraphs: !1
|
|
1606
1606
|
})}`;
|
|
@@ -1636,8 +1636,8 @@ class Cli {
|
|
|
1636
1636
|
d += `${this.format(r).header("Options")}\n`;
|
|
1637
1637
|
var B = M.reduce(((t, r) => Math.max(t, r.definition.length)), 0);
|
|
1638
1638
|
d += "\n";
|
|
1639
|
-
for (var {definition: F, description:
|
|
1640
|
-
d += ` ${this.format(r).bold(F.padEnd(B))} ${formatMarkdownish(
|
|
1639
|
+
for (var {definition: F, description: j} of M) {
|
|
1640
|
+
d += ` ${this.format(r).bold(F.padEnd(B))} ${formatMarkdownish(j, {
|
|
1641
1641
|
format: this.format(r),
|
|
1642
1642
|
paragraphs: !1
|
|
1643
1643
|
})}`;
|
|
@@ -1655,13 +1655,13 @@ class Cli {
|
|
|
1655
1655
|
if (T.length > 0) {
|
|
1656
1656
|
d += "\n";
|
|
1657
1657
|
d += `${this.format(r).header("Examples")}\n`;
|
|
1658
|
-
for (var [
|
|
1658
|
+
for (var [R, L] of T) {
|
|
1659
1659
|
d += "\n";
|
|
1660
|
-
d += formatMarkdownish(
|
|
1660
|
+
d += formatMarkdownish(R, {
|
|
1661
1661
|
format: this.format(r),
|
|
1662
1662
|
paragraphs: !1
|
|
1663
1663
|
});
|
|
1664
|
-
d += `${
|
|
1664
|
+
d += `${L.replace(/^/m, ` ${this.format(r).bold(n)}`).replace(/\$0/g, this.binaryName)}\n`;
|
|
1665
1665
|
}
|
|
1666
1666
|
}
|
|
1667
1667
|
}
|
|
@@ -2410,7 +2410,7 @@ var F = function(t) {
|
|
|
2410
2410
|
return t;
|
|
2411
2411
|
}(F || {});
|
|
2412
2412
|
|
|
2413
|
-
var
|
|
2413
|
+
var j = function(t) {
|
|
2414
2414
|
t[t.AppCursorKeys = 1] = "AppCursorKeys";
|
|
2415
2415
|
t[t.USASCII = 2] = "USASCII";
|
|
2416
2416
|
t[t.Column132 = 3] = "Column132";
|
|
@@ -2434,9 +2434,9 @@ var A = function(t) {
|
|
|
2434
2434
|
t[t.SaveCursor = 1048] = "SaveCursor";
|
|
2435
2435
|
t[t.BracketedPaste = 2004] = "BracketedPaste";
|
|
2436
2436
|
return t;
|
|
2437
|
-
}(
|
|
2437
|
+
}(j || {});
|
|
2438
2438
|
|
|
2439
|
-
var
|
|
2439
|
+
var R = function(t) {
|
|
2440
2440
|
t[t.Reset = 0] = "Reset";
|
|
2441
2441
|
t[t.Bold = 1] = "Bold";
|
|
2442
2442
|
t[t.Faint = 2] = "Faint";
|
|
@@ -2494,15 +2494,15 @@ var L = function(t) {
|
|
|
2494
2494
|
t.DottedUnderline = "4:4";
|
|
2495
2495
|
t.DashedUnderline = "4:5";
|
|
2496
2496
|
return t;
|
|
2497
|
-
}(
|
|
2497
|
+
}(R || {});
|
|
2498
2498
|
|
|
2499
|
-
var
|
|
2499
|
+
var L = "[";
|
|
2500
2500
|
|
|
2501
2501
|
function cmd(t, r, i) {
|
|
2502
2502
|
if (!P && t === M.Style) {
|
|
2503
2503
|
return "";
|
|
2504
2504
|
}
|
|
2505
|
-
var n =
|
|
2505
|
+
var n = L;
|
|
2506
2506
|
if (t === M.SetPrivateMode) {
|
|
2507
2507
|
n += "?";
|
|
2508
2508
|
t = M.SetMode;
|
|
@@ -2518,9 +2518,9 @@ function cmd(t, r, i) {
|
|
|
2518
2518
|
return n += t;
|
|
2519
2519
|
}
|
|
2520
2520
|
|
|
2521
|
-
var
|
|
2521
|
+
var A = /([\x1B\x9B][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><])/g;
|
|
2522
2522
|
|
|
2523
|
-
var stripAnsi = t => t.replace(
|
|
2523
|
+
var stripAnsi = t => t.replace(A, "");
|
|
2524
2524
|
|
|
2525
2525
|
class CLIError extends Error {
|
|
2526
2526
|
constructor(t, r) {
|
|
@@ -2596,7 +2596,7 @@ function commit(t) {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
|
|
2598
2598
|
function compose(t) {
|
|
2599
|
-
var r = cmd(M.Style, [
|
|
2599
|
+
var r = cmd(M.Style, [ R.Reset, R.NoInvert ]);
|
|
2600
2600
|
var i = pipe(fromAsyncIterable(async function* convertError(t) {
|
|
2601
2601
|
try {
|
|
2602
2602
|
yield* t;
|
|
@@ -2686,6 +2686,14 @@ var _ = function(t) {
|
|
|
2686
2686
|
}({});
|
|
2687
2687
|
|
|
2688
2688
|
var U = function(t) {
|
|
2689
|
+
t.Right = "▸";
|
|
2690
|
+
t.Left = "◂";
|
|
2691
|
+
t.Up = "▴";
|
|
2692
|
+
t.Down = "▾";
|
|
2693
|
+
return t;
|
|
2694
|
+
}({});
|
|
2695
|
+
|
|
2696
|
+
var q = function(t) {
|
|
2689
2697
|
t.Tick = "✓";
|
|
2690
2698
|
t.TickSwoosh = "✔";
|
|
2691
2699
|
t.Cross = "✖";
|
|
@@ -2698,11 +2706,11 @@ var U = function(t) {
|
|
|
2698
2706
|
return t;
|
|
2699
2707
|
}({});
|
|
2700
2708
|
|
|
2701
|
-
var
|
|
2709
|
+
var H = [ "⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏" ];
|
|
2702
2710
|
|
|
2703
|
-
var
|
|
2711
|
+
var V = [ "◐", "◓", "◑", "◒" ];
|
|
2704
2712
|
|
|
2705
|
-
var
|
|
2713
|
+
var W = !!process.env.GITHUB_ACTIONS;
|
|
2706
2714
|
|
|
2707
2715
|
var toCommandValue = t => "string" == typeof t || null == t ? t ? "" + t : "" : JSON.stringify(t);
|
|
2708
2716
|
|
|
@@ -2711,7 +2719,7 @@ var escapeData = t => toCommandValue(t).replace(/%/g, "%25").replace(/\r/g, "%0D
|
|
|
2711
2719
|
var escapeProperty = t => toCommandValue(t).replace(/%/g, "%25").replace(/\r/g, "%0D").replace(/\n/g, "%0A").replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
2712
2720
|
|
|
2713
2721
|
function githubAnnotation(t, r, i) {
|
|
2714
|
-
if (
|
|
2722
|
+
if (W) {
|
|
2715
2723
|
var n = `::${t}`;
|
|
2716
2724
|
var a = "";
|
|
2717
2725
|
if (i) {
|
|
@@ -2736,7 +2744,7 @@ function initTTY(t = {}) {
|
|
|
2736
2744
|
var r = "dumb" !== process.env.TERM && !process.env.CI && !t.disableTTY;
|
|
2737
2745
|
var i = null;
|
|
2738
2746
|
var a = process.stdout;
|
|
2739
|
-
if (
|
|
2747
|
+
if (W) {
|
|
2740
2748
|
a = process.stderr;
|
|
2741
2749
|
} else if (!a.isTTY && process.stderr.isTTY) {
|
|
2742
2750
|
a = process.stderr;
|
|
@@ -2746,13 +2754,13 @@ function initTTY(t = {}) {
|
|
|
2746
2754
|
}
|
|
2747
2755
|
var o = process.argv.includes("--color");
|
|
2748
2756
|
var s = "FORCE_COLOR" in process.env || !process.env.NO_COLOR && !process.env.CI;
|
|
2749
|
-
_setColor(r && s || o ||
|
|
2757
|
+
_setColor(r && s || o || W);
|
|
2750
2758
|
function _terminate(t) {
|
|
2751
2759
|
!function _restore() {
|
|
2752
2760
|
if (process.stdin.isTTY) {
|
|
2753
2761
|
process.stdin.setRawMode(!1);
|
|
2754
2762
|
}
|
|
2755
|
-
a.write(cmd(M.Reset) + cmd(M.ResetPrivateMode) + cmd(M.SetPrivateMode,
|
|
2763
|
+
a.write(cmd(M.Reset) + cmd(M.ResetPrivateMode) + cmd(M.SetPrivateMode, j.ShowCursor));
|
|
2756
2764
|
}();
|
|
2757
2765
|
process.exit(t);
|
|
2758
2766
|
}
|
|
@@ -2810,7 +2818,7 @@ function initTTY(t = {}) {
|
|
|
2810
2818
|
}((function _start() {
|
|
2811
2819
|
_setColor(r && s || o);
|
|
2812
2820
|
if (r) {
|
|
2813
|
-
a.write(cmd(M.UnsetPrivateMode,
|
|
2821
|
+
a.write(cmd(M.UnsetPrivateMode, j.ShowCursor));
|
|
2814
2822
|
process.on("SIGINT", _signal);
|
|
2815
2823
|
process.on("SIGTERM", _signal);
|
|
2816
2824
|
}
|
|
@@ -2818,7 +2826,7 @@ function initTTY(t = {}) {
|
|
|
2818
2826
|
if (r) {
|
|
2819
2827
|
process.removeListener("SIGINT", _signal);
|
|
2820
2828
|
process.removeListener("SIGTERM", _signal);
|
|
2821
|
-
a.write(cmd(M.Reset) + cmd(M.ResetPrivateMode) + cmd(M.SetPrivateMode,
|
|
2829
|
+
a.write(cmd(M.Reset) + cmd(M.ResetPrivateMode) + cmd(M.SetPrivateMode, j.ShowCursor));
|
|
2822
2830
|
}
|
|
2823
2831
|
})), share);
|
|
2824
2832
|
var c = pipe(concat([ pipe(l, filter((() => !1))), fromValue(null) ]), share);
|
|
@@ -2828,11 +2836,17 @@ function initTTY(t = {}) {
|
|
|
2828
2836
|
pipeTo: i,
|
|
2829
2837
|
inputSource: l,
|
|
2830
2838
|
cancelSource: c,
|
|
2831
|
-
write: function write(...
|
|
2832
|
-
|
|
2839
|
+
write: function write(...r) {
|
|
2840
|
+
if (!t.silent) {
|
|
2841
|
+
a.write(text(...r));
|
|
2842
|
+
}
|
|
2833
2843
|
},
|
|
2834
2844
|
start: function start(r) {
|
|
2835
|
-
var write =
|
|
2845
|
+
var write = r => {
|
|
2846
|
+
if (!t.silent) {
|
|
2847
|
+
a.write("" + r);
|
|
2848
|
+
}
|
|
2849
|
+
};
|
|
2836
2850
|
if (t.disableTTY) {
|
|
2837
2851
|
return pipe(compose(r), onPush(write), toPromise);
|
|
2838
2852
|
} else {
|
|
@@ -2890,19 +2904,23 @@ function indent(t, r) {
|
|
|
2890
2904
|
}
|
|
2891
2905
|
|
|
2892
2906
|
function code(t) {
|
|
2893
|
-
return text`${cmd(M.Style,
|
|
2907
|
+
return text`${cmd(M.Style, R.Underline)}${t}${cmd(M.Style, R.NoUnderline)}`;
|
|
2894
2908
|
}
|
|
2895
2909
|
|
|
2896
2910
|
function bold(t) {
|
|
2897
|
-
return text`${cmd(M.Style,
|
|
2911
|
+
return text`${cmd(M.Style, R.Bold)}${t}${cmd(M.Style, R.Normal)}`;
|
|
2898
2912
|
}
|
|
2899
2913
|
|
|
2900
2914
|
function hint(t) {
|
|
2901
|
-
return text([ cmd(M.Style,
|
|
2915
|
+
return text([ cmd(M.Style, R.BrightBlack), `${_.BottomLeft} `, cmd(M.Style, R.BrightBlue), `${q.Info} `, cmd(M.Style, R.Blue), indent(t, " ") ]);
|
|
2916
|
+
}
|
|
2917
|
+
|
|
2918
|
+
function projectHeader(t) {
|
|
2919
|
+
return text([ "\n", cmd(M.Style, R.Magenta), `${U.Right} `, cmd(M.Style, R.Foreground), bold(t), "\n" ]);
|
|
2902
2920
|
}
|
|
2903
2921
|
|
|
2904
2922
|
function errorMessage$1(t) {
|
|
2905
|
-
return error([ "\n", cmd(M.Style, [
|
|
2923
|
+
return error([ "\n", cmd(M.Style, [ R.Red, R.Invert ]), ` ${q.Warning} Error `, cmd(M.Style, R.NoInvert), `\n${t.trim()}\n` ]);
|
|
2906
2924
|
}
|
|
2907
2925
|
|
|
2908
2926
|
function externalError(t, r) {
|
|
@@ -2911,7 +2929,7 @@ function externalError(t, r) {
|
|
|
2911
2929
|
if (r && "object" == typeof r) {
|
|
2912
2930
|
if ("name" in r && ("TSError" === r.name || "TadaError" === r.name || "code" in r)) {
|
|
2913
2931
|
i = "code" in r ? "System Error" : "Error";
|
|
2914
|
-
n = "TadaError" === r.name ? text([ cmd(M.Style,
|
|
2932
|
+
n = "TadaError" === r.name ? text([ cmd(M.Style, R.Blue), r.message ]) : r.message.trim();
|
|
2915
2933
|
} else if ("stack" in r && "string" == typeof r.stack) {
|
|
2916
2934
|
i = "Unexpected Error";
|
|
2917
2935
|
n = `${r.stack}`;
|
|
@@ -2926,13 +2944,31 @@ function externalError(t, r) {
|
|
|
2926
2944
|
i = "Unexpected Error";
|
|
2927
2945
|
n = `${r}`;
|
|
2928
2946
|
}
|
|
2929
|
-
return error([ "\n", cmd(M.Style, [
|
|
2947
|
+
return error([ "\n", cmd(M.Style, [ R.Red, R.Invert ]), ` ${q.Warning} ${i} `, cmd(M.Style, R.NoInvert), `\n${t.trim()}\n`, cmd(M.Style, R.BrightBlack), `${_.BottomLeft} `, indent(!n.endsWith("\n") ? n + "\n" : n, " ") ]);
|
|
2930
2948
|
}
|
|
2931
2949
|
|
|
2932
2950
|
function experimentMessage(t) {
|
|
2933
|
-
return error([ cmd(M.Style, [
|
|
2951
|
+
return error([ cmd(M.Style, [ R.Yellow, R.Bold ]), `${q.Warning} Note: `, cmd(M.Style, R.Reset), `${t.trim()}\n\n` ]);
|
|
2934
2952
|
}
|
|
2935
2953
|
|
|
2954
|
+
var loadProjects = async t => {
|
|
2955
|
+
var i = (await r.loadConfigs(t)).map((t => {
|
|
2956
|
+
var i = c.dirname(t.tsconfigPath);
|
|
2957
|
+
return {
|
|
2958
|
+
configResult: t,
|
|
2959
|
+
pluginConfig: r.parseConfig(t.pluginConfig, t.rootPath),
|
|
2960
|
+
projectPath: i,
|
|
2961
|
+
label: c.relative(process.cwd(), t.tsconfigPath) || t.tsconfigPath
|
|
2962
|
+
};
|
|
2963
|
+
}));
|
|
2964
|
+
r.validateUniqueOutputLocations(i.map((t => ({
|
|
2965
|
+
projectPath: t.projectPath,
|
|
2966
|
+
config: t.pluginConfig,
|
|
2967
|
+
label: t.label
|
|
2968
|
+
}))));
|
|
2969
|
+
return i;
|
|
2970
|
+
};
|
|
2971
|
+
|
|
2936
2972
|
var directoryExists = async t => {
|
|
2937
2973
|
try {
|
|
2938
2974
|
var r = await u.stat(t);
|
|
@@ -2989,40 +3025,50 @@ var writeOutput = async (r, i) => {
|
|
|
2989
3025
|
};
|
|
2990
3026
|
|
|
2991
3027
|
function summary$1(t) {
|
|
2992
|
-
var r = text([ cmd(M.Style,
|
|
3028
|
+
var r = text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Introspection output was generated successfully\n` ]);
|
|
2993
3029
|
if (t) {
|
|
2994
3030
|
r += hint(`The pipe output was generated in the ${code(".d.ts")} format.\nFor the ${code(".ts")} format, pass the ${code("--force-ts-format")} argument.\n`);
|
|
2995
3031
|
}
|
|
2996
3032
|
return r;
|
|
2997
3033
|
}
|
|
2998
3034
|
|
|
2999
|
-
async function* run$5(t,
|
|
3000
|
-
var
|
|
3001
|
-
var a;
|
|
3035
|
+
async function* run$5(t, r) {
|
|
3036
|
+
var i;
|
|
3002
3037
|
try {
|
|
3003
|
-
|
|
3004
|
-
a = r.parseConfig(n.pluginConfig, n.rootPath);
|
|
3038
|
+
i = await loadProjects(r.tsconfig);
|
|
3005
3039
|
} catch (t) {
|
|
3006
3040
|
throw externalError("Failed to load configuration.", t);
|
|
3007
3041
|
}
|
|
3008
|
-
|
|
3042
|
+
if (i.length > 1 && (r.output || t.pipeTo)) {
|
|
3043
|
+
throw errorMessage$1("Output path was specified, while multiple projects are configured.\n" + hint(`You can only output all projects to their ${code('"tadaOutputLocation"')} options\nwhen multiple projects are set up through ${code('"references"')}.`));
|
|
3044
|
+
}
|
|
3045
|
+
for (var n of i) {
|
|
3046
|
+
if (i.length > 1) {
|
|
3047
|
+
yield projectHeader(n.label);
|
|
3048
|
+
}
|
|
3049
|
+
yield* runProject$2(t, r, n);
|
|
3050
|
+
}
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
async function* runProject$2(t, i, n) {
|
|
3054
|
+
var {pluginConfig: a, projectPath: o} = n;
|
|
3055
|
+
var s = r.loadRef(a);
|
|
3009
3056
|
try {
|
|
3010
|
-
|
|
3011
|
-
rootPath:
|
|
3057
|
+
s = await s.load({
|
|
3058
|
+
rootPath: o
|
|
3012
3059
|
});
|
|
3013
3060
|
} catch (t) {
|
|
3014
3061
|
throw externalError("Failed to load schema(s).", t);
|
|
3015
3062
|
}
|
|
3016
|
-
var s = c.dirname(n.configPath);
|
|
3017
3063
|
if ("schema" in a) {
|
|
3018
|
-
var l =
|
|
3064
|
+
var l = s.current;
|
|
3019
3065
|
var u;
|
|
3020
3066
|
if (!i.output && t.pipeTo) {
|
|
3021
3067
|
u = t.pipeTo;
|
|
3022
3068
|
} else if (i.output) {
|
|
3023
3069
|
u = c.resolve(process.cwd(), i.output);
|
|
3024
3070
|
} else if (a.tadaOutputLocation) {
|
|
3025
|
-
u = a.tadaOutputLocation;
|
|
3071
|
+
u = c.resolve(o, a.tadaOutputLocation);
|
|
3026
3072
|
} else {
|
|
3027
3073
|
throw errorMessage$1("No output path was specified to write the output file to.\n" + hint(`You have to either set ${code('"tadaOutputLocation"')} in your configuration,\npass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
3028
3074
|
}
|
|
@@ -3045,24 +3091,24 @@ async function* run$5(t, i) {
|
|
|
3045
3091
|
if (i.output) {
|
|
3046
3092
|
throw errorMessage$1("Output path was specified, while multiple schemas are configured.\n" + hint(`You can only output all schemas to their ${code('"tadaOutputLocation"')} options\nwhen multiple ${code("schemas")} are set up.`));
|
|
3047
3093
|
}
|
|
3048
|
-
for (var f in
|
|
3049
|
-
var
|
|
3050
|
-
if (!
|
|
3094
|
+
for (var f in s.multi) {
|
|
3095
|
+
var p = s.multi[f];
|
|
3096
|
+
if (!p) {
|
|
3051
3097
|
continue;
|
|
3052
|
-
} else if (!
|
|
3098
|
+
} else if (!p.tadaOutputLocation) {
|
|
3053
3099
|
throw errorMessage$1(`No output path was specified to write the '${f}' schema to.\n` + hint(`You have to set ${code('"tadaOutputLocation"')} in each schema configuration.`));
|
|
3054
3100
|
}
|
|
3055
|
-
var
|
|
3101
|
+
var g = void 0;
|
|
3056
3102
|
try {
|
|
3057
|
-
|
|
3058
|
-
fileType:
|
|
3103
|
+
g = r.outputIntrospectionFile(r.minifyIntrospection(p.introspection), {
|
|
3104
|
+
fileType: p.tadaOutputLocation,
|
|
3059
3105
|
shouldPreprocess: !i.disablePreprocessing
|
|
3060
3106
|
});
|
|
3061
3107
|
} catch (t) {
|
|
3062
3108
|
throw externalError(`Could not generate any output for the '${f}' schema`, t);
|
|
3063
3109
|
}
|
|
3064
3110
|
try {
|
|
3065
|
-
await writeOutput(c.resolve(
|
|
3111
|
+
await writeOutput(c.resolve(o, p.tadaOutputLocation), g);
|
|
3066
3112
|
} catch (t) {
|
|
3067
3113
|
throw externalError(`Something went wrong while writing the '${f}' schema's output`, t);
|
|
3068
3114
|
}
|
|
@@ -3100,7 +3146,8 @@ class GenerateOutputCommand extends Command {
|
|
|
3100
3146
|
|
|
3101
3147
|
async function generateOutput(t) {
|
|
3102
3148
|
var r = initTTY({
|
|
3103
|
-
disableTTY: !0
|
|
3149
|
+
disableTTY: !0,
|
|
3150
|
+
silent: t.silent
|
|
3104
3151
|
});
|
|
3105
3152
|
var i = await r.start(run$5(r, t));
|
|
3106
3153
|
if (i instanceof Error) {
|
|
@@ -3108,41 +3155,41 @@ async function generateOutput(t) {
|
|
|
3108
3155
|
}
|
|
3109
3156
|
}
|
|
3110
3157
|
|
|
3111
|
-
var
|
|
3158
|
+
var K = process.cwd();
|
|
3112
3159
|
|
|
3113
|
-
var
|
|
3160
|
+
var G = " ";
|
|
3114
3161
|
|
|
3115
3162
|
function warningFile$1(t) {
|
|
3116
|
-
var r = c.relative(
|
|
3163
|
+
var r = c.relative(K, t);
|
|
3117
3164
|
if (!r.startsWith("..")) {
|
|
3118
3165
|
t = r;
|
|
3119
3166
|
}
|
|
3120
|
-
return text([ cmd(M.Style,
|
|
3167
|
+
return text([ cmd(M.Style, R.Underline), t, cmd(M.Style, R.NoUnderline), "\n" ]);
|
|
3121
3168
|
}
|
|
3122
3169
|
|
|
3123
3170
|
var documentSummary$1 = t => {
|
|
3124
3171
|
var r = "";
|
|
3125
3172
|
if ("number" != typeof t ? Object.values(t).every((t => !t)) : !t) {
|
|
3126
|
-
r += text([ cmd(M.Style,
|
|
3173
|
+
r += text([ cmd(M.Style, R.Blue), `${q.Info} No persisted documents were found `, cmd(M.Style, R.BrightBlack), "(Persisted manifests were not generated)\n" ]);
|
|
3127
3174
|
} else if ("number" == typeof t) {
|
|
3128
|
-
r += text([ cmd(M.Style,
|
|
3175
|
+
r += text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Persisted manifest was generated successfully `, cmd(M.Style, R.BrightBlack), `(${t} documents extracted)\n` ]);
|
|
3129
3176
|
} else {
|
|
3130
|
-
r += text([ cmd(M.Style,
|
|
3177
|
+
r += text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Persisted manifests were generated successfully.\n` ]);
|
|
3131
3178
|
for (var i in t) {
|
|
3132
|
-
r += text([ cmd(M.Style,
|
|
3179
|
+
r += text([ cmd(M.Style, R.BrightBlack), `${_.BottomLeft} `, cmd(M.Style, R.BrightBlue), `${t[i]} documents extracted for the '${i}' schema\n` ]);
|
|
3133
3180
|
}
|
|
3134
3181
|
}
|
|
3135
3182
|
return r;
|
|
3136
3183
|
};
|
|
3137
3184
|
|
|
3138
3185
|
function warningSummary$1(t) {
|
|
3139
|
-
return error([ cmd(M.Style,
|
|
3186
|
+
return error([ cmd(M.Style, R.Red), `${q.Cross} ${t} warnings\n` ]);
|
|
3140
3187
|
}
|
|
3141
3188
|
|
|
3142
3189
|
function infoSummary$2(t, r) {
|
|
3143
3190
|
var i = "";
|
|
3144
3191
|
if (t) {
|
|
3145
|
-
i += text([ cmd(M.Style,
|
|
3192
|
+
i += text([ cmd(M.Style, R.BrightYellow), q.Warning, ` ${t} warnings\n` ]);
|
|
3146
3193
|
}
|
|
3147
3194
|
return i += documentSummary$1(r);
|
|
3148
3195
|
}
|
|
@@ -3157,125 +3204,159 @@ function warningGithub$1(t) {
|
|
|
3157
3204
|
|
|
3158
3205
|
function runningPersisted(t, r) {
|
|
3159
3206
|
var i = t ? r ? `(${t}/${r})` : `(${t})` : "";
|
|
3160
|
-
var frame = t => text([ cmd(M.Style,
|
|
3207
|
+
var frame = t => text([ cmd(M.Style, R.Magenta), H[t % H.length], " ", cmd(M.Style, R.Foreground), `Scanning files${D.Ellipsis} `, cmd(M.Style, R.BrightBlack), i ]);
|
|
3161
3208
|
return concat([ fromValue(frame(0)), pipe(interval(150), map((t => frame(t + 1)))) ]);
|
|
3162
3209
|
}
|
|
3163
3210
|
|
|
3164
|
-
async function* run$4(t,
|
|
3165
|
-
var
|
|
3166
|
-
return require("./thread-chunk.js");
|
|
3167
|
-
}));
|
|
3168
|
-
var a;
|
|
3169
|
-
var o;
|
|
3211
|
+
async function* run$4(t, r) {
|
|
3212
|
+
var i;
|
|
3170
3213
|
try {
|
|
3171
|
-
|
|
3172
|
-
o = r.parseConfig(a.pluginConfig, a.rootPath);
|
|
3214
|
+
i = await loadProjects(r.tsconfig);
|
|
3173
3215
|
} catch (t) {
|
|
3174
3216
|
throw externalError("Failed to load configuration.", t);
|
|
3175
3217
|
}
|
|
3218
|
+
if (i.length > 1 && (r.output || t.pipeTo)) {
|
|
3219
|
+
throw errorMessage$1("Output path was specified, while multiple projects are configured.\n" + hint(`You can only output all projects to their ${code('"tadaPersistedLocation"')} options\nwhen multiple projects are set up through ${code('"references"')}.`));
|
|
3220
|
+
}
|
|
3221
|
+
var n = 0;
|
|
3222
|
+
var a = !1;
|
|
3223
|
+
for (var o of i) {
|
|
3224
|
+
if (i.length > 1) {
|
|
3225
|
+
yield projectHeader(o.label);
|
|
3226
|
+
}
|
|
3227
|
+
var s = yield* runProject$1(t, r, o, i.length > 1);
|
|
3228
|
+
n += s.warnings;
|
|
3229
|
+
a = a || s.failed;
|
|
3230
|
+
}
|
|
3231
|
+
if (a) {
|
|
3232
|
+
throw warningSummary$1(n);
|
|
3233
|
+
}
|
|
3234
|
+
}
|
|
3235
|
+
|
|
3236
|
+
async function* runProject$1(t, r, i, n) {
|
|
3237
|
+
var {runPersisted: a} = await Promise.resolve().then((function() {
|
|
3238
|
+
return require("./thread-chunk.js");
|
|
3239
|
+
}));
|
|
3240
|
+
var {pluginConfig: o, projectPath: s} = i;
|
|
3176
3241
|
if (t.isInteractive) {
|
|
3177
3242
|
yield runningPersisted();
|
|
3178
3243
|
}
|
|
3179
|
-
var
|
|
3180
|
-
disableNormalization: !!
|
|
3181
|
-
rootPath:
|
|
3182
|
-
|
|
3244
|
+
var l = a({
|
|
3245
|
+
disableNormalization: !!r.disableNormalization,
|
|
3246
|
+
rootPath: i.configResult.rootPath,
|
|
3247
|
+
tsconfigPath: i.configResult.tsconfigPath,
|
|
3248
|
+
configPath: i.configResult.configPath,
|
|
3183
3249
|
pluginConfig: o
|
|
3184
3250
|
});
|
|
3185
|
-
var
|
|
3186
|
-
var u = 0;
|
|
3251
|
+
var u = [];
|
|
3187
3252
|
var d = 0;
|
|
3188
3253
|
var f = 0;
|
|
3254
|
+
var p = 0;
|
|
3189
3255
|
try {
|
|
3190
3256
|
if (t.isInteractive) {
|
|
3191
3257
|
yield runningPersisted();
|
|
3192
3258
|
}
|
|
3193
|
-
for await (var g of
|
|
3259
|
+
for await (var g of l) {
|
|
3194
3260
|
if ("EXTERNAL_WARNING" === g.kind) {
|
|
3195
3261
|
yield experimentMessage(`${code(".vue")} and ${code(".svelte")} file support is experimental.`);
|
|
3196
3262
|
} else if ("FILE_COUNT" === g.kind) {
|
|
3197
|
-
|
|
3263
|
+
f = g.fileCount;
|
|
3198
3264
|
} else {
|
|
3199
|
-
|
|
3200
|
-
|
|
3201
|
-
|
|
3265
|
+
p++;
|
|
3266
|
+
u.push(...g.documents);
|
|
3267
|
+
d += g.warnings.length;
|
|
3202
3268
|
if (g.warnings.length) {
|
|
3203
|
-
var
|
|
3204
|
-
for (var
|
|
3205
|
-
|
|
3206
|
-
warningGithub$1(
|
|
3269
|
+
var h = warningFile$1(g.filePath);
|
|
3270
|
+
for (var v of g.warnings) {
|
|
3271
|
+
h += (m = v, text([ G, cmd(M.Style, R.BrightBlack), `${m.line}:${m.col}`, D.Tab, cmd(M.Style, R.Foreground), indent(m.message.trim(), text([ G, D.Tab ])), D.Newline ]));
|
|
3272
|
+
warningGithub$1(v);
|
|
3207
3273
|
}
|
|
3208
|
-
yield
|
|
3274
|
+
yield h + "\n";
|
|
3209
3275
|
}
|
|
3210
3276
|
}
|
|
3211
3277
|
if (t.isInteractive) {
|
|
3212
|
-
yield runningPersisted(
|
|
3278
|
+
yield runningPersisted(p, f);
|
|
3213
3279
|
}
|
|
3214
3280
|
}
|
|
3215
3281
|
} catch (t) {
|
|
3216
3282
|
throw externalError("Could not generate persisted manifest file", t);
|
|
3217
3283
|
}
|
|
3218
|
-
var
|
|
3219
|
-
var m = c.dirname(a.configPath);
|
|
3284
|
+
var m;
|
|
3220
3285
|
if ("schema" in o) {
|
|
3221
3286
|
var y;
|
|
3222
|
-
if (!
|
|
3287
|
+
if (!r.output && t.pipeTo) {
|
|
3223
3288
|
y = t.pipeTo;
|
|
3224
|
-
} else if (
|
|
3225
|
-
y = c.resolve(process.cwd(),
|
|
3289
|
+
} else if (r.output) {
|
|
3290
|
+
y = c.resolve(process.cwd(), r.output);
|
|
3226
3291
|
} else if (o.tadaPersistedLocation) {
|
|
3227
|
-
y = c.resolve(
|
|
3292
|
+
y = c.resolve(s, o.tadaPersistedLocation);
|
|
3228
3293
|
} else {
|
|
3229
3294
|
throw errorMessage$1("No output path was specified to write the persisted manifest file to.\n" + hint(`You have to either set ${code('"tadaPersistedLocation"')} in your configuration,\npass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
3230
3295
|
}
|
|
3231
|
-
if (
|
|
3232
|
-
|
|
3233
|
-
|
|
3296
|
+
if (d && r.failOnWarn) {
|
|
3297
|
+
if (!n) {
|
|
3298
|
+
throw warningSummary$1(d);
|
|
3299
|
+
}
|
|
3300
|
+
return {
|
|
3301
|
+
warnings: d,
|
|
3302
|
+
failed: !0
|
|
3303
|
+
};
|
|
3304
|
+
} else if (u.length) {
|
|
3234
3305
|
try {
|
|
3235
|
-
var
|
|
3236
|
-
for (var
|
|
3237
|
-
S
|
|
3306
|
+
var w = {};
|
|
3307
|
+
for (var S of u) {
|
|
3308
|
+
w[S.hashKey] = S.document;
|
|
3238
3309
|
}
|
|
3239
|
-
var b = JSON.stringify(
|
|
3310
|
+
var b = JSON.stringify(w, null, 2);
|
|
3240
3311
|
await writeOutput(y, b);
|
|
3241
3312
|
} catch (t) {
|
|
3242
3313
|
throw externalError("Something went wrong while writing the persisted manifest file.", t);
|
|
3243
3314
|
}
|
|
3244
3315
|
}
|
|
3245
|
-
yield infoSummary$2(
|
|
3316
|
+
yield infoSummary$2(d, u.length);
|
|
3246
3317
|
} else {
|
|
3247
|
-
if (
|
|
3318
|
+
if (r.output) {
|
|
3248
3319
|
throw errorMessage$1("Output path was specified, while multiple schemas are configured.\n" + hint(`You can only output all schemas to their ${code('"tadaPersistedLocation"')} options\nwhen multiple ${code("schemas")} are set up.`));
|
|
3249
3320
|
}
|
|
3250
3321
|
var x = {};
|
|
3251
3322
|
for (var E of o.schemas) {
|
|
3252
|
-
var {name: C, tadaPersistedLocation:
|
|
3253
|
-
if (
|
|
3323
|
+
var {name: C, tadaPersistedLocation: $} = E;
|
|
3324
|
+
if (!$) {
|
|
3254
3325
|
throw errorMessage$1(`No output path was specified to write the '${C}' schema to.\n` + hint(`You have to set ${code('"tadaPersistedLocation"')} in each schema configuration.`));
|
|
3255
3326
|
}
|
|
3256
3327
|
try {
|
|
3257
3328
|
x[C] = 0;
|
|
3258
|
-
var
|
|
3259
|
-
for (var k of
|
|
3329
|
+
var O = {};
|
|
3330
|
+
for (var k of u) {
|
|
3260
3331
|
if (k.schemaName === C) {
|
|
3261
|
-
|
|
3332
|
+
O[k.hashKey] = k.document;
|
|
3262
3333
|
x[C]++;
|
|
3263
3334
|
}
|
|
3264
3335
|
}
|
|
3265
3336
|
if (x[C]) {
|
|
3266
|
-
var N = JSON.stringify(
|
|
3267
|
-
await writeOutput(c.resolve(
|
|
3337
|
+
var N = JSON.stringify(O, null, 2);
|
|
3338
|
+
await writeOutput(c.resolve(s, $), N);
|
|
3268
3339
|
}
|
|
3269
3340
|
} catch (t) {
|
|
3270
3341
|
throw externalError(`Something went wrong while writing the '${C}' schema's persisted manifest file.`, t);
|
|
3271
3342
|
}
|
|
3272
3343
|
}
|
|
3273
|
-
if (
|
|
3274
|
-
|
|
3344
|
+
if (d && r.failOnWarn) {
|
|
3345
|
+
if (!n) {
|
|
3346
|
+
throw warningSummary$1(d);
|
|
3347
|
+
}
|
|
3348
|
+
return {
|
|
3349
|
+
warnings: d,
|
|
3350
|
+
failed: !0
|
|
3351
|
+
};
|
|
3275
3352
|
} else {
|
|
3276
|
-
yield infoSummary$2(
|
|
3353
|
+
yield infoSummary$2(d, x);
|
|
3277
3354
|
}
|
|
3278
3355
|
}
|
|
3356
|
+
return {
|
|
3357
|
+
warnings: d,
|
|
3358
|
+
failed: !1
|
|
3359
|
+
};
|
|
3279
3360
|
}
|
|
3280
3361
|
|
|
3281
3362
|
class GeneratePersisted extends Command {
|
|
@@ -3314,7 +3395,7 @@ async function generatePersisted(t) {
|
|
|
3314
3395
|
}
|
|
3315
3396
|
}
|
|
3316
3397
|
|
|
3317
|
-
var
|
|
3398
|
+
var Y = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
|
|
3318
3399
|
|
|
3319
3400
|
function getPrintable(t) {
|
|
3320
3401
|
if (null === t) {
|
|
@@ -3339,7 +3420,7 @@ function computeKey(t, r) {
|
|
|
3339
3420
|
var i, n, a;
|
|
3340
3421
|
if ("number" == typeof r) {
|
|
3341
3422
|
return `${null !== (i = null == t ? void 0 : t.p) && void 0 !== i ? i : "."}[${r}]`;
|
|
3342
|
-
} else if (
|
|
3423
|
+
} else if (Y.test(r)) {
|
|
3343
3424
|
return `${null !== (n = null == t ? void 0 : t.p) && void 0 !== n ? n : ""}.${r}`;
|
|
3344
3425
|
} else {
|
|
3345
3426
|
return `${null !== (a = null == t ? void 0 : t.p) && void 0 !== a ? a : "."}[${JSON.stringify(r)}]`;
|
|
@@ -3503,13 +3584,13 @@ var isOneOf = (t, {exclusive: r = !1} = {}) => makeValidator({
|
|
|
3503
3584
|
var c = void 0 !== (null == n ? void 0 : n.errors) ? [] : void 0;
|
|
3504
3585
|
for (var u = 0, d = t.length; u < d; ++u) {
|
|
3505
3586
|
var f = void 0 !== (null == n ? void 0 : n.errors) ? [] : void 0;
|
|
3506
|
-
var
|
|
3587
|
+
var p = void 0 !== (null == n ? void 0 : n.coercions) ? [] : void 0;
|
|
3507
3588
|
if (t[u](i, Object.assign(Object.assign({}, n), {
|
|
3508
3589
|
errors: f,
|
|
3509
|
-
coercions:
|
|
3590
|
+
coercions: p,
|
|
3510
3591
|
p: `${null !== (a = null == n ? void 0 : n.p) && void 0 !== a ? a : "."}#${u + 1}`
|
|
3511
3592
|
}))) {
|
|
3512
|
-
l.push([ `#${u + 1}`,
|
|
3593
|
+
l.push([ `#${u + 1}`, p ]);
|
|
3513
3594
|
if (!r) {
|
|
3514
3595
|
break;
|
|
3515
3596
|
}
|
|
@@ -3518,9 +3599,9 @@ var isOneOf = (t, {exclusive: r = !1} = {}) => makeValidator({
|
|
|
3518
3599
|
}
|
|
3519
3600
|
}
|
|
3520
3601
|
if (1 === l.length) {
|
|
3521
|
-
var [,
|
|
3522
|
-
if (void 0 !==
|
|
3523
|
-
null === (o = null == n ? void 0 : n.coercions) || void 0 === o || o.push(...
|
|
3602
|
+
var [, g] = l[0];
|
|
3603
|
+
if (void 0 !== g) {
|
|
3604
|
+
null === (o = null == n ? void 0 : n.coercions) || void 0 === o || o.push(...g);
|
|
3524
3605
|
}
|
|
3525
3606
|
return !0;
|
|
3526
3607
|
}
|
|
@@ -3605,17 +3686,17 @@ function cascade(t, ...r) {
|
|
|
3605
3686
|
});
|
|
3606
3687
|
}
|
|
3607
3688
|
|
|
3608
|
-
var
|
|
3689
|
+
var J;
|
|
3609
3690
|
|
|
3610
3691
|
!function(t) {
|
|
3611
3692
|
t.Forbids = "Forbids";
|
|
3612
3693
|
t.Requires = "Requires";
|
|
3613
|
-
}(
|
|
3694
|
+
}(J || (J = {}));
|
|
3614
3695
|
|
|
3615
|
-
var
|
|
3696
|
+
var z = {
|
|
3616
3697
|
__proto__: null,
|
|
3617
3698
|
get KeyRelationship() {
|
|
3618
|
-
return
|
|
3699
|
+
return J;
|
|
3619
3700
|
},
|
|
3620
3701
|
applyCascade: function applyCascade(t, ...r) {
|
|
3621
3702
|
return cascade(t, Array.isArray(r[0]) ? r[0] : r);
|
|
@@ -3663,15 +3744,17 @@ async function* run$3(i, n) {
|
|
|
3663
3744
|
c = t.resolve(process.cwd(), n.output);
|
|
3664
3745
|
} else {
|
|
3665
3746
|
var u;
|
|
3666
|
-
var d;
|
|
3667
3747
|
try {
|
|
3668
|
-
u = await
|
|
3669
|
-
d = r.parseConfig(u.pluginConfig, u.rootPath);
|
|
3748
|
+
u = await loadProjects(n.tsconfig);
|
|
3670
3749
|
} catch (t) {
|
|
3671
3750
|
throw externalError("Failed to load configuration.", t);
|
|
3672
3751
|
}
|
|
3752
|
+
if (u.length > 1) {
|
|
3753
|
+
throw errorMessage$1(`Output path cannot be automatically determined when multiple projects are configured,\nbecause multiple projects are set up through ${code('"references"')}.` + hint(`You have to explicitly pass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
3754
|
+
}
|
|
3755
|
+
var {pluginConfig: d, projectPath: f} = u[0];
|
|
3673
3756
|
if ("schema" in d && "string" == typeof d.schema && ".graphql" === t.extname(d.schema)) {
|
|
3674
|
-
c = t.resolve(
|
|
3757
|
+
c = t.resolve(f, d.schema);
|
|
3675
3758
|
} else if (!("schema" in d)) {
|
|
3676
3759
|
throw errorMessage$1(`Output path cannot be automatically determined when multiple schemas are configured,\nbecause multiple ${code("schemas")} are set up.` + hint(`You have to explicitly pass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
3677
3760
|
} else {
|
|
@@ -3684,11 +3767,11 @@ async function* run$3(i, n) {
|
|
|
3684
3767
|
throw externalError("Something went wrong while writing the introspection file", t);
|
|
3685
3768
|
}
|
|
3686
3769
|
yield function summary() {
|
|
3687
|
-
return text([ cmd(M.Style,
|
|
3770
|
+
return text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Schema was generated successfully\n` ]);
|
|
3688
3771
|
}();
|
|
3689
3772
|
}
|
|
3690
3773
|
|
|
3691
|
-
var
|
|
3774
|
+
var X = isArray(cascade(isString(), matchesRegExp(/^[\w-]+[ ]*:[ ]*.+/i)));
|
|
3692
3775
|
|
|
3693
3776
|
var parseHeaders = t => {
|
|
3694
3777
|
if (t && t.length) {
|
|
@@ -3748,7 +3831,7 @@ class GenerateSchema extends Command {
|
|
|
3748
3831
|
});
|
|
3749
3832
|
}("--header", {
|
|
3750
3833
|
description: "Headers to be used when introspection a schema from a remote URL",
|
|
3751
|
-
validator:
|
|
3834
|
+
validator: X
|
|
3752
3835
|
});
|
|
3753
3836
|
async execute() {
|
|
3754
3837
|
var t = initTTY();
|
|
@@ -3764,7 +3847,8 @@ class GenerateSchema extends Command {
|
|
|
3764
3847
|
|
|
3765
3848
|
async function generateSchema(t) {
|
|
3766
3849
|
var r = initTTY({
|
|
3767
|
-
disableTTY: !0
|
|
3850
|
+
disableTTY: !0,
|
|
3851
|
+
silent: t.silent
|
|
3768
3852
|
});
|
|
3769
3853
|
var i = await r.start(run$3(r, t));
|
|
3770
3854
|
if (i instanceof Error) {
|
|
@@ -3772,41 +3856,45 @@ async function generateSchema(t) {
|
|
|
3772
3856
|
}
|
|
3773
3857
|
}
|
|
3774
3858
|
|
|
3775
|
-
var
|
|
3859
|
+
var Q = process.cwd();
|
|
3776
3860
|
|
|
3777
|
-
var
|
|
3861
|
+
var Z = " ";
|
|
3778
3862
|
|
|
3779
3863
|
function warningFile(t) {
|
|
3780
|
-
var r = c.relative(
|
|
3864
|
+
var r = c.relative(Q, t);
|
|
3781
3865
|
if (!r.startsWith("..")) {
|
|
3782
3866
|
t = r;
|
|
3783
3867
|
}
|
|
3784
|
-
return text([ cmd(M.Style,
|
|
3868
|
+
return text([ cmd(M.Style, R.Underline), t, cmd(M.Style, R.NoUnderline), "\n" ]);
|
|
3785
3869
|
}
|
|
3786
3870
|
|
|
3787
|
-
var
|
|
3788
|
-
|
|
3871
|
+
var reusedLabel = t => t ? `, ${t} reused` : "";
|
|
3872
|
+
|
|
3873
|
+
var documentSummary = (t, r) => {
|
|
3874
|
+
var i = "";
|
|
3789
3875
|
if ("number" == typeof t) {
|
|
3790
|
-
|
|
3876
|
+
var n = reusedLabel("number" == typeof r ? r : void 0);
|
|
3877
|
+
i += text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Type cache was generated successfully `, cmd(M.Style, R.BrightBlack), `(${t} document types cached${n})\n` ]);
|
|
3791
3878
|
} else {
|
|
3792
|
-
|
|
3793
|
-
for (var
|
|
3794
|
-
|
|
3879
|
+
i += text([ cmd(M.Style, R.BrightGreen), `${q.Tick} Type caches were generated successfully.\n` ]);
|
|
3880
|
+
for (var a in t) {
|
|
3881
|
+
var o = reusedLabel(r && "number" != typeof r ? r[a] : void 0);
|
|
3882
|
+
i += text([ cmd(M.Style, R.BrightBlack), `${_.BottomLeft} `, cmd(M.Style, R.BrightBlue), `${t[a]} document types cached for the '${a}' schema${o}\n` ]);
|
|
3795
3883
|
}
|
|
3796
3884
|
}
|
|
3797
|
-
return
|
|
3885
|
+
return i;
|
|
3798
3886
|
};
|
|
3799
3887
|
|
|
3800
3888
|
function warningSummary(t) {
|
|
3801
|
-
return error([ cmd(M.Style,
|
|
3889
|
+
return error([ cmd(M.Style, R.Red), `${q.Cross} ${t} warnings\n` ]);
|
|
3802
3890
|
}
|
|
3803
3891
|
|
|
3804
|
-
function infoSummary$1(t, r) {
|
|
3805
|
-
var
|
|
3892
|
+
function infoSummary$1(t, r, i) {
|
|
3893
|
+
var n = "";
|
|
3806
3894
|
if (t) {
|
|
3807
|
-
|
|
3895
|
+
n += text([ cmd(M.Style, R.BrightYellow), q.Warning, ` ${t} warnings\n` ]);
|
|
3808
3896
|
}
|
|
3809
|
-
return
|
|
3897
|
+
return n += documentSummary(r, i);
|
|
3810
3898
|
}
|
|
3811
3899
|
|
|
3812
3900
|
function warningGithub(t) {
|
|
@@ -3819,38 +3907,55 @@ function warningGithub(t) {
|
|
|
3819
3907
|
|
|
3820
3908
|
function runningTurbo(t, r) {
|
|
3821
3909
|
var i = t ? r ? `(${t}/${r})` : `(${t})` : "";
|
|
3822
|
-
var frame = t => text([ cmd(M.Style,
|
|
3910
|
+
var frame = t => text([ cmd(M.Style, R.Magenta), H[t % H.length], " ", cmd(M.Style, R.Foreground), `Scanning files${D.Ellipsis} `, cmd(M.Style, R.BrightBlack), i ]);
|
|
3823
3911
|
return concat([ fromValue(frame(0)), pipe(interval(150), map((t => frame(t + 1)))) ]);
|
|
3824
3912
|
}
|
|
3825
3913
|
|
|
3826
|
-
var
|
|
3914
|
+
var ee = [ "/* eslint-disable */", "/* prettier-ignore */" ].join("\n") + "\n";
|
|
3827
3915
|
|
|
3828
|
-
async function* run$2(t,
|
|
3829
|
-
var
|
|
3830
|
-
return require("./thread-chunk2.js");
|
|
3831
|
-
}));
|
|
3832
|
-
var a;
|
|
3833
|
-
var o;
|
|
3916
|
+
async function* run$2(t, r) {
|
|
3917
|
+
var i;
|
|
3834
3918
|
try {
|
|
3835
|
-
|
|
3836
|
-
o = r.parseConfig(a.pluginConfig, a.rootPath);
|
|
3919
|
+
i = await loadProjects(r.tsconfig);
|
|
3837
3920
|
} catch (t) {
|
|
3838
3921
|
throw externalError("Failed to load configuration.", t);
|
|
3839
3922
|
}
|
|
3840
|
-
|
|
3923
|
+
if (i.length > 1 && (r.output || t.pipeTo)) {
|
|
3924
|
+
throw errorMessage$1("Output path was specified, while multiple projects are configured.\n" + hint(`You can only output all projects to their ${code('"tadaTurboLocation"')} options\nwhen multiple projects are set up through ${code('"references"')}.`));
|
|
3925
|
+
}
|
|
3926
|
+
var n = 0;
|
|
3927
|
+
var a = !1;
|
|
3928
|
+
for (var o of i) {
|
|
3929
|
+
if (i.length > 1) {
|
|
3930
|
+
yield projectHeader(o.label);
|
|
3931
|
+
}
|
|
3932
|
+
var s = yield* runProject(t, r, o, i.length > 1);
|
|
3933
|
+
n += s.warnings;
|
|
3934
|
+
a = a || s.failed;
|
|
3935
|
+
}
|
|
3936
|
+
if (a) {
|
|
3937
|
+
throw warningSummary(n);
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
|
|
3941
|
+
async function* runProject(t, r, i, n) {
|
|
3942
|
+
var {runTurbo: a} = await Promise.resolve().then((function() {
|
|
3943
|
+
return require("./thread-chunk2.js");
|
|
3944
|
+
}));
|
|
3945
|
+
var {pluginConfig: o, projectPath: s} = i;
|
|
3841
3946
|
var l;
|
|
3842
3947
|
var u = [];
|
|
3843
3948
|
if ("schema" in o) {
|
|
3844
|
-
if (!
|
|
3949
|
+
if (!r.output && t.pipeTo) {
|
|
3845
3950
|
l = t.pipeTo;
|
|
3846
|
-
} else if (
|
|
3847
|
-
l = c.resolve(process.cwd(),
|
|
3951
|
+
} else if (r.output) {
|
|
3952
|
+
l = c.resolve(process.cwd(), r.output);
|
|
3848
3953
|
} else if (o.tadaTurboLocation) {
|
|
3849
3954
|
l = c.resolve(s, o.tadaTurboLocation);
|
|
3850
3955
|
} else if (o.tadaOutputLocation) {
|
|
3851
3956
|
l = c.resolve(s, o.tadaOutputLocation, "..", "graphql-cache.d.ts");
|
|
3852
3957
|
yield function hintMessage$1(t) {
|
|
3853
|
-
return error([ cmd(M.Style, [
|
|
3958
|
+
return error([ cmd(M.Style, [ R.Yellow, R.Bold ]), `${q.Warning} Note: `, cmd(M.Style, R.Reset), `${t.trim()}\n\n` ]);
|
|
3854
3959
|
}(`No output location was specified.\nThe turbo cache will by default be saved as ${code('"graphql-cache.d.ts"')}.\n` + hint(`To change this, add a ${code('"tadaTurboLocation"')} in your configuration,\npass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
3855
3960
|
} else {
|
|
3856
3961
|
throw errorMessage$1("No output path was specified to write the output file to.\n" + hint(`You have to either set ${code('"tadaTurboLocation"')} in your configuration,\npass an ${code("--output")} argument to this command,\nor pipe this command to an output file.`));
|
|
@@ -3865,37 +3970,40 @@ async function* run$2(t, i) {
|
|
|
3865
3970
|
}
|
|
3866
3971
|
}
|
|
3867
3972
|
}
|
|
3868
|
-
var f =
|
|
3869
|
-
rootPath:
|
|
3870
|
-
|
|
3973
|
+
var f = a({
|
|
3974
|
+
rootPath: i.configResult.rootPath,
|
|
3975
|
+
tsconfigPath: i.configResult.tsconfigPath,
|
|
3976
|
+
configPath: i.configResult.configPath,
|
|
3871
3977
|
pluginConfig: o,
|
|
3872
3978
|
turboOutputPath: "string" == typeof l ? l : u
|
|
3873
3979
|
});
|
|
3874
|
-
var g = [];
|
|
3875
3980
|
var p = [];
|
|
3981
|
+
var g = [];
|
|
3876
3982
|
var h = 0;
|
|
3877
3983
|
var v = 0;
|
|
3878
3984
|
var m = 0;
|
|
3985
|
+
var y = 0;
|
|
3879
3986
|
try {
|
|
3880
3987
|
if (t.isInteractive) {
|
|
3881
3988
|
yield runningTurbo();
|
|
3882
3989
|
}
|
|
3883
|
-
for await (var
|
|
3884
|
-
if ("EXTERNAL_WARNING" ===
|
|
3990
|
+
for await (var w of f) {
|
|
3991
|
+
if ("EXTERNAL_WARNING" === w.kind) {
|
|
3885
3992
|
yield experimentMessage(`${code(".vue")} and ${code(".svelte")} file support is experimental.`);
|
|
3886
|
-
} else if ("FILE_COUNT" ===
|
|
3887
|
-
v =
|
|
3888
|
-
} else if ("GRAPHQL_SOURCES" ===
|
|
3889
|
-
|
|
3993
|
+
} else if ("FILE_COUNT" === w.kind) {
|
|
3994
|
+
v = w.fileCount;
|
|
3995
|
+
} else if ("GRAPHQL_SOURCES" === w.kind) {
|
|
3996
|
+
g = w.sources;
|
|
3890
3997
|
} else {
|
|
3891
3998
|
m++;
|
|
3892
|
-
|
|
3893
|
-
|
|
3894
|
-
|
|
3895
|
-
|
|
3896
|
-
|
|
3897
|
-
|
|
3898
|
-
|
|
3999
|
+
p.push(...w.documents);
|
|
4000
|
+
y += w.documents.filter((t => t.isCached)).length;
|
|
4001
|
+
h += w.warnings.length;
|
|
4002
|
+
if (w.warnings.length) {
|
|
4003
|
+
var S = warningFile(w.filePath);
|
|
4004
|
+
for (var b of w.warnings) {
|
|
4005
|
+
S += (x = b, text([ Z, cmd(M.Style, R.BrightBlack), `${x.line}:${x.col}`, D.Tab, cmd(M.Style, R.Foreground), indent(x.message.trim(), text([ Z, D.Tab ])), D.Newline ]));
|
|
4006
|
+
warningGithub(b);
|
|
3899
4007
|
}
|
|
3900
4008
|
yield S + "\n";
|
|
3901
4009
|
}
|
|
@@ -3907,81 +4015,105 @@ async function* run$2(t, i) {
|
|
|
3907
4015
|
} catch (t) {
|
|
3908
4016
|
throw externalError("Could not build cache", t);
|
|
3909
4017
|
}
|
|
3910
|
-
var
|
|
4018
|
+
var x;
|
|
3911
4019
|
if ("schema" in o) {
|
|
3912
|
-
if (h &&
|
|
3913
|
-
|
|
4020
|
+
if (h && r.failOnWarn) {
|
|
4021
|
+
if (!n) {
|
|
4022
|
+
throw warningSummary(h);
|
|
4023
|
+
}
|
|
4024
|
+
return {
|
|
4025
|
+
warnings: h,
|
|
4026
|
+
failed: !0
|
|
4027
|
+
};
|
|
3914
4028
|
}
|
|
3915
4029
|
try {
|
|
3916
|
-
var
|
|
3917
|
-
|
|
3918
|
-
x[E.argumentKey] = E.documentType;
|
|
3919
|
-
}
|
|
3920
|
-
var C = createCacheContents(x, p, l);
|
|
3921
|
-
await writeOutput(l, C);
|
|
4030
|
+
var E = createCacheContents(p, g, l);
|
|
4031
|
+
await writeOutput(l, E);
|
|
3922
4032
|
} catch (t) {
|
|
3923
4033
|
throw externalError("Something went wrong while writing the type cache file", t);
|
|
3924
4034
|
}
|
|
3925
|
-
yield infoSummary$1(h,
|
|
4035
|
+
yield infoSummary$1(h, p.length, y);
|
|
3926
4036
|
} else {
|
|
3927
|
-
if (
|
|
4037
|
+
if (r.output) {
|
|
3928
4038
|
throw errorMessage$1("Output path was specified, while multiple schemas are configured.\n" + hint(`You can only output all schemas to their ${code('"tadaTurboLocation"')} options\nwhen multiple ${code("schemas")} are set up.`));
|
|
3929
4039
|
}
|
|
3930
|
-
var
|
|
3931
|
-
|
|
3932
|
-
|
|
4040
|
+
var C = {};
|
|
4041
|
+
var $ = {};
|
|
4042
|
+
for (var O of o.schemas) {
|
|
4043
|
+
var {name: k, tadaTurboLocation: N} = O;
|
|
3933
4044
|
if (!N) {
|
|
3934
4045
|
throw errorMessage$1(`No output path was specified to write the '${k}' type cache to.\n` + hint(`You have to set ${code('"tadaTurboLocation"')} in each schema configuration.`));
|
|
3935
4046
|
}
|
|
3936
4047
|
try {
|
|
3937
|
-
|
|
3938
|
-
|
|
3939
|
-
|
|
4048
|
+
C[k] = 0;
|
|
4049
|
+
$[k] = 0;
|
|
4050
|
+
var I = [];
|
|
4051
|
+
for (var T of p) {
|
|
3940
4052
|
if (T.schemaName === k) {
|
|
3941
|
-
I
|
|
3942
|
-
|
|
4053
|
+
I.push(T);
|
|
4054
|
+
C[k]++;
|
|
4055
|
+
if (T.isCached) {
|
|
4056
|
+
$[k]++;
|
|
4057
|
+
}
|
|
3943
4058
|
}
|
|
3944
4059
|
}
|
|
3945
4060
|
var P = c.resolve(s, N);
|
|
3946
|
-
var B = createCacheContents(I,
|
|
4061
|
+
var B = createCacheContents(I, g, P);
|
|
3947
4062
|
await writeOutput(P, B);
|
|
3948
4063
|
} catch (t) {
|
|
3949
4064
|
throw externalError(`Something went wrong while writing the '${k}' schema's type cache file.`, t);
|
|
3950
4065
|
}
|
|
3951
4066
|
}
|
|
3952
|
-
if (h &&
|
|
3953
|
-
|
|
4067
|
+
if (h && r.failOnWarn) {
|
|
4068
|
+
if (!n) {
|
|
4069
|
+
throw warningSummary(h);
|
|
4070
|
+
}
|
|
4071
|
+
return {
|
|
4072
|
+
warnings: h,
|
|
4073
|
+
failed: !0
|
|
4074
|
+
};
|
|
3954
4075
|
} else {
|
|
3955
|
-
yield infoSummary$1(h,
|
|
4076
|
+
yield infoSummary$1(h, C, $);
|
|
3956
4077
|
}
|
|
3957
4078
|
}
|
|
4079
|
+
return {
|
|
4080
|
+
warnings: h,
|
|
4081
|
+
failed: !1
|
|
4082
|
+
};
|
|
3958
4083
|
}
|
|
3959
4084
|
|
|
3960
4085
|
function createCacheContents(t, r, i) {
|
|
3961
|
-
var n =
|
|
3962
|
-
for (var a
|
|
3963
|
-
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
4086
|
+
var n = new Map;
|
|
4087
|
+
for (var a of t) {
|
|
4088
|
+
n.set(a.argumentKey, a);
|
|
4089
|
+
}
|
|
4090
|
+
var o = "";
|
|
4091
|
+
for (var s of n.values()) {
|
|
4092
|
+
if (o) {
|
|
4093
|
+
o += "\n";
|
|
4094
|
+
}
|
|
4095
|
+
if (s.documentHash) {
|
|
4096
|
+
o += ` /** @gql.tada/hash ${s.documentHash} */\n`;
|
|
4097
|
+
}
|
|
4098
|
+
o += ` ${s.argumentKey}:\n ${s.documentType};`;
|
|
4099
|
+
}
|
|
4100
|
+
var l = "import type { TadaDocumentNode, $tada } from 'gql.tada';\n";
|
|
4101
|
+
var u = "string" == typeof i || i && "object" == typeof i && "toString" in i && !("writable" in i);
|
|
4102
|
+
var d = new Set;
|
|
4103
|
+
for (var f of r) {
|
|
4104
|
+
for (var p of f.imports) {
|
|
4105
|
+
if (u) {
|
|
4106
|
+
var g = i.toString();
|
|
4107
|
+
var h = c.dirname(f.absolutePath);
|
|
4108
|
+
if (c.resolve(h, p.specifier) === c.resolve(g) || d.has(p.specifier)) {
|
|
3977
4109
|
continue;
|
|
3978
4110
|
}
|
|
3979
|
-
|
|
4111
|
+
d.add(p.specifier);
|
|
3980
4112
|
}
|
|
3981
|
-
|
|
4113
|
+
l += p.importClause + "\n";
|
|
3982
4114
|
}
|
|
3983
4115
|
}
|
|
3984
|
-
return
|
|
4116
|
+
return ee + l + "\ndeclare module 'gql.tada' {\n interface setupCache {\n" + o + "\n }\n}\n";
|
|
3985
4117
|
}
|
|
3986
4118
|
|
|
3987
4119
|
class TurboCommand extends Command {
|
|
@@ -4016,7 +4148,7 @@ async function generateTurbo(t) {
|
|
|
4016
4148
|
}
|
|
4017
4149
|
}
|
|
4018
4150
|
|
|
4019
|
-
var
|
|
4151
|
+
var te = {
|
|
4020
4152
|
__proto__: null,
|
|
4021
4153
|
generateOutput,
|
|
4022
4154
|
generatePersisted,
|
|
@@ -4024,28 +4156,28 @@ var ee = {
|
|
|
4024
4156
|
generateTurbo
|
|
4025
4157
|
};
|
|
4026
4158
|
|
|
4027
|
-
var
|
|
4159
|
+
var re = process.cwd();
|
|
4028
4160
|
|
|
4029
|
-
var
|
|
4161
|
+
var ie = " ";
|
|
4030
4162
|
|
|
4031
4163
|
function diagnosticFile(t) {
|
|
4032
|
-
var r = c.relative(
|
|
4164
|
+
var r = c.relative(re, t);
|
|
4033
4165
|
if (!r.startsWith("..")) {
|
|
4034
4166
|
t = r;
|
|
4035
4167
|
}
|
|
4036
|
-
return text([ cmd(M.Style,
|
|
4168
|
+
return text([ cmd(M.Style, R.Underline), t, cmd(M.Style, R.NoUnderline), "\n" ]);
|
|
4037
4169
|
}
|
|
4038
4170
|
|
|
4039
4171
|
function diagnosticMessage(t) {
|
|
4040
|
-
var r =
|
|
4172
|
+
var r = R.Foreground;
|
|
4041
4173
|
if ("info" === t.severity) {
|
|
4042
|
-
r =
|
|
4174
|
+
r = R.BrightBlue;
|
|
4043
4175
|
} else if ("warn" === t.severity) {
|
|
4044
|
-
r =
|
|
4176
|
+
r = R.BrightYellow;
|
|
4045
4177
|
} else if ("error" === t.severity) {
|
|
4046
|
-
r =
|
|
4178
|
+
r = R.BrightRed;
|
|
4047
4179
|
}
|
|
4048
|
-
return text([
|
|
4180
|
+
return text([ ie, cmd(M.Style, R.BrightBlack), `${t.line}:${t.col}`, D.Tab, cmd(M.Style, r), t.severity, D.Tab, cmd(M.Style, R.Foreground), indent(t.message.trim(), text([ ie, D.Tab, D.Tab ])), D.Newline ]);
|
|
4049
4181
|
}
|
|
4050
4182
|
|
|
4051
4183
|
function diagnosticMessageGithub(t) {
|
|
@@ -4060,7 +4192,7 @@ function diagnosticMessageGithub(t) {
|
|
|
4060
4192
|
|
|
4061
4193
|
function runningDiagnostics(t, r) {
|
|
4062
4194
|
var i = t ? r ? `(${t}/${r})` : `(${t})` : "";
|
|
4063
|
-
var frame = t => text([ cmd(M.Style,
|
|
4195
|
+
var frame = t => text([ cmd(M.Style, R.Magenta), H[t % H.length], " ", cmd(M.Style, R.Foreground), `Checking files${D.Ellipsis} `, cmd(M.Style, R.BrightBlack), i ]);
|
|
4064
4196
|
return concat([ fromValue(frame(0)), pipe(interval(150), map((t => frame(t + 1)))) ]);
|
|
4065
4197
|
}
|
|
4066
4198
|
|
|
@@ -4077,87 +4209,95 @@ var isMinSeverity = (t, r) => {
|
|
|
4077
4209
|
}
|
|
4078
4210
|
};
|
|
4079
4211
|
|
|
4080
|
-
async function* run$1(t,
|
|
4081
|
-
var {runDiagnostics:
|
|
4212
|
+
async function* run$1(t, r) {
|
|
4213
|
+
var {runDiagnostics: i} = await Promise.resolve().then((function() {
|
|
4082
4214
|
return require("./thread-chunk3.js");
|
|
4083
4215
|
}));
|
|
4084
|
-
var
|
|
4085
|
-
var o;
|
|
4216
|
+
var n;
|
|
4086
4217
|
try {
|
|
4087
|
-
|
|
4088
|
-
o = r.parseConfig(a.pluginConfig, a.rootPath);
|
|
4218
|
+
n = await loadProjects(r.tsconfig);
|
|
4089
4219
|
} catch (t) {
|
|
4090
4220
|
throw externalError("Failed to load configuration.", t);
|
|
4091
4221
|
}
|
|
4092
|
-
var
|
|
4222
|
+
var a = {
|
|
4093
4223
|
warn: 0,
|
|
4094
4224
|
error: 0,
|
|
4095
4225
|
info: 0
|
|
4096
4226
|
};
|
|
4097
|
-
var
|
|
4098
|
-
var
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
|
|
4102
|
-
|
|
4103
|
-
|
|
4104
|
-
|
|
4105
|
-
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
}
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
}
|
|
4115
|
-
|
|
4116
|
-
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4227
|
+
var o = r.minSeverity;
|
|
4228
|
+
var s = !1;
|
|
4229
|
+
for (var l of n) {
|
|
4230
|
+
if (n.length > 1) {
|
|
4231
|
+
yield projectHeader(l.label);
|
|
4232
|
+
}
|
|
4233
|
+
var c = i({
|
|
4234
|
+
rootPath: l.configResult.rootPath,
|
|
4235
|
+
tsconfigPath: l.configResult.tsconfigPath,
|
|
4236
|
+
configPath: l.configResult.configPath,
|
|
4237
|
+
pluginConfig: l.pluginConfig
|
|
4238
|
+
});
|
|
4239
|
+
var u = 0;
|
|
4240
|
+
var d = 0;
|
|
4241
|
+
try {
|
|
4242
|
+
if (t.isInteractive) {
|
|
4243
|
+
yield runningDiagnostics();
|
|
4244
|
+
}
|
|
4245
|
+
for await (var f of c) {
|
|
4246
|
+
if ("EXTERNAL_WARNING" === f.kind) {
|
|
4247
|
+
if (!s) {
|
|
4248
|
+
s = !0;
|
|
4249
|
+
yield experimentMessage(`${code(".vue")} and ${code(".svelte")} file support is experimental.`);
|
|
4250
|
+
}
|
|
4251
|
+
} else if ("FILE_COUNT" === f.kind) {
|
|
4252
|
+
u = f.fileCount;
|
|
4253
|
+
} else {
|
|
4254
|
+
d++;
|
|
4255
|
+
var p = "";
|
|
4256
|
+
for (var g of f.messages) {
|
|
4257
|
+
a[g.severity]++;
|
|
4258
|
+
if (isMinSeverity(g.severity, o)) {
|
|
4259
|
+
p += diagnosticMessage(g);
|
|
4260
|
+
diagnosticMessageGithub(g);
|
|
4261
|
+
}
|
|
4262
|
+
}
|
|
4263
|
+
if (p) {
|
|
4264
|
+
yield diagnosticFile(f.filePath) + p + "\n";
|
|
4122
4265
|
}
|
|
4123
4266
|
}
|
|
4124
|
-
if (
|
|
4125
|
-
yield
|
|
4267
|
+
if (t.isInteractive) {
|
|
4268
|
+
yield runningDiagnostics(d, u);
|
|
4126
4269
|
}
|
|
4127
4270
|
}
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
}
|
|
4271
|
+
} catch (t) {
|
|
4272
|
+
throw externalError("Could not check files", t);
|
|
4131
4273
|
}
|
|
4132
|
-
} catch (t) {
|
|
4133
|
-
throw externalError("Could not check files", t);
|
|
4134
4274
|
}
|
|
4135
|
-
if ("info" !==
|
|
4136
|
-
|
|
4275
|
+
if ("info" !== o) {
|
|
4276
|
+
a.info = 0;
|
|
4137
4277
|
}
|
|
4138
|
-
if (
|
|
4278
|
+
if (r.failOnWarn && a.warn || a.error) {
|
|
4139
4279
|
throw function problemsSummary(t) {
|
|
4140
4280
|
var {info: r, error: i, warn: n} = t;
|
|
4141
4281
|
var a = "";
|
|
4142
4282
|
if (r) {
|
|
4143
|
-
a += text([ cmd(M.Style,
|
|
4283
|
+
a += text([ cmd(M.Style, R.Blue), q.Info, ` ${r} notices\n` ]);
|
|
4144
4284
|
}
|
|
4145
|
-
return error(a += text([ cmd(M.Style,
|
|
4146
|
-
}(
|
|
4285
|
+
return error(a += text([ cmd(M.Style, R.Red), q.Cross, ` ${i + n} problems (${i} errors, ${n} warnings)\n` ]));
|
|
4286
|
+
}(a);
|
|
4147
4287
|
} else {
|
|
4148
4288
|
yield function infoSummary(t) {
|
|
4149
4289
|
var {info: r, error: i, warn: n} = t;
|
|
4150
4290
|
var a = "";
|
|
4151
4291
|
if (r) {
|
|
4152
|
-
a += text([ cmd(M.Style,
|
|
4292
|
+
a += text([ cmd(M.Style, R.Blue), q.Info, ` ${r} notices\n` ]);
|
|
4153
4293
|
}
|
|
4154
4294
|
if (i || n) {
|
|
4155
|
-
a += text([ cmd(M.Style,
|
|
4295
|
+
a += text([ cmd(M.Style, R.BrightYellow), q.Warning, ` ${i + n} problems (${i} errors, ${n} warnings)\n` ]);
|
|
4156
4296
|
} else {
|
|
4157
|
-
a += text([ cmd(M.Style,
|
|
4297
|
+
a += text([ cmd(M.Style, R.BrightGreen), q.Tick, " No problems found\n" ]);
|
|
4158
4298
|
}
|
|
4159
4299
|
return a;
|
|
4160
|
-
}(
|
|
4300
|
+
}(a);
|
|
4161
4301
|
}
|
|
4162
4302
|
}
|
|
4163
4303
|
|
|
@@ -4184,11 +4324,11 @@ class CheckCommand extends Command {
|
|
|
4184
4324
|
}
|
|
4185
4325
|
}
|
|
4186
4326
|
|
|
4187
|
-
var
|
|
4327
|
+
var ne = new Intl.Collator(0, {
|
|
4188
4328
|
numeric: 1
|
|
4189
4329
|
}).compare;
|
|
4190
4330
|
|
|
4191
|
-
var
|
|
4331
|
+
var ae = {
|
|
4192
4332
|
typescript_embed_lsp: "5.5.0",
|
|
4193
4333
|
typescript: "4.1.0",
|
|
4194
4334
|
tada: "1.0.0",
|
|
@@ -4200,7 +4340,7 @@ var semverComply = (t, r) => {
|
|
|
4200
4340
|
return i ? function semiver(t, r, i) {
|
|
4201
4341
|
t = t.split(".");
|
|
4202
4342
|
r = r.split(".");
|
|
4203
|
-
return
|
|
4343
|
+
return ne(t[0], r[0]) || ne(t[1], r[1]) || (r[2] = r.slice(2).join("."), (i = /[.-]/.test(t[2] = t.slice(2).join("."))) == /[.-]/.test(r[2]) ? ne(t[2], r[2]) : i ? -1 : 1);
|
|
4204
4344
|
}(i[0], r) >= 0 : !1;
|
|
4205
4345
|
};
|
|
4206
4346
|
|
|
@@ -4316,19 +4456,19 @@ function createVirtualLanguageServiceHost(t, r, i, n, a) {
|
|
|
4316
4456
|
};
|
|
4317
4457
|
}
|
|
4318
4458
|
|
|
4319
|
-
var ae = {};
|
|
4320
|
-
|
|
4321
4459
|
var oe = {};
|
|
4322
4460
|
|
|
4323
4461
|
var se = {};
|
|
4324
4462
|
|
|
4325
|
-
|
|
4463
|
+
var le = {};
|
|
4464
|
+
|
|
4465
|
+
Object.defineProperty(le, "__esModule", {
|
|
4326
4466
|
value: !0
|
|
4327
4467
|
});
|
|
4328
4468
|
|
|
4329
|
-
|
|
4469
|
+
le.binarySearch = void 0;
|
|
4330
4470
|
|
|
4331
|
-
|
|
4471
|
+
le.binarySearch = function binarySearch$2(t, r) {
|
|
4332
4472
|
var i = 0;
|
|
4333
4473
|
var n = t.length - 1;
|
|
4334
4474
|
while (i <= n) {
|
|
@@ -4347,34 +4487,34 @@ se.binarySearch = function binarySearch$2(t, r) {
|
|
|
4347
4487
|
return Math.max(Math.min(i, n, t.length - 1), 0);
|
|
4348
4488
|
};
|
|
4349
4489
|
|
|
4350
|
-
var
|
|
4490
|
+
var ce = {};
|
|
4351
4491
|
|
|
4352
|
-
Object.defineProperty(
|
|
4492
|
+
Object.defineProperty(ce, "__esModule", {
|
|
4353
4493
|
value: !0
|
|
4354
4494
|
});
|
|
4355
4495
|
|
|
4356
|
-
|
|
4496
|
+
ce.getStack = ce.track = ce.resetOffsetStack = ce.offsetStack = ce.setTracking = void 0;
|
|
4357
4497
|
|
|
4358
|
-
var
|
|
4498
|
+
var ue = !0;
|
|
4359
4499
|
|
|
4360
|
-
var
|
|
4500
|
+
var de = 0;
|
|
4361
4501
|
|
|
4362
|
-
|
|
4363
|
-
|
|
4502
|
+
ce.setTracking = function setTracking(t) {
|
|
4503
|
+
ue = t;
|
|
4364
4504
|
};
|
|
4365
4505
|
|
|
4366
|
-
|
|
4367
|
-
|
|
4506
|
+
ce.offsetStack = function offsetStack() {
|
|
4507
|
+
de++;
|
|
4368
4508
|
};
|
|
4369
4509
|
|
|
4370
|
-
|
|
4371
|
-
|
|
4510
|
+
ce.resetOffsetStack = function resetOffsetStack() {
|
|
4511
|
+
de--;
|
|
4372
4512
|
};
|
|
4373
4513
|
|
|
4374
|
-
|
|
4514
|
+
ce.track = function track(t, r = []) {
|
|
4375
4515
|
return [ new Proxy(t, {
|
|
4376
4516
|
get(t, r, i) {
|
|
4377
|
-
if (
|
|
4517
|
+
if (ue) {
|
|
4378
4518
|
if ("push" === r) {
|
|
4379
4519
|
return push;
|
|
4380
4520
|
}
|
|
@@ -4461,10 +4601,10 @@ le.track = function track(t, r = []) {
|
|
|
4461
4601
|
throw new Error("Invalid splice operation");
|
|
4462
4602
|
}
|
|
4463
4603
|
var f = n;
|
|
4464
|
-
for (var
|
|
4465
|
-
var
|
|
4466
|
-
while (f > 0 &&
|
|
4467
|
-
|
|
4604
|
+
for (var p = s; p < r.length; p++) {
|
|
4605
|
+
var g = r[p];
|
|
4606
|
+
while (f > 0 && g.length > 0) {
|
|
4607
|
+
g.length--;
|
|
4468
4608
|
f--;
|
|
4469
4609
|
}
|
|
4470
4610
|
if (0 === f) {
|
|
@@ -4494,7 +4634,7 @@ le.track = function track(t, r = []) {
|
|
|
4494
4634
|
};
|
|
4495
4635
|
|
|
4496
4636
|
function getStack() {
|
|
4497
|
-
var t = (new Error).stack.split("\n")[3 +
|
|
4637
|
+
var t = (new Error).stack.split("\n")[3 + de].trim();
|
|
4498
4638
|
if (t.endsWith(")")) {
|
|
4499
4639
|
t = t.slice(t.lastIndexOf("(") + 1, -1);
|
|
4500
4640
|
} else {
|
|
@@ -4503,11 +4643,11 @@ function getStack() {
|
|
|
4503
4643
|
return t;
|
|
4504
4644
|
}
|
|
4505
4645
|
|
|
4506
|
-
|
|
4646
|
+
ce.getStack = getStack;
|
|
4507
4647
|
|
|
4508
|
-
var
|
|
4648
|
+
var fe = {};
|
|
4509
4649
|
|
|
4510
|
-
Object.defineProperty(
|
|
4650
|
+
Object.defineProperty(fe, "__esModule", {
|
|
4511
4651
|
value: !0
|
|
4512
4652
|
});
|
|
4513
4653
|
|
|
@@ -4543,10 +4683,10 @@ Object.defineProperty(de, "__esModule", {
|
|
|
4543
4683
|
value: !0
|
|
4544
4684
|
});
|
|
4545
4685
|
t.replaceRange = t.replaceSourceRange = t.replaceAll = t.replace = t.create = t.toString = t.getLength = void 0;
|
|
4546
|
-
var n =
|
|
4547
|
-
var a =
|
|
4548
|
-
i(
|
|
4549
|
-
i(
|
|
4686
|
+
var n = le;
|
|
4687
|
+
var a = ce;
|
|
4688
|
+
i(fe, t);
|
|
4689
|
+
i(ce, t);
|
|
4550
4690
|
function getLength(t) {
|
|
4551
4691
|
var r = 0;
|
|
4552
4692
|
for (var i of t) {
|
|
@@ -4637,20 +4777,20 @@ Object.defineProperty(de, "__esModule", {
|
|
|
4637
4777
|
var u = t[c];
|
|
4638
4778
|
var d = s[l];
|
|
4639
4779
|
var f = s[c];
|
|
4640
|
-
var
|
|
4641
|
-
var
|
|
4780
|
+
var p = s[c] + ("string" == typeof u ? u.length : u[0].length);
|
|
4781
|
+
var g = [];
|
|
4642
4782
|
if (r > d) {
|
|
4643
|
-
|
|
4783
|
+
g.push(trimSegmentEnd(t[l], r - d));
|
|
4644
4784
|
}
|
|
4645
4785
|
for (var h of o) {
|
|
4646
|
-
|
|
4786
|
+
g.push(h);
|
|
4647
4787
|
}
|
|
4648
|
-
if (i <
|
|
4649
|
-
|
|
4788
|
+
if (i < p) {
|
|
4789
|
+
g.push(trimSegmentStart(u, i - f));
|
|
4650
4790
|
}
|
|
4651
|
-
combineStrings(
|
|
4791
|
+
combineStrings(g);
|
|
4652
4792
|
(0, a.offsetStack)();
|
|
4653
|
-
t.splice(l, c - l + 1, ...
|
|
4793
|
+
t.splice(l, c - l + 1, ...g);
|
|
4654
4794
|
(0, a.resetOffsetStack)();
|
|
4655
4795
|
}
|
|
4656
4796
|
t.replaceRange = replaceRange;
|
|
@@ -4679,9 +4819,9 @@ Object.defineProperty(de, "__esModule", {
|
|
|
4679
4819
|
}
|
|
4680
4820
|
return [ t[0].slice(r), t[1], t[2] + r, ...t.slice(3) ];
|
|
4681
4821
|
}
|
|
4682
|
-
}(
|
|
4822
|
+
}(se);
|
|
4683
4823
|
|
|
4684
|
-
var
|
|
4824
|
+
var pe = {};
|
|
4685
4825
|
|
|
4686
4826
|
var ge = {};
|
|
4687
4827
|
|
|
@@ -4716,15 +4856,15 @@ ge.binarySearch = function binarySearch(t, r) {
|
|
|
4716
4856
|
};
|
|
4717
4857
|
};
|
|
4718
4858
|
|
|
4719
|
-
var
|
|
4859
|
+
var he = {};
|
|
4720
4860
|
|
|
4721
|
-
Object.defineProperty(
|
|
4861
|
+
Object.defineProperty(he, "__esModule", {
|
|
4722
4862
|
value: !0
|
|
4723
4863
|
});
|
|
4724
4864
|
|
|
4725
|
-
|
|
4865
|
+
he.translateOffset = void 0;
|
|
4726
4866
|
|
|
4727
|
-
|
|
4867
|
+
he.translateOffset = function translateOffset(t, r, i, n) {
|
|
4728
4868
|
for (var a = 0; a < r.length; a++) {
|
|
4729
4869
|
var o = r[a];
|
|
4730
4870
|
if (t >= o && t <= o + n[a]) {
|
|
@@ -4733,17 +4873,17 @@ pe.translateOffset = function translateOffset(t, r, i, n) {
|
|
|
4733
4873
|
}
|
|
4734
4874
|
};
|
|
4735
4875
|
|
|
4736
|
-
Object.defineProperty(
|
|
4876
|
+
Object.defineProperty(pe, "__esModule", {
|
|
4737
4877
|
value: !0
|
|
4738
4878
|
});
|
|
4739
4879
|
|
|
4740
|
-
|
|
4880
|
+
pe.SourceMap = void 0;
|
|
4741
4881
|
|
|
4742
|
-
var
|
|
4882
|
+
var ve = ge;
|
|
4743
4883
|
|
|
4744
|
-
var
|
|
4884
|
+
var me = he;
|
|
4745
4885
|
|
|
4746
|
-
|
|
4886
|
+
pe.SourceMap = class SourceMap {
|
|
4747
4887
|
constructor(t) {
|
|
4748
4888
|
this.mappings = t;
|
|
4749
4889
|
}
|
|
@@ -4768,7 +4908,7 @@ fe.SourceMap = class SourceMap {
|
|
|
4768
4908
|
if (0 === n.offsets.length) {
|
|
4769
4909
|
return;
|
|
4770
4910
|
}
|
|
4771
|
-
var {low: a, high: o} = (0,
|
|
4911
|
+
var {low: a, high: o} = (0, ve.binarySearch)(n.offsets, t);
|
|
4772
4912
|
var s = new Set;
|
|
4773
4913
|
for (var l = a; l <= o; l++) {
|
|
4774
4914
|
for (var c of n.mappings[l]) {
|
|
@@ -4776,7 +4916,7 @@ fe.SourceMap = class SourceMap {
|
|
|
4776
4916
|
continue;
|
|
4777
4917
|
}
|
|
4778
4918
|
s.add(c);
|
|
4779
|
-
var u = (0,
|
|
4919
|
+
var u = (0, me.translateOffset)(t, c[r], c[i], c.lengths);
|
|
4780
4920
|
if (void 0 !== u) {
|
|
4781
4921
|
yield [ u, c ];
|
|
4782
4922
|
}
|
|
@@ -4798,8 +4938,8 @@ fe.SourceMap = class SourceMap {
|
|
|
4798
4938
|
var o = a.map((() => new Set));
|
|
4799
4939
|
for (var s of this.mappings) {
|
|
4800
4940
|
for (var l = 0; l < s[t].length; l++) {
|
|
4801
|
-
var c = (0,
|
|
4802
|
-
var u = (0,
|
|
4941
|
+
var c = (0, ve.binarySearch)(a, s[t][l]).match;
|
|
4942
|
+
var u = (0, ve.binarySearch)(a, s[t][l] + s.lengths[l]).match;
|
|
4803
4943
|
for (var d = c; d <= u; d++) {
|
|
4804
4944
|
o[d].add(s);
|
|
4805
4945
|
}
|
|
@@ -4812,15 +4952,15 @@ fe.SourceMap = class SourceMap {
|
|
|
4812
4952
|
}
|
|
4813
4953
|
};
|
|
4814
4954
|
|
|
4815
|
-
var
|
|
4955
|
+
var ye = {};
|
|
4816
4956
|
|
|
4817
|
-
Object.defineProperty(
|
|
4957
|
+
Object.defineProperty(ye, "__esModule", {
|
|
4818
4958
|
value: !0
|
|
4819
4959
|
});
|
|
4820
4960
|
|
|
4821
|
-
|
|
4961
|
+
ye.buildMappings = void 0;
|
|
4822
4962
|
|
|
4823
|
-
|
|
4963
|
+
ye.buildMappings = function buildMappings(t) {
|
|
4824
4964
|
var r = 0;
|
|
4825
4965
|
var i = [];
|
|
4826
4966
|
for (var n of t) {
|
|
@@ -4840,15 +4980,15 @@ me.buildMappings = function buildMappings(t) {
|
|
|
4840
4980
|
return i;
|
|
4841
4981
|
};
|
|
4842
4982
|
|
|
4843
|
-
var
|
|
4983
|
+
var we = {};
|
|
4844
4984
|
|
|
4845
|
-
Object.defineProperty(
|
|
4985
|
+
Object.defineProperty(we, "__esModule", {
|
|
4846
4986
|
value: !0
|
|
4847
4987
|
});
|
|
4848
4988
|
|
|
4849
|
-
|
|
4989
|
+
we.buildStacks = void 0;
|
|
4850
4990
|
|
|
4851
|
-
|
|
4991
|
+
we.buildStacks = function buildStacks(t, r) {
|
|
4852
4992
|
var i = 0;
|
|
4853
4993
|
var n = 0;
|
|
4854
4994
|
var a = [];
|
|
@@ -4902,14 +5042,14 @@ ye.buildStacks = function buildStacks(t, r) {
|
|
|
4902
5042
|
Object.defineProperty(t, "__esModule", {
|
|
4903
5043
|
value: !0
|
|
4904
5044
|
});
|
|
4905
|
-
i(
|
|
4906
|
-
i(fe, t);
|
|
5045
|
+
i(se, t);
|
|
4907
5046
|
i(pe, t);
|
|
4908
|
-
i(
|
|
5047
|
+
i(he, t);
|
|
4909
5048
|
i(ye, t);
|
|
4910
|
-
|
|
5049
|
+
i(we, t);
|
|
5050
|
+
}(oe);
|
|
4911
5051
|
|
|
4912
|
-
class SourceMappedFile extends
|
|
5052
|
+
class SourceMappedFile extends oe.SourceMap {
|
|
4913
5053
|
constructor(t, r) {
|
|
4914
5054
|
super(t);
|
|
4915
5055
|
this.sourceFile = r.sourceFile;
|
|
@@ -5144,9 +5284,9 @@ var buildPluginInfo = t => {
|
|
|
5144
5284
|
|
|
5145
5285
|
var Se;
|
|
5146
5286
|
|
|
5147
|
-
var
|
|
5287
|
+
var be;
|
|
5148
5288
|
|
|
5149
|
-
var
|
|
5289
|
+
var xe = [ ".svelte", ".vue" ];
|
|
5150
5290
|
|
|
5151
5291
|
var transform = async t => {
|
|
5152
5292
|
var r = c.extname(t.fileName);
|
|
@@ -5163,27 +5303,27 @@ var transform = async t => {
|
|
|
5163
5303
|
})(t);
|
|
5164
5304
|
} else if (".vue" === r) {
|
|
5165
5305
|
await (async () => {
|
|
5166
|
-
if (!
|
|
5306
|
+
if (!be) {
|
|
5167
5307
|
try {
|
|
5168
|
-
|
|
5308
|
+
be = await import("@gql.tada/vue-support");
|
|
5169
5309
|
} catch (t) {
|
|
5170
5310
|
throw new TadaError(I.VUE_SUPPORT, "For Vue support the `@gql.tada/vue-support` package must be installed.\nInstall the package and try again.");
|
|
5171
5311
|
}
|
|
5172
5312
|
}
|
|
5173
|
-
return
|
|
5313
|
+
return be.check();
|
|
5174
5314
|
})();
|
|
5175
5315
|
return (async (...t) => {
|
|
5176
|
-
if (!
|
|
5316
|
+
if (!be) {
|
|
5177
5317
|
try {
|
|
5178
|
-
|
|
5318
|
+
be = await import("@gql.tada/vue-support");
|
|
5179
5319
|
} catch (t) {
|
|
5180
5320
|
throw new TadaError(I.VUE_SUPPORT, "For Vue support the `@gql.tada/vue-support` package must be installed.\nInstall the package and try again.");
|
|
5181
5321
|
}
|
|
5182
5322
|
}
|
|
5183
|
-
return
|
|
5323
|
+
return be.transform(...t);
|
|
5184
5324
|
})(t);
|
|
5185
5325
|
} else {
|
|
5186
|
-
throw new TadaError(I.UNKNOWN_EXTERNAL_FILE, `Tried transforming unknown file type "${r}". Supported: ${
|
|
5326
|
+
throw new TadaError(I.UNKNOWN_EXTERNAL_FILE, `Tried transforming unknown file type "${r}". Supported: ${xe.join(", ")}`);
|
|
5187
5327
|
}
|
|
5188
5328
|
};
|
|
5189
5329
|
|
|
@@ -5273,8 +5413,8 @@ var programFactory = t => {
|
|
|
5273
5413
|
u.moduleResolution = s.ModuleResolutionKind.Bundler;
|
|
5274
5414
|
}
|
|
5275
5415
|
var f = createVirtualCompilerHost(n, u, s);
|
|
5276
|
-
var
|
|
5277
|
-
var
|
|
5416
|
+
var p = s.createDocumentRegistry();
|
|
5417
|
+
var g = {
|
|
5278
5418
|
get projectPath() {
|
|
5279
5419
|
return t.rootPath;
|
|
5280
5420
|
},
|
|
@@ -5288,8 +5428,11 @@ var programFactory = t => {
|
|
|
5288
5428
|
}
|
|
5289
5429
|
return [ ...r ];
|
|
5290
5430
|
},
|
|
5431
|
+
get rootFileNames() {
|
|
5432
|
+
return [ ...o ];
|
|
5433
|
+
},
|
|
5291
5434
|
createSourceFile: (t, r) => s.createSourceFile(t.fileId, "object" == typeof t.sourceText ? t.sourceText.getText(0, t.sourceText.getLength()) : t.sourceText, u.target || s.ScriptTarget.ESNext, !0, r || (null != t.scriptKind ? t.scriptKind : s.ScriptKind.TSX)),
|
|
5292
|
-
createExternalFiles(r =
|
|
5435
|
+
createExternalFiles(r = xe) {
|
|
5293
5436
|
var i = [];
|
|
5294
5437
|
var a = new Set(o);
|
|
5295
5438
|
var l = new Set([ t.rootPath ]);
|
|
@@ -5300,11 +5443,11 @@ var programFactory = t => {
|
|
|
5300
5443
|
for (var f of n.readDirectory(d, r, [ "**/node_modules" ])) {
|
|
5301
5444
|
if (!a.has(f)) {
|
|
5302
5445
|
a.add(f);
|
|
5303
|
-
var
|
|
5304
|
-
if (
|
|
5305
|
-
i.push(
|
|
5446
|
+
var p = n.readFile(f, "utf8");
|
|
5447
|
+
if (p) {
|
|
5448
|
+
i.push(g.createSourceFile({
|
|
5306
5449
|
fileId: f,
|
|
5307
|
-
sourceText:
|
|
5450
|
+
sourceText: p
|
|
5308
5451
|
}, s.ScriptKind.External));
|
|
5309
5452
|
}
|
|
5310
5453
|
}
|
|
@@ -5313,13 +5456,13 @@ var programFactory = t => {
|
|
|
5313
5456
|
return i;
|
|
5314
5457
|
},
|
|
5315
5458
|
addSourceFile(t) {
|
|
5316
|
-
var r = "fileName" in t ? t :
|
|
5459
|
+
var r = "fileName" in t ? t : g.createSourceFile(t, s.ScriptKind.TSX);
|
|
5317
5460
|
f.updateFile(r);
|
|
5318
5461
|
o.add(r.fileName);
|
|
5319
|
-
return
|
|
5462
|
+
return g;
|
|
5320
5463
|
},
|
|
5321
5464
|
addMappedFile(t, r) {
|
|
5322
|
-
var n = "fileName" in t ? t :
|
|
5465
|
+
var n = "fileName" in t ? t : g.createSourceFile(t, s.ScriptKind.External);
|
|
5323
5466
|
if (r.mappings.length) {
|
|
5324
5467
|
o.delete(n.fileName);
|
|
5325
5468
|
}
|
|
@@ -5330,14 +5473,14 @@ var programFactory = t => {
|
|
|
5330
5473
|
});
|
|
5331
5474
|
i.set(a.sourceFileId, a);
|
|
5332
5475
|
i.set(a.generatedFileId, a);
|
|
5333
|
-
return
|
|
5476
|
+
return g;
|
|
5334
5477
|
},
|
|
5335
5478
|
async addVirtualFiles(t) {
|
|
5336
5479
|
for (var r of t) {
|
|
5337
5480
|
var i = `${r.fileName}.ts`;
|
|
5338
5481
|
var n = await transform(r);
|
|
5339
5482
|
if (n) {
|
|
5340
|
-
|
|
5483
|
+
g.addSourceFile({
|
|
5341
5484
|
fileId: i,
|
|
5342
5485
|
sourceText: n.snapshot
|
|
5343
5486
|
}).addMappedFile(r, {
|
|
@@ -5346,30 +5489,33 @@ var programFactory = t => {
|
|
|
5346
5489
|
});
|
|
5347
5490
|
}
|
|
5348
5491
|
}
|
|
5349
|
-
return
|
|
5492
|
+
return g;
|
|
5493
|
+
},
|
|
5494
|
+
resolveModulePath(t, r) {
|
|
5495
|
+
var i = s.resolveModuleName(t, r, u, f.compilerHost);
|
|
5496
|
+
return i.resolvedModule?.resolvedFileName;
|
|
5350
5497
|
},
|
|
5351
5498
|
resolveModuleName(t, r, i) {
|
|
5352
5499
|
if (!t.startsWith(".")) {
|
|
5353
5500
|
return t;
|
|
5354
5501
|
}
|
|
5355
|
-
var n =
|
|
5356
|
-
if (n
|
|
5357
|
-
var a =
|
|
5358
|
-
var o = c.
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
l = "./" + l;
|
|
5502
|
+
var n = g.resolveModulePath(t, r);
|
|
5503
|
+
if (n) {
|
|
5504
|
+
var a = c.dirname(i);
|
|
5505
|
+
var o = c.relative(a, n);
|
|
5506
|
+
if (!o.startsWith(".")) {
|
|
5507
|
+
o = "./" + o;
|
|
5362
5508
|
}
|
|
5363
|
-
return
|
|
5509
|
+
return o.replace(/\\/g, "/");
|
|
5364
5510
|
}
|
|
5365
|
-
var
|
|
5366
|
-
var
|
|
5367
|
-
var
|
|
5368
|
-
var
|
|
5369
|
-
if (!
|
|
5370
|
-
|
|
5511
|
+
var s = c.dirname(r);
|
|
5512
|
+
var l = c.dirname(i);
|
|
5513
|
+
var u = c.resolve(s, t);
|
|
5514
|
+
var d = c.relative(l, u);
|
|
5515
|
+
if (!d.startsWith(".")) {
|
|
5516
|
+
d = "./" + d;
|
|
5371
5517
|
}
|
|
5372
|
-
return
|
|
5518
|
+
return d.replace(/\\/g, "/");
|
|
5373
5519
|
},
|
|
5374
5520
|
build() {
|
|
5375
5521
|
(() => {
|
|
@@ -5451,11 +5597,11 @@ var programFactory = t => {
|
|
|
5451
5597
|
rootNames: [ ...o ],
|
|
5452
5598
|
options: u,
|
|
5453
5599
|
system: n,
|
|
5454
|
-
documentRegistry:
|
|
5600
|
+
documentRegistry: p
|
|
5455
5601
|
});
|
|
5456
5602
|
}
|
|
5457
5603
|
};
|
|
5458
|
-
return
|
|
5604
|
+
return g;
|
|
5459
5605
|
};
|
|
5460
5606
|
|
|
5461
5607
|
var resolveDefaultLibsPath = t => {
|
|
@@ -5476,32 +5622,33 @@ var resolveDefaultLibsPath = t => {
|
|
|
5476
5622
|
};
|
|
5477
5623
|
|
|
5478
5624
|
var resolveConfig = t => {
|
|
5479
|
-
var r =
|
|
5480
|
-
var i = s.
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5484
|
-
|
|
5485
|
-
|
|
5625
|
+
var r = t.tsconfigPath || t.configPath;
|
|
5626
|
+
var i = s.sys.readFile(r, "utf8") || "{}";
|
|
5627
|
+
var n = s.parseConfigFileTextToJson(r, i);
|
|
5628
|
+
if (null != n.error) {
|
|
5629
|
+
throw new Error(n.error.messageText.toString());
|
|
5630
|
+
}
|
|
5631
|
+
var a = c.dirname(r);
|
|
5632
|
+
return s.parseJsonConfigFileContent(n.config, s.sys, a, s.getDefaultCompilerOptions(), r);
|
|
5486
5633
|
};
|
|
5487
5634
|
|
|
5488
|
-
var
|
|
5635
|
+
var Ee = function(t) {
|
|
5489
5636
|
t[t.File = 0] = "File";
|
|
5490
5637
|
t[t.Directory = 1] = "Directory";
|
|
5491
5638
|
return t;
|
|
5492
5639
|
}({});
|
|
5493
5640
|
|
|
5494
|
-
var stat = async (t, r =
|
|
5641
|
+
var stat = async (t, r = Ee.File) => await u.stat(t).then((t => {
|
|
5495
5642
|
switch (r) {
|
|
5496
|
-
case
|
|
5643
|
+
case Ee.File:
|
|
5497
5644
|
return t.isFile();
|
|
5498
5645
|
|
|
5499
|
-
case
|
|
5646
|
+
case Ee.Directory:
|
|
5500
5647
|
return t.isDirectory();
|
|
5501
5648
|
}
|
|
5502
5649
|
})).catch((() => !1));
|
|
5503
5650
|
|
|
5504
|
-
var
|
|
5651
|
+
var Ce = /^(?:graphql\.config|\.graphqlrc)\.(?:cjs|[jt]s|json|toml|ya?ml)$/i;
|
|
5505
5652
|
|
|
5506
5653
|
var findGraphQLConfig = async t => {
|
|
5507
5654
|
var r = process.cwd();
|
|
@@ -5511,13 +5658,13 @@ var findGraphQLConfig = async t => {
|
|
|
5511
5658
|
try {
|
|
5512
5659
|
n = await u.readdir(r);
|
|
5513
5660
|
} catch (t) {}
|
|
5514
|
-
var a = n.find((t =>
|
|
5661
|
+
var a = n.find((t => Ce.test(t)));
|
|
5515
5662
|
if (a) {
|
|
5516
5663
|
return a;
|
|
5517
5664
|
}
|
|
5518
|
-
if (await stat(c.resolve(r, ".git"),
|
|
5665
|
+
if (await stat(c.resolve(r, ".git"), Ee.Directory)) {
|
|
5519
5666
|
break;
|
|
5520
|
-
} else if (await stat(c.resolve(r, ".vscode"),
|
|
5667
|
+
} else if (await stat(c.resolve(r, ".vscode"), Ee.Directory)) {
|
|
5521
5668
|
break;
|
|
5522
5669
|
}
|
|
5523
5670
|
r = c.resolve(r, "..");
|
|
@@ -5526,9 +5673,9 @@ var findGraphQLConfig = async t => {
|
|
|
5526
5673
|
var r = t || process.cwd();
|
|
5527
5674
|
var i = c.resolve(r, "/");
|
|
5528
5675
|
while (r !== i) {
|
|
5529
|
-
if (await stat(c.resolve(r, ".git"),
|
|
5676
|
+
if (await stat(c.resolve(r, ".git"), Ee.Directory)) {
|
|
5530
5677
|
return r;
|
|
5531
|
-
} else if (await stat(c.resolve(r, ".vscode"),
|
|
5678
|
+
} else if (await stat(c.resolve(r, ".vscode"), Ee.Directory)) {
|
|
5532
5679
|
return r;
|
|
5533
5680
|
} else if (await stat(c.resolve(r, "pnpm-workspace.yml"))) {
|
|
5534
5681
|
return r;
|
|
@@ -5761,16 +5908,16 @@ var isVSCodeInstalled = async () => {
|
|
|
5761
5908
|
return !1;
|
|
5762
5909
|
}
|
|
5763
5910
|
var t = c.resolve(process.env.HOME, ".vscode");
|
|
5764
|
-
return !!await stat(t,
|
|
5911
|
+
return !!await stat(t, Ee.Directory);
|
|
5765
5912
|
};
|
|
5766
5913
|
|
|
5767
5914
|
var loadSuggestedExtensionsList = async t => {
|
|
5768
5915
|
var r = process.cwd();
|
|
5769
5916
|
var i = c.resolve(r, "/");
|
|
5770
5917
|
while (r !== i) {
|
|
5771
|
-
if (await stat(c.resolve(r, ".git"),
|
|
5918
|
+
if (await stat(c.resolve(r, ".git"), Ee.Directory)) {
|
|
5772
5919
|
break;
|
|
5773
|
-
} else if (await stat(c.resolve(r, ".vscode"),
|
|
5920
|
+
} else if (await stat(c.resolve(r, ".vscode"), Ee.Directory)) {
|
|
5774
5921
|
break;
|
|
5775
5922
|
}
|
|
5776
5923
|
r = c.resolve(r, "..");
|
|
@@ -5819,32 +5966,32 @@ var loadExtensionsList = async () => {
|
|
|
5819
5966
|
};
|
|
5820
5967
|
|
|
5821
5968
|
function emptyLine() {
|
|
5822
|
-
return text([ cmd(M.Style,
|
|
5969
|
+
return text([ cmd(M.Style, R.BrightBlack), _.Vertical, "\n" ]);
|
|
5823
5970
|
}
|
|
5824
5971
|
|
|
5825
5972
|
function completedTask(t, r = !1) {
|
|
5826
|
-
return text([ emptyLine(), cmd(M.Style,
|
|
5973
|
+
return text([ emptyLine(), cmd(M.Style, R.BrightBlack), r ? _.BottomLeft : _.VerticalRight, " ", cmd(M.Style, R.Green), q.TickSwoosh, " ", cmd(M.Style, R.Foreground), t, "\n" ]);
|
|
5827
5974
|
}
|
|
5828
5975
|
|
|
5829
5976
|
function failedTask(t) {
|
|
5830
|
-
return text([ emptyLine(), cmd(M.Style,
|
|
5977
|
+
return text([ emptyLine(), cmd(M.Style, R.BrightBlack), _.BottomLeft, " ", cmd(M.Style, R.BrightRed), q.CrossSwoosh, " ", cmd(M.Style, R.Foreground), t, "\n" ]);
|
|
5831
5978
|
}
|
|
5832
5979
|
|
|
5833
5980
|
function warningTask(t) {
|
|
5834
|
-
return text([ emptyLine(), cmd(M.Style,
|
|
5981
|
+
return text([ emptyLine(), cmd(M.Style, R.BrightBlack), _.VerticalRight, " ", cmd(M.Style, R.BrightYellow), q.Warning, " ", cmd(M.Style, R.Foreground), t, "\n" ]);
|
|
5835
5982
|
}
|
|
5836
5983
|
|
|
5837
5984
|
function hintMessage(t) {
|
|
5838
|
-
return text([ cmd(M.Style,
|
|
5985
|
+
return text([ cmd(M.Style, R.BrightBlack), `${_.VerticalRight} `, cmd(M.Style, R.BrightBlue), `${q.Info} `, cmd(M.Style, R.Blue), indent(t, text([ cmd(M.Style, R.BrightBlack), `${_.Vertical} `, cmd(M.Style, R.Blue) ])) ]);
|
|
5839
5986
|
}
|
|
5840
5987
|
|
|
5841
5988
|
function runningTask(t) {
|
|
5842
|
-
var frame = r => text([ emptyLine(), cmd(M.Style,
|
|
5989
|
+
var frame = r => text([ emptyLine(), cmd(M.Style, R.Magenta), V[r % V.length], " ", cmd(M.Style, R.Foreground), t.trim() ]);
|
|
5843
5990
|
return concat([ fromValue(frame(0)), pipe(interval(150), map((t => frame(t + 1)))) ]);
|
|
5844
5991
|
}
|
|
5845
5992
|
|
|
5846
5993
|
function errorMessage(t) {
|
|
5847
|
-
return error([ "\n", cmd(M.Style, [
|
|
5994
|
+
return error([ "\n", cmd(M.Style, [ R.Red, R.Invert ]), ` ${q.Warning} Error `, cmd(M.Style, R.NoInvert), `\n${t.trim()}\n` ]);
|
|
5848
5995
|
}
|
|
5849
5996
|
|
|
5850
5997
|
var delay = (t = 700) => {
|
|
@@ -5857,7 +6004,7 @@ var delay = (t = 700) => {
|
|
|
5857
6004
|
}
|
|
5858
6005
|
};
|
|
5859
6006
|
|
|
5860
|
-
var
|
|
6007
|
+
var $e = function(t) {
|
|
5861
6008
|
t.TITLE = "Doctor";
|
|
5862
6009
|
t.DESCRIPTION = "Detects problems with your setup";
|
|
5863
6010
|
t.CHECK_TS_VERSION = "Checking TypeScript version";
|
|
@@ -5867,17 +6014,17 @@ var Ce = function(t) {
|
|
|
5867
6014
|
t.CHECK_VSCODE = "Checking VSCode setup";
|
|
5868
6015
|
t.CHECK_SCHEMA = "Checking schema";
|
|
5869
6016
|
return t;
|
|
5870
|
-
}(
|
|
6017
|
+
}($e || {});
|
|
5871
6018
|
|
|
5872
6019
|
async function* run() {
|
|
5873
6020
|
yield function title(t, r) {
|
|
5874
|
-
var i = text([ cmd(M.Style,
|
|
6021
|
+
var i = text([ cmd(M.Style, R.BrightBlack), _.TopLeft, " ", cmd(M.Style, [ R.Magenta, R.Invert ]), ` ${t.trim()} `, cmd(M.Style, [ R.NoInvert ]), "\n" ]);
|
|
5875
6022
|
if (r) {
|
|
5876
|
-
i += text([ cmd(M.Style,
|
|
6023
|
+
i += text([ cmd(M.Style, R.BrightBlack), _.Vertical, ` ${r}\n` ]);
|
|
5877
6024
|
}
|
|
5878
6025
|
return i;
|
|
5879
|
-
}(
|
|
5880
|
-
yield runningTask(
|
|
6026
|
+
}($e.TITLE, $e.DESCRIPTION);
|
|
6027
|
+
yield runningTask($e.CHECK_TS_VERSION);
|
|
5881
6028
|
await delay();
|
|
5882
6029
|
var n;
|
|
5883
6030
|
try {
|
|
@@ -5887,7 +6034,7 @@ async function* run() {
|
|
|
5887
6034
|
return JSON.parse(await i.readFile(n, "utf-8"));
|
|
5888
6035
|
})();
|
|
5889
6036
|
} catch (t) {
|
|
5890
|
-
yield failedTask(
|
|
6037
|
+
yield failedTask($e.CHECK_TS_VERSION);
|
|
5891
6038
|
throw errorMessage(`A ${code("package.json")} file was not found in the current working directory.\n` + hint("Try running the doctor command in your workspace folder."));
|
|
5892
6039
|
}
|
|
5893
6040
|
var a = await (async t => {
|
|
@@ -5903,16 +6050,16 @@ async function* run() {
|
|
|
5903
6050
|
}
|
|
5904
6051
|
})(n);
|
|
5905
6052
|
if (!a) {
|
|
5906
|
-
yield failedTask(
|
|
6053
|
+
yield failedTask($e.CHECK_TS_VERSION);
|
|
5907
6054
|
throw errorMessage(`A version of ${code("typescript")} was not found in your dependencies.\n` + hint(`Is ${code("typescript")} installed in this package?`));
|
|
5908
|
-
} else if (!semverComply(a,
|
|
5909
|
-
yield failedTask(
|
|
5910
|
-
throw errorMessage(`The version of ${code("typescript")} in your dependencies is out of date.\n` + hint(`${code("gql.tada")} requires at least ${bold(
|
|
6055
|
+
} else if (!semverComply(a, ae.typescript)) {
|
|
6056
|
+
yield failedTask($e.CHECK_TS_VERSION);
|
|
6057
|
+
throw errorMessage(`The version of ${code("typescript")} in your dependencies is out of date.\n` + hint(`${code("gql.tada")} requires at least ${bold(ae.typescript)}`));
|
|
5911
6058
|
}
|
|
5912
|
-
yield completedTask(
|
|
5913
|
-
yield runningTask(
|
|
6059
|
+
yield completedTask($e.CHECK_TS_VERSION);
|
|
6060
|
+
yield runningTask($e.CHECK_DEPENDENCIES);
|
|
5914
6061
|
await delay();
|
|
5915
|
-
var s = semverComply(a,
|
|
6062
|
+
var s = semverComply(a, ae.typescript_embed_lsp);
|
|
5916
6063
|
if (!s) {
|
|
5917
6064
|
var l = await (async t => {
|
|
5918
6065
|
var r = "@0no-co/graphqlsp";
|
|
@@ -5927,11 +6074,11 @@ async function* run() {
|
|
|
5927
6074
|
}
|
|
5928
6075
|
})(n);
|
|
5929
6076
|
if (!l) {
|
|
5930
|
-
yield failedTask(
|
|
6077
|
+
yield failedTask($e.CHECK_DEPENDENCIES);
|
|
5931
6078
|
throw errorMessage(`A version of ${code("@0no-co/graphqlsp")} was not found in your dependencies.\n` + hint(`Is ${code("@0no-co/graphqlsp")} installed?`));
|
|
5932
|
-
} else if (!semverComply(l,
|
|
5933
|
-
yield failedTask(
|
|
5934
|
-
throw errorMessage(`The version of ${code("@0no-co/graphqlsp")} in your dependencies is out of date.\n` + hint(`${code("gql.tada")} requires at least ${bold(
|
|
6079
|
+
} else if (!semverComply(l, ae.lsp)) {
|
|
6080
|
+
yield failedTask($e.CHECK_DEPENDENCIES);
|
|
6081
|
+
throw errorMessage(`The version of ${code("@0no-co/graphqlsp")} in your dependencies is out of date.\n` + hint(`${code("gql.tada")} requires at least ${bold(ae.lsp)}`));
|
|
5935
6082
|
}
|
|
5936
6083
|
}
|
|
5937
6084
|
var c = await (async t => {
|
|
@@ -5947,57 +6094,82 @@ async function* run() {
|
|
|
5947
6094
|
}
|
|
5948
6095
|
})(n);
|
|
5949
6096
|
if (!c) {
|
|
5950
|
-
yield failedTask(
|
|
6097
|
+
yield failedTask($e.CHECK_DEPENDENCIES);
|
|
5951
6098
|
throw errorMessage(`A version of ${code("gql.tada")} was not found in your dependencies.\n` + hint(`Is ${code("gql.tada")} installed?`));
|
|
5952
6099
|
} else if (!semverComply(c, "1.0.0")) {
|
|
5953
|
-
yield failedTask(
|
|
5954
|
-
throw errorMessage(`The version of ${code("gql.tada")} in your dependencies is out of date.\n` + hint(`It's recommended to upgrade ${code("gql.tada")} to at least ${bold(
|
|
6100
|
+
yield failedTask($e.CHECK_DEPENDENCIES);
|
|
6101
|
+
throw errorMessage(`The version of ${code("gql.tada")} in your dependencies is out of date.\n` + hint(`It's recommended to upgrade ${code("gql.tada")} to at least ${bold(ae.lsp)}`));
|
|
5955
6102
|
}
|
|
5956
|
-
yield completedTask(
|
|
5957
|
-
yield runningTask(
|
|
6103
|
+
yield completedTask($e.CHECK_DEPENDENCIES);
|
|
6104
|
+
yield runningTask($e.CHECK_TSCONFIG);
|
|
5958
6105
|
await delay();
|
|
5959
6106
|
var u;
|
|
5960
6107
|
try {
|
|
5961
|
-
u = await r.
|
|
6108
|
+
u = await r.loadConfigs();
|
|
5962
6109
|
} catch (t) {
|
|
5963
|
-
yield failedTask(
|
|
6110
|
+
yield failedTask($e.CHECK_TSCONFIG);
|
|
5964
6111
|
throw externalError(`A ${code("tsconfig.json")} file was not found in the current working directory.`, t);
|
|
5965
6112
|
}
|
|
5966
|
-
var d;
|
|
6113
|
+
var d = [];
|
|
6114
|
+
for (var f of u) {
|
|
6115
|
+
var p = t.relative(process.cwd(), f.tsconfigPath) || f.tsconfigPath;
|
|
6116
|
+
try {
|
|
6117
|
+
d.push({
|
|
6118
|
+
configResult: f,
|
|
6119
|
+
pluginConfig: r.parseConfig(f.pluginConfig, f.rootPath),
|
|
6120
|
+
projectPath: t.dirname(f.tsconfigPath),
|
|
6121
|
+
label: p
|
|
6122
|
+
});
|
|
6123
|
+
} catch (t) {
|
|
6124
|
+
yield failedTask($e.CHECK_TSCONFIG);
|
|
6125
|
+
throw externalError(`The plugin configuration for ${code(s ? '"gql.tada/ts-plugin"' : '"@0no-co/graphqlsp"')} in ${code(p)} seems to be invalid.`, t);
|
|
6126
|
+
}
|
|
6127
|
+
}
|
|
5967
6128
|
try {
|
|
5968
|
-
|
|
6129
|
+
r.validateUniqueOutputLocations(d.map((t => ({
|
|
6130
|
+
projectPath: t.projectPath,
|
|
6131
|
+
config: t.pluginConfig,
|
|
6132
|
+
label: t.label
|
|
6133
|
+
}))));
|
|
5969
6134
|
} catch (t) {
|
|
5970
|
-
yield failedTask(
|
|
5971
|
-
throw externalError(
|
|
6135
|
+
yield failedTask($e.CHECK_TSCONFIG);
|
|
6136
|
+
throw externalError("The output locations of your configured projects overlap.", t);
|
|
6137
|
+
}
|
|
6138
|
+
yield completedTask($e.CHECK_TSCONFIG);
|
|
6139
|
+
if (d.length > 1) {
|
|
6140
|
+
yield hintMessage(`Found ${d.length} ${code("gql.tada")} projects through ${code('"references"')} in your ${code("tsconfig.json")} files.\n`);
|
|
5972
6141
|
}
|
|
5973
|
-
yield completedTask(Ce.CHECK_TSCONFIG);
|
|
5974
6142
|
yield* async function* runExternalFilesChecks(r, i) {
|
|
5975
6143
|
var n = [];
|
|
5976
|
-
|
|
5977
|
-
|
|
5978
|
-
|
|
5979
|
-
|
|
6144
|
+
for (var a of r) {
|
|
6145
|
+
try {
|
|
6146
|
+
var o = programFactory({
|
|
6147
|
+
rootPath: a.configResult.rootPath,
|
|
6148
|
+
configPath: a.configResult.tsconfigPath
|
|
6149
|
+
});
|
|
6150
|
+
n.push(...o.createExternalFiles());
|
|
6151
|
+
} catch (t) {}
|
|
5980
6152
|
}
|
|
5981
6153
|
if (n.length) {
|
|
5982
|
-
yield runningTask(
|
|
6154
|
+
yield runningTask($e.CHECK_EXTERNAL_FILES);
|
|
5983
6155
|
await delay();
|
|
5984
|
-
var
|
|
5985
|
-
if (
|
|
5986
|
-
yield failedTask(
|
|
6156
|
+
var s = new Set(n.map((r => t.extname(r.fileName))));
|
|
6157
|
+
if (s.has(".svelte") && !await hasSvelteSupport(i)) {
|
|
6158
|
+
yield failedTask($e.CHECK_EXTERNAL_FILES);
|
|
5987
6159
|
throw errorMessage(`A version of ${code("@gql.tada/svelte-support")} must be installed for Svelte file support.\n` + hint(`Have you installed ${code("@gql.tada/svelte-support")}?`));
|
|
5988
6160
|
}
|
|
5989
|
-
if (
|
|
5990
|
-
yield failedTask(
|
|
6161
|
+
if (s.has(".vue") && !await hasVueSupport(i)) {
|
|
6162
|
+
yield failedTask($e.CHECK_EXTERNAL_FILES);
|
|
5991
6163
|
throw errorMessage(`A version of ${code("@gql.tada/vue-support")} must be installed for Vue file support.\n` + hint(`Have you installed ${code("@gql.tada/vue-support")}?`));
|
|
5992
6164
|
}
|
|
5993
|
-
yield completedTask(
|
|
6165
|
+
yield completedTask($e.CHECK_EXTERNAL_FILES);
|
|
5994
6166
|
}
|
|
5995
|
-
}(
|
|
6167
|
+
}(d, n);
|
|
5996
6168
|
yield* async function* runVSCodeChecks() {
|
|
5997
6169
|
var r = await loadSuggestedExtensionsList();
|
|
5998
6170
|
var i = await isVSCodeInstalled();
|
|
5999
6171
|
if (r.length || i) {
|
|
6000
|
-
yield runningTask(
|
|
6172
|
+
yield runningTask($e.CHECK_VSCODE);
|
|
6001
6173
|
await delay();
|
|
6002
6174
|
var n = !1;
|
|
6003
6175
|
var a = [];
|
|
@@ -6005,7 +6177,7 @@ async function* run() {
|
|
|
6005
6177
|
if (!(a = await loadExtensionsList()).includes("graphql.vscode-graphql-syntax")) {
|
|
6006
6178
|
if (!n) {
|
|
6007
6179
|
n = !0;
|
|
6008
|
-
yield warningTask(
|
|
6180
|
+
yield warningTask($e.CHECK_VSCODE);
|
|
6009
6181
|
}
|
|
6010
6182
|
yield hintMessage(`We recommend you to install the ${code('"GraphQL: Syntax Highlighting"')} extension for VSCode.\nSee: https://marketplace.visualstudio.com/items?itemName=GraphQL.vscode-graphql-syntax\n`);
|
|
6011
6183
|
}
|
|
@@ -6015,30 +6187,32 @@ async function* run() {
|
|
|
6015
6187
|
if (o && s) {
|
|
6016
6188
|
if (!n) {
|
|
6017
6189
|
n = !0;
|
|
6018
|
-
yield warningTask(
|
|
6190
|
+
yield warningTask($e.CHECK_VSCODE);
|
|
6019
6191
|
}
|
|
6020
6192
|
var l = t.basename(s);
|
|
6021
6193
|
yield hintMessage(`The ${code('"GraphQL: Language Feature Support"')} VSCode extension can cause problems!\nWhen enabled it may display invalid diagnostic errors for ${code("gql.tada")} code.\nCheck whether your ${code(l)} config only targets ${code(".graphql")} documents.\n`);
|
|
6022
6194
|
}
|
|
6023
6195
|
if (!n) {
|
|
6024
|
-
yield completedTask(
|
|
6196
|
+
yield completedTask($e.CHECK_VSCODE);
|
|
6025
6197
|
}
|
|
6026
6198
|
}
|
|
6027
6199
|
}();
|
|
6028
|
-
yield runningTask(
|
|
6200
|
+
yield runningTask($e.CHECK_SCHEMA);
|
|
6029
6201
|
await delay();
|
|
6030
|
-
|
|
6031
|
-
|
|
6032
|
-
|
|
6033
|
-
|
|
6034
|
-
|
|
6035
|
-
|
|
6036
|
-
|
|
6202
|
+
for (var g of d) {
|
|
6203
|
+
try {
|
|
6204
|
+
await r.loadRef(g.pluginConfig).load({
|
|
6205
|
+
rootPath: g.projectPath
|
|
6206
|
+
});
|
|
6207
|
+
} catch (t) {
|
|
6208
|
+
yield failedTask($e.CHECK_SCHEMA);
|
|
6209
|
+
throw externalError(d.length > 1 ? `Failed to load schema for project ${code(g.label)}.` : "Failed to load schema.", t);
|
|
6210
|
+
}
|
|
6037
6211
|
}
|
|
6038
|
-
yield completedTask(
|
|
6212
|
+
yield completedTask($e.CHECK_SCHEMA, !0);
|
|
6039
6213
|
await delay();
|
|
6040
6214
|
yield function success() {
|
|
6041
|
-
return text([ "\n", cmd(M.Style, [
|
|
6215
|
+
return text([ "\n", cmd(M.Style, [ R.Green, R.Invert ]), " Done ", cmd(M.Style, R.NoInvert), D.Space, "You are all set and ready to go.\n" ]);
|
|
6042
6216
|
}();
|
|
6043
6217
|
}
|
|
6044
6218
|
|
|
@@ -6078,9 +6252,9 @@ var Oe = Object.assign((async function _main() {
|
|
|
6078
6252
|
t.register(InitCommand);
|
|
6079
6253
|
t.register(TurboCommand);
|
|
6080
6254
|
await t.runExit(process.argv.slice(2));
|
|
6081
|
-
}),
|
|
6255
|
+
}), te);
|
|
6082
6256
|
|
|
6083
|
-
exports.MINIMUM_VERSIONS =
|
|
6257
|
+
exports.MINIMUM_VERSIONS = ae;
|
|
6084
6258
|
|
|
6085
6259
|
exports.generateOutput = generateOutput;
|
|
6086
6260
|
|