Skip to content

Instantly share code, notes, and snippets.

@xrkffgg
Forked from brandonbloom/antd-peer-deps.sh
Created October 26, 2020 01:13
Show Gist options
  • Save xrkffgg/897225c63cdde3f62fbd040bdadece23 to your computer and use it in GitHub Desktop.
Save xrkffgg/897225c63cdde3f62fbd040bdadece23 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -ex
repos='
animate
cascader
checkbox
collapse
dialog
drawer
dropdown
field-form
image
input-number
mentions
menu
motion
notification
pagination
picker
progress
rate
resize-observer
select
slider
steps
switch
table
tabs
textarea
tooltip
tree
tree-select
trigger
upload
util
'
for repo in $repos; do
pkg="rc-$repo"
[ ! -d $pkg ] && git clone [email protected]:react-component/$repo.git $pkg
(
cd $pkg
gh repo fork --remote
git checkout master
git fetch upstream
git reset --hard upstream/master
git b -D react-peer-dependencies || true
git checkout -b react-peer-dependencies
jq '.peerDependencies += {
react: .devDependencies.react,
"react-dom": .devDependencies."react-dom"
}' package.json > package.json-new
mv package.json-new package.json
git --no-pager diff
git commit -a \
-m 'Add react and react-dom as peer dependencies' \
-m 'Fixes errors using Yarn 2 (berry).' \
-m 'See https://github.com/ant-design/ant-design/issues/27339 for details.'
git push -f origin react-peer-dependencies
gh pr create --fill --base master
)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment