@graphql-codegen/client-preset 5.2.0-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb → 6.0.0-alpha-20251115121823-72e57eca5d8e2e6ae9a642532cf4c41692466f7c

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
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.plugin = void 0;
4
- const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
5
4
  const fragmentTypeHelper = `
6
5
  export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
7
6
  infer TType,
@@ -112,13 +111,9 @@ export function isFragmentReady<TQuery, TFrag>(
112
111
  /**
113
112
  * Plugin for generating fragment masking helper functions.
114
113
  */
115
- const plugin = (_, __, { useTypeImports, augmentedModuleName, unmaskFunctionName, emitLegacyCommonJSImports, importExtension, isStringDocumentMode, }, _info) => {
116
- const appendedImportExtension = (0, plugin_helpers_1.normalizeImportExtension)({
117
- emitLegacyCommonJSImports,
118
- importExtension,
119
- });
114
+ const plugin = (_, __, { useTypeImports, augmentedModuleName, unmaskFunctionName, emitLegacyCommonJSImports, isStringDocumentMode }, _info) => {
120
115
  const documentNodeImport = `${useTypeImports ? 'import type' : 'import'} { ResultOf, DocumentTypeDecoration${isStringDocumentMode ? '' : ', TypedDocumentNode'} } from '@graphql-typed-document-node/core';\n`;
121
- const deferFragmentHelperImports = `${useTypeImports ? 'import type' : 'import'} { Incremental${isStringDocumentMode ? ', TypedDocumentString' : ''} } from './graphql${appendedImportExtension}';\n`;
116
+ const deferFragmentHelperImports = `${useTypeImports ? 'import type' : 'import'} { Incremental${isStringDocumentMode ? ', TypedDocumentString' : ''} } from './graphql${emitLegacyCommonJSImports ? '' : '.js'}';\n`;
122
117
  const fragmentDefinitionNodeImport = isStringDocumentMode
123
118
  ? ''
124
119
  : `${useTypeImports ? 'import type' : 'import'} { FragmentDefinitionNode } from 'graphql';\n`;
package/cjs/index.js CHANGED
@@ -4,7 +4,6 @@ exports.addTypenameSelectionDocumentTransform = exports.preset = exports.babelOp
4
4
  const tslib_1 = require("tslib");
5
5
  const addPlugin = tslib_1.__importStar(require("@graphql-codegen/add"));
6
6
  const gqlTagPlugin = tslib_1.__importStar(require("@graphql-codegen/gql-tag-operations"));
7
- const plugin_helpers_1 = require("@graphql-codegen/plugin-helpers");
8
7
  const typedDocumentNodePlugin = tslib_1.__importStar(require("@graphql-codegen/typed-document-node"));
9
8
  const typescriptPlugin = tslib_1.__importStar(require("@graphql-codegen/typescript"));
10
9
  const typescriptOperationPlugin = tslib_1.__importStar(require("@graphql-codegen/typescript-operations"));
@@ -143,10 +142,6 @@ exports.preset = {
143
142
  inlineFragmentTypes: isMaskingFragments ? 'mask' : options.config['inlineFragmentTypes'],
144
143
  };
145
144
  let fragmentMaskingFileGenerateConfig = null;
146
- const importExtension = (0, plugin_helpers_1.normalizeImportExtension)({
147
- emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
148
- importExtension: options.config.importExtension,
149
- });
150
145
  if (isMaskingFragments === true) {
151
146
  const fragmentMaskingArtifactFileExtension = '.ts';
152
147
  reexports.push('fragment-masking');
@@ -167,7 +162,6 @@ exports.preset = {
167
162
  useTypeImports: options.config.useTypeImports,
168
163
  unmaskFunctionName: fragmentMaskingConfig.unmaskFunctionName,
169
164
  emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
170
- importExtension,
171
165
  isStringDocumentMode: options.config.documentMode === visitor_plugin_common_1.DocumentMode.string,
172
166
  },
173
167
  documents: [],
@@ -175,6 +169,7 @@ exports.preset = {
175
169
  };
176
170
  }
177
171
  let indexFileGenerateConfig = null;
172
+ const reexportsExtension = options.config.emitLegacyCommonJSImports ? '' : '.js';
178
173
  if (reexports.length) {
179
174
  indexFileGenerateConfig = {
180
175
  filename: `${options.baseOutputDir}index.ts`,
@@ -186,7 +181,7 @@ exports.preset = {
186
181
  [`add`]: {
187
182
  content: reexports
188
183
  .sort()
189
- .map(moduleName => `export * from "./${moduleName}${importExtension}";`)
184
+ .map(moduleName => `export * from "./${moduleName}${reexportsExtension}";`)
190
185
  .join('\n'),
191
186
  },
192
187
  },
@@ -1,4 +1,3 @@
1
- import { normalizeImportExtension } from '@graphql-codegen/plugin-helpers';
2
1
  const fragmentTypeHelper = `
