Make web typecheck self-sufficient so CI and local agree - #3
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #2.
pnpm typecheckpassed locally and failed in CI, which isthe bug worth fixing — not the two
TS2307s it happened to surface.Why it diverged.
apps/web/typecheckwas a baretsc --noEmit. Thedeclarations for
*.svgcome fromnext/image-types/global, referenced fromnext-env.d.ts— a file Next generates and.gitignore:76excludes. Adeveloper machine has one lying around from the last
next dev; a cleancheckout has none, so image imports do not resolve. Local and CI were
typechecking different inputs.
The fix.
next typegen && tsc --noEmit. Typegen writesnext-env.d.tsand
.next/typeswithout a full build, so typecheck now produces everythingtsc 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 fileall absent — the condition CI runs under: exit 0.
Not claimed: typed routes are still unenforced, because
typedRoutesisnot enabled in
next.config.ts. A<Link>to a nonexistent route passeseither way — I checked, rather than assuming typegen implied it. Enabling it
is a separate change.