-
Notifications
You must be signed in to change notification settings - Fork 31
Development guide
After cloning, install the dev packages.
npm install
If you want to change C/C++, you'll also need to install Zig 0.14.
The following commands work out of the src/
directory. Each one of them is a single command: no build step is necessary.
npm run tsc
npm run playground
npm run test
npm run test:watch
node -C typescript examples/rtl-1.ts
Some of the files in dropflow are generated from other files in the repo. The generated files are tracked in git because they're changed rarely. When you do need to make changes to these files, you'll need to run the appropriate command.
Outputs src/parse-css.js
from the .pegjs
file.
npm run buildcssparser
Use gen.js
to update files in gen/
. These are Unicode tries and various character databases. To see available commands, run:
node gen.js help
Make sure you're using Zig 0.14. This outputs dist/dropflow.wasm
from src/dropflow.cc
, gen/*.cc
, gen/*.c
, and the dependencies in build.zig.zon
.
zig build
Dropflow is distributed to NPM with JS and .d.ts files in the dist folder. To run tests before publishing or to debug any issues that might arise from this slightly different transformation, use the following commands.
npm run test:dist
node dist/examples/rtl-1.js