Contributions to LISN are always welcome!
- Check existing issues, including closed ones.
- Create an issue using one of the pre-defined templates and follow the guidelines of the template.
The documentation is generated from TypeDoc comments in the source code.
- If you can, edit the code (follow guidelines below) and submit a pull request.
- Otherwise, create an issue for it and clearly describe the changes.
The demos are hosted on the website and each one should be available in React version, JavaScript API and HTML API.
- If you can, edit the website code.
- Duplicate an existing demo folder and edit the copy.
- Fork the StackBlitz/CodePen demos and edit those copies.
- Update URLs for the sandboxes.
- Otherwise, just create a sandbox for the demo on StackBlitz/CodePen and create an issue asking for it to be added to the site.
-
Fork the repository
-
Clone the forked repository
git clone [email protected]:your-username/lisn.js.git cd lisn.js
-
Install dependencies
npm install -D
-
Create a new branch
git checkout -b feature-branch-name
-
Make your changes
- Please follow the project's coding style (see below).
- Check for typos.
-
Rebuild
npm run dist
-
Add/update unit tests and or manual tests
- If adding new functionality, write corresponding unit tests and if relevant manual (browser) tests.
- Tests are in packages/lisn.js/tests
-
Run ALL tests
npm run test
-
Rebuild doc if relevant and test
- If you made any changes to the doc, then
npm run doc
- Then open
website/public/docs/index.html
in your browser and check changes
- If you made any changes to the doc, then
-
Commit your changes
- If you made many separate changes, commit each separately.
- Use a descriptive title that summarises all changes.
- Clearly list each change in the commit message. Style similar to CHANGELOG.
- Mention related issue numbers if applicable.
-
Push your changes
git push origin feature-branch-name
- Submit a pull request (PR)
- Clearly list each change in the PR description.
- Mention related issue numbers if applicable
- Understand current code style and follow it.
- Ensure your editor is configured to use the ESLint configuration for the repository and automatically lint and fix on save (or you do it manually)
- Keep code modular and reusable. Keep it DRY.
- Keep code clear and readable.
- Don't use funny shorthands or one-liners.
- Keep functions as short as is practical and sensible
- It's ok to split code into a separate function even if used only once.
- Keep strong typing. Minimise type assertions to only absolute necessary ones.
- Document ALL functions and components with TypeDoc comments.
- Keep in mind minification. If a given long literal string or property name is to be used more than once, declare it as a constant so that minifiers can do their job.