Skip to content
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

[chore] export App types #2259

Merged
merged 2 commits into from
Aug 22, 2021
Merged

[chore] export App types #2259

merged 2 commits into from
Aug 22, 2021

Conversation

benmccann
Copy link
Member

@benmccann benmccann commented Aug 21, 2021

I think that exporting App will be enough to use init and request, but if not we can tweak a bit further

NOTE: If you open adapter-node/src/server.js in master, the import @sveltejs/kit/node cannot be resolved. I don't understand why. It'd be nice to use these new types in our own adapters, but I can't figure out why they're not available

@changeset-bot
Copy link

changeset-bot bot commented Aug 21, 2021

🦋 Changeset detected

Latest commit: 72cfa5f

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

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

@jthegedus
Copy link
Contributor

jthegedus commented Aug 22, 2021

NOTE: If you open adapter-node/src/server.js in master, the import @sveltejs/kit/node cannot be resolved. I don't understand why. It'd be nice to use these new types in our own adapters, but I can't figure out why they're not available

In VSCode,@sveltejs/kit when 'clicked to follow' takes me to @sveltejs/kit/types/index.d.ts

With @sveltejs/kit/node I guess VSCode is looking for @sveltejs/kit/types/node but cannot find anything. There is a @sveltejs/kit/dist/node.js file which is what is meant to be imported but there's no associated .d.ts, just JSDocs.

Esbuild doesn't seem to have a problem resolving @sveltejs/kit/node during build.

@jthegedus
Copy link
Contributor

jthegedus commented Aug 22, 2021

The init type needs updating, or all the adapters. It requires 1 param, but currently each adapter calls init without a param.

Maybe this is the wrong init type, is there another?

kit-init-type-error

@benmccann
Copy link
Member Author

Thanks for taking a look! You're right - that parameter needed to be optional

As for my issue using @sveltejs/kit/node it seems to be because TypeScript lacks support for exports: microsoft/TypeScript#33079. I'll look at some of the workarounds on that thread

@benmccann benmccann merged commit 90ae870 into master Aug 22, 2021
@benmccann benmccann deleted the export-app-types branch August 22, 2021 05:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants