@depup/graphql-codegen__cli 7.4.1-depup.0 → 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,31 +13,32 @@ 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-10 |
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
- | Deps updated | 26 |
19
+ | Deps updated | 27 |
20
20
 
21
21
  ## Dependency Changes
22
22
 
23
23
  | Dependency | From | To |
24
24
  |------------|------|-----|
25
- | @babel/generator | ^7.18.13 | ^8.0.0 |
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.4 |
27
+ | @babel/types | ^7.18.13 | ^8.0.6 |
28
28
  | @graphql-tools/apollo-engine-loader | ^8.0.28 | ^8.0.36 |
29
29
  | @graphql-tools/git-loader | ^8.0.32 | ^8.0.42 |
30
- | @graphql-tools/github-loader | ^9.0.6 | ^9.1.8 |
30
+ | @graphql-tools/github-loader | ^9.0.6 | ^9.1.9 |
31
31
  | @graphql-tools/graphql-file-loader | ^8.1.11 | ^8.1.20 |
32
32
  | @graphql-tools/json-file-loader | ^8.0.26 | ^8.0.34 |
33
33
  | @graphql-tools/load | ^8.1.8 | ^8.1.17 |
34
- | @graphql-tools/url-loader | ^9.0.6 | ^9.1.9 |
34
+ | @graphql-tools/url-loader | ^9.0.6 | ^9.1.10 |
35
35
  | @graphql-tools/utils | ^11.2.0 | ^12.0.1 |
36
36
  | @inquirer/prompts | ^8.3.2 | ^8.7.2 |
37
37
  | @whatwg-node/fetch | ^0.10.0 | ^0.10.13 |
38
38
  | chalk | ^5.6.0 | ^6.0.0 |
39
39
  | cosmiconfig | ^9.0.0 | ^10.0.1 |
40
40
  | detect-indent | ^7.0.0 | ^7.0.2 |
41
+ | graphql-config | ^5.1.6 | ^5.1.7 |
41
42
  | is-glob | ^4.0.1 | ^4.0.3 |
42
43
  | jiti | ^2.3.0 | ^2.7.0 |
43
44
  | listr2 | ^10.2.1 | ^11.1.0 |
@@ -46,7 +47,7 @@ npm install @depup/graphql-codegen__cli
46
47
  | shell-quote | ^1.7.3 | ^1.10.0 |
47
48
  | ts-log | ^3.0.0 | ^3.0.3 |
48
49
  | tslib | ^2.4.0 | ^2.8.1 |
49
- | yaml | ^2.3.1 | ^2.9.0 |
50
+ | yaml | ^2.3.1 | ^2.9.1 |
50
51
  | yargs | ^18.0.0 | ^18.1.0 |
51
52
 
52
53
  ---
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.0"
5
+ "to": "^8.0.6"
6
6
  },
7
7
  "@babel/template": {
8
8
  "from": "^7.18.10",
@@ -10,7 +10,7 @@
10
10
  },
11
11
  "@babel/types": {
12
12
  "from": "^7.18.13",
13
- "to": "^8.0.4"
13
+ "to": "^8.0.6"
14
14
  },
15
15
  "@graphql-tools/apollo-engine-loader": {
16
16
  "from": "^8.0.28",
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "@graphql-tools/github-loader": {
24
24
  "from": "^9.0.6",
25
- "to": "^9.1.8"
25
+ "to": "^9.1.9"
26
26
  },
27
27
  "@graphql-tools/graphql-file-loader": {
28
28
  "from": "^8.1.11",
@@ -38,7 +38,7 @@
38
38
  },
39
39
  "@graphql-tools/url-loader": {
40
40
  "from": "^9.0.6",
41
- "to": "^9.1.9"
41
+ "to": "^9.1.10"
42
42
  },
43
43
  "@graphql-tools/utils": {
44
44
  "from": "^11.2.0",
@@ -64,6 +64,10 @@
64
64
  "from": "^7.0.0",
65
65
  "to": "^7.0.2"
66
66
  },
67
+ "graphql-config": {
68
+ "from": "^5.1.6",
69
+ "to": "^5.1.7"
70
+ },
67
71
  "is-glob": {
68
72
  "from": "^4.0.1",
69
73
  "to": "^4.0.3"
@@ -98,13 +102,13 @@
98
102
  },
99
103
  "yaml": {
100
104
  "from": "^2.3.1",
101
- "to": "^2.9.0"
105
+ "to": "^2.9.1"
102
106
  },
103
107
  "yargs": {
104
108
  "from": "^18.0.0",
105
109
  "to": "^18.1.0"
106
110
  }
107
111
  },
