-
Notifications
You must be signed in to change notification settings - Fork 204
Implement TypeScript support #131
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #131 +/- ##
==========================================
+ Coverage 87.50% 87.65% +0.15%
==========================================
Files 18 18
Lines 328 332 +4
Branches 76 78 +2
==========================================
+ Hits 287 291 +4
Misses 34 34
Partials 7 7
Continue to review full report at Codecov.
|
kentcdodds
left a comment
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.
This looks great. Just one small thing. Thank you!
src/config/rollup.config.js
Outdated
| presets: babelPresets, | ||
| babelrc: !useBuiltinConfig, | ||
| runtimeHelpers: useBuiltinConfig, | ||
| runtimeHelpers: hasAnyDep('@babel/runtime'), |
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.
Let's use hasDep rather than hasAnyDep (looks like we'll need to create that). If they don't have it in their regular deps then it may not work for consumers.
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.
changed to hasDep
kentcdodds
left a comment
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.
Super. Thank you :)
|
🎉 This PR is included in version 5.7.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
|
Is there a reason we don't support |
|
Nope. I'd be happy to have support for typescript throughout the project 👍 |
|
@all-contributors please add @KubaJastrz for code |
|
I've put up a pull request to add @KubaJastrz! 🎉 |
Closes #130
What:
Allow building TypeScript files with
kcd-scripts build --bundlecommand.Also, I've changed the default for babel's
runtimeHelperstohasAnyDep('@babel/runtime')and I'm not entirely sure why this is needed.Why:
TypeScript is awesome and we want to use it in @testing-library source code.
More in #130 and testing-library/dom-testing-library#494
How:
typescriptdependency andtsconfig.jsonfile in root directory.@babel/preset-typescriptto default babel configuration..tsand.tsxfile extensions to default rollup configuration.src/index.tsandsrc/index.tsxentry files.Checklist:
I'm not exactly sure what and how to test this feature but if you have any ideas, I can help. I did some smoke tests on
dom-testing-libraryrepo and it seemed to work out-of-the-box.Also, I think that
kcd-scripts lintwill fail on TypeScript files when using the default configuration. https://github.com/kentcdodds/eslint-config-kentcdodds should also be updated.