@kubb/plugin-ts 5.0.0-alpha.32 → 5.0.0-alpha.33
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/index.cjs +19 -19
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
- package/src/components/Enum.tsx +3 -3
- package/src/components/Type.tsx +3 -3
- package/src/generators/typeGenerator.tsx +1 -1
- package/src/generators/typeGeneratorLegacy.tsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/plugin-ts",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.33",
|
|
4
4
|
"description": "TypeScript code generation plugin for Kubb, transforming OpenAPI schemas into TypeScript interfaces, types, and utility functions.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
}
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@kubb/react-fabric": "0.15.1",
|
|
53
52
|
"remeda": "^2.33.7",
|
|
54
53
|
"typescript": "5.9.3",
|
|
55
|
-
"@kubb/ast": "5.0.0-alpha.
|
|
56
|
-
"@kubb/core": "5.0.0-alpha.
|
|
57
|
-
"@kubb/
|
|
54
|
+
"@kubb/ast": "5.0.0-alpha.33",
|
|
55
|
+
"@kubb/core": "5.0.0-alpha.33",
|
|
56
|
+
"@kubb/renderer-jsx": "5.0.0-alpha.33",
|
|
57
|
+
"@kubb/parser-ts": "5.0.0-alpha.33"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
|
-
"@kubb/
|
|
60
|
+
"@kubb/renderer-jsx": "5.0.0-alpha.33"
|
|
61
61
|
},
|
|
62
62
|
"engines": {
|
|
63
63
|
"node": ">=22"
|
package/src/components/Enum.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { camelCase, trimQuotes } from '@internals/utils'
|
|
2
2
|
import type { EnumSchemaNode } from '@kubb/ast/types'
|
|
3
3
|
import { safePrint } from '@kubb/parser-ts'
|
|
4
|
-
import { File } from '@kubb/
|
|
5
|
-
import type {
|
|
4
|
+
import { File } from '@kubb/renderer-jsx'
|
|
5
|
+
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
6
6
|
import { ENUM_TYPES_WITH_KEY_SUFFIX, ENUM_TYPES_WITH_RUNTIME_VALUE, ENUM_TYPES_WITH_TYPE_ONLY } from '../constants.ts'
|
|
7
7
|
import * as factory from '../factory.ts'
|
|
8
8
|
import type { PluginTs, ResolverTs } from '../types.ts'
|
|
@@ -54,7 +54,7 @@ export function getEnumNames({
|
|
|
54
54
|
* The emitted `File.Source` nodes carry the resolved names so that the barrel
|
|
55
55
|
* index picks up the correct export identifiers.
|
|
56
56
|
*/
|
|
57
|
-
export function Enum({ node, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props):
|
|
57
|
+
export function Enum({ node, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {
|
|
58
58
|
const { enumName, typeName } = getEnumNames({ node, enumType, enumTypeSuffix, resolver })
|
|
59
59
|
|
|
60
60
|
const [nameNode, typeNode] = factory.createEnumDeclaration({
|
package/src/components/Type.tsx
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { Printer } from '@kubb/ast'
|
|
2
2
|
import { collect, narrowSchema, schemaTypes } from '@kubb/ast'
|
|
3
3
|
import type { EnumSchemaNode, SchemaNode } from '@kubb/ast/types'
|
|
4
|
-
import { File } from '@kubb/
|
|
5
|
-
import type {
|
|
4
|
+
import { File } from '@kubb/renderer-jsx'
|
|
5
|
+
import type { KubbReactNode } from '@kubb/renderer-jsx/types'
|
|
6
6
|
import type { PrinterTsFactory } from '../printers/printerTs.ts'
|
|
7
7
|
import type { PluginTs } from '../types.ts'
|
|
8
8
|
import { Enum, getEnumNames } from './Enum.tsx'
|
|
@@ -21,7 +21,7 @@ type Props = {
|
|
|
21
21
|
resolver: PluginTs['resolver']
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
export function Type({ name, node, printer, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props):
|
|
24
|
+
export function Type({ name, node, printer, enumType, enumTypeSuffix, enumKeyCasing, resolver }: Props): KubbReactNode {
|
|
25
25
|
const enumSchemaNodes = collect<EnumSchemaNode>(node, {
|
|
26
26
|
schema(n): EnumSchemaNode | undefined {
|
|
27
27
|
const enumNode = narrowSchema(n, schemaTypes.enum)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { caseParams, narrowSchema, schemaTypes } from '@kubb/ast'
|
|
2
2
|
import type { SchemaNode } from '@kubb/ast/types'
|
|
3
3
|
import { defineGenerator } from '@kubb/core'
|
|
4
|
-
import { File } from '@kubb/
|
|
4
|
+
import { File } from '@kubb/renderer-jsx'
|
|
5
5
|
import { Type } from '../components/Type.tsx'
|
|
6
6
|
import { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'
|
|
7
7
|
import { printerTs } from '../printers/printerTs.ts'
|
|
@@ -2,7 +2,7 @@ import { pascalCase } from '@internals/utils'
|
|
|
2
2
|
import { caseParams, createProperty, createSchema, narrowSchema, schemaTypes, transform } from '@kubb/ast'
|
|
3
3
|
import type { OperationNode, ParameterNode, SchemaNode } from '@kubb/ast/types'
|
|
4
4
|
import { defineGenerator } from '@kubb/core'
|
|
5
|
-
import { File } from '@kubb/
|
|
5
|
+
import { File } from '@kubb/renderer-jsx'
|
|
6
6
|
import { Type } from '../components/Type.tsx'
|
|
7
7
|
import { ENUM_TYPES_WITH_KEY_SUFFIX } from '../constants.ts'
|
|
8
8
|
import { printerTs } from '../printers/printerTs.ts'
|