Development
January 30, 2025 ยท View on GitHub
Note:
- information about the library internals are available in the architecture folder or in html form in the documentation site
- additional information related to development can also be found in the contributors guidelines page
Requirements
Node.js: use the version referenced in.nvmrcfile. For nvm users, just runnvm usefor the repository root.npm: use the version associated to the node version.Supported OSWindows/Linux/macOS (see the GitHub Build workflow for more details)
Build
npm installInstall the dependencies in the local node_modules foldernpm run devStart the development server and rebuild on changes
You can now access the project on http://localhost:10001/dev/public/index.html
Tests
See the testing page
Code style
Your patch should follow the same conventions & pass the same code quality checks as the rest of the project.
Project, in major line, follows the code style suggested by airbnb which is explicit and well documented.
Typescript was chosen because it's strongly typed, and we believe it adds some syntactical benefits to the JavaScript language. More information here: Typescript
To enforce best practices we use ESLint and husky. The latter performs lint checks on pre-commit event to make sure that committed code meets standards.
Husky settings when using Node Version Managers
On commit, if you use a Node Version Manager, the pre-commit hook may generate an Command not found error.
If so, create a startup file and add the following content (this example is given for Linux or macOS when using nvm):
# This loads nvm.sh and sets the correct PATH before running hook
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
For more details, see
- https://typicode.github.io/husky/how-to.html#node-version-managers-and-guis
- https://github.com/typicode/husky/issues/912
Typescript
Although Linting, Sonar and Tests keeps the code in a good shape.
To write code that conforms to best practices, we strongly recommend that you review the following resources: