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

build-workflow

Package Overview
Dependencies
Maintainers
1
Versions
126
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

build-workflow - npm Package Compare versions

Comparing version 0.0.24 to 0.0.25

utils/check-files.js

2

docs/usage.md

@@ -20,3 +20,3 @@ # Usage

# install the check-valid tasks
npm i -D grunt-contrib-jshint grunt-jscs grunt-jsvalidate https://github.com/royriojas/grunt-jsbeautifier/tarball/e69f6ef
npm i -D grunt-newer grunt-contrib-jshint grunt-jscs grunt-jsvalidate https://github.com/royriojas/grunt-jsbeautifier/tarball/e69f6ef

@@ -23,0 +23,0 @@ # optional to enable a nice reporter that group errors per file

{
"name": "build-workflow",
"version": "0.0.24",
"version": "0.0.25",
"description": "Simple gruntfile helper to define build workflows",

@@ -49,3 +49,4 @@ "main": "config-loader.js",

"grunt-jsonlint": "~1.0.4",
"grunt-contrib-clean": "~0.6.0"
"grunt-contrib-clean": "~0.6.0",
"grunt-newer": "~0.7.0"
},

@@ -52,0 +53,0 @@ "docco_husky": {

@@ -7,2 +7,3 @@ module.exports = function ( grunt, pkg, options ) {

var path = require( 'path' );
var checkFiles = require( '../utils/check-files' );

@@ -12,28 +13,10 @@ gruntTaskUtils.registerTasks( {

var key = 'js-check';
jsTasks = jsTasks || 'jsbeautifier,jscs,jshint,jsvalidate';
jsTasks = jsTasks.split( ',' );
var tasksToRun = [];
var prepush = options.commonConfig.filesToValidate || {};
jsTasks.forEach(function ( task ) {
var files = prepush[ task ] || [];
if ( files.length > 0 ) {
var tConfig = {
src: files
};
grunt.config.set( [ task, key ], tConfig );
tasksToRun.push( task );
}
var opts = this.options( {
useNewer: true,
tasksToRun: 'jsbeautifier,jscs,jshint,jsvalidate',
filesToValidate: options.commonConfig.filesToValidate,
forceBeautify: true
} );
tasksToRun = tasksToRun.map(function ( task ) {
return task + ':' + key;
} );
var tasksToRun = checkFiles.doCheck( grunt, jsTasks, opts );

@@ -44,7 +27,5 @@ if ( tasksToRun.length > 0 ) {

console.log( 'tasks to run', tasksToRun );
grunt.log.ok( 'all validated!' );
grunt.log.ok( 'check-valid: tasks to run', tasksToRun );
}
} );
};

@@ -7,2 +7,3 @@ module.exports = function ( grunt, pkg, options ) {

var path = require( 'path' );
var checkFiles = require( '../utils/check-files' );

@@ -12,37 +13,10 @@ gruntTaskUtils.registerTasks( {

var key = 'js-check';
jsTasks = jsTasks || 'jsbeautifier,jscs,jshint,jsvalidate';
jsTasks = jsTasks.split( ',' );
var tasksToRun = [];
var prepush = options.commonConfig.filesToValidate || {};
jsTasks.forEach(function ( task ) {
var files = prepush[ task ] || [];
if ( files.length > 0 ) {
var tConfig = {
src: files
};
if ( task === 'jsbeautifier' && !grunt.option( 'pp-force-beautify' )) {
tConfig.options = {
mode: 'VERIFY_ONLY',
onVerificationFailed: function ( result, opts ) {
grunt.fail.fatal( 'File needed beautification: ' + opts.file );
}
};
}
grunt.config.set( [ task, key ], tConfig );
tasksToRun.push( task );
}
var opts = this.options( {
useNewer: false,
tasksToRun: 'jsbeautifier,jscs,jshint,jsvalidate',
filesToValidate: options.commonConfig.filesToValidate,
forceBeautify: false
} );
tasksToRun = tasksToRun.map(function ( task ) {
return task + ':' + key;
} );
var tasksToRun = checkFiles.doCheck( grunt, jsTasks, opts );

@@ -53,5 +27,5 @@ if ( tasksToRun.length > 0 ) {

console.log( 'tasks to run', tasksToRun );
grunt.log.ok( 'prepush: tasks to run', tasksToRun );
}
} );
};

Sorry, the diff of this file is not supported yet

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