mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-04-29 12:55:21 +08:00
docs: add instructions for forks
This commit is contained in:
33
README.md
33
README.md
@@ -71,6 +71,39 @@ yarn lerna publish
|
||||
|
||||
This will automatically bump the version and publish the packages. It'll also publish the changelogs on GitHub for each package.
|
||||
|
||||
## Installing from a fork on GitHub
|
||||
|
||||
Since we use a monorepo, it's not possible to install a package from the repository URL. If you need to install a forked version from Git, you can use [`gitpkg`](https://github.com/ramasilveyra/gitpkg).
|
||||
|
||||
First install `gitpkg`:
|
||||
|
||||
```sh
|
||||
yarn global add gitpkg
|
||||
```
|
||||
|
||||
Then follow these steps to publish and install a forked package:
|
||||
|
||||
1. Fork this repo to your account and clone the forked repo to your local machine
|
||||
1. Open a Terminal and `cd` to the location of the cloned repo
|
||||
1. Run `yarn` to install any dependencies
|
||||
1. If you want to make any changes, make them and commit
|
||||
1. Now `cd` to the package directory that you want to use (e.g. `cd packages/stack` for `@react-navigation/stack`)
|
||||
1. Run `gitpkg publish` to publish the package to your repo
|
||||
|
||||
After publishing, you should see something like this:
|
||||
|
||||
```sh
|
||||
Package uploaded to git@github.com:<user>/<repo>.git with the name <name>
|
||||
```
|
||||
|
||||
You can now install the dependency in your project:
|
||||
|
||||
```sh
|
||||
yarn add <user>/<repo>.git#<name>
|
||||
```
|
||||
|
||||
Remember to replace `<user>`, `<repo>` and `<name>` with right values.
|
||||
|
||||
<!-- badges -->
|
||||
|
||||
[build-badge]: https://img.shields.io/circleci/project/github/react-navigation/navigation-ex/master.svg?style=flat-square
|
||||
|
||||
Reference in New Issue
Block a user