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:
@@ -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"
|
||||
: "";
|
||||
|
||||
Reference in New Issue
Block a user