Skip to content

Make web typecheck self-sufficient so CI and local agree - #3

Merged
lightchainaidev merged 3 commits into
mainfrom
fix/typecheck-self-sufficient
Aug 6, 2026
Merged

lightchainaidev merged 3 commits into
mainfrom
fix/typecheck-self-sufficient

Conversation

@lightchainaidev

Copy link
Copy Markdown
Contributor

Follow-up to #2. pnpm typecheck passed locally and failed in CI, which is
the bug worth fixing — not the two TS2307s it happened to surface.

Why it diverged. apps/web/typecheck was a bare tsc --noEmit. The
declarations for *.svg come from next/image-types/global, referenced from
next-env.d.ts — a file Next generates and .gitignore:76 excludes. A
developer machine has one lying around from the last next dev; a clean
checkout has none, so image imports do not resolve. Local and CI were
typechecking different inputs.

The fix. next typegen && tsc --noEmit. Typegen writes next-env.d.ts
and .next/types without a full build, so typecheck now produces everything
tsc needs rather than inheriting it. That is the shape the indexer already
uses (ponder codegen && tsc) — this brings web in line.

This replaces the hand-written declaration file from 9b300dc, which only
covered image imports and left the underlying split in place.

Verified with next-env.d.ts, .next/ and the removed declaration file
all absent — the condition CI runs under: exit 0.

Not claimed: typed routes are still unenforced, because typedRoutes is
not enabled in next.config.ts. A <Link> to a nonexistent route passes
either way — I checked, rather than assuming typegen implied it. Enabling it
is a separate change.

Replaces the hand-written image declarations from 9b300dc with the general
fix. `next typegen` writes next-env.d.ts and .next/types without a full
build, so `pnpm typecheck` now produces everything tsc needs instead of
depending on artefacts a previous `next dev` happened to leave behind. This
is the same shape the indexer already uses: `ponder codegen && tsc`.

The narrow fix only covered image imports. This covers anything Next
generates, and removes the split where a clean checkout typechecked
differently from a developer machine — which is the actual defect, and the
reason the failure was invisible locally.

Verified with next-env.d.ts, .next/ and the removed declaration file all
absent: exit 0.

Note for anyone expecting more from this: typed routes are still not
enforced, because `typedRoutes` is not enabled in next.config.ts. A Link to
a nonexistent route passes typecheck either way. Enabling it is a separate
change.
Removing the price column and the created-at line left five imports and
locals that nothing read, which pushed lint to 29 against a ceiling of 24 and
was the only genuine CI failure on this branch.

`formatPrice`, `formatUsdPrice` and the `useNativePrice` call go with the
price column. `dayjs` goes with the commented-out created-at line in the home
card. `ExternalLinkIcon` is instead wired into the transaction cell, which is
what it was imported for — the hash had already been shortened from 12
characters to 6 to make room for it.

Also fixes the empty state, which still spanned 7 columns after the price
column was dropped, so "No trades yet" stretched a column that no longer
exists.

Lint is now exactly at 24. Four of those are `minReceived` and `impactBps` in
the two trade forms, unread while their "Minimum received" and "Price impact"
blocks stay commented out; restoring that UI takes the ceiling to 20.
Removed at the operator's decision. CI was introduced by #2 and produced
mostly noise: every commit on a PR branch triggered two full runs, because
`on: push` had no branch filter and `on: pull_request` covered the same
commit, and GitHub repeatedly failed to resolve the action downloads
("Service Unavailable") before any step ran.

The gates themselves are unchanged and still run locally:

    pnpm typecheck && pnpm lint && pnpm test
    cd contracts && npx hardhat test --network hardhat

All four pass at this commit. Nothing now enforces them on a pull request —
the two defects CI caught on this branch (typecheck depending on a gitignored
generated file, and symbols orphaned by the trade-table edits) would both have
reached main unnoticed.

The workflow is recoverable from history:

    git show 81bbf9b:.github/workflows/ci.yml > .github/workflows/ci.yml

Restoring it is worth doing with `push` scoped to main, which fixes the
duplicate runs that made it noisy.
@lightchainaidev
lightchainaidev merged commit e3868ea into main Aug 6, 2026
@lightchainaidev
lightchainaidev deleted the fix/typecheck-self-sufficient branch August 6, 2026 19:06
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