Before you begin, make sure your environment matches the following versions:
- Node.js: >= 18.20.0 (20.x LTS recommended)
- npm: >= 9.x (npm 10+ works with Node 20)
Check your versions:
node --version
npm --versionTip: Use
nvmorvoltato manage and switch Node.js versions.
For reproducible installs, use:
npm ciRefer to package.json for the full list of dependencies and devDependencies.
To prepare your environment after cloning the repo, run:
npm installnpm run devnpm run buildGenerate a production bundle and produce a bundle size breakdown report:
npm run build:analyzenpm run lint# unit tests
npm run test
# e2e tests (Chrome)
npm run test:e2e:chromeWhen running end-to-end tests, baseline images are saved to tests/baseline. Baseline diffs and actual snapshots are saved to .tmp.
When adding a new baseline image and test, the image should be pulled from GitHub Actions. Every test run will upload artifacts containing the snapshots taken, and those should be used when verifying and committing the baseline images.
npm run test:e2e:dev -- -- --spec ./tests/specs/remote-manifest.e2e.tsMerging to main automatically publishes prerelease packages to NPM:
- Merge creates a prerelease tag (e.g. v4.4.0-dev.)
- Tag triggers automatic NPM publish with
@devdist-tag
npm install volview # Gets latest stable release (e.g., 4.4.0)
npm install volview@dev # Gets latest dev package (most recent commit to main branch)To publish a new release via CI/CD, manually create and push a tag, e.g.:
git tag v4.5.0 # must match format 'v[0-9]+.[0-9]+.[0-9]+'
git push origin --tagsFollow these steps to develop against a custom development branch of VTK.js:
- Build and package VTK.js:
path/to/vtk-js > npm run build:esm- Create a symbolic link to the VTK.js distribution folder on your local system:
cd path/to/vtk-js/dist/esm
npm link- Reference the symbolic link in your local VolView build:
cd path/to/VolView
npm link --no-save @kitware/vtk.js- Build and run VolView:
npm run dev