dojo / cli

:rocket: Dojo - command line tooling.
http://dojo.io
Other
25 stars 34 forks source link

Adding ability to specify commands at the command line, issue #125 #152

Closed rorticus closed 7 years ago

rorticus commented 7 years ago

Type: feature

The following has been addressed in the PR:

Description:

Adds an option to specify one or more explicit commands to load. This is helpful if you have a command that is:

Specify the module ID at runtime,

dojo --command=/Projects/dojo2/cli-test-intern/dist/umd/index

Module group and name will be read from command description if available, if not available, they will try to be extracted from the file name (looks for cli-(group)-(name) pattern).

Resolves #125

codecov[bot] commented 7 years ago

Codecov Report

Merging #152 into master will increase coverage by 0.07%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #152      +/-   ##
==========================================
+ Coverage   98.94%   99.01%   +0.07%     
==========================================
  Files          15       15              
  Lines         379      408      +29     
  Branches       46       51       +5     
==========================================
+ Hits          375      404      +29     
  Partials        4        4
Impacted Files Coverage Δ
src/registerCommands.ts 100% <ø> (ø) :arrow_up:
src/config.ts 100% <100%> (ø) :arrow_up:
src/command.ts 100% <100%> (ø) :arrow_up:
src/allCommands.ts 100% <100%> (ø) :arrow_up:
src/loadCommands.ts 97.43% <100%> (+0.13%) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update fe2bcd2...948953c. Read the comment docs.

agubler commented 7 years ago

I would ask, isn't grunt link and npm link not good enough for testing commands in development? Perhaps it's not, just wondering.

rorticus commented 7 years ago

@kitsonk , responded to your feedback!

rorticus commented 7 years ago

@agubler npm link might be enough for working with the @dojo cli commands, but this might still be useful if you ever want to run a command that isn't provided by @dojo, or, maybe one that doesn't even have an npm package because it is part of your local project?

agubler commented 7 years ago

@rorticus would npm link work any module? I am creating a command called dojo-cli-my-custom-module, all I would need to do is npm link in my commands root directory and then npm link dojo-cli-my-custom-module in my project to test it?

rorticus commented 7 years ago

@agubler yeah I think that would work. I wish I could remember the specifics right now, but this ticket was originally put in because testing a certain CLI command was a big pain. There were a couple of different linking steps that had to be done to get the command going, and just being able to specify a path would have greatly simplified things. Maybe that's not an issue anymore.

agubler commented 7 years ago

What is the conclusion here? Does the command line for specifying local commands make sense? Or should we just continue to use linking to test local commands? cc @kitsonk @rorticus @matt-gadd

rorticus commented 7 years ago

I'm ok with just closing this if linking will do the trick.

kitsonk commented 7 years ago

I tend to do linking too and haven't run into any issues.

rorticus commented 7 years ago

Closing this. It sounds like linking will do the trick, so this isn't needed.