@graphcommerce/graphql-codegen-near-operation-file 3.0.14 → 3.0.17

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.
@@ -128,6 +128,7 @@ function buildFragmentResolver(collectorOptions, presetOptions, schemaObject) {
128
128
  path: fragmentsFilePath,
129
129
  identifiers: identifiers,
130
130
  },
131
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
131
132
  typesImport: typesImport,
132
133
  });
133
134
  }),
@@ -85,6 +85,7 @@ function resolveDocumentImports(presetOptions, schemaObject, importResolverOptio
85
85
  if ((0, plugin_helpers_1.isUsingTypes)(documentFile.document, [], schemaObject)) {
86
86
  var schemaTypesImportStatement = (0, visitor_plugin_common_1.generateImportStatement)({
87
87
  baseDir: baseDir,
88
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
88
89
  importSource: (0, visitor_plugin_common_1.resolveImportSource)(schemaTypesSource),
89
90
  baseOutputDir: baseOutputDir,
90
91
  outputPath: generatedFilePath_1,
@@ -109,6 +110,7 @@ function resolveDocumentImports(presetOptions, schemaObject, importResolverOptio
109
110
  var schemaTypesImportStatement = (0, visitor_plugin_common_1.generateImportStatement)({
110
111
  baseDir: baseDir,
111
112
  importSource: (0, visitor_plugin_common_1.resolveImportSource)(schemaTypesSource),
113
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
112
114
  baseOutputDir: baseOutputDir,
113
115
  outputPath: generatedFilePath,
114
116
  typesImport: typesImport,
@@ -133,7 +135,7 @@ function resolveDocumentImports(presetOptions, schemaObject, importResolverOptio
133
135
  }
134
136
  });
135
137
  return resDocuments.filter(function (result) {
136
- return result.filename.startsWith((0, path_1.resolve)(baseDir, baseOutputDir));
138
+ return result.filename.startsWith((0, path_1.resolve)(baseDir, baseOutputDir).replace(/\\/g, '/'));
137
139
  });
138
140
  }
139
141
  exports.resolveDocumentImports = resolveDocumentImports;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/graphql-codegen-near-operation-file",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.0.14",
5
+ "version": "3.0.17",
6
6
  "sideEffects": false,
7
7
  "main": "dist/index.js",
8
8
  "files": [
@@ -22,15 +22,15 @@
22
22
  }
23
23
  },
24
24
  "devDependencies": {
25
- "@graphcommerce/eslint-config-pwa": "^4.1.8",
25
+ "@graphcommerce/eslint-config-pwa": "^4.1.10",
26
26
  "@graphcommerce/prettier-config-pwa": "^4.0.6",
27
- "@graphcommerce/typescript-config-pwa": "^4.0.3",
27
+ "@graphcommerce/typescript-config-pwa": "^4.0.4",
28
28
  "@playwright/test": "^1.21.1"
29
29
  },
30
30
  "dependencies": {
31
- "@graphql-codegen/add": "3.1.1",
32
- "@graphql-codegen/plugin-helpers": "2.4.2",
33
- "@graphql-codegen/visitor-plugin-common": "2.9.0",
31
+ "@graphql-codegen/add": "3.2.1",
32
+ "@graphql-codegen/plugin-helpers": "2.6.2",
33
+ "@graphql-codegen/visitor-plugin-common": "2.12.1",
34
34
  "@types/parse-filepath": "^1.0.0",
35
35
  "graphql": "16.5.0",
36
36
  "parse-filepath": "^1.0.2"
@@ -186,6 +186,7 @@ export default function buildFragmentResolver<T>(
186
186
  path: fragmentsFilePath,
187
187
  identifiers,
188
188
  },
189
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
189
190
  typesImport,
190
191
  }),
191
192
  ),
@@ -105,6 +105,7 @@ export function resolveDocumentImports<T>(
105
105
  if (isUsingTypes(documentFile.document!, [], schemaObject)) {
106
106
  const schemaTypesImportStatement = generateImportStatement({
107
107
  baseDir,
108
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
108
109
  importSource: resolveImportSource(schemaTypesSource),
109
110
  baseOutputDir,
110
111
  outputPath: generatedFilePath,
@@ -142,6 +143,7 @@ export function resolveDocumentImports<T>(
142
143
  const schemaTypesImportStatement = generateImportStatement({
143
144
  baseDir,
144
145
  importSource: resolveImportSource(schemaTypesSource),
146
+ emitLegacyCommonJSImports: presetOptions.config.emitLegacyCommonJSImports,
145
147
  baseOutputDir,
146
148
  outputPath: generatedFilePath,
147
149
  typesImport,
@@ -170,6 +172,6 @@ export function resolveDocumentImports<T>(
170
172
  })
171
173
 
172
174
  return resDocuments.filter((result) =>
173
- result.filename.startsWith(resolve(baseDir, baseOutputDir)),
175
+ result.filename.startsWith(resolve(baseDir, baseOutputDir).replace(/\\/g, '/')),
174
176
  )
175
177
  }