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
feat(babel): add typings #462
Conversation
packages/babel/test/types.ts
Outdated
@@ -0,0 +1,22 @@ | |||
import babel from '../types'; |
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.
import babel from '../types'; | |
import babel from '../'; |
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.
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.
Looking good! One more export needed
FYI this shouldn't be merged until DefinitelyTyped/DefinitelyTyped#45613 is included as it breaks locally! |
} | ||
|
||
type CustomInputPluginOptions = ( | ||
options: RollupBabelInputPluginOptions & Record<string, any> |
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.
TS is not my strongest suit so take my comment with a grain of salt - maybe instead of accepting & Record<string, any>
here this should be parametrized with a generic?
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.
I didn't think the customOptions
should be a 1-1 mapping, as that would limit the custom plugin, so they could not remove or add options. I think this way the user could build stronger on top if necassary.
This was published and I updated the version here, so good to merge now :) |
@Andarist if you think this looks good to go, we'll merge this. As the custodian of this plugin, I'd like to get your thumbs up first. |
ping @Andarist |
* feat(babel): add typings * refactor(babel): typings PR feedback * chore(babel): update lockfile * refactor(babel): named export + dev dep * refactor(babel): typing PR feedback round 2 * test(babel): remove old options * chore(babel): order peerDeps * fix(babel): typing typos * refactor(babel): consistent typing names
Rollup Plugin Name:
babel
This PR contains:
Are tests included?
Breaking Changes?
If yes, then include "BREAKING CHANGES:" in the first commit message body, followed by a description of what is breaking.
List any relevant issue numbers:
Description
Adds TypeScript typings to the
@rollup/plugin-babel
so the plugin works nicely in TypeScript environments. I used the@rollup/plugin-commonjs
typings as a template for this :)