Skip to content

Commit db93dc8

Browse files
committed
feat(scripts): migrate to TypeScript-only service scripts
- Replace dev.sh with dev.ts (starts services + CLI, stops all on Ctrl+C) - Rewrite start-services.ts to directly start db/studio/sdk/web - stop-services.ts kills by port (worktree-safe) - Add CODEBUFF_SKIP_ENV_CLEAR flag for TS scripts to preserve env vars - Remove bash dependencies entirely
1 parent f31ddc8 commit db93dc8

File tree

17 files changed

+1322
-220
lines changed

17 files changed

+1322
-220
lines changed

.bin/bun

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ check_env_setup() {
206206
# Bun loads .env files natively, but inherited shell variables take precedence.
207207
# We unset variables defined in our env files so Bun can set fresh values.
208208
clear_inherited_env_vars() {
209+
# Skip clearing if CODEBUFF_SKIP_ENV_CLEAR is set
210+
# Used by TypeScript scripts that already have env vars loaded via Bun
211+
if [ -n "$CODEBUFF_SKIP_ENV_CLEAR" ]; then
212+
return
213+
fi
214+
209215
# Unset variables from .env.local so Bun can load fresh values
210216
if [ -f "$ENV_LOCAL_FILE" ]; then
211217
while IFS='=' read -r key _; do

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@
1515
"cli"
1616
],
1717
"scripts": {
18-
"dev": "bash scripts/dev.sh",
18+
"dev": "bun scripts/dev.ts",
19+
"start-services": "bun scripts/start-services.ts",
1920
"start-cli": "bun --cwd cli dev",
2021
"start-db": "bun --cwd packages/internal db:start",
2122
"start-web": "bun start-db && bun --cwd web dev",
2223
"start-studio": "bun --cwd packages/internal db:studio",
24+
"stop-services": "bun scripts/stop-services.ts",
2325
"format": "prettier --write \"**/*.{ts,tsx,json,md}\"",
2426
"release:cli": "bun run --cwd=cli release",
2527
"release:sdk": "bun run --cwd=sdk release",

scripts/dev.sh

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)