-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make commands 'context' (directory) aware #885
Comments
Since there isn't a huge amount of acceptance criteria around this, heres my current plan:
Most of the groundwork for this has been done, its just the commands that now all need converting to be context aware, but I wanted to get some feedback before ploughing ahead. @dchambers @james-shaw-turner @leggetter @thecapdan @ioanalianabalas any thoughts on this? |
I'd prefer the final parameter to be the optional context e.g.
Seeing this highlights that the necessity to do Longer term, we should consider doing what I think Grunt and Gulp do - have a global runner which checks to see if there is a local version of the CLI to actually use. More info available on this if required. |
Thats what I've suggested above. It can't be a straightforward argument though since the command arguments are then ambiguous. But we can make it an optional flagged option, e.g.
Yep, agreed. For the time being, assuming only one BRJS instance is on the path, this should work in a reasonably nice way. When we look at the full global install and apps separate from the BRJS install we'll need to refine how this works. |
I really don't like the |
We can achieve it, anything is possible 😄. The thing that makes it more difficult for us is supporting pluggable commands but trying to also augment command arguments from the outside so any model/BRJS concerns don't need to be handled by plugins. Command plugins configure the options they support before a command is even run, and before the context is known. So for example The possible ways to support an optional fifth argument might be:
Theres always the option of not allowing the the context parameter and requiring commands to be run from the correct directory. |
Can't commands just define their last argument as greedy? |
I'm not sure how that would help. We need to know whether the last arg is the context or not so so we can provide that as the context to the plugin. |
Couldn't we leave it up to the plugins to decide whether to use the context If they get their own final greedy argument they use that. If not, they use |
I haven't got time to read any of these, but it seems like we should halt development till after we've had a get together with the following people: @andyberry88, @leggetter, @thecapdan, @james-shaw-turner and myself. |
I'll be available between 3:45 and 4:45 BTW. |
As things currently stand, to create an app, then create a blade within that app, then run the blade tests, I need to run the following commands:
If
If we implemented the context-aware commands proposal I could instead run these commands:
|
There is a slightly more in depth write up here. I suggest we use this issue for and comments/feedback on the proposal since wiki pages don't support comments. |
I don't really care about the create blade etc commands, as I rarely use them. But I would love to be able to do this for running the tests: cd apps/my-app
brjs test libs/my-lib UTs But I shouldn't be forced to |
Change each command so it can take an optional 'context' directory which specifies the directory being acted in. For example
brjs create-blade <app> <bladeset> <blade>
becomesbrjs create-blade myBlade [path/to/bladeset]
. We should also check whether this then allows commands to be run from any directory.The text was updated successfully, but these errors were encountered: