diff --git a/lib/models/plugin-registry.js b/lib/models/plugin-registry.js index 9a33c41b..ae2d71e5 100644 --- a/lib/models/plugin-registry.js +++ b/lib/models/plugin-registry.js @@ -274,8 +274,8 @@ module.exports = CoreObject.extend({ _pluginName: function(addon) { if(addon.name.indexOf('ember-cli-deploy') > -1) { - var pluginNameRegex = /^(ember-cli-deploy-)(.*)$/; - return addon.name.match(pluginNameRegex)[2]; + var pluginNameRegex = /^(@[a-z0-9-~][a-z0-9-._~]*\/)?(ember-cli-deploy-)(.*)$/; + return addon.name.match(pluginNameRegex)[3]; } return addon.name; }, diff --git a/node-tests/unit/models/plugin-registry-test.js b/node-tests/unit/models/plugin-registry-test.js index a7731a3b..73803cb0 100644 --- a/node-tests/unit/models/plugin-registry-test.js +++ b/node-tests/unit/models/plugin-registry-test.js @@ -92,22 +92,27 @@ describe('Plugin Registry', function() { it('accepts plugins with names not starting with ember-cli-deploy and renames those starting with', function() { var validPlugin = makePlugin('foo'); + var otherNamedPlugin = makePlugin('bar'); otherNamedPlugin.name = 'my-other-bar'; + var orgScopedPlugin = makePlugin('baz'); + orgScopedPlugin.name = '@my-org/ember-cli-deploy-baz'; + var project = { name: function() {return 'test-project';}, root: process.cwd(), - addons: [validPlugin, otherNamedPlugin], + addons: [validPlugin, otherNamedPlugin, orgScopedPlugin], }; var registry = new PluginRegistry(project, mockUi, {}); var plugins = registry.pluginInstances(); - expect(plugins.length).to.equal(2); + expect(plugins.length).to.equal(3); expect(plugins[0].name).to.equal('foo'); expect(plugins[1].name).to.equal('my-other-bar'); + expect(plugins[2].name).to.equal('baz'); }); it('returns plugins for addons that have the correct keyword and implement the plugin function', function() {