Move private-cli commands to local-cli

Summary: public

We cannot remove `local-cli` because is referenced by the global cli explicitly. If we do so, people would have to upgrate this global thin cli which will cause some pain. So, lets move `private-cli` commands into `local-cli` instead.

Reviewed By: frantic

Differential Revision: D2571983

fb-gh-sync-id: 712c29430203660fb6f0d5f23813cb2a7156ee48
This commit is contained in:
Martín Bigio
2015-10-26 07:55:29 -07:00
committed by facebook-github-bot-3
parent 24537e3726
commit 849aa4dae6
33 changed files with 49 additions and 138 deletions

View File

@@ -13,20 +13,28 @@ require('../packager/babelRegisterOnly')([
/local-cli/
]);
var bundle = require('../private-cli/src/bundle/bundle');
var bundle = require('./bundle/bundle');
var childProcess = require('child_process');
var Config = require('../private-cli/src/util/Config');
var Config = require('./util/Config');
var defaultConfig = require('./default.config');
var dependencies = require('./dependencies/dependencies');
var fs = require('fs');
var generate = require('../private-cli/src/generate/generate');
var library = require('../private-cli/src/library/library');
var generate = require('./generate/generate');
var library = require('./library/library');
var path = require('path');
var Promise = require('promise');
var runAndroid = require('../private-cli/src/runAndroid/runAndroid');
var server = require('../private-cli/src/server/server');
var runAndroid = require('./runAndroid/runAndroid');
var server = require('./server/server');
var TerminalAdapter = require('yeoman-environment/lib/adapter.js');
var yeoman = require('yeoman-environment');
var upgrade = require('../private-cli/src/upgrade/upgrade');
var upgrade = require('./upgrade/upgrade');
var fs = require('fs');
var gracefulFs = require('graceful-fs');
// graceful-fs helps on getting an error when we run out of file
// descriptors. When that happens it will enqueue the operation and retry it.
gracefulFs.gracefulify(fs);
var documentedCommands = {
'start': [server, 'starts the webserver'],
@@ -38,6 +46,11 @@ var documentedCommands = {
'updating the react-native version in your package.json and running npm install']
};
var exportedCommands = {dependencies: dependencies};
Object.keys(documentedCommands).forEach(function(command) {
exportedCommands[command] = documentedCommands[command][0];
});
var undocumentedCommands = {
'init': [printInitWarning, ''],
};
@@ -148,4 +161,5 @@ if (require.main === module) {
module.exports = {
run: run,
init: init,
commands: exportedCommands
};