---
slug: moon-v1.20
title: moon v1.20 - Extension plugins, default task options, and more
authors: [milesj]
tags: [task, options, extensions, plugins]
image: ./img/moon/v1.20.png
---

In this release, we're excited to introduce extensions, our first type of plugin!

<!--truncate-->

## New extension plugins

In our [2024 roadmap blog post](./2024-roadmap), we talked heavily about plugins, as we believe
they're the future of moon and its ecosystem. What we didn't talk about is that we plan to have
_many types of plugins_, and not just language/platform specific ones. And with that, we're excited
to introduce extensions!

An extension is a WASM plugin that allows you to extend moon with additional functionality, have
whitelisted access to the file system, and receive partial information about the current workspace.
Extensions are extremely useful in offering new and unique functionality that doesn't need to be
built into moon's core.

Once such extension is our built-in `download` extension, which is a basic extension that simply
downloads a file from a URL into the current moon workspace.

```shell
$ moon ext download -- --url https://github.com/moonrepo/proto/releases/latest/download/proto_cli-aarch64-apple-darwin.tar.xz
```

Shipping alongside extensions are the following new features:

- An [official extensions guide](/docs/guides/extensions)!
- An [`extensions`](/docs/config/workspace#extensions) setting for configuring new extensions.
- A [`moon ext`](/docs/commands/ext) command for executing a configured extension.
- The required infrastructure for plugins!

## Configure default options for tasks

[Task options](/docs/config/project#options) provide a way to apply granular changes to a task's
behavior when running in the pipeline. However, they can become tedious when you need to apply them
to many tasks, especially when inheritance is involved. To help with this, you can now configure the
[`taskOptions`](/docs/config/tasks#taskoptions) setting in task related configs, like
`.moon/tasks.yml` and `.moon/tasks/*.yml`, which acts as the base/default options for all inherited
tasks.

For example, the following config:

```yaml title=".moon/tasks.yml"
tasks:
  build:
    # ...
    options:
      outputStyle: 'stream'
      retryCount: 2
  lint:
    # ...
    options:
      outputStyle: 'stream'
      retryCount: 2
  test:
    # ...
    options:
      outputStyle: 'stream'
      retryCount: 2
```

Can simply be rewritten as:

```yaml title=".moon/tasks.yml"
taskOptions:
  outputStyle: 'stream'
  retryCount: 2

tasks:
  build:
    # ...
  lint:
    # ...
  test:
    # ...
```

Because these options are defined at the workspace-level, they adhere to the same merge and
inheritance rules as other settings. Just be aware that these options are inherited first in the
chain, and can be overwritten by other layers, or by project-level tasks.

## Optional task dependencies

By default, all task [`deps`](/docs/config/project#tasks-1) are required to exist when tasks are
being built and expanded, but this isn't always true when dealing with composition and inheritance.
For example, say you're using
[tag-based inheritance](/docs/concepts/task-inheritance#scope-by-project-metadata), and a global
task relies on one of these tagged tasks, but not all projects may define the appropriate tags. In
previous versions of moon, this is a hard failure, as the dependent task does not exist.

To remedy this, we're introducing a new [`optional`](/docs/config/project#optional-1) flag for task
dependencies. When set to `true`, moon will no longer error when the task doesn't exist, and instead
will omit the dependency.

```yaml title=".moon/tasks.yml" {4-6}
tasks:
  build:
    command: 'vite'
    deps:
      - target: '#components:build'
        optional: true
```

> Thanks to [@maastrich](https://github.com/maastrich) for this contribution!

## Other changes

View the [official release](https://github.com/moonrepo/moon/releases/tag/v1.20.0) for a full list
of changes.

- Added a "Tags" view to the VSCode extension.
- Updated proto to v0.29.1 (from v0.26.4).
- Updated proto installation to trigger for all applicable commands, not just `moon run`,
  `moon check`, and `moon ci`.
