chore(readme): Added contributing guide and empyrical link (#146)

Added a Contributing.md file and moved contributor notes there. Also added @empyrical. 🎉
This commit is contained in:
Jamon Holmgren 2018-11-19 02:32:22 -08:00 committed by Thibault Malbranche
parent 8064f66e03
commit 692961bfca
2 changed files with 56 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class MyWebComponent extends Component {
}
```
For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide.md).
For more, read the [API Reference](./docs/Reference.md) and [Guide](./docs/Guide.md). If you're interested in contributing, check out the [Contributing Guide](./docs/Contributing.md).
## Migrate from React Native core WebView to React Native WebView
@ -71,6 +71,7 @@ Simply install React Native WebView and then use it in place of the core WebView
- [Jamon Holmgren](https://github.com/jamonholmgren) ([Twitter @jamonholmgren](https://twitter.com/jamonholmgren)) from [Infinite Red](https://infinite.red/react-native)
- [Thibault Malbranche](https://github.com/Titozzz) ([Twitter @titozzz](https://twitter.com/titozzz)) from [Brigad](https://brigad.co/about)
- [Empyrical](https://github.com/empyrical) ([Twitter @empyrical](https://twitter.com/empyrical))
## License

54
docs/Contributing.md Normal file
View File

@ -0,0 +1,54 @@
# Contributing to React Native WebView
First off, _thank you_ for considering contributing to the React Native Community. The community-supported packages are only possible because of amazing people like you.
Secondly, we'd like the contribution experience to be as good as possible. While we are a small all-volunteer team, we are happy to hear feedback about your experience, and if we can make the docs or experience better please let us know.
## How to test changes
After you fork the repo, clone it to your machine, and make your changes, you'll want to test them in an app.
In a new `react-native init` project, do this:
```
$ yarn add ../react-native-webview
$ react-native link react-native-webview
```
You may run into a problem where the `jest-haste-map` module map says react-native was added twice:
```
Loading dependency graph...(node:32651) UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision:
Duplicate module name: react-native
Paths: /Users/myuser/TestApp/node_modules/react-native/package.json collides with /Users/myuser/TestApp/node_modules/react-native-webview/node_modules/react-native/package.json
```
Just remove the second path like this:
```
$ rm -rf ./node_modules/react-native-webview/node_modules/react-native
```
And then re-run the packager:
```
$ react-native start --reset-cache
```
When you make a change, you'll probably need to unlink, remove, re-add, and re-link `react-native-webview`:
```
$ react-native unlink react-native-webview && yarn remove react-native-webview
$ yarn add ../react-native-webview && react-native link react-native-webview
```
## Notes
- We use Flow types. TypeScript types will probably be added at a later date.
- We don't intend to support UIWebView and will remove it soon.
- After pulling this repo and installing all dependencies, you can run flow on iOS and Android-specific files using the commands:
- `yarn test:ios:flow` for iOS
- `yarn test:android:flow` for Android
- If you want to add another React Native platform to this repository, you will need to create another `.flowconfig` for it. If your platform is `example`, copy the main flowconfig and rename it to `.flowconfig.example`. Then edit the config to ignore other platforms, and add `.*/*[.]example.js` to the ignore lists of the other platforms. Then add an entry to `package.json` like this:
- `"test:example:flow": "flow check --flowconfig-name .flowconfig.example"`
- Currently you need to install React Native 0.57 to be able to test these types - `flow check` will not pass against 0.56.