@kubb/parser-ts 5.0.0-beta.26 → 5.0.0-beta.28
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/extension.yaml +5 -7
- package/package.json +3 -3
package/extension.yaml
CHANGED
|
@@ -29,23 +29,21 @@ featured: true
|
|
|
29
29
|
icon:
|
|
30
30
|
light: https://kubb.dev/feature/typescript.svg
|
|
31
31
|
intro: |-
|
|
32
|
-
`@kubb/parser-ts`
|
|
32
|
+
`@kubb/parser-ts` takes the `FileNode` staged by your plugins and prints it as TypeScript source using the official [TypeScript compiler](https://www.typescriptlang.org/). It resolves import paths, deduplicates declarations, prints JSDoc, and rewrites extensions based on `output.extension`.
|
|
33
33
|
|
|
34
|
-
Two
|
|
34
|
+
Two parsers are exported:
|
|
35
35
|
|
|
36
36
|
- `parserTs` — handles `.ts` and `.js` files.
|
|
37
37
|
- `parserTsx` — handles `.tsx` and `.jsx` files. Use this for React projects so JSX in generated components is preserved.
|
|
38
|
-
|
|
39
|
-
Configure once on `defineConfig`. The choice applies to every file every plugin produces.
|
|
40
38
|
options:
|
|
41
39
|
- name: extname
|
|
42
40
|
type: "'.ts' | '.js' | '.tsx' | '.jsx' | string"
|
|
43
41
|
required: false
|
|
44
42
|
default: "'.ts'"
|
|
45
43
|
description: |-
|
|
46
|
-
|
|
44
|
+
Controls which extension is written into the generated import specifiers. Set `.js` for ESM-compatible output, `.tsx` for React projects. Leave unset for the TypeScript default.
|
|
47
45
|
|
|
48
|
-
|
|
46
|
+
To rewrite extensions in the generated source (e.g. `./foo` → `./foo.js`), use `output.extension` in `defineConfig`, not this option.
|
|
49
47
|
codeBlock:
|
|
50
48
|
lang: typescript
|
|
51
49
|
title: kubb.config.ts
|
|
@@ -100,4 +98,4 @@ examples:
|
|
|
100
98
|
notes:
|
|
101
99
|
- type: tip
|
|
102
100
|
body: |-
|
|
103
|
-
|
|
101
|
+
`@kubb/parser-ts` is bundled with Kubb and used automatically when no `parsers` option is set. Install it explicitly only when combining it with other parsers or providing a fully custom parser list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubb/parser-ts",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.28",
|
|
4
4
|
"description": "TypeScript and TSX source file parser for Kubb. Converts AST nodes and raw TypeScript code into formatted source strings using the TypeScript compiler API.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"codegen",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"typescript": "^6.0.3",
|
|
45
|
-
"@kubb/core": "5.0.0-beta.
|
|
45
|
+
"@kubb/core": "5.0.0-beta.28"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@internals/utils": "0.0.0",
|
|
49
|
-
"@kubb/ast": "5.0.0-beta.
|
|
49
|
+
"@kubb/ast": "5.0.0-beta.28"
|
|
50
50
|
},
|
|
51
51
|
"engines": {
|
|
52
52
|
"node": ">=22"
|