@kubb/plugin-ts 5.0.0-alpha.9 → 5.0.0-beta.100

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.
Files changed (41) hide show
  1. package/LICENSE +17 -10
  2. package/README.md +38 -23
  3. package/dist/index.cjs +2376 -5
  4. package/dist/index.cjs.map +1 -0
  5. package/dist/index.d.ts +941 -40
  6. package/dist/index.js +2321 -2
  7. package/dist/index.js.map +1 -0
  8. package/dist/rolldown-runtime-CNktS9qV.js +17 -0
  9. package/package.json +38 -74
  10. package/dist/chunk--u3MIqq1.js +0 -8
  11. package/dist/components-CRu8IKY3.js +0 -729
  12. package/dist/components-CRu8IKY3.js.map +0 -1
  13. package/dist/components-DeNDKlzf.cjs +0 -982
  14. package/dist/components-DeNDKlzf.cjs.map +0 -1
  15. package/dist/components.cjs +0 -3
  16. package/dist/components.d.ts +0 -36
  17. package/dist/components.js +0 -2
  18. package/dist/generators.cjs +0 -4
  19. package/dist/generators.d.ts +0 -509
  20. package/dist/generators.js +0 -2
  21. package/dist/plugin-BZkBwnEA.js +0 -1269
  22. package/dist/plugin-BZkBwnEA.js.map +0 -1
  23. package/dist/plugin-Bunz1oGa.cjs +0 -1322
  24. package/dist/plugin-Bunz1oGa.cjs.map +0 -1
  25. package/dist/types-mSXmB8WU.d.ts +0 -298
  26. package/src/components/Type.tsx +0 -190
  27. package/src/components/index.ts +0 -1
  28. package/src/components/v2/Enum.tsx +0 -67
  29. package/src/components/v2/Type.tsx +0 -59
  30. package/src/constants.ts +0 -29
  31. package/src/factory.ts +0 -726
  32. package/src/generators/index.ts +0 -2
  33. package/src/generators/typeGenerator.tsx +0 -468
  34. package/src/generators/v2/typeGenerator.tsx +0 -167
  35. package/src/generators/v2/utils.ts +0 -140
  36. package/src/index.ts +0 -3
  37. package/src/parser.ts +0 -389
  38. package/src/plugin.ts +0 -232
  39. package/src/printer.ts +0 -368
  40. package/src/resolverTs.ts +0 -77
  41. package/src/types.ts +0 -296
