Merge pull request #7 from tiktok/chore-command-line

feat: turn on phased commands
This commit is contained in:
Cheng Liu 2024-02-21 16:23:35 -08:00 committed by GitHub
commit e705f50496
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 82 additions and 13 deletions

View file

@ -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"]
}
]
}

View file

@ -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