chore: use unbundled type declarations for @sveltejs/kit/* modules - #16775
chore: use unbundled type declarations for @sveltejs/kit/* modules#16775Rich-Harris wants to merge 2 commits into
@sveltejs/kit/* modules#16775Conversation
|
Install the latest version of pnpm add https://pkg.svelte.dev/@sveltejs/kit/c/4e1b22cbcdce6deb7ba1fed6c21872a3e62a6342Open in |
🦋 Changeset detectedLatest commit: 4e1b22c 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 |
|
We might also need to avoid importing internal files/types in those |
We use dts-buddy to bundle our types, but the original reason for doing so doesn't really apply any more, as far as the
@sveltejs/kit/*modules go — everyone uses a modernmoduleResolutionoption now (I think the legacy ones were removed or deprecated?) which meanstypesresolve conditions inpackage.exportsare reliable. So we don't need to usedeclare modulefor people to be able to see the types of subpackages.We do still need it for
$app/*modules, of course. But making this change speeds upprepublishOnly, and means that cmd-click works much more reliably (no sourcemaps between you and the code).One thing I'm not sure about is why the
RequestEventandCookiestypes are being inlined into$app/serverrather than imported from@sveltejs/kit. Not sure off the top of my head if that's a bug in dts-buddy or a missing piece of config or something.Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits