-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove internal __sveltekit/
module declarations from types
#11620
Conversation
Takes advantage of the fact that dts-buddy doesn't detect the ambient-private.d.ts module declarations (which arguably is a bit weird and could result in buggy behavior, but we can use it to our advantage here). fixes #11607
🦋 Changeset detectedLatest commit: 124adbf 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 |
The test failures look legit, the paths have different values somehow? |
Ah, of course — it's because the bindings are live. By re-exporting them, they stay live. By aliasing them, we evaluate them eagerly. I think we're going to have to find another approach unfortunately. |
One idea — we could use |
Ah that's a gnarly gotcha - yeah I guess we have to use |
#11406 (comment) this could be another way solve this - use a path alias in our tsconfig to resolve to a |
Yeah, this is right. I think that's the correct behaviour though — if you were using |
I went with the facade |
Takes advantage of the fact that dts-buddy doesn't detect the
ambient-private.d.ts
module declarations (which arguably is a bit weird and could result in buggy behavior, but we can use it to our advantage here).My guess why this happens:
dts-buddy
doesn't pick upambient-private.d.ts
because it's not using theincludes
field of thetsconfig.json
and instead only follows the paths it knows from imports - in the case of__sveltekit/x
it doesn't know where to go though so it leaves it as is. One could argue that this is the desired/expected behavior. If not, then we would need a mechanism to telldts-buddy
that certain ambient module declarations are private and shouldn't be bundled in unless they are needed (through@internal
for example).fixes #11607
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. Changesets that add features should beminor
and those that fix bugs should bepatch
. Please prefix changeset messages withfeat:
,fix:
, orchore:
.Edits