Skip to content

Commit ecb4f8f

Browse files
authored
Merge pull request #793 from ai16z/fix/dev_command
fix: dev command
2 parents 5d763e0 + 2379668 commit ecb4f8f

File tree

30 files changed

+113
-45
lines changed

30 files changed

+113
-45
lines changed

agent/tsconfig.json

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
"node"
1010
]
1111
},
12+
"ts-node": {
13+
"experimentalSpecifierResolution": "node",
14+
"transpileOnly": true,
15+
"esm": true,
16+
},
1217
"include": [
1318
"src"
1419
]

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"start": "pnpm --filter \"@ai16z/agent\" start --isRoot",
77
"start:client": "pnpm --dir client start --isRoot",
88
"start:debug": "cross-env NODE_ENV=development VERBOSE=true DEBUG=eliza:* pnpm --filter \"@ai16z/agent\" start --isRoot",
9-
"dev": "turbo check-types dev --concurrency 25",
9+
"dev": "bash ./scripts/dev.sh",
10+
"dev:build": "turbo run build --filter=!eliza-docs",
1011
"lint": "bash ./scripts/lint.sh",
1112
"prettier-check": "npx prettier --check .",
1213
"prettier": "npx prettier --write .",

packages/adapter-sqljs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"scripts": {
1717
"build": "tsup --format esm --dts",
18-
"dev": "tsup --watch",
18+
"dev": "tsup --format esm --dts --watch",
1919
"lint": "eslint . --fix"
2020
},
2121
"peerDependencies": {

packages/adapter-supabase/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"scripts": {
1515
"build": "tsup --format esm --dts",
16-
"dev": "tsup --watch",
16+
"dev": "tsup --format esm --dts --watch",
1717
"lint": "eslint . --fix"
1818
},
1919
"peerDependencies": {

packages/client-auto/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"scripts": {
2020
"build": "tsup --format esm --dts",
21-
"dev": "tsup --watch",
21+
"dev": "tsup --format esm --dts --watch",
2222
"lint": "eslint . --fix"
2323
},
2424
"peerDependencies": {

packages/client-direct/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
},
2222
"scripts": {
2323
"build": "tsup --format esm --dts",
24-
"dev": "tsup --watch",
24+
"dev": "tsup --format esm --dts --watch",
2525
"lint": "eslint . --fix"
2626
},
2727
"peerDependencies": {

packages/client-discord/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
},
2121
"scripts": {
2222
"build": "tsup --format esm --dts",
23-
"dev": "tsup --watch",
23+
"dev": "tsup --format esm --dts --watch",
2424
"lint": "eslint . --fix"
2525
},
2626
"trustedDependencies": {

packages/client-farcaster/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"scripts": {
1616
"build": "tsup --format esm --dts",
17-
"dev": "tsup --watch"
17+
"dev": "tsup --format esm --dts --watch"
1818
},
1919
"peerDependencies": {}
2020
}

packages/client-github/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"scripts": {
1919
"build": "tsup --format esm --dts",
20-
"dev": "tsup --watch",
20+
"dev": "tsup --format esm --dts --watch",
2121
"lint": "eslint . --fix"
2222
}
2323
}

packages/client-telegram/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"scripts": {
1717
"build": "tsup --format esm --dts",
18-
"dev": "tsup --watch",
18+
"dev": "tsup --format esm --dts --watch",
1919
"lint": "eslint . --fix"
2020
}
2121
}

packages/client-twitter/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
},
1616
"scripts": {
1717
"build": "tsup --format esm --dts",
18-
"dev": "tsup --watch",
18+
"dev": "tsup --format esm --dts --watch",
1919
"lint": "eslint . --fix"
2020
},
2121
"peerDependencies": {

packages/plugin-0g/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
},
1313
"scripts": {
1414
"build": "tsup --format esm --dts",
15-
"dev": "tsup --watch",
15+
"dev": "tsup --format esm --dts --watch",
1616
"test": "vitest"
1717
}
1818
}

packages/plugin-bootstrap/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {},
1212
"scripts": {
1313
"build": "tsup --format esm --dts",
14-
"dev": "tsup --watch",
14+
"dev": "tsup --format esm --dts --watch",
1515
"lint": "eslint . --fix"
1616
},
1717
"peerDependencies": {

packages/plugin-buttplug/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
},
1313
"scripts": {
1414
"build": "tsup --format esm --dts",
15+
"dev": "tsup --format esm --dts --watch",
1516
"test-via-bun": "bun test/simulate.ts"
1617
},
1718
"peerDependencies": {

packages/plugin-coinbase/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"scripts": {
1515
"build": "tsup --format esm --dts",
16-
"dev": "tsup --watch",
16+
"dev": "tsup --format esm --dts --watch",
1717
"lint": "eslint . --fix"
1818
}
1919
}

