Skip to content

chore(dx): tighten feedback loop — root lint/test, husky gates, check.sh signal-to-noise#19

Merged
nokternol merged 2 commits into
mainfrom
chore/dx-feedback-gates
Mar 9, 2026
Merged

chore(dx): tighten feedback loop — root lint/test, husky gates, check.sh signal-to-noise#19
nokternol merged 2 commits into
mainfrom
chore/dx-feedback-gates

Conversation

@nokternol

Copy link
Copy Markdown
Owner

Summary

  • Root npm test composes both workspaces sequentially (apps/api then apps/web), each running their own vitest config — avoids the Vite 5/6 hoisting conflict introduced by the root-level @sveltejs/vite-plugin-svelte@^4 (Storybook constraint)
  • Root npm run lint runs biome check . across all files from one place
  • lint-staged runs biome check --write on staged files and auto-restages any safe fixes before the commit lands
  • .husky/pre-commit now covers three gates: lint-staged → tsc (both workspaces) → vitest (both workspaces); each step captures output and only prints on failure — the failure message is the next action, no scrolling required
  • check.sh rewritten: silent on pass, deferred failure detail printed at the bottom; summary line shows N passed, N failed at a glance
  • apps/web/vitest.config.ts: import.meta.dirname for the $env/dynamic/public alias so the config is CWD-agnostic
  • vitest added to root devDependencies explicitly rather than relying on workspace hoisting

Why not a vitest workspace config?

Attempted but blocked: sveltekit() plugin captures process.cwd() at module load time and overrides Vite's root. Running it from repo root causes Vite 5 (root) vs Vite 6 (apps/web) type conflicts that break tsc. Composing via npm scripts is simpler and avoids touching the Storybook-sensitive Vite version split.

Test plan

  • npm test passes from repo root
  • npm run lint passes from repo root
  • Make a deliberate type error, attempt commit — pre-commit blocks with the tsc error printed directly
  • Make a deliberate test failure, attempt commit — pre-commit blocks with vitest output
  • Fix both, commit succeeds — only ✅ lines printed
  • CI quality-gate passes on this PR

🤖 Generated with Claude Code

nokternol and others added 2 commits March 9, 2026 21:19
….sh signal-to-noise

- Root npm test composes both workspaces (api + web run their own vitest config,
  avoiding the Vite 5/6 hoisting conflict with Storybook)
- Root npm lint runs biome check . for all files from one place
- lint-staged: biome check --write on staged files, auto-restages safe fixes
- .husky/pre-commit: lint-staged → tsc (api+web) → vitest (api+web); each step
  captures output and only prints on failure — failure message is the next action
- check.sh rewritten: silent on pass, prints captured logs only for failed steps;
  summary line shows pass/fail/warn counts at a glance
- apps/web/vitest.config.ts: use import.meta.dirname for alias path so config is
  CWD-agnostic when invoked from any directory
- vitest added to root devDependencies (explicit, not relying on workspace hoist)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
husky v9 no longer needs #!/usr/bin/env sh or the _/husky.sh source line.
They will fail in v10. Removing proactively.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@nokternol nokternol merged commit 493cd12 into main Mar 9, 2026
3 checks passed
@nokternol nokternol deleted the chore/dx-feedback-gates branch March 9, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant