@eddeee888/gcg-typescript-resolver-files 0.18.2 → 0.18.4
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.
|
@@ -98,16 +98,16 @@ export const postProcessFiles = ({ config: { tsMorph: { project }, fixObjectType
|
|
|
98
98
|
}
|
|
99
99
|
});
|
|
100
100
|
});
|
|
101
|
+
// 4. Apply to result files the updated content done in step 2. and 3. above
|
|
102
|
+
sourceFilesToProcess.forEach(({ sourceFile, resolverFile }) => {
|
|
103
|
+
const normalizedRelativePath = path.posix.relative(cwd(), sourceFile.getFilePath());
|
|
104
|
+
// Overwrite existing files with fixes
|
|
105
|
+
result.files[normalizedRelativePath] = {
|
|
106
|
+
...resolverFile,
|
|
107
|
+
content: sourceFile.getText(),
|
|
108
|
+
};
|
|
109
|
+
});
|
|
101
110
|
}
|
|
102
|
-
// 4. Apply to result files the updated content done in step 2. and 3. above
|
|
103
|
-
sourceFilesToProcess.forEach(({ sourceFile, resolverFile }) => {
|
|
104
|
-
const normalizedRelativePath = path.posix.relative(cwd(), sourceFile.getFilePath());
|
|
105
|
-
// Overwrite existing files with fixes
|
|
106
|
-
result.files[normalizedRelativePath] = {
|
|
107
|
-
...resolverFile,
|
|
108
|
-
content: sourceFile.getText(),
|
|
109
|
-
};
|
|
110
|
-
});
|
|
111
111
|
};
|
|
112
112
|
/**
|
|
113
113
|
* Ensure correctly named resolvers are exported
|
package/dist/preset.js
CHANGED
|
@@ -18,6 +18,7 @@ import { validateAndMergeParsedConfigs } from './validateAndMergeParsedConfigs/i
|
|
|
18
18
|
import { normalizeAddConfigPath } from './normalizeAddConfigPath/index.js';
|
|
19
19
|
import { logger } from './utils/index.js';
|
|
20
20
|
export const presetName = '@eddeee888/gcg-typescript-resolver-files';
|
|
21
|
+
let tsMorphProject;
|
|
21
22
|
export const preset = {
|
|
22
23
|
buildGeneratesSection: async ({ schema, schemaAst, presetConfig: rawPresetConfig, baseOutputDir, config: baseConfig, profiler = createNoopProfiler(), }) => {
|
|
23
24
|
if (!schemaAst) {
|
|
@@ -35,7 +36,16 @@ export const preset = {
|
|
|
35
36
|
baseOutputDir,
|
|
36
37
|
moduleNamingMode,
|
|
37
38
|
});
|
|
38
|
-
|
|
39
|
+
if (!tsMorphProject) {
|
|
40
|
+
tsMorphProject = await profiler.run(async () => new Project(tsMorphProjectOptions), createProfilerRunName('Initialising ts-morph project'));
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
await profiler.run(async () => {
|
|
44
|
+
tsMorphProject
|
|
45
|
+
.getSourceFiles()
|
|
46
|
+
.forEach((sourceFile) => sourceFile.refreshFromFileSystemSync());
|
|
47
|
+
}, createProfilerRunName('Refreshing ts-morph project files'));
|
|
48
|
+
}
|
|
39
49
|
const typeMappersMap = await profiler.run(async () => parseTypeMappers({
|
|
40
50
|
sourceMap,
|
|
41
51
|
resolverTypesPath,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eddeee888/gcg-typescript-resolver-files",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.4",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/eddeee888/graphql-code-generator-plugins.git",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
43
|
"@graphql-codegen/add": "^7.1.0",
|
|
44
|
-
"@graphql-codegen/plugin-helpers": "^7.2.
|
|
44
|
+
"@graphql-codegen/plugin-helpers": "^7.2.1",
|
|
45
45
|
"@graphql-codegen/schema-ast": "^6.1.0",
|
|
46
46
|
"@graphql-codegen/typescript": "^6.1.0",
|
|
47
47
|
"@graphql-codegen/typescript-resolvers": "^6.1.0",
|