Permalink
Browse files

added support for buddy-cli

  • Loading branch information...
1 parent 927ce5e commit 2bf9abbfe5a997a8595a9cff82fdfd294788d0c3 @popeindustries committed Mar 5, 2013
Showing with 4 additions and 138 deletions.
  1. +1 −80 bin/buddy
  2. +0 −56 buddy.js
  3. +3 −2 package.json
View
81 bin/buddy
@@ -1,82 +1,3 @@
#!/usr/bin/env node
-var program = require('commander')
- , fs = require('fs')
- , path = require('path')
- , indent = require('buddy-term').indent
- , Builder = require('../lib/builder');
-
-var exampleHeader = [
- ' Configuration:'
- , ''
- , ' build, dependencies, and plugin settings are defined in a "buddy.js" config file'
- , ' that should be located in the root of your project directory:'
- , ''
-
- ].join('\n')
- , exampleFooter = [
- ''
- , ' Visit https://github.com/popeindustries/buddy#readme for more details.'
- , ''
- ].join('\n');
-
-program
- .version(require('../package.json').version)
- .usage('[options] <command> [path/to/buddy.json]>')
- .option('-c, --compress', 'compress output for production deployment')
- .option('-l, --lint', 'check output for syntax and logic errors')
- .option('-r, --reload', 'reload all connected live-reload clients on file change during watch')
- .option('-s, --serve', 'create a webserver to serve static files during watch')
- .option('-t, --test', 'run test command on build completion')
- .option('-L, --lazy', 'convert js modules for lazy evaluation')
- .option('-v, --verbose', 'print all messages for debugging');
-
-program
- .command('install [config]')
- .description('install dependencies')
- .action(function(config) {
- new Builder().install(config, program.verbose);
- });
-
-program
- .command('build [config]')
- .description('build js and css sources')
- .action(function(config){
- new Builder().build(config, program.compress, program.lint, program.test, program.lazy, program.verbose);
- });
-
-program
- .command('watch [config]')
- .description('watch js and css source files and build changes')
- .action(function(config){
- new Builder().watch(config, program.compress, program.reload, program.serve, program.test, program.lazy, program.verbose);
- });
-
-program
- .command('deploy [config]')
- .description('build compressed js and css sources')
- .action(function(config){
- new Builder().deploy(config, program.test, program.lazy, program.verbose);
- });
-
-program
- .command('ls')
- .description('list all previously created files and directories')
- .action(function(){
- new Builder().list(program.verbose);
- });
-
-program
- .command('clean')
- .description('remove all previously created files and directories')
- .action(function(){
- new Builder().clean(program.verbose);
- });
-
-program.on('--help', function(){
- console.log(exampleHeader);
- console.log(indent(fs.readFileSync(path.resolve(__dirname, '../buddy.js'), 'utf8'), 4));
- console.log(exampleFooter);
-});
-
-program.parse(process.argv);
+require('buddy-cli');
View
56 buddy.js
@@ -1,56 +0,0 @@
-exports.build = {
- js: {
- sources: ['a/coffeescript/source/directory', 'a/js/source/directory', '!a/js/source/directory/ignored'],
- targets: [
- {
- input: 'a/coffeescript/or/js/file',
- output: 'a/js/file/or/directory',
- output_compressed: 'a/js/file/or/directory'
- },
- {
- input: 'a/coffeescript/or/js/directory',
- output: 'a/js/directory',
- modular: false
- }
- ]
- },
- css: {
- sources: ['a/stylus/directory', 'a/less/directory', 'a/css/directory'],
- targets: [
- {
- input: 'a/stylus/less/or/css/file',
- output: 'a/css/file/or/directory'
- },
- {
- input: 'a/stylus/less/or/css/directory',
- output: 'a/css/directory'
- }
- ]
- }
-}
-
-exports.dependencies = {
- 'a/vendor/directory': {
- sources: [
- 'popeindustries/browser-require',
- 'library@version'
- ],
- output: 'a/js/file'
- }
-}
-
-exports.settings = {
- test: 'command --flags',
- server: {
- directory: 'a/directory',
- port: 8000
- }
- processors: {
- js: {
- compilers: ['a/file', 'another/file'],
- compressor: 'a/file',
- linter: 'a/file',
- module: 'amd'
- }
- }
-}
View
5 package.json
@@ -15,17 +15,18 @@
"clean-css": "0.10.1",
"csslint": "0.9.10",
"jshint": "0.9.1",
- "commander": "1.1.1",
"async": "0.2.5",
"recur-fs": "0.1.0",
"buddy-term": "0.1.0",
"buddy-dependencies": "0.1.0",
"buddy-server": "0.2.0",
+ "buddy-cli": "0.1.0",
"yaw": "0.1.0"
},
"devDependencies": {
"should": "*",
- "mocha": "*"
+ "mocha": "*",
+ "rimraf": "*"
},
"directories": {
"lib": "./lib"

0 comments on commit 2bf9abb

Please sign in to comment.