Skip to content

Flite's node.js grunt tasks: for deploying to s3, snockets dependencies, ducksboard updates, and more.

License

Notifications You must be signed in to change notification settings

coen-hyde/barkeep

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

98 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-barkeep

Barkeep

a simple collection of common javascript build tasks for grunt.

Getting Started

Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-barkeep

Then add this line to your project's grunt.js gruntfile:

grunt.loadNpmTasks('grunt-barkeep');

Documentation

grunt-barkeep is bundled with the following additonal tasks:

docco

Generate docco documentation from JavaScript files. This is a multi task. It requires the docco binary to be installed on the system.

Example:

grunt.initConfig({
    docco: {
      files: ['lib/**/*.js']
    }
});

snockets

Build a dependency tree of source files for the concat and min grunt tasks using snockets. Snockets is a JavaScript dependency parser similar to Ruby's sprockets. This is a multi task.

barkeep, using snockets, can also concatenate coffeescript files.

Example:

grunt.initConfig({
    meta: {
        buildDirectory: 'dist',
        header: '/* Copyright 2012, Flite Inc. */',
        footer: '/* End of source */',
    },
    snockets: {
        core: {
            src: ['public/javascript/main-rollup.js'],
            options: {
                concat: {
                        header: '<banner:meta.header>',
                        destExtension: "debug.js",
                        destDir: "<config:meta.buildDirectory>",
                        footer: '<banner:meta.footer>'
                },
                min: {
                        destExtension: "js",
                        destDir: "<config:meta.buildDirectory>"
                }
            }
        }
    }
});

prepare-deploy

An experimental task that determines what files to upload or delete from an Amazon S3 buckets when mirroring a local directory. It is meant to be run before the s3 task in the grunt-s3 project.

ducksboard

Sends file size data to ducksboard for reporting purposes. Useful for tracking the size of your JavaScript web applications over time. This is a multi task.

Example:

grunt.initConfig({
    meta: {
        ducksboard_api_key: process.env.DUCKSBOARD_API_KEY
    },
    ducksboard: {
        everything_gzip: {
            src: ['public/rollup.js'],
            endpoint: 'everything',
            gzip: true
        },
        everything_no_gzip: {
            src: ['public/rollup.js'],
            endpoint: 'everything-no-gzip'
        }
    }   
});

clean

Delete the files and/or directories of your choice. This is a multi task.

Example:

grunt.initConfig({
    clean: {
      files: ['build/**/*.js']
    }
});

More Examples

See grunt.js in the barkeep directory.

Contributing

In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.

Release History

(Nothing yet)

License

Copyright (c) 2012 Flite, Inc.
Licensed under the MIT license.

About

Flite's node.js grunt tasks: for deploying to s3, snockets dependencies, ducksboard updates, and more.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.6%
  • CoffeeScript 0.4%