This crate is split into 3 parts. The first one is the repository's root folder, which we'll be refering to as the "outer"-crate. The second and third are the "inner"-crates, which are in the "crates"-directory.
Of these the "definitions"-crate contains all code about tokens, what operators and expressions there are etc. If you need to make changes to these topics please do so in crates/definitions.
The "source_gen"-crate rarely needs any changes. It contains a build.rs file, which automatically builds new source code needed for the project from the definitions crate.
All code concerning AST, parsing and such topics can be found in the src directory of the "outer"-crate. Please make your changes there.
Contributions are welcome! If you have any ideas, suggestions, or bug reports, please open an issue or submit a pull
request.
To contribute to this project, follow these steps:
-
Fork the repository.
-
Create a new branch for your feature or bug fix:
git checkout -b feature/my-feature
-
Make your changes and ensure that the code follows the project's coding conventions.
-
Run the tests to ensure they pass:
cargo test --features coverage-tests
-
Commit your changes:
git commit -m "Add my feature"
-
Push to your branch:
git push origin feature/my-feature
-
Open a pull request on GitHub.
To build the application and generate a full npm package in the pkg/
directory, use
wasm-pack build --target nodejs
To run all unit tests, use
cargo test
To run unit tests marked with #[ignore]
, use
cargo test -- --ignored
To run the coverage tests, use
cargo test -F coverage-tests
To run the TypeScript test suite, use
npm --prefix tests/typescript clean-install
npm --prefix tests/typescript test
To generate the (public) rustdoc for this library, use:
cargo doc
To generate the full rustdoc for all items, including private ones, use:
cargo doc --document-private-items
It is endorsed to install the wasm-opt
tool from the
binaryen
project,
which wasm-pack
will automatically use to optimize the generated WASM code.