Skip to content

Commit 15c5956

Browse files
committed
feat: swc & typescript transformer
1 parent d83a89b commit 15c5956

File tree

7 files changed

+359
-55
lines changed

7 files changed

+359
-55
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
## Features
88

99
- 🚀 **Fast**: Blazing-fast `.d.ts` generator, powered by Oxc.
10-
- 🎯 **Isolated**: Generate isolated declarations for each file.
10+
- 🎨 **Transformer**: Support Oxc, SWC, and TypeScript transformer.
11+
- 📦 **Zero Config**: No configuration required, works out of the box.
1112
-**Bundler Support**: Works with Vite, Rollup, and esbuild.
1213

1314
## Installation
@@ -74,6 +75,23 @@ build({
7475

7576
<br></details>
7677

78+
## Options
79+
80+
```ts
81+
export interface Options {
82+
include?: FilterPattern
83+
exclude?: FilterPattern
84+
enforce?: 'pre' | 'post' | undefined
85+
/**
86+
* If you use swc or typescript, you need to install `@swc/core` or `typescript` yourself.
87+
* @default oxc
88+
*/
89+
transformer?: 'oxc' | 'swc' | 'typescript'
90+
/** Only for typescript transformer */
91+
transformOptions?: TranspileOptions
92+
}
93+
```
94+
7795
## Sponsors
7896

7997
<p align="center">

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,25 @@
7777
"release": "bumpp && pnpm publish",
7878
"prepublishOnly": "pnpm run build"
7979
},
80+
"peerDependencies": {
81+
"@swc/core": "^1.6.6",
82+
"typescript": "^5.5.2"
83+
},
84+
"peerDependenciesMeta": {
85+
"@swc/core": {
86+
"optional": true
87+
},
88+
"typescript": {
89+
"optional": true
90+
}
91+
},
8092
"dependencies": {
8193
"@rollup/pluginutils": "^5.1.0",
8294
"oxc-transform": "^0.15.1",
8395
"unplugin": "^1.10.1"
8496
},
8597
"devDependencies": {
98+
"@swc/core": "^1.6.6",
8699
"@sxzz/eslint-config": "^3.13.0",
87100
"@sxzz/prettier-config": "^2.0.2",
88101
"@types/node": "^20.14.9",

0 commit comments

Comments
 (0)