2018-01-29 15:01:58 +01:00
|
|
|
# Contributing
|
|
|
|
|
|
2019-09-06 04:27:01 +02:00
|
|
|
## How can I help?
|
2018-01-30 15:05:15 +01:00
|
|
|
|
2019-09-06 04:27:01 +02:00
|
|
|
Fork the repository, make your change and submit a pull request. If you would
|
|
|
|
|
like to discuss the changes you intend to make to clarify where or how they
|
|
|
|
|
should be implemented, please don't hesitate to create a new issue. At a
|
|
|
|
|
minimum, you may want to read the following documentation:
|
2018-01-30 15:05:15 +01:00
|
|
|
|
2019-09-06 04:27:01 +02:00
|
|
|
- [Essentials: Getting Started](./essentials/getting-started.md)
|
|
|
|
|
- [Advanced: Architecture](./advanced/architecture.md)
|
2019-05-10 21:20:15 +02:00
|
|
|
|
2019-05-20 17:10:30 +02:00
|
|
|
### When changes impact multiple repositories
|
|
|
|
|
|
2019-09-06 04:27:01 +02:00
|
|
|
While this can be tricky, we've tried to reduce how often this situation crops
|
|
|
|
|
up this with our [recent switch to a monorepo][monorepo]. Our maintained
|
|
|
|
|
extensions, ui components, internationalization library, and business logic can
|
|
|
|
|
all be developed by simply running `yarn run dev` from the repository root.
|
2019-05-20 17:10:30 +02:00
|
|
|
|
2019-09-06 04:27:01 +02:00
|
|
|
Testing the viewer with locally developed, unpublished package changes from a
|
|
|
|
|
package outside of the monorepo is most common with extension development. Let's
|
|
|
|
|
demonstrate how to accomplish this with two commonly forked extension
|
|
|
|
|
dependencies:
|
|
|
|
|
|
|
|
|
|
#### `cornerstone-tools`
|
|
|
|
|
|
|
|
|
|
On your local file system:
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# code/my-projects/
|
|
|
|
|
.
|
|
|
|
|
├── cornerstonejs/cornerstone-tools
|
|
|
|
|
└── ohif/viewers
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
- Open a terminal/shell
|
|
|
|
|
- Navigate to `cornerstonejs/cornerstone-tools`
|
|
|
|
|
- `npm install`
|
|
|
|
|
- [`yarn link`](https://yarnpkg.com/en/docs/cli/link)
|
|
|
|
|
- `npm run dev`
|
|
|
|
|
- Navigate to `ohif/viewers`.
|
|
|
|
|
- `yarn install`
|
|
|
|
|
- [`yarn link cornerstone-tools`](https://yarnpkg.com/en/docs/cli/link)
|
|
|
|
|
- `yarn run dev`
|
2019-05-20 17:10:30 +02:00
|
|
|
|
|
|
|
|
For example if you are working on `ohif-core` and would like to use your local
|
|
|
|
|
version to debug a problem in `Viewers`, simply run yarn link inside of the
|
|
|
|
|
`ohif-core` project.
|
|
|
|
|
|
|
|
|
|
- If you're experiencing issues with `yarn link`,
|
|
|
|
|
[try `yalc`](https://github.com/whitecolor/yalc)
|
|
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
## Any guidance on submitting changes?
|
2018-01-30 15:05:15 +01:00
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
While we do appreciate code contributions, triaging and integrating contributed
|
|
|
|
|
code changes can be very time consuming. Please consider the following tips when
|
|
|
|
|
working on your pull requests:
|
2018-01-30 15:05:15 +01:00
|
|
|
|
2019-05-13 19:47:42 +02:00
|
|
|
- Functionality is appropriate for the repository. Consider creating a GitHub
|
|
|
|
|
issue to discuss your suggested changes.
|
2019-04-28 19:44:07 +02:00
|
|
|
- The scope of the pull request is not too large. Please consider separate pull
|
|
|
|
|
requests for each feature as big pull requests are very time consuming to
|
|
|
|
|
understand.
|
2018-01-30 15:05:15 +01:00
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
We will provide feedback on your pull requests as soon as possible. Following
|
|
|
|
|
the tips above will help ensure your changes are reviewed.
|
2018-07-23 23:29:22 +02:00
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
## Testing contribution pull requests
|
2018-07-23 23:29:22 +02:00
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
OHIF uses [netlify](netlify.com) so that pull requests are autogenerated and
|
|
|
|
|
available for testing.
|
2018-07-23 23:29:22 +02:00
|
|
|
|
2019-04-28 20:02:41 +02:00
|
|
|
For example, [this url][example-url] allows you to test [pull request 237, the
|
|
|
|
|
request that created this FAQ entry,][pr-237] using data pulled from Amazon S3.
|
2019-04-28 19:44:07 +02:00
|
|
|
|
|
|
|
|
Replacing the number 237 in the link below with your pull request number should
|
|
|
|
|
let you test it as well and you can use this link for discussions on github
|
|
|
|
|
without requiring reviewers to download and build your branch.
|
2018-07-23 23:29:22 +02:00
|
|
|
|
2019-05-10 21:20:15 +02:00
|
|
|
```bash
|
2018-07-24 00:34:37 +02:00
|
|
|
https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
|
|
|
|
```
|
|
|
|
|
|
2019-04-28 19:44:07 +02:00
|
|
|
If you have made a documentation change, a link like this will let you preview
|
|
|
|
|
the gitbook generated by the pull request:
|
|
|
|
|
|
2019-05-10 21:20:15 +02:00
|
|
|
```bash
|
2018-07-24 00:34:37 +02:00
|
|
|
https://deploy-preview-237--ohif.netlify.com/contributing.html
|
2018-07-23 23:29:22 +02:00
|
|
|
```
|
2019-04-28 20:02:41 +02:00
|
|
|
|
|
|
|
|
<!--
|
|
|
|
|
Links
|
|
|
|
|
-->
|
|
|
|
|
|
|
|
|
|
<!-- prettier-ignore-start -->
|
|
|
|
|
[example-url]: https://deploy-preview-237--ohif.netlify.com/viewer/?url=https://s3.eu-central-1.amazonaws.com/ohif-viewer/sampleDICOM.json
|
|
|
|
|
[pr-237]: https://github.com/OHIF/Viewers/pull/237
|
2019-09-06 04:27:01 +02:00
|
|
|
[monorepo]: https://github.com/OHIF/Viewers/issues/768
|
2019-04-28 20:02:41 +02:00
|
|
|
<!-- prettier-ignore-end -->
|