Ensure declaration reference published paths #64476
Closed
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.
We currently emit declaration for files that reference unknown modules e.g.
export { default as GlobalError } from 'VAR_MODULE_GLOBAL_ERROR';
innext/dist/build/templates/app-page.d.ts
.Since the referenced modules are declarated in
compiled.d.ts
which we do publish, I see no reason to not also letnext/dist/build/templates/app-page.d.ts
reference the appropriate ambient declaration file (compiled.d.ts
).The alternative is marking the whole module as
@internal
but checking if every export truly never flows into a public module takes way more time.This also unblocks the TypeScript 5.4 upgrade in #64043. TS 5.4 would emit a declaration referencing the appropriate ambient declaration but since
compiled.d.ts
is not part of the program butmisc.d.ts
is, the declaration would referencemisc.d.ts
(/// <reference path="../../../types/misc.d.ts"
) which is not published and would cause TypeScript compilation to fail.Closes NEXT-3104