melos
This Mason brick bootstraps a Melos project structure, supporting both monorepos and poly-repositories. Use this brick to quickly set up a multi-package workspace for your Dart and Flutter projects.
Variables
Variable | Type | Description | Default |
---|---|---|---|
name | String | Your project name | (Prompted) |
packages | Array | List of packages to include | ["packages", "apps"] |
isMono | Boolean | Is this a monorepo? | true |
Variable Details
name
: The name of your project.packages
: An array specifying the directories for your packages. Common directories include"packages"
for reusable packages and"apps"
for end-user applications.isMono
: Set this totrue
if creating a monorepo structure, orfalse
for a poly-repository setup.
Usage
-
Install Mason (if you haven’t already):
dart pub global activate mason_cli
-
Add the Brick:
mason add melos -g
-
Generate the Project: Run the following command and follow the prompts to customize your project:
mason make melos
Notes
- This brick is helpful for initializing Melos projects with a custom directory structure.
- You may want to customize the resulting workspace in
melos.yaml
based on your project’s requirements.