Skip to content

Latest commit

 

History

History
88 lines (54 loc) · 3.97 KB

CONTRIBUTING.md

File metadata and controls

88 lines (54 loc) · 3.97 KB

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Fork the repo, then clone your fork to your machine and run npm install

Format with npm run format

Lint with npm run lint

Run the demos with npm start. Then open your browser to http://localhost:9966

Note that changes to test files (demo HTML and JS) are hot-reloaded, but changes to the source are not. It would be great if source changes were also hot-reloaded. If you know how to fix that, please do!

Testing

Test with npm test (checks formatting, checks lint, runs both unit and E2E tests).
To troubleshoot headless E2E test failures, recording can be found at cypress/videos/*.mp4.
Note: By default chrome is the browser on which headless E2E test are running

Unit test (only) with npm run test:unit

E2E test can alo be run in interactive mode on Cypress UI which is easier for development and troubleshooting with npm run test:cypress

API Changes

If you added/removed options in the API, please remember to update the docs in the README as well as the typings.

Changeset

Before posting your PR, please add a changeset by running npx changeset and following the prompts. This will help us quickly make a release with your enhancements.

If your changes don't affect the source or typings, then a changeset is not needed (and you can ignore the bot's automated comment on your PR about not finding one as part of your changes).

Anything Helps

We want to recognize all contributions. To that end, we use the All Contributors Bot to automate adding all types of contributions to our README.

You can also use the All Contributors CLI instead of the bot: npm run all-contributors add <USERNAME> <KEY>[,<KEY>...] (where KEY is an emoji key contribution term). Then run npm run all-contributors generate to update the README.

Please feel free to use the bot on your own issue or PR to add yourself as a contributor (or use the CLI), or remind one of the maintainers to do so.

✨ No contribution is too small not to be included. We appreciate your help!

Updating the demo

This would mean making a PR into the gh-pages branch. Keep in mind that the code may be much older than master.

For a maintainer to update the demo, however, these steps can be followed:

$ git push -f origin HEAD:gh-pages # push all the latest to the branch
$ git checkout gh-pages
$ git pull # pull all the latest you just pushed

# ❗️ remove the exclusion for the ./demo/demo-bundle.js file
#  in ./.gitignore

$ npm run demo-bundle # this will generate ./demo/demo-bundle.js

$ git add .
$ git commit -m "Updating demo to latest"
$ git push

Manual publishing

Lately, the ./.github/workflows/release.yml workflow has been causing issues with tests failing (while the very same tests succeed in the CI workflow and locally). This will block a release in one of two ways:

  1. The repo won't get versioned (because the release workflow will fail on the versioning task).
  2. The changes won't get published to NPM (if you get passed (1), the publishing task may fail).

When re-running the failed release job on GitHub just won't work (sometimes it takes ~4 tires before it finally goes through, but beyond that...), here are the equivalent local commands using the changesets CLI:

## versioning
$ npx changeset version
$ npm install # manual update of lock file version that Changesets no longer does [1]
$ git push # to master

## publishing
$ npm test
$ npm build
$ npx changeset publish # you'll need publish permission to do this, will prompt for OTP
$ git push --tags

[1] changesets/changesets#421