Happy Holidays 🎄☃️! With our last release of the year, we're very excited to announce our tiered language support structure, which lays the foundation for turning moon into a multi-language build system! On top of this, we've worked heavily on bug fixing, optimizations, and overall quality of life improvements.
New tiered language support
The most common question we receive is whether we plan to support additional languages besides Node.js, with Rust, Deno, and Bun being top of that list. Adding new languages is non-trivial, as we need to build abstractions that support and integrate with the language's ecosystem, primarily dependency managers and resolution algorithms.
This is a very large upfront cost, with a huge time and resource commitment. To reduce this burden, we're introducing a tiered support structure, so that languages can be incrementally integrated into moon and adopted by consumers.
The tiers break down as follows:
- Tier 0 No direct integration - Tool is not directly supported in moon, but can still be ran using the "system" task platform, which expects the tool to exist in the current environment.
- Tier 1 Project categorization - Projects can
configure their primary language in
moon.yml, and have a dedicated Rust crate for metadata.
- Tier 2 Ecosystem platformization - moon deeply integrates with the language's ecosystem by parsing manifests, lockfiles, and other semantic files to infer dependencies, tasks, and other necessary information.
- Tier 3 Toolchain integration - Language is
directly supported in the toolchain, configured in
.moon/toolchain.yml, and will automatically be downloaded and installed.
To learn more about our currently supported languages and their tiers, jump to the official documentation.
One important facet we'd like to express, is that all languages and tools fall into tier 0. Feel free to use anything you'd like as a task command!
Basic support for Go, PHP, Python, Ruby, and, Rust
As announced above, we now incrementally support new languages, and have integrated the following 5
languages with tier 1 support: Go, PHP, Python, Ruby, and, Rust! Start using these languages today
by setting the
language field in
moon.yml, or by letting moon
infer the language based on files in the project root (for example,
Cargo.toml is Rust).
command: 'cargo build'
command: 'cargo test'
Because these languages are tier 1, moon does not install the language automatically, and will require the command to already exist in the environment. Furthermore, the project language will automatically set all task's
platformto "system", at least until it's supported directly in the toolchain.
Interactive project and dependency graphs
Thanks to the amazing contribution from Diptesh Choudhuri, we now have
interactive project and dependency graphs when running the
moon project-graph and
moon dep-graph commands respectively.
This is only the first iteration of these graphs. Expect more advanced features in the future, like filtering, node/edge inspection, exporting, and more!
--updateCache command line option
Our caching layer is pretty powerful, as it helps to avoid tasks from running unnecessarily.
However, there are situations where you need to refresh or force update the cache outside of the
inputs list. This is currently achieved with the
--cache option, like
moon --cache off run ..., but this is
non-ideal for a few reasons:
- It disables all caching, which means dependency installs/dedupes will continually be ran. This adds a lot of unwanted overhead.
- It requires you to backspace in the terminal to add the option before
check, as it's a global option. A little tedious but important for experience.
So to work around these limitations, we've added a new
-u) to both
moon run and
moon check, which will bypass
reading any existing cache items, but will force update the cache base on the latest run.
$ moon run app:build --updateCache
New multi-status affected filtering
We support running tasks based on affected files using the
moon run --affected command, which is great for reducing the amount of
tasks being ran, and for applying code quality tooling like git hooks. However, you were only able
to apply a single status filter, like "deleted" or "modified", which was non-ideal... but no more!
You can now apply multiple statuses by passing the
--status option multiple times.
$ moon run :lint --affected --status modified --status added
This pairs nicely with the recent
affectedFiles task option changes!
View the official release for a full list of changes.
- Refactored project and dependency graphs for improved performance.
- Added args and env var variants to the
moon initfor quick scaffolding and prototyping.
Expect the following in the v0.22 release!
- Generalized hashing for use in any context (improved deps installation).
- More work on language integrations.