Skip to content

refactor: commands now register themselves#475

Merged
ariporad merged 1 commit intomasterfrom
refactor-register-commands
Jul 22, 2016
Merged

refactor: commands now register themselves#475
ariporad merged 1 commit intomasterfrom
refactor-register-commands

Conversation

@nfischer
Copy link
Copy Markdown
Member

This is based off the plugin API spec. All ShellJS commands now register themselves from within their source file. The only modification that is required to shell.js is to put:

//@include ./src/foo
require('./src/foo');

for a hypothetical new command named foo() implemented inside of src/foo.js.

In a possible future plugin, the //@include would be unnecessary (that's for our internal docs) and the require() statement would be all that is needed by the plugin's end-user. The plugin hypothetically doesn't even need to export anything, because the plugin author can require ShellJS as a peer dependency and modify the existing ShellJS instance using a call to common.register().

Let's wait to merge this until after #452 is merged, since I can quickly resolve the merge conflict. Send feedback my way in the meantime, however.

@ariporad
Copy link
Copy Markdown
Contributor

LGTM!

@ariporad ariporad merged commit 3951a87 into master Jul 22, 2016
@ariporad ariporad deleted the refactor-register-commands branch July 22, 2016 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants