Skip to content

Commit e6d71e4

Browse files
authored
chore(deps): update all dependencies (#22)
* chore(deps): bump frontend dependencies and drop unused - Bump direct deps to latest including majors: typescript ~5.9 -> ~6.0, eslint ^9 -> ^10, @eslint/js ^9 -> ^10, @types/node ^24 -> ^25, lucide-react ^1.7 -> ^1.12, shadcn ^4.1 -> ^4.6, vite ^8.0.1 -> ^8.0.10, vitest ^4.1.2 -> ^4.1.5, @base-ui/react ^1.3 -> ^1.4, recharts ^3.8.0 -> ^3.8.1, tailwindcss ^4.2.2 -> ^4.2.4, plus minor bumps. - Remove unused deps surfaced by depcheck: react-use-websocket (replaced earlier by native WebSocket), @fontsource-variable/geist (no references in src/ or styles), @testing-library/jest-dom (vitest setupFiles is empty; matchers never wired). - Drop deprecated tsconfig baseUrl (TS 6 removes it in 7.0); paths still resolve relative to tsconfig.json so the `@/*` alias keeps working. - npm audit is clean after the bump (was 2 moderate; transitive shadcn/hono). No metrics contract change. Build, type-check and 78 vitest specs pass. * chore(deps): bump rust dependencies - reqwest 0.12 -> 0.13 (only direct dep with a major bump available); no source changes needed (Client builder API unchanged for our usage). - cargo update refreshes the lockfile within existing semver ranges: axum 0.8.8 -> 0.8.9, clap 4.6.0 -> 4.6.1, sysinfo 0.38.x patch, tokio 1.50 -> 1.52, tower-http 0.6.x patch, plus rustls/wasm/icu chain. cargo fmt / cargo clippy --all-targets -D warnings clean. 72 tests pass. cargo machete reports no unused crates. * docs: condense CLAUDE.md project rules Trim verbose framing while preserving every operative rule: branch/PR protection, conventional-commit/release-please mapping, pre-commit checks, the metrics contract touchpoint list, and the tests-with-change expectation.
1 parent 5c9be67 commit e6d71e4

7 files changed

Lines changed: 1082 additions & 1097 deletions

File tree

CLAUDE.md

Lines changed: 36 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,59 @@
11
# spark-dashboard — Claude project rules
22

3-
These rules are project-specific. Global coding/test/security rules in `~/.claude/rules/` still apply.
3+
Project-specific. Global rules in `~/.claude/rules/` still apply.
44

5-
## Pre-commit verification (NON-NEGOTIABLE)
5+
## Branches & PRs
66

7-
CI fails fast on formatting. Always run the same checks CI runs *before* committing — do not skip, do not batch for "later".
7+
- `main` is protected. No direct pushes. Every change goes through a PR.
8+
- Branch name: `<type>/<slug>` (`feat/...`, `fix/...`, `docs/...`).
9+
- Squash-merge PR title = the commit on `main` → it must be a valid Conventional Commit.
10+
- All `ci.yml` jobs (rust, frontend, installer) must pass before merge.
811

9-
### Rust changes (anything under `src/`, `Cargo.toml`, `Cargo.lock`)
12+
## Commits drive releases
1013

11-
Run from the repo root, in this exact order (mirrors `.github/workflows/ci.yml` → job `rust`):
14+
`release-please` reads commits on `main` to bump versions and publish to crates.io. Format: `<type>(<scope>)<!>: <description>`.
15+
16+
| Type | Bump (pre-1.0) |
17+
| ---------------------------------------------------------- | ------------------------------- |
18+
| `feat:` | minor |
19+
| `fix:` | patch |
20+
| `feat!:` / `BREAKING CHANGE:` | minor (becomes major after 1.0) |
21+
| `chore`, `docs`, `refactor`, `test`, `ci`, `perf`, `style` | none |
22+
23+
Tags: `vX.Y.Z`. After merge, release-please opens a rolling release PR; merging it tags + triggers `publish.yml` (`cargo publish`).
24+
25+
**Never hand-edit**: `Cargo.toml` version, `Cargo.lock`, `.release-please-manifest.json`, `frontend/package.json`, `frontend/package-lock.json`, `CHANGELOG.md`. Release-please owns them.
26+
27+
## Pre-commit checks (run before pushing)
28+
29+
Rust changes (`src/`, `Cargo.*`):
1230

1331
```bash
1432
cargo fmt --all -- --check
1533
cargo clippy --all-targets --locked -- -D warnings
1634
cargo test --locked
1735
```
1836

19-
All three must exit 0. If `fmt --check` fails, run `cargo fmt --all` to fix, then re-run the check.
20-
21-
Note: the CI rust job builds the frontend first because `rust-embed` needs `frontend/dist/` at compile time. If you touched embedded assets, also run `(cd frontend && npm ci && npm run build)` before `cargo clippy`/`cargo test`.
22-
23-
### Frontend changes (anything under `frontend/`)
37+
Frontend changes (`frontend/`):
2438

2539
```bash
26-
cd frontend
27-
npm run build
28-
npm test -- --run
40+
cd frontend && npm run build && npm test -- --run
2941
```
3042

31-
Both must pass.
32-
33-
### When in doubt
34-
35-
If a change touches *both* Rust and frontend (e.g. metrics shape changes), run the full Rust block AND the full frontend block. CI runs both; you should too.
36-
37-
## Cross-stack contract: metrics
38-
39-
The metrics payload is consumed by the frontend. When you change *any* of the following, you must update *all* of the listed touchpoints in the same commit (or the same PR at minimum):
43+
If both stacks changed, run both blocks. If embedded assets changed, build the frontend first (`rust-embed` needs `frontend/dist/`).
4044

41-
**Trigger** — changes to:
42-
- `MemoryMetrics` / `GpuMetrics` / `CpuMetrics` struct shapes in `src/metrics/`
43-
- JSON field names / `serde` rename attributes
44-
- Display logic (e.g. `display_total_bytes`, formatters, marketed-capacity rounding)
45-
- New metric fields (added or removed)
45+
## Metrics contract (Rust ↔ frontend)
4646

47-
**Required updates**:
48-
1. **Rust unit tests** in `src/metrics/` — cover the new field/branch (`#[cfg(test)]` modules)
49-
2. **TypeScript types** in `frontend/src/types/metrics.ts` — keep in sync with serde output
50-
3. **Frontend formatters** in `frontend/src/lib/format.ts` — if the value needs human formatting
51-
4. **Vitest specs** in `frontend/src/__tests__/` — cover new rendering / formatting behavior
52-
5. **Affected components** in `frontend/src/components/` — wire new fields through
47+
When you change `MemoryMetrics`/`GpuMetrics`/`CpuMetrics` shape, serde names, display logic, or fields — update all of these in the same PR:
5348

54-
If any of (1)–(5) is genuinely not applicable, say so explicitly in the commit message. Default assumption is that all five are needed.
49+
1. Rust unit tests in `src/metrics/`
50+
2. TS types in `frontend/src/types/metrics.ts`
51+
3. Formatters in `frontend/src/lib/format.ts`
52+
4. Vitest specs in `frontend/src/__tests__/`
53+
5. Components in `frontend/src/components/`
5554

56-
## When adding or changing any feature
55+
If one is genuinely N/A, say so in the commit.
5756

58-
Add or update tests in the same commit. No behavior change ships without test coverage updates — backend OR frontend. This has been forgotten before; do not repeat.
57+
## Tests ship with the change
5958

60-
- New Rust function with branching logic → unit test in same file's `#[cfg(test)] mod tests`
61-
- New frontend component or formatter → Vitest spec in `frontend/src/__tests__/`
62-
- New API field → both the Rust serializer test AND the frontend type/test
59+
No behavior change merges without test coverage in the same PR. Rust branches → `#[cfg(test)]`. Frontend components/formatters → Vitest. New API field → both sides.

0 commit comments

Comments
 (0)