From 4732c8f1bdbb0b4e0bb852eef426b7bcb018dcc4 Mon Sep 17 00:00:00 2001 From: suyao Date: Thu, 17 Jul 2025 21:00:32 +0800 Subject: [PATCH] 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. --- packages/aiCore/package.json | 16 ++++++++-------- packages/aiCore/tsdown.config.ts | 13 +++++++++++++ 2 files changed, 21 insertions(+), 8 deletions(-) create mode 100644 packages/aiCore/tsdown.config.ts diff --git a/packages/aiCore/package.json b/packages/aiCore/package.json index ba0f748835..02ad187d72 100644 --- a/packages/aiCore/package.json +++ b/packages/aiCore/package.json @@ -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" } } } diff --git a/packages/aiCore/tsdown.config.ts b/packages/aiCore/tsdown.config.ts new file mode 100644 index 0000000000..315799695d --- /dev/null +++ b/packages/aiCore/tsdown.config.ts @@ -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' +})