Follow semantic versioning and make sure the changelog is up-to-date.
Use npm to update the version number, make a dist build, tag and push to github with npm version [level]
using the appropriate level (e.g. major, minor, patch, prerelease, ...). Publish on npm using npm publish
. For the prerelease level use npm publish --tag next
(to avoid making a prerelease version the default for new installs from npm).
For non prerelease level also update README.md and CHANGELOG.md and make a release on github including copying the relevant info from the changelog file there.
Development of the NGL Viewer is coordinated through the repository on github. Please use the issue tracker there to report bugs or suggest improvements.
To participate in developing for the NGL Viewer you need a local copy of the source code, which you can obtain by forking the repository on github. Read about how to fork a repository, sync a fork and start a pull request.
The source code (src/) is organized into ES6 modules (see http://exploringjs.com/es6/ch_modules.html). The main entry point is the file src/ngl.js and rollup is used to create a bundle that can be used in a browser. Before bundeling the code is transpiled using buble so that most ES6 features can be used for development.
The JavaScript package manager npm is used as a build tool. The necessary dependencies can be installed with npm install
. For development, a non-minified build build/js/ngl.dev.js
can be created with npm run-script build
. A minified file for distribution (dist/ngl.js) can be created with npm run-script build-min
. For development npm run-script watch
can be called to watch source files and trigger a rebuild upon changes to them. The documentation can be build with npm run-script doc
. Tests can be run with npm test
.
The examples need to served by a webserver. Options for a simple development webserver are python -m SimpleHTTPServer
(Python 2), python -m http.server
(Python 3) or https://github.com/indexzero/http-server (node.js).
Jest is used for unit testing. The unit tests can be run all at once with npm test
or individually like npx jest test/tests-utils.spec.js
.