@@ -1,2 +0,0 @@
1
- export { typeGenerator } from './typeGenerator.tsx'
2
- export { typeGenerator as typeGeneratorV2 } from './v2/typeGenerator.tsx'
@@ -1,468 +0,0 @@
1
- import { pascalCase } from '@internals/utils'
2
- import type { PluginDriver } from '@kubb/core'
3
- import { useMode, usePluginDriver } from '@kubb/core/hooks'
4
- import { safePrint } from '@kubb/fabric-core/parsers/typescript'
5
- import type { Operation } from '@kubb/oas'
6
- import { isKeyword, type OperationSchemas, type OperationSchema as OperationSchemaType, SchemaGenerator, schemaKeywords } from '@kubb/plugin-oas'
7
- import { createReactGenerator } from '@kubb/plugin-oas/generators'
8
- import { useOas, useOperationManager, useSchemaManager } from '@kubb/plugin-oas/hooks'
9
- import { applyParamsCasing, getBanner, getFooter, getImports, isParameterSchema } from '@kubb/plugin-oas/utils'
10
- import { File } from '@kubb/react-fabric'
11
- import ts from 'typescript'
12
- import { Type } from '../components'
13
- import * as factory from '../factory.ts'
14
- import { createUrlTemplateType, getUnknownType, keywordTypeNodes } from '../factory.ts'
15
- import { pluginTsName } from '../plugin.ts'
16
- import type { PluginTs } from '../types'
17
-
18
- function printCombinedSchema({ name, schemas, driver }: { name: string; schemas: OperationSchemas; driver: PluginDriver }): string {
19
- const properties: Record<string, ts.TypeNode> = {}
20
-
21
- if (schemas.response) {
22
- properties['response'] = factory.createUnionDeclaration({
23
- nodes: schemas.responses.map((res) => {
24
- const identifier = driver.resolveName({
25
- name: res.name,
26
- pluginName: pluginTsName,
27
- type: 'function',
28
- })
29
-
30
- return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
31
- }),
32
- })!
33
- }
34
-
35
- if (schemas.request) {
36
- const identifier = driver.resolveName({
37
- name: schemas.request.name,
38
- pluginName: pluginTsName,
39
- type: 'function',
40
- })
41
- properties['request'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
42
- }
43
-
44
- if (schemas.pathParams) {
45
- const identifier = driver.resolveName({
46
- name: schemas.pathParams.name,
47
- pluginName: pluginTsName,
48
- type: 'function',
49
- })
50
- properties['pathParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
51
- }
52
-
53
- if (schemas.queryParams) {
54
- const identifier = driver.resolveName({
55
- name: schemas.queryParams.name,
56
- pluginName: pluginTsName,
57
- type: 'function',
58
- })
59
- properties['queryParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
60
- }
61
-
62
- if (schemas.headerParams) {
63
- const identifier = driver.resolveName({
64
- name: schemas.headerParams.name,
65
- pluginName: pluginTsName,
66
- type: 'function',
67
- })
68
- properties['headerParams'] = factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
69
- }
70
-
71
- if (schemas.errors) {
72
- properties['errors'] = factory.createUnionDeclaration({
73
- nodes: schemas.errors.map((error) => {
74
- const identifier = driver.resolveName({
75
- name: error.name,
76
- pluginName: pluginTsName,
77
- type: 'function',
78
- })
79
-
80
- return factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined)
81
- }),
82
- })!
83
- }
84
-
85
- const namespaceNode = factory.createTypeAliasDeclaration({
86
- name,
87
- type: factory.createTypeLiteralNode(
88
- Object.keys(properties)
89
- .map((key) => {
90
- const type = properties[key]
91
- if (!type) {
92
- return undefined
93
- }
94
-
95
- return factory.createPropertySignature({
96
- name: pascalCase(key),
97
- type,
98
- })
99
- })
100
- .filter(Boolean),
101
- ),
102
- modifiers: [factory.modifiers.export],
103
- })
104
-
105
- return safePrint(namespaceNode)
106
- }
107
-
108
- function printRequestSchema({
109
- baseName,
110
- operation,
111
- schemas,
112
- driver,
113
- }: {
114
- baseName: string
115
- operation: Operation
116
- schemas: OperationSchemas
117
- driver: PluginDriver
118
- }): string {
119
- const name = driver.resolveName({
120
- name: `${baseName} Request`,
121
- pluginName: pluginTsName,
122
- type: 'type',
123
- })
124
-
125
- const results: string[] = []
126
-
127
- // Generate DataRequest type
128
- const dataRequestProperties: ts.PropertySignature[] = []
129
-
130
- if (schemas.request) {
131
- const identifier = driver.resolveName({
132
- name: schemas.request.name,
133
- pluginName: pluginTsName,
134
- type: 'type',
135
- })
136
- dataRequestProperties.push(
137
- factory.createPropertySignature({
138
- name: 'data',
139
- questionToken: true,
140
- type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),
141
- }),
142
- )
143
- } else {
144
- dataRequestProperties.push(
145
- factory.createPropertySignature({
146
- name: 'data',
147
- questionToken: true,
148
- type: keywordTypeNodes.never,
149
- }),
150
- )
151
- }
152
-
153
- // Add pathParams property
154
- if (schemas.pathParams) {
155
- const identifier = driver.resolveName({
156
- name: schemas.pathParams.name,
157
- pluginName: pluginTsName,
158
- type: 'type',
159
- })
160
- dataRequestProperties.push(
161
- factory.createPropertySignature({
162
- name: 'pathParams',
163
- type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),
164
- }),
165
- )
166
- } else {
167
- dataRequestProperties.push(
168
- factory.createPropertySignature({
169
- name: 'pathParams',
170
- questionToken: true,
171
- type: keywordTypeNodes.never,
172
- }),
173
- )
174
- }
175
-
176
- // Add queryParams property
177
- if (schemas.queryParams) {
178
- const identifier = driver.resolveName({
179
- name: schemas.queryParams.name,
180
- pluginName: pluginTsName,
181
- type: 'type',
182
- })
183
- dataRequestProperties.push(
184
- factory.createPropertySignature({
185
- name: 'queryParams',
186
- questionToken: true,
187
- type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),
188
- }),
189
- )
190
- } else {
191
- dataRequestProperties.push(
192
- factory.createPropertySignature({
193
- name: 'queryParams',
194
- questionToken: true,
195
- type: keywordTypeNodes.never,
196
- }),
197
- )
198
- }
199
-
200
- // Add headerParams property
201
- if (schemas.headerParams) {
202
- const identifier = driver.resolveName({
203
- name: schemas.headerParams.name,
204
- pluginName: pluginTsName,
205
- type: 'type',
206
- })
207
- dataRequestProperties.push(
208
- factory.createPropertySignature({
209
- name: 'headerParams',
210
- questionToken: true,
211
- type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),
212
- }),
213
- )
214
- } else {
215
- dataRequestProperties.push(
216
- factory.createPropertySignature({
217
- name: 'headerParams',
218
- questionToken: true,
219
- type: keywordTypeNodes.never,
220
- }),
221
- )
222
- }
223
-
224
- // Add url property with template literal type
225
- dataRequestProperties.push(
226
- factory.createPropertySignature({
227
- name: 'url',
228
- type: createUrlTemplateType(operation.path),
229
- }),
230
- )
231
-
232
- const dataRequestNode = factory.createTypeAliasDeclaration({
233
- name,
234
- type: factory.createTypeLiteralNode(dataRequestProperties),
235
- modifiers: [factory.modifiers.export],
236
- })
237
-
238
- results.push(safePrint(dataRequestNode))
239
-
240
- return results.join('\n\n')
241
- }
242
-
243
- function printResponseSchema({
244
- baseName,
245
- schemas,
246
- driver,
247
- unknownType,
248
- }: {
249
- baseName: string
250
- schemas: OperationSchemas
251
- driver: PluginDriver
252
- unknownType: PluginTs['resolvedOptions']['unknownType']
253
- }): string {
254
- const results: string[] = []
255
-
256
- const name = driver.resolveName({
257
- name: `${baseName} ResponseData`,
258
- pluginName: pluginTsName,
259
- type: 'type',
260
- })
261
-
262
- // Generate Responses type (mapping status codes to response types)
263
- if (schemas.responses && schemas.responses.length > 0) {
264
- const responsesProperties: ts.PropertySignature[] = schemas.responses.map((res) => {
265
- const identifier = driver.resolveName({
266
- name: res.name,
267
- pluginName: pluginTsName,
268
- type: 'type',
269
- })
270
-
271
- return factory.createPropertySignature({
272
- name: res.statusCode?.toString() ?? 'default',
273
- type: factory.createTypeReferenceNode(factory.createIdentifier(identifier), undefined),
274
- })
275
- })
276
-
277
- const responsesNode = factory.createTypeAliasDeclaration({
278
- name: `${baseName}Responses`,
279
- type: factory.createTypeLiteralNode(responsesProperties),
280
- modifiers: [factory.modifiers.export],
281
- })
282
-
283
- results.push(safePrint(responsesNode))
284
-
285
- // Generate Response type (union via indexed access)
286
- const responseNode = factory.createTypeAliasDeclaration({
287
- name,
288
- type: factory.createIndexedAccessTypeNode(
289
- factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),
290
- factory.createTypeOperatorNode(
291
- ts.SyntaxKind.KeyOfKeyword,
292
- factory.createTypeReferenceNode(factory.createIdentifier(`${baseName}Responses`), undefined),
293
- ),
294
- ),
295
- modifiers: [factory.modifiers.export],
296
- })
297
-
298
- results.push(safePrint(responseNode))
299
- } else {
300
- const responseNode = factory.createTypeAliasDeclaration({
301
- name,
302
- modifiers: [factory.modifiers.export],
303
- type: getUnknownType(unknownType),
304
- })
305
-
306
- results.push(safePrint(responseNode))
307
- }
308
-
309
- return results.join('\n\n')
310
- }
311
-
312
- export const typeGenerator = createReactGenerator<PluginTs>({
313
- name: 'typescript',
314
- Operation({ operation, generator, plugin }) {
315
- const {
316
- options,
317
- options: { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, unknownType, paramsCasing },
318
- } = plugin
319
-
320
- const mode = useMode()
321
- const driver = usePluginDriver()
322
-
323
- const oas = useOas()
324
- const { getSchemas, getFile, getName, getGroup } = useOperationManager(generator)
325
- const schemaManager = useSchemaManager()
326
-
327
- const name = getName(operation, { type: 'type', pluginName: pluginTsName })
328
-
329
- const file = getFile(operation)
330
- const schemas = getSchemas(operation)
331
- const schemaGenerator = new SchemaGenerator(options, {
332
- fabric: generator.context.fabric,
333
- oas,
334
- events: generator.context.events,
335
- plugin,
336
- driver,
337
- mode,
338
- override: options.override,
339
- })
340
-
341
- const operationSchemas = [schemas.pathParams, schemas.queryParams, schemas.headerParams, schemas.statusCodes, schemas.request, schemas.response]
342
- .flat()
343
- .filter(Boolean)
344
-
345
- const mapOperationSchema = ({ name, schema, description, keysToOmit, ...options }: OperationSchemaType) => {
346
- // Apply paramsCasing transformation to pathParams, queryParams, and headerParams (not response)
347
- const shouldTransform = paramsCasing && isParameterSchema(name)
348
- const transformedSchema = shouldTransform ? applyParamsCasing(schema, paramsCasing) : schema
349
-
350
- const tree = schemaGenerator.parse({ schema: transformedSchema, name, parentName: null })
351
- const imports = getImports(tree)
352
- const group = options.operation ? getGroup(options.operation) : undefined
353
-
354
- const type = {
355
- name: schemaManager.getName(name, { type: 'type' }),
356
- typedName: schemaManager.getName(name, { type: 'type' }),
357
- file: schemaManager.getFile(options.operationName || name, { group }),
358
- }
359
-
360
- return (
361
- <>
362
- {mode === 'split' &&
363
- imports.map((imp) => (
364
- <File.Import key={[name, imp.name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />
365
- ))}
366
- <Type
367
- name={type.name}
368
- typedName={type.typedName}
369
- description={description}
370
- tree={tree}
371
- schema={transformedSchema}
372
- enumType={enumType}
373
- enumKeyCasing={enumKeyCasing}
374
- optionalType={optionalType}
375
- arrayType={arrayType}
376
- keysToOmit={keysToOmit}
377
- syntaxType={syntaxType}
378
- />
379
- </>
380
- )
381
- }
382
-
383
- const responseName = schemaManager.getName(schemas.response.name, {
384
- type: 'type',
385
- })
386
-
387
- const combinedSchemaName = operation.method === 'get' ? `${name}Query` : `${name}Mutation`
388
-
389
- return (
390
- <File
391
- baseName={file.baseName}
392
- path={file.path}
393
- meta={file.meta}
394
- banner={getBanner({ oas, output: plugin.options.output, config: driver.config })}
395
- footer={getFooter({ oas, output: plugin.options.output })}
396
- >
397
- {operationSchemas.map(mapOperationSchema)}
398
-
399
- {generator.context.UNSTABLE_NAMING ? (
400
- <>
401
- <File.Source name={`${name}Request`} isExportable isIndexable isTypeOnly>
402
- {printRequestSchema({ baseName: name, operation, schemas, driver })}
403
- </File.Source>
404
- <File.Source name={responseName} isExportable isIndexable isTypeOnly>
405
- {printResponseSchema({ baseName: name, schemas, driver, unknownType })}
406
- </File.Source>
407
- </>
408
- ) : (
409
- <File.Source name={combinedSchemaName} isExportable isIndexable isTypeOnly>
410
- {printCombinedSchema({ name: combinedSchemaName, schemas, driver })}
411
- </File.Source>
412
- )}
413
- </File>
414
- )
415
- },
416
- Schema({ schema, plugin }) {
417
- const {
418
- options: { enumType, enumKeyCasing, syntaxType, optionalType, arrayType, output },
419
- } = plugin
420
- const mode = useMode()
421
-
422
- const oas = useOas()
423
- const driver = usePluginDriver()
424
-
425
- const { getName, getFile } = useSchemaManager()
426
- const imports = getImports(schema.tree)
427
- const schemaFromTree = schema.tree.find((item) => item.keyword === schemaKeywords.schema)
428
-
429
- let typedName = getName(schema.name, { type: 'type' })
430
-
431
- if (['asConst', 'asPascalConst'].includes(enumType) && schemaFromTree && isKeyword(schemaFromTree, schemaKeywords.enum)) {
432
- typedName = typedName += 'Key' //Suffix for avoiding collisions (https://github.com/kubb-labs/kubb/issues/1873)
433
- }
434
-
435
- const type = {
436
- name: getName(schema.name, { type: 'function' }),
437
- typedName,
438
- file: getFile(schema.name),
439
- }
440
-
441
- return (
442
- <File
443
- baseName={type.file.baseName}
444
- path={type.file.path}
445
- meta={type.file.meta}
446
- banner={getBanner({ oas, output, config: driver.config })}
447
- footer={getFooter({ oas, output })}
448
- >
449
- {mode === 'split' &&
450
- imports.map((imp) => (
451
- <File.Import key={[schema.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />
452
- ))}
453
- <Type
454
- name={type.name}
455
- typedName={type.typedName}
456
- description={schema.value.description}
457
- tree={schema.tree}
458
- schema={schema.value}
459
- enumType={enumType}
460
- enumKeyCasing={enumKeyCasing}
461
- optionalType={optionalType}
462
- arrayType={arrayType}
463
- syntaxType={syntaxType}
464
- />
465
- </File>
466
- )
467
- },
468
- })
@@ -1,167 +0,0 @@
1
- import { applyParamsCasing } from '@kubb/ast'
2
- import type { SchemaNode } from '@kubb/ast/types'
3
- import { defineGenerator } from '@kubb/core'
4
- import { useKubb } from '@kubb/core/hooks'
5
- import { File } from '@kubb/react-fabric'
6
- import { Type } from '../../components/v2/Type.tsx'
7
- import { ENUM_TYPES_WITH_KEY_SUFFIX } from '../../constants.ts'
8
- import { resolverTs } from '../../resolverTs.ts'
9
- import type { PluginTs } from '../../types'
10
- import { buildDataSchemaNode, buildResponsesSchemaNode, buildResponseUnionSchemaNode } from './utils.ts'
11
-
12
- export const typeGenerator = defineGenerator<PluginTs>({
13
- name: 'typescript',
14
- type: 'react',
15
- Operation({ node, adapter, options }) {
16
- const { enumType, enumKeyCasing, optionalType, arrayType, syntaxType, paramsCasing, group } = options
17
- const { mode, getFile, resolveName, resolveBanner, resolveFooter } = useKubb<PluginTs>()
18
-
19
- const file = getFile({
20
- name: node.operationId,
21
- extname: '.ts',
22
- mode,
23
- options: {
24
- group: group ? (group.type === 'tag' ? { tag: node.tags[0] } : { path: node.path }) : undefined,
25
- },
26
- })
27
- const params = applyParamsCasing(node.parameters, paramsCasing)
28
-
29
- function renderSchemaType({
30
- node: schemaNode,
31
- name,
32
- typedName,
33
- description,
34
- }: {
35
- node: SchemaNode | null
36
- name: string
37
- typedName: string
38
- description?: string
39
- }) {
40
- if (!schemaNode) {
41
- return null
42
- }
43
-
44
- const imports = adapter.getImports(schemaNode, (schemaName) => ({
45
- name: resolveName({ name: schemaName, type: 'type' }),
46
- path: getFile({ name: schemaName, extname: '.ts', mode }).path,
47
- }))
48
-
49
- return (
50
- <>
51
- {mode === 'split' &&
52
- imports.map((imp) => <File.Import key={[name, imp.path, imp.isTypeOnly].join('-')} root={file.path} path={imp.path} name={imp.name} isTypeOnly />)}
53
- <Type
54
- name={name}
55
- typedName={typedName}
56
- node={schemaNode}
57
- description={description}
58
- enumType={enumType}
59
- enumKeyCasing={enumKeyCasing}
60
- optionalType={optionalType}
61
- arrayType={arrayType}
62
- syntaxType={syntaxType}
63
- />
64
- </>
65
- )
66
- }
67
-
68
- const paramTypes = params.map((param) =>
69
- renderSchemaType({
70
- node: param.schema,
71
- name: resolverTs.resolveParamName(node, param),
72
- typedName: resolverTs.resolveParamTypedName(node, param),
73
- }),
74
- )
75
-
76
- const responseTypes = node.responses.map((res) =>
77
- renderSchemaType({
78
- node: res.schema,
79
- name: resolverTs.resolveResponseStatusName(node, res.statusCode),
80
- typedName: resolverTs.resolveResponseStatusTypedName(node, res.statusCode),
81
- description: res.description,
82
- }),
83
- )
84
-
85
- const requestType = node.requestBody
86
- ? renderSchemaType({
87
- node: node.requestBody,
88
- name: resolverTs.resolveDataName(node),
89
- typedName: resolverTs.resolveDataTypedName(node),
90
- description: node.requestBody.description,
91
- })
92
- : null
93
-
94
- const dataType = renderSchemaType({
95
- node: buildDataSchemaNode({ node: { ...node, parameters: params }, resolveName }),
96
- name: resolverTs.resolveRequestConfigName(node),
97
- typedName: resolverTs.resolveRequestConfigTypedName(node),
98
- })
99
-
100
- const responsesType = renderSchemaType({
101
- node: buildResponsesSchemaNode({ node, resolveName }),
102
- name: resolverTs.resolveResponsesName(node),
103
- typedName: resolverTs.resolveResponsesTypedName(node),
104
- })
105
-
106
- const responseType = renderSchemaType({
107
- node: buildResponseUnionSchemaNode({ node, resolveName }),
108
- name: resolverTs.resolveResponseName(node),
109
- typedName: resolverTs.resolveResponseTypedName(node),
110
- description: 'Union of all possible responses',
111
- })
112
-
113
- return (
114
- <File baseName={file.baseName} path={file.path} meta={file.meta} banner={resolveBanner()} footer={resolveFooter()}>
115
- {paramTypes}
116
- {responseTypes}
117
- {requestType}
118
- {dataType}
119
- {responsesType}
120
- {responseType}
121
- </File>
122
- )
123
- },
124
- Schema({ node, adapter, options }) {
125
- const { enumType, enumKeyCasing, syntaxType, optionalType, arrayType } = options
126
- const { mode, resolveName, getFile, resolveBanner, resolveFooter } = useKubb<PluginTs>()
127
-
128
- if (!node.name) {
129
- return
130
- }
131
-
132
- const imports = adapter.getImports(node, (schemaName) => ({
133
- name: resolveName({ name: schemaName, type: 'type' }),
134
- path: getFile({ name: schemaName, extname: '.ts', mode }).path,
135
- }))
136
-
137
- const isEnumSchema = node.type === 'enum'
138
-
139
- const typedName =
140
- ENUM_TYPES_WITH_KEY_SUFFIX.has(enumType) && isEnumSchema ? resolverTs.resolveEnumKeyTypedName(node) : resolverTs.resolveTypedName(node.name)
141
-
142
- const type = {
143
- name: resolverTs.resolveName(node.name),
144
- typedName,
145
- file: getFile({ name: node.name, extname: '.ts', mode }),
146
- } as const
147
-
148
- return (
149
- <File baseName={type.file.baseName} path={type.file.path} meta={type.file.meta} banner={resolveBanner()} footer={resolveFooter()}>
150
- {mode === 'split' &&
151
- imports.map((imp) => (
152
- <File.Import key={[node.name, imp.path, imp.isTypeOnly].join('-')} root={type.file.path} path={imp.path} name={imp.name} isTypeOnly />
153
- ))}
154
- <Type
155
- name={type.name}
156
- typedName={type.typedName}
157
- node={node}
158
- enumType={enumType}
159
- enumKeyCasing={enumKeyCasing}
160
- optionalType={optionalType}
161
- arrayType={arrayType}
162
- syntaxType={syntaxType}
163
- />
164
- </File>
165
- )
166
- },
167
- })