@gql.tada/cli-utils 1.9.2 → 1.9.3
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.
|
@@ -2748,7 +2748,7 @@ function initTTY(t = {}) {
|
|
|
2748
2748
|
n = process.stderr;
|
|
2749
2749
|
a = process.stdout;
|
|
2750
2750
|
} else {
|
|
2751
|
-
r = n.isTTY;
|
|
2751
|
+
r = r && !!n.isTTY;
|
|
2752
2752
|
}
|
|
2753
2753
|
var i = process.argv.includes("--color");
|
|
2754
2754
|
var o = "FORCE_COLOR" in process.env || !process.env.NO_COLOR && !process.env.CI;
|
|
@@ -2770,7 +2770,6 @@ function initTTY(t = {}) {
|
|
|
2770
2770
|
function onKeypress(t, n) {
|
|
2771
2771
|
switch (n.name) {
|
|
2772
2772
|
case "c":
|
|
2773
|
-
case "d":
|
|
2774
2773
|
case "x":
|
|
2775
2774
|
if (n.ctrl) {
|
|
2776
2775
|
return r();
|
|
@@ -2844,16 +2843,16 @@ function initTTY(t = {}) {
|
|
|
2844
2843
|
n.write(text(...r));
|
|
2845
2844
|
}
|
|
2846
2845
|
},
|
|
2847
|
-
start: function start(
|
|
2846
|
+
start: function start(a) {
|
|
2848
2847
|
var write = r => {
|
|
2849
2848
|
if (!t.silent) {
|
|
2850
2849
|
n.write("" + r);
|
|
2851
2850
|
}
|
|
2852
2851
|
};
|
|
2853
|
-
if (t.disableTTY) {
|
|
2854
|
-
return pipe(compose(
|
|
2852
|
+
if (t.disableTTY || !r) {
|
|
2853
|
+
return pipe(compose(a), onPush(write), toPromise);
|
|
2855
2854
|
} else {
|
|
2856
|
-
return pipe(compose(
|
|
2855
|
+
return pipe(compose(a), onPush(write), takeUntil(l), toPromise);
|
|
2857
2856
|
}
|
|
2858
2857
|
},
|
|
2859
2858
|
mode: function mode(...t) {
|
|
@@ -4116,33 +4115,39 @@ function createCacheContents(r, a, n, i) {
|
|
|
4116
4115
|
for (var l of r) {
|
|
4117
4116
|
s.set(l.argumentKey, l);
|
|
4118
4117
|
}
|
|
4119
|
-
var c =
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
|
|
4125
|
-
|
|
4126
|
-
}
|
|
4127
|
-
|
|
4128
|
-
|
|
4129
|
-
|
|
4130
|
-
var p = "
|
|
4131
|
-
var h =
|
|
4132
|
-
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
|
|
4136
|
-
|
|
4137
|
-
|
|
4118
|
+
var c = [ ...s.values() ].sort(((t, r) => compareUtf16(t.argumentKey, r.argumentKey)));
|
|
4119
|
+
var d = "";
|
|
4120
|
+
for (var f of c) {
|
|
4121
|
+
if (d) {
|
|
4122
|
+
d += "\n";
|
|
4123
|
+
}
|
|
4124
|
+
if (f.documentHash) {
|
|
4125
|
+
d += ` /** @gql.tada/hash ${f.documentHash} */\n`;
|
|
4126
|
+
}
|
|
4127
|
+
d += ` ${f.argumentKey}:\n ${f.documentType};`;
|
|
4128
|
+
}
|
|
4129
|
+
var p = "import type { TadaDocumentNode, $tada } from 'gql.tada';\n";
|
|
4130
|
+
var h = "string" == typeof n || n && "object" == typeof n && "toString" in n && !("writable" in n);
|
|
4131
|
+
var g = [ ...a ].sort(((t, r) => compareUtf16(t.absolutePath, r.absolutePath)));
|
|
4132
|
+
var m = new Set;
|
|
4133
|
+
for (var v of g) {
|
|
4134
|
+
for (var y of v.imports) {
|
|
4135
|
+
if (h) {
|
|
4136
|
+
var w = n.toString();
|
|
4137
|
+
var S = t.dirname(v.absolutePath);
|
|
4138
|
+
if (t.resolve(S, y.specifier) === t.resolve(w) || m.has(y.specifier)) {
|
|
4138
4139
|
continue;
|
|
4139
4140
|
}
|
|
4140
|
-
|
|
4141
|
+
m.add(y.specifier);
|
|
4141
4142
|
}
|
|
4142
|
-
|
|
4143
|
+
p += y.importClause + "\n";
|
|
4143
4144
|
}
|
|
4144
4145
|
}
|
|
4145
|
-
return o +
|
|
4146
|
+
return o + p + "\ndeclare module 'gql.tada' {\n interface setupCache {\n" + d + "\n }\n}\n";
|
|
4147
|
+
}
|
|
4148
|
+
|
|
4149
|
+
function compareUtf16(t, r) {
|
|
4150
|
+
return t < r ? -1 : t > r ? 1 : 0;
|
|
4146
4151
|
}
|
|
4147
4152
|
|
|
4148
4153
|
class TurboCommand extends Command {
|