-
Notifications
You must be signed in to change notification settings - Fork 1
/
command-line.json
386 lines (377 loc) · 19.4 KB
/
command-line.json
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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
/**
* This configuration file defines custom commands for the "rush" command-line.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
/**
* Custom "commands" introduce new verbs for the command-line. To see the help for these
* example commands, try "rush --help", "rush my-bulk-command --help", or
* "rush my-global-command --help".
*/
"commands": [
// {
// /**
// * (Required) Determines the type of custom command.
// * Rush's "bulk" commands are invoked separately for each project. Rush will look in
// * each project's package.json file for a "scripts" entry whose name matches the
// * command name. By default, the command will run for every project in the repo,
// * according to the dependency graph (similar to how "rush build" works).
// * The set of projects can be restricted e.g. using the "--to" or "--from" parameters.
// */
// "commandKind": "bulk",
//
// /**
// * (Required) The name that will be typed as part of the command line. This is also the name
// * of the "scripts" hook in the project's package.json file.
// * The name should be comprised of lower case words separated by hyphens or colons. The name should include an
// * English verb (e.g. "deploy"). Use a hyphen to separate words (e.g. "upload-docs"). A group of related commands
// * can be prefixed with a colon (e.g. "docs:generate", "docs:deploy", "docs:serve", etc).
// *
// * Note that if the "rebuild" command is overridden here, it becomes separated from the "build" command
// * and will call the "rebuild" script instead of the "build" script.
// */
// "name": "my-bulk-command",
//
// /**
// * (Required) A short summary of the custom command to be shown when printing command line
// * help, e.g. "rush --help".
// */
// "summary": "Example bulk custom command",
//
// /**
// * A detailed description of the command to be shown when printing command line
// * help (e.g. "rush --help my-command").
// * If omitted, the "summary" text will be shown instead.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "This is an example custom command that runs separately for each project",
//
// /**
// * By default, Rush operations acquire a lock file which prevents multiple commands from executing simultaneously
// * in the same repo folder. (For example, it would be a mistake to run "rush install" and "rush build" at the
// * same time.) If your command makes sense to run concurrently with other operations,
// * set "safeForSimultaneousRushProcesses" to true to disable this protection.
// *
// * In particular, this is needed for custom scripts that invoke other Rush commands.
// */
// "safeForSimultaneousRushProcesses": false,
//
// /**
// * (Required) If true, then this command is safe to be run in parallel, i.e. executed
// * simultaneously for multiple projects. Similar to "rush build", regardless of parallelism
// * projects will not start processing until their dependencies have completed processing.
// */
// "enableParallelism": false,
//
// /**
// * Normally projects will be processed according to their dependency order: a given project will not start
// * processing the command until all of its dependencies have completed. This restriction doesn't apply for
// * certain operations, for example a "clean" task that deletes output files. In this case
// * you can set "ignoreDependencyOrder" to true to increase parallelism.
// */
// "ignoreDependencyOrder": false,
//
// /**
// * Normally Rush requires that each project's package.json has a "scripts" entry matching
// * the custom command name. To disable this check, set "ignoreMissingScript" to true;
// * projects with a missing definition will be skipped.
// */
// "ignoreMissingScript": false,
//
// /**
// * When invoking shell scripts, Rush uses a heuristic to distinguish errors from warnings:
// * - If the shell script returns a nonzero process exit code, Rush interprets this as "one or more errors".
// * Error output is displayed in red, and it prevents Rush from attempting to process any downstream projects.
// * - If the shell script returns a zero process exit code but writes something to its stderr stream,
// * Rush interprets this as "one or more warnings". Warning output is printed in yellow, but does NOT prevent
// * Rush from processing downstream projects.
// *
// * Thus, warnings do not interfere with local development, but they will cause a CI job to fail, because
// * the Rush process itself returns a nonzero exit code if there are any warnings or errors. This is by design.
// * In an active monorepo, we've found that if you allow any warnings in your master branch, it inadvertently
// * teaches developers to ignore warnings, which quickly leads to a situation where so many "expected" warnings
// * have accumulated that warnings no longer serve any useful purpose.
// *
// * Sometimes a poorly behaved task will write output to stderr even though its operation was successful.
// * In that case, it's strongly recommended to fix the task. However, as a workaround you can set
// * allowWarningsInSuccessfulBuild=true, which causes Rush to return a nonzero exit code for errors only.
// *
// * Note: The default value is false. In Rush 5.7.x and earlier, the default value was true.
// */
// "allowWarningsInSuccessfulBuild": false,
//
// /**
// * If true then this command will be incremental like the built-in "build" command
// */
// "incremental": false,
//
// /**
// * (EXPERIMENTAL) Normally Rush terminates after the command finishes. If this option is set to "true" Rush
// * will instead enter a loop where it watches the file system for changes to the selected projects. Whenever a
// * change is detected, the command will be invoked again for the changed project and any selected projects that
// * directly or indirectly depend on it.
// *
// * For details, refer to the website article "Using watch mode".
// */
// "watchForChanges": false,
//
// /**
// * (EXPERIMENTAL) Disable cache for this action. This may be useful if this command affects state outside of
// * projects' own folders.
// */
// "disableBuildCache": false
// },
//
// {
// /**
// * (Required) Determines the type of custom command.
// * Rush's "global" commands are invoked once for the entire repo.
// */
// "commandKind": "global",
//
// "name": "my-global-command",
// "summary": "Example global custom command",
// "description": "This is an example custom command that runs once for the entire repo",
//
// "safeForSimultaneousRushProcesses": false,
//
// /**
// * (Required) A script that will be invoked using the OS shell. The working directory will be
// * the folder that contains rush.json. If custom parameters are associated with this command, their
// * values will be appended to the end of this string.
// */
// "shellCommand": "node common/scripts/my-global-command.js",
//
// /**
// * If your "shellCommand" script depends on NPM packages, the recommended best practice is
// * to make it into a regular Rush project that builds using your normal toolchain. In cases where
// * the command needs to work without first having to run "rush build", the recommended practice
// * is to publish the project to an NPM registry and use common/scripts/install-run.js to launch it.
// *
// * Autoinstallers offer another possibility: They are folders under "common/autoinstallers" with
// * a package.json file and shrinkwrap file. Rush will automatically invoke the package manager to
// * install these dependencies before an associated command is invoked. Autoinstallers have the
// * advantage that they work even in a branch where "rush install" is broken, which makes them a
// * good solution for Git hook scripts. But they have the disadvantages of not being buildable
// * projects, and of increasing the overall installation footprint for your monorepo.
// *
// * The "autoinstallerName" setting must not contain a path and must be a valid NPM package name.
// * For example, the name "my-task" would map to "common/autoinstallers/my-task/package.json", and
// * the "common/autoinstallers/my-task/node_modules/.bin" folder would be added to the shell PATH when
// * invoking the "shellCommand".
// */
// // "autoinstallerName": "my-task"
// }
/**
* Firebase Emulator suite commands
*/
{
"commandKind": "global",
"name": "emulators:start",
"summary": "DEPRECATED - Starts Firebase emulators for local development.",
"description": "DEPRECATED - Starts Firebase emulators suite, using config from firebase.json in order to set up emulator for each service at its predefined port. Starts Firebase emulator dashboard at http://localhost:4000",
"shellCommand": "echo Deprecated: please use the emulators-start script in the common/scripts directory"
},
{
"commandKind": "global",
"name": "emulators:inspect",
"summary": "DEPRECATED - Starts Firebase emulators for local development with inspect feature.",
"description": "DEPRECATED - Starts Firebase emulators suite, using config from firebase.json, in the same way as 'emulators:start' with added functionality of allowing you to connect with a debugger, for instance chrome from chrome://inspect/#devices or from the VSCode debugger.",
"shellCommand": "echo Deprecated: please use the command emulators-start '--inspect-functions 9229'"
},
/**
* Bulk commands
*/
{
"commandKind": "bulk",
"name": "lint:strict",
"summary": "Run lint all of the packages.",
"description": "Runs 'lint:strict' on all of the packages. If the package doesn't contain 'lint:strict' script, it's silently ignored.",
"enableParallelism": true,
"ignoreMissingScript": true
},
{
"commandKind": "bulk",
"name": "typecheck",
"summary": "Run 'tsc' on all of the packages.",
"description": "Runs 'typecheck' ('tsc' with '--no-emit') on all of the packages. If the package doesn't contain the 'typecheck' script, it's silently ignored.",
"enableParallelism": true,
"ignoreMissingScript": true
},
/**
* Firebase deployment commands
*/
{
"commandKind": "global",
"name": "deploy:eisbuk",
"summary": "Deploys only the staging project (eisbuk), only the client app to Firebase",
"description": "Rather than deploying all of the builds for an eisbuk project, this command is used to deploy only the staging build (eisbuk)",
"shellCommand": "firebase deploy --project eisbuk --only hosting:eisbuk"
},
{
"commandKind": "global",
"name": "deploy:production",
"summary": "Deploys all of the builds to production",
"description": "Using the custom script, we're deploying the entire project to production, expecting a possible functions deletion prompt, to which the canned response is no, as to not affect the automated deployment.",
"shellCommand": "./deploy-firebase.expect"
},
/**
* Firestore backup/restore commands
*/
{
"commandKind": "global",
"safeForSimultaneousRushProcesses": true,
"name": "seed-firestore:igorice",
"summary": "Backs up the production firestore data and seeds the dev emulated firestore with said data (for 'igorice' oranization)",
"description": "Used for debugging purposes on production data: backs up the data from production firestore, using the script in 'packages/backup-restore', stores it in a temp '<repo-root>/firestore-backup' and seeds the local firestore so that we can run debugging sessions without jeopardizing the production data.",
"shellCommand": "mkdir -p firestore-backup && cd firestore-backup && ../packages/backup-restore/dist/cli.js backup --project eisbuk igorice.web.app && curl -X PUT http://127.0.0.1:4400/functions/disableBackgroundTriggers && ../packages/backup-restore/dist/cli.js restore --project eisbuk --emulators igorice.web.app.json && curl -X PUT http://127.0.0.1:4400/functions/enableBackgroundTriggers && echo Done"
},
{
"commandKind": "global",
"safeForSimultaneousRushProcesses": true,
"name": "seed-firestore:eisbuk",
"summary": "Backs up the production firestore data and seeds the dev emulated firestore with said data (for 'eisbuk' oranization)",
"description": "Used for debugging purposes on production data: backs up the data from production firestore, using the script in 'packages/backup-restore', stores it in a temp '<repo-root>/firestore-backup' and seeds the local firestore so that we can run debugging sessions without jeopardizing the production data.",
"shellCommand": "mkdir -p firestore-backup && cd firestore-backup && ../packages/backup-restore/dist/cli.js backup --project eisbuk eisbuk.web.app && curl -X PUT http://127.0.0.1:4400/functions/disableBackgroundTriggers && ../packages/backup-restore/dist/cli.js restore --project eisbuk --emulators eisbuk.web.app.json && curl -X PUT http://127.0.0.1:4400/functions/enableBackgroundTriggers && echo Done"
},
/**
* Pre-commit commands
*/
{
"commandKind": "global",
"name": "lint-staged",
"summary": "Lints the staged files as a pre-commit, also does 'prettier --write' on files after linting",
"autoinstallerName": "lint-staged",
"shellCommand": "lint-staged"
}
],
/**
* Custom "parameters" introduce new parameters for specified Rush command-line commands.
* For example, you might define a "--production" parameter for the "rush build" command.
*/
"parameters": [
// {
// /**
// * (Required) Determines the type of custom parameter.
// * A "flag" is a custom command-line parameter whose presence acts as an on/off switch.
// */
// "parameterKind": "flag",
//
// /**
// * (Required) The long name of the parameter. It must be lower-case and use dash delimiters.
// */
// "longName": "--my-flag",
//
// /**
// * An optional alternative short name for the parameter. It must be a dash followed by a single
// * lower-case or upper-case letter, which is case-sensitive.
// *
// * NOTE: The Rush developers recommend that automation scripts should always use the long name
// * to improve readability. The short name is only intended as a convenience for humans.
// * The alphabet letters run out quickly, and are difficult to memorize, so *only* use
// * a short name if you expect the parameter to be needed very often in everyday operations.
// */
// "shortName": "-m",
//
// /**
// * (Required) A long description to be shown in the command-line help.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "A custom flag parameter that is passed to the scripts that are invoked when building projects",
//
// /**
// * (Required) A list of custom commands and/or built-in Rush commands that this parameter may
// * be used with. The parameter will be appended to the shell command that Rush invokes.
// */
// "associatedCommands": ["build", "rebuild"]
// },
//
// {
// /**
// * (Required) Determines the type of custom parameter.
// * A "string" is a custom command-line parameter whose value is a simple text string.
// */
// "parameterKind": "string",
// "longName": "--my-string",
// "description": "A custom string parameter for the \"my-global-command\" custom command",
//
// "associatedCommands": ["my-global-command"],
//
// /**
// * The name of the argument, which will be shown in the command-line help.
// *
// * For example, if the parameter name is '--count" and the argument name is "NUMBER",
// * then the command-line help would display "--count NUMBER". The argument name must
// * be comprised of upper-case letters, numbers, and underscores. It should be kept short.
// */
// "argumentName": "SOME_TEXT",
//
// /**
// * If true, this parameter must be included with the command. The default is false.
// */
// "required": false
// },
//
// {
// /**
// * (Required) Determines the type of custom parameter.
// * A "choice" is a custom command-line parameter whose argument must be chosen from a list of
// * allowable alternatives.
// */
// "parameterKind": "choice",
// "longName": "--my-choice",
// "description": "A custom choice parameter for the \"my-global-command\" custom command",
//
// "associatedCommands": ["my-global-command"],
//
// /**
// * If true, this parameter must be included with the command. The default is false.
// */
// "required": false,
//
// /**
// * Normally if a parameter is omitted from the command line, it will not be passed
// * to the shell command. this value will be inserted by default. Whereas if a "defaultValue"
// * is defined, the parameter will always be passed to the shell command, and will use the
// * default value if unspecified. The value must be one of the defined alternatives.
// */
// "defaultValue": "vanilla",
//
// /**
// * (Required) A list of alternative argument values that can be chosen for this parameter.
// */
// "alternatives": [
// {
// /**
// * A token that is one of the alternatives that can be used with the choice parameter,
// * e.g. "vanilla" in "--flavor vanilla".
// */
// "name": "vanilla",
//
// /**
// * A detailed description for the alternative that can be shown in the command-line help.
// *
// * Whenever you introduce commands/parameters, taking a little time to write meaningful
// * documentation can make a big difference for the developer experience in your repo.
// */
// "description": "Use the vanilla flavor (the default)"
// },
//
// {
// "name": "chocolate",
// "description": "Use the chocolate flavor"
// },
//
// {
// "name": "strawberry",
// "description": "Use the strawberry flavor"
// }
// ]
// }
]
}