Skip to content

Latest commit

 

History

History
118 lines (70 loc) · 5.04 KB

CONTRIBUTING.md

File metadata and controls

118 lines (70 loc) · 5.04 KB

Contributing to Plete

There are several ways of contributing to Plete

Contributor Code of Conduct

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.

Reporting an issue

To save everyone time and make it much more likely for your issue to be understood, worked on and resolved quickly, it would help if you're mindful of How to Report Bugs Effectively when pressing the "Submit new issue" button.

As a minimum, please report the following:

  • Which environment are you using?
    • Browser
    • OS
  • Which version of Plete?
  • How are you loading Plete?
  • What other libraries are you using?
  • What you expected to happen
  • What actually happens
  • Describe with code how to reproduce the fault

See our issue templates for all details.

Contributing to the code base

Pick an issue to fix, or pitch new features. To avoid wasting your time, please ask for feedback on feature suggestions with an issue.

Make sure you have read GitHub's guide on forking. It explains the general contribution process and key concepts.

Making a pull request

Please try to write great commit messages.

There are numerous benefits to great commit messages

  • They allow Plete users to understand the consequences of updating to a newer version
  • They help contributors understand what is going on with the codebase, allowing features and fixes to be developed faster
  • They save maintainers time when compiling the changelog for a new release

If you're already a few commits in by the time you read this, you can still change your commit messages.

Also, before making your pull request, consider if your commits make sense on their own (and potentially should be multiple pull requests) or if they can be squashed down to one commit (with a great message). There are no hard and fast rules about this, but being mindful of your readers greatly help you author good commits.

Use EditorConfig

To save everyone some time, please use EditorConfig, so your editor helps make sure we all use the same encoding, indentation, line endings, etc.

Installation

The Plete developer environment requires Node/NPM & Git . Please make sure you have Node installed, and install the project dependencies:

$ npm install

This will also install a pre-commit hook, that runs style validation on staged files.

Linting and style

Plete uses ESLint to keep the codebase free of lint, and uses Prettier to keep consistent style.

If you are contributing to the Plete project, you'll probably want to configure your editors (ESLint, Prettier) to make editing code a more enjoyable experience.

The ESLint verification (which includes Prettier) will be run before unit tests in the CI environment. The build will fail if the source code does not pass the style check.

You can run the linter locally:

$ npm run lint

You can fix a lot lint and style violations automatically:

$ npm run lint -- --fix

To ensure consistent reporting of lint warnings, you should use the same versions of ESLint and Prettier as defined in package.json (which is what the CI servers use).

Run the tests

The command below runs tests

$ npm test

Code Coverage

This repository requires 100%, line, branch and function coverage. For more information about code coverage please see Wikipedia - Code Coverage.

Running the command to run all tests with coverage checking, produces a coverage report in both lcov and html formats; as well as providing verbose command line output.

The command below runs tests with coverage

$ npm run test-check-coverage

Compiling a built version of the library

Build requires Node.

To build run

$ node run build