Before you can build the UV, we assume the following list of software is already installed in your system
- Git
- Node 14.18.1 or higher
- Npm 8.1.1 or higher
In order to contribute to the UV, you must have a github account so you can push code and create a new Pull Request (PR).
Once you are all setup, following the Github's guide of how to fork a repository: https://guides.github.com/activities/forking/
-
Clone the
universalviewer
repository:git clone https://github.com/UniversalViewer/universalviewer.git
-
On the command line, go in to the
universalviewer
folder
cd universalviewer
-
Run
npm install
To build the debug version of the viewer, just run (on the command line, in the universalviewer
folder):
npm start
This will compile the project using webpack and serve the examples on localhost:8080
To build the distribution version of the UV, just run (on the command line, in the universalviewer
folder):
npm run build
UV source code lives inside the /src/
folder.
Here is a diagram showing the overall architecture of the project.
Before commiting your changes make sure tests are passing:
npm test
Note: the development server must be running (
npm start
)
Tests are written using Jest
# Create a git branch
git checkout -b my-improvement
# Add changes
git add .
# Create commit
git commit -m "fix(component): message"
Checkout the main
branch, and ensure it is up-to-date.
Run npm version [major | minor | patch]
for example:
npm version patch
This will update the package.json
version and create a git tag. Then push both the main/tag.
git push origin main v0.0.8
Then the GitHub action will pick up the tag and publish it to NPM.
Create a PR: https://guides.github.com/activities/forking/