Skip to content

Make --scope and --ignore available across commands#8

Merged
gigabo merged 1 commit intoasini:masterfrom
gigabo:filter
Sep 19, 2016
Merged

Make --scope and --ignore available across commands#8
gigabo merged 1 commit intoasini:masterfrom
gigabo:filter

Conversation

@gigabo
Copy link
Copy Markdown
Contributor

@gigabo gigabo commented Sep 19, 2016

This adds support for:

  • bootstrap --scope
  • run --ignore

Also supports --ignore in conjunction with --scope.

This adds support for:

- `bootstrap --scope`
- `run --ignore`

Also supports `--ignore` in conjunction with `--scope`.
@gigabo
Copy link
Copy Markdown
Contributor Author

gigabo commented Sep 19, 2016

@seansfkelley You may be interested in this.

Comment thread src/Repository.js
buildPackageGraph({scope, ignore}) {

// TODO: Replace these with a nicer config sieve.
if (this.constructor.name === "BootstrapCommand") {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what about a (static) property on the class with the command name?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this about?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perhaps a __GLOBAL__ or all or similar key could be used to apply to all commands?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe the config should just be a little more verbose... 😉

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do you mean?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yeah that makes sense. Maybe I'm just overthinking it. :)

Copy link
Copy Markdown
Contributor

@rygine rygine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants