From 2fb01e07bfc9ef3a04da2195a124b5af84520b94 Mon Sep 17 00:00:00 2001 From: Pablo Pettinari Date: Wed, 20 May 2026 17:52:47 +0200 Subject: [PATCH 1/2] fix: stop versioning next-env.d.ts and generate it for type-check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit next-env.d.ts is auto-generated by Next.js and the official recommendation is to keep it out of source control. Since Next 16, dev and build use different distDirs (.next/dev vs .next), so the file's content diverges between modes — making a stable committed version impossible. Revert versioning the file (#18139) and have `pnpm type-check` invoke `next typegen` to generate it on demand. typegen ships in Next 15.5+ and runs in ~600ms without a full build, producing the canonical build-mode types in .next/types/. Refs: https://nextjs.org/docs/app/api-reference/config/typescript https://github.com/vercel/next.js/issues/85738 --- .gitignore | 1 + next-env.d.ts | 6 ------ package.json | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) delete mode 100644 next-env.d.ts diff --git a/.gitignore b/.gitignore index 3c640a16713..8a79af47869 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ pnpm-lock.yaml.bak # typescript *.tsbuildinfo +next-env.d.ts # rss feeds feed.xml diff --git a/next-env.d.ts b/next-env.d.ts deleted file mode 100644 index 7a70f65a1ee..00000000000 --- a/next-env.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -/// -import "./.next/types/routes.d.ts" - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/app/api-reference/config/typescript for more information. diff --git a/package.json b/package.json index cc0fc65b154..485b58d68e4 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "start": "next start", "lint": "eslint .", "lint:fix": "eslint . --fix", - "type-check": "tsc --noEmit", + "type-check": "next typegen && tsc --noEmit", "format": "prettier \"**/*.{js,jsx,ts,tsx}\" --write", "preversion": "bash ./src/scripts/updatePublishDate.sh", "storybook": "storybook dev -p 6006", From 81f6870ea115f9fdc75ad6cc34d7136569f0292c Mon Sep 17 00:00:00 2001 From: wackerow <54227730+wackerow@users.noreply.github.com> Date: Thu, 21 May 2026 09:47:41 +0200 Subject: [PATCH 2/2] chore(docs): update to canonical `pnpm type-check` Avoids "cannot find module" errors until the `next-env.d.ts` file is generated by a fresh clone running `npx tsc --noEmit` --- .../skills/design-system/references/new-component-checklist.md | 2 +- AGENTS.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.claude/skills/design-system/references/new-component-checklist.md b/.claude/skills/design-system/references/new-component-checklist.md index cb49826176d..9f98cf53947 100644 --- a/.claude/skills/design-system/references/new-component-checklist.md +++ b/.claude/skills/design-system/references/new-component-checklist.md @@ -225,6 +225,6 @@ Title hierarchy: - [ ] No commented-out code - [ ] No `console.log` debug statements - [ ] No TODO comments without an owner / issue link -- [ ] Type errors clean (`npx tsc --noEmit`) +- [ ] Type errors clean (`pnpm type-check`) - [ ] Lint clean (`pnpm lint`) - [ ] Format clean (`pnpm format`) diff --git a/AGENTS.md b/AGENTS.md index a6d833e8f33..8d750e8260a 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -194,7 +194,7 @@ This project enforces type-safe chain names via TypeScript. When working with la 1. **Always look up exact names** - Before adding `chainName` or `supported_chains`, search `chains.ts` for the exact `name` value 2. **Names are case-sensitive and exact** - e.g., use `"Zircuit Mainnet"` not `"Zircuit"`, use `"OP Mainnet"` not `"Optimism"` -3. **Run type checking** - Use `npx tsc --noEmit` to verify chain names are valid before committing +3. **Run type checking** - Use `pnpm type-check` to verify chain names are valid before committing 4. **Non-EVM chains** - For Starknet and other non-EVM chains, use `NonEVMChainName` type **Common Mistakes:**