-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Generate .d.ts bundle from source #9992
Conversation
|
One compromise — had to expose That said, I realised just now that we're currently messing up by referencing these modules anyway, and need to come up with a different solution. Both of them indirectly reference the app version, which defeats the goal of maintaining hash stability between deployments. I therefore think we need to rethink how that's implemented, but that's out of scope of this PR so I'm going to punt on it for now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
l.g.t.m.
a o e o
u d n m
d l d e
e y i n
d n t
g a
r
i
l
y
/** | ||
* @type {import('@sveltejs/kit').error} | ||
* @overload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TIL -- I was searching for this a while ago and couldn't find it!
Co-authored-by: Ben McCann <322311+benmccann@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm. for those who haven't been following along, the motivation for this PR is explained in #9883 (comment)
I nerd-sniped myself in #9895 (comment) — I've created a small library, dts-buddy (couldn't think of a better name), for generating
.d.ts
bundles.It's currently missing two important features:
Also, virtual modules like
__sveltekit/environment
are currently a TODO. We also need toOnce those things are fixed, I think this gives us the best of all possible worlds — everything is derived from source (no more duplicating function definitions inside the hand-authored
.d.ts
files), and 'go to definition' will finally work properly. We also get to delete a bunch of stuff.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:
.