shelljs / shx

Portable Shell Commands for Node
MIT License
1.72k stars 44 forks source link

feat: support for ShellJS plugins #78

Closed nfischer closed 8 years ago

nfischer commented 8 years ago

This adds support for ShellJS plugins. This can be used by creating a config file for shx, .shxrc.json in the root of your package (assuming that you'll be running shx via npm scripts). The file should be formatted as such:

{
  "plugins": [
    "shelljs-plugin-foo"
  ]
}

This will load in the shelljs-plugin-foo plugin. This plugin must be required by the user as a dependency (or dev dependency) in the project, otherwise shx will fail for every command.

Once we officially support ShellJS plugins, we should update the README for shx to show plugin usage instructions.

codecov-io commented 8 years ago

Current coverage is 88.46% (diff: 100%)

Merging #78 into master will increase coverage by 3.46%

@@             master        #78   diff @@
==========================================
  Files             2          2          
  Lines            20         26     +6   
  Methods           0          0          
  Messages          0          0          
  Branches          0          0          
==========================================
+ Hits             17         23     +6   
  Misses            3          3          
  Partials          0          0          

Powered by Codecov. Last update c540bf5...ab4f5e3

levithomason commented 8 years ago

I haven't followed the plugin work closely, been so heads down on TechnologyAdvice/stardust, but this PR looks good otherwise.

I'll leave the sign off to @ariporad

ariporad commented 8 years ago

LGTM

ariporad commented 8 years ago

However, I think it might be a good idea to have some more complex logic such as allowing an shx field in your package.json, or looking for configs in parent directories. But that can defiantly be later.

nfischer commented 8 years ago

However, I think it might be a good idea to have some more complex logic such as allowing an shx field in your package.json, or looking for configs in parent directories. But that can defiantly be later.

@ariporad Sounds fine to me, feel free to add it in. We might also want a way to configure plugins for global installs of shx, so feel free to implement a fix for that too if you like.

levithomason commented 8 years ago

If we want more CLI bootstrapping features, we might want to consider https://www.npmjs.com/package/liftoff