@graphql-codegen/gql-tag-operations 1.2.16 → 1.3.0-alpha-2fbcdb6d3.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.
@@ -1,7 +1,6 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.plugin = void 0;
5
4
  const documentTypePartial = `
6
5
  export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<
7
6
  infer TType,
@@ -16,7 +15,7 @@ const plugin = (_, __, { sourcesWithOperations, useTypeImports, augmentedModuleN
16
15
  }
17
16
  if (augmentedModuleName == null) {
18
17
  return [
19
- `import * as graphql from './graphql';\n`,
18
+ `import * as graphql from './graphql.js';\n`,
20
19
  `${useTypeImports ? 'import type' : 'import'} { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n`,
21
20
  `\n`,
22
21
  ...getDocumentRegistryChunk(sourcesWithOperations),
@@ -46,6 +45,7 @@ const plugin = (_, __, { sourcesWithOperations, useTypeImports, augmentedModuleN
46
45
  `}`,
47
46
  ].join(`\n`);
48
47
  };
48
+ exports.plugin = plugin;
49
49
  function getDocumentRegistryChunk(sourcesWithOperations = []) {
50
50
  const lines = new Set();
51
51
  lines.add(`const documents = {\n`);
@@ -70,5 +70,3 @@ function getGqlOverloadChunk(sourcesWithOperations, mode) {
70
70
  }
71
71
  return lines;
72
72
  }
73
-
74
- exports.plugin = plugin;
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
@@ -6,13 +6,13 @@ export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocume
6
6
  ? TType
7
7
  : never;
8
8
  `.split(`\n`);
9
- const plugin = (_, __, { sourcesWithOperations, useTypeImports, augmentedModuleName }, _info) => {
9
+ export const plugin = (_, __, { sourcesWithOperations, useTypeImports, augmentedModuleName }, _info) => {
10
10
  if (!sourcesWithOperations) {
11
11
  return '';
12
12
  }
13
13
  if (augmentedModuleName == null) {
14
14
  return [
15
- `import * as graphql from './graphql';\n`,
15
+ `import * as graphql from './graphql.js';\n`,
16
16
  `${useTypeImports ? 'import type' : 'import'} { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';\n`,
17
17
  `\n`,
18
18
  ...getDocumentRegistryChunk(sourcesWithOperations),
@@ -66,5 +66,3 @@ function getGqlOverloadChunk(sourcesWithOperations, mode) {
66
66
  }
67
67
  return lines;
68
68
  }
69
-
70
- export { plugin };
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@graphql-codegen/gql-tag-operations",
3
- "version": "1.2.16",
3
+ "version": "1.3.0-alpha-2fbcdb6d3.0",
4
4
  "description": "GraphQL Code Generator plugin for generating a typed gql tag function",
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
  "graphql-tag": "^2.0.0"
8
8
  },
9
9
  "dependencies": {
10
- "@graphql-codegen/plugin-helpers": "^2.4.0",
11
- "@graphql-codegen/visitor-plugin-common": "2.9.1",
12
- "@graphql-tools/utils": "^8.1.1",
10
+ "@graphql-tools/utils": "^8.8.0",
11
+ "@graphql-codegen/plugin-helpers": "^2.5.0-alpha-2fbcdb6d3.0",
12
+ "@graphql-codegen/visitor-plugin-common": "2.11.0-alpha-2fbcdb6d3.0",
13
13
  "auto-bind": "~4.0.0",
14
14
  "tslib": "~2.4.0"
15
15
  },
@@ -19,21 +19,28 @@
19
19
  "directory": "packages/plugins/typescript/gql-tag-operations"
20
20
  },
21
21
  "license": "MIT",
22
- "main": "index.js",
23
- "module": "index.mjs",
24
- "typings": "index.d.ts",
22
+ "main": "cjs/index.js",
23
+ "module": "esm/index.js",
24
+ "typings": "typings/index.d.ts",
25
25
  "typescript": {
26
- "definition": "index.d.ts"
26
+ "definition": "typings/index.d.ts"
27
27
  },
28
+ "type": "module",
28
29
  "exports": {
29
- "./package.json": "./package.json",
30
30
  ".": {
31
- "require": "./index.js",
32
- "import": "./index.mjs"
31
+ "require": {
32
+ "types": "./typings/index.d.ts",
33
+ "default": "./cjs/index.js"
34
+ },
35
+ "import": {
36
+ "types": "./typings/index.d.ts",
37
+ "default": "./esm/index.js"
38
+ },
39
+ "default": {
40
+ "types": "./typings/index.d.ts",
41
+ "default": "./esm/index.js"
42
+ }
33
43
  },
34
- "./*": {
35
- "require": "./*.js",
36
- "import": "./*.mjs"
37
- }
44
+ "./package.json": "./package.json"
38
45
  }
39
- }
46
+ }
File without changes