Skip to content

Commit

Permalink
feat: swc & typescript transformer
Browse files Browse the repository at this point in the history
  • Loading branch information
sxzz committed Jun 29, 2024
1 parent d83a89b commit 15c5956
Show file tree
Hide file tree
Showing 7 changed files with 359 additions and 55 deletions.
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
## Features

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

## Installation
Expand Down Expand Up @@ -74,6 +75,23 @@ build({

<br></details>

## Options

```ts
export interface Options {
include?: FilterPattern
exclude?: FilterPattern
enforce?: 'pre' | 'post' | undefined
/**
* If you use swc or typescript, you need to install `@swc/core` or `typescript` yourself.
* @default oxc
*/
transformer?: 'oxc' | 'swc' | 'typescript'
/** Only for typescript transformer */
transformOptions?: TranspileOptions
}
```

## Sponsors

<p align="center">
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,25 @@
"release": "bumpp && pnpm publish",
"prepublishOnly": "pnpm run build"
},
"peerDependencies": {
"@swc/core": "^1.6.6",
"typescript": "^5.5.2"
},
"peerDependenciesMeta": {
"@swc/core": {
"optional": true
},
"typescript": {
"optional": true
}
},
"dependencies": {
"@rollup/pluginutils": "^5.1.0",
"oxc-transform": "^0.15.1",
"unplugin": "^1.10.1"
},
"devDependencies": {
"@swc/core": "^1.6.6",
"@sxzz/eslint-config": "^3.13.0",
"@sxzz/prettier-config": "^2.0.2",
"@types/node": "^20.14.9",
Expand Down
Loading

0 comments on commit 15c5956

Please sign in to comment.