-
Notifications
You must be signed in to change notification settings - Fork 0
/
melos.yaml
253 lines (241 loc) · 7.17 KB
/
melos.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
name: altoke_bricks_monorepo
repository: https://github.com/mrverdant13/altoke_bricks
packages:
- bricks/*
- bricks/**/brick/hooks
- bricks/**/e2e
- bricks/**/reference
- bricks/**/reference/**
- tools/*
categories:
e2e:
- bricks/**/e2e
hooks:
- bricks/**/brick/hooks
references:
- bricks/**/reference
- bricks/**/reference/**
scopes:
- bricks/*
tools:
- tools/*
command:
bootstrap:
environment:
sdk: ">=3.5.1 <4.0.0"
flutter: ">=3.24.1 <4.0.0"
dependencies:
collection: ^1.19.0
mason: ^0.1.0-dev.59
meta: ^1.15.0
dev_dependencies:
build_runner: ^2.4.12
mason: ^0.1.0-dev.59
melos: ^6.1.0
meta: ^1.15.0
mocktail: ^1.0.4
test: ^1.25.8
very_good_analysis: ^6.0.0
clean:
hooks:
pre:
run: melos run clean
scripts:
# Clean-up
clean:
description: Deep clean up
run: >
git clean --exclude="!android" --exclude="!ios" --exclude="!linux" --exclude="!macos" --exclude="!web" --exclude="!windows" -dfX .
exec:
concurrency: 1
# Code generation
gen:
description: Generate code for a package
run: dart run build_runner build -d
packageFilters:
dependsOn:
- build_runner
exec:
concurrency: 1
failFast: true
orderDependents: true
gen.all:
description: Generate code for all packages
steps:
- gen
gen.all.fast:
description: Generate code for all packages (multi-threaded)
steps:
- melos exec --depends-on=build_runner --order-dependents -- "dart run build_runner build -d"
# Spell checking
spellcheck:
description: Run spell checking for the entire project
run: cspell lint --no-progress -c ./.cspell/cspell.yaml MELOS_ROOT_PATH/**
# Formatting
format:
description: Format a package
run: dart format .
exec:
concurrency: 1
packageFilters:
ignore:
- "*_brick_scope"
format.all:
description: Format all packages
steps:
- format
format.ci:
description: Format all packages (CI)
run: melos exec --ignore="*_brick_scope" --order-dependents --fail-fast -- "dart format --set-exit-if-changed ."
# Analyzing
analyze.dart:
description: Analyze a Dart package
run: dart analyze
packageFilters:
flutter: false
ignore:
- "*_brick_scope"
exec:
concurrency: 1
orderDependents: true
analyze.flutter:
description: Analyze a Flutter package
run: flutter analyze --no-pub
packageFilters:
ignore:
- "*_brick_scope"
flutter: true
exec:
concurrency: 1
orderDependents: true
analyze.custom:
description: Analyze a package with custom lint rules
run: dart run custom_lint
packageFilters:
ignore:
- "*_brick_scope"
dependsOn:
- custom_lint
exec:
concurrency: 1
orderDependents: true
analyze.all:
description: Analyze all packages
steps:
- analyze.dart
- analyze.flutter
# HACK: Avoid issue https://github.com/invertase/dart_custom_lint/issues/268
# - analyze.custom
analyze.ci:
description: Analyze all packages (CI)
steps:
- melos exec --ignore="*_brick_scope" --order-dependents --fail-fast --no-flutter -- "dart analyze --fatal-infos --fatal-warnings"
- melos exec --ignore="*_brick_scope" --order-dependents --fail-fast --flutter -- "flutter analyze --fatal-infos --fatal-warnings --no-pub --no-congratulate --no-preamble"
- melos exec --ignore="*_brick_scope" --order-dependents --fail-fast --depends-on=custom_lint -- "dart run custom_lint --fatal-infos --fatal-warnings"
# Testing & Coverage
test.dart:
description: Test a Dart package
run: >
dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random --color
&&
format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib -b MELOS_PACKAGE_PATH
packageFilters:
flutter: false
dirExists:
- test
dependsOn:
- test
exec:
concurrency: 1
orderDependents: true
test.flutter:
description: Test a Flutter package
run: flutter test -x ci-only --coverage -r expanded --test-randomize-ordering-seed random
packageFilters:
flutter: true
dirExists:
- test
dependsOn:
- flutter_test
exec:
concurrency: 1
orderDependents: true
test.e2e:
description: Run E2E tests
run: dart test e2e --run-skipped -t e2e
packageFilters:
flutter: false
category:
- e2e
fileExists:
- e2e/brick_e2e_test.dart
exec:
concurrency: 1
orderDependents: true
test.e2e.all:
description: Run E2E tests for all packages
steps:
- test.e2e
test.all:
description: Test all packages
steps:
- test.dart
- test.flutter
test.ci:
description: Test all packages (CI)
steps:
- melos exec --order-dependents --fail-fast --no-flutter --dir-exists="test" --depends-on=test -- "dart test -x ci-only --coverage=coverage -r expanded --test-randomize-ordering-seed random && format_coverage --lcov --in=coverage --out=coverage/lcov.info --report-on=lib -b MELOS_PACKAGE_PATH"
- melos exec --order-dependents --fail-fast --flutter --dir-exists="test" --depends-on=flutter_test -- "flutter test -x ci-only --coverage -r expanded --test-randomize-ordering-seed random"
coverage.merge:
description: Merge all packages coverage trace files ignoring data related to generated files
steps:
- coverde rm MELOS_ROOT_PATH/coverage/filtered.lcov.info
- melos exec -c 1 --file-exists=coverage/lcov.info -- "coverde filter --input ./coverage/lcov.info --output MELOS_ROOT_PATH/coverage/filtered.lcov.info --paths-parent MELOS_PACKAGE_PATH --filters \.drift\.dart,\.freezed\.dart,\.g\.dart,\.gr\.dart,\.mapper\.dart"
coverage.check:
description: Check test coverage
steps:
- coverde check -i MELOS_ROOT_PATH/coverage/filtered.lcov.info 100
# Documentation
docs.root:
description: Resolve root README file
steps:
- dart run MELOS_ROOT_PATH/tools/readmes_resolver/lib/reset_root_readme.dart
- melos exec -c 1 --category=scopes -- "dart run MELOS_ROOT_PATH/tools/readmes_resolver/lib/resolve_root_readme.dart"
docs.brick:
description: Resolve brick README files
run: >
dart run MELOS_ROOT_PATH/tools/readmes_resolver/lib/resolve_brick_readme.dart
exec:
concurrency: 1
packageFilters:
category:
- scopes
docs.all:
description: Resolve all README files
steps:
- docs.root
- docs.brick
# Brick management
brick.gen:
description: Generate brick
run: >
dart run MELOS_ROOT_PATH/tools/brick_generator/lib/main.dart
exec:
concurrency: 1
packageFilters:
category:
- scopes
brick.install:
description: Add brick globally
run: dart run MELOS_ROOT_PATH/tools/local_brick_installer/lib/install_local_brick.dart
exec:
concurrency: 1
failFast: true
packageFilters:
category:
- scopes
brick.all:
description: Generate brick and add it globally
steps:
- brick.gen
- brick.install