*BREAKING*: Remove support for plugins entirely

There are very few plugins in real-world use, we're not actively working
on this at all, and the current approach won't work once we move to
standalone node-less binary installation anyway.

Change-Type: major
This commit is contained in:
Tim Perry 2017-12-12 17:28:18 +01:00 committed by Cameron Diver
parent 163684e3a9
commit 079ce552e3
No known key found for this signature in database
GPG Key ID: E76D7ACBEE436E12
5 changed files with 7 additions and 61 deletions

View File

@ -81,13 +81,6 @@ _(Typically useful, but not strictly required for all commands)_
Take a look at the full command documentation at [https://docs.resin.io/tools/cli/](https://docs.resin.io/tools/cli/#table-of-contents Take a look at the full command documentation at [https://docs.resin.io/tools/cli/](https://docs.resin.io/tools/cli/#table-of-contents
), or by running `resin help`. ), or by running `resin help`.
---
Plugins
-------
The Resin CLI can be extended with plugins to automate laborious tasks and overall provide a better experience when working with Resin.io. Check the [plugin development tutorial](https://github.com/resin-io/resin-plugin-hello) to learn how to build your own!
FAQ FAQ
--- ---

View File

@ -55,8 +55,6 @@ general = (params, options, done) ->
return command.hidden or command.isWildcard() return command.hidden or command.isWildcard()
groupedCommands = _.groupBy commands, (command) -> groupedCommands = _.groupBy commands, (command) ->
if command.plugin
return 'plugins'
if command.primary if command.primary
return 'primary' return 'primary'
return 'secondary' return 'secondary'
@ -64,10 +62,6 @@ general = (params, options, done) ->
print(parse(groupedCommands.primary)) print(parse(groupedCommands.primary))
if options.verbose if options.verbose
if not _.isEmpty(groupedCommands.plugins)
console.log('\nInstalled plugins:\n')
print(parse(groupedCommands.plugins))
console.log('\nAdditional commands:\n') console.log('\nAdditional commands:\n')
print(parse(groupedCommands.secondary)) print(parse(groupedCommands.secondary))
else else

View File

@ -74,7 +74,6 @@ resin = require('resin-sdk-preconfigured')
actions = require('./actions') actions = require('./actions')
errors = require('./errors') errors = require('./errors')
events = require('./events') events = require('./events')
plugins = require('./utils/plugins')
update = require('./utils/update') update = require('./utils/update')
# Assign bluebird as the global promise library # Assign bluebird as the global promise library
@ -209,15 +208,12 @@ capitano.command(actions.deploy)
update.notify() update.notify()
plugins.register(/^resin-plugin-(.+)$/).then -> cli = capitano.parse(process.argv)
cli = capitano.parse(process.argv) runCommand = ->
if cli.global?.help
runCommand = -> capitanoExecuteAsync(command: "help #{cli.command ? ''}")
if cli.global?.help else
capitanoExecuteAsync(command: "help #{cli.command ? ''}") capitanoExecuteAsync(cli)
else
capitanoExecuteAsync(cli)
Promise.all([events.trackCommand(cli), runCommand()])
Promise.all([events.trackCommand(cli), runCommand()])
.catch(errors.handle) .catch(errors.handle)

View File

@ -1,36 +0,0 @@
/*
Copyright 2016-2017 Resin.io
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import nplugm = require('nplugm');
import _ = require('lodash');
import capitano = require('capitano');
import patterns = require('./patterns');
export function register(regex: RegExp): Promise<void> {
return nplugm
.list(regex)
.map(async function(plugin: any) {
const command = await import(plugin);
command.plugin = true;
if (!_.isArray(command)) {
return capitano.command(command);
}
return _.each(command, capitano.command);
})
.catch((error: Error) => {
return patterns.printErrorMessage(error.message);
});
}

View File

@ -114,7 +114,6 @@
"moment": "^2.12.0", "moment": "^2.12.0",
"mz": "^2.6.0", "mz": "^2.6.0",
"node-cleanup": "^2.1.2", "node-cleanup": "^2.1.2",
"nplugm": "^3.0.0",
"opn": "^5.1.0", "opn": "^5.1.0",
"president": "^2.0.1", "president": "^2.0.1",
"prettyjson": "^1.1.3", "prettyjson": "^1.1.3",