@gql.tada/cli-utils 1.7.1-canary-e193732bfa456bacf50b007ae7a2ca1396f62733 → 1.7.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  # @gql.tada/cli-utils
2
2
 
3
- ## 1.7.1-canary-e193732bfa456bacf50b007ae7a2ca1396f62733
3
+ ## 1.7.1
4
4
 
5
5
  ### Patch Changes
6
6
 
@@ -3813,6 +3813,7 @@ async function* run$3(e, r) {
3813
3813
  }
3814
3814
  var s = O.dirname(n.configPath);
3815
3815
  var l;
3816
+ var c = [];
3816
3817
  if ("schema" in a) {
3817
3818
  if (!r.output && e.pipeTo) {
3818
3819
  l = e.pipeTo;
@@ -3828,95 +3829,104 @@ async function* run$3(e, r) {
3828
3829
  } else {
3829
3830
  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.`));
3830
3831
  }
3832
+ } else if ("schemas" in a) {
3833
+ for (var D of a.schemas) {
3834
+ if (D.tadaTurboLocation) {
3835
+ c.push({
3836
+ path: O.resolve(s, D.tadaTurboLocation),
3837
+ schemaName: D.name
3838
+ });
3839
+ }
3840
+ }
3831
3841
  }
3832
- var c = i({
3842
+ var d = i({
3833
3843
  rootPath: n.rootPath,
3834
3844
  configPath: n.configPath,
3835
3845
  pluginConfig: a,
3836
- turboOutputPath: "string" == typeof l ? l : void 0
3846
+ turboOutputPath: "string" == typeof l ? l : c
3837
3847
  });
3838
- var D = [];
3839
- var d = [];
3840
- var f = 0;
3841
- var p = 0;
3848
+ var f = [];
3849
+ var p = [];
3842
3850
  var h = 0;
3851
+ var g = 0;
3852
+ var m = 0;
3843
3853
  try {
3844
3854
  if (e.isInteractive) {
3845
3855
  yield runningTurbo();
3846
3856
  }
3847
- for await (var g of c) {
3848
- if ("EXTERNAL_WARNING" === g.kind) {
3857
+ for await (var E of d) {
3858
+ if ("EXTERNAL_WARNING" === E.kind) {
3849
3859
  yield experimentMessage(`${code(".vue")} and ${code(".svelte")} file support is experimental.`);
3850
- } else if ("FILE_COUNT" === g.kind) {
3851
- p = g.fileCount;
3852
- } else if ("GRAPHQL_SOURCES" === g.kind) {
3853
- d = g.sources;
3860
+ } else if ("FILE_COUNT" === E.kind) {
3861
+ g = E.fileCount;
3862
+ } else if ("GRAPHQL_SOURCES" === E.kind) {
3863
+ p = E.sources;
3854
3864
  } else {
3855
- h++;
3856
- D.push(...g.documents);
3857
- f += g.warnings.length;
3858
- if (g.warnings.length) {
3859
- var m = warningFile(g.filePath);
3860
- for (var E of g.warnings) {
3861
- m += (w = E, text([ ke, cmd(De.Style, he.BrightBlack), `${w.line}:${w.col}`, me.Tab, cmd(De.Style, he.Foreground), indent(w.message.trim(), text([ ke, me.Tab ])), me.Newline ]));
3862
- warningGithub(E);
3865
+ m++;
3866
+ f.push(...E.documents);
3867
+ h += E.warnings.length;
3868
+ if (E.warnings.length) {
3869
+ var w = warningFile(E.filePath);
3870
+ for (var S of E.warnings) {
3871
+ w += (b = S, text([ ke, cmd(De.Style, he.BrightBlack), `${b.line}:${b.col}`, me.Tab, cmd(De.Style, he.Foreground), indent(b.message.trim(), text([ ke, me.Tab ])), me.Newline ]));
3872
+ warningGithub(S);
3863
3873
  }
3864
- yield m + "\n";
3874
+ yield w + "\n";
3865
3875
  }
3866
3876
  }
3867
3877
  if (e.isInteractive) {
3868
- yield runningTurbo(h, p);
3878
+ yield runningTurbo(m, g);
3869
3879
  }
3870
3880
  }
3871
3881
  } catch (e) {
3872
3882
  throw externalError("Could not build cache", e);
3873
3883
  }
3874
- var w;
3884
+ var b;
3875
3885
  if ("schema" in a) {
3876
- if (f && r.failOnWarn) {
3877
- throw warningSummary(f);
3886
+ if (h && r.failOnWarn) {
3887
+ throw warningSummary(h);
3878
3888
  }
3879
3889
  try {
3880
- var S = {};
3881
- for (var b of D) {
3882
- S[b.argumentKey] = b.documentType;
3890
+ var B = {};
3891
+ for (var k of f) {
3892
+ B[k.argumentKey] = k.documentType;
3883
3893
  }
3884
- var B = createCacheContents(S, d, l);
3885
- await writeOutput(l, B);
3894
+ var I = createCacheContents(B, p, l);
3895
+ await writeOutput(l, I);
3886
3896
  } catch (e) {
3887
3897
  throw externalError("Something went wrong while writing the type cache file", e);
3888
3898
  }
3889
- yield infoSummary$1(f, D.length);
3899
+ yield infoSummary$1(h, f.length);
3890
3900
  } else {
3891
3901
  if (r.output) {
3892
3902
  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.`));
3893
3903
  }
3894
- var k = {};
3895
- for (var I of a.schemas) {
3896
- var {name: M, tadaTurboLocation: _} = I;
3897
- if (!_) {
3898
- throw errorMessage$1(`No output path was specified to write the '${M}' type cache to.\n` + hint(`You have to set ${code('"tadaTurboLocation"')} in each schema configuration.`));
3904
+ var M = {};
3905
+ for (var _ of a.schemas) {
3906
+ var {name: U, tadaTurboLocation: G} = _;
3907
+ if (!G) {
3908
+ throw errorMessage$1(`No output path was specified to write the '${U}' type cache to.\n` + hint(`You have to set ${code('"tadaTurboLocation"')} in each schema configuration.`));
3899
3909
  }
3900
3910
  try {
3901
- k[M] = 0;
3902
- var U = {};
3903
- for (var G of D) {
3904
- if (G.schemaName === M) {
3905
- U[G.argumentKey] = G.documentType;
3906
- k[M]++;
3911
+ M[U] = 0;
3912
+ var H = {};
3913
+ for (var V of f) {
3914
+ if (V.schemaName === U) {
3915
+ H[V.argumentKey] = V.documentType;
3916
+ M[U]++;
3907
3917
  }
3908
3918
  }
3909
- var H = O.resolve(s, _);
3910
- var V = createCacheContents(U, d, H);
3911
- await writeOutput(H, V);
3919
+ var K = O.resolve(s, G);
3920
+ var Y = createCacheContents(H, p, K);
3921
+ await writeOutput(K, Y);
3912
3922
  } catch (e) {
3913
- throw externalError(`Something went wrong while writing the '${M}' schema's type cache file.`, e);
3923
+ throw externalError(`Something went wrong while writing the '${U}' schema's type cache file.`, e);
3914
3924
  }
3915
3925
  }
3916
- if (f && r.failOnWarn) {
3917
- throw warningSummary(f);
3926
+ if (h && r.failOnWarn) {
3927
+ throw warningSummary(h);
3918
3928
  } else {
3919
- yield infoSummary$1(f, k);
3929
+ yield infoSummary$1(h, M);
3920
3930
  }
3921
3931
  }
3922
3932
  }