@soda-gql/tools 0.13.2 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.cjs +2958 -3777
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.d.cts +7 -223
- package/dist/bin.d.cts.map +1 -1
- package/dist/codegen.cjs +2896 -3741
- package/dist/codegen.cjs.map +1 -1
- package/dist/codegen.d.cts +8 -224
- package/dist/codegen.d.cts.map +1 -1
- package/dist/codegen.d.mts +10 -226
- package/dist/codegen.d.mts.map +1 -1
- package/dist/codegen.mjs +2836 -3730
- package/dist/codegen.mjs.map +1 -1
- package/dist/{formatter-D5rL2R7k.cjs → formatter-DnyPtv8R.cjs} +17 -174
- package/dist/formatter-DnyPtv8R.cjs.map +1 -0
- package/dist/formatter.cjs +16 -173
- package/dist/formatter.cjs.map +1 -1
- package/dist/formatter.d.cts +0 -2
- package/dist/formatter.d.cts.map +1 -1
- package/dist/formatter.d.mts +0 -2
- package/dist/formatter.d.mts.map +1 -1
- package/dist/formatter.mjs +16 -173
- package/dist/formatter.mjs.map +1 -1
- package/dist/typegen.cjs +92 -4
- package/dist/typegen.cjs.map +1 -1
- package/dist/typegen.d.cts +1 -1
- package/dist/typegen.d.cts.map +1 -1
- package/dist/typegen.d.mts +1 -1
- package/dist/typegen.d.mts.map +1 -1
- package/dist/typegen.mjs +94 -6
- package/dist/typegen.mjs.map +1 -1
- package/package.json +5 -5
- package/dist/formatter-D5rL2R7k.cjs.map +0 -1
package/dist/codegen.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { EnrichedFragment, EnrichedOperation, EnrichedVariable, GraphqlAnalysisError, GraphqlAnalysisError as GraphqlCompatError, InferredVariable, ParseResult, ParseResultBase, ParsedArgument, ParsedFieldSelection, ParsedFragment, ParsedFragmentSpread, ParsedInlineFragment, ParsedObjectField, ParsedOperation, ParsedSelection, ParsedValue, ParsedVariable, TransformOptions, TransformResult, TypeInfo, VariableUsage, collectVariableUsages, getArgumentType, getFieldReturnType, getInputFieldType, inferVariablesFromUsages, isModifierAssignable, mergeModifiers, mergeVariableUsages, sortFragmentsByDependency, transformParsedGraphql } from "@soda-gql/core";
|
|
1
2
|
import * as graphql0 from "graphql";
|
|
2
3
|
import { DocumentNode, TypeNode } from "graphql";
|
|
3
4
|
import * as neverthrow0 from "neverthrow";
|
|
4
5
|
import { Result } from "neverthrow";
|
|
5
|
-
import { DirectiveRecord, EnrichedFragment, EnrichedOperation, EnrichedVariable, EnumRecord, GraphqlAnalysisError, GraphqlAnalysisError as GraphqlCompatError, InferredVariable, InputRecord, ObjectRecord, OperationTypeNames, ParseResultBase as ParseResult, ParsedArgument, ParsedFieldSelection, ParsedFragment, ParsedFragmentSpread, ParsedInlineFragment, ParsedObjectField, ParsedOperation, ParsedSelection, ParsedValue, ParsedVariable, ScalarRecord, SchemaIndex as SchemaIndex$1, TransformOptions, TransformResult, TypeInfo, UnionRecord, createSchemaIndex } from "@soda-gql/core";
|
|
6
6
|
import { TypeCategory, TypeFilterConfig } from "@soda-gql/config";
|
|
7
7
|
|
|
8
8
|
//#region packages/tools/src/codegen/graphql-compat/types.d.ts
|
|
@@ -39,21 +39,21 @@ type EmitOptions = {
|
|
|
39
39
|
readonly graphqlSystemPath: string;
|
|
40
40
|
/** Schema document for type lookups (required for inline fragment support) */
|
|
41
41
|
readonly schemaDocument?: DocumentNode;
|
|
42
|
+
/** Operation document containing parsed definitions (for print-based emission) */
|
|
43
|
+
readonly operationDocument?: DocumentNode;
|
|
44
|
+
/** Cross-file fragment imports: fragmentName -> import path (same-file fragments are omitted) */
|
|
45
|
+
readonly fragmentImports?: ReadonlyMap<string, string>;
|
|
42
46
|
};
|
|
43
47
|
/**
|
|
44
48
|
* Emit TypeScript code for an operation.
|
|
45
49
|
*/
|
|
46
|
-
declare const emitOperation: (operation: EnrichedOperation, options: EmitOptions) =>
|
|
50
|
+
declare const emitOperation: (operation: EnrichedOperation, options: EmitOptions) => string;
|
|
47
51
|
/**
|
|
48
52
|
* Emit TypeScript code for a fragment.
|
|
49
53
|
*/
|
|
50
|
-
declare const emitFragment: (fragment: EnrichedFragment, options: EmitOptions) =>
|
|
54
|
+
declare const emitFragment: (fragment: EnrichedFragment, options: EmitOptions) => string;
|
|
51
55
|
//#endregion
|
|
52
56
|
//#region packages/tools/src/codegen/graphql-compat/parser.d.ts
|
|
53
|
-
/**
|
|
54
|
-
* Parse a single .graphql file and extract operations and fragments.
|
|
55
|
-
*/
|
|
56
|
-
declare const parseGraphqlFile: (filePath: string) => Result<ParseResult, GraphqlCompatError>;
|
|
57
57
|
/**
|
|
58
58
|
* Parse GraphQL source string directly.
|
|
59
59
|
*/
|
|
@@ -67,222 +67,6 @@ declare const parseGraphqlSource: (source: string, sourceFile: string) => Result
|
|
|
67
67
|
*/
|
|
68
68
|
declare const parseTypeNode: (node: TypeNode) => TypeInfo;
|
|
69
69
|
//#endregion
|
|
70
|
-
//#region packages/tools/src/codegen/defs-generator.d.ts
|
|
71
|
-
/**
|
|
72
|
-
* Definition file generator for split codegen.
|
|
73
|
-
* Generates separate files for each definition category (enums, inputs, objects, unions).
|
|
74
|
-
*/
|
|
75
|
-
type DefinitionCategory = "enums" | "inputs" | "objects" | "unions";
|
|
76
|
-
type DefinitionVar = {
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly code: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Split an array into chunks of the specified size.
|
|
82
|
-
*/
|
|
83
|
-
declare const chunkArray: <T>(array: readonly T[], size: number) => T[][];
|
|
84
|
-
/**
|
|
85
|
-
* Determine if chunking is needed based on the number of definitions.
|
|
86
|
-
*/
|
|
87
|
-
declare const needsChunking: (vars: readonly DefinitionVar[], chunkSize: number) => boolean;
|
|
88
|
-
type DefinitionFileOptions = {
|
|
89
|
-
readonly category: DefinitionCategory;
|
|
90
|
-
readonly schemaName: string;
|
|
91
|
-
readonly vars: readonly DefinitionVar[];
|
|
92
|
-
readonly needsDefineEnum: boolean;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Generate a single definition file content.
|
|
96
|
-
*/
|
|
97
|
-
declare const generateDefinitionFile: (options: DefinitionFileOptions) => string;
|
|
98
|
-
type ChunkFileOptions = {
|
|
99
|
-
readonly category: DefinitionCategory;
|
|
100
|
-
readonly schemaName: string;
|
|
101
|
-
readonly vars: readonly DefinitionVar[];
|
|
102
|
-
readonly chunkIndex: number;
|
|
103
|
-
readonly needsDefineEnum: boolean;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Generate a chunk file content.
|
|
107
|
-
*/
|
|
108
|
-
declare const generateChunkFile: (options: ChunkFileOptions) => string;
|
|
109
|
-
type ChunkIndexOptions = {
|
|
110
|
-
readonly category: DefinitionCategory;
|
|
111
|
-
readonly chunkCount: number;
|
|
112
|
-
readonly varNames: readonly string[];
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Generate the index file that re-exports all chunks.
|
|
116
|
-
*/
|
|
117
|
-
declare const generateChunkIndex: (options: ChunkIndexOptions) => string;
|
|
118
|
-
type ChunkedDefinitionFiles = {
|
|
119
|
-
readonly indexContent: string;
|
|
120
|
-
readonly chunks: ReadonlyArray<{
|
|
121
|
-
readonly chunkIndex: number;
|
|
122
|
-
readonly content: string;
|
|
123
|
-
readonly varNames: readonly string[];
|
|
124
|
-
}>;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Generate chunked definition files.
|
|
128
|
-
*/
|
|
129
|
-
declare const generateChunkedDefinitionFiles: (category: DefinitionCategory, schemaName: string, vars: readonly DefinitionVar[], chunkSize: number) => ChunkedDefinitionFiles;
|
|
130
|
-
type DefsDirectoryStructure = {
|
|
131
|
-
readonly files: ReadonlyArray<{
|
|
132
|
-
readonly relativePath: string;
|
|
133
|
-
readonly content: string;
|
|
134
|
-
}>;
|
|
135
|
-
readonly importPaths: Record<DefinitionCategory, string>;
|
|
136
|
-
};
|
|
137
|
-
type CategoryVars = {
|
|
138
|
-
readonly enums: readonly DefinitionVar[];
|
|
139
|
-
readonly inputs: readonly DefinitionVar[];
|
|
140
|
-
readonly objects: readonly DefinitionVar[];
|
|
141
|
-
readonly unions: readonly DefinitionVar[];
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Generate the complete _defs directory structure.
|
|
145
|
-
*/
|
|
146
|
-
declare const generateDefsStructure: (schemaName: string, categoryVars: CategoryVars, chunkSize: number) => DefsDirectoryStructure;
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region packages/tools/src/codegen/generator.d.ts
|
|
149
|
-
type DefsFile = {
|
|
150
|
-
readonly relativePath: string;
|
|
151
|
-
readonly content: string;
|
|
152
|
-
};
|
|
153
|
-
type GeneratedModule = {
|
|
154
|
-
readonly code: string;
|
|
155
|
-
readonly injectsCode?: string;
|
|
156
|
-
readonly defsFiles?: readonly DefsFile[];
|
|
157
|
-
readonly categoryVars?: Record<string, CategoryVars>;
|
|
158
|
-
readonly stats: {
|
|
159
|
-
readonly objects: number;
|
|
160
|
-
readonly enums: number;
|
|
161
|
-
readonly inputs: number;
|
|
162
|
-
readonly unions: number;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
type PerSchemaInjection = {
|
|
166
|
-
readonly scalarImportPath: string;
|
|
167
|
-
readonly adapterImportPath?: string;
|
|
168
|
-
};
|
|
169
|
-
type RuntimeGenerationOptions = {
|
|
170
|
-
readonly injection?: Map<string, PerSchemaInjection>;
|
|
171
|
-
readonly defaultInputDepth?: Map<string, number>;
|
|
172
|
-
readonly inputDepthOverrides?: Map<string, Readonly<Record<string, number>>>;
|
|
173
|
-
readonly chunkSize?: number;
|
|
174
|
-
readonly typeFilters?: Map<string, TypeFilterConfig>;
|
|
175
|
-
};
|
|
176
|
-
declare const generateMultiSchemaModule: (schemas: Map<string, DocumentNode>, options?: RuntimeGenerationOptions) => GeneratedModule;
|
|
177
|
-
/**
|
|
178
|
-
* Generate a stub `types.prebuilt.ts` file with empty PrebuiltTypes registries.
|
|
179
|
-
* This stub is only written when `types.prebuilt.ts` does not already exist.
|
|
180
|
-
* Typegen will later overwrite it with the real type registry.
|
|
181
|
-
*/
|
|
182
|
-
declare const generatePrebuiltStub: (schemaNames: string[]) => string;
|
|
183
|
-
/**
|
|
184
|
-
* Generate the `index.ts` module that re-exports from `_internal`
|
|
185
|
-
* and constructs the `gql` object from individual `__gql_*` exports.
|
|
186
|
-
*
|
|
187
|
-
* The `gql` object preserves the original inferred types from schema inference.
|
|
188
|
-
* PrebuiltContext types will be integrated once the type resolution strategy
|
|
189
|
-
* is redesigned to match the tagged template runtime API.
|
|
190
|
-
*/
|
|
191
|
-
declare const generateIndexModule: (schemaNames: string[], allFieldNames?: ReadonlyMap<string, readonly string[]>) => string;
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region packages/tools/src/codegen/graphql-compat/transformer.d.ts
|
|
194
|
-
/**
|
|
195
|
-
* Schema index type extracted from generator.
|
|
196
|
-
*/
|
|
197
|
-
type SchemaIndex = ReturnType<typeof createSchemaIndex>;
|
|
198
|
-
/**
|
|
199
|
-
* Check if source modifier can be assigned to target modifier.
|
|
200
|
-
* Implements GraphQL List Coercion: depth difference of 0 or 1 is allowed.
|
|
201
|
-
*
|
|
202
|
-
* Rules:
|
|
203
|
-
* - A single value can be coerced into a list (depth diff = 1)
|
|
204
|
-
* - At each level, non-null can be assigned to nullable (but not vice versa)
|
|
205
|
-
*
|
|
206
|
-
* @param source - The modifier of the value being assigned (variable's type)
|
|
207
|
-
* @param target - The modifier expected by the position (field argument's type)
|
|
208
|
-
* @returns true if assignment is valid
|
|
209
|
-
*/
|
|
210
|
-
declare const isModifierAssignable: (source: string, target: string) => boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Merge two modifiers by taking the stricter constraint at each level.
|
|
213
|
-
* - Non-null (!) is stricter than nullable (?)
|
|
214
|
-
* - List depths must match
|
|
215
|
-
*
|
|
216
|
-
* @param a - First modifier
|
|
217
|
-
* @param b - Second modifier
|
|
218
|
-
* @returns Merged modifier or error if incompatible
|
|
219
|
-
*/
|
|
220
|
-
declare const mergeModifiers: (a: string, b: string) => {
|
|
221
|
-
ok: true;
|
|
222
|
-
value: string;
|
|
223
|
-
} | {
|
|
224
|
-
ok: false;
|
|
225
|
-
reason: string;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Intermediate type for tracking variable usages before merging.
|
|
229
|
-
*/
|
|
230
|
-
type VariableUsage = {
|
|
231
|
-
readonly name: string;
|
|
232
|
-
readonly typeName: string;
|
|
233
|
-
/** The modifier expected by the field/argument position */
|
|
234
|
-
readonly expectedModifier: string;
|
|
235
|
-
/** The minimum modifier the variable needs (after applying List Coercion) */
|
|
236
|
-
readonly minimumModifier: string;
|
|
237
|
-
readonly typeKind: "scalar" | "enum" | "input";
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Get the expected type for a field argument from the schema.
|
|
241
|
-
* Returns null if the field or argument is not found.
|
|
242
|
-
*/
|
|
243
|
-
declare const getArgumentType: (schema: SchemaIndex, parentTypeName: string, fieldName: string, argumentName: string) => TypeInfo | null;
|
|
244
|
-
/**
|
|
245
|
-
* Get the expected type for an input object field from the schema.
|
|
246
|
-
*/
|
|
247
|
-
declare const getInputFieldType: (schema: SchemaIndex, inputTypeName: string, fieldName: string) => TypeInfo | null;
|
|
248
|
-
/**
|
|
249
|
-
* Recursively collect all variable usages from selections.
|
|
250
|
-
*/
|
|
251
|
-
declare const collectVariableUsages: (selections: readonly ParsedSelection[], parentTypeName: string, schema: SchemaIndex) => Result<VariableUsage[], GraphqlCompatError>;
|
|
252
|
-
/**
|
|
253
|
-
* Get the return type of a field (unwrapped from modifiers).
|
|
254
|
-
*/
|
|
255
|
-
declare const getFieldReturnType: (schema: SchemaIndex, parentTypeName: string, fieldName: string) => string | null;
|
|
256
|
-
/**
|
|
257
|
-
* Merge multiple variable usages into a single InferredVariable.
|
|
258
|
-
* Validates type compatibility and merges modifiers using List Coercion rules.
|
|
259
|
-
*
|
|
260
|
-
* The algorithm:
|
|
261
|
-
* 1. Validate all usages have the same type name
|
|
262
|
-
* 2. Merge minimumModifiers to find the candidate (shallowest type that could work)
|
|
263
|
-
* 3. Verify the candidate can satisfy ALL expected modifiers via isModifierAssignable
|
|
264
|
-
*/
|
|
265
|
-
declare const mergeVariableUsages: (variableName: string, usages: readonly VariableUsage[]) => Result<InferredVariable, GraphqlCompatError>;
|
|
266
|
-
/**
|
|
267
|
-
* Infer variables from collected usages.
|
|
268
|
-
* Groups by variable name and merges each group.
|
|
269
|
-
*/
|
|
270
|
-
declare const inferVariablesFromUsages: (usages: readonly VariableUsage[]) => Result<InferredVariable[], GraphqlCompatError>;
|
|
271
|
-
/**
|
|
272
|
-
* Topologically sort fragments so dependencies come before dependents.
|
|
273
|
-
* Detects circular dependencies.
|
|
274
|
-
*
|
|
275
|
-
* Note: Uses the existing collectFragmentDependencies function defined below.
|
|
276
|
-
*/
|
|
277
|
-
declare const sortFragmentsByDependency: (fragments: readonly ParsedFragment[]) => Result<ParsedFragment[], GraphqlCompatError>;
|
|
278
|
-
/**
|
|
279
|
-
* Transform parsed operations/fragments by enriching them with schema information.
|
|
280
|
-
*
|
|
281
|
-
* This resolves variable type kinds (scalar, enum, input), collects
|
|
282
|
-
* fragment dependencies, and infers variables for fragments.
|
|
283
|
-
*/
|
|
284
|
-
declare const transformParsedGraphql: (parsed: ParseResult, options: TransformOptions) => Result<TransformResult, GraphqlCompatError>;
|
|
285
|
-
//#endregion
|
|
286
70
|
//#region packages/tools/src/codegen/types.d.ts
|
|
287
71
|
type CodegenFormat = "json" | "human";
|
|
288
72
|
type CodegenInjectConfig = {
|
|
@@ -412,5 +196,5 @@ declare const loadSingleSchema: (schemaPath: string) => neverthrow0.Err<Document
|
|
|
412
196
|
declare const loadSchema: (schemaPaths: readonly string[]) => neverthrow0.Err<DocumentNode, CodegenError> | neverthrow0.Ok<DocumentNode, CodegenError>;
|
|
413
197
|
declare const hashSchema: (document: DocumentNode) => string;
|
|
414
198
|
//#endregion
|
|
415
|
-
export { type CodegenCliCommand, type CodegenError, type CodegenFormat, type CodegenInjectConfig, type CodegenOptions, type CodegenResult, type CodegenSchemaConfig, type CodegenSuccess, EmitOptions, type EnrichedFragment, type EnrichedOperation, type EnrichedVariable, GeneratedFile, type GraphqlAnalysisError, type GraphqlCompatError, GraphqlCompatOptions, type InferredVariable, type ParseResult, type ParsedArgument, type ParsedFieldSelection, type ParsedFragment, type ParsedFragmentSpread, type ParsedInlineFragment, type ParsedObjectField, type ParsedOperation, type ParsedSelection, type ParsedValue, type ParsedVariable, type TransformOptions, type TransformResult, type TypeInfo, collectVariableUsages, compileTypeFilter, computeReachabilityFilter, emitFragment, emitOperation, getArgumentType, getFieldReturnType, getInputFieldType, hashSchema, inferVariablesFromUsages, isModifierAssignable, loadSchema, mergeModifiers, mergeVariableUsages,
|
|
199
|
+
export { type CodegenCliCommand, type CodegenError, type CodegenFormat, type CodegenInjectConfig, type CodegenOptions, type CodegenResult, type CodegenSchemaConfig, type CodegenSuccess, EmitOptions, type EnrichedFragment, type EnrichedOperation, type EnrichedVariable, GeneratedFile, type GraphqlAnalysisError, type GraphqlCompatError, GraphqlCompatOptions, type InferredVariable, type ParseResult, type ParseResultBase, type ParsedArgument, type ParsedFieldSelection, type ParsedFragment, type ParsedFragmentSpread, type ParsedInlineFragment, type ParsedObjectField, type ParsedOperation, type ParsedSelection, type ParsedValue, type ParsedVariable, type TransformOptions, type TransformResult, type TypeInfo, type VariableUsage, collectVariableUsages, compileTypeFilter, computeReachabilityFilter, emitFragment, emitOperation, getArgumentType, getFieldReturnType, getInputFieldType, hashSchema, inferVariablesFromUsages, isModifierAssignable, loadSchema, mergeModifiers, mergeVariableUsages, parseGraphqlSource, parseTypeNode, runCodegen, sortFragmentsByDependency, transformParsedGraphql, writeInjectTemplate };
|
|
416
200
|
//# sourceMappingURL=codegen.d.cts.map
|
package/dist/codegen.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.cts","names":[],"sources":["../src/codegen/graphql-compat/types.ts","../src/codegen/graphql-compat/emitter.ts","../src/codegen/graphql-compat/parser.ts","../src/codegen/
|
|
1
|
+
{"version":3,"file":"codegen.d.cts","names":[],"sources":["../src/codegen/graphql-compat/types.ts","../src/codegen/graphql-compat/emitter.ts","../src/codegen/graphql-compat/parser.ts","../src/codegen/types.ts","../src/codegen/inject-template.ts","../src/codegen/type-filter.ts","../src/codegen/reachability.ts","../src/codegen/runner.ts","../src/codegen/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;ACcY,KDyBA,oBAAA,GCzBW;EAMK;EAEG,SAAA,UAAA,EAAA,MAAA;EAEF;EAAW,SAAA,cAAA,EAAA,SAAA,MAAA,EAAA;EA+F3B;EA8CA,SAAA,SAuBZ,CAAA,EAAA,MAvBsC;;;;AC5HvC;;;AAAwE,KFY5D,aAAA,GEZ4D;EAAM,SAAA,IAAA,EAAA,MAAA;EA8FjE,SAAA,OA8BZ,EAAA,MAAA;;;;AFhHD;;;KCvCY,WAAA;EAAA;EAMgB,SAAA,UAAA,EAAA,MAAA;EAEG;EAEF,SAAA,iBAAA,EAAA,MAAA;EAAW;EA+F3B,SAAA,cAyCZ,CAAA,EA5I2B,YAmGa;EA8C5B;+BA/IkB;;6BAEF;ACiB7B,CAAA;;;;AAA8E,cD8EjE,aC9EiE,EAAA,CAAA,SAAA,ED8ErC,iBC9EqC,EAAA,OAAA,ED8ET,WC9ES,EAAA,GAAA,MAAA;AA8F9E;;;cD8Ba,yBAA0B,2BAA2B;;;AD9HlE;AAcA;;cEZa,4DAA2D,OAAO,aAAa;;AD3B5F;;;;;AAyGA;AA8Ca,cC9BA,aD8B0B,EAAA,CAAA,IAAA,EC9BH,QD8B8B,EAAA,GC9BnB,QD8B8B;;;KElKjE,aAAA;KAGA,mBAAA;;;;KAMA,mBAAA;EH2BA,SAAA,MAAA,EAAA,SAAoB,MA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.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Result } from "neverthrow";
|
|
3
|
-
import { DirectiveRecord, EnrichedFragment, EnrichedOperation, EnrichedVariable, EnumRecord, GraphqlAnalysisError, GraphqlAnalysisError as GraphqlCompatError, InferredVariable, InputRecord, ObjectRecord, OperationTypeNames, ParseResultBase as ParseResult, ParsedArgument, ParsedFieldSelection, ParsedFragment, ParsedFragmentSpread, ParsedInlineFragment, ParsedObjectField, ParsedOperation, ParsedSelection, ParsedValue, ParsedVariable, ScalarRecord, SchemaIndex as SchemaIndex$1, TransformOptions, TransformResult, TypeInfo, UnionRecord, createSchemaIndex } from "@soda-gql/core";
|
|
1
|
+
import { EnrichedFragment, EnrichedOperation, EnrichedVariable, GraphqlAnalysisError, GraphqlAnalysisError as GraphqlCompatError, InferredVariable, ParseResult, ParseResultBase, ParsedArgument, ParsedFieldSelection, ParsedFragment, ParsedFragmentSpread, ParsedInlineFragment, ParsedObjectField, ParsedOperation, ParsedSelection, ParsedValue, ParsedVariable, TransformOptions, TransformResult, TypeInfo, VariableUsage, collectVariableUsages, getArgumentType, getFieldReturnType, getInputFieldType, inferVariablesFromUsages, isModifierAssignable, mergeModifiers, mergeVariableUsages, sortFragmentsByDependency, transformParsedGraphql } from "@soda-gql/core";
|
|
4
2
|
import * as graphql0 from "graphql";
|
|
5
3
|
import { DocumentNode, TypeNode } from "graphql";
|
|
4
|
+
import * as neverthrow0 from "neverthrow";
|
|
5
|
+
import { Result } from "neverthrow";
|
|
6
6
|
import { TypeCategory, TypeFilterConfig } from "@soda-gql/config";
|
|
7
7
|
|
|
8
8
|
//#region packages/tools/src/codegen/graphql-compat/types.d.ts
|
|
@@ -39,21 +39,21 @@ type EmitOptions = {
|
|
|
39
39
|
readonly graphqlSystemPath: string;
|
|
40
40
|
/** Schema document for type lookups (required for inline fragment support) */
|
|
41
41
|
readonly schemaDocument?: DocumentNode;
|
|
42
|
+
/** Operation document containing parsed definitions (for print-based emission) */
|
|
43
|
+
readonly operationDocument?: DocumentNode;
|
|
44
|
+
/** Cross-file fragment imports: fragmentName -> import path (same-file fragments are omitted) */
|
|
45
|
+
readonly fragmentImports?: ReadonlyMap<string, string>;
|
|
42
46
|
};
|
|
43
47
|
/**
|
|
44
48
|
* Emit TypeScript code for an operation.
|
|
45
49
|
*/
|
|
46
|
-
declare const emitOperation: (operation: EnrichedOperation, options: EmitOptions) =>
|
|
50
|
+
declare const emitOperation: (operation: EnrichedOperation, options: EmitOptions) => string;
|
|
47
51
|
/**
|
|
48
52
|
* Emit TypeScript code for a fragment.
|
|
49
53
|
*/
|
|
50
|
-
declare const emitFragment: (fragment: EnrichedFragment, options: EmitOptions) =>
|
|
54
|
+
declare const emitFragment: (fragment: EnrichedFragment, options: EmitOptions) => string;
|
|
51
55
|
//#endregion
|
|
52
56
|
//#region packages/tools/src/codegen/graphql-compat/parser.d.ts
|
|
53
|
-
/**
|
|
54
|
-
* Parse a single .graphql file and extract operations and fragments.
|
|
55
|
-
*/
|
|
56
|
-
declare const parseGraphqlFile: (filePath: string) => Result<ParseResult, GraphqlCompatError>;
|
|
57
57
|
/**
|
|
58
58
|
* Parse GraphQL source string directly.
|
|
59
59
|
*/
|
|
@@ -67,222 +67,6 @@ declare const parseGraphqlSource: (source: string, sourceFile: string) => Result
|
|
|
67
67
|
*/
|
|
68
68
|
declare const parseTypeNode: (node: TypeNode) => TypeInfo;
|
|
69
69
|
//#endregion
|
|
70
|
-
//#region packages/tools/src/codegen/defs-generator.d.ts
|
|
71
|
-
/**
|
|
72
|
-
* Definition file generator for split codegen.
|
|
73
|
-
* Generates separate files for each definition category (enums, inputs, objects, unions).
|
|
74
|
-
*/
|
|
75
|
-
type DefinitionCategory = "enums" | "inputs" | "objects" | "unions";
|
|
76
|
-
type DefinitionVar = {
|
|
77
|
-
readonly name: string;
|
|
78
|
-
readonly code: string;
|
|
79
|
-
};
|
|
80
|
-
/**
|
|
81
|
-
* Split an array into chunks of the specified size.
|
|
82
|
-
*/
|
|
83
|
-
declare const chunkArray: <T>(array: readonly T[], size: number) => T[][];
|
|
84
|
-
/**
|
|
85
|
-
* Determine if chunking is needed based on the number of definitions.
|
|
86
|
-
*/
|
|
87
|
-
declare const needsChunking: (vars: readonly DefinitionVar[], chunkSize: number) => boolean;
|
|
88
|
-
type DefinitionFileOptions = {
|
|
89
|
-
readonly category: DefinitionCategory;
|
|
90
|
-
readonly schemaName: string;
|
|
91
|
-
readonly vars: readonly DefinitionVar[];
|
|
92
|
-
readonly needsDefineEnum: boolean;
|
|
93
|
-
};
|
|
94
|
-
/**
|
|
95
|
-
* Generate a single definition file content.
|
|
96
|
-
*/
|
|
97
|
-
declare const generateDefinitionFile: (options: DefinitionFileOptions) => string;
|
|
98
|
-
type ChunkFileOptions = {
|
|
99
|
-
readonly category: DefinitionCategory;
|
|
100
|
-
readonly schemaName: string;
|
|
101
|
-
readonly vars: readonly DefinitionVar[];
|
|
102
|
-
readonly chunkIndex: number;
|
|
103
|
-
readonly needsDefineEnum: boolean;
|
|
104
|
-
};
|
|
105
|
-
/**
|
|
106
|
-
* Generate a chunk file content.
|
|
107
|
-
*/
|
|
108
|
-
declare const generateChunkFile: (options: ChunkFileOptions) => string;
|
|
109
|
-
type ChunkIndexOptions = {
|
|
110
|
-
readonly category: DefinitionCategory;
|
|
111
|
-
readonly chunkCount: number;
|
|
112
|
-
readonly varNames: readonly string[];
|
|
113
|
-
};
|
|
114
|
-
/**
|
|
115
|
-
* Generate the index file that re-exports all chunks.
|
|
116
|
-
*/
|
|
117
|
-
declare const generateChunkIndex: (options: ChunkIndexOptions) => string;
|
|
118
|
-
type ChunkedDefinitionFiles = {
|
|
119
|
-
readonly indexContent: string;
|
|
120
|
-
readonly chunks: ReadonlyArray<{
|
|
121
|
-
readonly chunkIndex: number;
|
|
122
|
-
readonly content: string;
|
|
123
|
-
readonly varNames: readonly string[];
|
|
124
|
-
}>;
|
|
125
|
-
};
|
|
126
|
-
/**
|
|
127
|
-
* Generate chunked definition files.
|
|
128
|
-
*/
|
|
129
|
-
declare const generateChunkedDefinitionFiles: (category: DefinitionCategory, schemaName: string, vars: readonly DefinitionVar[], chunkSize: number) => ChunkedDefinitionFiles;
|
|
130
|
-
type DefsDirectoryStructure = {
|
|
131
|
-
readonly files: ReadonlyArray<{
|
|
132
|
-
readonly relativePath: string;
|
|
133
|
-
readonly content: string;
|
|
134
|
-
}>;
|
|
135
|
-
readonly importPaths: Record<DefinitionCategory, string>;
|
|
136
|
-
};
|
|
137
|
-
type CategoryVars = {
|
|
138
|
-
readonly enums: readonly DefinitionVar[];
|
|
139
|
-
readonly inputs: readonly DefinitionVar[];
|
|
140
|
-
readonly objects: readonly DefinitionVar[];
|
|
141
|
-
readonly unions: readonly DefinitionVar[];
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* Generate the complete _defs directory structure.
|
|
145
|
-
*/
|
|
146
|
-
declare const generateDefsStructure: (schemaName: string, categoryVars: CategoryVars, chunkSize: number) => DefsDirectoryStructure;
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region packages/tools/src/codegen/generator.d.ts
|
|
149
|
-
type DefsFile = {
|
|
150
|
-
readonly relativePath: string;
|
|
151
|
-
readonly content: string;
|
|
152
|
-
};
|
|
153
|
-
type GeneratedModule = {
|
|
154
|
-
readonly code: string;
|
|
155
|
-
readonly injectsCode?: string;
|
|
156
|
-
readonly defsFiles?: readonly DefsFile[];
|
|
157
|
-
readonly categoryVars?: Record<string, CategoryVars>;
|
|
158
|
-
readonly stats: {
|
|
159
|
-
readonly objects: number;
|
|
160
|
-
readonly enums: number;
|
|
161
|
-
readonly inputs: number;
|
|
162
|
-
readonly unions: number;
|
|
163
|
-
};
|
|
164
|
-
};
|
|
165
|
-
type PerSchemaInjection = {
|
|
166
|
-
readonly scalarImportPath: string;
|
|
167
|
-
readonly adapterImportPath?: string;
|
|
168
|
-
};
|
|
169
|
-
type RuntimeGenerationOptions = {
|
|
170
|
-
readonly injection?: Map<string, PerSchemaInjection>;
|
|
171
|
-
readonly defaultInputDepth?: Map<string, number>;
|
|
172
|
-
readonly inputDepthOverrides?: Map<string, Readonly<Record<string, number>>>;
|
|
173
|
-
readonly chunkSize?: number;
|
|
174
|
-
readonly typeFilters?: Map<string, TypeFilterConfig>;
|
|
175
|
-
};
|
|
176
|
-
declare const generateMultiSchemaModule: (schemas: Map<string, DocumentNode>, options?: RuntimeGenerationOptions) => GeneratedModule;
|
|
177
|
-
/**
|
|
178
|
-
* Generate a stub `types.prebuilt.ts` file with empty PrebuiltTypes registries.
|
|
179
|
-
* This stub is only written when `types.prebuilt.ts` does not already exist.
|
|
180
|
-
* Typegen will later overwrite it with the real type registry.
|
|
181
|
-
*/
|
|
182
|
-
declare const generatePrebuiltStub: (schemaNames: string[]) => string;
|
|
183
|
-
/**
|
|
184
|
-
* Generate the `index.ts` module that re-exports from `_internal`
|
|
185
|
-
* and constructs the `gql` object from individual `__gql_*` exports.
|
|
186
|
-
*
|
|
187
|
-
* The `gql` object preserves the original inferred types from schema inference.
|
|
188
|
-
* PrebuiltContext types will be integrated once the type resolution strategy
|
|
189
|
-
* is redesigned to match the tagged template runtime API.
|
|
190
|
-
*/
|
|
191
|
-
declare const generateIndexModule: (schemaNames: string[], allFieldNames?: ReadonlyMap<string, readonly string[]>) => string;
|
|
192
|
-
//#endregion
|
|
193
|
-
//#region packages/tools/src/codegen/graphql-compat/transformer.d.ts
|
|
194
|
-
/**
|
|
195
|
-
* Schema index type extracted from generator.
|
|
196
|
-
*/
|
|
197
|
-
type SchemaIndex = ReturnType<typeof createSchemaIndex>;
|
|
198
|
-
/**
|
|
199
|
-
* Check if source modifier can be assigned to target modifier.
|
|
200
|
-
* Implements GraphQL List Coercion: depth difference of 0 or 1 is allowed.
|
|
201
|
-
*
|
|
202
|
-
* Rules:
|
|
203
|
-
* - A single value can be coerced into a list (depth diff = 1)
|
|
204
|
-
* - At each level, non-null can be assigned to nullable (but not vice versa)
|
|
205
|
-
*
|
|
206
|
-
* @param source - The modifier of the value being assigned (variable's type)
|
|
207
|
-
* @param target - The modifier expected by the position (field argument's type)
|
|
208
|
-
* @returns true if assignment is valid
|
|
209
|
-
*/
|
|
210
|
-
declare const isModifierAssignable: (source: string, target: string) => boolean;
|
|
211
|
-
/**
|
|
212
|
-
* Merge two modifiers by taking the stricter constraint at each level.
|
|
213
|
-
* - Non-null (!) is stricter than nullable (?)
|
|
214
|
-
* - List depths must match
|
|
215
|
-
*
|
|
216
|
-
* @param a - First modifier
|
|
217
|
-
* @param b - Second modifier
|
|
218
|
-
* @returns Merged modifier or error if incompatible
|
|
219
|
-
*/
|
|
220
|
-
declare const mergeModifiers: (a: string, b: string) => {
|
|
221
|
-
ok: true;
|
|
222
|
-
value: string;
|
|
223
|
-
} | {
|
|
224
|
-
ok: false;
|
|
225
|
-
reason: string;
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Intermediate type for tracking variable usages before merging.
|
|
229
|
-
*/
|
|
230
|
-
type VariableUsage = {
|
|
231
|
-
readonly name: string;
|
|
232
|
-
readonly typeName: string;
|
|
233
|
-
/** The modifier expected by the field/argument position */
|
|
234
|
-
readonly expectedModifier: string;
|
|
235
|
-
/** The minimum modifier the variable needs (after applying List Coercion) */
|
|
236
|
-
readonly minimumModifier: string;
|
|
237
|
-
readonly typeKind: "scalar" | "enum" | "input";
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Get the expected type for a field argument from the schema.
|
|
241
|
-
* Returns null if the field or argument is not found.
|
|
242
|
-
*/
|
|
243
|
-
declare const getArgumentType: (schema: SchemaIndex, parentTypeName: string, fieldName: string, argumentName: string) => TypeInfo | null;
|
|
244
|
-
/**
|
|
245
|
-
* Get the expected type for an input object field from the schema.
|
|
246
|
-
*/
|
|
247
|
-
declare const getInputFieldType: (schema: SchemaIndex, inputTypeName: string, fieldName: string) => TypeInfo | null;
|
|
248
|
-
/**
|
|
249
|
-
* Recursively collect all variable usages from selections.
|
|
250
|
-
*/
|
|
251
|
-
declare const collectVariableUsages: (selections: readonly ParsedSelection[], parentTypeName: string, schema: SchemaIndex) => Result<VariableUsage[], GraphqlCompatError>;
|
|
252
|
-
/**
|
|
253
|
-
* Get the return type of a field (unwrapped from modifiers).
|
|
254
|
-
*/
|
|
255
|
-
declare const getFieldReturnType: (schema: SchemaIndex, parentTypeName: string, fieldName: string) => string | null;
|
|
256
|
-
/**
|
|
257
|
-
* Merge multiple variable usages into a single InferredVariable.
|
|
258
|
-
* Validates type compatibility and merges modifiers using List Coercion rules.
|
|
259
|
-
*
|
|
260
|
-
* The algorithm:
|
|
261
|
-
* 1. Validate all usages have the same type name
|
|
262
|
-
* 2. Merge minimumModifiers to find the candidate (shallowest type that could work)
|
|
263
|
-
* 3. Verify the candidate can satisfy ALL expected modifiers via isModifierAssignable
|
|
264
|
-
*/
|
|
265
|
-
declare const mergeVariableUsages: (variableName: string, usages: readonly VariableUsage[]) => Result<InferredVariable, GraphqlCompatError>;
|
|
266
|
-
/**
|
|
267
|
-
* Infer variables from collected usages.
|
|
268
|
-
* Groups by variable name and merges each group.
|
|
269
|
-
*/
|
|
270
|
-
declare const inferVariablesFromUsages: (usages: readonly VariableUsage[]) => Result<InferredVariable[], GraphqlCompatError>;
|
|
271
|
-
/**
|
|
272
|
-
* Topologically sort fragments so dependencies come before dependents.
|
|
273
|
-
* Detects circular dependencies.
|
|
274
|
-
*
|
|
275
|
-
* Note: Uses the existing collectFragmentDependencies function defined below.
|
|
276
|
-
*/
|
|
277
|
-
declare const sortFragmentsByDependency: (fragments: readonly ParsedFragment[]) => Result<ParsedFragment[], GraphqlCompatError>;
|
|
278
|
-
/**
|
|
279
|
-
* Transform parsed operations/fragments by enriching them with schema information.
|
|
280
|
-
*
|
|
281
|
-
* This resolves variable type kinds (scalar, enum, input), collects
|
|
282
|
-
* fragment dependencies, and infers variables for fragments.
|
|
283
|
-
*/
|
|
284
|
-
declare const transformParsedGraphql: (parsed: ParseResult, options: TransformOptions) => Result<TransformResult, GraphqlCompatError>;
|
|
285
|
-
//#endregion
|
|
286
70
|
//#region packages/tools/src/codegen/types.d.ts
|
|
287
71
|
type CodegenFormat = "json" | "human";
|
|
288
72
|
type CodegenInjectConfig = {
|
|
@@ -412,5 +196,5 @@ declare const loadSingleSchema: (schemaPath: string) => neverthrow0.Err<Document
|
|
|
412
196
|
declare const loadSchema: (schemaPaths: readonly string[]) => neverthrow0.Err<DocumentNode, CodegenError> | neverthrow0.Ok<DocumentNode, CodegenError>;
|
|
413
197
|
declare const hashSchema: (document: DocumentNode) => string;
|
|
414
198
|
//#endregion
|
|
415
|
-
export { type CodegenCliCommand, type CodegenError, type CodegenFormat, type CodegenInjectConfig, type CodegenOptions, type CodegenResult, type CodegenSchemaConfig, type CodegenSuccess, EmitOptions, type EnrichedFragment, type EnrichedOperation, type EnrichedVariable, GeneratedFile, type GraphqlAnalysisError, type GraphqlCompatError, GraphqlCompatOptions, type InferredVariable, type ParseResult, type ParsedArgument, type ParsedFieldSelection, type ParsedFragment, type ParsedFragmentSpread, type ParsedInlineFragment, type ParsedObjectField, type ParsedOperation, type ParsedSelection, type ParsedValue, type ParsedVariable, type TransformOptions, type TransformResult, type TypeInfo, collectVariableUsages, compileTypeFilter, computeReachabilityFilter, emitFragment, emitOperation, getArgumentType, getFieldReturnType, getInputFieldType, hashSchema, inferVariablesFromUsages, isModifierAssignable, loadSchema, mergeModifiers, mergeVariableUsages,
|
|
199
|
+
export { type CodegenCliCommand, type CodegenError, type CodegenFormat, type CodegenInjectConfig, type CodegenOptions, type CodegenResult, type CodegenSchemaConfig, type CodegenSuccess, EmitOptions, type EnrichedFragment, type EnrichedOperation, type EnrichedVariable, GeneratedFile, type GraphqlAnalysisError, type GraphqlCompatError, GraphqlCompatOptions, type InferredVariable, type ParseResult, type ParseResultBase, type ParsedArgument, type ParsedFieldSelection, type ParsedFragment, type ParsedFragmentSpread, type ParsedInlineFragment, type ParsedObjectField, type ParsedOperation, type ParsedSelection, type ParsedValue, type ParsedVariable, type TransformOptions, type TransformResult, type TypeInfo, type VariableUsage, collectVariableUsages, compileTypeFilter, computeReachabilityFilter, emitFragment, emitOperation, getArgumentType, getFieldReturnType, getInputFieldType, hashSchema, inferVariablesFromUsages, isModifierAssignable, loadSchema, mergeModifiers, mergeVariableUsages, parseGraphqlSource, parseTypeNode, runCodegen, sortFragmentsByDependency, transformParsedGraphql, writeInjectTemplate };
|
|
416
200
|
//# sourceMappingURL=codegen.d.mts.map
|
package/dist/codegen.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"codegen.d.mts","names":[],"sources":["../src/codegen/graphql-compat/types.ts","../src/codegen/graphql-compat/emitter.ts","../src/codegen/graphql-compat/parser.ts","../src/codegen/
|
|
1
|
+
{"version":3,"file":"codegen.d.mts","names":[],"sources":["../src/codegen/graphql-compat/types.ts","../src/codegen/graphql-compat/emitter.ts","../src/codegen/graphql-compat/parser.ts","../src/codegen/types.ts","../src/codegen/inject-template.ts","../src/codegen/type-filter.ts","../src/codegen/reachability.ts","../src/codegen/runner.ts","../src/codegen/schema.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;ACcY,KDyBA,oBAAA,GCzBW;EAMK;EAEG,SAAA,UAAA,EAAA,MAAA;EAEF;EAAW,SAAA,cAAA,EAAA,SAAA,MAAA,EAAA;EA+F3B;EA8CA,SAAA,SAuBZ,CAAA,EAAA,MAvBsC;;;;AC5HvC;;;AAAwE,KFY5D,aAAA,GEZ4D;EAAM,SAAA,IAAA,EAAA,MAAA;EA8FjE,SAAA,OA8BZ,EAAA,MAAA;;;;AFhHD;;;KCvCY,WAAA;EAAA;EAMgB,SAAA,UAAA,EAAA,MAAA;EAEG;EAEF,SAAA,iBAAA,EAAA,MAAA;EAAW;EA+F3B,SAAA,cAyCZ,CAAA,EA5I2B,YAmGa;EA8C5B;+BA/IkB;;6BAEF;ACiB7B,CAAA;;;;AAA8E,cD8EjE,aC9EiE,EAAA,CAAA,SAAA,ED8ErC,iB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