website/docs/faq.mdx
The first incarnation of the name was a misspelling of monorepo (= moonrepo). This is where the domain moonrepo.dev came from, and our official company, moonrepo, Inc.
However, moonrepo is quite a long name with many syllables, and as someone who prefers short 1 syllable words, moon was perfect. The word moon also has great symmetry, as you can see in our logo!
But that's not all... moon is also an acronym. It originally stood for monorepo, organization, orchestration, and notification tool. But since moon can also be used for polyrepos, we replaced monorepo with management (as shown on the homepage). This is a great acronym, as it embraces what moon is trying to solve:
Yes! Although we're focusing right now on the web ecosystem (Node.js, Rust, Go, PHP, Python, etc), we've designed moon to be language agnostic and easily pluggable in the future. View our supported languages for more information.
Yes! We plan to integrate CD with the current build and CI system, but we are focusing on the latter 2 for the time being. Why not start using moon today so that you can easily adopt CD when it's ready?
To ensure a healthy repository state, moon constantly modifies JSON and YAML files, specifically
package.json and tsconfig.json. This may result in a different formatting style in regards to
indentation. While there is no way to stop or turn off this functionality, we respect
EditorConfig during this process.
Create a root .editorconfig file to enforce a consistent syntax.
[*.{json,yaml,yml}]
indent_style = space
indent_size = 4
Piping (|) or redirecting (>) the output of one moon task to another moon task, whether via
stdin or through inputs, is not possible within our pipeline (task runner) directly.
However, we do support this functionality on the command line, or within a task itself, using the
script setting.
tasks:
pipe:
script: 'gen-json | jq ...'
Alternativaly, you can wrap this script in something like a Bash file, and execute that instead.
#!/usr/bin/env bash
gen-json | jq ...
tasks:
pipe:
command: 'bash ./scripts/pipe.sh'
Only script based tasks can run multiple commands via && or ;
syntax. This is possible as we execute the entire script within a shell, and not directly with the
toolchain.
tasks:
multiple:
script: 'mkdir test && cd test && do-something'
By default, all tasks run in a shell, based on the task's shell option,
as demonstrated below:
tasks:
# Runs in a shell
global:
command: 'some-command-on-path'
# Custom shells
unix:
command: 'bash -c some-command'
options:
shell: false
windows:
command: 'pwsh.exe -c some-command'
options:
shell: false
Yes! Although our toolchain only supports a few languages at this time, you can still run other
languages within tasks by setting their toolchain to "system".
System tasks are an escape hatch that will use any command available on the current machine.
tasks:
# Ruby
lint:
command: 'rubocop'
toolchain: 'system'
# PHP
test:
command: 'phpunit tests'
toolchain: 'system'
However, because these languages are not supported directly within our toolchain, they will not receive the benefits of the toolchain. Some of which are:
package.json scripts?We encourage everyone to define tasks in a moon.* file, as it allows for
additional metadata like inputs, outputs, options, and more. However, if you'd like to keep
using package.json scripts, enable the
node.inferTasksFromScripts setting.
At this time, no, as we're focusing on the build and test aspect of development. With that being said, this is something we'd like to support first-class in the future, but until then, we suggest the following popular tools:
moon will automatically install dependencies in a project or in the workspace root (when using
package workspaces) when the lockfile or package.json has been modified since the last time the
install ran. If you are running a task and multiple installs are occurring (and it's causing
issues), it can mean 1 of 2 things:
workspaces field in the root package.json (for npm and yarn), or in
pnpm-workspace.* (for pnpm).This is typically caused by running moon in an old environment, like Ubuntu 18, and the minimum required libc doesn't exist or is too old. Since moon is Rust based, we're unable to support all environments and versions perpetually, and will only support relatively modern environments.
There's not an easy fix to this problem, but there are a few potential solutions, from easiest to hardest:
node:latest image.For more information on this problem as a whole, refer to this in-depth article.