From 371e0f8e4d10bf9c346c4565f94f6eb23988c976 Mon Sep 17 00:00:00 2001 From: fisker Date: Fri, 23 Jan 2026 08:37:18 +0800 Subject: [PATCH 1/3] Fix build script --- .github/workflows/ci.yml | 1 + package.json | 4 ++-- tsdown.config.ts | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tsdown.config.ts diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c4889dab..b591dd2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,3 +49,4 @@ jobs: disable_search: true files: coverage/lcov.info token: ${{ secrets.CODECOV_TOKEN }} + - run: yarn run build diff --git a/package.json b/package.json index 99a82e25..44af99d4 100644 --- a/package.json +++ b/package.json @@ -12,8 +12,8 @@ }, "exports": { ".": { - "types": "./dist/index.d.mts", - "default": "./dist/index.mjs" + "types": "./dist/index.d.ts", + "default": "./dist/index.js" } }, "license": "MIT", diff --git a/tsdown.config.ts b/tsdown.config.ts new file mode 100644 index 00000000..e771f578 --- /dev/null +++ b/tsdown.config.ts @@ -0,0 +1,6 @@ +import { defineConfig } from 'tsdown'; + +export default defineConfig({ + external: ['@babel/types'], + fixedExtension: false, +}); From 2a2b75d553a0d7fd80f99a860e56a1b20ae75a9c Mon Sep 17 00:00:00 2001 From: fisker Date: Fri, 23 Jan 2026 08:38:05 +0800 Subject: [PATCH 2/3] Simplify exports --- package.json | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/package.json b/package.json index 44af99d4..93d7a258 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,7 @@ "url": "https://github.com/ikatyang" }, "exports": { - ".": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - } + ".": "./dist/index.js" }, "license": "MIT", "scripts": { From 17319b661b72007b080b8074920df9d6c4cf1bd7 Mon Sep 17 00:00:00 2001 From: fisker Date: Fri, 23 Jan 2026 08:39:25 +0800 Subject: [PATCH 3/3] Update tsconfig.json --- tsconfig.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 513d74dc..f7ad4e78 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,5 +11,10 @@ "noEmit": true, "allowImportingTsExtensions": true }, - "include": ["src/**/*.ts", "tests/**/*.ts", "vitest.config.ts"] + "include": [ + "src/**/*.ts", + "tests/**/*.ts", + "vitest.config.ts", + "tsdown.config.ts" + ] }