diff --git a/packages/upulse/src/commands/deploy.ts b/packages/upulse/src/commands/deploy.ts index a1a06e6..099d4ce 100644 --- a/packages/upulse/src/commands/deploy.ts +++ b/packages/upulse/src/commands/deploy.ts @@ -93,7 +93,6 @@ async function tryWriteMigrateEvents( // Discover sense keys from vitals table first, then fall back to collect events let senseKeys: string[] = []; try { - // @ts-expect-error — accessing raw vitalsDb for key discovery const vitalsDb = (store as any)._vitalsDb ?? (store as any).vitalsDb; if (vitalsDb) { const rows = vitalsDb diff --git a/packages/upulse/src/ui/server.test.ts b/packages/upulse/src/ui/server.test.ts index dc1a65d..3e15636 100644 --- a/packages/upulse/src/ui/server.test.ts +++ b/packages/upulse/src/ui/server.test.ts @@ -46,7 +46,7 @@ function createTestConfig(baseDir: string): TestConfig { } describe('Pulse WebUI Server', () => { - let server: Server | null = null; + let server: Server | null = null; let baseUrl = ''; let testDir: string; let config: TestConfig; diff --git a/packages/upulse/src/ui/server.ts b/packages/upulse/src/ui/server.ts index daa492d..5969f0b 100644 --- a/packages/upulse/src/ui/server.ts +++ b/packages/upulse/src/ui/server.ts @@ -189,7 +189,10 @@ function handleSenseKeys(config: UpulseConfig): Response { // ── Server ───────────────────────────────────────────────────── -export function createUIServer(config: UpulseConfig, port: number): Server { +export function createUIServer( + config: UpulseConfig, + port: number, +): Server { return Bun.serve({ port, hostname: '127.0.0.1', diff --git a/scripts/install-hooks.mjs b/scripts/install-hooks.mjs index 89153ab..a5d7a62 100644 --- a/scripts/install-hooks.mjs +++ b/scripts/install-hooks.mjs @@ -21,23 +21,38 @@ if (existsSync(hookPath)) { const hook = `#!/bin/sh # pulse-auto-hook — installed by scripts/install-hooks.mjs -# Runs lint + tests before pushing. Delete this file to disable. +# Runs lint + type-check + tests before pushing. Delete this file to disable. +set -e +ROOT=$(git rev-parse --show-toplevel) echo "[pre-push] Running lint..." bun x @biomejs/biome check packages/ || { - echo "\\n❌ Lint failed. Fix with: bun run lint:fix" + echo "\\\\n❌ Lint failed. Fix with: bun run lint:fix" exit 1 } -echo "[pre-push] Running tests (pulse)..." -cd packages/pulse && bun test || { - echo "\\n❌ Tests failed (pulse)" - exit 1 -} +echo "[pre-push] Type checking..." +for pkg in pulse upulse pulse-hermes pulse-cursor pulse-openclaw; do + if [ -f "$ROOT/packages/$pkg/tsconfig.json" ]; then + echo " tsc: $pkg" + (cd "$ROOT/packages/$pkg" && bun x tsc --noEmit) || { + echo "\\\\n❌ Type check failed ($pkg)" + exit 1 + } + fi +done -echo "[pre-push] Running tests (pulse-hermes)..." -cd ../pulse-hermes && bun test || { - echo "\\n❌ Tests failed (pulse-hermes)" +echo "[pre-push] Running tests..." +for pkg in pulse pulse-hermes pulse-cursor pulse-openclaw; do + echo " test: $pkg" + (cd "$ROOT/packages/$pkg" && bun test) || { + echo "\\\\n❌ Tests failed ($pkg)" + exit 1 + } +done +echo " test: upulse" +(cd "$ROOT/packages/upulse" && bun test src/config.test.ts) || { + echo "\\\\n❌ Tests failed (upulse)" exit 1 }