diff --git a/package.json b/package.json index af31b1bad2..5b2c34d4be 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "@reactivex/rxjs": "5.0.0-alpha.4", "angular2": "2.0.0-alpha.44", "es6-shim": "^0.33.6", + "inquirer": "^0.11.0", "lodash": "^3.10.1", "reflect-metadata": "0.1.1", "shelljs": "^0.5.3", diff --git a/tooling/generate.js b/tooling/generate.js index 82ce487028..4d5abd2a4c 100644 --- a/tooling/generate.js +++ b/tooling/generate.js @@ -30,10 +30,6 @@ Generate.generate = function generate(options) { Generate.log = options.log; } - if (options.inquirer) { - Generate.inquirer = options.inquirer; - } - if (options.q) { Generate.q = options.q; } @@ -44,7 +40,6 @@ Generate.generate = function generate(options) { var generateOptions = { appDirectory: options.appDirectory, - inquirer: options.inquirer, fileAndClassName: Generate.fileAndClassName(options.name), javascriptClassName: Generate.javascriptClassName(options.name), name: options.name diff --git a/tooling/generators/page-tabs/index.js b/tooling/generators/page-tabs/index.js index 04092f4548..b159cb0e45 100644 --- a/tooling/generators/page-tabs/index.js +++ b/tooling/generators/page-tabs/index.js @@ -1,7 +1,8 @@ var fs = require('fs'), + path = require('path'), + inquirer = require('inquirer'), Generator = module.exports, - Generate = require('../../generate'), - path = require('path'); + Generate = require('../../generate'); Generator.validate = function(input) { // console.log(typeof parseInt(input)); @@ -17,7 +18,7 @@ Generator.numberNames = ['first', 'second', 'third', 'fourth', 'fifth']; Generator.promptForTabCount = function promptForTabCount() { var q = Generate.q.defer(); - Generate.inquirer.prompt({choices: ['1', '2', '3', '4', '5'], message: 'How many tabs will you have?', name: 'count', type: 'list', validate: Generator.validate}, function(result) { + inquirer.prompt({choices: ['1', '2', '3', '4', '5'], message: 'How many tabs will you have?', name: 'count', type: 'list', validate: Generator.validate}, function(result) { q.resolve(result.count); }); @@ -27,7 +28,7 @@ Generator.promptForTabCount = function promptForTabCount() { Generator.promptForTabName = function promptForTabName(tabIndex, options) { var q = Generate.q.defer(); - Generate.inquirer.prompt({message: 'Enter the ' + Generator.numberNames[tabIndex] + ' tab name:', name: 'name', type: 'input'}, function(nameResult) { + inquirer.prompt({message: 'Enter the ' + Generator.numberNames[tabIndex] + ' tab name:', name: 'name', type: 'input'}, function(nameResult) { Generator.tabs.push({ appDirectory: options.appDirectory, fileAndClassName: Generate.fileAndClassName(nameResult.name), javascriptClassName: Generate.javascriptClassName(nameResult.name), name: nameResult.name }); q.resolve(); }); @@ -63,9 +64,9 @@ Generator.run = function run(options) { // console.log('Using tabs:', Generator.tabs); // }); }) - .then(function() { + .then(function() { var templates = Generate.loadGeneratorTemplates(__dirname); - + //Generate the tabs container page templates templates.forEach(function(template) { var templatePath = path.join(__dirname, template.file);