forked from slightlytyler/bluprint
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b928d7e
commit a7a4415
Showing
5 changed files
with
129 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) | ||
}; |