# react-release-manager
This is a tool that is being used to manage React releases.
## Prerequisites
You should have an existing clone of the React repo. We will call this a **“working copy”**. Ideally this is where you are most comfortable working on React.
Your working copy of React **should be up to date**. Check out the `master` branch in it and run `git pull` just to be sure.
## Cloning the Release Manager
**If this is your first time using the Release Manager**, you need to set it up.
Skip this section if you’ve done this before.
The Release Manager is also located inside the React repository so you need to **clone it to a separate folder**. Call it something other than `react` so that you don’t confuse it with the working copy.
Check it out, install the dependencies, and run the CLI:
```
cd ~/projects # or wherever
git clone https://github.com/facebook/react.git react-release-manager
cd react-release-manager/scripts/release-manager
yarn
./cli.js
```
You will see a command-line interface that lets you enter commands.
It will need to learn a few things to work on your machine.
Type `init` and press Enter. It will ask you a few prompts:
1. `GitHub token? (needs "repo" privs)`
Follow [these instructions](https://help.github.com/articles/creating-an-access-token-for-command-line-use/) to generate a GitHub token. Make sure to put a checkmark for `repo` privileges. Don’t share it with anyone!
2. `Location of local React checkout?`
Enter the local path to your React working copy. For example, it is `~/projects/react` on my machine.
Now you should be all set for releasing React on this machine!
## Before You Do Anything Else
You should have two separate React checkouts by now:
* **The Release Manager copy.** The previous section described how to set it up. You will only use this checkout for *running* the Release Manager. Run `git checkout master` and `git pull` to ensure it is up-to-date.
* **Your working copy of React.** The Release Manager will operate on it, and you will fix any merge conflicts inside of it. This should be the folder path you specified when you ran `init` in the previous section. Run `git checkout master` and `git pull` to ensure it is up-to-date.
Both clones clean and up-to-date?
If you aren’t already running it, run the Release Manager CLI:
```
cd react-release-manager/scripts/release-manager
./cli.js
```
Keep your working copy and the running Release Manager in separate terminal tabs.
## Updating the Documentation
When we merge a pull request to the documentation and it is relevant to the current version, we tag it with a `Documentation: needs merge to stable` label. The Release Manager can cherry-pick those commits so that they appear on the website.
The documentation is built from the current stable branch. For example, for React 15.x the branch is called `15-stable`. Switch your working copy to it:
```
cd react
git checkout 15-stable
git pull
```
Then, in the Release Manager, run the command:
```
docs-prs
```
The Release Manager should find the PRs that haven’t been merged yet. Reply with `y` to get them merged and then with `y` to push your changes.
**Tip:** If you see an error like `The previous cherry-pick is now empty, possibly due to conflict resolution` it might mean that there’s a stray PR with a label that has already been merged to the stable branch. In this case you need to remove the label manually and retry the command.
## Cutting a Release
### Verifying Permissions
In the Release Manager, verify you have npm publish permissions:
```
npm-check-access
```
You will need to get all permissions before you can proceed.
### Cherry Picking PRs
If the permissions are cool, run:
```
start-release
```
**Tip:** if you get an error saying `'upstream' does not appear to be a git repository`, run `git remote add upstream https://github.com/facebook/react.git` in your working copy of React and try again.
If everything went well, you should see a green `OK!` in the output.
Create a new milestone in the [GitHub web interface](https://github.com/facebook/react/milestones) for the new release. Name it exactly after the version you intend to cut (e.g. `15.4.1`). Then run:
```
stable-prs
```
First, choose the current major “stable” milestone (such as `15-next`). Note that the Release Manager only sees merged PRs that have this milestone.
**Tip:** our 15.x branch has diverged significantly so we are using `15-hipri` for things we really need to get out, and `15-lopri` for everything else. This is a temporary situation that should get better after Fiber is out.
Next, choose the milestone you just created. This one should be specific and correspond to the version you intend to publish (such as `15.4.1`). The Release Manager will re-tag all PRs matching the previous “stable” milestone with this specific milestone after cherry-picking them.
Finally, pick all appropriate labels with a spacebar. For example, a patch release usually contains `exempt` and `patch` PRs, and a minor release contains `minor` PRs in addition to them.
Now the Release Manager will find all relevant PRs and attempt to cherry-pick them. Before agreeing to this, copy the list of PRs it prints out so that you can look them up later when you write the changelog.
It is likely that some PRs won’t get merged cleanly. You’ll need to manually resolve the conflicts in the working copy. If the resolutions are not obvious it might be a sign the branches diverged too much which might be bad. (Talk to the team.)
### Verifying the Changes
Your working copy should now be in a clean state on a development branch. For example, during 15.x the development branch is `15-dev`.
Verify it by running:
```
git status
>On branch 15-dev
>Your branch is ahead of 'origin/15-dev' by 10 commits.
> (use "git push" to publish your local commits)
>nothing to commit, working directory clean
```
Next, run `npm test`.
If there are any issues you might have introduced mistakes resolving conflicts.
You can fix them in a separate commit.
**Tip:** tests might also be failing if dependency versions are incorrect. You might want to run `yarn` first since sometimes `package.json` on master is different from the stable branches.
### Update the Error Codes
**This step is only necessary for a stable release.**
If you’re just cutting an alpha, you should skip it.
Run this so that `scripts/error-codes/codes.json` is up to date:
```
npm run build -- --extract-errors
```
Check `git diff`. Do changes, if any, look sensible?
If there are any changes, commit them:
```
git commit -am 'Update error codes'
```
You will see the commit hash. Copy it in your editor. You will need it later to cherry-pick the error codes update to master.
If there were no changes, it’s also fine.
### Push and Choose the Branch
If you followed the guide correctly (and ran `start-release` in the beginning), you should be on a “stable development” branch such as `15-dev`. Now is a good time to push the development branch:
```
git push
```
Then comes the important part.
**If you plan to cut a stable release, switch the branch to the stable branch now.**
For example, if you plan to cut `15.4.1` (rather than a `15.4.1-0` alpha release), run:
```
git checkout 15-stable
git merge --no-ff 15-dev
```
This will merge the commits you cherry-picked into the stable branch.
However, if you plan to cut an alpha or a beta, you should stay on the “stable development” branch.
### Update the Lockfile
Run this so that the build is reproducible:
```
rm yarn.lock
rm -rf node_modules
yarn cache clean
yarn
```
Check `git diff`. Do changes look sensible?
Commit your changes:
```
git commit -am 'Update Yarn lockfile'
```
If you’re feeling extra careful, you can run `npm test` again.
### Write the Changelog
**This step is only necessary for a stable release.**
If you’re just cutting an alpha, you should sk
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
react-16.0.0-beta.4.zip (1213个子文件)
AUTHORS 25KB
authors 284B
.babelrc 922B
ReactCoffeeScriptClass-test.coffee 12KB
hardware-counter.cpp 13KB
jsc-perf.cpp 5KB
thread-local.cpp 2KB
perf-counters.cpp 2KB
codemirror.css 8KB
syntax.css 4KB
style.css 3KB
main.css 3KB
style.css 918B
index.css 189B
Chrome.css 66B
Page.css 31B
.editorconfig 293B
.env 30B
.eslintignore 458B
.eslintrc 113B
.flowconfig 1KB
Gemfile 465B
steve_reverse.gif 5.4MB
cra-runtime-error.gif 1.74MB
cra-dynamic-import.gif 1.66MB
cra-update-exports.gif 1.36MB
devtools-full.gif 1.35MB
modus-create.gif 992KB
devtools-search.gif 929KB
cra-jest-search.gif 907KB
gpu-cursor-move.gif 790KB
react-devtools-state.gif 567KB
monkeys.gif 532KB
granular-dom-updates.gif 124KB
devtools-side-pane.gif 43KB
grayarrow.gif 111B
.gitattributes 12B
.gitignore 454B
.gitignore 240B
.gitignore 175B
.gitignore 31B
.gitignore 23B
.gitignore 23B
.gitignore 10B
.gitignore 10B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
.gitignore 9B
binding.gyp 259B
thread-local.h 19KB
portability.h 5KB
hardware-counter.h 3KB
index.html 6KB
default.html 4KB
index.html 3KB
footer.html 2KB
index.html 1KB
navigation.html 1KB
index.html 1KB
nav_docs.html 1KB
index.html 943B
index.html 943B
index.html 943B
community.html 744B
tutorial.html 744B
index.html 729B
docs.html 720B
prod.html 699B
dev.html 693B
blog_post.html 656B
nav_community.html 645B
nav_tutorial.html 641B
single.html 605B
contributing.html 592B
prod.html 576B
dev.html 570B
single-file-example.html 543B
all.html 530B
dev.html 433B
hero.html 403B
index.html 401B
index.html 385B
nav_blog.html 381B
prod.html 373B
dev.html 367B
redirect.html 324B
index.html 283B
post.html 243B
index.html 175B
index.html 175B
hero.html 149B
index.html 146B
index.html 146B
index.html 102B
共 1213 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
资源评论
a3737337
- 粉丝: 0
- 资源: 2869
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功