@baeta/plugin-graphql 2.0.0-next.11 → 2.0.0-next.12
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/CHANGELOG.md +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +25 -36
- package/dist/index.js.map +1 -1
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import * as _baeta_generator_sdk0 from "@baeta/generator-sdk";
|
|
1
|
+
import * as _$_baeta_generator_sdk0 from "@baeta/generator-sdk";
|
|
2
2
|
|
|
3
3
|
//#region index.d.ts
|
|
4
|
-
declare function graphqlPlugin(): _baeta_generator_sdk0.GeneratorPluginV1<unknown>;
|
|
4
|
+
declare function graphqlPlugin(): _$_baeta_generator_sdk0.GeneratorPluginV1<unknown>;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { graphqlPlugin };
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { createPluginV1, isMatch } from "@baeta/generator-sdk";
|
|
2
|
-
import { join, normalize,
|
|
2
|
+
import { join, normalize, posixPath, relative } from "@baeta/util-path";
|
|
3
3
|
import { Kind, concatAST, validateSchema, visit } from "graphql";
|
|
4
4
|
import { GraphQLFileLoader } from "@graphql-tools/graphql-file-loader";
|
|
5
5
|
import { loadSchema } from "@graphql-tools/load";
|
|
6
6
|
import { getDocumentNodeFromSchema } from "@graphql-tools/utils";
|
|
7
7
|
import { camelCase, pascalCase } from "change-case-all";
|
|
8
|
-
|
|
9
8
|
//#region utils/load.ts
|
|
10
9
|
async function loadSchema$1(schemas, cwd, extraLoaders = []) {
|
|
11
10
|
const schemaPointerMap = {};
|
|
@@ -27,12 +26,11 @@ async function loadSchema$1(schemas, cwd, extraLoaders = []) {
|
|
|
27
26
|
outputSchema: getDocumentNodeFromSchema(outputSchemaAst)
|
|
28
27
|
};
|
|
29
28
|
}
|
|
30
|
-
|
|
31
29
|
//#endregion
|
|
32
30
|
//#region utils/path.ts
|
|
33
31
|
const sep = "/";
|
|
34
32
|
function getRelativePath(filepath, basePath) {
|
|
35
|
-
const normalizedFilepath = normalize(filepath);
|
|
33
|
+
const normalizedFilepath = ensureStartsWithSeparator(ensureEndsWithSeparator(normalize(filepath)));
|
|
36
34
|
const normalizedBasePath = ensureStartsWithSeparator(ensureEndsWithSeparator(normalize(basePath)));
|
|
37
35
|
const [, relativePath] = normalizedFilepath.split(normalizedBasePath);
|
|
38
36
|
return relativePath;
|
|
@@ -41,13 +39,12 @@ function extractModuleDirectory(relativePath) {
|
|
|
41
39
|
const [moduleDirectory] = relativePath.split(sep);
|
|
42
40
|
return moduleDirectory;
|
|
43
41
|
}
|
|
44
|
-
function ensureStartsWithSeparator(path
|
|
45
|
-
return path
|
|
42
|
+
function ensureStartsWithSeparator(path) {
|
|
43
|
+
return path.startsWith(sep) ? path : sep + path;
|
|
46
44
|
}
|
|
47
|
-
function ensureEndsWithSeparator(path
|
|
48
|
-
return path
|
|
45
|
+
function ensureEndsWithSeparator(path) {
|
|
46
|
+
return path.endsWith(sep) ? path : path + sep;
|
|
49
47
|
}
|
|
50
|
-
|
|
51
48
|
//#endregion
|
|
52
49
|
//#region utils/source.ts
|
|
53
50
|
function groupSourcesByModule(sources, basePath) {
|
|
@@ -66,7 +63,6 @@ function groupSourcesByModule(sources, basePath) {
|
|
|
66
63
|
function getSourcesFromSchema(schema) {
|
|
67
64
|
return schema.extensions?.extendedSources ?? [];
|
|
68
65
|
}
|
|
69
|
-
|
|
70
66
|
//#endregion
|
|
71
67
|
//#region lib/printer/printer-autoload.ts
|
|
72
68
|
function printAutoload(config, modules) {
|
|
@@ -74,7 +70,7 @@ function printAutoload(config, modules) {
|
|
|
74
70
|
}
|
|
75
71
|
function printImports(config, modules) {
|
|
76
72
|
const dependencyImports = ["import type { ModuleCompilerFactory } from \"@baeta/core/sdk\";", `import type { Ctx, Info } from "./types${config.importExtension}"`];
|
|
77
|
-
const moduleTypeImports = modules.map((module) => `import type { BaetaModuleTypes as ${pascalCase(module)}ModuleTypes } from "./${module}
|
|
73
|
+
const moduleTypeImports = modules.map((module) => `import type { BaetaModuleTypes as ${pascalCase(module)}ModuleTypes } from "./${module}/${config.moduleDefinitionName}${config.importExtension}"`);
|
|
78
74
|
const moduleImports = modules.flatMap((module) => `import ${camelCase(module)} from "./${module}/index${config.importExtension}"`);
|
|
79
75
|
return [
|
|
80
76
|
...dependencyImports,
|
|
@@ -88,7 +84,6 @@ function printExport(modules) {
|
|
|
88
84
|
function printModuleWithSatisfies(module) {
|
|
89
85
|
return ` ${camelCase(module)} satisfies ModuleCompilerFactory<Ctx, Info, ${pascalCase(module)}ModuleTypes["Factories"]>`;
|
|
90
86
|
}
|
|
91
|
-
|
|
92
87
|
//#endregion
|
|
93
88
|
//#region lib/printer/printer-utils.ts
|
|
94
89
|
function buildBlock({ name, lines }) {
|
|
@@ -118,7 +113,6 @@ function makeRelativePathForImport(from, to) {
|
|
|
118
113
|
if (res.startsWith(".") || res.startsWith("/")) return res;
|
|
119
114
|
return `./${res}`;
|
|
120
115
|
}
|
|
121
|
-
|
|
122
116
|
//#endregion
|
|
123
117
|
//#region lib/printer/printer-module.ts
|
|
124
118
|
function printModuleIndexStarter(config, moduleName) {
|
|
@@ -168,8 +162,7 @@ function printModuleIndexDestructuredTypes(moduleName, types) {
|
|
|
168
162
|
}
|
|
169
163
|
function printModuleIndexImports(config, moduleName) {
|
|
170
164
|
const hasScalars = config.registry.defined.scalars.length > 0;
|
|
171
|
-
const
|
|
172
|
-
const moduleImport = `import { ${pascalCase(moduleName)}Module } from "./${typedef}";`;
|
|
165
|
+
const moduleImport = `import { ${pascalCase(moduleName)}Module } from "./${config.moduleDefinitionName}${config.importExtension}";`;
|
|
173
166
|
if (!hasScalars) return moduleImport;
|
|
174
167
|
return [`import { GraphQLScalarType } from "graphql";`, moduleImport].join("\n");
|
|
175
168
|
}
|
|
@@ -309,7 +302,6 @@ function getInfoType() {
|
|
|
309
302
|
function getExtensionsVar() {
|
|
310
303
|
return "extensions";
|
|
311
304
|
}
|
|
312
|
-
|
|
313
305
|
//#endregion
|
|
314
306
|
//#region lib/printer/printer-templates.ts
|
|
315
307
|
function printTypesTemplate(options) {
|
|
@@ -331,13 +323,11 @@ function printExtensionsTemplate() {
|
|
|
331
323
|
export default createExtensions({});
|
|
332
324
|
`;
|
|
333
325
|
}
|
|
334
|
-
|
|
335
326
|
//#endregion
|
|
336
327
|
//#region utils/scalar.ts
|
|
337
328
|
function isScalarType(definitionsMap, defaultScalars, type) {
|
|
338
329
|
return definitionsMap.scalarTypeMap.has(type.name.value) || defaultScalars.includes(type.name.value);
|
|
339
330
|
}
|
|
340
|
-
|
|
341
331
|
//#endregion
|
|
342
332
|
//#region lib/printer/printer-types.ts
|
|
343
333
|
function printUtilityTypes() {
|
|
@@ -412,7 +402,7 @@ function printUnionTypesFromMap(config, map) {
|
|
|
412
402
|
return [...map.values()].map((type) => printUnionType(config, type));
|
|
413
403
|
}
|
|
414
404
|
function printUnionType(config, type) {
|
|
415
|
-
const types = type.types?.map((type
|
|
405
|
+
const types = type.types?.map((type) => printNamedTypeForUnion(config, type));
|
|
416
406
|
return `export type ${type.name.value} = ${types?.join(" | ") || "never"}`;
|
|
417
407
|
}
|
|
418
408
|
function printNamedTypeForUnion(config, type) {
|
|
@@ -477,7 +467,6 @@ function printOptionalMarker(config, type) {
|
|
|
477
467
|
function printOrObjectType(type, fields) {
|
|
478
468
|
return `BaetaUtility.Or<BaetaOverrides.ObjectTypes["${type.name.value}"], {\n${fields?.map(indent(2)).join("\n") ?? ""}\n}>`;
|
|
479
469
|
}
|
|
480
|
-
|
|
481
470
|
//#endregion
|
|
482
471
|
//#region lib/visitors/definitions-map.ts
|
|
483
472
|
function createRegistry() {
|
|
@@ -533,7 +522,6 @@ function collectTypesFromDocument(document, registry, filterObjectTypes = []) {
|
|
|
533
522
|
}
|
|
534
523
|
});
|
|
535
524
|
}
|
|
536
|
-
|
|
537
525
|
//#endregion
|
|
538
526
|
//#region lib/visitors/field-info.ts
|
|
539
527
|
function createFieldInfoMap(definitionsMap, defaultScalars) {
|
|
@@ -565,7 +553,6 @@ function printNamedType(definitionsMap, defaultScalars, type, nullable = true) {
|
|
|
565
553
|
default: return type;
|
|
566
554
|
}
|
|
567
555
|
}
|
|
568
|
-
|
|
569
556
|
//#endregion
|
|
570
557
|
//#region lib/visitors/module-registry.ts
|
|
571
558
|
const registryKeys = [
|
|
@@ -625,10 +612,9 @@ function createObject(keys, valueFn) {
|
|
|
625
612
|
for (const key of keys) obj[key] = valueFn(key);
|
|
626
613
|
return obj;
|
|
627
614
|
}
|
|
628
|
-
|
|
629
615
|
//#endregion
|
|
630
616
|
//#region lib/codegen.ts
|
|
631
|
-
async function generate(options) {
|
|
617
|
+
async function generate(options, currentFiles) {
|
|
632
618
|
const { outputSchema, outputSchemaAst } = await loadSchema$1(options.schemas, options.cwd, options.loaders);
|
|
633
619
|
const sources = getSourcesFromSchema(outputSchemaAst);
|
|
634
620
|
const sourcesByModule = groupSourcesByModule(sources, options.modulesDir);
|
|
@@ -682,7 +668,10 @@ async function generate(options) {
|
|
|
682
668
|
},
|
|
683
669
|
{
|
|
684
670
|
filename: join(options.modulesDir, "index.ts"),
|
|
685
|
-
content: printAutoload({
|
|
671
|
+
content: printAutoload({
|
|
672
|
+
importExtension: options.importExtension,
|
|
673
|
+
moduleDefinitionName: options.moduleDefinitionName
|
|
674
|
+
}, modules)
|
|
686
675
|
},
|
|
687
676
|
{
|
|
688
677
|
filename: join(options.modulesDir, "types.ts"),
|
|
@@ -715,7 +704,7 @@ async function generate(options) {
|
|
|
715
704
|
const documents = sourcesByModule.get(module)?.map((s) => s.document).filter((el) => el != null) ?? [];
|
|
716
705
|
if (documents.length === 0) continue;
|
|
717
706
|
const document = concatAST(documents);
|
|
718
|
-
const config
|
|
707
|
+
const config = {
|
|
719
708
|
typesDir: options.typesDir,
|
|
720
709
|
fieldInfo,
|
|
721
710
|
importExtension: options.importExtension,
|
|
@@ -724,18 +713,19 @@ async function generate(options) {
|
|
|
724
713
|
moduleDefinitionName: options.moduleDefinitionName
|
|
725
714
|
};
|
|
726
715
|
files.push({
|
|
727
|
-
filename: join(options.modulesDir, `/${module}/${options.moduleDefinitionName}`),
|
|
716
|
+
filename: join(options.modulesDir, `/${module}/${options.moduleDefinitionName}.ts`),
|
|
728
717
|
content: [
|
|
729
|
-
printModuleImports(config
|
|
718
|
+
printModuleImports(config, module),
|
|
730
719
|
printModuleMetadata(module, document),
|
|
731
|
-
printBaetaModuleTypes(config
|
|
732
|
-
printModuleObjectTypeFields(config
|
|
733
|
-
printModuleBuilder(config
|
|
720
|
+
printBaetaModuleTypes(config),
|
|
721
|
+
printModuleObjectTypeFields(config),
|
|
722
|
+
printModuleBuilder(config, module)
|
|
734
723
|
].join("\n\n")
|
|
735
724
|
});
|
|
736
|
-
|
|
725
|
+
const moduleStarterPath = join(options.modulesDir, `/${module}/index.ts`);
|
|
726
|
+
if (!currentFiles.some((file) => file.filename === moduleStarterPath)) files.push({
|
|
737
727
|
filename: join(options.modulesDir, `/${module}/index.ts`),
|
|
738
|
-
content: printModuleIndexStarter(config
|
|
728
|
+
content: printModuleIndexStarter(config, module),
|
|
739
729
|
options: {
|
|
740
730
|
disableOverwrite: true,
|
|
741
731
|
disableBiomeV1Header: true,
|
|
@@ -747,7 +737,6 @@ async function generate(options) {
|
|
|
747
737
|
}
|
|
748
738
|
return files;
|
|
749
739
|
}
|
|
750
|
-
|
|
751
740
|
//#endregion
|
|
752
741
|
//#region index.ts
|
|
753
742
|
function graphqlPlugin() {
|
|
@@ -762,13 +751,13 @@ function graphqlPlugin() {
|
|
|
762
751
|
watcher.on("delete", handleChange);
|
|
763
752
|
},
|
|
764
753
|
generate: async (ctx, next) => {
|
|
765
|
-
const items = await generate(ctx.generatorOptions);
|
|
754
|
+
const items = await generate(ctx.generatorOptions, ctx.fileManager.files);
|
|
766
755
|
for (const item of items) ctx.fileManager.createAndAdd(item.filename, item.content, "graphql", item.options);
|
|
767
756
|
return next();
|
|
768
757
|
}
|
|
769
758
|
});
|
|
770
759
|
}
|
|
771
|
-
|
|
772
760
|
//#endregion
|
|
773
761
|
export { graphqlPlugin };
|
|
762
|
+
|
|
774
763
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["loadSchema","schemaPointerMap: UnnormalizedTypeDefPointer","loadSchemaToolkit","path","defaultScalarTypes: Record<string, string | undefined>","type","printNamedType","map: FieldInfoMap","registryKeys: RegistryKeys[]","picks: Record<RegistryKeys, Record<string, string[]>>","defined: Registry","obj: Record<K, T>","loadSchema","config: PrinterConfig","files: GeneratedFile[]","config: ModulePrinterConfig","config"],"sources":["../utils/load.ts","../utils/path.ts","../utils/source.ts","../lib/printer/printer-autoload.ts","../lib/printer/printer-utils.ts","../lib/printer/printer-module.ts","../lib/printer/printer-templates.ts","../utils/scalar.ts","../lib/printer/printer-types.ts","../lib/visitors/definitions-map.ts","../lib/visitors/field-info.ts","../lib/visitors/module-registry.ts","../lib/codegen.ts","../index.ts"],"sourcesContent":["import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';\nimport {\n\tloadSchema as loadSchemaToolkit,\n\ttype UnnormalizedTypeDefPointer,\n} from '@graphql-tools/load';\nimport {\n\ttype BaseLoaderOptions,\n\tgetDocumentNodeFromSchema,\n\ttype Loader,\n} from '@graphql-tools/utils';\nimport { validateSchema } from 'graphql';\n\nexport async function loadSchema(\n\tschemas: string | string[],\n\tcwd: string,\n\textraLoaders: Loader<BaseLoaderOptions>[] = [],\n) {\n\tconst schemaPointerMap: UnnormalizedTypeDefPointer = {};\n\tfor (const ptr of Array.isArray(schemas) ? schemas : [schemas]) {\n\t\tschemaPointerMap[ptr] = {};\n\t}\n\n\tconst outputSchemaAst = await loadSchemaToolkit(schemaPointerMap, {\n\t\tloaders: [new GraphQLFileLoader(), ...extraLoaders],\n\t\tcwd,\n\t\tincludeSources: true,\n\t});\n\n\tconst errors = validateSchema(outputSchemaAst);\n\n\tif (errors.length > 0) {\n\t\tconst messages = errors.map((e) => e.toString()).join('\\n\\n--------------------\\n\\n');\n\t\tconst subject = errors.length === 1 ? 'error' : 'errors';\n\t\tthrow new Error(`Invalid schema. Found ${errors.length} ${subject}:\\n\\n${messages}`);\n\t}\n\n\tif (!outputSchemaAst.extensions) {\n\t\toutputSchemaAst.extensions = {};\n\t}\n\n\treturn {\n\t\toutputSchemaAst,\n\t\toutputSchema: getDocumentNodeFromSchema(outputSchemaAst),\n\t};\n}\n","import path, { normalize } from '@baeta/util-path';\n\nconst sep = '/';\n\nexport function fixPath(root: string, toFix: string) {\n\treturn path.resolve(path.relative(root, toFix));\n}\n\nexport function getRelativePath(filepath: string, basePath: string) {\n\tconst normalizedFilepath = normalize(filepath);\n\tconst normalizedBasePath = ensureStartsWithSeparator(\n\t\tensureEndsWithSeparator(normalize(basePath)),\n\t);\n\tconst [, relativePath] = normalizedFilepath.split(normalizedBasePath);\n\treturn relativePath;\n}\n\nexport function extractModuleDirectory(relativePath: string): string {\n\tconst [moduleDirectory] = relativePath.split(sep);\n\treturn moduleDirectory;\n}\n\nfunction ensureStartsWithSeparator(path: string) {\n\treturn path.startsWith(sep) ? path : sep + path;\n}\n\nfunction ensureEndsWithSeparator(path: string) {\n\treturn path.endsWith(sep) ? path : path + sep;\n}\n","import type { Source } from '@graphql-tools/utils';\nimport type { GraphQLSchema } from 'graphql';\nimport { extractModuleDirectory, getRelativePath } from './path.ts';\n\nexport function groupSourcesByModule(sources: Source[], basePath: string) {\n\tconst map = new Map<string, Source[]>();\n\tfor (const source of sources) {\n\t\tif (!source.location) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst relativePath = getRelativePath(source.location, basePath);\n\t\tif (!relativePath) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst mod = extractModuleDirectory(relativePath);\n\t\tconst existing = map.get(mod) ?? [];\n\t\texisting.push(source);\n\t\tmap.set(mod, existing);\n\t}\n\treturn map;\n}\n\nexport function getSourcesFromSchema(schema: GraphQLSchema) {\n\tconst extensions = schema.extensions;\n\treturn (extensions?.extendedSources ?? []) as Source[];\n}\n","import { camelCase, pascalCase } from 'change-case-all';\n\ninterface AutoloadPrinterConfig {\n\timportExtension: '.ts' | '.js' | '';\n}\n\nexport function printAutoload(config: AutoloadPrinterConfig, modules: string[]) {\n\treturn [printImports(config, modules), printExport(modules)].join('\\n\\n');\n}\n\nfunction printImports(config: AutoloadPrinterConfig, modules: string[]) {\n\tconst dependencyImports = [\n\t\t'import type { ModuleCompilerFactory } from \"@baeta/core/sdk\";',\n\t\t`import type { Ctx, Info } from \"./types${config.importExtension}\"`,\n\t];\n\tconst moduleTypeImports = modules.map(\n\t\t(module) =>\n\t\t\t`import type { BaetaModuleTypes as ${pascalCase(module)}ModuleTypes } from \"./${module}/typedef${config.importExtension}\"`,\n\t);\n\tconst moduleImports = modules.flatMap(\n\t\t(module) => `import ${camelCase(module)} from \"./${module}/index${config.importExtension}\"`,\n\t);\n\treturn [...dependencyImports, ...moduleTypeImports, ...moduleImports].join('\\n');\n}\n\nfunction printExport(modules: string[]) {\n\treturn `export default [\\n${modules.map(printModuleWithSatisfies).join(',\\n')}\\n];`;\n}\n\nfunction printModuleWithSatisfies(module: string) {\n\treturn ` ${camelCase(module)} satisfies ModuleCompilerFactory<Ctx, Info, ${pascalCase(module)}ModuleTypes[\"Factories\"]>`;\n}\n","import { posixPath, relative } from '@baeta/util-path';\n\nexport function buildBlock({ name, lines }: { name: string; lines: string[] }): string {\n\treturn [`${name} {`, ...lines.filter(Boolean).map(indent(2)), '};'].join('\\n');\n}\n\nexport function buildCodeBlock({ name, lines }: { name: string; lines: string[] }) {\n\tconst linesWithSep = lines.filter(Boolean).map(indent(2)).join(',\\n');\n\treturn [`${name} {`, linesWithSep, '}'].join('\\n');\n}\n\nexport function indent(size: number) {\n\tconst space = new Array(size).fill(' ').join('');\n\tfunction indentInner(val: string): string {\n\t\treturn val\n\t\t\t.split('\\n')\n\t\t\t.map((line) => `${space}${line}`)\n\t\t\t.join('\\n');\n\t}\n\treturn indentInner;\n}\n\nexport function unique<T>(val: T, i: number, all: T[]): boolean {\n\treturn i === all.indexOf(val);\n}\n\nexport function makeRelativePathForImport(from: string, to: string) {\n\tconst res = posixPath(relative(from, to));\n\tif (res.startsWith('.') || res.startsWith('/')) {\n\t\treturn res;\n\t}\n\treturn `./${res}`;\n}\n","import { join, parse } from '@baeta/util-path';\nimport { pascalCase } from 'change-case-all';\nimport type { DocumentNode } from 'graphql';\nimport type { FieldInfoMap } from '../visitors/field-info.ts';\nimport type { ModuleRegistry } from '../visitors/module-registry.ts';\nimport { buildBlock, buildCodeBlock, indent, makeRelativePathForImport } from './printer-utils.ts';\n\nexport interface ModulePrinterConfig {\n\tregistry: ModuleRegistry;\n\tfieldInfo: FieldInfoMap;\n\ttypesDir: string;\n\tmodulesDir: string;\n\tmoduleDefinitionName: string;\n\timportExtension: '.ts' | '.js' | '';\n}\n\nexport function printModuleIndexStarter(config: ModulePrinterConfig, moduleName: string): string {\n\tconst typeEntries = Object.entries(config.registry.picks.objects);\n\tconst types = typeEntries.map(([typeName]) => typeName);\n\n\treturn [\n\t\tprintModuleIndexImports(config, moduleName),\n\t\tprintModuleIndexDestructuredTypes(moduleName, types),\n\t\t...typeEntries.map(([typeName, fields]) => printModuleIndexType(typeName, fields)),\n\t\tprintModuleIndexSchema(moduleName, types, config.registry.defined.scalars),\n\t]\n\t\t.filter((el) => el != null)\n\t\t.join('\\n\\n');\n}\n\nexport function printModuleImports(config: ModulePrinterConfig, moduleName: string) {\n\tconst typesDir = makeRelativePathForImport(join(config.modulesDir, moduleName), config.typesDir);\n\treturn [\n\t\t'import type { DocumentNode, GraphQLScalarType } from \"graphql\";',\n\t\t'import * as Baeta from \"@baeta/core/sdk\";',\n\t\t`import extensions from \"../extensions${config.importExtension}\";`,\n\t\t`import type {Ctx, Info} from \"../types${config.importExtension}\";`,\n\t\t`import type * as Types from \"${typesDir}/types${config.importExtension}\";`,\n\t].join('\\n');\n}\n\nexport function printModuleMetadata(name: string, doc: DocumentNode) {\n\treturn buildCodeBlock({\n\t\tname: 'const moduleMetadata =',\n\t\tlines: [\n\t\t\t`id: '${name}'`,\n\t\t\t`dirname: './${name}'`,\n\t\t\t`typedef: ${JSON.stringify(doc)} as unknown as DocumentNode`,\n\t\t],\n\t});\n}\n\nexport function printBaetaModuleTypes(config: ModulePrinterConfig) {\n\treturn buildBlock({\n\t\tname: 'export interface BaetaModuleTypes',\n\t\tlines: [\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Builders:',\n\t\t\t\tlines: printBaetaModuleTypesForFields(config, false),\n\t\t\t}),\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Factories:',\n\t\t\t\tlines: [\n\t\t\t\t\t...printBaetaModuleTypesForFields(config, true),\n\t\t\t\t\t...printBaetaModuleTypesScalars(config),\n\t\t\t\t],\n\t\t\t}),\n\t\t],\n\t});\n}\n\nfunction printModuleIndexDestructuredTypes(moduleName: string, types: string[]) {\n\treturn `const { ${types.join(', ')} } = ${pascalCase(moduleName)}Module;`;\n}\n\nfunction printModuleIndexImports(config: ModulePrinterConfig, moduleName: string) {\n\tconst hasScalars = config.registry.defined.scalars.length > 0;\n\tconst typedef = parse(config.moduleDefinitionName).name + config.importExtension;\n\tconst moduleImport = `import { ${pascalCase(moduleName)}Module } from \"./${typedef}\";`;\n\tif (!hasScalars) {\n\t\treturn moduleImport;\n\t}\n\treturn [`import { GraphQLScalarType } from \"graphql\";`, moduleImport].join('\\n');\n}\n\nfunction printModuleIndexSchema(moduleName: string, types: string[], scalars: string[]) {\n\tconst printedTypes = [\n\t\t...types.map((typeName) => `${typeName}: ${typeName}Resolver,`),\n\t\t...scalars.map(\n\t\t\t(scalarName) => `${scalarName}: new GraphQLScalarType({ name: '${scalarName}' }),`,\n\t\t),\n\t]\n\t\t.map(indent(2))\n\t\t.join('\\n');\n\n\treturn `export default ${pascalCase(moduleName)}Module.$schema({\n${printedTypes}\n});`;\n}\n\nfunction printModuleIndexType(typeName: string, fields: string[]) {\n\tconst printedFields = fields\n\t\t.map((fieldName) => printModuleIndexTypeField(typeName, fieldName))\n\t\t.map(indent(2))\n\t\t.join('\\n');\n\n\treturn `const ${typeName}Resolver = ${typeName}.$fields({\n${printedFields}\n});`;\n}\n\nfunction printModuleIndexTypeField(typeName: string, fieldName: string) {\n\tif (typeName === 'Query' || typeName === 'Mutation') {\n\t\treturn `${fieldName}: ${typeName}.${fieldName}.resolve((params) => {\n // Implement resolver logic here\n}),`;\n\t}\n\n\tif (typeName === 'Subscription') {\n\t\treturn `${fieldName}: ${typeName}.${fieldName}\n .subscribe((params) => {\n // Implement subscribe logic here\n })\n .resolve((params) => {\n // Implement resolver logic here\n }),`;\n\t}\n\n\treturn `${fieldName}: ${typeName}.${fieldName}.key('${fieldName}'),`;\n}\n\nfunction printBaetaModuleTypesForFields(config: ModulePrinterConfig, isFactory: boolean) {\n\treturn config.registry.defined.objects\n\t\t.map((typeName) =>\n\t\t\tprintObjectTypeModuleType(typeName, config.registry.picks.objects, isFactory),\n\t\t)\n\t\t.filter(Boolean);\n}\n\nfunction printObjectTypeModuleType(\n\ttypeName: string,\n\tobjects: Record<string, string[] | undefined>,\n\tisFactory: boolean,\n) {\n\tconst object = objects[typeName];\n\tif (!object) {\n\t\treturn '';\n\t}\n\tconst parentType = getParentType(typeName);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tif (isFactory) {\n\t\treturn `${typeName}: Baeta.TypeCompilerFactory<${parentType}, ${contextType}, ${infoType}, BaetaModuleObjectTypeFields['${typeName}']['Factory']>`;\n\t}\n\treturn `${typeName}: Baeta.TypeMethods<${parentType}, ${contextType}, ${infoType}, BaetaModuleObjectTypeFields['${typeName}']['Builder'], BaetaModuleObjectTypeFields['${typeName}']['Factory']>`;\n}\n\nfunction printBaetaModuleTypesScalars(config: ModulePrinterConfig) {\n\treturn config.registry.defined.scalars.map((scalar) => `${scalar}: GraphQLScalarType`);\n}\n\nexport function printModuleObjectTypeFields(config: ModulePrinterConfig) {\n\tconst objects = config.registry.defined.objects\n\t\t.map((typeName) => printObjectTypeFields(config, typeName, config.registry.picks.objects))\n\t\t.filter(Boolean);\n\treturn buildBlock({\n\t\tname: 'interface BaetaModuleObjectTypeFields',\n\t\tlines: objects,\n\t});\n}\n\nfunction printObjectTypeFields(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tobjects: Record<string, string[] | undefined>,\n) {\n\tconst fields = objects[typeName];\n\tif (!fields || fields.length === 0) {\n\t\treturn '';\n\t}\n\tconst fieldsBuilders = fields.map((field) =>\n\t\tprintObjectTypeFieldBuilders(config, typeName, field),\n\t);\n\tconst fieldsFactories = fields.map((field) =>\n\t\tprintObjectTypeFieldFactories(config, typeName, field),\n\t);\n\treturn buildBlock({\n\t\tname: `${typeName}:`,\n\t\tlines: [\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Builder:',\n\t\t\t\tlines: fieldsBuilders,\n\t\t\t}),\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Factory:',\n\t\t\t\tlines: fieldsFactories,\n\t\t\t}),\n\t\t],\n\t});\n}\n\nfunction printObjectTypeFieldBuilders(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tfield: string,\n) {\n\tconst parentType = getParentType(typeName);\n\tconst resultType = getResultType(config, typeName, field);\n\tconst argumentsType = getArgsType(config, typeName, field);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tconst namespace = typeName === 'Subscription' ? 'SubscriptionMethods' : 'FieldMethods';\n\treturn `${field}: Baeta.${namespace}<${resultType}, ${parentType}, ${contextType}, ${argumentsType}, ${infoType}>`;\n}\n\nfunction printObjectTypeFieldFactories(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tfield: string,\n) {\n\tconst parentType = getParentType(typeName);\n\tconst resultType = getResultType(config, typeName, field);\n\tconst argumentsType = getArgsType(config, typeName, field);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tconst namespace = typeName === 'Subscription' ? 'SubscriptionField' : 'Field';\n\treturn `${field}: Baeta.${namespace}<${resultType}, ${resultType}, ${parentType}, ${contextType}, ${argumentsType}, ${infoType}>`;\n}\n\nexport function printModuleBuilder(config: ModulePrinterConfig, moduleName: string) {\n\tconst objectTypes = config.registry.defined.objects\n\t\t.map((typeName) => printObjectTypeBuilder(typeName, config.registry.picks.objects))\n\t\t.filter(Boolean);\n\tconst builders = buildCodeBlock({\n\t\tname: '',\n\t\tlines: objectTypes,\n\t});\n\tconst typeNameResolvers = buildCodeBlock({\n\t\tname: '',\n\t\tlines: [...config.registry.defined.unions, ...config.registry.defined.interfaces].map(\n\t\t\t(name) => `${name}: ${printTypeNameResolver()}`,\n\t\t),\n\t});\n\tconst infoType = getInfoType();\n\tconst contextType = getContextType();\n\treturn [\n\t\t`export const ${pascalCase(moduleName)}Module = Baeta.createModuleBuilder<${contextType}, ${infoType}, BaetaModuleTypes['Builders'], BaetaModuleTypes['Factories']>(moduleMetadata.id, moduleMetadata.typedef,`,\n\t\tbuilders,\n\t\t',',\n\t\ttypeNameResolvers,\n\t\t`, ${getExtensionsVar()});`,\n\t].join('');\n}\n\nfunction printObjectTypeBuilder(typeName: string, objects: Record<string, string[] | undefined>) {\n\tconst fields = objects[typeName]?.map((field) => printObjectTypeFieldBuilder(typeName, field));\n\tif (fields == null || fields.length === 0) {\n\t\treturn '';\n\t}\n\tconst content = buildCodeBlock({\n\t\tname: '',\n\t\tlines: fields,\n\t});\n\treturn `${typeName}: Baeta.createTypeBuilder(\"${typeName}\",${content}, ${getExtensionsVar()})`;\n}\n\nfunction printTypeNameResolver() {\n\treturn '{ __resolveType: (source: {__typename: string}) => { return source.__typename; }}';\n}\n\nfunction getParentType(type: string) {\n\tif (['Query', 'Mutation', 'Subscription'].includes(type)) {\n\t\treturn '{}';\n\t}\n\treturn `Types.${type}`;\n}\n\nfunction getResultType(config: ModulePrinterConfig, type: string, field: string) {\n\tconst fieldType = config.fieldInfo.get(type)?.get(field)?.type;\n\tif (fieldType == null) {\n\t\treturn '{}';\n\t}\n\treturn fieldType;\n}\n\nfunction getArgsType(config: ModulePrinterConfig, type: string, field: string) {\n\tconst hasArgs = config.fieldInfo.get(type)?.get(field)?.hasArguments ?? false;\n\tif (!hasArgs) {\n\t\treturn '{}';\n\t}\n\tconst fieldUpper = field[0].toUpperCase() + field.slice(1);\n\treturn `Types.${type}${fieldUpper}Args`;\n}\n\nfunction printObjectTypeFieldBuilder(typeName: string, field: string) {\n\tif (typeName === 'Subscription') {\n\t\treturn `${field}: Baeta.createSubscriptionBuilder(\"${field}\", ${getExtensionsVar()})`;\n\t}\n\treturn `${field}: Baeta.createFieldBuilder(\"${typeName}\", \"${field}\", ${getExtensionsVar()})`;\n}\n\nfunction getContextType() {\n\treturn 'Ctx';\n}\n\nfunction getInfoType() {\n\treturn 'Info';\n}\n\nfunction getExtensionsVar() {\n\treturn 'extensions';\n}\n","import { makeRelativePathForImport } from './printer-utils.ts';\n\nexport function printTypesTemplate(options: {\n\timportExtension: '.js' | '.ts' | '';\n\ttypesDir: string;\n\tmodulesDir: string;\n}) {\n\tconst importDir = makeRelativePathForImport(options.modulesDir, options.typesDir);\n\n\treturn `import type { GraphQLResolveInfo } from 'graphql';\nimport type { BaseObjectTypes, BaseScalars } from '${importDir}/utility${options.importExtension}';\n\nexport interface Scalars extends BaseScalars {}\n\nexport interface ObjectTypes extends BaseObjectTypes {}\n\nexport type Ctx = {};\n\nexport type Info = GraphQLResolveInfo;\n`;\n}\n\nexport function printExtensionsTemplate() {\n\treturn `import { createExtensions } from '@baeta/core';\n\nexport default createExtensions({});\n`;\n}\n","import type { NamedTypeNode } from 'graphql';\nimport type { DefinitionsMap } from '../lib/visitors/definitions-map.ts';\n\nexport function isScalarType(\n\tdefinitionsMap: DefinitionsMap,\n\tdefaultScalars: string[],\n\ttype: NamedTypeNode,\n): boolean {\n\treturn (\n\t\tdefinitionsMap.scalarTypeMap.has(type.name.value) || defaultScalars.includes(type.name.value)\n\t);\n}\n","import { pascalCase } from 'change-case-all';\nimport {\n\ttype EnumTypeDefinitionNode,\n\ttype FieldDefinitionNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputValueDefinitionNode,\n\ttype InterfaceTypeDefinitionNode,\n\tKind,\n\ttype ListTypeNode,\n\ttype NamedTypeNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype TypeNode,\n\ttype UnionTypeDefinitionNode,\n} from 'graphql';\nimport { isScalarType } from '../../utils/scalar.ts';\nimport type { DefinitionsMap } from '../visitors/definitions-map.ts';\nimport { buildBlock, indent, makeRelativePathForImport } from './printer-utils.ts';\n\nexport interface PrinterConfig {\n\tglobalDefinitions: DefinitionsMap;\n\twithMaybe: boolean;\n\twithOptional: boolean;\n\tdefaultScalars: string[];\n\timportExtension: '.ts' | '.js' | '';\n\ttypesDir: string;\n\tmodulesDir: string;\n}\n\nexport function printUtilityTypes(): string {\n\treturn [\n\t\t'export type Or<A, B> = void extends A ? B : A;',\n\t\t'export type Maybe<T> = T | null;',\n\t].join('\\n\\n');\n}\n\nconst defaultScalarTypes: Record<string, string | undefined> = {\n\tID: 'string',\n\tString: 'string',\n\tBoolean: 'boolean',\n\tInt: 'number',\n\tFloat: 'number',\n};\n\nexport function printBaseScalars(config: PrinterConfig): string {\n\tconst defaultScalars = config.defaultScalars\n\t\t.map((scalar) => {\n\t\t\tconst type = defaultScalarTypes[scalar];\n\t\t\tif (type == null) return null;\n\t\t\treturn `${scalar}: ${type};`;\n\t\t})\n\t\t.filter((el) => el != null);\n\tconst customScalars = [...config.globalDefinitions.scalarTypeMap.values()].map(\n\t\t(scalar) => `${scalar.name.value}: unknown;`,\n\t);\n\n\treturn buildBlock({\n\t\tname: 'export type BaseScalars =',\n\t\tlines: [...defaultScalars, ...customScalars],\n\t});\n}\n\nexport function printBaseObjectTypes(config: PrinterConfig): string {\n\tconst objectTypes = [...config.globalDefinitions.objectTypeMap.values()].map((t) => t.name.value);\n\treturn buildBlock({\n\t\tname: 'export interface BaseObjectTypes',\n\t\tlines: objectTypes.map((t) => `${t}: unknown;`),\n\t});\n}\n\nexport function printTypesHeaders(config: PrinterConfig): string {\n\tconst overridesDir = makeRelativePathForImport(config.typesDir, config.modulesDir);\n\treturn [\n\t\t`import type * as BaetaUtility from \"./utility${config.importExtension}\";`,\n\t\t`import type * as BaetaOverrides from \"${overridesDir}/types${config.importExtension}\";`,\n\t\t'',\n\t\t'export type Scalars = BaetaOverrides.Scalars;',\n\t].join('\\n');\n}\n\nexport function printRootTypesFromMap(\n\tconfig: PrinterConfig,\n\trootTypes: string[],\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()]\n\t\t.filter((type) => rootTypes.includes(type.name.value))\n\t\t.map((type) => printObjectType(config, type))\n\t\t.join('\\n\\n');\n}\n\nexport function printObjectTypeTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printObjectType(config, type));\n}\n\nfunction printObjectType(config: PrinterConfig, type: ObjectTypeDefinitionNode) {\n\tconst fields = type.fields?.map((field) => printObjectTypeField(config, field));\n\treturn `export type ${type.name.value} = ${printOrObjectType(type, fields)}`;\n}\n\nfunction printObjectTypeField(config: PrinterConfig, field: FieldDefinitionNode) {\n\tconst optionalMarker = printOptionalMarker(config, field.type);\n\treturn `${field.name.value}${optionalMarker}: ${printType(config, field.type)}`;\n}\n\nexport function printEnumTypesFromMap(map: Map<string, EnumTypeDefinitionNode>) {\n\treturn [...map.values()].map(printEnumType);\n}\n\nfunction printEnumType(type: EnumTypeDefinitionNode) {\n\tconst values = type.values?.map((value) => `'${value.name.value}'`);\n\treturn `export type ${type.name.value} = ${values?.join(' | ') || 'never'}`;\n}\n\nexport function printInterfaceTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, InterfaceTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printInterfaceType(config, type));\n}\n\nfunction printInterfaceType(config: PrinterConfig, type: InterfaceTypeDefinitionNode) {\n\tconst objectTypes = Array.from(config.globalDefinitions.objectTypeMap.values());\n\tconst implementingTypes = objectTypes.filter((t) =>\n\t\tt.interfaces?.some((i) => i.name.value === type.name.value),\n\t);\n\tconst types = implementingTypes.map((t) => printNamedTypeForInterface(t.name.value));\n\treturn `export type ${type.name.value} = ${types.join(' | ') || 'never'}`;\n}\n\nfunction printNamedTypeForInterface(name: string) {\n\treturn `${name} & {__typename: \"${name}\"}`;\n}\n\nexport function printUnionTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, UnionTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printUnionType(config, type));\n}\n\nfunction printUnionType(config: PrinterConfig, type: UnionTypeDefinitionNode) {\n\tconst types = type.types?.map((type) => printNamedTypeForUnion(config, type));\n\treturn `export type ${type.name.value} = ${types?.join(' | ') || 'never'}`;\n}\n\nfunction printNamedTypeForUnion(config: PrinterConfig, type: NamedTypeNode) {\n\treturn `${printNamedType(config, type, false)} & {__typename: \"${type.name.value}\"}`;\n}\n\nexport function printInputObjectTypeTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, InputObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printInputObjectType(config, type));\n}\n\nfunction printInputObjectType(config: PrinterConfig, type: InputObjectTypeDefinitionNode) {\n\tconst fields = type.fields?.map((field) => printInputObjectTypeField(config, field));\n\treturn buildBlock({\n\t\tname: `export type ${type.name.value} =`,\n\t\tlines: fields ?? [],\n\t});\n}\n\nfunction printInputObjectTypeField(config: PrinterConfig, field: InputValueDefinitionNode) {\n\tconst optionalMarker = printOptionalMarker(config, field.type);\n\treturn `${field.name.value}${optionalMarker}: ${printType(config, field.type)}`;\n}\n\nexport function printObjectTypeFieldsArgsFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].flatMap((type) => printObjectTypeArgs(config, type));\n}\n\nfunction printObjectTypeArgs(config: PrinterConfig, type: ObjectTypeDefinitionNode) {\n\tif (type.fields == null) {\n\t\treturn [];\n\t}\n\treturn type.fields\n\t\t.map((field) => printObjectTypeFieldArgs(config, type.name.value, field))\n\t\t.filter(Boolean);\n}\n\nfunction printObjectTypeFieldArgs(\n\tconfig: PrinterConfig,\n\ttypeName: string,\n\tfield: FieldDefinitionNode,\n) {\n\tconst name = `${typeName + pascalCase(field.name.value)}Args`;\n\treturn buildBlock({\n\t\tname: `export type ${name} =`,\n\t\tlines: field.arguments?.map((arg) => printObjectTypeFieldArg(config, arg)) ?? [],\n\t});\n}\n\nfunction printObjectTypeFieldArg(config: PrinterConfig, arg: InputValueDefinitionNode) {\n\treturn `${arg.name.value}: ${printType(config, arg.type)}`;\n}\n\nfunction printType(config: PrinterConfig, type: TypeNode, nullable = true): string {\n\tswitch (type.kind) {\n\t\tcase Kind.NAMED_TYPE:\n\t\t\treturn printNamedType(config, type, nullable);\n\t\tcase Kind.LIST_TYPE:\n\t\t\treturn printListType(config, type, nullable);\n\t\tcase Kind.NON_NULL_TYPE:\n\t\t\treturn printType(config, type.type, false);\n\t\tdefault:\n\t\t\treturn type satisfies never;\n\t}\n}\n\nfunction printListType(config: PrinterConfig, type: ListTypeNode, nullable = true): string {\n\treturn printValue(config, `Array<${printType(config, type.type)}>`, nullable);\n}\n\nfunction printNamedType(config: PrinterConfig, type: NamedTypeNode, nullable = true): string {\n\tif (isScalarType(config.globalDefinitions, config.defaultScalars, type)) {\n\t\treturn printScalarType(config, type, nullable);\n\t}\n\treturn printValue(config, type.name.value, nullable);\n}\n\nfunction printScalarType(config: PrinterConfig, type: NamedTypeNode, nullable = true): string {\n\treturn printValue(config, `Scalars[\"${type.name.value}\"]`, nullable);\n}\n\nfunction printValue(config: PrinterConfig, value: string, nullable: boolean): string {\n\tif (!nullable) {\n\t\treturn value;\n\t}\n\tif (config.withMaybe) {\n\t\treturn `BaetaUtility.Maybe<${value}>`;\n\t}\n\treturn `${value} | null`;\n}\n\nfunction printOptionalMarker(config: PrinterConfig, type: TypeNode): string {\n\treturn config.withOptional && type.kind !== Kind.NON_NULL_TYPE ? '?' : '';\n}\n\nfunction printOrObjectType(type: ObjectTypeDefinitionNode, fields?: string[]): string {\n\treturn `BaetaUtility.Or<BaetaOverrides.ObjectTypes[\"${type.name.value}\"], {\\n${fields?.map(indent(2)).join('\\n') ?? ''}\\n}>`;\n}\n","import type { Source } from '@graphql-tools/utils';\nimport {\n\ttype DocumentNode,\n\ttype EnumTypeDefinitionNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype ScalarTypeDefinitionNode,\n\ttype UnionTypeDefinitionNode,\n\tvisit,\n} from 'graphql';\n\nexport type DefinitionsMap = ReturnType<typeof createRegistry>;\n\nfunction createRegistry() {\n\treturn {\n\t\tscalarTypeMap: new Map<string, ScalarTypeDefinitionNode>(),\n\t\tenumTypeMap: new Map<string, EnumTypeDefinitionNode>(),\n\t\tobjectTypeMap: new Map<string, ObjectTypeDefinitionNode>(),\n\t\tinputObjectTypeMap: new Map<string, InputObjectTypeDefinitionNode>(),\n\t\tunionTypeMap: new Map<string, UnionTypeDefinitionNode>(),\n\t\tinterfaceTypeMap: new Map<string, InterfaceTypeDefinitionNode>(),\n\t};\n}\n\nexport function createDefinitionsMapFromSources(sources: Source[]) {\n\tconst registry = createRegistry();\n\tfor (const source of sources) {\n\t\tif (source.document) {\n\t\t\tcollectTypesFromDocument(source.document, registry, ['Query', 'Mutation', 'Subscription']);\n\t\t}\n\t}\n\treturn registry;\n}\n\nexport function createDefinitionsMapFromDocument(document: DocumentNode) {\n\tconst registry = createRegistry();\n\tcollectTypesFromDocument(document, registry);\n\treturn registry;\n}\n\nfunction collectTypesFromDocument(\n\tdocument: DocumentNode,\n\tregistry: DefinitionsMap,\n\tfilterObjectTypes: string[] = [],\n) {\n\tvisit(document, {\n\t\tScalarTypeDefinition(node) {\n\t\t\tif (registry.scalarTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Scalar type ${node.name.value} already exists`);\n\t\t\t}\n\t\t\tregistry.scalarTypeMap.set(node.name.value, node);\n\t\t},\n\t\tEnumTypeDefinition(node) {\n\t\t\tif (registry.enumTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Enum type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.enumTypeMap.set(node.name.value, node);\n\t\t},\n\t\tObjectTypeDefinition(node) {\n\t\t\tif (filterObjectTypes.includes(node.name.value)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (registry.objectTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Object type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.objectTypeMap.set(node.name.value, node);\n\t\t},\n\t\tInputObjectTypeDefinition(node) {\n\t\t\tif (registry.inputObjectTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Input type ${node.name.value} already exists. Use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.inputObjectTypeMap.set(node.name.value, node);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tif (registry.unionTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Union type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.unionTypeMap.set(node.name.value, node);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tif (registry.interfaceTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Interface type ${node.name.value} already exists. Use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.interfaceTypeMap.set(node.name.value, node);\n\t\t},\n\t});\n}\n","import { Kind, type TypeNode } from 'graphql';\nimport { isScalarType } from '../../utils/scalar.ts';\nimport type { DefinitionsMap } from './definitions-map.ts';\n\nexport type FieldInfoMap = Map<string, Map<string, { type: string; hasArguments: boolean }>>;\n\nexport function createFieldInfoMap(definitionsMap: DefinitionsMap, defaultScalars: string[]) {\n\tconst map: FieldInfoMap = new Map();\n\tfor (const objectType of definitionsMap.objectTypeMap.values()) {\n\t\tconst objectName = objectType.name.value;\n\t\tfor (const field of objectType.fields ?? []) {\n\t\t\tconst fieldName = field.name.value;\n\t\t\tconst type = printNamedType(definitionsMap, defaultScalars, field.type, true);\n\t\t\tconst hasArguments = field.arguments != null && field.arguments.length > 0;\n\t\t\tconst fieldMap = map.get(objectName) ?? new Map();\n\t\t\tfieldMap.set(fieldName, { type, hasArguments });\n\t\t\tmap.set(objectName, fieldMap);\n\t\t}\n\t}\n\treturn map;\n}\n\nfunction printNamedType(\n\tdefinitionsMap: DefinitionsMap,\n\tdefaultScalars: string[],\n\ttype: TypeNode,\n\tnullable = true,\n): string {\n\tconst withNullable = nullable ? ' | null' : '';\n\tswitch (type.kind) {\n\t\tcase Kind.NAMED_TYPE:\n\t\t\tif (isScalarType(definitionsMap, defaultScalars, type)) {\n\t\t\t\treturn `Types.Scalars[\"${type.name.value}\"]${withNullable}`;\n\t\t\t}\n\t\t\treturn `Types.${type.name.value}${withNullable}`;\n\t\tcase Kind.LIST_TYPE:\n\t\t\treturn `Array<${printNamedType(definitionsMap, defaultScalars, type.type, nullable)}>${withNullable}`;\n\t\tcase Kind.NON_NULL_TYPE:\n\t\t\treturn printNamedType(definitionsMap, defaultScalars, type.type, false);\n\t\tdefault:\n\t\t\treturn type satisfies never;\n\t}\n}\n","import {\n\ttype DocumentNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputObjectTypeExtensionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype InterfaceTypeExtensionNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype UnionTypeDefinitionNode,\n\tvisit,\n} from 'graphql';\n\nexport type RegistryKeys = 'objects' | 'interfaces' | 'unions' | 'scalars';\nexport type Registry = Record<RegistryKeys, string[]>;\nexport type Picks = Record<RegistryKeys, Record<string, string[]>>;\n\nconst registryKeys: RegistryKeys[] = ['objects', 'interfaces', 'unions', 'scalars'];\n\nexport type ModuleRegistry = {\n\tdefined: Registry;\n\tpicks: Picks;\n};\n\nexport function createModuleRegistry(document: DocumentNode): ModuleRegistry {\n\tconst picks: Record<RegistryKeys, Record<string, string[]>> = createObject(\n\t\tregistryKeys,\n\t\t() => ({}),\n\t);\n\tconst defined: Registry = createObject(registryKeys, () => []);\n\n\tvisit(document, {\n\t\tObjectTypeDefinition(node) {\n\t\t\tdefined.objects.push(node.name.value);\n\t\t\tcollectFields(node, picks.objects);\n\t\t},\n\t\tObjectTypeExtension(node) {\n\t\t\tpushUnique(defined.objects, node.name.value);\n\t\t\tcollectFields(node, picks.objects);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tdefined.interfaces.push(node.name.value);\n\t\t\tcollectFields(node, picks.interfaces);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tdefined.unions.push(node.name.value);\n\t\t\tcollectUnionTypes(node, picks);\n\t\t},\n\t\tScalarTypeDefinition(node) {\n\t\t\tdefined.scalars.push(node.name.value);\n\t\t},\n\t});\n\n\treturn {\n\t\tdefined,\n\t\tpicks,\n\t};\n}\n\nfunction collectFields(\n\tnode:\n\t\t| ObjectTypeDefinitionNode\n\t\t| ObjectTypeExtensionNode\n\t\t| InterfaceTypeDefinitionNode\n\t\t| InterfaceTypeExtensionNode\n\t\t| InputObjectTypeDefinitionNode\n\t\t| InputObjectTypeExtensionNode,\n\tpicksObj: Record<string, string[]>,\n) {\n\tconst name = node.name.value;\n\tif (node.fields) {\n\t\tif (!picksObj[name]) {\n\t\t\tpicksObj[name] = [];\n\t\t}\n\t\tfor (const field of node.fields) {\n\t\t\tpicksObj[name].push(field.name.value);\n\t\t}\n\t}\n}\n\nfunction collectUnionTypes(node: UnionTypeDefinitionNode, picks: Picks) {\n\tconst name = node.name.value;\n\tif (node.types) {\n\t\tif (!picks.unions[name]) {\n\t\t\tpicks.unions[name] = [];\n\t\t}\n\t\tfor (const type of node.types) {\n\t\t\tpicks.unions[name].push(type.name.value);\n\t\t}\n\t}\n}\n\nexport function pushUnique<T>(list: T[], item: T): void {\n\tif (!list.includes(item)) {\n\t\tlist.push(item);\n\t}\n}\n\nexport function createObject<K extends string, T>(keys: K[], valueFn: (key: K) => T) {\n\tconst obj: Record<K, T> = {} as Record<K, T>;\n\tfor (const key of keys) {\n\t\tobj[key] = valueFn(key);\n\t}\n\treturn obj;\n}\n","import type { FileOptions, NormalizedGeneratorOptions } from '@baeta/generator-sdk';\nimport { join } from '@baeta/util-path';\nimport { concatAST } from 'graphql';\nimport { loadSchema } from '../utils/load.ts';\nimport { getSourcesFromSchema, groupSourcesByModule } from '../utils/source.ts';\nimport { printAutoload } from './printer/printer-autoload.ts';\nimport {\n\ttype ModulePrinterConfig,\n\tprintBaetaModuleTypes,\n\tprintModuleBuilder,\n\tprintModuleImports,\n\tprintModuleIndexStarter,\n\tprintModuleMetadata,\n\tprintModuleObjectTypeFields,\n} from './printer/printer-module.ts';\nimport { printExtensionsTemplate, printTypesTemplate } from './printer/printer-templates.ts';\nimport {\n\ttype PrinterConfig,\n\tprintBaseObjectTypes,\n\tprintBaseScalars,\n\tprintEnumTypesFromMap,\n\tprintInputObjectTypeTypesFromMap,\n\tprintInterfaceTypesFromMap,\n\tprintObjectTypeFieldsArgsFromMap,\n\tprintObjectTypeTypesFromMap,\n\tprintRootTypesFromMap,\n\tprintTypesHeaders,\n\tprintUnionTypesFromMap,\n\tprintUtilityTypes,\n} from './printer/printer-types.ts';\nimport {\n\tcreateDefinitionsMapFromDocument,\n\tcreateDefinitionsMapFromSources,\n} from './visitors/definitions-map.ts';\nimport { createFieldInfoMap } from './visitors/field-info.ts';\nimport { createModuleRegistry } from './visitors/module-registry.ts';\n\ntype GeneratedFile = {\n\tfilename: string;\n\tcontent: string;\n\toptions?: FileOptions;\n};\n\nexport async function generate(options: NormalizedGeneratorOptions): Promise<GeneratedFile[]> {\n\tconst { outputSchema, outputSchemaAst } = await loadSchema(\n\t\toptions.schemas,\n\t\toptions.cwd,\n\t\toptions.loaders,\n\t);\n\tconst sources = getSourcesFromSchema(outputSchemaAst);\n\tconst sourcesByModule = groupSourcesByModule(sources, options.modulesDir);\n\tconst modules = Array.from(sourcesByModule.keys());\n\tconst globalDefinitions = createDefinitionsMapFromDocument(outputSchema);\n\tconst modulesDefinitions = createDefinitionsMapFromSources(sources);\n\n\tconst defaultScalars = ['ID', 'Int', 'Float', 'String', 'Boolean'];\n\n\tconst config: PrinterConfig = {\n\t\tglobalDefinitions,\n\t\twithMaybe: false,\n\t\twithOptional: false,\n\t\tdefaultScalars,\n\t\timportExtension: options.importExtension,\n\t\ttypesDir: options.typesDir,\n\t\tmodulesDir: options.modulesDir,\n\t};\n\n\tconst fieldInfo = createFieldInfoMap(globalDefinitions, defaultScalars);\n\n\tconst typesContent = [\n\t\tprintTypesHeaders(config),\n\t\tprintRootTypesFromMap(\n\t\t\tconfig,\n\t\t\t['Query', 'Mutation', 'Subscription'],\n\t\t\tglobalDefinitions.objectTypeMap,\n\t\t),\n\t\t...printEnumTypesFromMap(globalDefinitions.enumTypeMap),\n\t\t...printObjectTypeTypesFromMap(config, modulesDefinitions.objectTypeMap),\n\t\t...printObjectTypeFieldsArgsFromMap(config, globalDefinitions.objectTypeMap),\n\t\t...printInputObjectTypeTypesFromMap(config, globalDefinitions.inputObjectTypeMap),\n\t\t...printInterfaceTypesFromMap(config, globalDefinitions.interfaceTypeMap),\n\t\t...printUnionTypesFromMap(config, globalDefinitions.unionTypeMap),\n\t].join('\\n\\n');\n\n\tconst utilityContent = [\n\t\tprintUtilityTypes(),\n\t\tprintBaseScalars(config),\n\t\tprintBaseObjectTypes(config),\n\t].join('\\n\\n');\n\n\tconst files: GeneratedFile[] = [\n\t\t{\n\t\t\tfilename: join(options.typesDir, 'types.ts'),\n\t\t\tcontent: typesContent,\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.typesDir, 'utility.ts'),\n\t\t\tcontent: utilityContent,\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'index.ts'),\n\t\t\tcontent: printAutoload({ importExtension: options.importExtension }, modules),\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'types.ts'),\n\t\t\tcontent: printTypesTemplate({\n\t\t\t\timportExtension: options.importExtension,\n\t\t\t\ttypesDir: options.typesDir,\n\t\t\t\tmodulesDir: options.modulesDir,\n\t\t\t}),\n\t\t\toptions: {\n\t\t\t\tdisableOverwrite: true,\n\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\tdisableEslintHeader: true,\n\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'extensions.ts'),\n\t\t\tcontent: printExtensionsTemplate(),\n\t\t\toptions: {\n\t\t\t\tdisableOverwrite: true,\n\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\tdisableEslintHeader: true,\n\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t},\n\t\t},\n\t];\n\n\tfor (const module of modules) {\n\t\tconst sources = sourcesByModule.get(module);\n\t\tconst documents = sources?.map((s) => s.document).filter((el) => el != null) ?? [];\n\t\tif (documents.length === 0) continue;\n\t\tconst document = concatAST(documents);\n\t\tconst config: ModulePrinterConfig = {\n\t\t\ttypesDir: options.typesDir,\n\t\t\tfieldInfo,\n\t\t\timportExtension: options.importExtension,\n\t\t\tmodulesDir: options.modulesDir,\n\t\t\tregistry: createModuleRegistry(document),\n\t\t\tmoduleDefinitionName: options.moduleDefinitionName,\n\t\t};\n\t\tfiles.push({\n\t\t\tfilename: join(options.modulesDir, `/${module}/${options.moduleDefinitionName}`),\n\t\t\tcontent: [\n\t\t\t\tprintModuleImports(config, module),\n\t\t\t\tprintModuleMetadata(module, document),\n\t\t\t\tprintBaetaModuleTypes(config),\n\t\t\t\tprintModuleObjectTypeFields(config),\n\t\t\t\tprintModuleBuilder(config, module),\n\t\t\t].join('\\n\\n'),\n\t\t});\n\t\tfiles.push({\n\t\t\tfilename: join(options.modulesDir, `/${module}/index.ts`),\n\t\t\tcontent: printModuleIndexStarter(config, module),\n\t\t\toptions: {\n\t\t\t\tdisableOverwrite: true,\n\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\tdisableEslintHeader: true,\n\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t},\n\t\t});\n\t}\n\n\treturn files;\n}\n","import { createPluginV1, isMatch, type WatcherFile } from '@baeta/generator-sdk';\nimport { generate } from './lib/codegen.ts';\n\nexport function graphqlPlugin() {\n\treturn createPluginV1({\n\t\tname: 'graphql',\n\t\tactionName: 'GraphQL modules',\n\t\twatch: (options, watcher, reload) => {\n\t\t\tconst handleChange = (file: WatcherFile) => {\n\t\t\t\tif (isMatch(file.relativePath, options.schemas)) {\n\t\t\t\t\treload(file);\n\t\t\t\t}\n\t\t\t};\n\t\t\twatcher.on('update', handleChange);\n\t\t\twatcher.on('delete', handleChange);\n\t\t},\n\t\tgenerate: async (ctx, next) => {\n\t\t\tconst items = await generate(ctx.generatorOptions);\n\t\t\tfor (const item of items) {\n\t\t\t\tctx.fileManager.createAndAdd(item.filename, item.content, 'graphql', item.options);\n\t\t\t}\n\t\t\treturn next();\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;AAYA,eAAsBA,aACrB,SACA,KACA,eAA4C,EAAE,EAC7C;CACD,MAAMC,mBAA+C,EAAE;AACvD,MAAK,MAAM,OAAO,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAC7D,kBAAiB,OAAO,EAAE;CAG3B,MAAM,kBAAkB,MAA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SAAS;IACR,mBAAmBC,UAAQ,OAAO;IAClC,oBAAoB,QAAQ,SAAS;IACrC,sBAAsBA,SAAO;IAC7B,4BAA4BA,SAAO;IACnC,mBAAmBA,UAAQ,OAAO;IAClC,CAAC,KAAK,OAAO;GACd,CAAC;AACF,QAAM,KAAK;GACV,UAAU,KAAK,QAAQ,YAAY,IAAI,OAAO,WAAW;GACzD,SAAS,wBAAwBA,UAAQ,OAAO;GAChD,SAAS;IACR,kBAAkB;IAClB,sBAAsB;IACtB,sBAAsB;IACtB,qBAAqB;IACrB,+BAA+B;IAC/B;GACD,CAAC;;AAGH,QAAO;;;;;ACpKR,SAAgB,gBAAgB;AAC/B,QAAO,eAAe;EACrB,MAAM;EACN,YAAY;EACZ,QAAQ,SAAS,SAAS,WAAW;GACpC,MAAM,gBAAgB,SAAsB;AAC3C,QAAI,QAAQ,KAAK,cAAc,QAAQ,QAAQ,CAC9C,QAAO,KAAK;;AAGd,WAAQ,GAAG,UAAU,aAAa;AAClC,WAAQ,GAAG,UAAU,aAAa;;EAEnC,UAAU,OAAO,KAAK,SAAS;GAC9B,MAAM,QAAQ,MAAM,SAAS,IAAI,iBAAiB;AAClD,QAAK,MAAM,QAAQ,MAClB,KAAI,YAAY,aAAa,KAAK,UAAU,KAAK,SAAS,WAAW,KAAK,QAAQ;AAEnF,UAAO,MAAM;;EAEd,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["loadSchema","loadSchemaToolkit","printNamedType","loadSchema"],"sources":["../utils/load.ts","../utils/path.ts","../utils/source.ts","../lib/printer/printer-autoload.ts","../lib/printer/printer-utils.ts","../lib/printer/printer-module.ts","../lib/printer/printer-templates.ts","../utils/scalar.ts","../lib/printer/printer-types.ts","../lib/visitors/definitions-map.ts","../lib/visitors/field-info.ts","../lib/visitors/module-registry.ts","../lib/codegen.ts","../index.ts"],"sourcesContent":["import { GraphQLFileLoader } from '@graphql-tools/graphql-file-loader';\nimport {\n\tloadSchema as loadSchemaToolkit,\n\ttype UnnormalizedTypeDefPointer,\n} from '@graphql-tools/load';\nimport {\n\ttype BaseLoaderOptions,\n\tgetDocumentNodeFromSchema,\n\ttype Loader,\n} from '@graphql-tools/utils';\nimport { validateSchema } from 'graphql';\n\nexport async function loadSchema(\n\tschemas: string | string[],\n\tcwd: string,\n\textraLoaders: Loader<BaseLoaderOptions>[] = [],\n) {\n\tconst schemaPointerMap: UnnormalizedTypeDefPointer = {};\n\tfor (const ptr of Array.isArray(schemas) ? schemas : [schemas]) {\n\t\tschemaPointerMap[ptr] = {};\n\t}\n\n\tconst outputSchemaAst = await loadSchemaToolkit(schemaPointerMap, {\n\t\tloaders: [new GraphQLFileLoader(), ...extraLoaders],\n\t\tcwd,\n\t\tincludeSources: true,\n\t});\n\n\tconst errors = validateSchema(outputSchemaAst);\n\n\tif (errors.length > 0) {\n\t\tconst messages = errors.map((e) => e.toString()).join('\\n\\n--------------------\\n\\n');\n\t\tconst subject = errors.length === 1 ? 'error' : 'errors';\n\t\tthrow new Error(`Invalid schema. Found ${errors.length} ${subject}:\\n\\n${messages}`);\n\t}\n\n\tif (!outputSchemaAst.extensions) {\n\t\toutputSchemaAst.extensions = {};\n\t}\n\n\treturn {\n\t\toutputSchemaAst,\n\t\toutputSchema: getDocumentNodeFromSchema(outputSchemaAst),\n\t};\n}\n","import path, { normalize } from '@baeta/util-path';\n\nconst sep = '/';\n\nexport function fixPath(root: string, toFix: string) {\n\treturn path.resolve(path.relative(root, toFix));\n}\n\nexport function getRelativePath(filepath: string, basePath: string) {\n\tconst normalizedFilepath = ensureStartsWithSeparator(\n\t\tensureEndsWithSeparator(normalize(filepath)),\n\t);\n\tconst normalizedBasePath = ensureStartsWithSeparator(\n\t\tensureEndsWithSeparator(normalize(basePath)),\n\t);\n\tconst [, relativePath] = normalizedFilepath.split(normalizedBasePath);\n\treturn relativePath;\n}\n\nexport function extractModuleDirectory(relativePath: string): string {\n\tconst [moduleDirectory] = relativePath.split(sep);\n\treturn moduleDirectory;\n}\n\nfunction ensureStartsWithSeparator(path: string) {\n\treturn path.startsWith(sep) ? path : sep + path;\n}\n\nfunction ensureEndsWithSeparator(path: string) {\n\treturn path.endsWith(sep) ? path : path + sep;\n}\n","import type { Source } from '@graphql-tools/utils';\nimport type { GraphQLSchema } from 'graphql';\nimport { extractModuleDirectory, getRelativePath } from './path.ts';\n\nexport function groupSourcesByModule(sources: Source[], basePath: string) {\n\tconst map = new Map<string, Source[]>();\n\tfor (const source of sources) {\n\t\tif (!source.location) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst relativePath = getRelativePath(source.location, basePath);\n\t\tif (!relativePath) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst mod = extractModuleDirectory(relativePath);\n\t\tconst existing = map.get(mod) ?? [];\n\t\texisting.push(source);\n\t\tmap.set(mod, existing);\n\t}\n\treturn map;\n}\n\nexport function getSourcesFromSchema(schema: GraphQLSchema) {\n\tconst extensions = schema.extensions;\n\treturn (extensions?.extendedSources ?? []) as Source[];\n}\n","import { camelCase, pascalCase } from 'change-case-all';\n\ninterface AutoloadPrinterConfig {\n\tmoduleDefinitionName: string;\n\timportExtension: '.ts' | '.js' | '';\n}\n\nexport function printAutoload(config: AutoloadPrinterConfig, modules: string[]) {\n\treturn [printImports(config, modules), printExport(modules)].join('\\n\\n');\n}\n\nfunction printImports(config: AutoloadPrinterConfig, modules: string[]) {\n\tconst dependencyImports = [\n\t\t'import type { ModuleCompilerFactory } from \"@baeta/core/sdk\";',\n\t\t`import type { Ctx, Info } from \"./types${config.importExtension}\"`,\n\t];\n\tconst moduleTypeImports = modules.map(\n\t\t(module) =>\n\t\t\t`import type { BaetaModuleTypes as ${pascalCase(module)}ModuleTypes } from \"./${module}/${config.moduleDefinitionName}${config.importExtension}\"`,\n\t);\n\tconst moduleImports = modules.flatMap(\n\t\t(module) => `import ${camelCase(module)} from \"./${module}/index${config.importExtension}\"`,\n\t);\n\treturn [...dependencyImports, ...moduleTypeImports, ...moduleImports].join('\\n');\n}\n\nfunction printExport(modules: string[]) {\n\treturn `export default [\\n${modules.map(printModuleWithSatisfies).join(',\\n')}\\n];`;\n}\n\nfunction printModuleWithSatisfies(module: string) {\n\treturn ` ${camelCase(module)} satisfies ModuleCompilerFactory<Ctx, Info, ${pascalCase(module)}ModuleTypes[\"Factories\"]>`;\n}\n","import { posixPath, relative } from '@baeta/util-path';\n\nexport function buildBlock({ name, lines }: { name: string; lines: string[] }): string {\n\treturn [`${name} {`, ...lines.filter(Boolean).map(indent(2)), '};'].join('\\n');\n}\n\nexport function buildCodeBlock({ name, lines }: { name: string; lines: string[] }) {\n\tconst linesWithSep = lines.filter(Boolean).map(indent(2)).join(',\\n');\n\treturn [`${name} {`, linesWithSep, '}'].join('\\n');\n}\n\nexport function indent(size: number) {\n\tconst space = new Array(size).fill(' ').join('');\n\tfunction indentInner(val: string): string {\n\t\treturn val\n\t\t\t.split('\\n')\n\t\t\t.map((line) => `${space}${line}`)\n\t\t\t.join('\\n');\n\t}\n\treturn indentInner;\n}\n\nexport function unique<T>(val: T, i: number, all: T[]): boolean {\n\treturn i === all.indexOf(val);\n}\n\nexport function makeRelativePathForImport(from: string, to: string) {\n\tconst res = posixPath(relative(from, to));\n\tif (res.startsWith('.') || res.startsWith('/')) {\n\t\treturn res;\n\t}\n\treturn `./${res}`;\n}\n","import { join } from '@baeta/util-path';\nimport { pascalCase } from 'change-case-all';\nimport type { DocumentNode } from 'graphql';\nimport type { FieldInfoMap } from '../visitors/field-info.ts';\nimport type { ModuleRegistry } from '../visitors/module-registry.ts';\nimport { buildBlock, buildCodeBlock, indent, makeRelativePathForImport } from './printer-utils.ts';\n\nexport interface ModulePrinterConfig {\n\tregistry: ModuleRegistry;\n\tfieldInfo: FieldInfoMap;\n\ttypesDir: string;\n\tmodulesDir: string;\n\tmoduleDefinitionName: string;\n\timportExtension: '.ts' | '.js' | '';\n}\n\nexport function printModuleIndexStarter(config: ModulePrinterConfig, moduleName: string): string {\n\tconst typeEntries = Object.entries(config.registry.picks.objects);\n\tconst types = typeEntries.map(([typeName]) => typeName);\n\n\treturn [\n\t\tprintModuleIndexImports(config, moduleName),\n\t\tprintModuleIndexDestructuredTypes(moduleName, types),\n\t\t...typeEntries.map(([typeName, fields]) => printModuleIndexType(typeName, fields)),\n\t\tprintModuleIndexSchema(moduleName, types, config.registry.defined.scalars),\n\t]\n\t\t.filter((el) => el != null)\n\t\t.join('\\n\\n');\n}\n\nexport function printModuleImports(config: ModulePrinterConfig, moduleName: string) {\n\tconst typesDir = makeRelativePathForImport(join(config.modulesDir, moduleName), config.typesDir);\n\treturn [\n\t\t'import type { DocumentNode, GraphQLScalarType } from \"graphql\";',\n\t\t'import * as Baeta from \"@baeta/core/sdk\";',\n\t\t`import extensions from \"../extensions${config.importExtension}\";`,\n\t\t`import type {Ctx, Info} from \"../types${config.importExtension}\";`,\n\t\t`import type * as Types from \"${typesDir}/types${config.importExtension}\";`,\n\t].join('\\n');\n}\n\nexport function printModuleMetadata(name: string, doc: DocumentNode) {\n\treturn buildCodeBlock({\n\t\tname: 'const moduleMetadata =',\n\t\tlines: [\n\t\t\t`id: '${name}'`,\n\t\t\t`dirname: './${name}'`,\n\t\t\t`typedef: ${JSON.stringify(doc)} as unknown as DocumentNode`,\n\t\t],\n\t});\n}\n\nexport function printBaetaModuleTypes(config: ModulePrinterConfig) {\n\treturn buildBlock({\n\t\tname: 'export interface BaetaModuleTypes',\n\t\tlines: [\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Builders:',\n\t\t\t\tlines: printBaetaModuleTypesForFields(config, false),\n\t\t\t}),\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Factories:',\n\t\t\t\tlines: [\n\t\t\t\t\t...printBaetaModuleTypesForFields(config, true),\n\t\t\t\t\t...printBaetaModuleTypesScalars(config),\n\t\t\t\t],\n\t\t\t}),\n\t\t],\n\t});\n}\n\nfunction printModuleIndexDestructuredTypes(moduleName: string, types: string[]) {\n\treturn `const { ${types.join(', ')} } = ${pascalCase(moduleName)}Module;`;\n}\n\nfunction printModuleIndexImports(config: ModulePrinterConfig, moduleName: string) {\n\tconst hasScalars = config.registry.defined.scalars.length > 0;\n\tconst moduleImport = `import { ${pascalCase(moduleName)}Module } from \"./${config.moduleDefinitionName}${config.importExtension}\";`;\n\tif (!hasScalars) {\n\t\treturn moduleImport;\n\t}\n\treturn [`import { GraphQLScalarType } from \"graphql\";`, moduleImport].join('\\n');\n}\n\nfunction printModuleIndexSchema(moduleName: string, types: string[], scalars: string[]) {\n\tconst printedTypes = [\n\t\t...types.map((typeName) => `${typeName}: ${typeName}Resolver,`),\n\t\t...scalars.map(\n\t\t\t(scalarName) => `${scalarName}: new GraphQLScalarType({ name: '${scalarName}' }),`,\n\t\t),\n\t]\n\t\t.map(indent(2))\n\t\t.join('\\n');\n\n\treturn `export default ${pascalCase(moduleName)}Module.$schema({\n${printedTypes}\n});`;\n}\n\nfunction printModuleIndexType(typeName: string, fields: string[]) {\n\tconst printedFields = fields\n\t\t.map((fieldName) => printModuleIndexTypeField(typeName, fieldName))\n\t\t.map(indent(2))\n\t\t.join('\\n');\n\n\treturn `const ${typeName}Resolver = ${typeName}.$fields({\n${printedFields}\n});`;\n}\n\nfunction printModuleIndexTypeField(typeName: string, fieldName: string) {\n\tif (typeName === 'Query' || typeName === 'Mutation') {\n\t\treturn `${fieldName}: ${typeName}.${fieldName}.resolve((params) => {\n // Implement resolver logic here\n}),`;\n\t}\n\n\tif (typeName === 'Subscription') {\n\t\treturn `${fieldName}: ${typeName}.${fieldName}\n .subscribe((params) => {\n // Implement subscribe logic here\n })\n .resolve((params) => {\n // Implement resolver logic here\n }),`;\n\t}\n\n\treturn `${fieldName}: ${typeName}.${fieldName}.key('${fieldName}'),`;\n}\n\nfunction printBaetaModuleTypesForFields(config: ModulePrinterConfig, isFactory: boolean) {\n\treturn config.registry.defined.objects\n\t\t.map((typeName) =>\n\t\t\tprintObjectTypeModuleType(typeName, config.registry.picks.objects, isFactory),\n\t\t)\n\t\t.filter(Boolean);\n}\n\nfunction printObjectTypeModuleType(\n\ttypeName: string,\n\tobjects: Record<string, string[] | undefined>,\n\tisFactory: boolean,\n) {\n\tconst object = objects[typeName];\n\tif (!object) {\n\t\treturn '';\n\t}\n\tconst parentType = getParentType(typeName);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tif (isFactory) {\n\t\treturn `${typeName}: Baeta.TypeCompilerFactory<${parentType}, ${contextType}, ${infoType}, BaetaModuleObjectTypeFields['${typeName}']['Factory']>`;\n\t}\n\treturn `${typeName}: Baeta.TypeMethods<${parentType}, ${contextType}, ${infoType}, BaetaModuleObjectTypeFields['${typeName}']['Builder'], BaetaModuleObjectTypeFields['${typeName}']['Factory']>`;\n}\n\nfunction printBaetaModuleTypesScalars(config: ModulePrinterConfig) {\n\treturn config.registry.defined.scalars.map((scalar) => `${scalar}: GraphQLScalarType`);\n}\n\nexport function printModuleObjectTypeFields(config: ModulePrinterConfig) {\n\tconst objects = config.registry.defined.objects\n\t\t.map((typeName) => printObjectTypeFields(config, typeName, config.registry.picks.objects))\n\t\t.filter(Boolean);\n\treturn buildBlock({\n\t\tname: 'interface BaetaModuleObjectTypeFields',\n\t\tlines: objects,\n\t});\n}\n\nfunction printObjectTypeFields(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tobjects: Record<string, string[] | undefined>,\n) {\n\tconst fields = objects[typeName];\n\tif (!fields || fields.length === 0) {\n\t\treturn '';\n\t}\n\tconst fieldsBuilders = fields.map((field) =>\n\t\tprintObjectTypeFieldBuilders(config, typeName, field),\n\t);\n\tconst fieldsFactories = fields.map((field) =>\n\t\tprintObjectTypeFieldFactories(config, typeName, field),\n\t);\n\treturn buildBlock({\n\t\tname: `${typeName}:`,\n\t\tlines: [\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Builder:',\n\t\t\t\tlines: fieldsBuilders,\n\t\t\t}),\n\t\t\tbuildBlock({\n\t\t\t\tname: 'Factory:',\n\t\t\t\tlines: fieldsFactories,\n\t\t\t}),\n\t\t],\n\t});\n}\n\nfunction printObjectTypeFieldBuilders(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tfield: string,\n) {\n\tconst parentType = getParentType(typeName);\n\tconst resultType = getResultType(config, typeName, field);\n\tconst argumentsType = getArgsType(config, typeName, field);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tconst namespace = typeName === 'Subscription' ? 'SubscriptionMethods' : 'FieldMethods';\n\treturn `${field}: Baeta.${namespace}<${resultType}, ${parentType}, ${contextType}, ${argumentsType}, ${infoType}>`;\n}\n\nfunction printObjectTypeFieldFactories(\n\tconfig: ModulePrinterConfig,\n\ttypeName: string,\n\tfield: string,\n) {\n\tconst parentType = getParentType(typeName);\n\tconst resultType = getResultType(config, typeName, field);\n\tconst argumentsType = getArgsType(config, typeName, field);\n\tconst contextType = getContextType();\n\tconst infoType = getInfoType();\n\tconst namespace = typeName === 'Subscription' ? 'SubscriptionField' : 'Field';\n\treturn `${field}: Baeta.${namespace}<${resultType}, ${resultType}, ${parentType}, ${contextType}, ${argumentsType}, ${infoType}>`;\n}\n\nexport function printModuleBuilder(config: ModulePrinterConfig, moduleName: string) {\n\tconst objectTypes = config.registry.defined.objects\n\t\t.map((typeName) => printObjectTypeBuilder(typeName, config.registry.picks.objects))\n\t\t.filter(Boolean);\n\tconst builders = buildCodeBlock({\n\t\tname: '',\n\t\tlines: objectTypes,\n\t});\n\tconst typeNameResolvers = buildCodeBlock({\n\t\tname: '',\n\t\tlines: [...config.registry.defined.unions, ...config.registry.defined.interfaces].map(\n\t\t\t(name) => `${name}: ${printTypeNameResolver()}`,\n\t\t),\n\t});\n\tconst infoType = getInfoType();\n\tconst contextType = getContextType();\n\treturn [\n\t\t`export const ${pascalCase(moduleName)}Module = Baeta.createModuleBuilder<${contextType}, ${infoType}, BaetaModuleTypes['Builders'], BaetaModuleTypes['Factories']>(moduleMetadata.id, moduleMetadata.typedef,`,\n\t\tbuilders,\n\t\t',',\n\t\ttypeNameResolvers,\n\t\t`, ${getExtensionsVar()});`,\n\t].join('');\n}\n\nfunction printObjectTypeBuilder(typeName: string, objects: Record<string, string[] | undefined>) {\n\tconst fields = objects[typeName]?.map((field) => printObjectTypeFieldBuilder(typeName, field));\n\tif (fields == null || fields.length === 0) {\n\t\treturn '';\n\t}\n\tconst content = buildCodeBlock({\n\t\tname: '',\n\t\tlines: fields,\n\t});\n\treturn `${typeName}: Baeta.createTypeBuilder(\"${typeName}\",${content}, ${getExtensionsVar()})`;\n}\n\nfunction printTypeNameResolver() {\n\treturn '{ __resolveType: (source: {__typename: string}) => { return source.__typename; }}';\n}\n\nfunction getParentType(type: string) {\n\tif (['Query', 'Mutation', 'Subscription'].includes(type)) {\n\t\treturn '{}';\n\t}\n\treturn `Types.${type}`;\n}\n\nfunction getResultType(config: ModulePrinterConfig, type: string, field: string) {\n\tconst fieldType = config.fieldInfo.get(type)?.get(field)?.type;\n\tif (fieldType == null) {\n\t\treturn '{}';\n\t}\n\treturn fieldType;\n}\n\nfunction getArgsType(config: ModulePrinterConfig, type: string, field: string) {\n\tconst hasArgs = config.fieldInfo.get(type)?.get(field)?.hasArguments ?? false;\n\tif (!hasArgs) {\n\t\treturn '{}';\n\t}\n\tconst fieldUpper = field[0].toUpperCase() + field.slice(1);\n\treturn `Types.${type}${fieldUpper}Args`;\n}\n\nfunction printObjectTypeFieldBuilder(typeName: string, field: string) {\n\tif (typeName === 'Subscription') {\n\t\treturn `${field}: Baeta.createSubscriptionBuilder(\"${field}\", ${getExtensionsVar()})`;\n\t}\n\treturn `${field}: Baeta.createFieldBuilder(\"${typeName}\", \"${field}\", ${getExtensionsVar()})`;\n}\n\nfunction getContextType() {\n\treturn 'Ctx';\n}\n\nfunction getInfoType() {\n\treturn 'Info';\n}\n\nfunction getExtensionsVar() {\n\treturn 'extensions';\n}\n","import { makeRelativePathForImport } from './printer-utils.ts';\n\nexport function printTypesTemplate(options: {\n\timportExtension: '.js' | '.ts' | '';\n\ttypesDir: string;\n\tmodulesDir: string;\n}) {\n\tconst importDir = makeRelativePathForImport(options.modulesDir, options.typesDir);\n\n\treturn `import type { GraphQLResolveInfo } from 'graphql';\nimport type { BaseObjectTypes, BaseScalars } from '${importDir}/utility${options.importExtension}';\n\nexport interface Scalars extends BaseScalars {}\n\nexport interface ObjectTypes extends BaseObjectTypes {}\n\nexport type Ctx = {};\n\nexport type Info = GraphQLResolveInfo;\n`;\n}\n\nexport function printExtensionsTemplate() {\n\treturn `import { createExtensions } from '@baeta/core';\n\nexport default createExtensions({});\n`;\n}\n","import type { NamedTypeNode } from 'graphql';\nimport type { DefinitionsMap } from '../lib/visitors/definitions-map.ts';\n\nexport function isScalarType(\n\tdefinitionsMap: DefinitionsMap,\n\tdefaultScalars: string[],\n\ttype: NamedTypeNode,\n): boolean {\n\treturn (\n\t\tdefinitionsMap.scalarTypeMap.has(type.name.value) || defaultScalars.includes(type.name.value)\n\t);\n}\n","import { pascalCase } from 'change-case-all';\nimport {\n\ttype EnumTypeDefinitionNode,\n\ttype FieldDefinitionNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputValueDefinitionNode,\n\ttype InterfaceTypeDefinitionNode,\n\tKind,\n\ttype ListTypeNode,\n\ttype NamedTypeNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype TypeNode,\n\ttype UnionTypeDefinitionNode,\n} from 'graphql';\nimport { isScalarType } from '../../utils/scalar.ts';\nimport type { DefinitionsMap } from '../visitors/definitions-map.ts';\nimport { buildBlock, indent, makeRelativePathForImport } from './printer-utils.ts';\n\nexport interface PrinterConfig {\n\tglobalDefinitions: DefinitionsMap;\n\twithMaybe: boolean;\n\twithOptional: boolean;\n\tdefaultScalars: string[];\n\timportExtension: '.ts' | '.js' | '';\n\ttypesDir: string;\n\tmodulesDir: string;\n}\n\nexport function printUtilityTypes(): string {\n\treturn [\n\t\t'export type Or<A, B> = void extends A ? B : A;',\n\t\t'export type Maybe<T> = T | null;',\n\t].join('\\n\\n');\n}\n\nconst defaultScalarTypes: Record<string, string | undefined> = {\n\tID: 'string',\n\tString: 'string',\n\tBoolean: 'boolean',\n\tInt: 'number',\n\tFloat: 'number',\n};\n\nexport function printBaseScalars(config: PrinterConfig): string {\n\tconst defaultScalars = config.defaultScalars\n\t\t.map((scalar) => {\n\t\t\tconst type = defaultScalarTypes[scalar];\n\t\t\tif (type == null) return null;\n\t\t\treturn `${scalar}: ${type};`;\n\t\t})\n\t\t.filter((el) => el != null);\n\tconst customScalars = [...config.globalDefinitions.scalarTypeMap.values()].map(\n\t\t(scalar) => `${scalar.name.value}: unknown;`,\n\t);\n\n\treturn buildBlock({\n\t\tname: 'export type BaseScalars =',\n\t\tlines: [...defaultScalars, ...customScalars],\n\t});\n}\n\nexport function printBaseObjectTypes(config: PrinterConfig): string {\n\tconst objectTypes = [...config.globalDefinitions.objectTypeMap.values()].map((t) => t.name.value);\n\treturn buildBlock({\n\t\tname: 'export interface BaseObjectTypes',\n\t\tlines: objectTypes.map((t) => `${t}: unknown;`),\n\t});\n}\n\nexport function printTypesHeaders(config: PrinterConfig): string {\n\tconst overridesDir = makeRelativePathForImport(config.typesDir, config.modulesDir);\n\treturn [\n\t\t`import type * as BaetaUtility from \"./utility${config.importExtension}\";`,\n\t\t`import type * as BaetaOverrides from \"${overridesDir}/types${config.importExtension}\";`,\n\t\t'',\n\t\t'export type Scalars = BaetaOverrides.Scalars;',\n\t].join('\\n');\n}\n\nexport function printRootTypesFromMap(\n\tconfig: PrinterConfig,\n\trootTypes: string[],\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()]\n\t\t.filter((type) => rootTypes.includes(type.name.value))\n\t\t.map((type) => printObjectType(config, type))\n\t\t.join('\\n\\n');\n}\n\nexport function printObjectTypeTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printObjectType(config, type));\n}\n\nfunction printObjectType(config: PrinterConfig, type: ObjectTypeDefinitionNode) {\n\tconst fields = type.fields?.map((field) => printObjectTypeField(config, field));\n\treturn `export type ${type.name.value} = ${printOrObjectType(type, fields)}`;\n}\n\nfunction printObjectTypeField(config: PrinterConfig, field: FieldDefinitionNode) {\n\tconst optionalMarker = printOptionalMarker(config, field.type);\n\treturn `${field.name.value}${optionalMarker}: ${printType(config, field.type)}`;\n}\n\nexport function printEnumTypesFromMap(map: Map<string, EnumTypeDefinitionNode>) {\n\treturn [...map.values()].map(printEnumType);\n}\n\nfunction printEnumType(type: EnumTypeDefinitionNode) {\n\tconst values = type.values?.map((value) => `'${value.name.value}'`);\n\treturn `export type ${type.name.value} = ${values?.join(' | ') || 'never'}`;\n}\n\nexport function printInterfaceTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, InterfaceTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printInterfaceType(config, type));\n}\n\nfunction printInterfaceType(config: PrinterConfig, type: InterfaceTypeDefinitionNode) {\n\tconst objectTypes = Array.from(config.globalDefinitions.objectTypeMap.values());\n\tconst implementingTypes = objectTypes.filter((t) =>\n\t\tt.interfaces?.some((i) => i.name.value === type.name.value),\n\t);\n\tconst types = implementingTypes.map((t) => printNamedTypeForInterface(t.name.value));\n\treturn `export type ${type.name.value} = ${types.join(' | ') || 'never'}`;\n}\n\nfunction printNamedTypeForInterface(name: string) {\n\treturn `${name} & {__typename: \"${name}\"}`;\n}\n\nexport function printUnionTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, UnionTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printUnionType(config, type));\n}\n\nfunction printUnionType(config: PrinterConfig, type: UnionTypeDefinitionNode) {\n\tconst types = type.types?.map((type) => printNamedTypeForUnion(config, type));\n\treturn `export type ${type.name.value} = ${types?.join(' | ') || 'never'}`;\n}\n\nfunction printNamedTypeForUnion(config: PrinterConfig, type: NamedTypeNode) {\n\treturn `${printNamedType(config, type, false)} & {__typename: \"${type.name.value}\"}`;\n}\n\nexport function printInputObjectTypeTypesFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, InputObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].map((type) => printInputObjectType(config, type));\n}\n\nfunction printInputObjectType(config: PrinterConfig, type: InputObjectTypeDefinitionNode) {\n\tconst fields = type.fields?.map((field) => printInputObjectTypeField(config, field));\n\treturn buildBlock({\n\t\tname: `export type ${type.name.value} =`,\n\t\tlines: fields ?? [],\n\t});\n}\n\nfunction printInputObjectTypeField(config: PrinterConfig, field: InputValueDefinitionNode) {\n\tconst optionalMarker = printOptionalMarker(config, field.type);\n\treturn `${field.name.value}${optionalMarker}: ${printType(config, field.type)}`;\n}\n\nexport function printObjectTypeFieldsArgsFromMap(\n\tconfig: PrinterConfig,\n\tmap: Map<string, ObjectTypeDefinitionNode>,\n) {\n\treturn [...map.values()].flatMap((type) => printObjectTypeArgs(config, type));\n}\n\nfunction printObjectTypeArgs(config: PrinterConfig, type: ObjectTypeDefinitionNode) {\n\tif (type.fields == null) {\n\t\treturn [];\n\t}\n\treturn type.fields\n\t\t.map((field) => printObjectTypeFieldArgs(config, type.name.value, field))\n\t\t.filter(Boolean);\n}\n\nfunction printObjectTypeFieldArgs(\n\tconfig: PrinterConfig,\n\ttypeName: string,\n\tfield: FieldDefinitionNode,\n) {\n\tconst name = `${typeName + pascalCase(field.name.value)}Args`;\n\treturn buildBlock({\n\t\tname: `export type ${name} =`,\n\t\tlines: field.arguments?.map((arg) => printObjectTypeFieldArg(config, arg)) ?? [],\n\t});\n}\n\nfunction printObjectTypeFieldArg(config: PrinterConfig, arg: InputValueDefinitionNode) {\n\treturn `${arg.name.value}: ${printType(config, arg.type)}`;\n}\n\nfunction printType(config: PrinterConfig, type: TypeNode, nullable = true): string {\n\tswitch (type.kind) {\n\t\tcase Kind.NAMED_TYPE:\n\t\t\treturn printNamedType(config, type, nullable);\n\t\tcase Kind.LIST_TYPE:\n\t\t\treturn printListType(config, type, nullable);\n\t\tcase Kind.NON_NULL_TYPE:\n\t\t\treturn printType(config, type.type, false);\n\t\tdefault:\n\t\t\treturn type satisfies never;\n\t}\n}\n\nfunction printListType(config: PrinterConfig, type: ListTypeNode, nullable = true): string {\n\treturn printValue(config, `Array<${printType(config, type.type)}>`, nullable);\n}\n\nfunction printNamedType(config: PrinterConfig, type: NamedTypeNode, nullable = true): string {\n\tif (isScalarType(config.globalDefinitions, config.defaultScalars, type)) {\n\t\treturn printScalarType(config, type, nullable);\n\t}\n\treturn printValue(config, type.name.value, nullable);\n}\n\nfunction printScalarType(config: PrinterConfig, type: NamedTypeNode, nullable = true): string {\n\treturn printValue(config, `Scalars[\"${type.name.value}\"]`, nullable);\n}\n\nfunction printValue(config: PrinterConfig, value: string, nullable: boolean): string {\n\tif (!nullable) {\n\t\treturn value;\n\t}\n\tif (config.withMaybe) {\n\t\treturn `BaetaUtility.Maybe<${value}>`;\n\t}\n\treturn `${value} | null`;\n}\n\nfunction printOptionalMarker(config: PrinterConfig, type: TypeNode): string {\n\treturn config.withOptional && type.kind !== Kind.NON_NULL_TYPE ? '?' : '';\n}\n\nfunction printOrObjectType(type: ObjectTypeDefinitionNode, fields?: string[]): string {\n\treturn `BaetaUtility.Or<BaetaOverrides.ObjectTypes[\"${type.name.value}\"], {\\n${fields?.map(indent(2)).join('\\n') ?? ''}\\n}>`;\n}\n","import type { Source } from '@graphql-tools/utils';\nimport {\n\ttype DocumentNode,\n\ttype EnumTypeDefinitionNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype ScalarTypeDefinitionNode,\n\ttype UnionTypeDefinitionNode,\n\tvisit,\n} from 'graphql';\n\nexport type DefinitionsMap = ReturnType<typeof createRegistry>;\n\nfunction createRegistry() {\n\treturn {\n\t\tscalarTypeMap: new Map<string, ScalarTypeDefinitionNode>(),\n\t\tenumTypeMap: new Map<string, EnumTypeDefinitionNode>(),\n\t\tobjectTypeMap: new Map<string, ObjectTypeDefinitionNode>(),\n\t\tinputObjectTypeMap: new Map<string, InputObjectTypeDefinitionNode>(),\n\t\tunionTypeMap: new Map<string, UnionTypeDefinitionNode>(),\n\t\tinterfaceTypeMap: new Map<string, InterfaceTypeDefinitionNode>(),\n\t};\n}\n\nexport function createDefinitionsMapFromSources(sources: Source[]) {\n\tconst registry = createRegistry();\n\tfor (const source of sources) {\n\t\tif (source.document) {\n\t\t\tcollectTypesFromDocument(source.document, registry, ['Query', 'Mutation', 'Subscription']);\n\t\t}\n\t}\n\treturn registry;\n}\n\nexport function createDefinitionsMapFromDocument(document: DocumentNode) {\n\tconst registry = createRegistry();\n\tcollectTypesFromDocument(document, registry);\n\treturn registry;\n}\n\nfunction collectTypesFromDocument(\n\tdocument: DocumentNode,\n\tregistry: DefinitionsMap,\n\tfilterObjectTypes: string[] = [],\n) {\n\tvisit(document, {\n\t\tScalarTypeDefinition(node) {\n\t\t\tif (registry.scalarTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Scalar type ${node.name.value} already exists`);\n\t\t\t}\n\t\t\tregistry.scalarTypeMap.set(node.name.value, node);\n\t\t},\n\t\tEnumTypeDefinition(node) {\n\t\t\tif (registry.enumTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Enum type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.enumTypeMap.set(node.name.value, node);\n\t\t},\n\t\tObjectTypeDefinition(node) {\n\t\t\tif (filterObjectTypes.includes(node.name.value)) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (registry.objectTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Object type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.objectTypeMap.set(node.name.value, node);\n\t\t},\n\t\tInputObjectTypeDefinition(node) {\n\t\t\tif (registry.inputObjectTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Input type ${node.name.value} already exists. Use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.inputObjectTypeMap.set(node.name.value, node);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tif (registry.unionTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Union type ${node.name.value} already exists, use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.unionTypeMap.set(node.name.value, node);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tif (registry.interfaceTypeMap.has(node.name.value)) {\n\t\t\t\tthrow new Error(`Interface type ${node.name.value} already exists. Use 'extend' instead!`);\n\t\t\t}\n\t\t\tregistry.interfaceTypeMap.set(node.name.value, node);\n\t\t},\n\t});\n}\n","import { Kind, type TypeNode } from 'graphql';\nimport { isScalarType } from '../../utils/scalar.ts';\nimport type { DefinitionsMap } from './definitions-map.ts';\n\nexport type FieldInfoMap = Map<string, Map<string, { type: string; hasArguments: boolean }>>;\n\nexport function createFieldInfoMap(definitionsMap: DefinitionsMap, defaultScalars: string[]) {\n\tconst map: FieldInfoMap = new Map();\n\tfor (const objectType of definitionsMap.objectTypeMap.values()) {\n\t\tconst objectName = objectType.name.value;\n\t\tfor (const field of objectType.fields ?? []) {\n\t\t\tconst fieldName = field.name.value;\n\t\t\tconst type = printNamedType(definitionsMap, defaultScalars, field.type, true);\n\t\t\tconst hasArguments = field.arguments != null && field.arguments.length > 0;\n\t\t\tconst fieldMap = map.get(objectName) ?? new Map();\n\t\t\tfieldMap.set(fieldName, { type, hasArguments });\n\t\t\tmap.set(objectName, fieldMap);\n\t\t}\n\t}\n\treturn map;\n}\n\nfunction printNamedType(\n\tdefinitionsMap: DefinitionsMap,\n\tdefaultScalars: string[],\n\ttype: TypeNode,\n\tnullable = true,\n): string {\n\tconst withNullable = nullable ? ' | null' : '';\n\tswitch (type.kind) {\n\t\tcase Kind.NAMED_TYPE:\n\t\t\tif (isScalarType(definitionsMap, defaultScalars, type)) {\n\t\t\t\treturn `Types.Scalars[\"${type.name.value}\"]${withNullable}`;\n\t\t\t}\n\t\t\treturn `Types.${type.name.value}${withNullable}`;\n\t\tcase Kind.LIST_TYPE:\n\t\t\treturn `Array<${printNamedType(definitionsMap, defaultScalars, type.type, nullable)}>${withNullable}`;\n\t\tcase Kind.NON_NULL_TYPE:\n\t\t\treturn printNamedType(definitionsMap, defaultScalars, type.type, false);\n\t\tdefault:\n\t\t\treturn type satisfies never;\n\t}\n}\n","import {\n\ttype DocumentNode,\n\ttype InputObjectTypeDefinitionNode,\n\ttype InputObjectTypeExtensionNode,\n\ttype InterfaceTypeDefinitionNode,\n\ttype InterfaceTypeExtensionNode,\n\ttype ObjectTypeDefinitionNode,\n\ttype ObjectTypeExtensionNode,\n\ttype UnionTypeDefinitionNode,\n\tvisit,\n} from 'graphql';\n\nexport type RegistryKeys = 'objects' | 'interfaces' | 'unions' | 'scalars';\nexport type Registry = Record<RegistryKeys, string[]>;\nexport type Picks = Record<RegistryKeys, Record<string, string[]>>;\n\nconst registryKeys: RegistryKeys[] = ['objects', 'interfaces', 'unions', 'scalars'];\n\nexport type ModuleRegistry = {\n\tdefined: Registry;\n\tpicks: Picks;\n};\n\nexport function createModuleRegistry(document: DocumentNode): ModuleRegistry {\n\tconst picks: Record<RegistryKeys, Record<string, string[]>> = createObject(\n\t\tregistryKeys,\n\t\t() => ({}),\n\t);\n\tconst defined: Registry = createObject(registryKeys, () => []);\n\n\tvisit(document, {\n\t\tObjectTypeDefinition(node) {\n\t\t\tdefined.objects.push(node.name.value);\n\t\t\tcollectFields(node, picks.objects);\n\t\t},\n\t\tObjectTypeExtension(node) {\n\t\t\tpushUnique(defined.objects, node.name.value);\n\t\t\tcollectFields(node, picks.objects);\n\t\t},\n\t\tInterfaceTypeDefinition(node) {\n\t\t\tdefined.interfaces.push(node.name.value);\n\t\t\tcollectFields(node, picks.interfaces);\n\t\t},\n\t\tUnionTypeDefinition(node) {\n\t\t\tdefined.unions.push(node.name.value);\n\t\t\tcollectUnionTypes(node, picks);\n\t\t},\n\t\tScalarTypeDefinition(node) {\n\t\t\tdefined.scalars.push(node.name.value);\n\t\t},\n\t});\n\n\treturn {\n\t\tdefined,\n\t\tpicks,\n\t};\n}\n\nfunction collectFields(\n\tnode:\n\t\t| ObjectTypeDefinitionNode\n\t\t| ObjectTypeExtensionNode\n\t\t| InterfaceTypeDefinitionNode\n\t\t| InterfaceTypeExtensionNode\n\t\t| InputObjectTypeDefinitionNode\n\t\t| InputObjectTypeExtensionNode,\n\tpicksObj: Record<string, string[]>,\n) {\n\tconst name = node.name.value;\n\tif (node.fields) {\n\t\tif (!picksObj[name]) {\n\t\t\tpicksObj[name] = [];\n\t\t}\n\t\tfor (const field of node.fields) {\n\t\t\tpicksObj[name].push(field.name.value);\n\t\t}\n\t}\n}\n\nfunction collectUnionTypes(node: UnionTypeDefinitionNode, picks: Picks) {\n\tconst name = node.name.value;\n\tif (node.types) {\n\t\tif (!picks.unions[name]) {\n\t\t\tpicks.unions[name] = [];\n\t\t}\n\t\tfor (const type of node.types) {\n\t\t\tpicks.unions[name].push(type.name.value);\n\t\t}\n\t}\n}\n\nexport function pushUnique<T>(list: T[], item: T): void {\n\tif (!list.includes(item)) {\n\t\tlist.push(item);\n\t}\n}\n\nexport function createObject<K extends string, T>(keys: K[], valueFn: (key: K) => T) {\n\tconst obj: Record<K, T> = {} as Record<K, T>;\n\tfor (const key of keys) {\n\t\tobj[key] = valueFn(key);\n\t}\n\treturn obj;\n}\n","import type { File, FileOptions, NormalizedGeneratorOptions } from '@baeta/generator-sdk';\nimport { join } from '@baeta/util-path';\nimport { concatAST } from 'graphql';\nimport { loadSchema } from '../utils/load.ts';\nimport { getSourcesFromSchema, groupSourcesByModule } from '../utils/source.ts';\nimport { printAutoload } from './printer/printer-autoload.ts';\nimport {\n\ttype ModulePrinterConfig,\n\tprintBaetaModuleTypes,\n\tprintModuleBuilder,\n\tprintModuleImports,\n\tprintModuleIndexStarter,\n\tprintModuleMetadata,\n\tprintModuleObjectTypeFields,\n} from './printer/printer-module.ts';\nimport { printExtensionsTemplate, printTypesTemplate } from './printer/printer-templates.ts';\nimport {\n\ttype PrinterConfig,\n\tprintBaseObjectTypes,\n\tprintBaseScalars,\n\tprintEnumTypesFromMap,\n\tprintInputObjectTypeTypesFromMap,\n\tprintInterfaceTypesFromMap,\n\tprintObjectTypeFieldsArgsFromMap,\n\tprintObjectTypeTypesFromMap,\n\tprintRootTypesFromMap,\n\tprintTypesHeaders,\n\tprintUnionTypesFromMap,\n\tprintUtilityTypes,\n} from './printer/printer-types.ts';\nimport {\n\tcreateDefinitionsMapFromDocument,\n\tcreateDefinitionsMapFromSources,\n} from './visitors/definitions-map.ts';\nimport { createFieldInfoMap } from './visitors/field-info.ts';\nimport { createModuleRegistry } from './visitors/module-registry.ts';\n\ntype GeneratedFile = {\n\tfilename: string;\n\tcontent: string;\n\toptions?: FileOptions;\n};\n\nexport async function generate(\n\toptions: NormalizedGeneratorOptions,\n\tcurrentFiles: File[],\n): Promise<GeneratedFile[]> {\n\tconst { outputSchema, outputSchemaAst } = await loadSchema(\n\t\toptions.schemas,\n\t\toptions.cwd,\n\t\toptions.loaders,\n\t);\n\tconst sources = getSourcesFromSchema(outputSchemaAst);\n\tconst sourcesByModule = groupSourcesByModule(sources, options.modulesDir);\n\tconst modules = Array.from(sourcesByModule.keys());\n\tconst globalDefinitions = createDefinitionsMapFromDocument(outputSchema);\n\tconst modulesDefinitions = createDefinitionsMapFromSources(sources);\n\n\tconst defaultScalars = ['ID', 'Int', 'Float', 'String', 'Boolean'];\n\n\tconst config: PrinterConfig = {\n\t\tglobalDefinitions,\n\t\twithMaybe: false,\n\t\twithOptional: false,\n\t\tdefaultScalars,\n\t\timportExtension: options.importExtension,\n\t\ttypesDir: options.typesDir,\n\t\tmodulesDir: options.modulesDir,\n\t};\n\n\tconst fieldInfo = createFieldInfoMap(globalDefinitions, defaultScalars);\n\n\tconst typesContent = [\n\t\tprintTypesHeaders(config),\n\t\tprintRootTypesFromMap(\n\t\t\tconfig,\n\t\t\t['Query', 'Mutation', 'Subscription'],\n\t\t\tglobalDefinitions.objectTypeMap,\n\t\t),\n\t\t...printEnumTypesFromMap(globalDefinitions.enumTypeMap),\n\t\t...printObjectTypeTypesFromMap(config, modulesDefinitions.objectTypeMap),\n\t\t...printObjectTypeFieldsArgsFromMap(config, globalDefinitions.objectTypeMap),\n\t\t...printInputObjectTypeTypesFromMap(config, globalDefinitions.inputObjectTypeMap),\n\t\t...printInterfaceTypesFromMap(config, globalDefinitions.interfaceTypeMap),\n\t\t...printUnionTypesFromMap(config, globalDefinitions.unionTypeMap),\n\t].join('\\n\\n');\n\n\tconst utilityContent = [\n\t\tprintUtilityTypes(),\n\t\tprintBaseScalars(config),\n\t\tprintBaseObjectTypes(config),\n\t].join('\\n\\n');\n\n\tconst files: GeneratedFile[] = [\n\t\t{\n\t\t\tfilename: join(options.typesDir, 'types.ts'),\n\t\t\tcontent: typesContent,\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.typesDir, 'utility.ts'),\n\t\t\tcontent: utilityContent,\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'index.ts'),\n\t\t\tcontent: printAutoload(\n\t\t\t\t{\n\t\t\t\t\timportExtension: options.importExtension,\n\t\t\t\t\tmoduleDefinitionName: options.moduleDefinitionName,\n\t\t\t\t},\n\t\t\t\tmodules,\n\t\t\t),\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'types.ts'),\n\t\t\tcontent: printTypesTemplate({\n\t\t\t\timportExtension: options.importExtension,\n\t\t\t\ttypesDir: options.typesDir,\n\t\t\t\tmodulesDir: options.modulesDir,\n\t\t\t}),\n\t\t\toptions: {\n\t\t\t\tdisableOverwrite: true,\n\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\tdisableEslintHeader: true,\n\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tfilename: join(options.modulesDir, 'extensions.ts'),\n\t\t\tcontent: printExtensionsTemplate(),\n\t\t\toptions: {\n\t\t\t\tdisableOverwrite: true,\n\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\tdisableEslintHeader: true,\n\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t},\n\t\t},\n\t];\n\n\tfor (const module of modules) {\n\t\tconst sources = sourcesByModule.get(module);\n\t\tconst documents = sources?.map((s) => s.document).filter((el) => el != null) ?? [];\n\t\tif (documents.length === 0) continue;\n\t\tconst document = concatAST(documents);\n\t\tconst config: ModulePrinterConfig = {\n\t\t\ttypesDir: options.typesDir,\n\t\t\tfieldInfo,\n\t\t\timportExtension: options.importExtension,\n\t\t\tmodulesDir: options.modulesDir,\n\t\t\tregistry: createModuleRegistry(document),\n\t\t\tmoduleDefinitionName: options.moduleDefinitionName,\n\t\t};\n\t\tfiles.push({\n\t\t\tfilename: join(options.modulesDir, `/${module}/${options.moduleDefinitionName}.ts`),\n\t\t\tcontent: [\n\t\t\t\tprintModuleImports(config, module),\n\t\t\t\tprintModuleMetadata(module, document),\n\t\t\t\tprintBaetaModuleTypes(config),\n\t\t\t\tprintModuleObjectTypeFields(config),\n\t\t\t\tprintModuleBuilder(config, module),\n\t\t\t].join('\\n\\n'),\n\t\t});\n\n\t\tconst moduleStarterPath = join(options.modulesDir, `/${module}/index.ts`);\n\t\tconst moduleStarterExists = currentFiles.some((file) => file.filename === moduleStarterPath);\n\t\tif (!moduleStarterExists) {\n\t\t\tfiles.push({\n\t\t\t\tfilename: join(options.modulesDir, `/${module}/index.ts`),\n\t\t\t\tcontent: printModuleIndexStarter(config, module),\n\t\t\t\toptions: {\n\t\t\t\t\tdisableOverwrite: true,\n\t\t\t\t\tdisableBiomeV1Header: true,\n\t\t\t\t\tdisableBiomeV2Header: true,\n\t\t\t\t\tdisableEslintHeader: true,\n\t\t\t\t\tdisableGenerationNoticeHeader: true,\n\t\t\t\t},\n\t\t\t});\n\t\t}\n\t}\n\n\treturn files;\n}\n","import { createPluginV1, isMatch, type WatcherFile } from '@baeta/generator-sdk';\nimport { generate } from './lib/codegen.ts';\n\nexport function graphqlPlugin() {\n\treturn createPluginV1({\n\t\tname: 'graphql',\n\t\tactionName: 'GraphQL modules',\n\t\twatch: (options, watcher, reload) => {\n\t\t\tconst handleChange = (file: WatcherFile) => {\n\t\t\t\tif (isMatch(file.relativePath, options.schemas)) {\n\t\t\t\t\treload(file);\n\t\t\t\t}\n\t\t\t};\n\t\t\twatcher.on('update', handleChange);\n\t\t\twatcher.on('delete', handleChange);\n\t\t},\n\t\tgenerate: async (ctx, next) => {\n\t\t\tconst items = await generate(ctx.generatorOptions, ctx.fileManager.files);\n\t\t\tfor (const item of items) {\n\t\t\t\tctx.fileManager.createAndAdd(item.filename, item.content, 'graphql', item.options);\n\t\t\t}\n\t\t\treturn next();\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;AAYA,eAAsBA,aACrB,SACA,KACA,eAA4C,EAAE,EAC7C;CACD,MAAM,mBAA+C,EAAE;AACvD,MAAK,MAAM,OAAO,MAAM,QAAQ,QAAQ,GAAG,UAAU,CAAC,QAAQ,CAC7D,kBAAiB,OAAO,EAAE;CAG3B,MAAM,kBAAkB,MAAMC,WAAkB,kBAAkB;EACjE,SAAS,CAAC,IAAI,mBAAmB,EAAE,GAAG,aAAa;EACnD;EACA,gBAAgB;EAChB,CAAC;CAEF,MAAM,SAAS,eAAe,gBAAgB;AAE9C,KAAI,OAAO,SAAS,GAAG;EACtB,MAAM,WAAW,OAAO,KAAK,MAAM,EAAE,UAAU,CAAC,CAAC,KAAK,+BAA+B;EACrF,MAAM,UAAU,OAAO,WAAW,IAAI,UAAU;AAChD,QAAM,IAAI,MAAM,yBAAyB,OAAO,OAAO,GAAG,QAAQ,OAAO,WAAW;;AAGrF,KAAI,CAAC,gBAAgB,WACpB,iBAAgB,aAAa,EAAE;AAGhC,QAAO;EACN;EACA,cAAc,0BAA0B,gBAAgB;EACxD;;;;ACzCF,MAAM,MAAM;AAMZ,SAAgB,gBAAgB,U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,SAAgB,gBAAgB;AAC/B,QAAO,eAAe;EACrB,MAAM;EACN,YAAY;EACZ,QAAQ,SAAS,SAAS,WAAW;GACpC,MAAM,gBAAgB,SAAsB;AAC3C,QAAI,QAAQ,KAAK,cAAc,QAAQ,QAAQ,CAC9C,QAAO,KAAK;;AAGd,WAAQ,GAAG,UAAU,aAAa;AAClC,WAAQ,GAAG,UAAU,aAAa;;EAEnC,UAAU,OAAO,KAAK,SAAS;GAC9B,MAAM,QAAQ,MAAM,SAAS,IAAI,kBAAkB,IAAI,YAAY,MAAM;AACzE,QAAK,MAAM,QAAQ,MAClB,KAAI,YAAY,aAAa,KAAK,UAAU,KAAK,SAAS,WAAW,KAAK,QAAQ;AAEnF,UAAO,MAAM;;EAEd,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@baeta/plugin-graphql",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.12",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"baeta",
|
|
6
6
|
"graphql",
|
|
@@ -38,8 +38,9 @@
|
|
|
38
38
|
],
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "builder build",
|
|
41
|
+
"check:deps": "builder check-deps",
|
|
41
42
|
"prepack": "builder prepare",
|
|
42
|
-
"postpack": "builder prepare --
|
|
43
|
+
"postpack": "builder prepare --restore",
|
|
43
44
|
"test": "builder test",
|
|
44
45
|
"test:circular": "builder test-circular",
|
|
45
46
|
"types": "tsc --noEmit"
|
|
@@ -52,17 +53,17 @@
|
|
|
52
53
|
"dependencies": {
|
|
53
54
|
"@baeta/generator-sdk": "^2.0.0-next.4",
|
|
54
55
|
"@baeta/util-path": "^2.0.0-next.3",
|
|
55
|
-
"@graphql-tools/graphql-file-loader": "^8.1.
|
|
56
|
-
"@graphql-tools/load": "^8.1.
|
|
57
|
-
"@graphql-tools/utils": "^
|
|
56
|
+
"@graphql-tools/graphql-file-loader": "^8.1.12",
|
|
57
|
+
"@graphql-tools/load": "^8.1.8",
|
|
58
|
+
"@graphql-tools/utils": "^11.0.0",
|
|
58
59
|
"change-case-all": "2.1.0"
|
|
59
60
|
},
|
|
60
61
|
"devDependencies": {
|
|
61
62
|
"@baeta/builder": "^0.0.0",
|
|
62
63
|
"@baeta/testing": "^0.0.0",
|
|
63
64
|
"@baeta/tsconfig": "^0.0.0",
|
|
64
|
-
"@types/node": "^22.19.
|
|
65
|
-
"graphql": "^16.
|
|
65
|
+
"@types/node": "^22.19.13",
|
|
66
|
+
"graphql": "^16.6.0",
|
|
66
67
|
"typescript": "^5.9.3"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|