Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

grunt

Package Overview
Dependencies
Maintainers
4
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

grunt - npm Package Compare versions

Comparing version 0.4.5 to 1.0.0-rc1

CHANGELOG

8

lib/grunt.js

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -17,3 +17,3 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

// This allows grunt to require() .coffee files.
require('coffee-script');
require('coffee-script/register');

@@ -122,3 +122,3 @@ // The module to be exported.

// Initialize tasks.
task.init(tasks);
task.init(tasks, options);

@@ -167,3 +167,3 @@ verbose.writeln();

// https://github.com/gruntjs/grunt/pull/1026
task.start({asyncDone:true});
task.start({asyncDone: true});
};

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -50,3 +50,4 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

base: {
info: 'Specify an alternate base path. By default, all file paths are relative to the Gruntfile. (grunt.file.setBase) *',
info: 'Specify an alternate base path. By default, all file paths are relative to the Gruntfile. ' +
'(grunt.file.setBase) *',
type: path

@@ -60,3 +61,4 @@ },

gruntfile: {
info: 'Specify an alternate Gruntfile. By default, grunt looks in the current or parent directories for the nearest Gruntfile.js or Gruntfile.coffee file.',
info: 'Specify an alternate Gruntfile. By default, grunt looks in the current or parent directories ' +
'for the nearest Gruntfile.js or Gruntfile.coffee file.',
type: path

@@ -63,0 +65,0 @@ },

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -8,0 +8,0 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -8,0 +8,0 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -83,4 +83,4 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

} else {
grunt.log.writeln().success('Done, without errors.');
grunt.log.writeln().success('Done.');
}
};

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -29,2 +29,3 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

var iconv = require('iconv-lite');
var pathIsAbsolute = require('path-is-absolute');

@@ -55,3 +56,3 @@ // Windows?

