website/blog/2022-12-19_v0.21.mdx
import Label from '@site/src/ui/typography/Label'; import Image from '@site/src/components/Image';
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.
<!--truncate-->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:
moon.yml, and have a
dedicated Rust crate for metadata..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!
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).
language: 'rust'
tasks:
build:
command: 'cargo build'
inputs:
- 'src/**/*'
- 'Cargo.toml'
test:
command: 'cargo test'
inputs:
- 'src/**/*'
- 'tests/**/*'
- 'Cargo.toml'
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.
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!
<Image src={require('./img/v0.21/graph.png')} width="80%" />
--updateCache command line optionOur 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:
run or 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 --updateCache (or -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
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.
affectedFiles task option.--minimal to moon init for quick scaffolding and prototyping.Expect the following in the v0.22 release!