108
- "timestamp": "2026-09-10T16:09:14.958Z",
109
- "totalUpdated": 26
112
+ "timestamp": "2026-09-20T08:11:36.942Z",
113
+ "totalUpdated": 27
110
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.0",
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.0",
14
+ "@babel/generator": "^8.0.6",
15
15
  "@babel/template": "^8.0.0",
16
- "@babel/types": "^8.0.4",
17
- "@graphql-codegen/client-preset": "^6.1.3",
16
+ "@babel/types": "^8.0.6",
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",
@@ -44,7 +44,7 @@
44
44
  "string-env-interpolation": "^1.0.1",
45
45
  "ts-log": "^3.0.3",
46
46
  "tslib": "^2.8.1",
47
- "yaml": "^2.9.0",
47
+ "yaml": "^2.9.1",
48
48
  "yargs": "^18.1.0"
49
49
  },
50
50
  "repository": {
@@ -116,7 +116,7 @@
116
116
  "changes": {
117
117
  "@babel/generator": {
118
118
  "from": "^7.18.13",
119
- "to": "^8.0.0"
119
+ "to": "^8.0.6"
120
120
  },
121
121
  "@babel/template": {
122
122
  "from": "^7.18.10",
@@ -124,7 +124,7 @@
124
124
  },
125
125
  "@babel/types": {
126
126
  "from": "^7.18.13",
127
- "to": "^8.0.4"
127
+ "to": "^8.0.6"
128
128
  },
129
129
  "@graphql-tools/apollo-engine-loader": {
130
130
  "from": "^8.0.28",
@@ -136,7 +136,7 @@
136
136
  },
137
137
  "@graphql-tools/github-loader": {
138
138
  "from": "^9.0.6",
139
- "to": "^9.1.8"
139
+ "to": "^9.1.9"
140
140
  },
141
141
  "@graphql-tools/graphql-file-loader": {
142
142
  "from": "^8.1.11",
@@ -152,7 +152,7 @@
152
152
  },
153
153
  "@graphql-tools/url-loader": {
154
154
  "from": "^9.0.6",
155
- "to": "^9.1.9"
155
+ "to": "^9.1.10"
156
156
  },
157
157
  "@graphql-tools/utils": {
158
158
  "from": "^11.2.0",
@@ -178,6 +178,10 @@
178
178
  "from": "^7.0.0",
179
179
  "to": "^7.0.2"
180
180
  },
181
+ "graphql-config": {
182
+ "from": "^5.1.6",
183
+ "to": "^5.1.7"
184
+ },
181
185
  "is-glob": {
182
186
  "from": "^4.0.1",
183
187
  "to": "^4.0.3"
@@ -212,17 +216,17 @@
212
216
  },
213
217
  "yaml": {
214
218
  "from": "^2.3.1",
215
- "to": "^2.9.0"
219
+ "to": "^2.9.1"
216
220
  },
217
221
  "yargs": {
218
222
  "from": "^18.0.0",
219
223
  "to": "^18.1.0"
220
224
  }
221
225
  },
222
- "depsUpdated": 26,
226
+ "depsUpdated": 27,
223
227
  "originalPackage": "@graphql-codegen/cli",
224
- "originalVersion": "7.4.1",
225
- "processedAt": "2026-09-10T16:09:29.117Z",
228
+ "originalVersion": "7.4.2",
229
+ "processedAt": "2026-09-20T08:11:54.516Z",
226
230
  "smokeTest": "passed"
227
231
  }
228
232
  }