Skip to content

Commit

Permalink
Up and running
Browse files Browse the repository at this point in the history
  • Loading branch information
slightlytyler committed Oct 28, 2015
1 parent b928d7e commit a7a4415
Show file tree
Hide file tree
Showing 5 changed files with 129 additions and 0 deletions.
30 changes: 30 additions & 0 deletions dist/bluprint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env node
'use strict';

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _commander = require('commander');

var _commander2 = _interopRequireDefault(_commander);

var _help = require('./help');

var _help2 = _interopRequireDefault(_help);

_commander2['default'].version('0.1.0').usage('<keywords> [options]').option('-p, --pods [pods flag]', 'Generates using the defined pods based file structure').on('--help', function () {
return _help2['default'].print();
}).parse(process.argv);

var anyArgs = function anyArgs() {
return !!_commander2['default'].args.length;
};

if (!anyArgs()) {
_commander2['default'].help();
} else {
if (_commander2['default'].args[0] === "generate") {
console.log('GENERATE!!!');
} else {
_commander2['default'].help();
}
}
47 changes: 47 additions & 0 deletions dist/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
'use strict';

Object.defineProperty(exports, '__esModule', {
value: true
});

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; }

var _chalk = require('chalk');

var _chalk2 = _interopRequireDefault(_chalk);

var _chip = require('chip');

var _chip2 = _interopRequireDefault(_chip);

var _colors = require('colors');

var _colors2 = _interopRequireDefault(_colors);

var _log = (0, _chip2['default'])();

exports['default'] = {
print: function print() {
console.log('Keywords:\n');
console.log('generate: creates a new file according to its associated blueprint. \n');
console.log('Description:\n');
console.log('CLI app for easily creating and placing boilerplate code from predefined blueprints. \n');
console.log('Examples:\n'.inverse.green);
console.log('Creating a new component');
console.log('bluprint generate component todos/list --pod \n'.white);
},
// helpers for printing to the console.
log: function log(msg) {
return _log.info(_chalk2['default'].green(msg));
},
info: function info(msg) {
return _log.debug(_chalk2['default'].magenta(msg));
},
warn: function warn(msg) {
return _log.warn(_chalk2['default'].yellow(msg));
},
error: function error(msg) {
return _log.error(_chalk2['default'].red(msg));
}
};
module.exports = exports['default'];
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,10 @@
"bin": {
"bluprint": "dist/bluprint.js"
},
"dependencies": {
"chalk": "^1.1.1",
"chip": "0.0.5",
"colors": "^1.1.2",
"commander": "^2.9.0"
}
}
24 changes: 24 additions & 0 deletions src/bluprint.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/env node

import program from 'commander';

import help from './help';

program
.version('0.1.0')
.usage('<keywords> [options]')
.option('-p, --pods [pods flag]', 'Generates using the defined pods based file structure')
.on('--help', () => help.print())
.parse(process.argv);

const anyArgs = () => !!program.args.length;

if(!anyArgs()) {
program.help();
} else {
if (program.args[0] === "generate") {
console.log('GENERATE!!!');
} else {
program.help();
}
}
22 changes: 22 additions & 0 deletions src/help.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import chalk from 'chalk';
import chip from 'chip';
import colors from 'colors';

const log = chip();

export default {
print: () => {
console.log('Keywords:\n');
console.log('generate: creates a new file according to its associated blueprint. \n');
console.log('Description:\n');
console.log('CLI app for easily creating and placing boilerplate code from predefined blueprints. \n');
console.log('Examples:\n'.inverse.green);
console.log('Creating a new component');
console.log('bluprint generate component todos/list --pod \n'.white);
},
// helpers for printing to the console.
log: (msg) => log.info(chalk.green(msg)),
info: (msg) => log.debug(chalk.magenta(msg)),
warn: (msg) => log.warn(chalk.yellow(msg)),
error: (msg) => log.error(chalk.red(msg))
};

0 comments on commit a7a4415

Please sign in to comment.