fix: emit declarations when the tsconfig lives above the package root - #16568
Merged
Rich-Harris merged 3 commits intoJul 30, 2026
Merged
Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/530e936fe0449082b5842d2359a00b595b0c144fOpen in Note This PR is from a fork. A maintainer must approve approve each commit before it can be built and installed. |
🦋 Changeset detectedLatest commit: 530e936 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Nic-Polumeyv
marked this pull request as ready for review
July 29, 2026 19:31
0.7.56 is the first version that resolves an absolute declarationDir (sveltejs/language-tools#2965).
svelte2tsx resolves a relative declarationDir against the tsconfig's directory, so declarations landed outside the temp dir whenever the tsconfig was not in the package root, and never got copied into dist.
Nic-Polumeyv
force-pushed
the
package-declaration-dir
branch
from
July 30, 2026 00:27
04f32c1 to
530e936
Compare
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.
When a package's only tsconfig or jsconfig lives above the package root, no
.d.tsreachesdistat all.emitDtsresolves a relativedeclarationDiragainst the tsconfig's directory rather than the cwd, so the declarations were written outside__package_types_tmp__and the copy step never saw them. Absolute paths only started working in svelte2tsx 0.7.56 (sveltejs/language-tools#2965), so the bump and the fix are both needed.Reported from the svelte2tsx side in sveltejs/language-tools#2182, where the kit half was spotted but never filed.