If you're reading this, thank you for helping improve this package! Here are a few guidelines that will help you along the way.
Please keep your pull requests small. To give a PR the best chance of getting accepted, don't bundle more than one feature or bug fix per pull request. It's always best to create two smaller PRs than one big one.
When adding new features or modifying existing, please attempt to include tests to confirm the new behaviour. You can read more about our test setup below.
At any given time, master
represents the latest production version of the library.
We will only accept a pull request for which all tests pass. Make sure the following is true:
- The branch is not behind master.
- If a feature is being added:
- If the result was already achievable with the core library, explain why this feature needs to be added to the core.
- It includes relevant tests.
- If this is a common use case, considered adding an example to the documentation.
- If a bug is being fixed, test cases that fail without the fix are included.
- The code is formatted and linted.
- The PR title follows the pattern
Imperative commit message
. (See: How to Write a Git Commit Message for a great explanation)
Please create a new branch from an up to date master on your fork.
- Fork this repository on Github
- Clone your fork to your local machine
git clone [email protected]:<yourname>/[package-name].git
- Create a branch
git checkout -b my-topic-branch
- Install dependencies
- Make your changes, build, test, then push to to GitHub with
git push --set-upstream origin my-topic-branch
. - Visit GitHub and make your pull request.
If you have an existing local repository, please update it before you start, to minimise the chance of merge conflicts.
git remote add upstream [email protected]:<yourname>/[package-name].git
git checkout master
git pull upstream master
git checkout -b my-topic-branch
npm i
npm run test
npm build
Sometimes it is good to test your changes in a real world scenario, in order to do that you can install your local distribution of this package in any project with npm link.
First, you have to build your local distribution of this package:
# From the root folder of the project
npm run build
Note: You can run the task npm run build:watch
instead of npm run build
if you want the process to continue running as you modify the codebase.
Then, you create a link to your local distribution:
# From the root folder of the project
npm link
Next, you link your local distribution of this package to any project you want to try your changes:
# From the root folder of any project
npm link <package-name>
Now, every time you import package-name
in your project, it is going to use your local distribution.
Please follow the coding style of the project. This package uses eslint and prettier, so if possible, enable linting in your editor to get real-time feedback.
To get a sense of where this package is heading, or for ideas on where you could contribute, take a look at the ROADMAP.
By contributing your code to this GitHub repository, you agree to license your contribution under the MIT license.