Once moon has been initialized, we must setup the workspace, which is
denoted by the
.moon folder and a relative
package.json -- this is known as the workspace root.
The workspace is in charge of:
- Integrating with a version control system.
- Defining configuration that applies to its entire tree.
- Housing projects to build a project graph.
- Managing a toolchain that automatically installs Node.js and other tools.
- Running tasks and the build system.
The most important tool within moon and its toolchain is Node.js, as it's the backbone of a
toolchain, enforce for developers, and to utilize when running
moon commands, by updating
This setting requires an explicit semantic version and does not support version ranges, so let's set it to the latest version. We suggest always using an Active LTS version.
Let's now run
moon --log debug setup to verify that Node.js is downloaded and
installed correctly. Pretty cool right?
Configuring a package manager
Even though Node.js is now installed, we need a package manager to install dependencies. During
installation, we talked about choosing a package manager, so
let's use that choice here by defining
By default moon will install the latest version of a package manager, but this isn't consistently
updated, so we suggest defining an explicit semantic version for the package manager as well,
Once again, let's run
moon --log debug setup to verify the package manager is
installed, and also take note that Node.js is already installed. Based on the example
configuration above, we'll be switching from npm (the default) to yarn.
Configuring a version control system
moon defaults to
gitfor a VCS, so feel free to skip this if you use git.
moon requires a version control system (VCS) to be present for functionality like file diffing,
hashing, and revision comparison. The VCS and its default branch can be configured through the
SVN support is experimental and may not work properly!