packages/plugin-conflux/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
},
1111
"scripts": {
1212
"build": "tsup --format esm --dts",
13-
"dev": "tsup --watch"
13+
"dev": "tsup --format esm --dts --watch"
1414
}
1515
}

packages/plugin-evm/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
"viem": "2.21.53"
1515
},
1616
"scripts": {
17-
"build": "tsup --format esm --dts"
17+
"build": "tsup --format esm --dts",
18+
"dev": "tsup --format esm --dts --watch"
1819
},
1920
"peerDependencies": {
2021
"whatwg-url": "7.1.0"

packages/plugin-goat/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
"viem": "^2.21.45"
1414
},
1515
"scripts": {
16-
"build": "tsup --format esm --dts"
16+
"build": "tsup --format esm --dts",
17+
"dev": "tsup --format esm --dts --watch"
1718
},
1819
"peerDependencies": {
1920
"whatwg-url": "7.1.0"

packages/plugin-icp/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"@dfinity/principal": "2.1.3"
1313
},
1414
"scripts": {
15-
"build": "tsup --format esm --dts"
15+
"build": "tsup --format esm --dts",
16+
"dev": "tsup --format esm --dts --watch"
1617
},
1718
"devDependencies": {
1819
"@types/jest": "29.5.14",

packages/plugin-image-generation/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"devDependencies": {},
1212
"scripts": {
1313
"build": "tsup --format esm --dts",
14+
"dev": "tsup --format esm --dts --watch",
1415
"lint": "eslint . --fix"
1516
},
1617
"peerDependencies": {

packages/plugin-node/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
},
6666
"scripts": {
6767
"build": "tsup --format esm --dts",
68-
"dev": "tsup --watch",
68+
"dev": "tsup --format esm --dts --watch",
6969
"lint": "eslint . --fix",
7070
"postinstall": "node scripts/postinstall.js"
7171
},

packages/plugin-solana/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"devDependencies": {},
2222
"scripts": {
2323
"build": "tsup --format esm --dts",
24+
"dev": "tsup --format esm --dts --watch",
2425
"lint": "eslint . --fix",
2526
"test": "vitest run"
2627
},

packages/plugin-starknet/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"devDependencies": {},
1818
"scripts": {
1919
"build": "tsup --format esm --dts",
20+
"dev": "tsup --format esm --dts --watch",
2021
"test": "vitest run",
2122
"test:watch": "vitest",
2223
"lint": "eslint . --fix"

packages/plugin-tee/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"scripts": {
2121
"build": "tsup --format esm --dts",
22-
"dev": "tsup --watch"
22+
"dev": "tsup --format esm --dts --watch"
2323
},
2424
"peerDependencies": {
2525
"whatwg-url": "7.1.0"

packages/plugin-trustdb/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"scripts": {
1515
"build": "tsup --format esm --dts",
16+
"dev": "tsup --format esm --dts --watch",
1617
"test": "vitest run",
1718
"test:watch": "vitest",
1819
"lint": "eslint . --fix"

packages/plugin-video-generation/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"devDependencies": {},
1212
"scripts": {
1313
"build": "tsup --format esm --dts",
14-
"dev": "tsup --watch",
14+
"dev": "tsup --format esm --dts --watch",
1515
"lint": "eslint . --fix"
1616
},
1717
"peerDependencies": {

packages/plugin-web-search/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"tsup": "8.3.5"
1010
},
1111
"scripts": {
12-
"build": "tsup --format esm --dts"
12+
"build": "tsup --format esm --dts",
13+
"dev": "tsup --format esm --dts --watch"
1314
},
1415
"peerDependencies": {
1516
"whatwg-url": "7.1.0"

packages/plugin-whatsapp/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"main": "dist/index.js",
66
"types": "dist/index.d.ts",
77
"scripts": {
8-
"build": "tsc",
8+
"build": "tsup --format esm --dts",
9+
"dev": "tsup --format esm --dts --watch",
910
"test": "jest",
1011
"lint": "eslint . --fix"
1112
},

packages/plugin-whatsapp/tsconfig.json

+3-10
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,16 @@
11
{
2+
"extends": "../core/tsconfig.json",
23
"compilerOptions": {
3-
"target": "es2018",
4-
"module": "commonjs",
5-
"declaration": true,
64
"outDir": "./dist",
7-
"strict": true,
8-
"esModuleInterop": true,
9-
"skipLibCheck": true,
10-
"forceConsistentCasingInFileNames": true,
11-
"moduleResolution": "node",
12-
"resolveJsonModule": true,
5+
"rootDir": "src",
136
"baseUrl": ".",
147
"types": [
158
"node",
169
"jest"
1710
]
1811
},
1912
"include": [
20-
"src/**/*"
13+
"src/**/*.ts"
2114
],
2215
"exclude": [
2316
"node_modules",

scripts/dev.sh

+72-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,73 @@
1+
#!/bin/bash
2+
13
echo "Passing arguments: $*"
2-
npx concurrently --raw \
3-
"pnpm --dir packages/core dev -- $*" \
4-
"pnpm --dir client dev -- $*" \
5-
"pnpm --dir packages/client-telegram dev -- $*" \
6-
"pnpm --dir packages/client-discord dev -- $*" \
7-
"pnpm --dir packages/client-twitter dev -- $*" \
8-
"pnpm --dir packages/client-direct dev -- $*" \
9-
"pnpm --dir packages/plugin-bootstrap dev -- $*" \
10-
"pnpm --dir packages/plugin-node dev -- $*" \
11-
"pnpm --dir packages/adapter-sqlite dev -- $*" \
12-
"pnpm --dir packages/adapter-postgres dev -- $*" \
13-
"pnpm --dir packages/plugin-buttplug dev -- $*" \
14-
"node -e \"setTimeout(() => process.exit(0), 5000)\" && pnpm --dir agent dev -- $*"
4+
5+
# Base packages directory
6+
PACKAGES_DIR="./packages"
7+
8+
# Check if the packages directory exists
9+
if [ ! -d "$PACKAGES_DIR" ]; then
10+
echo "Error: Directory $PACKAGES_DIR does not exist."
11+
exit 1
12+
fi
13+
14+
# Function to check if an item is in an array
15+
is_in_array() {
16+
local item="$1"
17+
shift
18+
for element; do
19+
if [[ "$element" == "$item" ]]; then
20+
return 0
21+
fi
22+
done
23+
return 1
24+
}
25+
26+
# Initialize an array to hold package-specific commands
27+
COMMANDS=()
28+
29+
# Ensure "core" package runs first
30+
if [ -d "$PACKAGES_DIR/core" ]; then
31+
COMMANDS+=("pnpm --dir $PACKAGES_DIR/core dev -- $*")
32+
else
33+
echo "Warning: 'core' package not found in $PACKAGES_DIR."
34+
fi
35+
36+
# List of folders to exclude
37+
EXCLUDED_FOLDERS=("create-eliza-app" "debug_audio" "content_cache")
38+
39+
# Iterate over all other subdirectories in the packages folder
40+
for PACKAGE in "$PACKAGES_DIR"/*; do
41+
PACKAGE_NAME=$(basename "$PACKAGE")
42+
43+
# Skip excluded folders and "core"
44+
if [ -d "$PACKAGE" ] && ! is_in_array "$PACKAGE_NAME" "${EXCLUDED_FOLDERS[@]}" && [ "$PACKAGE_NAME" != "core" ]; then
45+
COMMANDS+=("pnpm --dir $PACKAGE dev -- $*")
46+
fi
47+
done
48+
49+
# Add specific commands for other directories or cases
50+
if [ -d "./client" ]; then
51+
COMMANDS+=("pnpm --dir client dev -- $*")
52+
else
53+
echo "Warning: 'client' directory not found."
54+
fi
55+
56+
if [ -d "./agent" ]; then
57+
COMMANDS+=("node -e \"setTimeout(() => process.exit(0), 5000)\" && pnpm --dir agent dev -- $*")
58+
else
59+
echo "Warning: 'agent' directory not found."
60+
fi
61+
62+
# Run build command first
63+
if ! pnpm dev:build; then
64+
echo "Build failed. Exiting."
65+
exit 1
66+
fi
67+
68+
# Run all commands concurrently
69+
if [ ${#COMMANDS[@]} -gt 0 ]; then
70+
npx concurrently --raw "${COMMANDS[@]}"
71+
else
72+
echo "No valid packages to run."
73+
fi

0 commit comments

Comments
 (0)