11# Development
22
3- Below lists a few commands for building and running a local copy of VolView.
3+ ## Prerequisites
44
5- To prepare your environment after cloning the repo, run:
5+ Before you begin, make sure your environment matches the following versions:
6+
7+ - ** Node.js** : >= 18.20.0 (20.x LTS recommended)
8+ - ** npm** : >= 9.x (npm 10+ works with Node 20)
9+
10+ Check your versions:
11+
12+ ``` bash
13+ node --version
14+ npm --version
15+ ```
16+
17+ > ** Tip:** Use ` nvm ` or ` volta ` to manage and switch Node.js versions.
618
19+ For reproducible installs, use:
20+
21+ ``` bash
22+ npm ci
723```
24+
25+
26+ ---
27+
28+ ## Dependencies
29+
30+ Refer to ` package.json ` for the full list of dependencies and devDependencies.
31+
32+ ---
33+
34+ ## Setup
35+
36+ To prepare your environment after cloning the repo, run:
37+
38+ ``` bash
839npm install
940```
1041
42+ ---
43+
1144## Compiles and hot-reloads for development
1245
13- ```
46+ ``` bash
1447npm run dev
1548```
1649
50+ ---
51+
1752## Compiles and minifies for production
1853
19- ```
54+ ``` bash
2055npm run build
2156```
2257
58+ ---
59+
2360## Analyzing the production bundle
2461
25- You can generate a production bundle and produce a bundle size breakdown report:
62+ Generate a production bundle and produce a bundle size breakdown report:
2663
27- ```
64+ ``` bash
2865npm run build:analyze
2966```
3067
68+ ---
69+
3170## Lints and fixes files
3271
33- ```
72+ ``` bash
3473npm run lint
3574```
3675
76+ ---
77+
3778## Testing
3879
39- ```
80+ ``` bash
4081# unit tests
41- npm run test:unit
82+ npm run test
4283
43- # e2e tests
84+ # e2e tests (Chrome)
4485npm run test:e2e:chrome
4586```
4687
@@ -50,36 +91,38 @@ When adding a new baseline image and test, the image should be pulled from GitHu
5091
5192#### Run one e2e spec file
5293
53- ```
94+ ``` bash
5495npm run test:e2e:dev -- -- --spec ./tests/specs/remote-manifest.e2e.ts
5596```
5697
98+ ---
99+
57100## Developing with VTK.js
58101
59102Follow these steps to develop against a custom development branch of VTK.js:
60103
611041 . Build and package VTK.js:
62105
63- ``` sh
106+ ``` bash
64107path/to/vtk-js > npm run build:esm
65108```
66109
671102 . Create a symbolic link to the VTK.js distribution folder on your local system:
68111
69- ``` sh
70- > cd path/to/vtk-js/dist/esm
71- path/to/vtk-js/dist/esm > npm link
112+ ``` bash
113+ cd path/to/vtk-js/dist/esm
114+ npm link
72115```
73116
741173 . Reference the symbolic link in your local VolView build:
75118
76- ``` sh
77- > cd path/to/VolView
78- path/to/VolView > npm link --no-save @kitware/vtk.js
119+ ``` bash
120+ cd path/to/VolView
121+ npm link --no-save @kitware/vtk.js
79122```
80123
811244 . Build and run VolView:
82125
83- ``` sh
84- path/to/VolView > npm run dev
126+ ``` bash
127+ npm run dev
85128```
0 commit comments