-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
examples.ts
362 lines (361 loc) · 12.1 KB
/
examples.ts
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
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
export interface Example {
command: string;
description: string;
}
export const examples: Record<string, Example[]> = {
'print-affected': [
{
command: 'print-affected',
description:
'Print information about affected projects and the project graph',
},
{
command: 'print-affected --base=main --head=HEAD',
description:
'Print information about the projects affected by the changes between main and HEAD (e.g,. PR)',
},
{
command: 'print-affected --target=test',
description:
'Prints information about the affected projects and a list of tasks to test them',
},
{
command: 'print-affected --target=build --select=projects',
description:
'Prints the projects property from the print-affected output',
},
{
command: 'print-affected --target=build --select=tasks.target.project',
description:
'Prints the tasks.target.project property from the print-affected output',
},
],
affected: [
{
command: 'affected --target=custom-target',
description: 'Run custom target for all affected projects',
},
{
command: 'affected --target=test --parallel=5',
description: 'Run tests in parallel',
},
{
command: 'affected --target=test --all',
description: 'Run the test target for all projects',
},
{
command: 'affected --target=test --files=libs/mylib/src/index.ts',
description:
'Run tests for all the projects affected by changing the index.ts file',
},
{
command: 'affected --target=test --base=main --head=HEAD',
description:
'Run tests for all the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected --target=test --base=main~1 --head=main',
description:
'Run tests for all the projects affected by the last commit on main',
},
{
command: 'affected --target=build --tag=$NX_TARGET_TASK_PROJECT:latest',
description: 'Use the currently executing project name in your command.',
},
],
'affected:test': [
{
command: 'affected:test --parallel=5',
description: 'Run tests in parallel',
},
{
command: 'affected:test --all',
description: 'Run the test target for all projects',
},
{
command: 'affected:test --files=libs/mylib/src/index.ts',
description:
'Run tests for all the projects affected by changing the index.ts file',
},
{
command: 'affected:test --base=main --head=HEAD',
description:
'Run tests for all the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:test --base=main~1 --head=main',
description:
'Run tests for all the projects affected by the last commit on main',
},
],
'affected:build': [
{
command: 'affected:build --parallel=5',
description: 'Run build in parallel',
},
{
command: 'affected:build --all',
description: 'Run the build target for all projects',
},
{
command: 'affected:build --files=libs/mylib/src/index.ts',
description:
'Run build for all the projects affected by changing the index.ts file',
},
{
command: 'affected:build --base=main --head=HEAD',
description:
'Run build for all the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:build --base=main~1 --head=main',
description:
'Run build for all the projects affected by the last commit on main',
},
],
'affected:e2e': [
{
command: 'affected:e2e --parallel=5',
description: 'Run tests in parallel',
},
{
command: 'affected:e2e --all',
description: 'Run the test target for all projects',
},
{
command: 'affected:e2e --files=libs/mylib/src/index.ts',
description:
'Run tests for all the projects affected by changing the index.ts file',
},
{
command: 'affected:e2e --base=main --head=HEAD',
description:
'Run tests for all the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:e2e --base=main~1 --head=main',
description:
'Run tests for all the projects affected by the last commit on main',
},
],
'affected:lint': [
{
command: 'affected:lint --parallel=5',
description: 'Run lint in parallel',
},
{
command: 'affected:lint --all',
description: 'Run the lint target for all projects',
},
{
command: 'affected:lint --files=libs/mylib/src/index.ts',
description:
'Run lint for all the projects affected by changing the index.ts file',
},
{
command: 'affected:lint --base=main --head=HEAD',
description:
'Run lint for all the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:lint --base=main~1 --head=main',
description:
'Run lint for all the projects affected by the last commit on main',
},
],
'affected:apps': [
{
command: 'affected:apps --files=libs/mylib/src/index.ts',
description:
'Print the names of all the apps affected by changing the index.ts file',
},
{
command: 'affected:apps --base=main --head=HEAD',
description:
'Print the names of all the apps affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:apps --base=main~1 --head=main',
description:
'Print the names of all the apps affected by the last commit on main',
},
],
'affected:libs': [
{
command: 'affected:libs --files=libs/mylib/src/index.ts',
description:
'Print the names of all the libs affected by changing the index.ts file',
},
{
command: 'affected:libs --base=main --head=HEAD',
description:
'Print the names of all the libs affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:libs --base=main~1 --head=main',
description:
'Print the names of all the libs affected by the last commit on main',
},
],
'format:write': [],
'format:check': [],
graph: [
{
command: 'graph',
description: 'Open the project graph of the workspace in the browser',
},
{
command: 'graph --file=output.json',
description: 'Save the project graph into a json file',
},
{
command: 'graph --file=output.html',
description:
'Generate a static website with project graph into an html file, accompanied by an asset folder called static',
},
{
command: 'graph --focus=todos-feature-main',
description:
'Show the graph where every node is either an ancestor or a descendant of todos-feature-main',
},
{
command: 'graph --include=project-one,project-two',
description: 'Include project-one and project-two in the project graph',
},
{
command: 'graph --exclude=project-one,project-two',
description: 'Exclude project-one and project-two from the project graph',
},
{
command:
'graph --focus=todos-feature-main --exclude=project-one,project-two',
description:
'Show the graph where every node is either an ancestor or a descendant of todos-feature-main, but exclude project-one and project-two',
},
{
command: 'graph --watch',
description: 'Watch for changes to project graph and update in-browser',
},
],
'affected:graph': [
{
command: 'affected:graph --files=libs/mylib/src/index.ts',
description:
'Open the project graph of the workspace in the browser, and highlight the projects affected by changing the index.ts file',
},
{
command: 'affected:graph --base=main --head=HEAD',
description:
'Open the project graph of the workspace in the browser, and highlight the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:graph --base=main --head=HEAD --file=output.json',
description:
'Save the project graph of the workspace in a json file, and highlight the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:graph --base=main --head=HEAD --file=output.html',
description:
'Generate a static website with project graph data in an html file, highlighting the projects affected by the changes between main and HEAD (e.g., PR)',
},
{
command: 'affected:graph --base=main~1 --head=main',
description:
'Open the project graph of the workspace in the browser, and highlight the projects affected by the last commit on main',
},
{
command: 'affected:graph --exclude=project-one,project-two',
description:
'Open the project graph of the workspace in the browser, highlight the projects affected, but exclude project-one and project-two',
},
],
'workspace-generator': [],
list: [
{
command: 'list',
description: 'List the plugins installed in the current workspace',
},
{
command: 'list @nrwl/web',
description:
'List the generators and executors available in the `@nrwl/web` plugin if it is installed (If the plugin is not installed `nx` will show advice on how to add it to your workspace)',
},
],
'run-many': [
{
command: 'run-many --target=test',
description: 'Test all projects',
},
{
command: 'run-many --target=test --projects=proj1,proj2',
description: 'Test proj1 and proj2',
},
{
command: 'run-many --target=test --projects=proj1,proj2 --parallel=2',
description: 'Test proj1 and proj2 in parallel',
},
{
command: 'run-many --target=test --projects=*-app --exclude excluded-app',
description:
'Test all projects ending with `*-app` except `excluded-app`',
},
],
migrate: [
{
command: 'migrate next',
description:
'Update @nrwl/workspace to "next". This will update other packages and will generate migrations.json',
},
{
command: 'migrate 9.0.0',
description:
'Update @nrwl/workspace to "9.0.0". This will update other packages and will generate migrations.json',
},
{
command:
'migrate @nrwl/workspace@9.0.0 --from="@nrwl/workspace@8.0.0,@nrwl/node@8.0.0"',
description:
'Update @nrwl/workspace and generate the list of migrations starting with version 8.0.0 of @nrwl/workspace and @nrwl/node, regardless of what installed locally',
},
{
command:
'migrate @nrwl/workspace@9.0.0 --to="@nrwl/react@9.0.1,@nrwl/angular@9.0.1"',
description:
'Update @nrwl/workspace to "9.0.0". If it tries to update @nrwl/react or @nrwl/angular, use version "9.0.1"',
},
{
command: 'migrate another-package@12.0.0',
description:
'Update another-package to "12.0.0". This will update other packages and will generate migrations.json file',
},
{
command: 'migrate --run-migrations=migrations.json',
description:
'Run migrations from the provided migrations.json file. You can modify migrations.json and run this command many times',
},
{
command: 'migrate --run-migrations --create-commits',
description:
'Create a dedicated commit for each successfully completed migration. You can customize the prefix used for each commit by additionally setting --commit-prefix="PREFIX_HERE "',
},
],
watch: [
{
command:
'watch --projects=app -- echo \\$NX_PROJECT_NAME \\$NX_FILE_CHANGES',
description:
'Watch the "app" project and echo the project name and the files that changed',
},
{
command:
'watch --projects=app1,app2 --includeDependencies -- echo \\$NX_PROJECT_NAME',
description:
'Watch "app1" and "app2" and echo the project name whenever a specified project or its dependencies change',
},
{
command: 'watch --all -- echo \\$NX_PROJECT_NAME',
description:
'Watch all projects (including newly created projects) in the workspace',
},
],
};