@trackunit/react-graphql-tools 1.14.80 → 1.14.82

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,3 +1,24 @@
1
+ ## 1.14.82 (2026-07-29)
2
+
3
+ ### 🧱 Updated Dependencies
4
+
5
+ - Updated react-vite-test-setup to 0.0.82
6
+
7
+ ## 1.14.81 (2026-07-28)
8
+
9
+ ### 🩹 Fixes
10
+
11
+ - resolve fleet-map-page lint failure and prettier.config.mjs regressions ([2252abe2418](https://github.com/Trackunit/manager/commit/2252abe2418))
12
+
13
+ ### 🧱 Updated Dependencies
14
+
15
+ - Updated react-vite-test-setup to 0.0.81
16
+
17
+ ### ❤️ Thank You
18
+
19
+ - Cursor @cursoragent
20
+ - Michael Buss Rønne
21
+
1
22
  ## 1.14.80 (2026-07-27)
2
23
 
3
24
  ### 🧱 Updated Dependencies
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-graphql-tools",
3
- "version": "1.14.80",
3
+ "version": "1.14.82",
4
4
  "main": "src/index.js",
5
5
  "executors": "./executors.json",
6
6
  "generators": "./generators.json",
@@ -9,6 +9,21 @@ const prettier = tslib_1.__importStar(require("prettier"));
9
9
  const ts_morph_1 = require("ts-morph");
10
10
  const scrubMockFile_1 = require("./scrubMockFile");
11
11
  const utils_1 = require("./utils");
12
+ /**
13
+ * Resolves the repo's Prettier config by searching upward from `nxRoot` (the same
14
+ * lookup Prettier's CLI/editor integrations use), rather than requiring an exact
15
+ * `prettier.config.mjs` at that path. This lets generated code be formatted with the
16
+ * repo's real config when it exists, while degrading gracefully (no formatting, no
17
+ * throw) for workspaces without one - e.g. the ad-hoc workspaces `nx-tools-e2e`
18
+ * scaffolds via `create-iris-app-workspace` to exercise this executor in isolation.
19
+ */
20
+ const getPrettierOptions = async (nxRoot) => {
21
+ const prettierConfigPath = (0, path_1.join)(nxRoot, "prettier.config.mjs");
22
+ return await prettier.resolveConfig(prettierConfigPath, { useCache: false, editorconfig: false }).catch((error) => {
23
+ console.log(error);
24
+ return null;
25
+ });
26
+ };
12
27
  /**
13
28
  * Generates React hooks from your graphql files.
14
29
  */
@@ -76,44 +91,25 @@ const scrubFile = async (file, nxRoot, isVerbose) => {
76
91
  // mutates the shared source file via insertStatements().
77
92
  const scrubbedFileContent = await (0, exports.scrubFileContent)(fileContent, nxRoot, isVerbose, sharedSourceFile);
78
93
  const scrubbedMockFileContent = await (0, scrubMockFile_1.scrubMockFileContent)(fileContent, nxRoot, isVerbose, sharedSourceFile);
79
- let options = null;
80
- try {
81
- options = prettier
82
- .resolveConfig((0, path_1.join)(nxRoot, ".prettierrc"), {
83
- useCache: false,
84
- editorconfig: false,
85
- config: (0, path_1.join)(nxRoot, ".prettierrc"),
86
- })
87
- .catch((error) => console.log(error));
88
- }
89
- catch (e) {
90
- console.log(e);
91
- }
92
- if (!options) {
93
- throw new Error("Could not find prettier config");
94
- }
95
- const prettierOptions = await options;
94
+ const prettierOptions = await getPrettierOptions(nxRoot);
96
95
  let prettySrc = scrubbedFileContent;
96
+ let prettyMockSrc = scrubbedMockFileContent;
97
97
  if (prettierOptions) {
98
- prettierOptions.parser = "typescript";
98
+ const formatOptions = { ...prettierOptions, parser: "typescript" };
99
99
  try {
100
- prettySrc = await prettier.format(scrubbedFileContent, prettierOptions);
100
+ prettySrc = await prettier.format(scrubbedFileContent, formatOptions);
101
101
  }
102
102
  catch (error) {
103
103
  console.error("Error in prettier.format:", error);
104
104
  }
105
- }
106
- (0, fs_1.writeFileSync)(file, prettySrc, { encoding: "utf-8" });
107
- let prettyMockSrc = scrubbedMockFileContent;
108
- if (prettierOptions) {
109
- prettierOptions.parser = "typescript";
110
105
  try {
111
- prettyMockSrc = await prettier.format(scrubbedMockFileContent, prettierOptions);
106
+ prettyMockSrc = await prettier.format(scrubbedMockFileContent, formatOptions);
112
107
  }
113
108
  catch (error) {
114
109
  console.error("Error in prettier.format:", error);
115
110
  }
116
111
  }
112
+ (0, fs_1.writeFileSync)(file, prettySrc, { encoding: "utf-8" });
117
113
  const parentDir = (0, path_1.dirname)(file);
118
114
  if (prettyMockSrc.length > 0) {
119
115
  (0, fs_1.writeFileSync)((0, path_1.join)(parentDir, "mock.ts"), prettyMockSrc, { encoding: "utf-8" });