Skip to content

Commit

Permalink
docs: update contribution guide for new v4 build
Browse files Browse the repository at this point in the history
  • Loading branch information
wa0x6e committed Jan 2, 2023
1 parent f0b4b80 commit 463e391
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,36 @@
# Contributing to Cal-Heatmap

## Editing source file
## About the code

All edition should be done on `src/cal-heatmap.js`.
* The source code is located in the `src` folder
* All tests are locacted in the `test` folder
* Code is written in Typescript

**DO NOT** edit javascripts file located in the root, as they're built via grunt.
## Getting started

## Building final javascripts
Clone/Download the repository, then run `npm install`
to insure you have all the required dev dependencies.

## Code formatting

Cal-Heatmap uses `grunt` to build final javascripts and stylesheets.
* Code is formatted with ESLint/Prettier. See `.eslintrc.json` and `prettierrc`

Install grunt via
You can also trigger:
* the lint with `npm run lint`
* an auto-formatting with `npm run format`

npm install -g grunt-cli
Ensure your code is formatted correctly before opening a pull request

then run
## Building bundle

grunt build
As a developer, you should use `npm run dev` while developing,
as it produces a slimer and faster bundle.

## Tests

Cal-Heatmap is tested with [Qunit](https://qunitjs.com/).

Tests files are located in the `test` directory, and can be run by opening the `index.html` file.
The code is built with Rollup, with `npm run build`. This command is run
from the CI when releasing a new tag, as the bundle are not versioned.

If you want to add or edit existing tests, **do not** edit the `test/test.js` file. Instead, add them in `test/src`, under the corresponding module. Take a look at existing tests for reference.

You can then run `grunt build` to generate the final `test/test.js` file.
## Tests

## Submitting changes
Cal-Heatmap is tested with Jest.

Submit your pull requests with only files located in `src` folders. Do not commit files generated by grunt (.js located in the root and `test/test.js`).
Tests are run with `npm run test`

0 comments on commit 463e391

Please sign in to comment.