First off, Contributions are always welcome and we appreciate any help you can offer. Please take a moment to read the entire contributors guide.
Below are some general guidelines we try to stick to on all of our FHIR related repositories. When contributing to @bluehalo/node-fhir-server-core
, we do ask that you do your best to follow these guidelines.
We do our best to keep master
in a stable state. We also started cutting release branches, for example, release/1.4.0
, to make it easier to contribute to specific versions and maintain older versions. When you submit pull requests, please make sure to fork from and submit back to master
.
We try to follow semantic versioning for this repo as close as we can. If we ever publish breaking changes, there will be something in the release notes. There have been occasionally breaking changes in the past on minor updates, which is something we will not be doing going forwards.
We use conventional commits which helps keep commit messages clean and useful. It also is helpful because we use the changelog cli generator (yarn changelog
) to automatically generate changelogs when cutting new releases.
In an attempt to never have a debate about style or tabs versus spaces in a PR, we use prettier, an opinionated code formatter. We ask everyone to run this before submitting a pull request and have some general configurations defined in our package.json.
Getting setup is easy, however, this project does require that you have Node.js and preferably yarn installed. You can install the latest LTS for Node.js here.
- Fork this repo to your GitHub account and clone it.
- Run
yarn install
.
After cloning and installing all the dependencies, there are several commands we can use for local development.
yarn lint
- Lints everything in src directoryyarn jest
- Runs jest over all tests in src directoryyarn test
- Runs yarn lint and yarn jest togetheryarn nodemon
- Starts a development server with live reload, available onlocalhost:3000
unless you specify your own PORT.
yarn start
- Runs a production version. No live reload and NODE_ENV is defaulted toproduction
.
You can test the server in https mode if you provide certs. For local testing, you can easily generate self-signed certs. To generate self-signed certs, run the following commands:
openssl genrsa -out key.pem 2048
openssl req -new -sha256 -key key.pem -out client-csr.pem
openssl x509 -req -in client-csr.pem -signkey key.pem -out cert.pem
Then populate the HTTPS_KEY_PATH
and HTTPS_CERT_PATH
environment variables before starting the server.
When submitting a pull request, please make sure you have completed the following otherwise the pull request will not be accepted.
- Run
yarn prettier
. yarn test
passes. This is integrated in our CI so if this fails the PR will be automatically blocked until tests pass.- If documentation needs to be added, include a snippet of what should be added and where.
- If new code is being introduced or a bug is being fixed, add relevant test cases.
- Pull request base branch is set to
master
. All pull requests should be forked from and merged back tomaster
.
When cutting a release, the following steps need to be performed.
package.json
needs to have a version update based on the content being released, remember semver.- Changelogs should be generated with
yarn changelog
. - Create a release branch with the convention
release/x.x.x
. - Create a tag for the version; naming convention is just the version, so x.x.x.
- Push the tag to github.
- Publish to npm.
- Draft a release in the release tab with release notes. You can copy these from the changelog, but feel free to add any additional information if necessary or if it is missing from the changelogs. Follow previous releases if you are unsure on the format.
For more information about how things are designed and how they work, please consult our wiki.
Please file your issues here and try to provide as much information in the template as possible/relevant.