@graphql-codegen/typescript-graphql-files-modules 2.2.1 → 3.0.0-alpha-20230524083052-08ce957b4
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 +1 -1
- package/esm/index.js +1 -1
- package/package.json +6 -3
- package/typings/index.d.cts +17 -8
- package/typings/index.d.ts +17 -8
package/cjs/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.validate = exports.plugin = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
|
-
const plugin = async (schema, documents, { modulePathPrefix = '', relativeToCwd, prefix = '*/', type = 'DocumentNode' }) => {
|
|
5
|
+
const plugin = async (schema, documents, { modulePathPrefix = '', relativeToCwd, prefix = '*/', type = 'DocumentNode', }) => {
|
|
6
6
|
const useRelative = relativeToCwd === true;
|
|
7
7
|
const mappedDocuments = documents.reduce((prev, documentRecord) => {
|
|
8
8
|
const fileName = useRelative
|
package/esm/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { basename, relative } from 'path';
|
|
2
|
-
export const plugin = async (schema, documents, { modulePathPrefix = '', relativeToCwd, prefix = '*/', type = 'DocumentNode' }) => {
|
|
2
|
+
export const plugin = async (schema, documents, { modulePathPrefix = '', relativeToCwd, prefix = '*/', type = 'DocumentNode', }) => {
|
|
3
3
|
const useRelative = relativeToCwd === true;
|
|
4
4
|
const mappedDocuments = documents.reduce((prev, documentRecord) => {
|
|
5
5
|
const fileName = useRelative
|
package/package.json
CHANGED
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphql-codegen/typescript-graphql-files-modules",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha-20230524083052-08ce957b4",
|
|
4
4
|
"description": "GraphQL Code Generator plugin for generating TypeScript module declarations based on GraphQL operations",
|
|
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": "^
|
|
9
|
+
"@graphql-codegen/plugin-helpers": "^3.0.0",
|
|
10
10
|
"tslib": "~2.4.0"
|
|
11
11
|
},
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
14
|
-
"url": "https://github.com/dotansimha/graphql-code-generator.git",
|
|
14
|
+
"url": "https://github.com/dotansimha/graphql-code-generator-community.git",
|
|
15
15
|
"directory": "packages/plugins/typescript/graphql-files-modules"
|
|
16
16
|
},
|
|
17
17
|
"license": "MIT",
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">= 16.0.0"
|
|
20
|
+
},
|
|
18
21
|
"main": "cjs/index.js",
|
|
19
22
|
"module": "esm/index.js",
|
|
20
23
|
"typings": "typings/index.d.ts",
|
package/typings/index.d.cts
CHANGED
|
@@ -14,14 +14,23 @@ export interface TypeScriptFilesModulesPluginConfig {
|
|
|
14
14
|
* between generated types.
|
|
15
15
|
*
|
|
16
16
|
* @exampleMarkdown
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
17
|
+
* ```ts filename="codegen.ts"
|
|
18
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
19
|
+
*
|
|
20
|
+
* const config: CodegenConfig = {
|
|
21
|
+
* // ...
|
|
22
|
+
* generates: {
|
|
23
|
+
* 'src/api/user-service/queries.d.ts': {
|
|
24
|
+
* documents: 'src/api/user-service/queries.graphql',
|
|
25
|
+
* plugins: ['typescript-graphql-files-modules'],
|
|
26
|
+
* config: {
|
|
27
|
+
* // resulting module definition path glob: "*\/api/user-service/queries.graphql"
|
|
28
|
+
* modulePathPrefix: "/api/user-service/",
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* };
|
|
33
|
+
* export default config;
|
|
25
34
|
* ```
|
|
26
35
|
*/
|
|
27
36
|
modulePathPrefix?: string;
|
package/typings/index.d.ts
CHANGED
|
@@ -14,14 +14,23 @@ export interface TypeScriptFilesModulesPluginConfig {
|
|
|
14
14
|
* between generated types.
|
|
15
15
|
*
|
|
16
16
|
* @exampleMarkdown
|
|
17
|
-
* ```
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
17
|
+
* ```ts filename="codegen.ts"
|
|
18
|
+
* import type { CodegenConfig } from '@graphql-codegen/cli';
|
|
19
|
+
*
|
|
20
|
+
* const config: CodegenConfig = {
|
|
21
|
+
* // ...
|
|
22
|
+
* generates: {
|
|
23
|
+
* 'src/api/user-service/queries.d.ts': {
|
|
24
|
+
* documents: 'src/api/user-service/queries.graphql',
|
|
25
|
+
* plugins: ['typescript-graphql-files-modules'],
|
|
26
|
+
* config: {
|
|
27
|
+
* // resulting module definition path glob: "*\/api/user-service/queries.graphql"
|
|
28
|
+
* modulePathPrefix: "/api/user-service/",
|
|
29
|
+
* },
|
|
30
|
+
* },
|
|
31
|
+
* },
|
|
32
|
+
* };
|
|
33
|
+
* export default config;
|
|
25
34
|
* ```
|
|
26
35
|
*/
|
|
27
36
|
modulePathPrefix?: string;
|