Building the project is not usually needed for local development. However, for exports to WPT, NodeJS, or deployment, files can be pre-generated.
The project can be built several different ways, each with a different output directory:
Use npm run start to launch a server that live-compiles everything as needed. Use tools/run_node and other tools to run under ts-node which compiles at runtime.
out directoryBuilt with: npm run standalone
Serve locally with: npx grunt serve
Used for: Static deployment of the CTS, primarily for gpuweb.github.io/cts.
out-wpt directoryBuilt with: npm run wpt
Used for: Deploying into Web Platform Tests. See below for more information.
Contains:
out/.html test cases from src/out-node directoryBuilt with: npm run node
Used for: Running NodeJS tools, if you want to specifically avoid the live-compilation overhead of the tools/ versions, or are running on a deployment which no longer has access to ts-node (which is a build-time dependency). For example:
node out-node/common/runtime/cmdline.js (source) - A command line interface test runnernode out-node/common/runtime/server.js (source) - An HTTP server for executing CTS tests with a REST interfaceTo build and run all pre-submit checks (including type and lint checks and unittests), use:
npm test
For checks only:
npm run check
Run npm run wpt.
Copy (or symlink) the out-wpt/ directory as the webgpu/ directory in your WPT checkout or your browser's “internal” WPT test directory.