Coming from other repositories or task runner, you may be familiar with tasks available at the repository root, in which one-off, organization, maintenance, or process oriented tasks can be ran. moon supports this through a concept known as a root-level project.
Begin by adding the root to
projects with a source value of
(current directory relative from the workspace).
# As a map
# As a list of globs
When using globs, the root project's name will be inferred from the repository folder name. Be wary of this as it can change based on what a developer has checked out as.
Once added, create a
moon.yml in the root of the repository. From here you
can define tasks that can be ran using this new root-level project name, for example,
moon run root:<task>.
command: 'yarn version check'
And that's it, but there are a few caveats to be aware of...
inputs default to
**/*, which would result in root-level tasks
scanning all files in the repository. This will be a very expensive operation! We suggest
restricting inputs to a very succinct whitelist, or disabling inputs entirely.
Because a root project is still a project in the workspace, it will inherit all tasks defined in
.moon/tasks.yml, which may be unexpected. To mitigate this, you can exclude
some or all of these tasks in the root config with