@depup/graphql-codegen__cli 7.4.1-depup.1 → 7.4.2-depup.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,8 +13,8 @@ npm install @depup/graphql-codegen__cli
13
13
 
14
14
  | Field | Value |
15
15
  |-------|-------|
16
- | Original | [@graphql-codegen/cli](https://www.npmjs.com/package/@graphql-codegen/cli) @ 7.4.1 |
17
- | Processed | 2026-09-13 |
16
+ | Original | [@graphql-codegen/cli](https://www.npmjs.com/package/@graphql-codegen/cli) @ 7.4.2 |
17
+ | Processed | 2026-09-20 |
18
18
  | Smoke test | passed |
19
19
  | Deps updated | 27 |
20
20
 
@@ -22,23 +22,23 @@ npm install @depup/graphql-codegen__cli
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | @babel/generator | ^7.18.13 | ^8.0.5 |
25
+ | @babel/generator | ^7.18.13 | ^8.0.6 |
26
26
  | @babel/template | ^7.18.10 | ^8.0.0 |
27
- | @babel/types | ^7.18.13 | ^8.0.5 |
28
- | @graphql-codegen/client-preset | ^6.1.3 | ^6.2.0 |
27
+ | @babel/types | ^7.18.13 | ^8.0.6 |
29
28
  | @graphql-tools/apollo-engine-loader | ^8.0.28 | ^8.0.36 |
30
29
  | @graphql-tools/git-loader | ^8.0.32 | ^8.0.42 |
31
- | @graphql-tools/github-loader | ^9.0.6 | ^9.1.8 |
30
+ | @graphql-tools/github-loader | ^9.0.6 | ^9.1.9 |
32
31
  | @graphql-tools/graphql-file-loader | ^8.1.11 | ^8.1.20 |
33
32
  | @graphql-tools/json-file-loader | ^8.0.26 | ^8.0.34 |
34
33
  | @graphql-tools/load | ^8.1.8 | ^8.1.17 |
35
- | @graphql-tools/url-loader | ^9.0.6 | ^9.1.9 |
34
+ | @graphql-tools/url-loader | ^9.0.6 | ^9.1.10 |
36
35
  | @graphql-tools/utils | ^11.2.0 | ^12.0.1 |
37
36
  | @inquirer/prompts | ^8.3.2 | ^8.7.2 |
38
37
  | @whatwg-node/fetch | ^0.10.0 | ^0.10.13 |
39
38
  | chalk | ^5.6.0 | ^6.0.0 |
40
39
  | cosmiconfig | ^9.0.0 | ^10.0.1 |
41
40
  | detect-indent | ^7.0.0 | ^7.0.2 |
41
+ | graphql-config | ^5.1.6 | ^5.1.7 |
42
42
  | is-glob | ^4.0.1 | ^4.0.3 |
43
43
  | jiti | ^2.3.0 | ^2.7.0 |
44
44
  | listr2 | ^10.2.1 | ^11.1.0 |
package/changes.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "bumped": {
3
3
  "@babel/generator": {
4
4
  "from": "^7.18.13",
5
- "to": "^8.0.5"
5
+ "to": "^8.0.6"
6
6
  },
7
7
  "@babel/template": {
8
8
  "from": "^7.18.10",
@@ -10,11 +10,7 @@
10
10
  },
11
11
  "@babel/types": {
12
12
  "from": "^7.18.13",
13
- "to": "^8.0.5"
14
- },
15
- "@graphql-codegen/client-preset": {
16
- "from": "^6.1.3",
17
- "to": "^6.2.0"
13
+ "to": "^8.0.6"
18
14
  },
19
15
  "@graphql-tools/apollo-engine-loader": {
20
16
  "from": "^8.0.28",
@@ -26,7 +22,7 @@
26
22
  },
27
23
  "@graphql-tools/github-loader": {
28
24
  "from": "^9.0.6",
29
- "to": "^9.1.8"
25
+ "to": "^9.1.9"
30
26
  },
31
27
  "@graphql-tools/graphql-file-loader": {
32
28
  "from": "^8.1.11",
@@ -42,7 +38,7 @@
42
38
  },
43
39
  "@graphql-tools/url-loader": {
44
40
  "from": "^9.0.6",
45
- "to": "^9.1.9"
41
+ "to": "^9.1.10"
46
42
  },
47
43
  "@graphql-tools/utils": {
48
44
  "from": "^11.2.0",
@@ -68,6 +64,10 @@
68
64
  "from": "^7.0.0",
69
65
  "to": "^7.0.2"
70
66
  },
67
+ "graphql-config": {
68
+ "from": "^5.1.6",
69
+ "to": "^5.1.7"
70
+ },
71
71
  "is-glob": {
72
72
  "from": "^4.0.1",
73
73
  "to": "^4.0.3"
@@ -109,6 +109,6 @@
109
109
  "to": "^18.1.0"
110
110
  }
111
111
  },
112
- "timestamp": "2026-09-13T16:08:42.096Z",
112
+ "timestamp": "2026-09-20T08:11:36.942Z",
113
113
  "totalUpdated": 27
114
114
  }
package/cjs/codegen.js CHANGED
@@ -6,6 +6,7 @@ const fs_1 = tslib_1.__importDefault(require("fs"));
6
6
  const module_1 = require("module");
7
7
  const os_1 = require("os");
8
8
  const path_1 = tslib_1.__importDefault(require("path"));
9
+ const url_1 = require("url");
9
10
  const graphql_1 = require("graphql");
10
11
  const listr2_1 = require("listr2");
11
12
  const core_1 = require("@graphql-codegen/core");
@@ -24,16 +25,17 @@ const makeDefaultLoader = (from) => {
24
25
  }
25
26
  const relativeRequire = (0, module_1.createRequire)(from);
26
27
  return async (mod) => {
27
- return Promise.resolve(`${isESMModule_js_1.isESMModule
28
- ? /**
29
- * For ESM we currently have no "resolve path" solution
30
- * as import.meta is unavailable in a CommonJS context
31
- * and furthermore unavailable in stable Node.js.
32
- **/
33
- // FIXME(pnpm-update): this causes dev-test devDeps to be brought into CLI's package.json, which is not ideal.
34
- // Note that `relativeRequire.resolve(mod)` seems to work correctly for ESM as well.
35
- mod
36
- : relativeRequire.resolve(mod)}`).then(s => tslib_1.__importStar(require(s)));
28
+ const resolved = relativeRequire.resolve(mod);
29
+ /**
30
+ * `resolved` is always an absolute filesystem path. In the CJS build, TypeScript
31
+ * rewrites `import()` into `require()`, which accepts native OS paths as-is. In
32
+ * the ESM build, `import()` stays a real dynamic import, whose loader parses the
33
+ * specifier as a URL — a raw Windows path (e.g. `C:\...`) is misread as a `c:`
34
+ * protocol scheme and rejected with `ERR_UNSUPPORTED_ESM_URL_SCHEME` (see #10935,
35
+ * which hit the same issue in `@graphql-tools/code-file-loader`). Converting to a
36
+ * `file://` URL only for the real-ESM case avoids that.
37
+ */
38
+ return Promise.resolve(`${isESMModule_js_1.isESMModule ? (0, url_1.pathToFileURL)(resolved).href : resolved}`).then(s => tslib_1.__importStar(require(s)));
37
39
  };
38
40
  };
