Skip to content

Commit 6c18244

Browse files
committed
feat(cli): add SDK auto-build fallback for dev script
- Create wrapper script that attempts to run CLI directly - Falls back to building SDK silently if initial run fails - Prevents "module not found" errors for new developers - No performance impact when SDK is already built - Properly forwards CLI arguments like --clear-logs
1 parent 00aa4f5 commit 6c18244

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
}
1616
},
1717
"scripts": {
18-
"dev": "bun run src/index.tsx",
18+
"dev": "./scripts/dev.sh",
1919
"prebuild": "bun run build:sdk",
2020
"build": "bun build src/index.tsx --outdir dist --target node --format esm",
2121
"build:sdk": "cd ../sdk && bun run build",

cli/scripts/dev.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Wrapper script to handle dev command with fallback SDK build
3+
4+
# Try to run directly
5+
bun run src/index.tsx "$@" || {
6+
# If it fails, build SDK silently and retry
7+
bun run build:sdk > /dev/null 2>&1
8+
bun run src/index.tsx "$@"
9+
}

0 commit comments

Comments
 (0)