// Iterate over flattened patterns array.
grunt.util._.flatten(patterns).forEach(function(pattern) {
grunt.util._.flattenDeep(patterns).forEach(function(pattern) {
// If the first character is ! it should be omitted

@@ -128,3 +129,3 @@ var exclusion = pattern.indexOf('!') === 0;

}
} catch(e) {
} catch (e) {
// Otherwise, it's probably not the right type.

@@ -205,3 +206,3 @@ return false;

fs.mkdirSync(subpath, mode);
} catch(e) {
} catch (e) {
throw grunt.util.error('Unable to create directory "' + subpath + '" (Error code: ' + e.code + ').', e);

@@ -242,3 +243,3 @@ }

if (options.encoding !== null) {
contents = iconv.decode(contents, options.encoding || file.defaultEncoding);
contents = iconv.decode(contents, options.encoding || file.defaultEncoding, {stripBOM: !file.preserveBOM});
// Strip any BOM that might exist.

@@ -251,3 +252,3 @@ if (!file.preserveBOM && contents.charCodeAt(0) === 0xFEFF) {

return contents;
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -267,3 +268,3 @@ throw grunt.util.error('Unable to read "' + filepath + '" file (Error code: ' + e.code + ').', e);

return result;
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -283,3 +284,3 @@ throw grunt.util.error('Unable to parse "' + filepath + '" file (' + e.message + ').', e);

return result;
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -305,7 +306,7 @@ throw grunt.util.error('Unable to parse "' + filepath + '" file (' + e.problem + ').', e);

if (!nowrite) {
fs.writeFileSync(filepath, contents);
fs.writeFileSync(filepath, contents, 'mode' in options ? {mode: options.mode} : {});
}
grunt.verbose.ok();
return true;
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -317,3 +318,21 @@ throw grunt.util.error('Unable to write "' + filepath + '" file (Error code: ' + e.code + ').', e);

// Read a file, optionally processing its content, then write the output.
file.copy = function(srcpath, destpath, options) {
// Or read a directory, recursively creating directories, reading files,
// processing content, writing output.
file.copy = function copy(srcpath, destpath, options) {
if (file.isDir(srcpath)) {
// Copy a directory, recursively.
// Explicitly create new dest directory.
file.mkdir(destpath);
// Iterate over all sub-files/dirs, recursing.
fs.readdirSync(srcpath).forEach(function(filepath) {
copy(path.join(srcpath, filepath), path.join(destpath, filepath), options);
});
} else {
// Copy a single file.
file._copy(srcpath, destpath, options);
}
};
// Read a file, optionally processing its content, then write the output.
file._copy = function(srcpath, destpath, options) {
if (!options) { options = {}; }

@@ -332,5 +351,5 @@ // If a process function was specified, and noProcess isn't true or doesn't

try {
contents = options.process(contents, srcpath);
contents = options.process(contents, srcpath, destpath);
grunt.verbose.ok();
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -385,3 +404,3 @@ throw grunt.util.error('Error while processing "' + srcpath + '" file.', e);

return true;
} catch(e) {
} catch (e) {
grunt.verbose.error();

@@ -419,3 +438,3 @@ throw grunt.util.error('Unable to delete "' + filepath + '" file (' + e.message + ').', e);

var filepath = path.join.apply(path, arguments);
return path.resolve(filepath) === filepath.replace(/[\/\\]+$/, '');
return pathIsAbsolute(filepath);
};

@@ -449,3 +468,3 @@

return file.arePathsEquivalent(fs.realpathSync(process.cwd()), fs.realpathSync(filepath));
} catch(e) {
} catch (e) {
return false;

@@ -460,5 +479,5 @@ }

return file.doesPathContain(fs.realpathSync(process.cwd()), fs.realpathSync(filepath));
} catch(e) {
} catch (e) {
return false;
}
};

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -53,3 +53,2 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

// Header.

@@ -56,0 +55,0 @@ exports.header = function() {

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -8,0 +8,0 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -111,3 +111,3 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

} else if (Array.isArray(data.files)) {
grunt.util._.flatten(data.files).forEach(function(obj) {
grunt.util._.flattenDeep(data.files).forEach(function(obj) {
var prop;

@@ -262,3 +262,3 @@ if ('src' in obj || 'dest' in obj) {

get: function() {
return grunt.util._(this.files).chain().pluck('src').flatten().uniq().value();
return grunt.util._(this.files).chain().map('src').flatten().uniq().value();
}.bind(this)

@@ -292,3 +292,3 @@ });

return result;
} catch(e) {
} catch (e) {
grunt.log.error(e.message);

@@ -302,2 +302,4 @@ }

var targets = Object.keys(grunt.config.getRaw(taskname) || {});
// Remove invalid target properties.
targets = targets.filter(isValidMultiTaskTarget);
// Fail if there are no actual properties to iterate over.

@@ -308,4 +310,4 @@ if (targets.length === 0) {

}
// Iterate over all valid target properties, running a task for each.
targets.filter(isValidMultiTaskTarget).forEach(function(target) {
// Iterate over all targets, running a task for each.
targets.forEach(function(target) {
// Be sure to pass in any additionally specified args.

@@ -345,3 +347,3 @@ task.run([taskname, target].concat(args || []).join(':'));

}
} catch(e) {
} catch (e) {
// Something went wrong.

@@ -370,3 +372,3 @@ grunt.log.write(msg).error().verbose.error(e.stack).or.error(e);

});
} catch(e) {
} catch (e) {
grunt.log.verbose.error(e.stack).or.error(e);

@@ -434,7 +436,14 @@ }

// if specified, otherwise search the current directory or any parent.
var gruntfile = allInit ? null : grunt.option('gruntfile') ||
grunt.file.findup('Gruntfile.{js,coffee}', {nocase: true});
var gruntfile, msg;
if (allInit || options.gruntfile === false) {
gruntfile = null;
} else {
gruntfile = grunt.option('gruntfile') ||
grunt.file.findup('Gruntfile.{js,coffee}', {nocase: true});
msg = 'Reading "' + (gruntfile ? path.basename(gruntfile) : '???') + '" Gruntfile...';
}
var msg = 'Reading "' + (gruntfile ? path.basename(gruntfile) : '???') + '" Gruntfile...';
if (gruntfile && grunt.file.exists(gruntfile)) {
if (options.gruntfile === false) {
// Grunt was run as a lib with {gruntfile: false}.
} else if (gruntfile && grunt.file.exists(gruntfile)) {
grunt.verbose.writeln().write(msg).ok();

@@ -464,5 +473,5 @@ // Change working directory so that all paths are relative to the

// Load all user-specified --npm tasks.
(grunt.option('npm') || []).forEach(task.loadNpmTasks);
(grunt.option('npm') || []).map(String).forEach(task.loadNpmTasks);
// Load all user-specified --tasks.
(grunt.option('tasks') || []).forEach(task.loadTasks);
(grunt.option('tasks') || []).map(String).forEach(task.loadTasks);
};

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -55,3 +55,3 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

// Tell Lo-Dash which delimiters to use.
grunt.util._.templateSettings = delimiters.lodash;
grunt.util._.extend(grunt.util._.templateSettings, delimiters.lodash);
// Return the delimiters.

@@ -77,3 +77,3 @@ return delimiters;

while (tmpl.indexOf(delimiters.opener) >= 0) {
tmpl = grunt.util._.template(tmpl, data);
tmpl = grunt.util._.template(tmpl, options)(data);
// Abort if template didn't change - nothing left to process!

@@ -80,0 +80,0 @@ if (tmpl === last) { break; }

@@ -5,3 +5,3 @@ /*

*
* Copyright (c) 2014 "Cowboy" Ben Alman
* Copyright (c) 2016 "Cowboy" Ben Alman
* Licensed under the MIT license.

@@ -227,3 +227,3 @@ * https://github.com/gruntjs/grunt/blob/master/LICENSE-MIT

if (asyncDone) {
process.nextTick(function () {
process.nextTick(function() {
done(err, success);

@@ -230,0 +230,0 @@ });

{
"name": "grunt",
"description": "The JavaScript Task Runner",
"version": "0.4.5",
"author": "\"Cowboy\" Ben Alman (http://benalman.com/)",
"version": "1.0.0-rc1",
"author": "Grunt Development Team (http://gruntjs.com/development-team)",
"homepage": "http://gruntjs.com/",
"repository": {
"type": "git",
"url": "git://github.com/gruntjs/grunt.git"
"repository": "gruntjs/grunt",
"license": "MIT",
"engines": {
"node": ">=0.10.0"
},
"bugs": {
"url": "http://github.com/gruntjs/grunt/issues"
"scripts": {
"test": "grunt test",
"test-tap": "grunt test:tap"
},
"licenses": [
{
"type": "MIT",
"url": "http://github.com/gruntjs/grunt/blob/master/LICENSE-MIT"
}
],
"main": "lib/grunt",
"scripts": {
"test": "grunt test"
},
"engines": {
"node": ">= 0.8.0"
},
"keywords": [

@@ -47,32 +37,32 @@ "task",

"dependencies": {
"async": "~0.1.22",
"coffee-script": "~1.3.3",
"colors": "~0.6.2",
"dateformat": "1.0.2-1.2.3",
"coffee-script": "~1.10.0",
"dateformat": "~1.0.12",
"eventemitter2": "~0.4.13",
"findup-sync": "~0.1.2",
"glob": "~3.1.21",
"hooker": "~0.2.3",
"iconv-lite": "~0.2.11",
"minimatch": "~0.2.12",
"nopt": "~1.0.10",
"rimraf": "~2.2.8",
"lodash": "~0.9.2",
"underscore.string": "~2.2.1",
"which": "~1.0.5",
"js-yaml": "~2.0.5",
"exit": "~0.1.1",
"getobject": "~0.1.0",
"grunt-legacy-util": "~0.2.0",
"grunt-legacy-log": "~0.1.0"
"findup-sync": "~0.3.0",
"glob": "~6.0.4",
"grunt-cli": "1.0.0-rc1",
"grunt-legacy-log": "1.0.0-rc1",
"grunt-legacy-util": "1.0.0-rc1",
"iconv-lite": "~0.4.13",
"js-yaml": "~3.5.2",
"minimatch": "~3.0.0",
"nopt": "~3.0.6",
"path-is-absolute": "~1.0.0",
"rimraf": "~2.2.8"
},
"devDependencies": {
"temporary": "~0.0.4",
"grunt-contrib-jshint": "~0.6.4",
"grunt-contrib-nodeunit": "~0.2.0",
"grunt-contrib-watch": "~0.5.3",
"difflet": "~0.2.3",
"grunt-contrib-jshint": "~0.11.3",
"grunt-contrib-nodeunit": "~0.4.1",
"grunt-contrib-watch": "~0.6.1",
"grunt-jscs": "~2.3.0",
"semver": "2.1.0",
"shelljs": "~0.2.5"
}
}
"shelljs": "~0.5.3",
"temporary": "~0.0.4",
"through2": "~2.0.0"
},
"files": [
"lib"
]
}
# Grunt: The JavaScript Task Runner
[![Build Status: Linux](https://secure.travis-ci.org/gruntjs/grunt.png?branch=master)](http://travis-ci.org/gruntjs/grunt)
<a href="https://ci.appveyor.com/project/gruntjs/grunt"><img src="https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva/branch/master" alt="Build Status: Windows" height="18" /></a>
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
[![Build Status: Linux](https://travis-ci.org/gruntjs/grunt.svg?branch=master)](https://travis-ci.org/gruntjs/grunt)
[![Build Status: Windows](https://ci.appveyor.com/api/projects/status/32r7s2skrgm9ubva/branch/master?svg=true)](https://ci.appveyor.com/project/gruntjs/grunt/branch/master)
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.svg)](http://gruntjs.com/)

@@ -7,0 +7,0 @@ <img align="right" height="260" src="http://gruntjs.com/img/grunt-logo-no-wordmark.svg">

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc