.moon folder - 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
- Running tasks with the action graph
Initialize the Repository
Let’s scaffold and initialize moon in a repository with themoon init command. This should typically be run at the root, but can be nested within a directory.
If you’re investigating moon, or merely want to prototype, you can use
moon init --minimal to quickly initialize and create minimal configuration files.Workspace Configuration
The.moon/workspace.yml file is the central configuration for your moon workspace. Here’s a basic example:
.moon/workspace.yml
Configure Project Discovery
moon supports two approaches for discovering projects in your workspace:- Using Globs (Recommended)
- Manual Mapping
- Hybrid Approach
Automatically locate all project folders using glob patterns:When using this approach:
.moon/workspace.yml
- The project name is derived from the project folder name
- Names are cleaned to supported characters
- Can be customized with the
idsetting inmoon.yml
Configure Version Control System
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 thevcs setting:
.moon/workspace.yml
moon defaults to
git with a default branch of master, so you only need to configure this if your setup differs.Migrate from Existing Build Systems
Looking to migrate from Nx or Turborepo to moon? Use our migration commands for a seamless transition:Workspace Structure
After initialization, your workspace will have the following structure:Verify Setup
You can verify your workspace is configured correctly by running:Next Steps
Create a Project
Configure individual projects in your workspace
Workspace Configuration
Learn about all available workspace configuration options