Set up Grunt

Fixing up Grunt file to watch for directories

Exclude node modules folder from Jekyll built site
This commit is contained in:
Tetsuro
2015-07-25 13:48:45 -04:00
parent ae3d14bef5
commit 82249c99b3
2143 changed files with 389848 additions and 26 deletions
+3
View File
@@ -0,0 +1,3 @@
language: node_js
node_js:
- "0.10"
+19
View File
@@ -0,0 +1,19 @@
Copyright (c) 2010-2014 Caolan McMahon
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
File diff suppressed because it is too large Load Diff
+11
View File
@@ -0,0 +1,11 @@
{
"name": "async",
"repo": "caolan/async",
"description": "Higher-order functions and common patterns for asynchronous code",
"version": "0.1.23",
"keywords": [],
"dependencies": {},
"development": {},
"main": "lib/async.js",
"scripts": [ "lib/async.js" ]
}
+1123
View File
File diff suppressed because it is too large Load Diff
+60
View File
@@ -0,0 +1,60 @@
{
"name": "async",
"description": "Higher-order functions and common patterns for asynchronous code",
"main": "./lib/async",
"author": {
"name": "Caolan McMahon"
},
"version": "0.9.0",
"repository": {
"type": "git",
"url": "https://github.com/caolan/async.git"
},
"bugs": {
"url": "https://github.com/caolan/async/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/caolan/async/raw/master/LICENSE"
}
],
"devDependencies": {
"nodeunit": ">0.0.0",
"uglify-js": "1.2.x",
"nodelint": ">0.0.0"
},
"jam": {
"main": "lib/async.js",
"include": [
"lib/async.js",
"README.md",
"LICENSE"
]
},
"scripts": {
"test": "nodeunit test/test-async.js"
},
"homepage": "https://github.com/caolan/async",
"_id": "[email protected]",
"dist": {
"shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
"tarball": "http://registry.npmjs.org/async/-/async-0.9.0.tgz"
},
"_from": "async@^0.9.0",
"_npmVersion": "1.4.3",
"_npmUser": {
"name": "caolan",
"email": "[email protected]"
},
"maintainers": [
{
"name": "caolan",
"email": "[email protected]"
}
],
"directories": {},
"_shasum": "ac3613b1da9bed1b47510bb4651b8931e47146c7",
"_resolved": "https://registry.npmjs.org/async/-/async-0.9.0.tgz",
"readme": "ERROR: No README data found!"
}
+12
View File
@@ -0,0 +1,12 @@
'use strict';
var lpad = require('lpad');
var _outWrite = process.stdout.write.bind(process.stdout);
var _errWrite = process.stderr.write.bind(process.stderr);
exports.stdout = function (pad) {
process.stdout.write = pad ? function (str) { _outWrite(lpad(str, pad)); } : _outWrite;
};
exports.stderr = function (pad) {
process.stderr.write = pad ? function (str) { _errWrite(lpad(str, pad)); } : _errWrite;
};
@@ -0,0 +1,6 @@
'use strict';
var eol = require('os').EOL;
module.exports = function (str, pad) {
return pad ? pad + String(str).split(eol).join(eol + pad) : str;
};
@@ -0,0 +1,59 @@
{
"name": "lpad",
"version": "1.0.0",
"description": "Left pad each line in a string",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/sindresorhus/lpad"
},
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "http://sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"files": [
"index.js"
],
"keywords": [
"pad",
"indent",
"format",
"string",
"str"
],
"devDependencies": {
"mocha": "*"
},
"gitHead": "aab258d73dd0a810acba97a8667d163fa6191a62",
"bugs": {
"url": "https://github.com/sindresorhus/lpad/issues"
},
"homepage": "https://github.com/sindresorhus/lpad",
"_id": "[email protected]",
"_shasum": "a231dd2c129a4eebc7335b324c147ede3abfb6da",
"_from": "lpad@^1.0.0",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "sindresorhus",
"email": "[email protected]"
},
"maintainers": [
{
"name": "sindresorhus",
"email": "[email protected]"
}
],
"dist": {
"shasum": "a231dd2c129a4eebc7335b324c147ede3abfb6da",
"tarball": "http://registry.npmjs.org/lpad/-/lpad-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/lpad/-/lpad-1.0.0.tgz"
}
@@ -0,0 +1,42 @@
# lpad [![Build Status](https://travis-ci.org/sindresorhus/lpad.svg?branch=master)](https://travis-ci.org/sindresorhus/lpad)
> Left pad each line in a string
![screenshot](screenshot.png)
## Install
```sh
$ npm install --save lpad
```
## Usage
```js
var lpad = require('lpad');
var str = 'foo\nbar';
/*
foo
bar
*/
lpad(str, ' ');
/*
foo
bar
*/
```
## API
### lpad(string, pad)
Pads each line in a string with the supplied pad string.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
+65
View File
@@ -0,0 +1,65 @@
{
"name": "pad-stdio",
"version": "1.0.0",
"description": "Pad stdout and stderr",
"license": "MIT",
"repository": {
"type": "git",
"url": "git://github.com/sindresorhus/pad-stdio"
},
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "http://sindresorhus.com"
},
"engines": {
"node": ">=0.10.0"
},
"scripts": {
"test": "mocha"
},
"files": [
"index.js"
],
"keywords": [
"pad",
"indent",
"cli",
"format",
"string",
"stdio",
"stdout",
"stderr"
],
"dependencies": {
"lpad": "^1.0.0"
},
"devDependencies": {
"mocha": "*"
},
"gitHead": "553688a2db7bfea362850fda4cedda9e53b5836e",
"bugs": {
"url": "https://github.com/sindresorhus/pad-stdio/issues"
},
"homepage": "https://github.com/sindresorhus/pad-stdio",
"_id": "[email protected]",
"_shasum": "79b282ae258e587f695dbd0381914362c0c98fcb",
"_from": "pad-stdio@^1.0.0",
"_npmVersion": "1.4.14",
"_npmUser": {
"name": "sindresorhus",
"email": "[email protected]"
},
"maintainers": [
{
"name": "sindresorhus",
"email": "[email protected]"
}
],
"dist": {
"shasum": "79b282ae258e587f695dbd0381914362c0c98fcb",
"tarball": "http://registry.npmjs.org/pad-stdio/-/pad-stdio-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/pad-stdio/-/pad-stdio-1.0.0.tgz"
}
+49
View File
@@ -0,0 +1,49 @@
# pad-stdio [![Build Status](https://travis-ci.org/sindresorhus/pad-stdio.svg?branch=master)](https://travis-ci.org/sindresorhus/pad-stdio)
> Pad stdout and stderr
Especially useful with CLI tools when you don't directly control the output.
![](https://f.cloud.github.com/assets/170270/2420088/0c74e148-ab6a-11e3-9c1e-3ea2b91d24f2.png)
## Install
```sh
$ npm install --save pad-stdio
```
## Usage
```js
var padStdio = require('pad-stdio');
padStdio.stdout(' '); // start padding
console.log('foo');
padStdio.stdout(' ');
console.log('bar');
padStdio.stdout(); // end padding
console.log('baz');
/*
foo
bar
baz
*/
```
## API
### padStdio.stdout(pad)
Pads each line of `process.stdout` with the supplied pad string until the method is called again with no arguments.
### padStdio.stderr(pad)
Pads each line of `process.stderr` with the supplied pad string until the method is called again with no arguments.
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
+68
View File
@@ -0,0 +1,68 @@
{
"name": "grunt-concurrent",
"version": "1.0.0",
"description": "Run grunt tasks concurrently",
"keywords": [
"gruntplugin",
"concurrent",
"parallel",
"simultaneous",
"optimize",
"speed"
],
"author": {
"name": "Sindre Sorhus",
"email": "[email protected]",
"url": "http://sindresorhus.com"
},
"repository": {
"type": "git",
"url": "git://github.com/sindresorhus/grunt-concurrent"
},
"scripts": {
"test": "grunt"
},
"files": [
"tasks"
],
"dependencies": {
"async": "^0.9.0",
"pad-stdio": "^1.0.0"
},
"devDependencies": {
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-watch": "^0.6.1",
"grunt-nodemon": "^0.3.0",
"grunt-simple-mocha": "^0.4.0",
"nodemon": "^1.2.1"
},
"engines": {
"node": ">=0.10.0"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/sindresorhus/grunt-concurrent/issues"
},
"homepage": "https://github.com/sindresorhus/grunt-concurrent",
"_id": "[email protected]",
"_shasum": "715f66ec7815a1ff33fd46105e0ce1242f9e7fee",
"_from": "grunt-concurrent@",
"_npmVersion": "1.4.9",
"_npmUser": {
"name": "sindresorhus",
"email": "[email protected]"
},
"maintainers": [
{
"name": "sindresorhus",
"email": "[email protected]"
}
],
"dist": {
"shasum": "715f66ec7815a1ff33fd46105e0ce1242f9e7fee",
"tarball": "http://registry.npmjs.org/grunt-concurrent/-/grunt-concurrent-1.0.0.tgz"
},
"directories": {},
"_resolved": "https://registry.npmjs.org/grunt-concurrent/-/grunt-concurrent-1.0.0.tgz"
}
+70
View File
@@ -0,0 +1,70 @@
# grunt-concurrent [![Build Status](https://travis-ci.org/sindresorhus/grunt-concurrent.svg?branch=master)](https://travis-ci.org/sindresorhus/grunt-concurrent)
> Run grunt tasks concurrently
<img src="screenshot.png" width="439">
Running slow tasks like Coffee and Sass concurrently can potentially improve your build time significantly. This task is also useful if you need to run [multiple blocking tasks](#logconcurrentoutput) like `nodemon` and `watch` at once.
## Install
```sh
$ npm install --save-dev grunt-concurrent
```
## Usage
```js
require('load-grunt-tasks')(grunt); // npm install --save-dev load-grunt-tasks
grunt.initConfig({
concurrent: {
target1: ['coffee', 'sass'],
target2: ['jshint', 'mocha']
}
});
grunt.registerTask('default', ['concurrent:target1', 'concurrent:target2']);
```
## Options
### limit
Type: `number`
Default: Twice the number of CPU cores with a minimum of 2
Limit how many tasks that are run concurrently.
### logConcurrentOutput
Type: `boolean`
Default: `false`
You can optionally log the output of your concurrent tasks by specifying the `logConcurrentOutput` option. Here is an example config which runs [grunt-nodemon](https://github.com/ChrisWren/grunt-nodemon) to launch and monitor a node server and [grunt-contrib-watch](https://github.com/gruntjs/grunt-contrib-watch) to watch for asset changes all in one terminal tab:
```js
grunt.initConfig({
concurrent: {
target: {
tasks: ['nodemon', 'watch'],
options: {
logConcurrentOutput: true
}
}
}
});
grunt.loadNpmTasks('grunt-concurrent');
grunt.registerTask('default', ['concurrent:target']);
```
*The output will be messy when combining certain tasks. This option is best used with tasks that don't exit like `watch` and `nodemon` to monitor the output of long-running concurrent tasks.*
## License
MIT © [Sindre Sorhus](http://sindresorhus.com)
+59
View File
@@ -0,0 +1,59 @@
'use strict';
var os = require('os');
var padStdio = require('pad-stdio');
var async = require('async');
var cpCache = [];
module.exports = function (grunt) {
grunt.registerMultiTask('concurrent', 'Run grunt tasks concurrently', function () {
var spawnOptions;
var cb = this.async();
var options = this.options({
limit: Math.max((os.cpus().length || 1) * 2, 2)
});
// Set the tasks based on the config format
var tasks = this.data.tasks || this.data;
// Warning if there are too many tasks to execute within the given limit
if (options.limit < tasks.length) {
grunt.log.oklns(
'Warning: There are more tasks than your concurrency limit. After ' +
'this limit is reached no further tasks will be run until the ' +
'current tasks are completed. You can adjust the limit in the ' +
'concurrent task options'
);
}
// Optionally log the task output
if (options.logConcurrentOutput) {
spawnOptions = { stdio: 'inherit' };
}
padStdio.stdout(' ');
async.eachLimit(tasks, options.limit, function (task, next) {
var cp = grunt.util.spawn({
grunt: true,
args: [task].concat(grunt.option.flags()),
opts: spawnOptions
}, function (err, result, code) {
if (err || code > 0) {
grunt.warn(result.stderr || result.stdout);
}
grunt.log.writeln('\n' + result.stdout);
next();
});
cpCache.push(cp);
}, function () {
padStdio.stdout();
cb();
});
});
};
// make sure all child processes are killed when grunt exits
process.on('exit', function () {
cpCache.forEach(function (el) {
el.kill();
});
});