Skip to content

Commit

Permalink
fix: build issues with tools package used in ESM context (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
grabbou authored Nov 30, 2024
1 parent ff9b002 commit d5c91eb
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 31 deletions.
2 changes: 1 addition & 1 deletion packages/mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"cali-mcp-server": "./dist/index.js"
},
"scripts": {
"build": "bun build ./src/index.ts --outdir ./dist --target node",
"build": "bun build ./src/index.ts --outdir ./dist --target node --packages external",
"inspector": "npx @modelcontextprotocol/inspector bun src/index.ts"
},
"dependencies": {
Expand Down
24 changes: 2 additions & 22 deletions packages/tools/package.json
Original file line number Diff line number Diff line change
@@ -1,23 +1,9 @@
{
"name": "cali-tools",
"description": "Tools to build your own AI agents for application development.",
"type": "module",
"exports": {
".": {
"bun": "./src/index.ts",
"import": {
"types": "./dist/typescript/module/src/index.d.ts",
"default": "./dist/module/index.js"
},
"require": {
"types": "./dist/typescript/commonjs/src/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"bun": "./src/index.ts",
"main": "./dist/commonjs/index.js",
"types": "./dist/typescript/commonjs/src/index.d.ts",
"module": "./dist/module/index.js",
"types": "./dist/typescript/commonjs/index.d.ts",
"scripts": {
"build": "bob build"
},
Expand Down Expand Up @@ -72,12 +58,6 @@
"esm": true
}
],
[
"module",
{
"esm": true
}
],
[
"typescript",
{
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
getTaskNames,
tryLaunchAppOnDevice,
tryLaunchEmulator,
} from '../vendor/react-native-cli'
import { adb, getAdbPathString, getEmulatorName } from '../vendor/react-native-cli'
} from './vendor/react-native-cli'
import { adb, getAdbPathString, getEmulatorName } from './vendor/react-native-cli'

export const getAdbPath = tool({
description: 'Returns path to ADB executable',
Expand Down
4 changes: 2 additions & 2 deletions packages/tools/src/apple.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ import { tool } from 'ai'
import { execSync } from 'child_process'
import { z } from 'zod'

import type { ApplePlatform } from '../vendor/react-native-cli'
import type { ApplePlatform } from './vendor/react-native-cli'
import {
createAppleBuild,
createAppleRun,
createLogCommand,
getPlatformInfo,
listAppleDevices,
loadReactNativeConfig,
} from '../vendor/react-native-cli'
} from './vendor/react-native-cli'

const platforms = ['ios', 'tvos', 'visionos'] as const

Expand Down
2 changes: 1 addition & 1 deletion packages/tools/src/npm.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { tool } from 'ai'
import { z } from 'zod'

import { install, installDev, uninstall } from '../vendor/react-native-cli'
import { install, installDev, uninstall } from './vendor/react-native-cli'

export const installNpmPackage = tool({
description: 'Install a package from npm by name',
Expand Down
2 changes: 1 addition & 1 deletion packages/tools/src/react-native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { tool } from 'ai'
import dedent from 'dedent'
import { z } from 'zod'

import { loadReactNativeConfig } from '../vendor/react-native-cli'
import { loadReactNativeConfig } from './vendor/react-native-cli'

export const startMetroDevServer = tool({
description: dedent`
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
"paths": {
"cali-tools": ["./packages/tools/src"]
}
},
"include": ["src/**/*.ts"]
}
}

0 comments on commit d5c91eb

Please sign in to comment.