Skip to content

Commit ade758c

Browse files
authored
feat!: Remove melos.yaml in favor of the root pubspec.yaml (#832)
<!-- Thanks for contributing! Provide a description of your changes below and a general summary in the title Please look at the following checklist to ensure that your PR can be accepted quickly: --> ## Description Since we now declare the packages in the `workspace` section in the `pubspec.yaml` file we'll move the rest of the config in there too, under it's own `melos` section. This is common practice for other dart tools too and the Dart team knows about it. Continues on the #747 effort. ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [x] ✨ `feat` -- New feature (non-breaking change which adds functionality) - [ ] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue) - [x] ❌ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 `refactor` -- Code refactor - [ ] ✅ `ci` -- Build configuration change - [ ] 📝 `docs` -- Documentation - [ ] 🗑️ `chore` -- Chore
1 parent c5238cd commit ade758c

40 files changed

+576
-1338
lines changed

docs/commands/analyze.mdx

Lines changed: 0 additions & 51 deletions
This file was deleted.

docs/configuration/overview.mdx

Lines changed: 88 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,21 @@
11
---
22
title: Configuration overview
3-
description: Configure Melos using the `melos.yaml` file.
3+
description: Configure Melos using the `pubspec.yaml` file.
44
---
55

66
# Configuration Overview
77

8-
Every project requires a `melos.yaml` project in the root. The below outlines
9-
all the configurable fields and their purpose.
10-
11-
Additionally, projects may include a `melos_overrides.yaml` file to override any
12-
`melos.yaml` field. This is useful for making untracked customizations to a
13-
project.
14-
15-
## name
16-
17-
<Warning>Required</Warning>
18-
19-
The name of this project for display purposes within IO environments and IDEs.
20-
21-
```yaml
22-
name: my_project
23-
```
8+
Every workspace requires a `pubspec.yaml` file in the root. The below outlines
9+
all the configurable fields for the `melos` section of the `pubspec.yaml` file.
2410

2511
## repository
2612

2713
The URL of the git repository that contains the Melos workspace.
2814

15+
If this is defined on the top level in the pubspec file you don't have to
16+
define it here, but if it's not just a URL you have to define it in the
17+
`melos` section, since pubspec only supports strings for the repository field.
18+
2919
Supported hosts:
3020

3121
- GitHub
@@ -34,25 +24,27 @@ Supported hosts:
3424
- Azure DevOps (https://dev.azure.com)
3525

3626
```yaml
37-
repository: https://github.com/invertase/melos
27+
melos:
28+
repository: https://github.com/invertase/melos
3829
```
3930
4031
When using a self-hosted GitHub, GitLab, Bitbucket or Azure DevOps instance,
4132
you can specify the repository location like this:
4233
4334
```yaml
44-
repository:
45-
type: gitlab
46-
origin: https://gitlab.example.dev
47-
owner: invertase
48-
name: melos
35+
melos:
36+
repository:
37+
type: gitlab
38+
origin: https://gitlab.example.dev
39+
owner: invertase
40+
name: melos
4941
```
5042
5143
## sdkPath
5244
5345
Path to the Dart/Flutter SDK that should be used.
5446
55-
Relative paths are resolved relative to the `melos.yaml` file.
47+
Relative paths are resolved relative to the root `pubspec.yaml` file.
5648

5749
To use the system-wide SDK, provide the special value "auto".
5850

@@ -61,47 +53,19 @@ highest to lowest is:
6153

6254
1. `--sdk-path` global command line option
6355
2. `MELOS_SDK_PATH` environment variable
64-
3. `sdkPath` in `melos.yaml`
65-
66-
```yaml
67-
sdkPath: .fvm/flutter_sdk
68-
```
69-
70-
## packages
71-
72-
<Warning>Required</Warning>
73-
74-
A list of paths to local packages that are included in the Melos workspace. Each
75-
entry can be a specific path or a [glob] pattern.
76-
77-
```yaml
78-
packages:
79-
# Include the package in the workspace root.
80-
- .
81-
# Include all packages inside the `packages` directory that are direct children.
82-
- packages/*
83-
# Include all packages inside the `packages` directory and all descendants.
84-
- packages/**
85-
```
86-
87-
<Info>
88-
You can also reduce the scope of packages on a per-command basis via the
89-
[`--scope` filter](/filters#--scope) flag.
90-
</Info>
91-
92-
Avoid recursive wildcards (`**`) as they require walking large parts of the
93-
file system and can be slow. If you have packages at multiple levels of depth,
94-
consider using multiple patterns instead:
56+
3. `sdkPath` in the `melos` section in the root `pubspec.yaml`
9557

9658
```yaml
97-
packages:
98-
- packages/*
99-
- packages/*/example
59+
melos:
60+
sdkPath: .fvm/flutter_sdk
10061
```
10162

10263
## ignore
10364

10465
A list of paths to local packages that are excluded from the Melos workspace.
66+
Do note that they are not excluded for the Dart/Flutter tooling, but only for
67+
Melos scripts.
68+
10569
Each entry can be a specific path or a [glob] pattern.
10670

10771
```yaml
@@ -114,19 +78,19 @@ ignore:
11478

11579
Categories are used to group packages together.
11680

117-
To define custom package categories, add a `categories` section in your `melos.yaml` file.
118-
Under this section, you can specify category names as keys, and their corresponding values
119-
should be lists of glob patterns that match the packages you want to include in each category.
81+
To define custom package categories, add a `categories` section in your root
82+
`pubspec.yaml` file. Under this section, you can specify category names as keys,
83+
and their corresponding values should be lists of glob patterns that match the
84+
packages you want to include in each category.
12085

12186
```yaml
122-
# melos.yaml
123-
124-
categories:
125-
examples:
126-
- packages/example*
127-
alpha:
128-
- packages/feature_a/*
129-
- packages/feature_b
87+
melos:
88+
categories:
89+
examples:
90+
- packages/example*
91+
alpha:
92+
- packages/feature_a/*
93+
- packages/feature_b
13094
```
13195

13296
## ide/intellij
@@ -141,9 +105,10 @@ experience when working in a Melos workspace.
141105
The default is `true`.
142106

143107
```yaml
144-
ide:
145-
intellij:
146-
enabled: false
108+
melos:
109+
ide:
110+
intellij:
111+
enabled: false
147112
```
148113

149114
### moduleNamePrefix
@@ -175,8 +140,9 @@ be a specific path or a [glob] pattern.
175140
workspace root.
176141

177142
```yaml
178-
dependencyOverridePaths:
179-
- '../external_project/packages/**'
143+
melos:
144+
dependencyOverridePaths:
145+
- '../external_project/packages/**'
180146
```
181147

182148
### runPubGetInParallel
@@ -242,9 +208,10 @@ If specified, prevents `melos version` from being used inside branches other
242208
than the one specified.
243209

244210
```yaml
245-
command:
246-
version:
247-
branch: main
211+
melos:
212+
command:
213+
version:
214+
branch: main
248215
```
249216

250217
### includeScopes
@@ -253,9 +220,10 @@ Whether to include conventional commit scopes in the generated CHANGELOG.md.
253220
Defaults to `true`.
254221

255222
```yaml
256-
command:
257-
version:
258-
includeScopes: false
223+
melos:
224+
command:
225+
version:
226+
includeScopes: false
259227
```
260228

261229
### includeCommitId
@@ -264,9 +232,10 @@ Whether to add short commit ids to commits (no links) in the CHANGELOG.md that
264232
is generated by `melos version`.
265233

266234
```yaml
267-
command:
268-
version:
269-
includeCommitId: true
235+
melos:
236+
command:
237+
version:
238+
includeCommitId: true
270239
```
271240

272241
### linkToCommits
@@ -278,9 +247,10 @@ Enabling this option, requires
278247
[`repository`](/configuration/overview#repository) to be specified.
279248

280249
```yaml
281-
command:
282-
version:
283-
linkToCommits: false
250+
melos:
251+
command:
252+
version:
253+
linkToCommits: false
284254
```
285255

286256
### workspaceChangelog
@@ -289,9 +259,10 @@ Whether to additionally build a CHANGELOG.md at the root of the workspace when
289259
running `melos version`. Defaults to `true`.
290260

291261
```yaml
292-
command:
293-
version:
294-
workspaceChangelog: false
262+
melos:
263+
command:
264+
version:
265+
workspaceChangelog: false
295266
```
296267

297268
### changelogs
@@ -300,14 +271,15 @@ Configure aggregate changelogs which document the changes made to multiple
300271
packages.
301272

302273
```yaml
303-
command:
304-
version:
305-
changelogs:
306-
- path: FOO_CHANGELOG.md
307-
description: |
308-
All notable changes to foo packages will be documented in this file.
309-
packageFilters:
310-
scope: foo_*
274+
melos:
275+
command:
276+
version:
277+
changelogs:
278+
- path: FOO_CHANGELOG.md
279+
description: |
280+
All notable changes to foo packages will be documented in this file.
281+
packageFilters:
282+
scope: foo_*
311283
```
312284

313285
#### path
@@ -342,9 +314,10 @@ See the
342314
for more information.
343315

344316
```yaml
345-
command:
346-
version:
347-
updateGitTagRefs: true
317+
melos:
318+
command:
319+
version:
320+
updateGitTagRefs: true
348321
```
349322

350323
### releaseUrl
@@ -360,21 +333,23 @@ Whether to fetch tags from the `origin` remote before versioning. Defaults to
360333
`true`.
361334

362335
```yaml
363-
command:
364-
version:
365-
fetchTags: false
336+
melos:
337+
command:
338+
version:
339+
fetchTags: false
366340
```
367341

368342
### changelogCommitBodies
369343

370344
Configuration for including commit bodies in the changelog.
371345

372346
```yaml
373-
command:
374-
version:
375-
changelogCommitBodies:
376-
include: true
377-
onlyBreaking: false
347+
melos:
348+
command:
349+
version:
350+
changelogCommitBodies:
351+
include: true
352+
onlyBreaking: false
378353
```
379354

380355
#### include
@@ -390,10 +365,11 @@ Whether to include only breaking changes in the changelog. Defaults to `true`.
390365
Configure the format of the generated CHANGELOG.md.
391366

392367
```yaml
393-
command:
394-
version:
395-
changelogFormat:
396-
includeDate: true
368+
melos:
369+
command:
370+
version:
371+
changelogFormat:
372+
includeDate: true
397373
```
398374

399375
#### includeDate

0 commit comments

Comments
 (0)