Skip to content

Instantly share code, notes, and snippets.

@nwalters512
Created August 16, 2018 21:02
Show Gist options
  • Save nwalters512/2f30bbe1b8d2ff14014f740e7b4feb2f to your computer and use it in GitHub Desktop.
Save nwalters512/2f30bbe1b8d2ff14014f740e7b4feb2f to your computer and use it in GitHub Desktop.
id: 2018.07.20-react-16
title: Update all packages to be React 16 compatible
adapter:
type: github
search_query: org:NerdWallet path:/ filename:package.json react
hooks:
should_migrate:
- node $SHEPHERD_MIGRATION_DIR/should_migrate.js
- git log -1 --format=%cd | grep 2018 --silent # Only migrate things that have seen commits in 2018
apply:
# Run nw-react tool
- node $SHEPHERD_MIGRATION_DIR/apply.js
# Add prop-types dependency
- npm install prop-types
# Update test-utils usage
- npm uninstall react-addons-test-utils
- git grep -l react-addons-test-utils -- ':!package.json' ':!package-lock.json' | xargs sed -i '' 's/react-addons-test-utils/react-dom\/test-utils/g'
# Update to @nerdwallet/react-router if on react-router@1
- $SHEPHERD_MIGRATION_DIR/update_react_router.sh
# Update to react-transition-group
- $SHEPHERD_MIGRATION_DIR/update_transition_group.sh
# Regenerate package-lock
- rm -rf node_modules
- rm package-lock.json
- npm install
pr_message: $SHEPHERD_MIGRATION_DIR/node_modules/.bin/nw-react react@16 --pr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment