cli-engine
cli-engine copied to clipboard
improved command loading
Command loading could be improved in 2 ways. First, every plugin has to manually require each command or otherwise do something involving klaw
to find every .js file in the commands directory. This is unneeded boilerplate I think we could do with out for either scenario.
Also, right now when a plugin is loaded it must require()
every command in the plugin. Ideally we could instead use some kind of introspection to find all the commands in a plugin that follow a convention (sort of like how rails files work).
So if you had commands such as (the babel-generated) ./lib/commands/foo/bar.js
it shouldn't have to be referenced in an index file. The CLI could list out all the js files under lib/commands
. Then during plugin loading we could just require the command about to be run, not all the commands in the CLI improving load times.
+1
For reference, you can improve your plugin's performance by following this lazy loaded command example.
No changes to cli-engine
needed for now.
Moving to open w/ hopes-and-dreams re: file name conventions