@depup/graphql-codegen__cli 6.2.1-depup.3 → 7.2.0-depup.11
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/LICENSE +21 -0
- package/README.md +27 -25
- package/changes.json +44 -36
- package/cjs/cli.js +17 -7
- package/cjs/codegen.js +84 -34
- package/cjs/config.js +55 -20
- package/cjs/documentTransforms.js +5 -1
- package/cjs/generate-and-save.js +1 -1
- package/cjs/graphql-config.js +5 -5
- package/cjs/init/helpers.js +8 -4
- package/cjs/init/index.js +1 -1
- package/cjs/init/plugins.js +3 -1
- package/cjs/init/questions.js +10 -3
- package/cjs/init/targets.js +1 -1
- package/cjs/isESMModule.js +9 -0
- package/cjs/load.js +6 -3
- package/cjs/utils/patterns.js +17 -6
- package/cjs/utils/watcher.js +12 -7
- package/cjs/version.js +4 -0
- package/esm/codegen.js +83 -33
- package/esm/config.js +55 -20
- package/esm/documentTransforms.js +5 -1
- package/esm/generate-and-save.js +1 -1
- package/esm/graphql-config.js +5 -5
- package/esm/init/helpers.js +8 -4
- package/esm/init/index.js +1 -1
- package/esm/init/plugins.js +3 -1
- package/esm/init/questions.js +11 -4
- package/esm/init/targets.js +1 -1
- package/esm/isESMModule.js +6 -0
- package/esm/load.js +6 -3
- package/esm/utils/file-system.js +1 -1
- package/esm/utils/patterns.js +17 -6
- package/esm/utils/watcher.js +12 -7
- package/esm/version.js +1 -0
- package/package.json +78 -69
- package/typings/config.d.cts +3 -2
- package/typings/config.d.ts +3 -2
- package/typings/init/questions.d.cts +1 -1
- package/typings/init/questions.d.ts +1 -1
- package/typings/init/targets.d.cts +1 -1
- package/typings/init/targets.d.ts +1 -1
- package/typings/isESMModule.d.cts +6 -0
- package/typings/isESMModule.d.ts +6 -0
- package/typings/load.d.cts +3 -2
- package/typings/load.d.ts +3 -2
- package/typings/version.d.cts +1 -0
- package/typings/version.d.ts +1 -0
- package/cjs/utils/abort-controller-polyfill.js +0 -99
- package/esm/utils/abort-controller-polyfill.js +0 -96
- package/typings/utils/abort-controller-polyfill.d.cts +0 -5
- package/typings/utils/abort-controller-polyfill.d.ts +0 -5
package/esm/generate-and-save.js
CHANGED
|
@@ -6,8 +6,8 @@ import { ensureContext } from './config.js';
|
|
|
6
6
|
import { lifecycleHooks } from './hooks.js';
|
|
7
7
|
import { debugLog } from './utils/debugging.js';
|
|
8
8
|
import { mkdirp, readFile, unlinkFile, writeFile } from './utils/file-system.js';
|
|
9
|
-
import { createWatcher } from './utils/watcher.js';
|
|
10
9
|
import { getLogger } from './utils/logger.js';
|
|
10
|
+
import { createWatcher } from './utils/watcher.js';
|
|
11
11
|
const hash = (content) => createHash('sha1').update(content).digest('base64');
|
|
12
12
|
export async function generate(input, saveToFile = true) {
|
|
13
13
|
const context = ensureContext(input);
|
package/esm/graphql-config.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { loadConfig } from 'graphql-config';
|
|
1
2
|
import { ApolloEngineLoader } from '@graphql-tools/apollo-engine-loader';
|
|
2
3
|
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
|
3
4
|
import { GitLoader } from '@graphql-tools/git-loader';
|
|
4
5
|
import { GithubLoader } from '@graphql-tools/github-loader';
|
|
5
|
-
import { loadConfig } from 'graphql-config';
|
|
6
6
|
export const CodegenExtension = (api) => {
|
|
7
7
|
// Schema
|
|
8
8
|
api.loaders.schema.register(new CodeFileLoader({
|
|
@@ -43,10 +43,6 @@ function isGraphQLConfig(config) {
|
|
|
43
43
|
if (!config) {
|
|
44
44
|
return false;
|
|
45
45
|
}
|
|
46
|
-
try {
|
|
47
|
-
return config.getDefault().hasExtension('codegen');
|
|
48
|
-
}
|
|
49
|
-
catch { }
|
|
50
46
|
try {
|
|
51
47
|
for (const projectName in config.projects) {
|
|
52
48
|
if (Object.prototype.hasOwnProperty.call(config.projects, projectName)) {
|
|
@@ -58,5 +54,9 @@ function isGraphQLConfig(config) {
|
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
catch { }
|
|
57
|
+
try {
|
|
58
|
+
return config.getDefault().hasExtension('codegen');
|
|
59
|
+
}
|
|
60
|
+
catch { }
|
|
61
61
|
return false;
|
|
62
62
|
}
|
package/esm/init/helpers.js
CHANGED
|
@@ -1,20 +1,24 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from 'fs';
|
|
2
2
|
import { relative, resolve } from 'path';
|
|
3
|
+
import chalk from 'chalk';
|
|
4
|
+
import detectIndent from 'detect-indent';
|
|
3
5
|
import generate from '@babel/generator';
|
|
4
6
|
import template from '@babel/template';
|
|
5
7
|
import * as t from '@babel/types';
|
|
6
|
-
import chalk from 'chalk';
|
|
7
|
-
import detectIndent from 'detect-indent';
|
|
8
8
|
import { getLatestVersion } from '../utils/get-latest-version.js';
|
|
9
9
|
import { Tags } from './types.js';
|
|
10
10
|
function jsObjectToBabelObjectExpression(obj) {
|
|
11
11
|
const objExp = t.objectExpression([]);
|
|
12
12
|
for (const [key, val] of Object.entries(obj)) {
|
|
13
13
|
if (Array.isArray(val)) {
|
|
14
|
-
objExp.properties.push(t.objectProperty(/^[a-zA-Z0-9]+$/.test(key) ? t.identifier(key) : t.stringLiteral(key), t.arrayExpression(val.map(v =>
|
|
14
|
+
objExp.properties.push(t.objectProperty(/^[a-zA-Z0-9]+$/.test(key) ? t.identifier(key) : t.stringLiteral(key), t.arrayExpression(val.map(v => typeof v === 'object'
|
|
15
|
+
? jsObjectToBabelObjectExpression(v)
|
|
16
|
+
: t.valueToNode(v)))));
|
|
15
17
|
}
|
|
16
18
|
else {
|
|
17
|
-
objExp.properties.push(t.objectProperty(/^[a-zA-Z0-9]+$/.test(key) ? t.identifier(key) : t.stringLiteral(key), typeof val === 'object'
|
|
19
|
+
objExp.properties.push(t.objectProperty(/^[a-zA-Z0-9]+$/.test(key) ? t.identifier(key) : t.stringLiteral(key), typeof val === 'object'
|
|
20
|
+
? jsObjectToBabelObjectExpression(val)
|
|
21
|
+
: t.valueToNode(val)));
|
|
18
22
|
}
|
|
19
23
|
}
|
|
20
24
|
return objExp;
|
package/esm/init/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export async function init() {
|
|
|
11
11
|
Welcome to ${bold('GraphQL Code Generator')}!
|
|
12
12
|
Answer few questions and we will setup everything for you.
|
|
13
13
|
`);
|
|
14
|
-
const possibleTargets =
|
|
14
|
+
const possibleTargets = guessTargets();
|
|
15
15
|
const answers = await getAnswers(possibleTargets);
|
|
16
16
|
// define config
|
|
17
17
|
const config = {
|
package/esm/init/plugins.js
CHANGED
|
@@ -7,7 +7,9 @@ export const plugins = [
|
|
|
7
7
|
value: 'typescript',
|
|
8
8
|
pathInRepo: 'typescript/typescript',
|
|
9
9
|
available: hasTag(Tags.typescript),
|
|
10
|
-
shouldBeSelected: tags => oneOf(tags, Tags.angular, Tags.stencil) ||
|
|
10
|
+
shouldBeSelected: tags => oneOf(tags, Tags.angular, Tags.stencil) ||
|
|
11
|
+
allOf(tags, Tags.typescript, Tags.react) ||
|
|
12
|
+
noneOf(tags, Tags.flow),
|
|
11
13
|
defaultExtension: '.ts',
|
|
12
14
|
},
|
|
13
15
|
{
|
package/esm/init/questions.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { checkbox, input, select
|
|
1
|
+
import { checkbox, confirm, input, select } from '@inquirer/prompts';
|
|
2
2
|
import { grey } from './helpers.js';
|
|
3
3
|
import { plugins } from './plugins.js';
|
|
4
4
|
import { Tags } from './types.js';
|
|
@@ -16,7 +16,9 @@ export async function getAnswers(possibleTargets) {
|
|
|
16
16
|
validate: str => str.length > 0,
|
|
17
17
|
});
|
|
18
18
|
let documents;
|
|
19
|
-
if (targets.includes(Tags.client) ||
|
|
19
|
+
if (targets.includes(Tags.client) ||
|
|
20
|
+
targets.includes(Tags.angular) ||
|
|
21
|
+
targets.includes(Tags.stencil))
|
|
20
22
|
documents = await input({
|
|
21
23
|
message: 'Where are your operations and fragments?:',
|
|
22
24
|
default: getDocumentsDefaultValue(targets),
|
|
@@ -41,7 +43,9 @@ export async function getAnswers(possibleTargets) {
|
|
|
41
43
|
});
|
|
42
44
|
const config = await input({
|
|
43
45
|
message: 'How to name the config file?',
|
|
44
|
-
default: (() => targets.includes(Tags.client) ||
|
|
46
|
+
default: (() => targets.includes(Tags.client) ||
|
|
47
|
+
targets.includes(Tags.typescript) ||
|
|
48
|
+
targets.includes(Tags.angular)
|
|
45
49
|
? 'codegen.ts'
|
|
46
50
|
: 'codegen.yml')(),
|
|
47
51
|
validate: str => {
|
|
@@ -131,7 +135,10 @@ export function getApplicationTypeChoices(possibleTargets) {
|
|
|
131
135
|
name: 'Application built with other framework or vanilla JS',
|
|
132
136
|
key: 'client',
|
|
133
137
|
value: [Tags.typescript, Tags.flow],
|
|
134
|
-
checked: possibleTargets.Browser &&
|
|
138
|
+
checked: possibleTargets.Browser &&
|
|
139
|
+
!possibleTargets.Angular &&
|
|
140
|
+
!possibleTargets.React &&
|
|
141
|
+
!possibleTargets.Stencil,
|
|
135
142
|
},
|
|
136
143
|
];
|
|
137
144
|
}
|
package/esm/init/targets.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { readFileSync } from 'fs';
|
|
2
2
|
import { resolve } from 'path';
|
|
3
3
|
import { Tags } from './types.js';
|
|
4
|
-
export
|
|
4
|
+
export function guessTargets() {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(resolve(process.cwd(), 'package.json'), 'utf8'));
|
|
6
6
|
const dependencies = Object.keys({
|
|
7
7
|
...pkg.dependencies,
|
package/esm/load.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { extname, join } from 'path';
|
|
2
|
+
import { GraphQLError } from 'graphql';
|
|
2
3
|
import { ApolloEngineLoader } from '@graphql-tools/apollo-engine-loader';
|
|
3
4
|
import { CodeFileLoader } from '@graphql-tools/code-file-loader';
|
|
4
5
|
import { GitLoader } from '@graphql-tools/git-loader';
|
|
@@ -7,7 +8,6 @@ import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';
|
|
|
7
8
|
import { JsonFileLoader } from '@graphql-tools/json-file-loader';
|
|
8
9
|
import { loadDocuments as loadDocumentsToolkit, loadSchema as loadSchemaToolkit, NoTypeDefinitionsFound, } from '@graphql-tools/load';
|
|
9
10
|
import { UrlLoader } from '@graphql-tools/url-loader';
|
|
10
|
-
import { GraphQLError } from 'graphql';
|
|
11
11
|
export const defaultSchemaLoadOptions = {
|
|
12
12
|
assumeValidSDL: true,
|
|
13
13
|
sort: true,
|
|
@@ -68,7 +68,7 @@ export async function loadDocuments(documentPointers, config) {
|
|
|
68
68
|
// we omit paths that don't resolve to a specific file
|
|
69
69
|
continue;
|
|
70
70
|
}
|
|
71
|
-
ignore.push(join(process.cwd(), generatePath));
|
|
71
|
+
ignore.push(join(config.cwd || process.cwd(), generatePath));
|
|
72
72
|
}
|
|
73
73
|
try {
|
|
74
74
|
const loadedFromToolkit = await loadDocumentsToolkit(documentPointers, {
|
|
@@ -86,7 +86,10 @@ export async function loadDocuments(documentPointers, config) {
|
|
|
86
86
|
throw error;
|
|
87
87
|
}
|
|
88
88
|
// For other errors, we need to add an error message with documentPointers, so it's better for DevX
|
|
89
|
-
throw new Error([
|
|
89
|
+
throw new Error([
|
|
90
|
+
`Failed to load documents from ${Object.keys(documentPointers).join(',')}:`,
|
|
91
|
+
printError(error),
|
|
92
|
+
].join('\n'));
|
|
90
93
|
}
|
|
91
94
|
}
|
|
92
95
|
const printError = (error) => {
|
package/esm/utils/file-system.js
CHANGED
package/esm/utils/patterns.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isAbsolute, relative } from 'path';
|
|
2
|
-
import { isValidPath } from '@graphql-tools/utils';
|
|
3
|
-
import { normalizeInstanceOrArray } from '@graphql-codegen/plugin-helpers';
|
|
4
2
|
import isGlob from 'is-glob';
|
|
5
3
|
import mm from 'micromatch';
|
|
4
|
+
import { normalizeInstanceOrArray } from '@graphql-codegen/plugin-helpers';
|
|
5
|
+
import { isValidPath } from '@graphql-tools/utils';
|
|
6
6
|
import { isURL } from './helpers.js';
|
|
7
7
|
/**
|
|
8
8
|
* Flatten a list of pattern sets to be a list of only the affirmative patterns
|
|
@@ -39,7 +39,10 @@ export const makeShouldRebuild = ({ globalPatternSet, localPatternSets, }) => {
|
|
|
39
39
|
const localMatchers = localPatternSets.map(localPatternSet => {
|
|
40
40
|
return (path) => {
|
|
41
41
|
// Is path negated by any negating watch pattern?
|
|
42
|
-
if (matchesAnyNegatedPattern(path, [
|
|
42
|
+
if (matchesAnyNegatedPattern(path, [
|
|
43
|
+
...globalPatternSet.watch.negated,
|
|
44
|
+
...localPatternSet.watch.negated,
|
|
45
|
+
])) {
|
|
43
46
|
// Short circut: negations in watch patterns take priority
|
|
44
47
|
return false;
|
|
45
48
|
}
|
|
@@ -56,7 +59,10 @@ export const makeShouldRebuild = ({ globalPatternSet, localPatternSets, }) => {
|
|
|
56
59
|
...globalPatternSet.documents.affirmative,
|
|
57
60
|
...localPatternSet.documents.affirmative,
|
|
58
61
|
]) &&
|
|
59
|
-
!matchesAnyNegatedPattern(path, [
|
|
62
|
+
!matchesAnyNegatedPattern(path, [
|
|
63
|
+
...globalPatternSet.documents.negated,
|
|
64
|
+
...localPatternSet.documents.negated,
|
|
65
|
+
])) {
|
|
60
66
|
return true;
|
|
61
67
|
}
|
|
62
68
|
// Does path match schemas patterns (without being negated)?
|
|
@@ -64,7 +70,10 @@ export const makeShouldRebuild = ({ globalPatternSet, localPatternSets, }) => {
|
|
|
64
70
|
...globalPatternSet.schemas.affirmative,
|
|
65
71
|
...localPatternSet.schemas.affirmative,
|
|
66
72
|
]) &&
|
|
67
|
-
!matchesAnyNegatedPattern(path, [
|
|
73
|
+
!matchesAnyNegatedPattern(path, [
|
|
74
|
+
...globalPatternSet.schemas.negated,
|
|
75
|
+
...localPatternSet.schemas.negated,
|
|
76
|
+
])) {
|
|
68
77
|
return true;
|
|
69
78
|
}
|
|
70
79
|
// Otherwise, there is no match
|
|
@@ -94,7 +103,9 @@ export const makeGlobalPatternSet = (initialContext) => {
|
|
|
94
103
|
const config = initialContext.getConfig();
|
|
95
104
|
return {
|
|
96
105
|
watch: sortPatterns([
|
|
97
|
-
...(typeof config.watch === 'boolean'
|
|
106
|
+
...(typeof config.watch === 'boolean'
|
|
107
|
+
? []
|
|
108
|
+
: normalizeInstanceOrArray(config.watch ?? [])),
|
|
98
109
|
relative(process.cwd(), initialContext.filepath),
|
|
99
110
|
]),
|
|
100
111
|
schemas: sortPatterns(makePatternsFromSchemas(normalizeInstanceOrArray(config.schema))),
|
package/esm/utils/watcher.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { normalizeOutputParam } from '@graphql-codegen/plugin-helpers';
|
|
1
|
+
import { isAbsolute, join, relative, resolve, sep } from 'path';
|
|
3
2
|
import debounce from 'debounce';
|
|
4
|
-
import mm from 'micromatch';
|
|
5
3
|
import logSymbols from 'log-symbols';
|
|
4
|
+
import mm from 'micromatch';
|
|
5
|
+
import { normalizeOutputParam } from '@graphql-codegen/plugin-helpers';
|
|
6
6
|
import { executeCodegen } from '../codegen.js';
|
|
7
7
|
import { loadContext } from '../config.js';
|
|
8
8
|
import { lifecycleHooks } from '../hooks.js';
|
|
9
|
-
import { access } from './file-system.js';
|
|
10
9
|
import { debugLog } from './debugging.js';
|
|
10
|
+
import { access } from './file-system.js';
|
|
11
11
|
import { getLogger } from './logger.js';
|
|
12
12
|
import { allAffirmativePatternsFromPatternSets, makeGlobalPatternSet, makeLocalPatternSet, makeShouldRebuild, } from './patterns.js';
|
|
13
|
-
import { AbortController } from './abort-controller-polyfill.js';
|
|
14
13
|
function log(msg) {
|
|
15
14
|
// double spaces to inline the message with Listr
|
|
16
15
|
getLogger().info(` ${msg}`);
|
|
@@ -25,8 +24,14 @@ export const createWatcher = (initialContext, onNext) => {
|
|
|
25
24
|
const localPatternSets = Object.keys(config.generates)
|
|
26
25
|
.map(filename => normalizeOutputParam(config.generates[filename]))
|
|
27
26
|
.map(conf => makeLocalPatternSet(conf));
|
|
28
|
-
const allAffirmativePatterns = allAffirmativePatternsFromPatternSets([
|
|
29
|
-
|
|
27
|
+
const allAffirmativePatterns = allAffirmativePatternsFromPatternSets([
|
|
28
|
+
globalPatternSet,
|
|
29
|
+
...localPatternSets,
|
|
30
|
+
]);
|
|
31
|
+
const shouldRebuild = makeShouldRebuild({
|
|
32
|
+
globalPatternSet,
|
|
33
|
+
localPatternSets,
|
|
34
|
+
});
|
|
30
35
|
let watcherSubscription;
|
|
31
36
|
const runWatcher = async (abortSignal) => {
|
|
32
37
|
const watchDirectory = await findHighestCommonDirectory(allAffirmativePatterns);
|
package/esm/version.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const version = '7.2.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depup/graphql-codegen__cli",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.2.0-depup.11",
|
|
4
4
|
"peerDependenciesMeta": {
|
|
5
5
|
"@parcel/watcher": {
|
|
6
6
|
"optional": true
|
|
@@ -8,48 +8,48 @@
|
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
10
|
"@parcel/watcher": "^2.1.0",
|
|
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"
|
|
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": "^
|
|
15
|
-
"@babel/template": "^
|
|
16
|
-
"@babel/types": "^
|
|
17
|
-
"@graphql-
|
|
18
|
-
"@graphql-
|
|
19
|
-
"@graphql-
|
|
20
|
-
"@graphql-tools/
|
|
21
|
-
"@graphql-tools/
|
|
22
|
-
"@graphql-tools/
|
|
23
|
-
"@graphql-tools/
|
|
24
|
-
"@graphql-tools/
|
|
25
|
-
"@graphql-tools/
|
|
26
|
-
"@graphql-tools/
|
|
27
|
-
"@
|
|
28
|
-
"@graphql-tools/merge": "^9.1.7",
|
|
29
|
-
"@graphql-tools/utils": "^11.0.0",
|
|
30
|
-
"@inquirer/prompts": "^8.4.0",
|
|
14
|
+
"@babel/generator": "^8.0.0",
|
|
15
|
+
"@babel/template": "^8.0.0",
|
|
16
|
+
"@babel/types": "^8.0.4",
|
|
17
|
+
"@graphql-tools/apollo-engine-loader": "^8.0.34",
|
|
18
|
+
"@graphql-tools/code-file-loader": "^8.1.36",
|
|
19
|
+
"@graphql-tools/git-loader": "^8.0.40",
|
|
20
|
+
"@graphql-tools/github-loader": "^9.1.6",
|
|
21
|
+
"@graphql-tools/graphql-file-loader": "^8.1.18",
|
|
22
|
+
"@graphql-tools/json-file-loader": "^8.0.32",
|
|
23
|
+
"@graphql-tools/load": "^8.1.15",
|
|
24
|
+
"@graphql-tools/merge": "^9.2.2",
|
|
25
|
+
"@graphql-tools/url-loader": "^9.1.6",
|
|
26
|
+
"@graphql-tools/utils": "^11.2.2",
|
|
27
|
+
"@inquirer/prompts": "^8.5.2",
|
|
31
28
|
"@whatwg-node/fetch": "^0.10.13",
|
|
32
|
-
"chalk": "^
|
|
33
|
-
"cosmiconfig": "^9.0.
|
|
29
|
+
"chalk": "^6.0.0",
|
|
30
|
+
"cosmiconfig": "^9.0.2",
|
|
34
31
|
"debounce": "^3.0.0",
|
|
35
32
|
"detect-indent": "^7.0.2",
|
|
36
33
|
"graphql-config": "^5.1.6",
|
|
37
34
|
"is-glob": "^4.0.3",
|
|
38
|
-
"jiti": "^2.
|
|
35
|
+
"jiti": "^2.7.0",
|
|
39
36
|
"json-to-pretty-yaml": "^1.2.2",
|
|
40
|
-
"listr2": "^
|
|
37
|
+
"listr2": "^11.0.0",
|
|
41
38
|
"log-symbols": "^7.0.1",
|
|
42
39
|
"micromatch": "^4.0.8",
|
|
43
|
-
"shell-quote": "^1.
|
|
40
|
+
"shell-quote": "^1.10.0",
|
|
44
41
|
"string-env-interpolation": "^1.0.1",
|
|
45
|
-
"ts-log": "^3.0.
|
|
42
|
+
"ts-log": "^3.0.2",
|
|
46
43
|
"tslib": "^2.8.1",
|
|
47
|
-
"yaml": "^2.
|
|
48
|
-
"yargs": "^18.
|
|
44
|
+
"yaml": "^2.9.0",
|
|
45
|
+
"yargs": "^18.1.0",
|
|
46
|
+
"@graphql-codegen/client-preset": "^6.1.0",
|
|
47
|
+
"@graphql-codegen/core": "^6.2.0",
|
|
48
|
+
"@graphql-codegen/plugin-helpers": "^7.1.0"
|
|
49
49
|
},
|
|
50
50
|
"repository": {
|
|
51
51
|
"type": "git",
|
|
52
|
-
"url": "https://github.com/dotansimha/graphql-code-generator.git",
|
|
52
|
+
"url": "git+https://github.com/dotansimha/graphql-code-generator.git",
|
|
53
53
|
"directory": "packages/graphql-codegen-cli"
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/dotansimha/graphql-code-generator#readme",
|
|
@@ -105,76 +105,85 @@
|
|
|
105
105
|
"./package.json": "./package.json"
|
|
106
106
|
},
|
|
107
107
|
"bin": {
|
|
108
|
-
"gql-gen": "
|
|
109
|
-
"graphql-codegen": "
|
|
110
|
-
"graphql-code-generator": "
|
|
111
|
-
"graphql-codegen-esm": "esm/bin.js"
|
|
108
|
+
"gql-gen": "esm/bin.js",
|
|
109
|
+
"graphql-codegen": "esm/bin.js",
|
|
110
|
+
"graphql-code-generator": "esm/bin.js",
|
|
111
|
+
"graphql-codegen-esm": "esm/bin.js",
|
|
112
|
+
"graphql-codegen-cjs": "cjs/bin.js"
|
|
112
113
|
},
|
|
113
114
|
"description": "@graphql-codegen/cli with all dependencies updated to latest",
|
|
114
115
|
"depup": {
|
|
115
116
|
"changes": {
|
|
116
117
|
"@babel/generator": {
|
|
117
118
|
"from": "^7.18.13",
|
|
118
|
-
"to": "^
|
|
119
|
+
"to": "^8.0.0"
|
|
119
120
|
},
|
|
120
121
|
"@babel/template": {
|
|
121
122
|
"from": "^7.18.10",
|
|
122
|
-
"to": "^
|
|
123
|
+
"to": "^8.0.0"
|
|
123
124
|
},
|
|
124
125
|
"@babel/types": {
|
|
125
126
|
"from": "^7.18.13",
|
|
126
|
-
"to": "^
|
|
127
|
+
"to": "^8.0.4"
|
|
127
128
|
},
|
|
128
|
-
"@graphql-
|
|
129
|
-
"from": "^
|
|
130
|
-
"to": "^
|
|
129
|
+
"@graphql-tools/apollo-engine-loader": {
|
|
130
|
+
"from": "^8.0.28",
|
|
131
|
+
"to": "^8.0.34"
|
|
131
132
|
},
|
|
132
133
|
"@graphql-tools/code-file-loader": {
|
|
133
134
|
"from": "^8.1.28",
|
|
134
|
-
"to": "^8.1.
|
|
135
|
+
"to": "^8.1.36"
|
|
135
136
|
},
|
|
136
137
|
"@graphql-tools/git-loader": {
|
|
137
138
|
"from": "^8.0.32",
|
|
138
|
-
"to": "^8.0.
|
|
139
|
+
"to": "^8.0.40"
|
|
139
140
|
},
|
|
140
141
|
"@graphql-tools/github-loader": {
|
|
141
142
|
"from": "^9.0.6",
|
|
142
|
-
"to": "^9.1.
|
|
143
|
+
"to": "^9.1.6"
|
|
143
144
|
},
|
|
144
145
|
"@graphql-tools/graphql-file-loader": {
|
|
145
146
|
"from": "^8.1.11",
|
|
146
|
-
"to": "^8.1.
|
|
147
|
+
"to": "^8.1.18"
|
|
147
148
|
},
|
|
148
|
-
"@graphql-tools/
|
|
149
|
-
"from": "^
|
|
150
|
-
"to": "^
|
|
149
|
+
"@graphql-tools/json-file-loader": {
|
|
150
|
+
"from": "^8.0.26",
|
|
151
|
+
"to": "^8.0.32"
|
|
152
|
+
},
|
|
153
|
+
"@graphql-tools/load": {
|
|
154
|
+
"from": "^8.1.8",
|
|
155
|
+
"to": "^8.1.15"
|
|
151
156
|
},
|
|
152
157
|
"@graphql-tools/merge": {
|
|
153
158
|
"from": "^9.0.6",
|
|
154
|
-
"to": "^9.
|
|
159
|
+
"to": "^9.2.2"
|
|
160
|
+
},
|
|
161
|
+
"@graphql-tools/url-loader": {
|
|
162
|
+
"from": "^9.0.6",
|
|
163
|
+
"to": "^9.1.6"
|
|
164
|
+
},
|
|
165
|
+
"@graphql-tools/utils": {
|
|
166
|
+
"from": "^11.2.0",
|
|
167
|
+
"to": "^11.2.2"
|
|
155
168
|
},
|
|
156
169
|
"@inquirer/prompts": {
|
|
157
|
-
"from": "^
|
|
158
|
-
"to": "^8.
|
|
170
|
+
"from": "^8.3.2",
|
|
171
|
+
"to": "^8.5.2"
|
|
159
172
|
},
|
|
160
173
|
"@whatwg-node/fetch": {
|
|
161
174
|
"from": "^0.10.0",
|
|
162
175
|
"to": "^0.10.13"
|
|
163
176
|
},
|
|
164
177
|
"chalk": {
|
|
165
|
-
"from": "^
|
|
166
|
-
"to": "^
|
|
178
|
+
"from": "^5.6.0",
|
|
179
|
+
"to": "^6.0.0"
|
|
167
180
|
},
|
|
168
181
|
"cosmiconfig": {
|
|
169
182
|
"from": "^9.0.0",
|
|
170
|
-
"to": "^9.0.
|
|
171
|
-
},
|
|
172
|
-
"debounce": {
|
|
173
|
-
"from": "^2.0.0",
|
|
174
|
-
"to": "^3.0.0"
|
|
183
|
+
"to": "^9.0.2"
|
|
175
184
|
},
|
|
176
185
|
"detect-indent": {
|
|
177
|
-
"from": "^
|
|
186
|
+
"from": "^7.0.0",
|
|
178
187
|
"to": "^7.0.2"
|
|
179
188
|
},
|
|
180
189
|
"is-glob": {
|
|
@@ -183,14 +192,14 @@
|
|
|
183
192
|
},
|
|
184
193
|
"jiti": {
|
|
185
194
|
"from": "^2.3.0",
|
|
186
|
-
"to": "^2.
|
|
195
|
+
"to": "^2.7.0"
|
|
187
196
|
},
|
|
188
197
|
"listr2": {
|
|
189
|
-
"from": "^
|
|
190
|
-
"to": "^
|
|
198
|
+
"from": "^10.2.1",
|
|
199
|
+
"to": "^11.0.0"
|
|
191
200
|
},
|
|
192
201
|
"log-symbols": {
|
|
193
|
-
"from": "^
|
|
202
|
+
"from": "^7.0.0",
|
|
194
203
|
"to": "^7.0.1"
|
|
195
204
|
},
|
|
196
205
|
"micromatch": {
|
|
@@ -199,11 +208,11 @@
|
|
|
199
208
|
},
|
|
200
209
|
"shell-quote": {
|
|
201
210
|
"from": "^1.7.3",
|
|
202
|
-
"to": "^1.
|
|
211
|
+
"to": "^1.10.0"
|
|
203
212
|
},
|
|
204
213
|
"ts-log": {
|
|
205
|
-
"from": "^
|
|
206
|
-
"to": "^3.0.
|
|
214
|
+
"from": "^3.0.0",
|
|
215
|
+
"to": "^3.0.2"
|
|
207
216
|
},
|
|
208
217
|
"tslib": {
|
|
209
218
|
"from": "^2.4.0",
|
|
@@ -211,17 +220,17 @@
|
|
|
211
220
|
},
|
|
212
221
|
"yaml": {
|
|
213
222
|
"from": "^2.3.1",
|
|
214
|
-
"to": "^2.
|
|
223
|
+
"to": "^2.9.0"
|
|
215
224
|
},
|
|
216
225
|
"yargs": {
|
|
217
|
-
"from": "^
|
|
218
|
-
"to": "^18.
|
|
226
|
+
"from": "^18.0.0",
|
|
227
|
+
"to": "^18.1.0"
|
|
219
228
|
}
|
|
220
229
|
},
|
|
221
|
-
"depsUpdated":
|
|
230
|
+
"depsUpdated": 28,
|
|
222
231
|
"originalPackage": "@graphql-codegen/cli",
|
|
223
|
-
"originalVersion": "
|
|
224
|
-
"processedAt": "2026-
|
|
232
|
+
"originalVersion": "7.2.0",
|
|
233
|
+
"processedAt": "2026-07-26T16:22:25.185Z",
|
|
225
234
|
"smokeTest": "passed"
|
|
226
235
|
}
|
|
227
236
|
}
|
package/typings/config.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Profiler, Types } from '@graphql-codegen/plugin-helpers';
|
|
2
1
|
import { GraphQLSchema } from 'graphql';
|
|
3
2
|
import { GraphQLConfig } from 'graphql-config';
|
|
3
|
+
import { Profiler, Types } from '@graphql-codegen/plugin-helpers';
|
|
4
|
+
import type { UnnormalizedTypeDefPointer } from '@graphql-tools/load';
|
|
4
5
|
export type CodegenConfig = Types.Config;
|
|
5
6
|
export type YamlCliFlags = {
|
|
6
7
|
config: string;
|
|
@@ -147,6 +148,6 @@ export declare class CodegenContext {
|
|
|
147
148
|
[key: string]: any;
|
|
148
149
|
};
|
|
149
150
|
loadSchema(pointer: Types.Schema | Types.Schema[]): Promise<GraphQLSchema>;
|
|
150
|
-
loadDocuments(pointer:
|
|
151
|
+
loadDocuments(pointer: UnnormalizedTypeDefPointer, type: 'standard' | 'external'): Promise<Types.DocumentFile[]>;
|
|
151
152
|
}
|
|
152
153
|
export declare function ensureContext(input: CodegenContext | Types.Config): CodegenContext;
|
package/typings/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { Profiler, Types } from '@graphql-codegen/plugin-helpers';
|
|
2
1
|
import { GraphQLSchema } from 'graphql';
|
|
3
2
|
import { GraphQLConfig } from 'graphql-config';
|
|
3
|
+
import { Profiler, Types } from '@graphql-codegen/plugin-helpers';
|
|
4
|
+
import type { UnnormalizedTypeDefPointer } from '@graphql-tools/load';
|
|
4
5
|
export type CodegenConfig = Types.Config;
|
|
5
6
|
export type YamlCliFlags = {
|
|
6
7
|
config: string;
|
|
@@ -147,6 +148,6 @@ export declare class CodegenContext {
|
|
|
147
148
|
[key: string]: any;
|
|
148
149
|
};
|
|
149
150
|
loadSchema(pointer: Types.Schema | Types.Schema[]): Promise<GraphQLSchema>;
|
|
150
|
-
loadDocuments(pointer:
|
|
151
|
+
loadDocuments(pointer: UnnormalizedTypeDefPointer, type: 'standard' | 'external'): Promise<Types.DocumentFile[]>;
|
|
151
152
|
}
|
|
152
153
|
export declare function ensureContext(input: CodegenContext | Types.Config): CodegenContext;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Answers, type PluginOption
|
|
1
|
+
import { Tags, type Answers, type PluginOption } from './types.cjs';
|
|
2
2
|
export declare function getAnswers(possibleTargets: Record<Tags, boolean>): Promise<Answers>;
|
|
3
3
|
export declare function getApplicationTypeChoices(possibleTargets: Record<Tags, boolean>): {
|
|
4
4
|
name: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type Answers, type PluginOption
|
|
1
|
+
import { Tags, type Answers, type PluginOption } from './types.js';
|
|
2
2
|
export declare function getAnswers(possibleTargets: Record<Tags, boolean>): Promise<Answers>;
|
|
3
3
|
export declare function getApplicationTypeChoices(possibleTargets: Record<Tags, boolean>): {
|
|
4
4
|
name: string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Tags } from './types.cjs';
|
|
2
|
-
export declare function guessTargets():
|
|
2
|
+
export declare function guessTargets(): Record<Tags, boolean>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { Tags } from './types.js';
|
|
2
|
-
export declare function guessTargets():
|
|
2
|
+
export declare function guessTargets(): Record<Tags, boolean>;
|
package/typings/load.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { GraphQLSchema } from 'graphql';
|
|
2
|
+
import type { Source } from 'graphql-config';
|
|
1
3
|
import { Types } from '@graphql-codegen/plugin-helpers';
|
|
2
4
|
import { UnnormalizedTypeDefPointer } from '@graphql-tools/load';
|
|
3
|
-
import { GraphQLSchema } from 'graphql';
|
|
4
5
|
export declare const defaultSchemaLoadOptions: {
|
|
5
6
|
assumeValidSDL: boolean;
|
|
6
7
|
sort: boolean;
|
|
@@ -12,4 +13,4 @@ export declare const defaultDocumentsLoadOptions: {
|
|
|
12
13
|
skipGraphQLImport: boolean;
|
|
13
14
|
};
|
|
14
15
|
export declare function loadSchema(schemaPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], config: Types.Config): Promise<GraphQLSchema>;
|
|
15
|
-
export declare function loadDocuments(documentPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], config: Types.Config): Promise<
|
|
16
|
+
export declare function loadDocuments(documentPointers: UnnormalizedTypeDefPointer | UnnormalizedTypeDefPointer[], config: Types.Config): Promise<Source[]>;
|