[rush] Provide override for package.json script executed by bulk commands#2298
Closed
ifeanyiecheruo wants to merge 1 commit intomicrosoft:masterfrom
ifeanyiecheruo:build
Closed
[rush] Provide override for package.json script executed by bulk commands#2298ifeanyiecheruo wants to merge 1 commit intomicrosoft:masterfrom ifeanyiecheruo:build
ifeanyiecheruo wants to merge 1 commit intomicrosoft:masterfrom
ifeanyiecheruo:build
Conversation
Adds a script configuration option for bulk commands that specifies
the package.json script to execute (falls-back to the bulk action name)
If an array of names is specified the first name that matches a scripts
entry in package.json will be executed (falls-back to the bulk action name).
This change also
- updates the default configuration for the builtin build command to have
a script entry of "rush-build"
- updates the default configuration of the built in rebuild command to have
a script entry of ["rush-build", "build"]
This enables a scenario where...
- a package can specify what happens for rush build
- a package can specify what happens rushx build (clean, build)
Without the two behaviors conflicting
"script": {
"build": "heft build --clean",
"rush-build": "heft test --clean",
}
1 task
Contributor
dmichon-msft
left a comment
There was a problem hiding this comment.
I like this in general, just a minor note about the package deps file name for cacheability.
| ignoreMissingScript: this._ignoreMissingScript, | ||
| ignoreDependencyOrder: this._ignoreDependencyOrder, | ||
| packageDepsFilename: Utilities.getPackageDepsFilenameForCommand(this._commandToRun) | ||
| packageDepsFilename: Utilities.getPackageDepsFilenameForCommand(this._commandToRun[0]) |
Contributor
There was a problem hiding this comment.
Ideally this should use the name of the command that actually executed, in case there is a collision between multiple Rush commands.
|
@iclanton this PR is referenced in the official documentation: https://rushjs.io/pages/advanced/watch_mode/#the-watchforchanges-setting-experimental |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proof of concept solution for #2283 (Support customizing CI builds from Dev builds)
Adds a script configuration option for bulk commands that specifies
the package.json script to execute (falls-back to the bulk action name)
If an array of names is specified the first name that matches a scripts
entry in package.json will be executed (falls-back to the bulk action name).
This change also
a script entry of "rush-build"
a script entry of ["rush-build", "build"]
This enables a scenario where...
Without the two behaviors conflicting