command-line.json 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. /**
  2. * This configuration file defines custom commands for the "rush" command-line.
  3. * More documentation is available on the Rush website: https://rushjs.io
  4. */
  5. {
  6. "$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
  7. /**
  8. * Custom "commands" introduce new verbs for the command-line. To see the help for these
  9. * example commands, try "rush --help", "rush my-bulk-command --help", or
  10. * "rush my-global-command --help".
  11. */
  12. "commands": [
  13. // {
  14. // /**
  15. // * (Required) Determines the type of custom command.
  16. // * Rush's "bulk" commands are invoked separately for each project. Rush will look in
  17. // * each project's package.json file for a "scripts" entry whose name matches the
  18. // * command name. By default, the command will run for every project in the repo,
  19. // * according to the dependency graph (similar to how "rush build" works).
  20. // * The set of projects can be restricted e.g. using the "--to" or "--from" parameters.
  21. // */
  22. // "commandKind": "bulk",
  23. //
  24. // /**
  25. // * (Required) The name that will be typed as part of the command line. This is also the name
  26. // * of the "scripts" hook in the project's package.json file.
  27. // * The name should be comprised of lower case words separated by hyphens or colons. The name should include an
  28. // * English verb (e.g. "deploy"). Use a hyphen to separate words (e.g. "upload-docs"). A group of related commands
  29. // * can be prefixed with a colon (e.g. "docs:generate", "docs:deploy", "docs:serve", etc).
  30. // *
  31. // * Note that if the "rebuild" command is overridden here, it becomes separated from the "build" command
  32. // * and will call the "rebuild" script instead of the "build" script.
  33. // */
  34. // "name": "my-bulk-command",
  35. //
  36. // /**
  37. // * (Required) A short summary of the custom command to be shown when printing command line
  38. // * help, e.g. "rush --help".
  39. // */
  40. // "summary": "Example bulk custom command",
  41. //
  42. // /**
  43. // * A detailed description of the command to be shown when printing command line
  44. // * help (e.g. "rush --help my-command").
  45. // * If omitted, the "summary" text will be shown instead.
  46. // *
  47. // * Whenever you introduce commands/parameters, taking a little time to write meaningful
  48. // * documentation can make a big difference for the developer experience in your repo.
  49. // */
  50. // "description": "This is an example custom command that runs separately for each project",
  51. //
  52. // /**
  53. // * By default, Rush operations acquire a lock file which prevents multiple commands from executing simultaneously
  54. // * in the same repo folder. (For example, it would be a mistake to run "rush install" and "rush build" at the
  55. // * same time.) If your command makes sense to run concurrently with other operations,
  56. // * set "safeForSimultaneousRushProcesses" to true to disable this protection.
  57. // *
  58. // * In particular, this is needed for custom scripts that invoke other Rush commands.
  59. // */
  60. // "safeForSimultaneousRushProcesses": false,
  61. //
  62. // /**
  63. // * (Required) If true, then this command is safe to be run in parallel, i.e. executed
  64. // * simultaneously for multiple projects. Similar to "rush build", regardless of parallelism
  65. // * projects will not start processing until their dependencies have completed processing.
  66. // */
  67. // "enableParallelism": false,
  68. //
  69. // /**
  70. // * Normally projects will be processed according to their dependency order: a given project will not start
  71. // * processing the command until all of its dependencies have completed. This restriction doesn't apply for
  72. // * certain operations, for example a "clean" task that deletes output files. In this case
  73. // * you can set "ignoreDependencyOrder" to true to increase parallelism.
  74. // */
  75. // "ignoreDependencyOrder": false,
  76. //
  77. // /**
  78. // * Normally Rush requires that each project's package.json has a "scripts" entry matching
  79. // * the custom command name. To disable this check, set "ignoreMissingScript" to true;
  80. // * projects with a missing definition will be skipped.
  81. // */
  82. // "ignoreMissingScript": false,
  83. //
  84. // /**
  85. // * When invoking shell scripts, Rush uses a heuristic to distinguish errors from warnings:
  86. // * - If the shell script returns a nonzero process exit code, Rush interprets this as "one or more errors".
  87. // * Error output is displayed in red, and it prevents Rush from attempting to process any downstream projects.
  88. // * - If the shell script returns a zero process exit code but writes something to its stderr stream,
  89. // * Rush interprets this as "one or more warnings". Warning output is printed in yellow, but does NOT prevent
  90. // * Rush from processing downstream projects.
  91. // *
  92. // * Thus, warnings do not interfere with local development, but they will cause a CI job to fail, because
  93. // * the Rush process itself returns a nonzero exit code if there are any warnings or errors. This is by design.
  94. // * In an active monorepo, we've found that if you allow any warnings in your master branch, it inadvertently
  95. // * teaches developers to ignore warnings, which quickly leads to a situation where so many "expected" warnings
  96. // * have accumulated that warnings no longer serve any useful purpose.
  97. // *
  98. // * Sometimes a poorly behaved task will write output to stderr even though its operation was successful.
  99. // * In that case, it's strongly recommended to fix the task. However, as a workaround you can set
  100. // * allowWarningsInSuccessfulBuild=true, which causes Rush to return a nonzero exit code for errors only.
  101. // *
  102. // * Note: The default value is false. In Rush 5.7.x and earlier, the default value was true.
  103. // */
  104. // "allowWarningsInSuccessfulBuild": false,
  105. //
  106. // /**
  107. // * If true then this command will be incremental like the built-in "build" command
  108. // */
  109. // "incremental": false,
  110. //
  111. // /**
  112. // * (EXPERIMENTAL) Normally Rush terminates after the command finishes. If this option is set to "true" Rush
  113. // * will instead enter a loop where it watches the file system for changes to the selected projects. Whenever a
  114. // * change is detected, the command will be invoked again for the changed project and any selected projects that
  115. // * directly or indirectly depend on it.
  116. // *
  117. // * For details, refer to the website article "Using watch mode".
  118. // */
  119. // "watchForChanges": false,
  120. //
  121. // /**
  122. // * (EXPERIMENTAL) Disable cache for this action. This may be useful if this command affects state outside of
  123. // * projects' own folders.
  124. // */
  125. // "disableBuildCache ": false
  126. // },
  127. //
  128. // {
  129. // /**
  130. // * (Required) Determines the type of custom command.
  131. // * Rush's "global" commands are invoked once for the entire repo.
  132. // */
  133. // "commandKind": "global",
  134. //
  135. // "name": "my-global-command",
  136. // "summary": "Example global custom command",
  137. // "description": "This is an example custom command that runs once for the entire repo",
  138. //
  139. // "safeForSimultaneousRushProcesses": false,
  140. //
  141. // /**
  142. // * (Required) A script that will be invoked using the OS shell. The working directory will be
  143. // * the folder that contains rush.json. If custom parameters are associated with this command, their
  144. // * values will be appended to the end of this string.
  145. // */
  146. // "shellCommand": "node common/scripts/my-global-command.js",
  147. //
  148. // /**
  149. // * If your "shellCommand" script depends on NPM packages, the recommended best practice is
  150. // * to make it into a regular Rush project that builds using your normal toolchain. In cases where
  151. // * the command needs to work without first having to run "rush build", the recommended practice
  152. // * is to publish the project to an NPM registry and use common/scripts/install-run.js to launch it.
  153. // *
  154. // * Autoinstallers offer another possibility: They are folders under "common/autoinstallers" with
  155. // * a package.json file and shrinkwrap file. Rush will automatically invoke the package manager to
  156. // * install these dependencies before an associated command is invoked. Autoinstallers have the
  157. // * advantage that they work even in a branch where "rush install" is broken, which makes them a
  158. // * good solution for Git hook scripts. But they have the disadvantages of not being buildable
  159. // * projects, and of increasing the overall installation footprint for your monorepo.
  160. // *
  161. // * The "autoinstallerName" setting must not contain a path and must be a valid NPM package name.
  162. // * For example, the name "my-task" would map to "common/autoinstallers/my-task/package.json", and
  163. // * the "common/autoinstallers/my-task/node_modules/.bin" folder would be added to the shell PATH when
  164. // * invoking the "shellCommand".
  165. // */
  166. // // "autoinstallerName": "my-task"
  167. // }
  168. {
  169. "commandKind": "bulk",
  170. "name": "build",
  171. "summary": "Builds all projects",
  172. "enableParallelism": true,
  173. "incremental": true,
  174. "allowWarningsInSuccessfulBuild": true
  175. },
  176. {
  177. "commandKind": "bulk",
  178. "name": "test",
  179. "summary": "Run Jest tests in each projects",
  180. "ignoreMissingScript": true,
  181. "allowWarningsInSuccessfulBuild": true,
  182. "enableParallelism": true,
  183. "incremental": true
  184. },
  185. {
  186. "commandKind": "bulk",
  187. "name": "build:watch",
  188. "summary": "Watch all libraries",
  189. "ignoreMissingScript": true,
  190. "enableParallelism": true,
  191. "incremental": true,
  192. "watchForChanges": true
  193. },
  194. {
  195. "commandKind": "bulk",
  196. "name": "postinstall",
  197. "summary": "Run all postinstall scripts",
  198. "ignoreMissingScript": true,
  199. "enableParallelism": true,
  200. "ignoreDependencyOrder": true,
  201. "safeForSimultaneousRushProcesses": true
  202. }
  203. ],
  204. /**
  205. * Custom "parameters" introduce new parameters for specified Rush command-line commands.
  206. * For example, you might define a "--production" parameter for the "rush build" command.
  207. */
  208. "parameters": [
  209. // {
  210. // /**
  211. // * (Required) Determines the type of custom parameter.
  212. // * A "flag" is a custom command-line parameter whose presence acts as an on/off switch.
  213. // */
  214. // "parameterKind": "flag",
  215. //
  216. // /**
  217. // * (Required) The long name of the parameter. It must be lower-case and use dash delimiters.
  218. // */
  219. // "longName": "--my-flag",
  220. //
  221. // /**
  222. // * An optional alternative short name for the parameter. It must be a dash followed by a single
  223. // * lower-case or upper-case letter, which is case-sensitive.
  224. // *
  225. // * NOTE: The Rush developers recommend that automation scripts should always use the long name
  226. // * to improve readability. The short name is only intended as a convenience for humans.
  227. // * The alphabet letters run out quickly, and are difficult to memorize, so *only* use
  228. // * a short name if you expect the parameter to be needed very often in everyday operations.
  229. // */
  230. // "shortName": "-m",
  231. //
  232. // /**
  233. // * (Required) A long description to be shown in the command-line help.
  234. // *
  235. // * Whenever you introduce commands/parameters, taking a little time to write meaningful
  236. // * documentation can make a big difference for the developer experience in your repo.
  237. // */
  238. // "description": "A custom flag parameter that is passed to the scripts that are invoked when building projects",
  239. //
  240. // /**
  241. // * (Required) A list of custom commands and/or built-in Rush commands that this parameter may
  242. // * be used with. The parameter will be appended to the shell command that Rush invokes.
  243. // */
  244. // "associatedCommands": ["build", "rebuild"]
  245. // },
  246. //
  247. // {
  248. // /**
  249. // * (Required) Determines the type of custom parameter.
  250. // * A "string" is a custom command-line parameter whose value is a simple text string.
  251. // */
  252. // "parameterKind": "string",
  253. // "longName": "--my-string",
  254. // "description": "A custom string parameter for the \"my-global-command\" custom command",
  255. //
  256. // "associatedCommands": ["my-global-command"],
  257. //
  258. // /**
  259. // * The name of the argument, which will be shown in the command-line help.
  260. // *
  261. // * For example, if the parameter name is '--count" and the argument name is "NUMBER",
  262. // * then the command-line help would display "--count NUMBER". The argument name must
  263. // * be comprised of upper-case letters, numbers, and underscores. It should be kept short.
  264. // */
  265. // "argumentName": "SOME_TEXT",
  266. //
  267. // /**
  268. // * If true, this parameter must be included with the command. The default is false.
  269. // */
  270. // "required": false
  271. // },
  272. //
  273. // {
  274. // /**
  275. // * (Required) Determines the type of custom parameter.
  276. // * A "choice" is a custom command-line parameter whose argument must be chosen from a list of
  277. // * allowable alternatives.
  278. // */
  279. // "parameterKind": "choice",
  280. // "longName": "--my-choice",
  281. // "description": "A custom choice parameter for the \"my-global-command\" custom command",
  282. //
  283. // "associatedCommands": ["my-global-command"],
  284. //
  285. // /**
  286. // * If true, this parameter must be included with the command. The default is false.
  287. // */
  288. // "required": false,
  289. //
  290. // /**
  291. // * Normally if a parameter is omitted from the command line, it will not be passed
  292. // * to the shell command. this value will be inserted by default. Whereas if a "defaultValue"
  293. // * is defined, the parameter will always be passed to the shell command, and will use the
  294. // * default value if unspecified. The value must be one of the defined alternatives.
  295. // */
  296. // "defaultValue": "vanilla",
  297. //
  298. // /**
  299. // * (Required) A list of alternative argument values that can be chosen for this parameter.
  300. // */
  301. // "alternatives": [
  302. // {
  303. // /**
  304. // * A token that is one of the alternatives that can be used with the choice parameter,
  305. // * e.g. "vanilla" in "--flavor vanilla".
  306. // */
  307. // "name": "vanilla",
  308. //
  309. // /**
  310. // * A detailed description for the alternative that can be shown in the command-line help.
  311. // *
  312. // * Whenever you introduce commands/parameters, taking a little time to write meaningful
  313. // * documentation can make a big difference for the developer experience in your repo.
  314. // */
  315. // "description": "Use the vanilla flavor (the default)"
  316. // },
  317. //
  318. // {
  319. // "name": "chocolate",
  320. // "description": "Use the chocolate flavor"
  321. // },
  322. //
  323. // {
  324. // "name": "strawberry",
  325. // "description": "Use the strawberry flavor"
  326. // }
  327. // ]
  328. // }
  329. ]
  330. }