@graphql-codegen/cli 3.0.0-alpha-20220819151557-d00fec86a → 3.0.0-alpha-20220823170145-c93d8aee3
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/cjs/config.js +5 -0
- package/esm/config.js +5 -0
- package/package.json +4 -3
- package/typings/config.d.cts +1 -0
- package/typings/config.d.ts +1 -0
- package/typings/index.d.cts +1 -0
- package/typings/index.d.ts +1 -0
package/cjs/config.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.shouldEmitLegacyCommonJSImports = exports.ensureContext = exports.CodegenContext = exports.updateContextWithCliFlags = exports.createContext = exports.parseArgv = exports.buildOptions = exports.loadContext = exports.loadCodegenConfig = exports.generateSearchPlaces = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const cosmiconfig_1 = require("cosmiconfig");
|
|
6
|
+
const cosmiconfig_typescript_loader_1 = tslib_1.__importDefault(require("cosmiconfig-typescript-loader"));
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
8
9
|
const string_env_interpolation_1 = require("string-env-interpolation");
|
|
@@ -45,6 +46,9 @@ function customLoader(ext) {
|
|
|
45
46
|
if (ext === 'js') {
|
|
46
47
|
return cosmiconfig_1.defaultLoaders['.js'](filepath, content);
|
|
47
48
|
}
|
|
49
|
+
if (ext === 'ts') {
|
|
50
|
+
return (0, cosmiconfig_typescript_loader_1.default)()(filepath, content);
|
|
51
|
+
}
|
|
48
52
|
}
|
|
49
53
|
return loader;
|
|
50
54
|
}
|
|
@@ -60,6 +64,7 @@ async function loadCodegenConfig({ configFilePath, moduleName, searchPlaces: add
|
|
|
60
64
|
'.yaml': customLoader('yaml'),
|
|
61
65
|
'.yml': customLoader('yaml'),
|
|
62
66
|
'.js': customLoader('js'),
|
|
67
|
+
'.ts': customLoader('ts'),
|
|
63
68
|
noExt: customLoader('yaml'),
|
|
64
69
|
...customLoaders,
|
|
65
70
|
},
|
package/esm/config.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cosmiconfig, defaultLoaders } from 'cosmiconfig';
|
|
2
|
+
import TypeScriptLoader from 'cosmiconfig-typescript-loader';
|
|
2
3
|
import { resolve } from 'path';
|
|
3
4
|
import { DetailedError, createProfiler, createNoopProfiler, getCachedDocumentNodeFromSchema, } from '@graphql-codegen/plugin-helpers';
|
|
4
5
|
import { env } from 'string-env-interpolation';
|
|
@@ -40,6 +41,9 @@ function customLoader(ext) {
|
|
|
40
41
|
if (ext === 'js') {
|
|
41
42
|
return defaultLoaders['.js'](filepath, content);
|
|
42
43
|
}
|
|
44
|
+
if (ext === 'ts') {
|
|
45
|
+
return TypeScriptLoader()(filepath, content);
|
|
46
|
+
}
|
|
43
47
|
}
|
|
44
48
|
return loader;
|
|
45
49
|
}
|
|
@@ -55,6 +59,7 @@ export async function loadCodegenConfig({ configFilePath, moduleName, searchPlac
|
|
|
55
59
|
'.yaml': customLoader('yaml'),
|
|
56
60
|
'.yml': customLoader('yaml'),
|
|
57
61
|
'.js': customLoader('js'),
|
|
62
|
+
'.ts': customLoader('ts'),
|
|
58
63
|
noExt: customLoader('yaml'),
|
|
59
64
|
...customLoaders,
|
|
60
65
|
},
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/cli",
|
|
3
|
-
"version": "3.0.0-alpha-
|
|
3
|
+
"version": "3.0.0-alpha-20220823170145-c93d8aee3",
|
|
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
8
|
"@graphql-codegen/core": "2.6.2",
|
|
9
|
-
"@graphql-codegen/front-end-preset": "1.0.1-alpha-
|
|
9
|
+
"@graphql-codegen/front-end-preset": "1.0.1-alpha-20220819144347-ab4dcfa54",
|
|
10
10
|
"@graphql-codegen/plugin-helpers": "^2.6.2",
|
|
11
11
|
"@graphql-tools/apollo-engine-loader": "^7.3.6",
|
|
12
12
|
"@graphql-tools/code-file-loader": "^7.3.1",
|
|
@@ -18,11 +18,12 @@
|
|
|
18
18
|
"@graphql-tools/prisma-loader": "^7.2.7",
|
|
19
19
|
"@graphql-tools/url-loader": "^7.13.2",
|
|
20
20
|
"@graphql-tools/utils": "^8.9.0",
|
|
21
|
-
"@whatwg-node/fetch": "^0.
|
|
21
|
+
"@whatwg-node/fetch": "^0.3.0",
|
|
22
22
|
"ansi-escapes": "^4.3.1",
|
|
23
23
|
"chalk": "^4.1.0",
|
|
24
24
|
"chokidar": "^3.5.2",
|
|
25
25
|
"cosmiconfig": "^7.0.0",
|
|
26
|
+
"cosmiconfig-typescript-loader": "^3.1.1",
|
|
26
27
|
"debounce": "^1.2.0",
|
|
27
28
|
"detect-indent": "^6.0.0",
|
|
28
29
|
"graphql-config": "^4.3.1",
|
package/typings/config.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Types, Profiler } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { GraphQLConfig } from 'graphql-config';
|
|
3
3
|
import { GraphQLSchema } from 'graphql';
|
|
4
|
+
export declare type CodegenConfig = Types.Config;
|
|
4
5
|
export declare type YamlCliFlags = {
|
|
5
6
|
config: string;
|
|
6
7
|
watch: boolean | string | string[];
|
package/typings/config.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Types, Profiler } from '@graphql-codegen/plugin-helpers';
|
|
2
2
|
import { GraphQLConfig } from 'graphql-config';
|
|
3
3
|
import { GraphQLSchema } from 'graphql';
|
|
4
|
+
export declare type CodegenConfig = Types.Config;
|
|
4
5
|
export declare type YamlCliFlags = {
|
|
5
6
|
config: string;
|
|
6
7
|
watch: boolean | string | string[];
|
package/typings/index.d.cts
CHANGED
package/typings/index.d.ts
CHANGED