chore: update package.json and add tsdown configuration for build process

- Changed the main and types entries in package.json to point to the dist directory for better output management.
- Added a new tsdown.config.ts file to define the build configuration, specifying entry points, output directory, and formats for the project.
This commit is contained in:
suyao 2025-07-17 21:00:32 +08:00
parent ef8cf65ece
commit 4732c8f1bd
No known key found for this signature in database
2 changed files with 21 additions and 8 deletions

View File

@ -2,8 +2,8 @@
"name": "@cherrystudio/ai-core",
"version": "1.0.0",
"description": "Cherry Studio AI Core - Unified AI Provider Interface Based on Vercel AI SDK",
"main": "src/index.ts",
"types": "src/index.ts",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"build": "tsdown",
"dev": "tsc -w",
@ -125,14 +125,14 @@
],
"exports": {
".": {
"types": "./src/index.ts",
"import": "./src/index.ts",
"require": "./src/index.ts"
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.js"
},
"./core/plugins/built-in": {
"types": "./src/core/plugins/built-in/index.ts",
"import": "./src/core/plugins/built-in/index.ts",
"require": "./src/core/plugins/built-in/index.ts"
"types": "./dist/core/plugins/built-in/index.d.ts",
"import": "./dist/core/plugins/built-in/index.mjs",
"require": "./dist/core/plugins/built-in/index.js"
}
}
}

View File

@ -0,0 +1,13 @@
import { defineConfig } from 'tsdown'
export default defineConfig({
entry: {
index: 'src/index.ts',
'core/plugins/built-in/index': 'src/core/plugins/built-in/index.ts'
},
outDir: 'dist',
format: ['esm', 'cjs'],
clean: true,
dts: true,
tsconfig: 'tsconfig.json'
})