Make --scope and --ignore available across commands#8
Conversation
This adds support for: - `bootstrap --scope` - `run --ignore` Also supports `--ignore` in conjunction with `--scope`.
|
@seansfkelley You may be interested in this. |
| buildPackageGraph({scope, ignore}) { | ||
|
|
||
| // TODO: Replace these with a nicer config sieve. | ||
| if (this.constructor.name === "BootstrapCommand") { |
There was a problem hiding this comment.
what about a (static) property on the class with the command name?
There was a problem hiding this comment.
Yeah, that would be a nicer setup. That's what I was getting at with the TODO above.
What I'd like is to be able to specify config for any command, like:
{
"asini": "x.x.x",
"version": "1.2.0",
"commands": {
"bootstrap": {
"ignore": "test-package"
},
}
}Figured I'd leave that for a dedicated patch, though, and do all of the commands at once.
| return file.replace(folder + path.sep, ""); | ||
| }); | ||
|
|
||
| // TODO: Ugh... something about this. |
There was a problem hiding this comment.
So... config for ignore and scope filtration is currently either on the CLI or via publishConfig or bootstrapConfig. I'd like to generalize that to command.<command>.{ignore,scope} or something like that. But... this is filtering in a helper class that is used by multiple commands. Need to figure out what to do about that. Really, it's nice to have asini updated and asini publish agree... so maybe the command.<command>.{ignore,scope} style isn't the right answer?
There was a problem hiding this comment.
perhaps a __GLOBAL__ or all or similar key could be used to apply to all commands?
There was a problem hiding this comment.
Yeah, or even just config at the outer level.
Like:
{
"asini": "x.x.x",
"version": "1.2.0",
"commands": {
"publish": {
"ignore": "test-package"
},
},
"ignore": "irrelevant-package"
}But that still doesn't help with groups of commands that should behave similarly.
Like, I want bootstrap to run on test-package, but I don't want publish to run on it, and I want updated to reflect what publish will do...
Maybe the answer is updated is really just publish --dry-run?
There was a problem hiding this comment.
maybe the config should just be a little more verbose... 😉
There was a problem hiding this comment.
instead of configuring groups, just configure each command independently. more work, but same outcome. unless i'm not understanding what you're trying to do.
There was a problem hiding this comment.
Oh, yeah that makes sense. Maybe I'm just overthinking it. :)
This adds support for:
bootstrap --scoperun --ignoreAlso supports
--ignorein conjunction with--scope.