39
41
  function createCache() {
@@ -177,11 +179,21 @@ async function executeCodegen(input) {
177
179
  const outputSpecificSchemas = (0, plugin_helpers_1.normalizeInstanceOrArray)(outputConfig.schema);
178
180
  let outputSpecificDocuments = (0, plugin_helpers_1.normalizeInstanceOrArray)(outputConfig.documents);
179
181
  let outputSpecificExternalDocuments = (0, plugin_helpers_1.normalizeInstanceOrArray)(outputConfig.externalDocuments);
180
- const preset = hasPreset
181
- ? typeof outputConfig.preset === 'string'
182
- ? await (0, presets_js_1.getPresetByName)(outputConfig.preset, makeDefaultLoader(context.cwd))
183
- : outputConfig.preset
184
- : null;
182
+ let preset;
183
+ try {
184
+ preset = hasPreset
185
+ ? typeof outputConfig.preset === 'string'
186
+ ? await (0, presets_js_1.getPresetByName)(outputConfig.preset, makeDefaultLoader(context.cwd))
187
+ : outputConfig.preset
188
+ : null;
189
+ }
190
+ catch (error) {
191
+ // ctx.errors is what determines CLI success/failure, so it must be pushed here
192
+ // before rethrowing — otherwise the CLI reports success even though the
193
+ // terminal printed this error.
194
+ ctx.errors.push(error);
195
+ throw error;
196
+ }
185
197
  if (preset?.prepareDocuments) {
186
198
  outputSpecificDocuments = await preset.prepareDocuments(filename, outputSpecificDocuments);
187
199
  outputSpecificExternalDocuments = await preset.prepareDocuments(filename, outputSpecificExternalDocuments);
package/cjs/hooks.js CHANGED
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lifecycleHooks = void 0;
4
4
  const child_process_1 = require("child_process");
5
+ const os_1 = require("os");
5
6
  const path_1 = require("path");
6
7
  const shell_quote_1 = require("shell-quote");
7
8
  const debugging_js_1 = require("./utils/debugging.js");
@@ -15,6 +16,21 @@ const DEFAULT_HOOKS = {
15
16
  beforeOneFileWrite: [],
16
17
  beforeAllFileWrite: [],
17
18
  };
19
+ // shell-quote's `quote()` always produces POSIX-style single-quoting, but
20
+ // `execShellCommand` below runs through `cmd.exe` on Windows (Node's
21
+ // `child_process.exec` default shell there), which doesn't understand single
22
+ // quotes and leaves them in literally. Quote per-platform instead: cmd.exe's
23
+ // own convention is double-quoting only the arguments that need it.
24
+ function quoteShellArgs(args) {
25
+ if ((0, os_1.platform)() === 'win32') {
26
+ // Only wrap an argument that contains a character cmd.exe treats specially --
27
+ // whitespace, pipe/redirection, caret, or a literal quote. e.g.
28
+ // - `C:\Program Files\x.ts` becomes `"C:\Program Files\x.ts"`
29
+ // - `D:\a\x.ts` is left bare.
30
+ return args.map(arg => (/[\s&|<>^"]/.test(arg) ? `"${arg}"` : arg)).join(' ');
31
+ }
32
+ return (0, shell_quote_1.quote)(args);
33
+ }
18
34
  function execShellCommand(cmd) {
19
35
  return new Promise((resolve, reject) => {
20
36
  (0, child_process_1.exec)(cmd, {
@@ -39,7 +55,7 @@ async function executeHooks(hookName, _scripts = [], args = [], initialState) {
39
55
  (0, debugging_js_1.debugLog)(`Running lifecycle hook "${hookName}" scripts...`);
40
56
  let state = initialState;
41
57
  const scripts = Array.isArray(_scripts) ? _scripts : [_scripts];
42
- const quotedArgs = (0, shell_quote_1.quote)(args);
58
+ const quotedArgs = quoteShellArgs(args);
43
59
  for (const script of scripts) {
44
60
  if (typeof script === 'string') {
45
61
  (0, debugging_js_1.debugLog)(`Running lifecycle hook "${hookName}" script: ${script} with args: ${quotedArgs}...`);
package/cjs/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
- exports.version = '7.4.1';
4
+ exports.version = '7.4.2';
package/esm/codegen.js CHANGED
@@ -2,6 +2,7 @@ import fs from 'fs';
2
2
  import { createRequire } from 'module';
3
3
  import { cpus } from 'os';
4
4
  import path from 'path';
5
+ import { pathToFileURL } from 'url';
5
6
  import { buildASTSchema, GraphQLError, isSchema } from 'graphql';
6
7
  import { Listr } from 'listr2';
7
8
  import { codegen } from '@graphql-codegen/core';
@@ -20,16 +21,17 @@ const makeDefaultLoader = (from) => {
20
21
  }
21
22
  const relativeRequire = createRequire(from);
22
23
  return async (mod) => {
23
- return import(isESMModule
24
- ? /**
25
- * For ESM we currently have no "resolve path" solution
26
- * as import.meta is unavailable in a CommonJS context
27
- * and furthermore unavailable in stable Node.js.
28
- **/
29
- // FIXME(pnpm-update): this causes dev-test devDeps to be brought into CLI's package.json, which is not ideal.
30
- // Note that `relativeRequire.resolve(mod)` seems to work correctly for ESM as well.
31
- mod
32
- : relativeRequire.resolve(mod));
24
+ const resolved = relativeRequire.resolve(mod);
25
+ /**
26
+ * `resolved` is always an absolute filesystem path. In the CJS build, TypeScript
27
+ * rewrites `import()` into `require()`, which accepts native OS paths as-is. In
28
+ * the ESM build, `import()` stays a real dynamic import, whose loader parses the
29
+ * specifier as a URL — a raw Windows path (e.g. `C:\...`) is misread as a `c:`
30
+ * protocol scheme and rejected with `ERR_UNSUPPORTED_ESM_URL_SCHEME` (see #10935,
31
+ * which hit the same issue in `@graphql-tools/code-file-loader`). Converting to a
32
+ * `file://` URL only for the real-ESM case avoids that.
33
+ */
34
+ return import(isESMModule ? pathToFileURL(resolved).href : resolved);
33
35
  };
34
36
  };
35
37
  function createCache() {
@@ -173,11 +175,21 @@ export async function executeCodegen(input) {
173
175
  const outputSpecificSchemas = normalizeInstanceOrArray(outputConfig.schema);
174
176
  let outputSpecificDocuments = normalizeInstanceOrArray(outputConfig.documents);
175
177
  let outputSpecificExternalDocuments = normalizeInstanceOrArray(outputConfig.externalDocuments);
176
- const preset = hasPreset
177
- ? typeof outputConfig.preset === 'string'
178
- ? await getPresetByName(outputConfig.preset, makeDefaultLoader(context.cwd))
179
- : outputConfig.preset
180
- : null;
178
+ let preset;
179
+ try {
180
+ preset = hasPreset
181
+ ? typeof outputConfig.preset === 'string'
182
+ ? await getPresetByName(outputConfig.preset, makeDefaultLoader(context.cwd))
183
+ : outputConfig.preset
184
+ : null;
185
+ }
186
+ catch (error) {
187
+ // ctx.errors is what determines CLI success/failure, so it must be pushed here
188
+ // before rethrowing — otherwise the CLI reports success even though the
189
+ // terminal printed this error.
190
+ ctx.errors.push(error);
191
+ throw error;
192
+ }
181
193
  if (preset?.prepareDocuments) {
182
194
  outputSpecificDocuments = await preset.prepareDocuments(filename, outputSpecificDocuments);
183
195
  outputSpecificExternalDocuments = await preset.prepareDocuments(filename, outputSpecificExternalDocuments);
package/esm/hooks.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { exec } from 'child_process';
2
+ import { platform } from 'os';
2
3
  import { delimiter, sep } from 'path';
3
4
  import { quote } from 'shell-quote';
4
5
  import { debugLog } from './utils/debugging.js';
@@ -12,6 +13,21 @@ const DEFAULT_HOOKS = {
12
13
  beforeOneFileWrite: [],
13
14
  beforeAllFileWrite: [],
14
15
  };
16
+ // shell-quote's `quote()` always produces POSIX-style single-quoting, but
17
+ // `execShellCommand` below runs through `cmd.exe` on Windows (Node's
18
+ // `child_process.exec` default shell there), which doesn't understand single
19
+ // quotes and leaves them in literally. Quote per-platform instead: cmd.exe's
20
+ // own convention is double-quoting only the arguments that need it.
21
+ function quoteShellArgs(args) {
22
+ if (platform() === 'win32') {
23
+ // Only wrap an argument that contains a character cmd.exe treats specially --
24
+ // whitespace, pipe/redirection, caret, or a literal quote. e.g.
25
+ // - `C:\Program Files\x.ts` becomes `"C:\Program Files\x.ts"`
26
+ // - `D:\a\x.ts` is left bare.
27
+ return args.map(arg => (/[\s&|<>^"]/.test(arg) ? `"${arg}"` : arg)).join(' ');
28
+ }
29
+ return quote(args);
30
+ }
15
31
  function execShellCommand(cmd) {
16
32
  return new Promise((resolve, reject) => {
17
33
  exec(cmd, {
@@ -36,7 +52,7 @@ async function executeHooks(hookName, _scripts = [], args = [], initialState) {
36
52
  debugLog(`Running lifecycle hook "${hookName}" scripts...`);
37
53
  let state = initialState;
38
54
  const scripts = Array.isArray(_scripts) ? _scripts : [_scripts];
39
- const quotedArgs = quote(args);
55
+ const quotedArgs = quoteShellArgs(args);
40
56
  for (const script of scripts) {
41
57
  if (typeof script === 'string') {
42
58
  debugLog(`Running lifecycle hook "${hookName}" script: ${script} with args: ${quotedArgs}...`);
package/esm/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '7.4.1';
1
+ export const version = '7.4.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@depup/graphql-codegen__cli",
3
- "version": "7.4.1-depup.1",
3
+ "version": "7.4.2-depup.0",
4
4
  "peerDependenciesMeta": {
5
5
  "@parcel/watcher": {
6
6
  "optional": true
@@ -11,21 +11,21 @@
11
11
  "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
12
12
  },
13
13
  "dependencies": {
14
- "@babel/generator": "^8.0.5",
14
+ "@babel/generator": "^8.0.6",
15
15
  "@babel/template": "^8.0.0",
16
- "@babel/types": "^8.0.5",
16
+ "@babel/types": "^8.0.6",
17
17
  "@graphql-codegen/client-preset": "^6.2.0",
18
18
  "@graphql-codegen/core": "^6.2.0",
19
19
  "@graphql-codegen/plugin-helpers": "^7.3.0",
20
20
  "@graphql-tools/apollo-engine-loader": "^8.0.36",
21
21
  "@graphql-tools/code-file-loader": "^8.1.39",
22
22
  "@graphql-tools/git-loader": "^8.0.42",
23
- "@graphql-tools/github-loader": "^9.1.8",
23
+ "@graphql-tools/github-loader": "^9.1.9",
24
24
  "@graphql-tools/graphql-file-loader": "^8.1.20",
25
25
  "@graphql-tools/json-file-loader": "^8.0.34",
26
26
  "@graphql-tools/load": "^8.1.17",
27
27
  "@graphql-tools/merge": "^9.2.4",
28
- "@graphql-tools/url-loader": "^9.1.9",
28
+ "@graphql-tools/url-loader": "^9.1.10",
29
29
  "@graphql-tools/utils": "^12.0.1",
30
30
  "@inquirer/prompts": "^8.7.2",
31
31
  "@whatwg-node/fetch": "^0.10.13",
@@ -33,7 +33,7 @@
33
33
  "cosmiconfig": "^10.0.1",
34
34
  "debounce": "^3.0.0",
35
35
  "detect-indent": "^7.0.2",
36
- "graphql-config": "^5.1.6",
36
+ "graphql-config": "^5.1.7",
37
37
  "is-glob": "^4.0.3",
38
38
  "jiti": "^2.7.0",
39
39
  "json-to-pretty-yaml": "^1.2.2",
@@ -116,7 +116,7 @@
116
116
  "changes": {
117
117
  "@babel/generator": {
118
118
  "from": "^7.18.13",
119
- "to": "^8.0.5"
119
+ "to": "^8.0.6"
120
120
  },
121
121
  "@babel/template": {
122
122
  "from": "^7.18.10",
@@ -124,11 +124,7 @@
124
124
  },
125
125
  "@babel/types": {
126
126
  "from": "^7.18.13",
127
- "to": "^8.0.5"
128
- },
129
- "@graphql-codegen/client-preset": {
130
- "from": "^6.1.3",
131
- "to": "^6.2.0"
127
+ "to": "^8.0.6"
132
128
  },
133
129
  "@graphql-tools/apollo-engine-loader": {
134
130
  "from": "^8.0.28",
@@ -140,7 +136,7 @@
140
136
  },
141
137
  "@graphql-tools/github-loader": {
142
138
  "from": "^9.0.6",
143
- "to": "^9.1.8"
139
+ "to": "^9.1.9"
144
140
  },
145
141
  "@graphql-tools/graphql-file-loader": {
146
142
  "from": "^8.1.11",
@@ -156,7 +152,7 @@
156
152
  },
157
153
  "@graphql-tools/url-loader": {
158
154
  "from": "^9.0.6",
159
- "to": "^9.1.9"
155
+ "to": "^9.1.10"
160
156
  },
161
157
  "@graphql-tools/utils": {
162
158
  "from": "^11.2.0",
@@ -182,6 +178,10 @@
182
178
  "from": "^7.0.0",
183
179
  "to": "^7.0.2"
184
180
  },
181
+ "graphql-config": {
182
+ "from": "^5.1.6",
183
+ "to": "^5.1.7"
184
+ },
185
185
  "is-glob": {
186
186
  "from": "^4.0.1",
187
187
  "to": "^4.0.3"
@@ -225,8 +225,8 @@
225
225
  },
226
226
  "depsUpdated": 27,
227
227
  "originalPackage": "@graphql-codegen/cli",
228
- "originalVersion": "7.4.1",
229
- "processedAt": "2026-09-13T16:09:04.025Z",
228
+ "originalVersion": "7.4.2",
229
+ "processedAt": "2026-09-20T08:11:54.516Z",
230
230
  "smokeTest": "passed"
231
231
  }
232
232
  }