-
Notifications
You must be signed in to change notification settings - Fork 207
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
Implement TypeScript support #131
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.
|
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
}), | ||
commonjs({include: 'node_modules/**'}), | ||
json(), | ||
rollupBabel({ | ||
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
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 --bundle
command.Also, I've changed the default for babel's
runtimeHelpers
tohasAnyDep('@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:
typescript
dependency andtsconfig.json
file in root directory.@babel/preset-typescript
to default babel configuration..ts
and.tsx
file extensions to default rollup configuration.src/index.ts
andsrc/index.tsx
entry 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-library
repo and it seemed to work out-of-the-box.Also, I think that
kcd-scripts lint
will fail on TypeScript files when using the default configuration. https://github.com/kentcdodds/eslint-config-kentcdodds should also be updated.