HospitalRun is a community project. We invite your participation through financial contributions, issues, and pull requests!
Contributions are always welcome. Before contributing please read the code of conduct and
search the issue tracker; your issue
may have already been discussed or fixed in master
. If you're new to the project,
maybe you'd like to open a pull request to address one of good-first-issue.
To contribute, fork HospitalRun components, commit your changes, and send a Pull Request.
Contribute to HospitalRun using a fully featured online development environment that will automatically: clone the repo, install the dependencies and start the webserver.
In order to optimize the workflow and to prevent multiple contributors working on the same issue without interactions, a contributor must ask to be assigned to an issue by one of the core team members: it's enough to ask it inside the specific issue.
- Fork this repository to your own GitHub account and then clone it to your local device
- Navigate to the cloned folder:
cd components
- Install the dependencies:
npm install
- Run
npm run dev
to build and watch for code changes - In another window, run storybook
npm run storybook
. Story book should open in a your default browser at localhost:6006. - You will be able to test components with storybook and enjoy live reloading!
- Create a new folder under
src/components
with the name of your component (i.e. Spinner, Graphs) - Create an
index.tsx
file. This file will be responsible for exporting all of the components. - Create a interfaces.ts file. This will define and export all non-props interfaces needed for the component.
- Create a file named
ComponentName.tsx
whereComponentName
is the name of the component being created (i.e.Spinner.tsx
). This file will be responsible for declaring the component logic and creating the Props interface. The Props interface should be namedProps
. All props should have a comment associated with them describing what they are used for. The component class should be documented with a description of what it is. - Create a
strings.ts
file (if needed). This file should declare and export all string constants. - Create a new file in
src/test
calledcomponentname.test.tsx
wherecomponentname
is the name of the component. The tests should cover all use cases of the component. - Create a new file called
componentname.stories.tsx
wherecomponentname
is the name of the component. The stories should cover all use cases of the component.
This repo uses Conventional Commits. Commitizen is recommended for development. Once you have changes staged
you can run git cz
from the root directory in order to commit to the proper standards.
Alternatively, if you are using NPM 5.2+ you can use npx instead of installing globally:
npx git-cz
Feature requests should be submitted in the issue tracker, with a description of the expected behavior & use case, where they’ll remain closed until sufficient interest, e.g. 👍 reactions, has been shown by the community. Before submitting a request, please search for similar ones in the closed issues.
HospitalRun is a member of the Open JS Foundation. As such, we request that all contributors sign our contributor license agreement (CLA).
For more information about CLAs, please check out Alex Russell’s excellent post, “Why Do I Need to Sign This?”.