@graphql-codegen/graphql-modules-preset 5.0.5 → 5.1.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/cjs/index.js +6 -1
- package/esm/index.js +6 -1
- package/package.json +3 -3
package/cjs/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.preset = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
+
const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
|
|
5
6
|
const visitor_plugin_common_1 = require("@graphql-codegen/visitor-plugin-common");
|
|
6
7
|
const graphql_1 = require("graphql");
|
|
7
8
|
const builder_js_1 = require("./builder.js");
|
|
@@ -61,9 +62,13 @@ exports.preset = {
|
|
|
61
62
|
schemaAst: options.schemaAst,
|
|
62
63
|
documentTransforms: options.documentTransforms,
|
|
63
64
|
};
|
|
65
|
+
const importExtension = (0, plugin_helpers_1.normalizeImportExtension)({
|
|
66
|
+
emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
|
|
67
|
+
importExtension: options.config.importExtension,
|
|
68
|
+
});
|
|
64
69
|
const baseTypesFilename = baseTypesPath.replace(/\.(js|ts|d.ts)$/,
|
|
65
70
|
// we need extension if ESM modules are used
|
|
66
|
-
|
|
71
|
+
importExtension);
|
|
67
72
|
const baseTypesDir = (0, utils_js_1.stripFilename)(baseOutput.filename);
|
|
68
73
|
// One file per each module
|
|
69
74
|
const outputs = modules.map(moduleName => {
|
package/esm/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { join, relative, resolve } from 'path';
|
|
2
|
+
import { normalizeImportExtension } from '@graphql-codegen/plugin-helpers';
|
|
2
3
|
import { BaseVisitor, getConfigValue } from '@graphql-codegen/visitor-plugin-common';
|
|
3
4
|
import { concatAST, isScalarType } from 'graphql';
|
|
4
5
|
import { buildModule } from './builder.js';
|
|
@@ -58,9 +59,13 @@ export const preset = {
|
|
|
58
59
|
schemaAst: options.schemaAst,
|
|
59
60
|
documentTransforms: options.documentTransforms,
|
|
60
61
|
};
|
|
62
|
+
const importExtension = normalizeImportExtension({
|
|
63
|
+
emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
|
|
64
|
+
importExtension: options.config.importExtension,
|
|
65
|
+
});
|
|
61
66
|
const baseTypesFilename = baseTypesPath.replace(/\.(js|ts|d.ts)$/,
|
|
62
67
|
// we need extension if ESM modules are used
|
|
63
|
-
|
|
68
|
+
importExtension);
|
|
64
69
|
const baseTypesDir = stripFilename(baseOutput.filename);
|
|
65
70
|
// One file per each module
|
|
66
71
|
const outputs = modules.map(moduleName => {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/graphql-modules-preset",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.1.0",
|
|
4
4
|
"description": "GraphQL Code Generator preset for modularized schema",
|
|
5
5
|
"peerDependencies": {
|
|
6
6
|
"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"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@graphql-codegen/plugin-helpers": "^6.
|
|
10
|
-
"@graphql-codegen/visitor-plugin-common": "6.
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^6.1.0",
|
|
10
|
+
"@graphql-codegen/visitor-plugin-common": "6.2.0",
|
|
11
11
|
"@graphql-tools/utils": "^10.0.0",
|
|
12
12
|
"parse-filepath": "^1.0.2",
|
|
13
13
|
"change-case-all": "1.0.15",
|