From b48ad5fedf351e860eb29ec366696ed4868ca18a Mon Sep 17 00:00:00 2001 From: lightchainaidev Date: Thu, 6 Aug 2026 17:55:27 +0200 Subject: [PATCH 1/3] build(web): generate Next's types as part of typecheck MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/web/package.json | 2 +- apps/web/types/next-images.d.ts | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 apps/web/types/next-images.d.ts diff --git a/apps/web/package.json b/apps/web/package.json index c1097bf..442b664 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -11,7 +11,7 @@ "start": "next start", "lint": "eslint --max-warnings 24", "format": "prettier --write \"**/*.{ts,tsx}\"", - "typecheck": "tsc --noEmit", + "typecheck": "next typegen && tsc --noEmit", "test": "vitest run" }, "dependencies": { diff --git a/apps/web/types/next-images.d.ts b/apps/web/types/next-images.d.ts deleted file mode 100644 index 668afcc..0000000 --- a/apps/web/types/next-images.d.ts +++ /dev/null @@ -1,10 +0,0 @@ -// Declarations for static image imports (`import light from "…/sun-01.svg"`). -// -// Next normally supplies these through `next-env.d.ts`, but that file is -// generated by `next dev` / `next build` and is gitignored, so a clean checkout -// — CI — typechecks without it and every image import fails with TS2307. This -// references Next's own declarations rather than restating them, so the types -// stay whatever the installed Next says they are. -/// - -export {}; From 81bbf9b4ac13d118997ce66d5ab0d44bab86dfe1 Mon Sep 17 00:00:00 2001 From: lightchainaidev Date: Thu, 6 Aug 2026 18:57:08 +0200 Subject: [PATCH 2/3] fix(web): clear the symbols orphaned by the trade-table edits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- apps/web/components/home/token-card.tsx | 1 - apps/web/components/token/token-trade-table.tsx | 9 ++++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/apps/web/components/home/token-card.tsx b/apps/web/components/home/token-card.tsx index 8c3aa11..8c98a04 100644 --- a/apps/web/components/home/token-card.tsx +++ b/apps/web/components/home/token-card.tsx @@ -2,7 +2,6 @@ import Link from "next/link"; import { useMemo } from "react"; import { CheckCircle2 } from "lucide-react"; -import dayjs from "@/lib/dayjs"; import { ipfsToHttp, weiToNative } from "@/lib/ipfs"; import { formatUsd } from "@/lib/utils"; import useNativePrice from "@/hooks/useNativePrice"; diff --git a/apps/web/components/token/token-trade-table.tsx b/apps/web/components/token/token-trade-table.tsx index 09c7cce..7dbbb93 100644 --- a/apps/web/components/token/token-trade-table.tsx +++ b/apps/web/components/token/token-trade-table.tsx @@ -7,8 +7,7 @@ import { useSuspenseQuery } from "@tanstack/react-query"; import dayjs from "@/lib/dayjs"; import useCurrentChain from "@/hooks/useCurrentChain"; import tokenQuery from "@/queries/tokenQuery"; -import useNativePrice from "@/hooks/useNativePrice"; -import { formatBigNumber, formatPrice, formatUsdPrice } from "@/lib/utils"; +import { formatBigNumber } from "@/lib/utils"; import type { Trade } from "@/types"; import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@lcai/ui/components/table"; import { Tooltip, TooltipContent, TooltipTrigger } from "@lcai/ui/components/tooltip"; @@ -19,7 +18,6 @@ export function TokenTradeTable({ trades }: { trades?: Trade[] }) { const { address } = useParams<{ address: string }>(); const { data: token } = useSuspenseQuery(tokenQuery(address)); const explorer = chain.blockExplorers?.default.url; - const nativePrice = useNativePrice(); const nativeSymbol = chain.nativeCurrency.symbol; return ( @@ -37,7 +35,7 @@ export function TokenTradeTable({ trades }: { trades?: Trade[] }) { {!trades?.length ? ( - + No trades yet @@ -104,9 +102,10 @@ export function TokenTradeTable({ trades }: { trades?: Trade[] }) { href={`${explorer}/tx/${trade.txHash}`} target="_blank" rel="noopener noreferrer" - className="hover:underline" + className="inline-flex items-center gap-1 hover:underline" > {trade.txHash.slice(0, 6)}... + ) : ( <>{trade.txHash.slice(0, 6)}... From 4248387d3d75298fd43735d91ed12263dd4a74fd Mon Sep 17 00:00:00 2001 From: lightchainaidev Date: Thu, 6 Aug 2026 19:32:01 +0200 Subject: [PATCH 3/3] ci: remove the workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- .github/workflows/ci.yml | 123 --------------------------------------- 1 file changed, 123 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 03fb62c..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,123 +0,0 @@ -name: ci - -on: - push: - pull_request: - -# This workflow only reads the repo — nothing publishes, comments, or deploys. -permissions: - contents: read - -# Cancel superseded runs on the same ref. -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true - -jobs: - # --------------------------------------------------------------------------- - # Workspace packages (apps/*, packages/*) — pnpm. - # `contracts/` is deliberately NOT a workspace package; it has its own job. - # --------------------------------------------------------------------------- - js: - name: typecheck / lint / test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.33.4 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - # @lcai/abis is generated-but-committed and imported by api, indexer and - # web. It must be built before anything typechecks against it. - - name: Build @lcai/abis - run: pnpm --filter @lcai/abis build - - - name: Typecheck - run: pnpm typecheck - - - name: Lint - run: pnpm lint - - - name: Test - run: pnpm test - - # --------------------------------------------------------------------------- - # Solidity — npm, not pnpm. `contracts/` has its own package-lock.json. - # --------------------------------------------------------------------------- - contracts: - name: solidity - runs-on: ubuntu-latest - defaults: - run: - working-directory: contracts - steps: - - uses: actions/checkout@v4 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: npm - cache-dependency-path: contracts/package-lock.json - - - name: Install dependencies - run: npm ci - - - name: Compile - run: npx hardhat compile - - # `--network hardhat` is MANDATORY. hardhat.config.ts sets - # `defaultNetwork: "lcaiTestnet"`, which points at the live public testnet - # (https://rpc.testnet.lightchain.ai). Omitting the flag targets it. - # ALCHEMY_API_KEY is intentionally unset: without it forking is disabled - # and the suite runs entirely against the in-repo Uniswap V2 mocks. - - name: Test - run: npx hardhat test --network hardhat - - # --------------------------------------------------------------------------- - # Dependency advisories — reported, not enforced. - # --------------------------------------------------------------------------- - audit: - name: dependency audit - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Install pnpm - uses: pnpm/action-setup@v4 - with: - version: 10.33.4 - - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install dependencies - run: pnpm install --frozen-lockfile - - # Non-blocking. As of f9db5a6 `pnpm audit --audit-level high` reports - # `4 low | 57 moderate | 42 high | 2 critical` — those are path - # instances; deduplicated it is 1 unique critical and 38 unique high - # (84 unique advisories in total). - # Both "criticals" are the same vitest <3.2.6 advisory, reached once via - # apps/web and once via apps/api. It is dev-only and exploitable only - # while the Vitest UI server is listening, so it is NOT runtime-reachable. - # Flip to blocking once the runtime-reachable advisories (next, - # @fastify/static, ws, socket.io-parser, find-my-way, drizzle-orm) are - # cleared. - - name: Audit - run: pnpm audit --audit-level high - continue-on-error: true