react-native-navigation的迁移库

meta-contributing.mdx 7.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. ---
  2. id: meta-contributing
  3. title: Contributing
  4. sidebar_label: Contributing
  5. ---
  6. Thank you for showing interest in contributing to React-Native-Navigation! This project is developed and maintained by Wix in collaboration with the community.
  7. There are various ways in which you can contribute to this library, not all require knowledge or expertise in native development. Listed below is all you need to get started with your first contribution.
  8. ## Stack Overflow
  9. Stack Overflow is used by developers to find answers and troubleshoot code. Users are encouraged to post questions on SO and tag them with the [wix-react-native-navigation](https://stackoverflow.com/questions/tagged/wix-react-native-navigation) tag. Answering issues on SO is very helpful and beneficial to the community, only this time, there's a personal angle - you can boost your SO ranking and rack up points quickly.
  10. ## Discord
  11. Another popular communication channel is our [Discord channel](https://discord.gg/DhkZjq2) where users post questions and consult with each other. You're welcome to join the discussions and answer questions. This is also a great place to meet other community members and project maintainers.
  12. ## GitHub Issues
  13. ### Open an issue
  14. Found a bug? Missing a feature? Go ahead and open an issue! Make sure to add all details mentioned in the issue template. If you're interested in suggesting a big change, please speak to one of the admins on [Discord](#discord) to coordinate your effort.
  15. ### Respond to issues
  16. Although the issue tracker is used solely for bug reports, issues are frequently opened for questions or to request assistance. As the project grows in popularity, more issues remain unanswered for long periods of time.
  17. Some issues can be trivial and easy to pinpoint - a missing import statement or apostrophe, wrong layout structure, etc. If you're an experienced user, helping out newcomers can be quite satisfying and allows maintainers to focus on features and bug fixes.
  18. Some issues are tagged as ["looking for contributors"](https://github.com/wix/react-native-navigation/labels/user%3A%20looking%20for%20contributors). These issues have been recognized by the team, but aren't prioritized by Wix developers due to lack of time or for some other reason. We leave these issues to our community and you're more than welcome to take a crack at them. If you'd like to submit a PR, see [these instructions](#running-the-project) on how to run the project locally.
  19. ### Provide reproductions
  20. Reproducing bugs takes time. Lots of time. Usually that's because an issue is lacking important information, which then causes lots of back and forth communication between maintainers and users. Help us address more bugs and issues by providing reproductions.
  21. Providing reproductions improves the chances of an issue being prioritized by maintainers!
  22. If an issue is reproduced with a specific combination of options, posting these options will usually suffice. If a specific layout structure is involved or specific actions need to be performed in a certain order - then we ask that you fork the project and push a branch with a reproduction to the Playground app.
  23. Check out the [list of issues requiring reproductions](https://github.com/wix/react-native-navigation/labels/user%3A%20requires%20reproduction).
  24. ## Submitting PRs
  25. So you've fixed a bug or added a feature and you're ready to submit a pull request 🎉🎊 Make sure the title is clear and describes the reason for the PR. Please include any information you can which will help us understand the reasons for the PR, what it fixes and what it changes. Please include before/after pictures/gifs when appropriate.
  26. ## Workflow
  27. This project is driven by tests. Before implementing any feature or fixing any bug, a failing test (e2e or unit or both) should be added, depending on the environment of where the fix should be implemented. For example, for an API change, a failing e2e should be written. For a small bug fix in Android, for example, a unit test in Android should be added.
  28. This will ensure good quality throughout the life of the project and will help avoid unexpected breakages.
  29. No PR will be accepted without adequate test coverage.
  30. If you need help running the project, have a look at the [Playground app](playground-app) section. You can run the tests using the scripts below.
  31. ### Tests and the Playground app
  32. Besides an overview of basic React Native Navigation functionality, the [Playground app](playground-app) can (and rather should) be used for e2e tests and reproductions. If your change requires an e2e, add it to the playground app, to the appropriate screen. Again, quick setup instructions available in [Playground app](playground-app) section of these docs.
  33. :::tip
  34. If a screen contains too many buttons, e2e tests might fail if the button is positioned out of screen bounds because Detox matchers detect it's invisible.
  35. :::
  36. ### Playground app Folder Structure
  37. | Folder | Description |
  38. | ------ | ----------- |
  39. | `lib` | The project itself composed of: |
  40. | `lib/android` | android sources and unit tests |
  41. | `lib/ios` | iOS sources and unit tests |
  42. | `lib/src` | TypeScript sources and unit tests |
  43. | `lib/dist` | compiled javascript sources and unit tests |
  44. | `lib/dist/index.js` | the entry point for `import Navigation from 'react-native-navigation'` |
  45. | `e2e` | [detox](https://github.com/wix/detox) e2e tests on both Android and iOS |
  46. | `playground` | The end-user project all e2e tests run against. Contains its own `src`, `android` and `ios`. Does not have its own package.json, depends on the local `<root>/lib` for faster local development (no need to `npm install` locally). |
  47. | `integration` | misc javascript integration tests, proving integration with other libraries like redux |
  48. | `scripts` | all scripts |
  49. ### Scripts
  50. | Command | Description |
  51. | ------- | ----------- |
  52. | `npm install` | installs dependencies |
  53. | `npm run build` | compiles TypeScript sources `./lib/src` into javascript `./lib/dist` |
  54. | `npm run clean` | cleans all build directories, stops packager, fixes flakiness by removing watchman cache, etc. |
  55. | `npm run start` | starts the react-native packager for local debugging |
  56. | `npm run xcode` | for convenience, opens xcode in this project |
  57. | `npm run install-android` | builds playground debug/release version and installs on running android devices/emulators. <br></br> **Options:** `-- --release` |
  58. | `npm run uninstall-android` | uninstalls playground from running android devices/simulators |
  59. | `npm run test-js` | runs javascript tests and coverage report |
  60. | `npm run test-unit-ios` | runs ios unit tests in debug/release <br></br> **Options:** `-- --release` |
  61. | `npm run test-unit-android` | runs android unit tests in debug/release <br></br> **Options:** `-- --release` |
  62. | `npm run test-e2e-ios` | runs the ios e2e tests using [detox](https://github.com/wix/detox) in debug/release <br></br> **Options:** `-- --release`|
  63. | `npm run test-e2e-android` | runs the android e2e tests using [detox](https://github.com/wix/detox) in debug/release <br></br> **Options:** `-- --release` |
  64. | `npm run test-all` | runs all tests in parallel |