Skip to content

Commit e0adb9c

Browse files
committed
feat!: migrate from babel to yuku
1 parent c9f8c92 commit e0adb9c

16 files changed

Lines changed: 453 additions & 108 deletions

‎README.md‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ AST({
112112
// Rollup and esbuild do not support using enforce to control the order of plugins. Users need to maintain the order manually.
113113
enforce: undefined,
114114

115-
// https://babeljs.io/docs/en/babel-parser#options
115+
// https://yuku.fyi/parser/#options
116116
parserOptions: {},
117117

118118
// Refer to Custom Transformers belows
@@ -122,6 +122,15 @@ AST({
122122

123123
## Transformers
124124

125+
AST nodes follow ESTree / TypeScript-ESTree. Yuku's typed guards, builders,
126+
walker, and utilities are available from the `ast` namespace, while its types
127+
are directly exported from `unplugin-ast/yuku`. No additional Yuku packages are
128+
required.
129+
130+
```ts
131+
import { ast, type CallExpression } from 'unplugin-ast/yuku'
132+
```
133+
125134
### Built-in Transformers
126135

127136
#### RemoveWrapperFunction
@@ -138,7 +147,7 @@ import { RemoveWrapperFunction } from 'unplugin-ast/transformers'
138147
*/
139148
export function RemoveWrapperFunction(
140149
functionNames: Arrayable<string>,
141-
): Transformer<CallExpression>
150+
): Transformer<CallExpression | TaggedTemplateExpression>
142151
```
143152

144153
Transforms:
@@ -173,8 +182,8 @@ export function RemoveNode(
173182
### Custom Transformers
174183

175184
```ts
176-
import type { CallExpression } from '@babel/types'
177185
import type { Transformer } from 'unplugin-ast'
186+
import type { CallExpression } from 'unplugin-ast/yuku'
178187
179188
export const RemoveWrapperFunction = (
180189
functionNames: string[],

‎jsr.json‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
"version": "0.17.2",
44
"exports": {
55
".": "./src/index.ts",
6-
"./ast-kit": "./src/ast-kit.ts",
76
"./esbuild": "./src/esbuild.ts",
87
"./rolldown": "./src/rolldown.ts",
98
"./rollup": "./src/rollup.ts",
109
"./rspack": "./src/rspack.ts",
1110
"./transformers": "./src/transformers.ts",
1211
"./vite": "./src/vite.ts",
13-
"./webpack": "./src/webpack.ts"
12+
"./webpack": "./src/webpack.ts",
13+
"./yuku": "./src/yuku.ts"
1414
},
1515
"publish": {
1616
"include": [

‎package.json‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@
2424
],
2525
"exports": {
2626
".": "./dist/index.js",
27-
"./ast-kit": "./dist/ast-kit.js",
2827
"./esbuild": "./dist/esbuild.js",
2928
"./rolldown": "./dist/rolldown.js",
3029
"./rollup": "./dist/rollup.js",
3130
"./rspack": "./dist/rspack.js",
3231
"./transformers": "./dist/transformers.js",
3332
"./vite": "./dist/vite.js",
3433
"./webpack": "./dist/webpack.js",
34+
"./yuku": "./dist/yuku.js",
3535
"./package.json": "./package.json"
3636
},
3737
"files": [
@@ -41,7 +41,7 @@
4141
"access": "public"
4242
},
4343
"engines": {
44-
"node": "^22.18.0 || >=24.11.0"
44+
"node": "^22.18.0 || ^24.11.0 || >=26.0.0"
4545
},
4646
"scripts": {
4747
"lint": "eslint .",
@@ -54,12 +54,12 @@
5454
"prepublishOnly": "pnpm run build"
5555
},
5656
"dependencies": {
57-
"@babel/generator": "^8.0.0",
58-
"@babel/parser": "^8.0.0",
59-
"@babel/types": "^8.0.0",
60-
"ast-kit": "^3.0.0",
57+
"@yuku-toolchain/types": "^0.8.3",
6158
"magic-string-ast": "^2.0.0",
62-
"unplugin": "^3.0.0"
59+
"unplugin": "^3.0.0",
60+
"yuku-ast": "^0.8.3",
61+
"yuku-codegen": "^0.8.3",
62+
"yuku-parser": "^0.8.3"
6363
},
6464
"inlinedDependencies": {
6565
"@antfu/utils": "9.3.0"

0 commit comments

Comments
 (0)