@graphql-codegen/cli 2.6.3-alpha-4a7e799f2.0 → 2.6.3-alpha-af9e4731c.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/bin.js +10 -14
- package/index.js +10 -14
- package/index.mjs +10 -14
- package/package.json +3 -9
package/bin.js
CHANGED
|
@@ -109,7 +109,7 @@ const DEFAULT_HOOKS = {
|
|
|
109
109
|
function normalizeHooks(_hooks) {
|
|
110
110
|
const keys = Object.keys({
|
|
111
111
|
...DEFAULT_HOOKS,
|
|
112
|
-
...
|
|
112
|
+
..._hooks,
|
|
113
113
|
});
|
|
114
114
|
return keys.reduce((prev, hookName) => {
|
|
115
115
|
if (typeof _hooks[hookName] === 'string') {
|
|
@@ -118,21 +118,19 @@ function normalizeHooks(_hooks) {
|
|
|
118
118
|
[hookName]: [_hooks[hookName]],
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
|
|
121
|
+
if (typeof _hooks[hookName] === 'function') {
|
|
122
122
|
return {
|
|
123
123
|
...prev,
|
|
124
124
|
[hookName]: [_hooks[hookName]],
|
|
125
125
|
};
|
|
126
126
|
}
|
|
127
|
-
|
|
127
|
+
if (Array.isArray(_hooks[hookName])) {
|
|
128
128
|
return {
|
|
129
129
|
...prev,
|
|
130
130
|
[hookName]: _hooks[hookName],
|
|
131
131
|
};
|
|
132
132
|
}
|
|
133
|
-
|
|
134
|
-
return prev;
|
|
135
|
-
}
|
|
133
|
+
return prev;
|
|
136
134
|
}, {});
|
|
137
135
|
}
|
|
138
136
|
function execShellCommand(cmd) {
|
|
@@ -388,7 +386,7 @@ async function getPresetByName(name, loader) {
|
|
|
388
386
|
if (loaded && loaded.preset) {
|
|
389
387
|
return loaded.preset;
|
|
390
388
|
}
|
|
391
|
-
|
|
389
|
+
if (loaded && loaded.default) {
|
|
392
390
|
return loaded.default;
|
|
393
391
|
}
|
|
394
392
|
return loaded;
|
|
@@ -1039,8 +1037,8 @@ async function executeCodegen(input) {
|
|
|
1039
1037
|
const outputSchemaAst = await context.loadSchema(schemaPointerMap);
|
|
1040
1038
|
const outputSchema = pluginHelpers.getCachedDocumentNodeFromSchema(outputSchemaAst);
|
|
1041
1039
|
return {
|
|
1042
|
-
outputSchemaAst
|
|
1043
|
-
outputSchema
|
|
1040
|
+
outputSchemaAst,
|
|
1041
|
+
outputSchema,
|
|
1044
1042
|
};
|
|
1045
1043
|
});
|
|
1046
1044
|
outputSchemaAst = await result.outputSchemaAst;
|
|
@@ -1057,7 +1055,7 @@ async function executeCodegen(input) {
|
|
|
1057
1055
|
return cache('documents', hash, async () => {
|
|
1058
1056
|
const documents = await context.loadDocuments(docs);
|
|
1059
1057
|
return {
|
|
1060
|
-
documents
|
|
1058
|
+
documents,
|
|
1061
1059
|
};
|
|
1062
1060
|
});
|
|
1063
1061
|
}));
|
|
@@ -1762,12 +1760,10 @@ function getOutputDefaultValue(answers) {
|
|
|
1762
1760
|
if (answers.plugins.some(plugin => plugin.defaultExtension === '.tsx')) {
|
|
1763
1761
|
return 'src/generated/graphql.tsx';
|
|
1764
1762
|
}
|
|
1765
|
-
|
|
1763
|
+
if (answers.plugins.some(plugin => plugin.defaultExtension === '.ts')) {
|
|
1766
1764
|
return 'src/generated/graphql.ts';
|
|
1767
1765
|
}
|
|
1768
|
-
|
|
1769
|
-
return 'src/generated/graphql.js';
|
|
1770
|
-
}
|
|
1766
|
+
return 'src/generated/graphql.js';
|
|
1771
1767
|
}
|
|
1772
1768
|
|
|
1773
1769
|
async function guessTargets() {
|
package/index.js
CHANGED
|
@@ -306,7 +306,7 @@ async function getPresetByName(name, loader) {
|
|
|
306
306
|
if (loaded && loaded.preset) {
|
|
307
307
|
return loaded.preset;
|
|
308
308
|
}
|
|
309
|
-
|
|
309
|
+
if (loaded && loaded.default) {
|
|
310
310
|
return loaded.default;
|
|
311
311
|
}
|
|
312
312
|
return loaded;
|
|
@@ -957,8 +957,8 @@ async function executeCodegen(input) {
|
|
|
957
957
|
const outputSchemaAst = await context.loadSchema(schemaPointerMap);
|
|
958
958
|
const outputSchema = pluginHelpers.getCachedDocumentNodeFromSchema(outputSchemaAst);
|
|
959
959
|
return {
|
|
960
|
-
outputSchemaAst
|
|
961
|
-
outputSchema
|
|
960
|
+
outputSchemaAst,
|
|
961
|
+
outputSchema,
|
|
962
962
|
};
|
|
963
963
|
});
|
|
964
964
|
outputSchemaAst = await result.outputSchemaAst;
|
|
@@ -975,7 +975,7 @@ async function executeCodegen(input) {
|
|
|
975
975
|
return cache('documents', hash, async () => {
|
|
976
976
|
const documents = await context.loadDocuments(docs);
|
|
977
977
|
return {
|
|
978
|
-
documents
|
|
978
|
+
documents,
|
|
979
979
|
};
|
|
980
980
|
});
|
|
981
981
|
}));
|
|
@@ -1098,7 +1098,7 @@ const DEFAULT_HOOKS = {
|
|
|
1098
1098
|
function normalizeHooks(_hooks) {
|
|
1099
1099
|
const keys = Object.keys({
|
|
1100
1100
|
...DEFAULT_HOOKS,
|
|
1101
|
-
...
|
|
1101
|
+
..._hooks,
|
|
1102
1102
|
});
|
|
1103
1103
|
return keys.reduce((prev, hookName) => {
|
|
1104
1104
|
if (typeof _hooks[hookName] === 'string') {
|
|
@@ -1107,21 +1107,19 @@ function normalizeHooks(_hooks) {
|
|
|
1107
1107
|
[hookName]: [_hooks[hookName]],
|
|
1108
1108
|
};
|
|
1109
1109
|
}
|
|
1110
|
-
|
|
1110
|
+
if (typeof _hooks[hookName] === 'function') {
|
|
1111
1111
|
return {
|
|
1112
1112
|
...prev,
|
|
1113
1113
|
[hookName]: [_hooks[hookName]],
|
|
1114
1114
|
};
|
|
1115
1115
|
}
|
|
1116
|
-
|
|
1116
|
+
if (Array.isArray(_hooks[hookName])) {
|
|
1117
1117
|
return {
|
|
1118
1118
|
...prev,
|
|
1119
1119
|
[hookName]: _hooks[hookName],
|
|
1120
1120
|
};
|
|
1121
1121
|
}
|
|
1122
|
-
|
|
1123
|
-
return prev;
|
|
1124
|
-
}
|
|
1122
|
+
return prev;
|
|
1125
1123
|
}, {});
|
|
1126
1124
|
}
|
|
1127
1125
|
function execShellCommand(cmd) {
|
|
@@ -1763,12 +1761,10 @@ function getOutputDefaultValue(answers) {
|
|
|
1763
1761
|
if (answers.plugins.some(plugin => plugin.defaultExtension === '.tsx')) {
|
|
1764
1762
|
return 'src/generated/graphql.tsx';
|
|
1765
1763
|
}
|
|
1766
|
-
|
|
1764
|
+
if (answers.plugins.some(plugin => plugin.defaultExtension === '.ts')) {
|
|
1767
1765
|
return 'src/generated/graphql.ts';
|
|
1768
1766
|
}
|
|
1769
|
-
|
|
1770
|
-
return 'src/generated/graphql.js';
|
|
1771
|
-
}
|
|
1767
|
+
return 'src/generated/graphql.js';
|
|
1772
1768
|
}
|
|
1773
1769
|
|
|
1774
1770
|
async function guessTargets() {
|
package/index.mjs
CHANGED
|
@@ -279,7 +279,7 @@ async function getPresetByName(name, loader) {
|
|
|
279
279
|
if (loaded && loaded.preset) {
|
|
280
280
|
return loaded.preset;
|
|
281
281
|
}
|
|
282
|
-
|
|
282
|
+
if (loaded && loaded.default) {
|
|
283
283
|
return loaded.default;
|
|
284
284
|
}
|
|
285
285
|
return loaded;
|
|
@@ -930,8 +930,8 @@ async function executeCodegen(input) {
|
|
|
930
930
|
const outputSchemaAst = await context.loadSchema(schemaPointerMap);
|
|
931
931
|
const outputSchema = getCachedDocumentNodeFromSchema(outputSchemaAst);
|
|
932
932
|
return {
|
|
933
|
-
outputSchemaAst
|
|
934
|
-
outputSchema
|
|
933
|
+
outputSchemaAst,
|
|
934
|
+
outputSchema,
|
|
935
935
|
};
|
|
936
936
|
});
|
|
937
937
|
outputSchemaAst = await result.outputSchemaAst;
|
|
@@ -948,7 +948,7 @@ async function executeCodegen(input) {
|
|
|
948
948
|
return cache('documents', hash, async () => {
|
|
949
949
|
const documents = await context.loadDocuments(docs);
|
|
950
950
|
return {
|
|
951
|
-
documents
|
|
951
|
+
documents,
|
|
952
952
|
};
|
|
953
953
|
});
|
|
954
954
|
}));
|
|
@@ -1071,7 +1071,7 @@ const DEFAULT_HOOKS = {
|
|
|
1071
1071
|
function normalizeHooks(_hooks) {
|
|
1072
1072
|
const keys = Object.keys({
|
|
1073
1073
|
...DEFAULT_HOOKS,
|
|
1074
|
-
...
|
|
1074
|
+
..._hooks,
|
|
1075
1075
|
});
|
|
1076
1076
|
return keys.reduce((prev, hookName) => {
|
|
1077
1077
|
if (typeof _hooks[hookName] === 'string') {
|
|
@@ -1080,21 +1080,19 @@ function normalizeHooks(_hooks) {
|
|
|
1080
1080
|
[hookName]: [_hooks[hookName]],
|
|
1081
1081
|
};
|
|
1082
1082
|
}
|
|
1083
|
-
|
|
1083
|
+
if (typeof _hooks[hookName] === 'function') {
|
|
1084
1084
|
return {
|
|
1085
1085
|
...prev,
|
|
1086
1086
|
[hookName]: [_hooks[hookName]],
|
|
1087
1087
|
};
|
|
1088
1088
|
}
|
|
1089
|
-
|
|
1089
|
+
if (Array.isArray(_hooks[hookName])) {
|
|
1090
1090
|
return {
|
|
1091
1091
|
...prev,
|
|
1092
1092
|
[hookName]: _hooks[hookName],
|
|
1093
1093
|
};
|
|
1094
1094
|
}
|
|
1095
|
-
|
|
1096
|
-
return prev;
|
|
1097
|
-
}
|
|
1095
|
+
return prev;
|
|
1098
1096
|
}, {});
|
|
1099
1097
|
}
|
|
1100
1098
|
function execShellCommand(cmd) {
|
|
@@ -1736,12 +1734,10 @@ function getOutputDefaultValue(answers) {
|
|
|
1736
1734
|
if (answers.plugins.some(plugin => plugin.defaultExtension === '.tsx')) {
|
|
1737
1735
|
return 'src/generated/graphql.tsx';
|
|
1738
1736
|
}
|
|
1739
|
-
|
|
1737
|
+
if (answers.plugins.some(plugin => plugin.defaultExtension === '.ts')) {
|
|
1740
1738
|
return 'src/generated/graphql.ts';
|
|
1741
1739
|
}
|
|
1742
|
-
|
|
1743
|
-
return 'src/generated/graphql.js';
|
|
1744
|
-
}
|
|
1740
|
+
return 'src/generated/graphql.js';
|
|
1745
1741
|
}
|
|
1746
1742
|
|
|
1747
1743
|
async function guessTargets() {
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/cli",
|
|
3
|
-
"version": "2.6.3-alpha-
|
|
3
|
+
"version": "2.6.3-alpha-af9e4731c.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"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"
|
|
6
6
|
},
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@graphql-codegen/core": "2.5.
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "2.4.
|
|
8
|
+
"@graphql-codegen/core": "2.5.1",
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^2.4.1",
|
|
10
10
|
"@graphql-tools/apollo-engine-loader": "^7.0.5",
|
|
11
11
|
"@graphql-tools/code-file-loader": "^7.0.6",
|
|
12
12
|
"@graphql-tools/git-loader": "^7.0.5",
|
|
@@ -24,10 +24,7 @@
|
|
|
24
24
|
"common-tags": "^1.8.0",
|
|
25
25
|
"cosmiconfig": "^7.0.0",
|
|
26
26
|
"debounce": "^1.2.0",
|
|
27
|
-
"dependency-graph": "^0.11.0",
|
|
28
27
|
"detect-indent": "^6.0.0",
|
|
29
|
-
"glob": "^7.1.6",
|
|
30
|
-
"globby": "^11.0.4",
|
|
31
28
|
"graphql-config": "^4.1.0",
|
|
32
29
|
"inquirer": "^8.0.0",
|
|
33
30
|
"is-glob": "^4.0.1",
|
|
@@ -36,12 +33,9 @@
|
|
|
36
33
|
"listr": "^0.14.3",
|
|
37
34
|
"listr-update-renderer": "^0.5.0",
|
|
38
35
|
"log-symbols": "^4.0.0",
|
|
39
|
-
"minimatch": "^5.0.0",
|
|
40
36
|
"mkdirp": "^1.0.4",
|
|
41
37
|
"string-env-interpolation": "^1.0.1",
|
|
42
38
|
"ts-log": "^2.2.3",
|
|
43
|
-
"tslib": "~2.3.0",
|
|
44
|
-
"valid-url": "^1.0.9",
|
|
45
39
|
"wrap-ansi": "^7.0.0",
|
|
46
40
|
"yaml": "^1.10.0",
|
|
47
41
|
"yargs": "^17.0.0"
|