The WebXR Layers Polyfill is developed in Typescript, and uses npm
as its package manager.
$ git clone [email protected]:immersive-web/webxr-layers-polyfill.git
$ cd webxr-layers-polyfill
# Install dependencies
$ npm install
# Build transpiled ES5 script
$ npm run build-script
# Build ES module
$ npm run build-module
# Create all builds
$ npm run build
# Run tests
$ npm test
This project uses Jest
to run unit tests, and there's a small collection of them in the /tests
folder. Unfortunately, it's difficult to make immersive WebXR sessions within a unit test setting, so the current existing tests mostly check to make sure the program polyfills the required classes.
Run the unit tests via:
$ npm test
Please also test the examples with your changes where appropriate. To run the examples, build the polyfill and run
$ npm run serve
and point your web browser to http://localhost:8080/examples/layers-samples/
.
We actively welcome pull requests.
- Fork the repo and create your branch from
main
. - If you've added code that should be tested, add tests. (This is unlikely, unless you're modifying the shape of the polyfilled classes.)
- Ensure the test suite passes, and that you've checked your changes manually against the examples.
- Format your code.
This project uses Prettier
to format the source code. Please run the formatter with
$ npm run format
before submitting your changes.
This program is free software for both commercial and non-commercial use, distributed under the Apache 2.0 license, which can be found in the LICENSE file.