This project contains a Node.js library Node.js that is used to generate common visualizations for data. The predominantly used packages are D3 and Three.js. The contributors to this project are listed here. The documentation for this library is hosted here.
You should have a version of Node.js that is at least 17.0. You can check what your active version of Node.js is by running
node --version
Once you have Node.js installed, you should install the required and development packages using
npm install
in the root directory of the project.
The following are guidelines for how code should be contributed to this project.
- Commitizen-friendly commit messages should always be used.
- Before code is submitted, Prettier should be used to format code. We suggest using the VSCode extension.
- Code versions should be bumped before pushing changes into
main
according to Semantic Versioning guidelines.
The following commands are available for running, testing, and packaging the project.
-
npm run rollup
packages the project as both a CommonJS and ECMAScript modules. The packaged files are contained in
dist/cjs
anddist/esm
respectively. The package contains type declarations embedded within so dependents do not need to install a@types
module. -
npm run test
tests the package by automatically running any file that has a name matching
*.test.ts
. Jest is the unit testing suite and is configured to use the JSDOM environment. This allows tests to construct a virtual DOM for testing. -
npm run storybook-serve
runs a Storybook server on port 6006 by default. The Storybook environment should be used to visually test interactions with the visualizations included in this package in addition to standard unit tests.
-
npm run storybook-build
compiles a static version of Storybook as a collection of HTML, CSS, and JS that is distributable. By default, these static files are exported to the
public
directory.
This project is configured to run a continuous deployment pipeline on GitLab. This pipeline does the following:
- Tests that that unit tests run with no errors.
- Publishes the package to the GitLab Package Registry if on the
main
branch. - Publishes the Storybook documentation if on the
main
branch.
It is important that the version of the package in project.json
is bumped whenever new features are pushed into main
. Otherwise, the publish stage will fail to update the package registry.