Skip to content

Commit 5b1a90e

Browse files
committed
feat(ai-sdk): improve packaging
1 parent 16473a3 commit 5b1a90e

File tree

3 files changed

+22
-3
lines changed

3 files changed

+22
-3
lines changed

packages/ai/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,14 @@
44
"version": "0.0.4",
55
"description": "Pipedream AI",
66
"main": "./dist/index.js",
7+
"module": "./dist/index.js",
78
"types": "./dist/index.d.ts",
89
"exports": {
910
".": {
11+
"types": "./dist/index.d.ts",
1012
"import": "./dist/index.js",
11-
"types": "./dist/index.d.ts"
13+
"require": "./dist/index.cjs",
14+
"default": "./dist/index.js"
1215
}
1316
},
1417
"engines": {
@@ -24,7 +27,7 @@
2427
"access": "public"
2528
},
2629
"scripts": {
27-
"build": "tsc --noCheck",
30+
"build": "rm -rf dist && tsup --config tsup.config.js",
2831
"prepublish": "npm run build"
2932
},
3033
"files": [

packages/ai/src/tool-sets/core.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ export class CoreTools {
2727
q: options?.query,
2828
});
2929

30-
for (const component of components) {
30+
for (const _component of components) {
31+
const component = _component as V1Component; // This is the correct type. When the sdk is updated, this will be removed.
3132
this.tools.push({
3233
name: component.name.replace(/[^a-zA-Z0-9_-]/g, "_"),
3334
description: component.description,

packages/ai/tsup.config.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { defineConfig } from "tsup";
2+
3+
export default defineConfig({
4+
entry: {
5+
index: "./src/index.ts",
6+
},
7+
format: [
8+
"cjs",
9+
"esm",
10+
],
11+
minify: true,
12+
sourcemap: true,
13+
dts: true,
14+
clean: true,
15+
});

0 commit comments

Comments
 (0)