feat(csv-loader): preserve original schema strings in type generation

Store the original schema string during CSV parsing to prevent
unnecessary expansion of type name references in the generated
TypeScript definitions. This ensures that declared types reference
each other by name rather than inlining their full definitions.
This commit is contained in:
2026-04-22 17:08:06 +08:00
parent ea362d4229
commit 46504a53dd
4 changed files with 33 additions and 14 deletions
+1 -1
View File
@@ -51,7 +51,7 @@ export function generateTypeDefinition(
? typeDeclarations
.map(
(decl) =>
`export type ${decl.name} = ${schemaToTypeString(decl.schema, resourceNames)};`,
`export type ${decl.name} = ${decl.schemaString ?? schemaToTypeString(decl.schema, resourceNames)};`,
)
.join("\n") + "\n\n"
: "";