This project contains several releasable components,
tree-sitter-wit
- a Tree Sitter parser for the WIT formatcrates/wit-compiler
- an incremental compiler for the WIT languagecrates/wit-language-server
- the actual Language Server implementationcrates/wit
- a monolithic command-line tool for end usersplugins/vscode
- an extension for VS Code which uses the language server
It also contains a crates/xtask
crate for running useful internal commands.
A clean debug build of the entire workspace shouldn't take any longer than 30 seconds and the entire CI workflow should finish within 10 minutes.
This isn't actually too difficult to achieve as long as you follow some guidelines:
- Don't add dependencies unless you absolutely need to
- Trim out unnecessary features
- Periodically use
cargo clean && cargo build --timings
to see where compile time is spent - Don't use dependencies that pull in half of crates.io
The rationale behind this is simple - a short edit-compile-test cycle is a force multiplier. If you have fast compile times then developers can recompile and re-run the test suite after every change.
On the other hand, if CI takes 30 minutes to complete, developers will avoid your project like the plague because getting even the most trivial changes merged becomes a multi-hour chore.
To help this, we have a GitHub Action which will post comments on each PR to let you know how much your changes have affected CI times.
You can test the VS Code extension is by using the "Run Extension" launch command found in the "Run and Debug" panel down the side.
This should automatically compile the extension and open a new VS Code window with the extension installed.
This repository uses Release Please to automate a lot of the work around creating releases.
Every time a commit following the Conventional Commit Style is merged
into main
, the release-please.yml
workflow will run and update the "Release PR" to reflect the new changes.
For commits that just fix bugs (i.e. the message starts with "fix: "
), the
associated crate will receive a changelog entry and a patch version bump.
Similarly, adding a new feature (i.e. "feat:"
) does a minor version bump and
adding breaking changes (i.e. "fix!:"
or "feat!:"
) will result in a major
version bump.
When the release PR is merged, the updated changelog and bumped version number
will be merged into the main
branch, the release-please.yml
workflow will
automatically generate GitHub Releases, and CI will publish the package to NPM.
TL;DR:
- Use Conventional Commit Messages whenever you make a noteworthy change
- Merge the release PR when ready to release
- Let the automation do everything else