microsoft/typespec
Publicmirrored from https://github.com/microsoft/typespecAvailable
common/config/rush/command-line.json
205lines · modecode
| 1 | /** |
| 2 | * This configuration file defines custom commands for the "rush" command-line. |
| 3 | * For full documentation, please see 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 | "commandKind": "global", |
| 15 | "safeForSimultaneousRushProcesses": true, |
| 16 | "name": "watch", |
| 17 | "summary": "(CUSTOM) Runs TypeScript compiler in watch mode on all projects.", |
| 18 | "shellCommand": "node eng/scripts/watch.js" |
| 19 | }, |
| 20 | { |
| 21 | "commandKind": "global", |
| 22 | "name": "test", |
| 23 | "summary": "(CUSTOM) Runs all tests.", |
| 24 | "shellCommand": "node eng/scripts/npm-run.js test" |
| 25 | }, |
| 26 | { |
| 27 | "commandKind": "global", |
| 28 | "name": "test-official", |
| 29 | "summary": "(CUSTOM) Runs all tests for CI or PR validation. Disallows .only.", |
| 30 | "shellCommand": "node eng/scripts/npm-run.js test-official" |
| 31 | }, |
| 32 | { |
| 33 | "commandKind": "global", |
| 34 | "safeForSimultaneousRushProcesses": true, |
| 35 | "name": "merge-coverage", |
| 36 | "summary": "(CUSTOM) Merge the coverage reports generated by running `rush test-official`", |
| 37 | "shellCommand": "npx istanbul report --include **/coverage/**/coverage-final.json cobertura text" |
| 38 | }, |
| 39 | { |
| 40 | "commandKind": "global", |
| 41 | "name": "format", |
| 42 | "summary": "(CUSTOM) Formats all code with Prettier.", |
| 43 | "shellCommand": "node eng/scripts/format.js" |
| 44 | }, |
| 45 | { |
| 46 | "commandKind": "global", |
| 47 | "name": "check-format", |
| 48 | "summary": "(CUSTOM) Checks formatting of all code with with Prettier.", |
| 49 | "shellCommand": "node eng/scripts/check-format.js" |
| 50 | }, |
| 51 | { |
| 52 | "commandKind": "global", |
| 53 | "name": "regen-docs", |
| 54 | "summary": "(CUSTOM) Regenerate the reference docs.", |
| 55 | "shellCommand": "node eng/scripts/npm-run.js regen-ref-docs" |
| 56 | }, |
| 57 | { |
| 58 | "commandKind": "global", |
| 59 | "name": "regen-samples", |
| 60 | "summary": "(CUSTOM) Regenerate samples.", |
| 61 | "shellCommand": "node eng/scripts/npm-run.js regen-samples" |
| 62 | }, |
| 63 | { |
| 64 | "commandKind": "global", |
| 65 | "name": "update-latest-docs", |
| 66 | "summary": "(CUSTOM) Copy the current docs to the latest.", |
| 67 | "shellCommand": "node eng/scripts/npm-run.js update-latest-docs" |
| 68 | }, |
| 69 | { |
| 70 | "commandKind": "global", |
| 71 | "name": "cspell", |
| 72 | "summary": "(CUSTOM) Check spelling.", |
| 73 | "shellCommand": "node eng/scripts/cspell.js" |
| 74 | }, |
| 75 | { |
| 76 | "commandKind": "global", |
| 77 | "safeForSimultaneousRushProcesses": true, |
| 78 | "name": "dogfood", |
| 79 | "summary": "(CUSTOM) Globally installs local builds of @typespec/compiler and typespec-vscode.", |
| 80 | "shellCommand": "node eng/scripts/dogfood.js" |
| 81 | }, |
| 82 | { |
| 83 | "commandKind": "bulk", |
| 84 | "name": "lint", |
| 85 | "summary": "Lint projects. Runs `npm run lint` on all projects.", |
| 86 | "enableParallelism": true, |
| 87 | "ignoreMissingScript": true |
| 88 | }, |
| 89 | { |
| 90 | "commandKind": "bulk", |
| 91 | "name": "lint:fix", |
| 92 | "summary": "Fix lint issues in projects. Runs `npm run lint:fix` on all projects.", |
| 93 | "enableParallelism": true, |
| 94 | "ignoreMissingScript": true |
| 95 | }, |
| 96 | { |
| 97 | "commandKind": "global", |
| 98 | "safeForSimultaneousRushProcesses": true, |
| 99 | "name": "e2e", |
| 100 | "summary": "(CUSTOM) Runs the e2e tests", |
| 101 | "shellCommand": "node e2e/e2e-tests.js" |
| 102 | }, |
| 103 | { |
| 104 | "commandKind": "bulk", |
| 105 | "name": "clean", |
| 106 | "summary": "(CUSTOM) Run `npm run clean` on all the projects.", |
| 107 | "enableParallelism": true, |
| 108 | "ignoreMissingScript": true |
| 109 | } |
| 110 | ], |
| 111 | /** |
| 112 | * Custom "parameters" introduce new parameters for specified Rush command-line commands. |
| 113 | * For example, you might define a "--production" parameter for the "rush build" command. |
| 114 | */ |
| 115 | "parameters": [ |
| 116 | // { |
| 117 | // /** |
| 118 | // * (Required) Determines the type of custom parameter. |
| 119 | // * A "flag" is a custom command-line parameter whose presence acts as an on/off switch. |
| 120 | // */ |
| 121 | // "parameterKind": "flag", |
| 122 | // |
| 123 | // /** |
| 124 | // * (Required) The long name of the parameter. It must be lower-case and use dash delimiters. |
| 125 | // */ |
| 126 | // "longName": "--my-flag", |
| 127 | // |
| 128 | // /** |
| 129 | // * An optional alternative short name for the parameter. It must be a dash followed by a single |
| 130 | // * lower-case or upper-case letter, which is case-sensitive. |
| 131 | // * |
| 132 | // * NOTE: The Rush developers recommend that automation scripts should always use the long name |
| 133 | // * to improve readability. The short name is only intended as a convenience for humans. |
| 134 | // * The alphabet letters run out quickly, and are difficult to memorize, so *only* use |
| 135 | // * a short name if you expect the parameter to be needed very often in everyday operations. |
| 136 | // */ |
| 137 | // "shortName": "-m", |
| 138 | // |
| 139 | // /** |
| 140 | // * (Required) A long description to be shown in the command-line help. |
| 141 | // * |
| 142 | // * Whenever you introduce commands/parameters, taking a little time to write meaningful |
| 143 | // * documentation can make a big difference for the developer experience in your repo. |
| 144 | // */ |
| 145 | // "description": "A custom flag parameter that is passed to the scripts that are invoked when building projects", |
| 146 | // |
| 147 | // /** |
| 148 | // * (Required) A list of custom commands and/or built-in Rush commands that this parameter may |
| 149 | // * be used with. The parameter will be appended to the shell command that Rush invokes. |
| 150 | // */ |
| 151 | // "associatedCommands": [ "build", "rebuild" ] |
| 152 | // }, |
| 153 | // |
| 154 | // { |
| 155 | // /** |
| 156 | // * (Required) Determines the type of custom parameter. |
| 157 | // * A "flag" is a custom command-line parameter whose presence acts as an on/off switch. |
| 158 | // */ |
| 159 | // "parameterKind": "choice", |
| 160 | // "longName": "--my-choice", |
| 161 | // "description": "A custom choice parameter for the \"my-global-command\" custom command", |
| 162 | // |
| 163 | // "associatedCommands": [ "my-global-command" ], |
| 164 | // |
| 165 | // /** |
| 166 | // * Normally if a parameter is omitted from the command line, it will not be passed |
| 167 | // * to the shell command. this value will be inserted by default. Whereas if a "defaultValue" |
| 168 | // * is defined, the parameter will always be passed to the shell command, and will use the |
| 169 | // * default value if unspecified. The value must be one of the defined alternatives. |
| 170 | // */ |
| 171 | // "defaultValue": "vanilla", |
| 172 | // |
| 173 | // /** |
| 174 | // * (Required) A list of alternative argument values that can be chosen for this parameter. |
| 175 | // */ |
| 176 | // "alternatives": [ |
| 177 | // { |
| 178 | // /** |
| 179 | // * A token that is one of the alternatives that can be used with the choice parameter, |
| 180 | // * e.g. "vanilla" in "--flavor vanilla". |
| 181 | // */ |
| 182 | // "name": "vanilla", |
| 183 | // |
| 184 | // /** |
| 185 | // * A detailed description for the alternative that can be shown in the command-line help. |
| 186 | // * |
| 187 | // * Whenever you introduce commands/parameters, taking a little time to write meaningful |
| 188 | // * documentation can make a big difference for the developer experience in your repo. |
| 189 | // */ |
| 190 | // "description": "Use the vanilla flavor (the default)" |
| 191 | // }, |
| 192 | // |
| 193 | // { |
| 194 | // "name": "chocolate", |
| 195 | // "description": "Use the chocolate flavor" |
| 196 | // }, |
| 197 | // |
| 198 | // { |
| 199 | // "name": "strawberry", |
| 200 | // "description": "Use the strawberry flavor" |
| 201 | // } |
| 202 | // ] |
| 203 | // } |
| 204 | ] |
| 205 | } |
| 206 | |