Skip to main content

moon v0.17 - Webhooks, extended YAML, and improved runtime performance

· 4 min read
Miles Johnson
Founder, developer

With this release, we're landing the first iteration of our notifier service, starting with webhooks! We've also spent some time working on quality of life improvements.

Breaking changes

To start, we have a few breaking changes this release to be aware of!

Minor changes to ID formatting

An ID refers to many things — project names, task names, target segments, so on and so forth. When parsing these values, we format them to remove unwanted characters, as these IDs are used in many contexts, many of which need to be strict.

Previously, we would remove unwanted characters entirely. Instead, we now replace them with dashes (-) for better readability. Take the following for example:

IDOldNew
domain.comdomaincomdomain-com
build:esmbuildesmbuild-esm

Task type has been renamed to platform

This setting was renamed for a few reasons. To start, tasks actually have a type internally that is not configured, but is inferred based on what's configured. This was a bit confusing.

And secondly, our toolchain refers to language integrations as platforms, and since this setting determines which tool to run with, we wanted to align on the platform terminology.

tasks:
clean:
command: 'rm -rf ./dist'
type: 'system'

Because of this change, the $taskType token was also renamed to $taskPlatform!

Webhook events (experimental)

Looking to gather metrics for your pipelines? Gain insight into run durations and failures? Maybe you want to send Slack or Discord notifications? With our new notifier system, this is now possible through webhooks!

Simply enable the notifier.webhookUrl setting to start receiving events from your CI environments.

.moon/workspace.yml
notifier:
webhookUrl: 'https://api.company.com/some/endpoint'

View the official guide on webhooks for a full list of events and an example payload structure!

YAML anchors and aliases

We've updated our YAML configuration files to support extended syntax, anchors (&) and aliases (*). With this new syntax, you're now able to reduce the amount of duplication required in your config files, especially when declaring tasks, as demonstrated below!

tasks:
astro:
command: 'astro'
local: true

dev:
command: 'astro dev'
inputs:
- '@group(astro)'
local: true

build:
command: 'astro build'
inputs:
- '@group(astro)'
outputs:
- 'dist'

check:
command: 'astro check'
inputs:
- '@group(astro)'
deps:
- '~:typecheck'

preview:
command: 'astro preview'
inputs:
- '@group(astro)'
deps:
- '~:build'
local: true

VS Code extension

If you missed the announcement earlier this week, we released the initial version of our new VS Code extension! Give it a try and refer to the documentation for more information.

Other changes

View the official release for a full list of changes.

  • Increased runtime performance and reduced memory consumption.
  • Template enum variables can now define objects for their values.
  • Task deps can now omit the ~: prefix for tasks within the current project.
  • The moon check command can now use the --report option.

What's next?

Expect the following in the v0.18 release!

  • Workflow improvements for moon init.
  • Benchmarks and performance tuning.
  • Individual stdout/stderr log files when running tasks.