fix: remove duplicate next-shims.d.ts from fixtures#1170
Conversation
Signed-off-by: Deepam Goyal <deepam02goyal@gmail.com>
|
/bigbonk review |
commit: |
There was a problem hiding this comment.
Good cleanup — consolidating the duplicated .d.ts files is the right call. Two issues need fixing before merge.
CI is red
The Check job fails with 4 consistent-type-definitions lint errors. The newly added declarations use interface where this repo's lint config requires type. The fix is mechanical — see inline suggestions below.
Scope observation
The examples/ directory still has two stale next-shims.d.ts copies (realworld-api-rest, pages-router-cloudflare) that are also subsets of the shared file. Those are out of scope for this PR (fixtures ≠ examples), but worth noting for a follow-up.
|
Review submitted. Here's a summary of the feedback: Request changes on PR #1170 with two main points:
|
Co-authored-by: ask-bonk[bot] <249159057+ask-bonk[bot]@users.noreply.github.com>
|
@james-elicx Should I clean up the examples copies too or is that out of scope? |
|
That would be great! |
|
/bigbonk review |
There was a problem hiding this comment.
Lint fixes look good — the type intersections from the first review are all addressed, and CI (vp check) passes clean. Tests all pass too (313 app-router, 204 pages-router, 916 shims+link).
One real bug to fix before merge, and a minor note.
Bug: next/link default export references undeclared value
The declare module "next/link" block defines LinkProps as a type but never declares Link as a value — then does export default Link referencing thin air. The deleted fixture copies all had const Link: ComponentType<LinkProps>; before the export. This is masked by skipLibCheck: true everywhere, but the declaration is incorrect — consumers get any for the default import.
Follow-up: examples cleanup
Per the thread with @james-elicx, the two stale copies in examples/ (realworld-api-rest, pages-router-cloudflare) should be cleaned up in this PR as well.
| onNavigate?: (event: { preventDefault(): void }) => void; | ||
| children?: ReactNode; | ||
| } & Omit<AnchorHTMLAttributes<HTMLAnchorElement>, "href">; | ||
| export default Link; |
There was a problem hiding this comment.
Bug: Link is referenced here but never declared as a value. The deleted fixture copies all had a const Link declaration. Without it, the default export resolves to any (hidden by skipLibCheck).
| export default Link; | |
| const Link: ComponentType<LinkProps>; | |
| export default Link; |
|
Review submitted. Here's a summary: One bug found, one follow-up noted.
Everything else looks good — lint fixes from the first review are all addressed, |
Apply the same consolidation from fixtures to examples/realworld-api-rest and examples/pages-router-cloudflare. Point their tsconfigs at the shared packages/vinext/src/shims/next-shims.d.ts instead of keeping local copies.
The deleted fixture copies all had `const Link: ComponentType<LinkProps>` before the default export. Without it the default import resolves to `any` (masked by skipLibCheck). Add the missing value declaration.
|
/bigbonk review |
There was a problem hiding this comment.
All feedback from prior reviews has been addressed:
- Lint fixes — All four
consistent-type-definitionsviolations (interface→typeintersection) are fixed.vp checkpasses. next/linkvalue declaration —const Link: ComponentType<LinkProps>is present beforeexport default Link(line 121). Bug fixed.- Examples cleanup — Both
examples/realworld-api-rest/next-shims.d.tsandexamples/pages-router-cloudflare/next-shims.d.tsare removed; their tsconfigs point to the shared file.
Verified:
- All 14 module declarations from the deleted fixtures/examples exist in the shared file (it's a superset).
- All relative paths in tsconfig
includearrays resolve correctly (../../../for fixtures,../../for examples). - No stale
next-shims.d.tscopies remain anywhere in the repo. - Check CI is green.
Clean consolidation — LGTM.
|
Review submitted. Here's the summary: Approved PR #1170. All feedback from the two prior review rounds has been addressed:
Verified that all 14 module declarations from deleted files exist in the shared file, all relative paths resolve correctly, and no stale copies remain anywhere in the repo. Check CI is green; remaining Vitest and E2E jobs are still pending. |
fixes #1169
three test fixtures had their own copy of
next-shims.d.tsduplicating what already exists in the main package. Removed those and pointed each fixture's tsconfig at the single shared file instead.Had to add a few missing declarations to the shared file first before removing the copies.