1PathKit WASM API 2================ 3 4The [PathKit](https://skia.org/docs/user/modules/pathkit/) library lets you use 5Skia's feature-rich PathOps API in the browser. 6 7Compiling the source 8-------------------- 9 10### Compiling with GN 11 12Get a compiled [Enscriptem SDK](https://kripken.github.io/emscripten-site/docs/getting_started/downloads.html) 13in your path. This is easiest done by running `//tools/git-sync-deps` which 14downloads and then runs `//bin/activate-emsdk`. 15 16To compile a production WASM build to `//out/pathkit`: 17 18```sh 19./compile.sh 20``` 21 22Add `--help` for more options. 23 24### Compiling with Bazel 25 26To compile a production WASM build to `//bazel-bin/modules/pathkit/pathkit`: 27 28```sh 29bazelisk build //modules/pathkit:pathkit --config=ck_full_webgl2_release 30``` 31 32A debug build: 33 34```sh 35bazelisk build //modules/pathkit:pathkit --config=ck_full_webgl2_debug 36``` 37 38Testing 39------- 40 41### Running example page locally: 42 43```sh 44# First build PathKit 45make release 46# Then run a local test server 47make local-example 48``` 49 50Then follow messages to navigate the browser to the example page. 51 52### Automated tests 53 54**Testing the GN build** 55 56```sh 57make release 58make npm 59npm ci 60make test-continuous 61``` 62 63**Testing the Bazel build** 64 65```sh 66make debug-bazel 67make npm-bazel 68npm ci 69make test-continuous 70``` 71 72Deploying to npm 73---------------- 74 75NOTE: The deployment steps use the GN build. 76 77```sh 78# Build the release version for both asmjs and WASM 79# These binaries will be placed in the proper places of npm-*/bin 80make npm 81 82# In each npm- subdirectory, run: 83npm version minor (or patch or major) 84npm login --registry https://wombat-dressing-room.appspot.com 85npm publish 86```