1
1
---
2
2
title : Configuration overview
3
- description : Configure Melos using the `melos .yaml` file.
3
+ description : Configure Melos using the `pubspec .yaml` file.
4
4
---
5
5
6
6
# Configuration Overview
7
7
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.
24
10
25
11
## repository
26
12
27
13
The URL of the git repository that contains the Melos workspace.
28
14
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
+
29
19
Supported hosts:
30
20
31
21
- GitHub
@@ -34,25 +24,27 @@ Supported hosts:
34
24
- Azure DevOps (https://dev.azure.com )
35
25
36
26
``` yaml
37
- repository : https://github.com/invertase/melos
27
+ melos :
28
+ repository : https://github.com/invertase/melos
38
29
` ` `
39
30
40
31
When using a self-hosted GitHub, GitLab, Bitbucket or Azure DevOps instance,
41
32
you can specify the repository location like this:
42
33
43
34
` ` ` 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
49
41
` ` `
50
42
51
43
## sdkPath
52
44
53
45
Path to the Dart/Flutter SDK that should be used.
54
46
55
- Relative paths are resolved relative to the ` melos .yaml` file.
47
+ Relative paths are resolved relative to the root ` pubspec .yaml` file.
56
48
57
49
To use the system-wide SDK, provide the special value "auto".
58
50
@@ -61,47 +53,19 @@ highest to lowest is:
61
53
62
54
1. `--sdk-path` global command line option
63
55
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`
95
57
96
58
` ` ` yaml
97
- packages:
98
- - packages/*
99
- - packages/*/example
59
+ melos:
60
+ sdkPath: .fvm/flutter_sdk
100
61
` ` `
101
62
102
63
# # ignore
103
64
104
65
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
+
105
69
Each entry can be a specific path or a [glob] pattern.
106
70
107
71
` ` ` yaml
@@ -114,19 +78,19 @@ ignore:
114
78
115
79
Categories are used to group packages together.
116
80
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.
120
85
121
86
` ` ` 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
130
94
` ` `
131
95
132
96
# # ide/intellij
@@ -141,9 +105,10 @@ experience when working in a Melos workspace.
141
105
The default is `true`.
142
106
143
107
` ` ` yaml
144
- ide:
145
- intellij:
146
- enabled: false
108
+ melos:
109
+ ide:
110
+ intellij:
111
+ enabled: false
147
112
` ` `
148
113
149
114
# ## moduleNamePrefix
@@ -175,8 +140,9 @@ be a specific path or a [glob] pattern.
175
140
workspace root.
176
141
177
142
` ` ` yaml
178
- dependencyOverridePaths:
179
- - '../external_project/packages/**'
143
+ melos:
144
+ dependencyOverridePaths:
145
+ - '../external_project/packages/**'
180
146
` ` `
181
147
182
148
# ## runPubGetInParallel
@@ -242,9 +208,10 @@ If specified, prevents `melos version` from being used inside branches other
242
208
than the one specified.
243
209
244
210
` ` ` yaml
245
- command:
246
- version:
247
- branch: main
211
+ melos:
212
+ command:
213
+ version:
214
+ branch: main
248
215
` ` `
249
216
250
217
# ## includeScopes
@@ -253,9 +220,10 @@ Whether to include conventional commit scopes in the generated CHANGELOG.md.
253
220
Defaults to `true`.
254
221
255
222
` ` ` yaml
256
- command:
257
- version:
258
- includeScopes: false
223
+ melos:
224
+ command:
225
+ version:
226
+ includeScopes: false
259
227
` ` `
260
228
261
229
# ## includeCommitId
@@ -264,9 +232,10 @@ Whether to add short commit ids to commits (no links) in the CHANGELOG.md that
264
232
is generated by `melos version`.
265
233
266
234
` ` ` yaml
267
- command:
268
- version:
269
- includeCommitId: true
235
+ melos:
236
+ command:
237
+ version:
238
+ includeCommitId: true
270
239
` ` `
271
240
272
241
# ## linkToCommits
@@ -278,9 +247,10 @@ Enabling this option, requires
278
247
[`repository`](/configuration/overview#repository) to be specified.
279
248
280
249
` ` ` yaml
281
- command:
282
- version:
283
- linkToCommits: false
250
+ melos:
251
+ command:
252
+ version:
253
+ linkToCommits: false
284
254
` ` `
285
255
286
256
# ## workspaceChangelog
@@ -289,9 +259,10 @@ Whether to additionally build a CHANGELOG.md at the root of the workspace when
289
259
running `melos version`. Defaults to `true`.
290
260
291
261
` ` ` yaml
292
- command:
293
- version:
294
- workspaceChangelog: false
262
+ melos:
263
+ command:
264
+ version:
265
+ workspaceChangelog: false
295
266
` ` `
296
267
297
268
# ## changelogs
@@ -300,14 +271,15 @@ Configure aggregate changelogs which document the changes made to multiple
300
271
packages.
301
272
302
273
` ` ` 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_*
311
283
` ` `
312
284
313
285
# ### path
@@ -342,9 +314,10 @@ See the
342
314
for more information.
343
315
344
316
` ` ` yaml
345
- command:
346
- version:
347
- updateGitTagRefs: true
317
+ melos:
318
+ command:
319
+ version:
320
+ updateGitTagRefs: true
348
321
` ` `
349
322
350
323
# ## releaseUrl
@@ -360,21 +333,23 @@ Whether to fetch tags from the `origin` remote before versioning. Defaults to
360
333
` true` .
361
334
362
335
` ` ` yaml
363
- command:
364
- version:
365
- fetchTags: false
336
+ melos:
337
+ command:
338
+ version:
339
+ fetchTags: false
366
340
` ` `
367
341
368
342
# ## changelogCommitBodies
369
343
370
344
Configuration for including commit bodies in the changelog.
371
345
372
346
` ` ` 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
378
353
` ` `
379
354
380
355
# ### include
@@ -390,10 +365,11 @@ Whether to include only breaking changes in the changelog. Defaults to `true`.
390
365
Configure the format of the generated CHANGELOG.md.
391
366
392
367
` ` ` yaml
393
- command:
394
- version:
395
- changelogFormat:
396
- includeDate: true
368
+ melos:
369
+ command:
370
+ version:
371
+ changelogFormat:
372
+ includeDate: true
397
373
` ` `
398
374
399
375
# ### includeDate
0 commit comments