3
2
  export type FragmentType<TDocumentType extends DocumentTypeDecoration<any, any>> = TDocumentType extends DocumentTypeDecoration<
4
3
  infer TType,
@@ -109,13 +108,9 @@ export function isFragmentReady<TQuery, TFrag>(
109
108
  /**
110
109
  * Plugin for generating fragment masking helper functions.
111
110
  */
112
- export const plugin = (_, __, { useTypeImports, augmentedModuleName, unmaskFunctionName, emitLegacyCommonJSImports, importExtension, isStringDocumentMode, }, _info) => {
113
- const appendedImportExtension = normalizeImportExtension({
114
- emitLegacyCommonJSImports,
115
- importExtension,
116
- });
111
+ export const plugin = (_, __, { useTypeImports, augmentedModuleName, unmaskFunctionName, emitLegacyCommonJSImports, isStringDocumentMode }, _info) => {
117
112
  const documentNodeImport = `${useTypeImports ? 'import type' : 'import'} { ResultOf, DocumentTypeDecoration${isStringDocumentMode ? '' : ', TypedDocumentNode'} } from '@graphql-typed-document-node/core';\n`;
118
- const deferFragmentHelperImports = `${useTypeImports ? 'import type' : 'import'} { Incremental${isStringDocumentMode ? ', TypedDocumentString' : ''} } from './graphql${appendedImportExtension}';\n`;
113
+ const deferFragmentHelperImports = `${useTypeImports ? 'import type' : 'import'} { Incremental${isStringDocumentMode ? ', TypedDocumentString' : ''} } from './graphql${emitLegacyCommonJSImports ? '' : '.js'}';\n`;
119
114
  const fragmentDefinitionNodeImport = isStringDocumentMode
120
115
  ? ''
121
116
  : `${useTypeImports ? 'import type' : 'import'} { FragmentDefinitionNode } from 'graphql';\n`;
package/esm/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import * as addPlugin from '@graphql-codegen/add';
2
2
  import * as gqlTagPlugin from '@graphql-codegen/gql-tag-operations';
3
- import { normalizeImportExtension } from '@graphql-codegen/plugin-helpers';
4
3
  import * as typedDocumentNodePlugin from '@graphql-codegen/typed-document-node';
5
4
  import * as typescriptPlugin from '@graphql-codegen/typescript';
6
5
  import * as typescriptOperationPlugin from '@graphql-codegen/typescript-operations';
@@ -138,10 +137,6 @@ export const preset = {
138
137
  inlineFragmentTypes: isMaskingFragments ? 'mask' : options.config['inlineFragmentTypes'],
139
138
  };
140
139
  let fragmentMaskingFileGenerateConfig = null;
141
- const importExtension = normalizeImportExtension({
142
- emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
143
- importExtension: options.config.importExtension,
144
- });
145
140
  if (isMaskingFragments === true) {
146
141
  const fragmentMaskingArtifactFileExtension = '.ts';
147
142
  reexports.push('fragment-masking');
@@ -162,7 +157,6 @@ export const preset = {
162
157
  useTypeImports: options.config.useTypeImports,
163
158
  unmaskFunctionName: fragmentMaskingConfig.unmaskFunctionName,
164
159
  emitLegacyCommonJSImports: options.config.emitLegacyCommonJSImports,
165
- importExtension,
166
160
  isStringDocumentMode: options.config.documentMode === DocumentMode.string,
167
161
  },
168
162
  documents: [],
@@ -170,6 +164,7 @@ export const preset = {
170
164
  };
171
165
  }
172
166
  let indexFileGenerateConfig = null;
167
+ const reexportsExtension = options.config.emitLegacyCommonJSImports ? '' : '.js';
173
168
  if (reexports.length) {
174
169
  indexFileGenerateConfig = {
175
170
  filename: `${options.baseOutputDir}index.ts`,
@@ -181,7 +176,7 @@ export const preset = {
181
176
  [`add`]: {
182
177
  content: reexports
183
178
  .sort()
184
- .map(moduleName => `export * from "./${moduleName}${importExtension}";`)
179
+ .map(moduleName => `export * from "./${moduleName}${reexportsExtension}";`)
185
180
  .join('\n'),
186
181
  },
187
182
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-codegen/client-preset",
3
- "version": "5.2.0-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
3
+ "version": "6.0.0-alpha-20251115121823-72e57eca5d8e2e6ae9a642532cf4c41692466f7c",
4
4
  "description": "GraphQL Code Generator preset for client.",
5
5
  "peerDependenciesMeta": {
6
6
  "graphql-sock": {
@@ -15,12 +15,12 @@
15
15
  "@babel/helper-plugin-utils": "^7.20.2",
16
16
  "@babel/template": "^7.20.7",
17
17
  "@graphql-codegen/add": "^6.0.0",
18
- "@graphql-codegen/typed-document-node": "6.1.3-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
19
- "@graphql-codegen/typescript": "5.0.5-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
20
- "@graphql-codegen/typescript-operations": "5.0.5-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
21
- "@graphql-codegen/gql-tag-operations": "5.1.0-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
22
- "@graphql-codegen/plugin-helpers": "6.1.0-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
23
- "@graphql-codegen/visitor-plugin-common": "6.2.0-alpha-20251119131248-4aa0bce27decc294509fae591f5c2236858abdbb",
18
+ "@graphql-codegen/typed-document-node": "^6.1.2",
19
+ "@graphql-codegen/typescript": "6.0.0-alpha-20251115121823-72e57eca5d8e2e6ae9a642532cf4c41692466f7c",
20
+ "@graphql-codegen/typescript-operations": "6.0.0-alpha-20251115121823-72e57eca5d8e2e6ae9a642532cf4c41692466f7c",
21
+ "@graphql-codegen/gql-tag-operations": "5.0.5",
22
+ "@graphql-codegen/plugin-helpers": "^6.0.0",
23
+ "@graphql-codegen/visitor-plugin-common": "^6.1.2",
24
24
  "@graphql-typed-document-node/core": "3.2.0",
25
25
  "@graphql-tools/documents": "^1.0.0",
26
26
  "@graphql-tools/utils": "^10.0.0",
@@ -1,4 +1,4 @@
1
- import { type PluginFunction } from '@graphql-codegen/plugin-helpers';
1
+ import type { PluginFunction } from '@graphql-codegen/plugin-helpers';
2
2
  /**
3
3
  * Plugin for generating fragment masking helper functions.
4
4
  */
@@ -7,6 +7,5 @@ export declare const plugin: PluginFunction<{
7
7
  augmentedModuleName?: string;
8
8
  unmaskFunctionName?: string;
9
9
  emitLegacyCommonJSImports?: boolean;
10
- importExtension?: '' | `.${string}`;
11
10
  isStringDocumentMode?: boolean;
12
11
  }>;
@@ -1,4 +1,4 @@
1
- import { type PluginFunction } from '@graphql-codegen/plugin-helpers';
1
+ import type { PluginFunction } from '@graphql-codegen/plugin-helpers';
2
2
  /**
3
3
  * Plugin for generating fragment masking helper functions.
4
4
  */
@@ -7,6 +7,5 @@ export declare const plugin: PluginFunction<{
7
7
  augmentedModuleName?: string;
8
8
  unmaskFunctionName?: string;
9
9
  emitLegacyCommonJSImports?: boolean;
10
- importExtension?: '' | `.${string}`;
11
10
  isStringDocumentMode?: boolean;
12
11
  }>;
@@ -1,4 +1,4 @@
1
- import { type Types } from '@graphql-codegen/plugin-helpers';
1
+ import type { Types } from '@graphql-codegen/plugin-helpers';
2
2
  import { type DocumentNode } from 'graphql';
3
3
  export { default as babelOptimizerPlugin } from './babel.cjs';
4
4
  export type FragmentMaskingConfig = {
@@ -1,4 +1,4 @@
1
- import { type Types } from '@graphql-codegen/plugin-helpers';
1
+ import type { Types } from '@graphql-codegen/plugin-helpers';
2
2
  import { type DocumentNode } from 'graphql';
3
3
  export { default as babelOptimizerPlugin } from './babel.js';
4
4
  export type FragmentMaskingConfig = {