Generate TypeScript declarations #134
Merged
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.
@ehrencrona I'm sending this PR against your branch in #121
This builds the type declarations when you build the project
This uses
rollup-plugin-typescript2
in some subprojects and@rollup/plugin-typescript
in others, which probably isn't ideal, but works well enough for now.I couldn't get
@rollup/plugin-typescript
to generate the types. I'm not exactly sure why, but rollup/plugins#247 might be related. I find@rollup/plugin-typescript
to be so full of issues I try to avoid it as much as I canrollup-plugin-typescript2
generated the type declarations without problem once I realized we had"emitDeclarationOnly": true
and removed that so that it generated the.js
files. It didn't work on a couple of the adapters, so they haven't been switched. The error message was unclear. We should file a bug to request a better error message. I was wondering if it was because of therequire
statements inadapter-netlify
and perhaps TypeScript was expectingimport
statements insteadYou should check that this works end-to-end and gets picked up by the other sub-projects. I wasn't quite sure how to test that all the pieces fit together