chore: untrack apps/docs/next-env.d.ts - #134
Merged
Merged
Conversation
Next.js regenerates this file inside its own commands and writes a different variant per mode: `next build` / `next typegen` write `import "./.next/types/routes.d.ts";` while `next dev` writes `import "./.next/dev/types/routes.d.ts";`. The tracked copy is the build variant, so running the docs dev server flips a tracked file that the file's own header says must not be edited. Add it to .gitignore and drop it from the index. Nothing checks it in from a fresh clone: `type-check` runs `next typegen` before `tsc --noEmit`, and the Cloudflare deploy path runs `next build` inside `opennextjs-cloudflare build`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Yaqu7kmKZM3tRPd9Y4xivo
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.
Fixes #124
Untrack
apps/docs/next-env.d.ts— the untrack route adjudicated in the triage comment on the issue.Next.js regenerates this file inside its own commands, and it writes a different variant per mode:
next buildandnext typegenwrite the.next/types/routes.d.tsimport,next devwrites the.next/dev/types/routes.d.tsone. The committed copy was the build variant, so starting the docs dev server flipped a tracked file whose own header says it must not be edited — agit add -Atrap landing precisely on agents doing the browser verification AGENTS.md asks for.Diff is two files: one
.gitignoreline (plus a comment) and the index removal. The file stays on disk; only the index entry goes.The premise was verified first, in a genuinely fresh clone
Triage made this a fork, not a fallback: from a clean tree with the file absent, the
type-checkpath and the Cloudflare deploy path must still work. Measured in a freshgit cloneof this branch (file absent, no.next/, thenpnpm install --frozen-lockfile) — not in the warm worktree, wheregit rm --cachedleaves the file on disk and hides the question:pnpm install --frozen-lockfile(runs thefumadocs-mdxpostinstall)tsc --noEmit, no Next command run at all, file absentpnpm turbo run type-check --continue --forcenext typegenregenerates the file beforetscrunspnpm turbo run build --forcepnpm turbo run test --forcepnpm exec opennextjs-cloudflare buildfrom a pristine tree (the deploy script's first half)next buildregenerates the file inside itThe bare-
tsclegs were run non-incrementally, and the run was shown able to go red (an injectedTS2322inapps/docs/lib/i18n.ts, then reverted) — an exit 0 from a tsc that cannot fail would prove nothing.One limit, stated plainly: the upload half,
opennextjs-cloudflare deploy, was not executed — it needsCLOUDFLARE_API_TOKEN/CLOUDFLARE_ACCOUNT_ID, which this environment does not have. It was verified from configuration and CLI source instead:deployCommandconsumes the compiled OpenNext config and.open-next/artifacts and shells out towrangler deploy;wrangler.jsoncpointsmainat.open-next/worker.jsand assets at.open-next/assets. Nothing on that path reads the app'snext-env.d.ts. (Thenext-envstring that does appear in@opennextjs/cloudflareisnext-env.mjs, its generated env-vars module — unrelated.)Before/after, reproduced rather than asserted
The issue measured the flip on
69204ab; reproduced here on currentmain(0246b2f), same triple:with the diff being exactly the routes-import line flipping to its
.next/dev/form.After this change, the same dev-server run (
next devon port 3124, Ready,/docsserved HTTP 200), then:while the file on disk had in fact flipped to the dev variant. That is the deliverable's proof: the file still changes, and git no longer notices.
Notes
path.posix.join(distDir, 'types/routes.d.ts')inwriteAppTypeDeclarations, and dev mode'sdistDiris.next/dev. The flip follows Next 16's separate dev dist directory, so it does not read like something a patch release removes.AGENTS.mddeliberately untouched — governed surface, and PR docs(agents): correct the documented docs dev-server port to 3000 #123 is awaiting the maintainer there.Gates run at
343fbaf:pnpm install --frozen-lockfile(0),pnpm turbo run type-check --continue --force(0),pnpm turbo run build --force(0),pnpm turbo run test --force(0),check-translations.mjs(0),check-translation-ownership.mjs --actor os-elon(0),check-translation-output.mjs --files(0) and--self-test(0). Changed-file list for the translation gates was computed against the realorigin/mainmerge-base (0246b2f):.gitignore,apps/docs/next-env.d.ts.Generated by Claude Code