From f46d1c361ffaa3c529eb3543764fa6958811aa97 Mon Sep 17 00:00:00 2001 From: Brian Love Date: Sat, 29 Aug 2026 18:32:30 -0700 Subject: [PATCH] chore: stop tracking next-env.d.ts, which every build rewrites MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both apps/website/next-env.d.ts and apps/cockpit/next-env.d.ts are generated by Next, and their contents differ by command: `next dev` writes an import of ./.next/dev/types/routes.d.ts, `next build` writes the Nx dist path. Tracking them means every build or dev run dirties the working tree, and the file flips back and forth depending on what ran last. I reverted that churn three times in one session before treating it as a problem. There is already a workaround for it — apps/website/scripts/run-e2e-with-next-env-restore.ts rewrites the file to hardcoded canonical content after e2e. Kept: with the file ignored the git churn is gone, but the script still prevents a stale dev-path reference from being left behind for a later typecheck in the same tree. Verified from a simulated fresh clone (both files absent, as they will be after this change): Website job: nx lint 0, nx test 0, nx build 0 Cockpit job: nx build 0, nx test 0 Both builds regenerate the file, so nothing downstream needs it committed. Co-Authored-By: Claude Opus 5 --- .gitignore | 4 ++++ apps/cockpit/next-env.d.ts | 6 ------ apps/website/next-env.d.ts | 6 ------ 3 files changed, 4 insertions(+), 12 deletions(-) delete mode 100644 apps/cockpit/next-env.d.ts delete mode 100644 apps/website/next-env.d.ts diff --git a/.gitignore b/.gitignore index 597ce1580..5412c5798 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,10 @@ marketing/channels/marketing/cowork/outbox/dry-runs/ .next out .vercel +# Regenerated by every `next build` / `next dev`, and its contents differ +# between the two (dev writes ./.next/dev/types, build writes the Nx dist +# path). Tracking it means every build dirties the working tree. +apps/*/next-env.d.ts # Whitepaper signup data apps/website/data/ diff --git a/apps/cockpit/next-env.d.ts b/apps/cockpit/next-env.d.ts deleted file mode 100644 index c4b7818fb..000000000 --- a/apps/cockpit/next-env.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -/// -import "./.next/dev/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/apps/website/next-env.d.ts b/apps/website/next-env.d.ts deleted file mode 100644 index c4b7818fb..000000000 --- a/apps/website/next-env.d.ts +++ /dev/null @@ -1,6 +0,0 @@ -/// -/// -import "./.next/dev/types/routes.d.ts"; - -// NOTE: This file should not be edited -// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.