-
Notifications
You must be signed in to change notification settings - Fork 297
Upgrade Jest and Babel dependencies #227
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
Merged
threepointone
merged 9 commits into
reactjs:master
from
skovy:skovy/upgrade-dependencies
Jul 27, 2019
Merged
Upgrade Jest and Babel dependencies #227
threepointone
merged 9 commits into
reactjs:master
from
skovy:skovy/upgrade-dependencies
Jul 27, 2019
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Could you rebase/merge from master? |
Let’s only update package.json in this PR, and then I’ll land it. |
Thanks for the feedback @threepointone! I believe I reverted all the unnecessary changes and resolved the conflicts 😅 |
Thank you very much! I'll merge this and cut a new version. I appreciate the effort a lot! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
Now that
jscodeshift
supports TypeScript (added inv0.6.0
) I was exploring upgradingjscodeshift
to take advantage of that added support. I was able to get a proof of concept working and planning to open that in a separate PR. However, there were some conflicts between the currentbabel
packages and setup when upgradingjscodeshift
and a few cleanup items I was hoping to merge in this PR before opening a PR to propose upgradingjscodeshift
and adding TypeScript support (#206).Changes
Upgrade Dependencies
jest
: Jest is many major versions behind in this project. Also to take advantage ofspyOn
it was necessary to upgrade (see below for use case ofspyOn
).package.json
to changetestPathDirs
toroots
(Jest CHANGELOG v19.0.0)babel
: as recommended in the Jest Getting Started for Using Babel documentation add (or upgrade) the following babel packages:babel-jest
(upgraded)@babel/core
(peer dependency)@babel/preset-env
(this replacesbabel-preset-es2015
as documented here)@babel/plugin-proposal-object-rest-spread
(this replacesbabel-plugin-transform-object-rest-spread
)Update
prepublish
scriptPreviously, it was using
npm
to runlint
andtest
. Given the project is usingyarn.lock
it seems fair to assume development should be done usingyarn
? If so, it seems preferable to not mixyarn
andnpm
usage (happy to revert this change if there's opposition as it's not necessary for the purposes of this PR)Silencing verbose logging during testing
Some of the transforms have custom
console.log
orconsole.warn
calls to provide information while using the transforms. While running tests (yarn test
) these get verbose and make it difficult to see the whole test suite (happy to revert this change if there's opposition as it's not necessary for the purposes of this PR).[Before] Example of running `yarn test`
[After] Example of running `yarn test`
Update node version in CI
Previously, the node version was set to
4
for CI. This caused CI to fail (see this build) with the error:There is an open issue (yarnpkg/yarn#6900) for this when using
node
v4
with newer versions ofyarn
. I updated it to version10
for CI which resolved this error. I based this decision on the Node Releases and that10
is currently "Active LTS".Testing these changes
yarn
to install the new packagesprepublish
script is now ran withyarn
(rather thannpm
)yarn test