Skip to content

chore(repo): finalize week 1 - readme, governance, ci, lint, husky (AC 5)#6

Merged
BODMAT merged 6 commits into
developmentfrom
chore/repo-setup
May 15, 2026
Merged

chore(repo): finalize week 1 - readme, governance, ci, lint, husky (AC 5)#6
BODMAT merged 6 commits into
developmentfrom
chore/repo-setup

Conversation

@BODMAT
Copy link
Copy Markdown
Owner

@BODMAT BODMAT commented May 15, 2026

What

Closes Week 1 AC 5 (full root README) and lands the supporting governance / CI / tooling infrastructure for ongoing work. Five commits, all repo-meta — no dashboard/ or extension/ source changes beyond a lint-config tweak and one stale comment removal.

Changes

Code

  • dashboard/eslint.config.mjs — stricter TS rules: no-explicit-any: error, ban-ts-comment: error, consistent-type-assertions (no object-literal casts), no-restricted-syntax blocking as unknown chains; ignore generated/**
  • dashboard/server/db.ts — drop redundant eslint-disable-next-line no-var

Tooling / config

  • package.json + package-lock.json (new root) — husky + lint-staged for the pre-commit hook
  • .husky/pre-commit — runs npx lint-staged
  • lint-staged.config.mjs — JS config; uses npm --prefix dashboard run lint -- --fix <relative paths> so the dashboard ESLint flat config resolves with the correct cwd cross-platform
  • .github/workflows/ci.yml — two jobs (dashboard lint + tsc, extension tsc) on PR/push to development and main
  • .gitattributes* text=auto eol=lf + binary patterns
  • .nvmrc20

Docs / plan

  • README.md — replaces 7-line placeholder with full setup guide (repo layout, tech stack, prerequisites, docker-compose, prisma migrate, dashboard dev, extension load)
  • LICENSE — MIT
  • CONTRIBUTING.md — Plan→Review→Implement summary, branch naming, commit conventions, branch-protection setup notes, file map
  • .github/PULL_REQUEST_TEMPLATE.md — enforces plan/AC references in every PR
  • plans/ reorganized under plans/week1/ (4 renames + 3 new plans: AC5 readme, governance+CI, husky)

Design decisions

  • Husky + lint-staged at root, ESLint runs from dashboard cwd. Repo has no workspace tool; root package.json hosts hooks only. lint-staged's JS config does the path arithmetic so npm --prefix dashboard run lint works cross-platform without shell tricks.
  • CI runs lint + tsc, not build. Build doubles runtime; lint + tsc catches most issues. Add next build / vite build only when a build-only failure escapes.
  • prisma generate is mandatory before tsc in CI, and needs a dummy DATABASE_URL. Dashboard imports from gitignored @/generated/prisma/client; without generation, tsc fails with "Cannot find module". And prisma.config.ts uses prisma/config's strict env() helper, which throws at load time if DATABASE_URL is unset — so the CI step sets a dummy URL (the command never actually connects).
  • Two CI jobs instead of a matrix. Different scripts per package (lint exists in dashboard, not extension). Named jobs (CI / dashboard, CI / extension) plug into branch protection as required checks.
  • Extension lint deferred. No eslint.config.mjs in extension/ yet — captured in plans for Week 2 pickup.

Verification

  • npm run lint (dashboard) — 0 errors, 0 warnings
  • npx tsc --noEmit (dashboard) — clean
  • npm run typecheck (extension) — clean
  • npx lint-staged --diff "HEAD~1 HEAD" — ESLint runs correctly with relative paths through npm --prefix dashboard run lint
  • core.hooksPath = .husky/_ set by husky's prepare script during npm install
  • README walkthrough cross-checked against actual file paths, ports, commands

Out of scope (future PRs)

Captured in each plan's "Out of scope" section. Highlights:

  • Extension ESLint config — Week 2 (when extension code grows)
  • Pre-push hook running tsc --noEmit — if devs start landing bad type-checks
  • Production extension ID in CORS allowlist — Week 4 AC 2 (extension packaging)
  • Dependabot / CodeQL / build step in CI — Week 4
  • Branch-protection toggles — manual GitHub UI step after the first green CI run on development

Closes

  • Week 1 AC 5 — root README (docs/Task.md#L59)
  • Week 4 AC 1 partially — CI runs on PRs to development/main (docs/Task.md#L97); branch-protection toggles remain a manual step

BODMAT added 5 commits May 15, 2026 19:30
GitHub Actions workflow that runs on every pull request and push
to development/main. Two jobs:

- dashboard: prisma generate (required before tsc — generated client is
  gitignored), npm run lint, tsc --noEmit
- extension: tsc --noEmit
Stricter eslint rules in dashboard to enforce CLAUDE.md type-safety
guarantees at PR time:

- @typescript-eslint/no-explicit-any: error
- @typescript-eslint/ban-ts-comment: error
- @typescript-eslint/consistent-type-assertions: forbid object-literal
  casts ({ foo } as T)
- no-restricted-syntax: forbid casting to unknown (incl. as unknown as T)

Also ignore generated/** (output of prisma generate — autogenerated)
and remove the now-redundant eslint-disable-next-line in server/db.ts.
Pre-commit hook runs eslint --fix on staged dashboard files via
lint-staged. Catches issues locally before CI; typecheck stays in CI
because it needs the whole project and is too slow per-commit.

- husky + lint-staged installed in a new root package.json (the repo
  is a monorepo without a workspace tool)
- lint-staged.config.mjs uses npm --prefix dashboard to run eslint
  from the dashboard cwd so the flat config resolves naturally
- .gitattributes normalizes line endings to LF — stops the
  "LF will be replaced by CRLF" warnings on every commit
- .nvmrc pins Node 20 for nvm use / IDE auto-switch
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
worktrace Ready Ready Preview, Comment May 15, 2026 6:11pm

prisma.config.ts uses prisma/config's strict env() helper, which
throws PrismaConfigEnvError if DATABASE_URL is missing at load time.
The CI runner has no .env file (gitignored), so prisma generate
failed before reading the schema.

prisma generate does not connect to the database — it only reads the
schema and writes the generated client + zod schemas. A dummy URL
satisfies the config loader without touching any real database.

Set DATABASE_URL only on the prisma generate step, not on the whole
job, so an accidental query elsewhere still fails loudly.
@BODMAT BODMAT merged commit d01cf27 into development May 15, 2026
4 checks passed
@BODMAT BODMAT deleted the chore/repo-setup branch May 15, 2026 18:16
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