Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removing info, ls, link, unlink #155

Merged
merged 2 commits into from
Nov 26, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 0 additions & 34 deletions cli/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ module.exports = {
}
},

info: { help: 'Shows installed components on the current project' },

init: {
help: 'Creates a new empty component in the current folder',
options: {
Expand All @@ -32,29 +30,6 @@ module.exports = {
}
},

link: {
help: 'Links a component in the current project',
options: {
componentName: {
help: 'The name of the component to link. <oc ls> to see the list of available components'
},
componentVersion: {
help: 'The specific version of the component to link. Default is the latest',
required: false
}
}
},

ls: {
help: 'Shows the list of the available components for a linked oc registry',
options: {
registry: {
help: 'Specify registry to query',
required: false
}
}
},

mock: {
help: 'Allows to mock configuration in order to facilitate local development',
options: {
Expand Down Expand Up @@ -101,15 +76,6 @@ module.exports = {
}
},

unlink: {
help: 'Unlinks a component from the current project',
options: {
componentName: {
help: 'The name of the component to unlink. <oc info> to see the list of linked components'
}
}
},

version: {
help: 'Shows the cli version',
flag: true
Expand Down
48 changes: 0 additions & 48 deletions cli/domain/link.js

This file was deleted.

11 changes: 1 addition & 10 deletions cli/domain/local.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
'use strict';

var fs = require('fs-extra');
var colors = require('colors');
var path = require('path');
var Targz = require('tar.gz');
var _ = require('underscore');

var getComponentsByDir = require('./get-components-by-dir');
var getLocalNpmModules = require('./get-local-npm-modules');
var link = require('./link');
var packageComponents = require('./package-components');
var mock = require('./mock');
var settings = require('../../resources/settings');
var validator = require('../../registry/domain/validators');
var unlink = require('./unlink');

module.exports = function(dependencies){
var logger = dependencies.logger;
Expand All @@ -28,9 +24,6 @@ module.exports = function(dependencies){
},
getComponentsByDir: getComponentsByDir(dependencies),
getLocalNpmModules: getLocalNpmModules(),
info: function(callback){
return fs.readJson(settings.configFile.src, callback);
},
init: function(componentName, templateType, callback){

if(!validator.validateComponentName(componentName)){
Expand Down Expand Up @@ -63,9 +56,7 @@ module.exports = function(dependencies){
return callback(e);
}
},
link: link(),
mock: mock(),
package: packageComponents(),
unlink: unlink()
package: packageComponents()
});
};
30 changes: 0 additions & 30 deletions cli/domain/registry.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
'use strict';

var async = require('async');
var format = require('stringformat');
var fs = require('fs-extra');
var path = require('path');
var _ = require('underscore');

var put = require('../../utils/put');
var querystring = require('querystring');
var request = require('../../utils/request');
var settings = require('../../resources/settings');
var urlBuilder = require('../../registry/domain/url-builder');
Expand Down Expand Up @@ -105,34 +103,6 @@ module.exports = function(opts){
callback(null, previewUrl);
});
},
getRegistryComponentsByRegistry: function(registry, callback){

request(registry, requestsOptions, function(err, res){
if(err || !res){
return callback('not components found for registry: ' + registry, null);
}

var components;

try {
components = JSON.parse(res).components;
} catch(e){
return callback('Registry api responded in an unexpected way', null);
}

if(components.length === 0){
return callback('no components found in oc registry', null);
}

async.map(components, function(component, cb){
request(component + settings.registry.componentInfoPath, requestsOptions, function(err, res){
cb(err, _.extend(JSON.parse(res), {
href: component
}));
});
}, callback);
});
},
putComponent: function(options, callback){
var headers = requestsOptions.headers;

Expand Down
19 changes: 0 additions & 19 deletions cli/domain/unlink.js

This file was deleted.

95 changes: 0 additions & 95 deletions cli/facade/info.js

This file was deleted.

21 changes: 0 additions & 21 deletions cli/facade/link.js

This file was deleted.

Loading