bolt icon indicating copy to clipboard operation
bolt copied to clipboard

bolt changed command

Open lukebatchelor opened this issue 7 years ago • 3 comments

We were discussing some ideas of how this might work in the Skate repo. The idea would be to return a list of packages that had changed since master

We think it would look something like:

$ bolt changed
@scope/foo
@scope/bar
zee

but would support a couple of flags

$ bolt changed --glob
(@scope/foo|@scope/bar|zee)
$ bolt changed --fs
packages/elements/foo
packages/fabric/bar
packages/zee
$ bolt changed --json
["@scope/foo", "@scope/bar", "zee"]

This would allow you to make some really nice commands such as

# build only changed packages
BABEL_ENV=es bolt ws --only "$(bolt changed --glob)" exec  -- babel src --out-dir es

lukebatchelor avatar Nov 30 '17 23:11 lukebatchelor

If I have got it correct,

list of files that had changed since master ~= git diff `(git rev-parse master)` --name-only

and then create support for flags. Have I got it correct?

ajaymathur avatar Dec 07 '17 09:12 ajaymathur

Changed files since master would look more like

git diff $(git merge-base master HEAD) --name-only

Which is equivalent to

git diff master...HEAD
# possibly `git diff $(git rev-parse master)...HEAD`
# (not at a terminal to double check)

This should be trivial to expose once bolt version lands. It has a bunch of git methods that will do this.

lukebatchelor avatar Jan 17 '18 11:01 lukebatchelor

So instead of this I think we should make changed a subcommand like workspaces or project.

bolt changed list
bolt changed install
bolt changed run [script]
bolt changed exec -- [...args]
bolt changed [script]

jamiebuilds avatar Feb 06 '18 00:02 jamiebuilds