mirror of
https://github.com/tiktok/sparo.git
synced 2024-11-14 19:35:12 -05:00
Merge pull request #7 from tiktok/chore-command-line
feat: turn on phased commands
This commit is contained in:
commit
e705f50496
2 changed files with 82 additions and 13 deletions
|
@ -175,6 +175,49 @@
|
|||
// */
|
||||
// // "autoinstallerName": "my-task"
|
||||
// }
|
||||
{
|
||||
"commandKind": "phased",
|
||||
"name": "build",
|
||||
"phases": ["_phase:build"]
|
||||
},
|
||||
|
||||
{
|
||||
"commandKind": "phased",
|
||||
"name": "test",
|
||||
"summary": "Builds all projects and runs their tests.",
|
||||
"phases": ["_phase:build", "_phase:test"],
|
||||
"enableParallelism": true,
|
||||
"incremental": true
|
||||
},
|
||||
|
||||
{
|
||||
"commandKind": "phased",
|
||||
"name": "retest",
|
||||
"summary": "Rebuilds all projects and reruns their tests.",
|
||||
"phases": ["_phase:build", "_phase:test"],
|
||||
"enableParallelism": true,
|
||||
"incremental": false
|
||||
},
|
||||
|
||||
{
|
||||
"commandKind": "phased",
|
||||
"name": "start",
|
||||
"summary": "Build all projects, then watch for changes, build and test.",
|
||||
"description": "Build all projects, then watches for changes and builds and runs tests for affected projects.",
|
||||
"safeForSimultaneousRushProcesses": false,
|
||||
|
||||
"enableParallelism": true,
|
||||
"incremental": true,
|
||||
// Initial execution only uses the build phase so that all dependencies of watch phases have been built
|
||||
"phases": ["_phase:build"],
|
||||
"watchOptions": {
|
||||
// Act as though `--watch` is always passed. If false, adds support for passing `--watch`.
|
||||
"alwaysWatch": true,
|
||||
// During watch recompilation run both build and test for affected projects
|
||||
"watchPhases": ["_phase:build", "_phase:test"]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "prettier",
|
||||
"commandKind": "global",
|
||||
|
@ -185,20 +228,25 @@
|
|||
|
||||
// This will invoke common/autoinstallers/rush-prettier/node_modules/.bin/pretty-quick
|
||||
"shellCommand": "pretty-quick --staged"
|
||||
}
|
||||
],
|
||||
|
||||
"phases": [
|
||||
{
|
||||
"name": "_phase:build",
|
||||
"dependencies": {
|
||||
"upstream": ["_phase:build"]
|
||||
},
|
||||
"ignoreMissingScript": true,
|
||||
"allowWarningsOnSuccess": false
|
||||
},
|
||||
{
|
||||
"commandKind": "bulk",
|
||||
"name": "test",
|
||||
"summary": "Bulk test script",
|
||||
"description": "This is an command that runs test script separately for each project",
|
||||
"safeForSimultaneousRushProcesses": false,
|
||||
"enableParallelism": true,
|
||||
"ignoreDependencyOrder": false,
|
||||
"ignoreMissingScript": false,
|
||||
"allowWarningsInSuccessfulBuild": false,
|
||||
"incremental": false,
|
||||
"watchForChanges": false,
|
||||
"disableBuildCache": false
|
||||
"name": "_phase:test",
|
||||
"dependencies": {
|
||||
"self": ["_phase:build"]
|
||||
},
|
||||
"ignoreMissingScript": true,
|
||||
"allowWarningsOnSuccess": false
|
||||
}
|
||||
],
|
||||
|
||||
|
@ -420,5 +468,26 @@
|
|||
// }
|
||||
// ]
|
||||
// }
|
||||
{
|
||||
"longName": "--no-color",
|
||||
"parameterKind": "flag",
|
||||
"description": "disable colors in the build log, defaults to 'true'",
|
||||
"associatedPhases": ["_phase:build", "_phase:test"],
|
||||
"associatedCommands": ["build", "rebuild", "test", "retest"]
|
||||
},
|
||||
{
|
||||
"longName": "--update-snapshots",
|
||||
"parameterKind": "flag",
|
||||
"description": "Update Jest snapshots",
|
||||
"associatedPhases": ["_phase:test"],
|
||||
"associatedCommands": ["test", "retest"]
|
||||
},
|
||||
{
|
||||
"longName": "--production",
|
||||
"parameterKind": "flag",
|
||||
"description": "Perform a production build, including minification and localization steps",
|
||||
"associatedPhases": ["_phase:build", "_phase:test"],
|
||||
"associatedCommands": ["build", "rebuild", "test", "retest"]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
* If true, the phased commands feature is enabled. To use this feature, create a "phased" command
|
||||
* in common/config/rush/command-line.json.
|
||||
*/
|
||||
// "phasedCommands": true,
|
||||
"phasedCommands": true
|
||||
|
||||
/**
|
||||
* If true, perform a clean install after when running `rush install` or `rush update` if the
|
||||
|
|
Loading…
Reference in a new issue