---
slug: moon-v1.22
title: moon v1.22 - Organizational settings, wildcard env var inputs, and Nx migration
authors: [milesj]
tags: [project, metadata, nx, migrate]
image: ./img/moon/v1.22.png
---

This release introduces new organizational settings for projects, a migrate from Nx extension, and
more.

<!--truncate-->

## More organizational settings

One aspect of moon that sets us apart from other build systems and tools, is that we have built-in
support for human-readable project and task metadata. This is extremely useful in organizing and
managing large repositories, especially when ownership comes into play. This information is also
used for categorization and filtering for MQL and our editor extensions/plugins.

To expand on this functionality even further, we're adding a few requests from the community, and
they are:

- New `configuration` and `scaffolding` variants for the project [`type`](/docs/config/project#type)
  setting in [`moon.yml`](/docs/config/project). Perfect for contracts and templates.

  ```yaml
  type: 'configuration'
  ```

- New [`stack`](/docs/config/project#stack) setting in [`moon.yml`](/docs/config/project), for
  categorizing which tech stack the project belongs to. Supports `frontend`, `backend`,
  `infrastructure`, and `systems`.

  ```yaml
  stack: 'frontend'
  ```

- New [`description`](/docs/config/project#description-1) setting for tasks, that provides
  human-readable information.

  ```yaml
  tasks:
    build:
      description: 'Builds the project using Vite'
      command: 'vite build'
  ```

## New wildcard environment variable inputs

Task inputs have supported environment variables for quite a while now, but they are explicit, which
can be tedious too manage when you have many environment variables. To make this easier, we've added
support for wildcard environment variables, denoted by a `*`, which will match any environment
variable with that pattern.

For example, say we want to track all Node.js and Vite environment variables that start with `NODE_`
and `VITE_` respectively, we can simply do:

```yaml
tasks:
  build:
    command: 'vite build'
    inputs:
      - '$NODE_*'
      - '$VITE_*'
```

> Do note that this _isn't_ a glob, and the `*` is merely a substitution for any character!

## New `migrate-nx` extension

In our previous release, we added support for [migrating from Turborepo](./moon-v1.21), but what
about Nx? Nx is a very popular build system with many users. A lot of our current moon users were
former Nx users, but unfortunately, they had to go through the tedious process of migrating
everything manually. We wanted to make this process easier for new users, so we created a new
experimental extension to help with this process,
[`migrate-nx`](/docs/guides/extensions#migrate-nx).

```shell
$ moon ext migrate-nx
```

This extension was quite complicated to implement, as Nx has a _ton_ of features. However, when the
extension is executed, we'll convert the root `nx.json` and `workspace.json` files to
[`.moon/workspace.yml`](/docs/config/workspace) and related top-level config files, and we'll also
convert every `project.json` and `package.json` (with an `nx` block) into a
[`moon.yml`](/docs/config/project) file.

Conversion is not a perfect 1:1, as moon and Nx are quite different. Please refer to the
[official documentation](/docs/guides/extensions#migrate-nx) for a list of unsupported settings and
features.

:::info

An awesome feature that didn't make it in time for this release, is an npm package for Nx
compatibility, that will allow Nx executors/plugins to be executed through moon, without the
requirement of Nx itself. This will allow for a seamless transition from Nx to moon, without the
need to change any of your existing Nx executors/plugins till later.

This functionality will be provided by our new
[`@moonrepo/nx-compat` package](https://github.com/moonrepo/moon/tree/master/packages/nx-compat),
which we hope to finish in the coming weeks.

:::

## Other changes

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

- Added an `installArgs` setting for bun/npm/pnpm/yarn in `.moon/toolchain.yml`, to customize the
  args used when installing dependencies.
- Updated the `envFile` task option to support a list of file paths.
