fix(ci): type-check and build the workspace root #54

Sammanfogat
supernaut sammanfogade 1 incheckning från fix/ci-typecheck-root in i main 2026-09-24 13:05:50 +00:00
Ägare

What was wrong

CI's type-check and build steps ran pnpm -r typecheck / pnpm -r build. pnpm recursive
commands exclude the workspace root package by default, so both steps only ever covered
contract/. The root package (.), which holds src/** (the money-handling domain
logic), has never been type-checked or built in CI since the project's first CI commit.

lefthook.json's pre-push type-check and build jobs had the same pnpm -r gap, so a
local pre-push run gave the same false green.

This was silent: pnpm typecheck locally (what a contributor runs by hand) does catch
root errors, but nobody runs that day to day, and CI's own signal never did. Running
tsc --noEmit -p . on HEAD surfaced 3 real TS2353 errors in
src/provider/mollie.test.ts, unrelated to this fix, that had been sitting there since
2026-08-05.

The fix

  • .forgejo/workflows/ci.yml: add --include-workspace-root to the Type-check and Build
    steps, so both . and contract/ are checked and built.
  • lefthook.json: same flag on the matching pre-push type-check and build jobs.
  • src/provider/mollie.test.ts: refundedPaymentClient's refunds param was typed as
    { id: string; status: string }[], missing paymentId, which every call site's object
    literal actually includes. TypeScript's excess-property check on those literals was the
    source of the TS2353 errors. Widened the type to include paymentId: string, matching
    the real Mollie SDK Refund shape (paymentRefunds.page() returns Refund[], which
    has paymentId) that mollie.ts operates against. No any, no cast.

How verified

Locally, in a clean worktree at the PR tip:

  • pnpm -r --include-workspace-root typecheck — passes for both . and contract.
  • pnpm eslint and pnpm format:check — clean.
  • pnpm test — 166 tests, 11 files, all passing.
  • pnpm -r --include-workspace-root build — succeeds for both packages.
  • git push ran the full pre-push lefthook gate (format, eslint, type-check, drizzle-kit
    check, gitleaks, audit, test, build) — all green, including the now-fixed type-check and
    build steps.
## What was wrong CI's type-check and build steps ran `pnpm -r typecheck` / `pnpm -r build`. pnpm recursive commands exclude the workspace root package by default, so both steps only ever covered `contract/`. The root package (`.`), which holds `src/**` (the money-handling domain logic), has never been type-checked or built in CI since the project's first CI commit. `lefthook.json`'s pre-push `type-check` and `build` jobs had the same `pnpm -r` gap, so a local pre-push run gave the same false green. This was silent: `pnpm typecheck` locally (what a contributor runs by hand) does catch root errors, but nobody runs that day to day, and CI's own signal never did. Running `tsc --noEmit -p .` on HEAD surfaced 3 real `TS2353` errors in `src/provider/mollie.test.ts`, unrelated to this fix, that had been sitting there since 2026-08-05. ## The fix - `.forgejo/workflows/ci.yml`: add `--include-workspace-root` to the Type-check and Build steps, so both `.` and `contract/` are checked and built. - `lefthook.json`: same flag on the matching pre-push `type-check` and `build` jobs. - `src/provider/mollie.test.ts`: `refundedPaymentClient`'s `refunds` param was typed as `{ id: string; status: string }[]`, missing `paymentId`, which every call site's object literal actually includes. TypeScript's excess-property check on those literals was the source of the `TS2353` errors. Widened the type to include `paymentId: string`, matching the real Mollie SDK `Refund` shape (`paymentRefunds.page()` returns `Refund[]`, which has `paymentId`) that `mollie.ts` operates against. No `any`, no cast. ## How verified Locally, in a clean worktree at the PR tip: - `pnpm -r --include-workspace-root typecheck` — passes for both `.` and `contract`. - `pnpm eslint` and `pnpm format:check` — clean. - `pnpm test` — 166 tests, 11 files, all passing. - `pnpm -r --include-workspace-root build` — succeeds for both packages. - `git push` ran the full pre-push lefthook gate (format, eslint, type-check, drizzle-kit check, gitleaks, audit, test, build) — all green, including the now-fixed type-check and build steps.
supernaut lade till 1 incheckning 2026-09-24 13:04:22 +00:00
fix(ci): type-check and build the workspace root
Alla kontroller lyckades
ci / ci (pull_request) Successful in 41s
70f3ac87c3
pnpm -r excludes the workspace root package by default, so CI's
type-check and build steps only ever covered contract/, never the root
src/** money logic. Add --include-workspace-root to both steps in
ci.yml, and the matching lefthook pre-push jobs, so the root package
typechecks and builds.

Fixing this surfaced a real tsc error in mollie.test.ts:
refundedPaymentClient's refund param type was missing paymentId,
which every call site's literal includes. Widen the type to match the
real Mollie Refund shape instead of casting.
supernaut sammanfogade incheckning b61121d4a3 till main 2026-09-24 13:05:50 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-09-24 13:05:51 +00:00
supernaut refererade denna ändringsförfrågan från en incheckning 2026-10-02 17:57:02 +00:00
Logga in för att delta i denna konversation.
Inga granskare
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-payment!54
Ingen beskrivning angiven.