With this release, we're introducing some quality of life task improvements.
Token variable support in task commands
moon supports a concept known as tokens where values are injected into tasks during project graph creation. This allows for dynamic values in your tasks, such as the current project language, or the current task name, and is crucial for task inheritance to work.
However, tokens were only supported by task args, inputs, and outputs, but not commands... until now. Commands can now use token variables (but not token functions). For example, this is useful for referencing shared scripts from the workspace root.
Run targets in closest project
moon run command can run targets in an array of different formats, but
was unable to run targets based on the current working directory. Well no more! You can now run
tasks from the closest project based on file path by omitting
: from the target name.
$ cd packages/components
# Runs `components:build` internally
$ moon run build
View resolved task information
Debugging task issues can be a quite a pain, as there can be many points of failure. Are inputs too
greedy? Are outputs not being created? Does it exist at all? To help with this, you can now view
task information by running
moon task <target>.
$ moon task app:build
This command will display resolved information, including inherited settings, and path resolved inputs and outputs. Here's an example:
Command: packemon build --addFiles --addExports --declaration
- NODE_ENV = production
Working directory: /Projects/moon/packages/runtime
Runs dependencies: Concurrently
Runs in CI: Yes
View the official release for a full list of changes.
- Support pnpm v8's new lockfile format.
- Better handling for task's that execute the
nooptasks to be cacheable, so that they can be used for cache hit early returns.