Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ jobs:
run: bunx syncpack lint
timeout-minutes: 1
- name: Test
run: TURBO_NO_DAEMON=1 bunx turbo run test --filter='!site' --filter='!@paws/dashboard' --filter='!@paws/cli' ${{ github.event_name == 'pull_request' && '--affected' || '' }}
run: TURBO_NO_DAEMON=1 bunx turbo run test --filter='!site' --filter='!@paws/dashboard' --filter='!@paws/cli'
timeout-minutes: 5
- name: Knip
run: bun run knip
timeout-minutes: 2
continue-on-error: true # Pre-existing unused exports/deps — tracked separately
1 change: 1 addition & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bunx turbo run typecheck --filter='!site'
15 changes: 15 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,24 @@ See @docs/testing.md for full strategy.
- Zod for all external data (API requests, config, env via `@t3-oss/env-core`)
- Commit prefix with scope: `firecracker: add snapshot restore`, `control-plane: add sessions`
- Each commit independently valid (bisect-friendly)
- **Bun workspace catalog for dependency versions.** Shared deps are defined once in root
`package.json` under `workspaces.catalog`. Packages use `"zod": "catalog:"` instead of pinning
versions. To add or bump a shared dep: edit the catalog in root `package.json`, then run
`bun install`. Never pin versions directly in workspace packages for deps in the catalog.
- **No `as any` or `as unknown` typecasts.** Use type guards, narrowing, conditional spreads, or
narrower type definitions. In tests, define explicit helper types (e.g., `type FetchFn`) rather
than casting mocks.

## Gotchas

- **`@types/bun` at root, not per-package.** All TypeScript types come from the root `@types/bun`
devDependency. Every package's `tsconfig.json` extends `packages/typescript-config/library.json`
(or `app-bun.json` / `app-react.json`), which extends `base.json`. Never add `bun-types`,
`@types/bun`, or `@types/node` to individual packages. Never set `"types": [...]` in per-package
tsconfigs, as it overrides auto-detection and breaks type resolution.
- **Bun's `fetch` has extra methods.** `typeof globalThis.fetch` under Bun includes `preconnect`,
which vitest mocks don't have. In tests, use `fn as unknown as typeof globalThis.fetch` to cast
mock functions to the fetch type. Don't use `as any`.
Comment on lines +127 to +140
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

git ls-files CLAUDE.md

Repository: arek-e/paws

Length of output: 64


🏁 Script executed:

cat -n CLAUDE.md | sed -n '120,145p'

Repository: arek-e/paws

Length of output: 2188


Resolve the contradictory cast policy in this section.

Line 127 bans as any or as unknown categorically, but line 139 explicitly prescribes fn as unknown as typeof globalThis.fetch in tests. Update the rule to allow documented interop edge cases like this one.

