grunt-barkeep

grunt tasks for deploying to s3, sending data to ducksboard, and snockets.

npm install grunt-barkeep
18 downloads in the last week
48 downloads in the last month

grunt-barkeep

Barkeep

grunt 0.4.x tasks for snockets, Amazon S3 uploads, and ducksboard updates.

Getting Started

If you haven't used grunt before, be sure to check out the Getting Started guide, as it explains how to create a gruntfile as well as install and use grunt plugins. Once you're familiar with that process, install this plugin with this command:

npm install grunt-barkeep --save-dev

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

grunt.loadNpmTasks('grunt-barkeep');

Documentation

grunt-barkeep is bundled with the following tasks:

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.

snockets will automatically concatenate files in the correct order, so you don't need to use grunt's concat task if you use the snockets 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: '<%= meta.header %>',
                        destExtension: "debug.js",
                        destDir: "<%= meta.buildDirectory %>",
                        footer: '<%= meta.footer %>'
                },
                min: {
                        destExtension: "js",
                        destDir: "<%= 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 Gruntfile.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][grunt].

Release History

0.4.0 - Version compatible with grunt-0.4.x.

License

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

npm loves you