Suggested fix
-- **No `as any` or `as unknown` typecasts.** Use type guards, narrowing, conditional spreads, or
-  narrower type definitions. In tests, define explicit helper types (e.g., `type FetchFn`) rather
-  than casting mocks.
+- **No `as any` typecasts; avoid `as unknown` except documented interop edge-cases.** Use type
+  guards, narrowing, conditional spreads, or narrower type definitions. In tests, prefer explicit
+  helper types (e.g., `type FetchFn`) over cast chains.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` around lines 127 - 140, Update the contradictory cast policy so it
forbids broad use of "as any" and "as unknown" in production code but explicitly
permits targeted double-casts used for interop test shims (e.g., "fn as unknown
as typeof globalThis.fetch"); change the prose around the rule and the Bun fetch
note to state that tests may use narrow, documented double-casts for
third-party/mock mismatches while recommending alternatives (type guards,
narrower helper types like "type FetchFn", or conditional spreads) for
application code and providing the exact example "fn as unknown as typeof
globalThis.fetch" as the sanctioned exception.

- **Dockerfiles use `COPY . .` with `.dockerignore`.** New packages are picked up automatically.
If you add files that shouldn't be in the Docker image (large assets, secrets, dev tools),
add them to `.dockerignore`.
Expand Down
15 changes: 7 additions & 8 deletions apps/control-plane/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@hono/oidc-auth": "^1.8.1",
"@hono/zod-openapi": "1.2.3",
"@hono/zod-openapi": "catalog:",
"@paws/credentials": "workspace:*",
"@paws/domain-audit": "workspace:*",
"@paws/domain-browser": "workspace:*",
Expand All @@ -37,14 +37,13 @@
"@paws/provider-hetzner-cloud": "workspace:*",
"@paws/providers": "workspace:*",
"@paws/provisioner": "workspace:*",
"better-sqlite3": "^12.8.0",
"drizzle-orm": "^0.45.2",
"hono": "^4.7.0",
"prom-client": "^15.1.3"
"better-sqlite3": "catalog:",
"drizzle-orm": "catalog:",
"hono": "catalog:",
"prom-client": "catalog:"
},
"devDependencies": {
"bun-types": "^1.3.11",
"neverthrow": "^8.2.0",
"vitest": "^4.1.2"
"neverthrow": "catalog:",
"vitest": "catalog:"
}
}
28 changes: 14 additions & 14 deletions apps/dashboard/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"typecheck": "tsc --build"
},
"dependencies": {
"@base-ui/react": "^1.3.0",
"@base-ui/react": "catalog:",
"@dagrejs/dagre": "^1.1.4",
"@fontsource-variable/inter": "^5.2.8",
"@paws/domain-browser": "workspace:*",
Expand All @@ -22,26 +22,26 @@
"@tanstack/react-router": "^1.120.0",
"@tanstack/react-table": "^8.21.3",
"@xyflow/react": "^12.6.4",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"class-variance-authority": "catalog:",
"clsx": "catalog:",
"cmdk": "^1.1.1",
"lucide-react": "^1.7.0",
"lucide-react": "catalog:",
"next-themes": "^0.4.6",
"radix-ui": "^1.4.3",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"shadcn": "^4.1.2",
"react": "catalog:",
"react-dom": "catalog:",
"shadcn": "catalog:",
"sonner": "^2.0.7",
"tailwind-merge": "^3.5.0",
"tw-animate-css": "^1.4.0"
"tailwind-merge": "catalog:",
"tw-animate-css": "catalog:"
},
"devDependencies": {
"@tailwindcss/vite": "^4.1.8",
"@types/react": "^19.1.4",
"@types/react-dom": "^19.1.5",
"@tailwindcss/vite": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"@vitejs/plugin-react": "^4.5.2",
"tailwindcss": "^4.1.8",
"typescript": "^6.0.2",
"tailwindcss": "catalog:",
"typescript": "catalog:",
"vite": "^6.3.5"
}
}
26 changes: 13 additions & 13 deletions apps/site/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@
"dependencies": {
"@astrojs/react": "^5.0.2",
"@astrojs/starlight": "^0.38.2",
"@base-ui/react": "^1.3.0",
"@base-ui/react": "catalog:",
"@fontsource-variable/geist": "^5.2.8",
"@tailwindcss/vite": "^4.2.2",
"@types/react": "^19.2.14",
"@types/react-dom": "^19.2.3",
"@tailwindcss/vite": "catalog:",
"@types/react": "catalog:",
"@types/react-dom": "catalog:",
"astro": "^6.0.1",
"class-variance-authority": "^0.7.1",
"clsx": "^2.1.1",
"lucide-react": "^1.7.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"shadcn": "^4.1.1",
"class-variance-authority": "catalog:",
"clsx": "catalog:",
"lucide-react": "catalog:",
"react": "catalog:",
"react-dom": "catalog:",
"shadcn": "catalog:",
"sharp": "^0.34.2",
"tailwind-merge": "^3.5.0",
"tailwindcss": "^4.2.2",
"tw-animate-css": "^1.4.0"
"tailwind-merge": "catalog:",
"tailwindcss": "catalog:",
"tw-animate-css": "catalog:"
}
}
9 changes: 4 additions & 5 deletions apps/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,11 @@
"@paws/logger": "workspace:*",
"@paws/proxy": "workspace:*",
"@paws/snapshot-store": "workspace:*",
"hono": "^4.7.0",
"neverthrow": "^8.2.0",
"prom-client": "^15.1.3"
"hono": "catalog:",
"neverthrow": "catalog:",
"prom-client": "catalog:"
},
"devDependencies": {
"bun-types": "^1.3.11",
"vitest": "^4.1.2"
"vitest": "catalog:"
}
}
Loading
Loading