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.1 to 0.0.5

.idea/.name

130

config-loader.js

@@ -6,2 +6,24 @@ module.exports = function ( grunt, args ) {

var opts = {
loadBaseTasksAndConfigs: true,
appPkgJSONPath: './package.json',
gruntFileDirectory: process.cwd(),
// the path to the local custom tasks for this grunt file
customTasks: './grunt-deps/tasks/**/*.js',
// the place where the tasks configuration live
taskConfigs: './grunt-deps/configs/**/*.js',
// the tasks aliases for grunt, they actually enable the grunt workflows.
workflows: './grunt-deps/workflows/**/*.js',
//common-config
commonConfig: './grunt-deps/common-config.js',
filterDevOnly: true
};
var lib = require( 'grunt-ez-frontend/lib/lib.js' );

@@ -20,2 +42,6 @@ var gruntTaskUtils = require( 'grunt-ez-frontend/lib/grunt-task-utils.js' )( grunt );

lib.extend( opts, args );
var filterMethod = opts.filterDevOnly ? 'filterDev' : 'filterAll';
// **load all grunt tasks without specifying them by name**.

@@ -25,37 +51,14 @@ //

// to register a task calling grunt.loadNmpTasks('grunt-name-of-task');
require( 'matchdep' )
.filterDev( 'grunt-*' )
.forEach( grunt.loadNpmTasks );
var gruntDeps = require( 'matchdep' )[ filterMethod ]( 'grunt-*' );
gruntDeps.forEach( grunt.loadNpmTasks );
// the base path relative to the location of this file
// when called from within the gruntfile.js
var opts = {
appPkgJSONPath: './package.json',
gruntFileDirectory: process.cwd(),
// the path to the local custom tasks for this grunt file
customTasks: './grunt-deps/tasks/**/*.js',
// the place where the tasks configuration live
taskConfigs: './grunt-deps/configs/**/*.js',
// the tasks aliases for grunt, they actually enable the grunt workflows.
workflows: './grunt-deps/workflows/**/*.js',
//common-config
commonConfig: './grunt-deps/common-config.js'
};
lib.extend(opts, args);
var basePath = opts.gruntFileDirectory;
grunt.verbose.writeln('cfg-ldr: basePath', basePath);
grunt.verbose.writeln( 'cfg-ldr: basePath', basePath );
if (!basePath) {
grunt.fail.warn('We need you to provide the gruntFileFolder path for the build-worflow to work correctly');
if ( !basePath ) {
grunt.fail.warn( 'We need you to provide the gruntFileFolder path for the build-worflow to work correctly' );
}

@@ -67,11 +70,4 @@

var commonConfig = {};
var commonConfig = require( './load-common-config' )( grunt, opts );
try {
commonConfig = require( path.join( basePath, opts.commonConfig ))(grunt);
}
catch(ex) {
verbose.writeln('Could not found commonConfig', opts.commonConfig);
}
var pkg = grunt.file.readJSON( file );

@@ -90,36 +86,4 @@

//console.log(helperOptions);
opts.loadBaseTasksAndConfigs && require( './load-base-tasks' )( grunt, opts, pkg, helperOptions );
var commonTasksPath = './tasks/**/*.js';
var commonTasks = grunt.file.expand( path.join( __dirname, commonTasksPath ) );
// Load the common Tasks definitions
commonTasks.forEach(function (entry) {
//console.log('loading common tasks', entry );
require( entry )(grunt, pkg, helperOptions);
});
// Custom tasks for this project
var customTasks = grunt.file.expand( opts.customTasks );
// iterate over them and execute them
customTasks.forEach(function ( entry ) {
//console.log('loading custom tasks', entry );
require( path.join( basePath, entry ))( grunt, pkg, helperOptions);
} );
var baseConfigs = {};
var commonTasksConfigs = grunt.file.expand( path.join(__dirname, './configs/**/*.js'));
commonTasksConfigs.forEach(function (entry) {
var entryName = path.basename( entry, '.js' );
baseConfigs[entryName] = require( entry ) (grunt, pkg, helperOptions);
});
//console.log(baseConfigs);
// tasks configs
var localConfig = grunt.file.expand( opts.taskConfigs );
grunt.initConfig( {

@@ -129,25 +93,15 @@ pkg: pkg

var baseConfigs = opts.loadBaseTasksAndConfigs ? require( './load-base-tasks-configs' )( grunt, opts, pkg, helperOptions ) : {};
// iterate over them and register them in the config
localConfig.forEach(function ( entry ) {
var entryName = path.basename( entry, '.js' );
var baseConfig = baseConfigs[entryName] || {};
require( './load-tasks' )( grunt, opts, pkg, helperOptions );
var lConfig = require(path.join(basePath, entry))(grunt, pkg, {
gruntTaskUtils: gruntTaskUtils,
commonConfig: commonConfig
});
require( './load-tasks-configs' )( grunt, opts, pkg, helperOptions, baseConfigs );
var outCfg = lib.extend(true, baseConfig, lConfig);
grunt.config.set( entryName , outCfg );
// load the workflows
var workflows = grunt.file.expand( path.join( basePath, opts.workflows ));
workflows.forEach(function ( entry ) {
require( entry )( grunt, pkg, helperOptions );
} );
var workflows = grunt.file.expand( path.join(basePath, opts.workflows) );
//console.log('workflows', workflows);
workflows.forEach(function (entry) {
require(entry)(grunt, pkg, helperOptions);
});
//grunt.file.write('./config.json', JSON.stringify(grunt.config.get(), null, 2));
};

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

return {
// 'changelog': {
// dest: './report/changelog/changelog.html'
// },
options: {

@@ -65,3 +70,3 @@

gitAuthorUrl: me.gitAuthorUrl || changeLogConfig.gitAuthorUrl, // 'http://git.kno.com/?p=cloud/kno-reader-ui.git;a=search;s={0};st=author',
rallySearchUrl: me.rallySearchUrl || changeLogConfig.rallySearchUrl, // 'https://rally1.rallydev.com/#/search?keywords={0}',
urlForBugId: me.urlForBugId || changeLogConfig.urlForBugId, // 'https://rally1.rallydev.com/#/search?keywords={0}',
projectName: me.projectName || pkg.name, // pkg.name,

@@ -76,6 +81,8 @@ projectVersion: me.projectVersion || pkg.version, //pkg.version,

shortDescription = shortDescription.replace( me.format( '[{0}]', commit.rallyId ), '{RALLY_ID}' );
shortDescription = shortDescription.replace( /\b[A-Z][A-Z]\d+\b/g, '{RALLY_ID}' );
shortDescription = shortDescription.replace( /\{RALLY_ID\}/g, me.format( '<a target="_blank" class="info-link" href="{0}"><span>{1}</span></a>', me.format( me.rallySearchUrl, commit.rallyId ), commit.rallyId ));
shortDescription = shortDescription.replace( me.format( '[{0}]', commit.bugId ), '{BUG_ID}' );
shortDescription = shortDescription.replace( /\b[A-Z][A-Z]\d+\b/g, '{BUG_ID}' );
shortDescription = shortDescription.replace( /\{BUG_ID\}/g, me.format( '<a target="_blank" class="info-link" href="{0}"><span>{1}</span></a>', me.format( me.urlForBugId, commit.bugId ), commit.bugId ));
return marked( capitalize( shortDescription )).replace( /<(\/)*p>/g, '' );

@@ -82,0 +89,0 @@ },

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

return {
options: {
ext: '.tpl' //.dot, .doT
}
// check: {
// kwlDistPkgFile: 'node_modules/kwl-dist/package.json',
// parametersYAML: 'bundles/Kno/AppBundle/Resources/config/parameters.yml',
// kwlTarballLocation: 'http://knorepo.cloud.kno.com/pool/main/kwl-dist-{0}.tgz'
// }
};
};

@@ -6,11 +6,10 @@ module.exports = function ( grunt, pkg, options ) {

var path = require('path');
var path = require( 'path' );
return {
options: {
//template: '(function (jQuery, kno, window) { \n var ns = kno.ns;\n \n//[[CONTENT]]\n \n}($, kno, window));'
templateFile: path.resolve( __dirname, '../resources/compile-templates/dot-template.tpl' )
templateFile: path.resolve( __dirname, '../resources/compile-templates/dot-template.tpl' )
}
};
};

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

return {
// lib: {
// files: [ {
// src: [ '**/*.*' ],
// dest: common.DEPLOY_FOLDER + 'vendor/',
// cwd: common.VENDOR_FOLDER,
// expand: true
// }, {
// src: [ '**/*.*' ],
// dest: common.READER_DEPLOY_FOLDER + 'img/',
// cwd: common.READER_REFRESH_SOURCE_FOLDER + 'img/',
// expand: true
// } ]
// },
options: {

@@ -9,0 +22,0 @@ // copy will try to process the content of the files as text. This behavior

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

return {
// kwl: {
// name: 'kwl',
// version: pkg.version,
// dest: 'publish/package.json'
// }
};
};

@@ -5,11 +5,27 @@ module.exports = function ( grunt, pkg, options ) {

var gruntTaskUtils = options.gruntTaskUtils;
var path = require('path');
var path = require( 'path' );
return {
// 'kwl-font': {
// files: [ {
// src: 'lib/fonts/KWL-font/selection.json',
// dest: 'src/less/KWL-font/kwl-font.less'
// } ],
// options: {
// // where to dump a js file with the codes declared
// jsonCodesOuput: 'docs/demo/pages/kwl-font-data/kwl-font-codes.js',
//
// // This function is called once per icon name and allows to fix inconsistencies in the naming conventions
// processIconName: function ( name ) {
// var fixPrefix = 'kwl-icon_'; // current version of the KWL-font have a duplicated prefix
// return ( name || '' ).trim().toLowerCase().replace( fixPrefix, '' ).replace( /_/g, '-' );
// }
// }
// },
options: {
// the template for the file that will generate the kwl-icon-* classes
fontLessTemplate: path.resolve(__dirname, '../resources/css-font/kwl-font.less.tpl'),
fontLessTemplate: path.resolve( __dirname, '../resources/css-font/kwl-font.less.tpl' ),
// the template for the mixins to use this font
fontCodesTemplate: path.resolve(__dirname, '../resources/css-font/font-codes.mixins.tpl'),
fontCodesTemplate: path.resolve( __dirname, '../resources/css-font/font-codes.mixins.tpl' ),

@@ -16,0 +32,0 @@ // the folder where the fonts are located relative to the selection.json file

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

var lib = require( 'grunt-ez-frontend/lib/lib.js' );
var path = require('path');
var path = require( 'path' );

@@ -105,3 +105,3 @@ return {

command: function ( glob ) {
var codepainterJSON = path.resolve(__dirname, '../resources/json-configs/codepainter.json');
var codepainterJSON = path.resolve( __dirname, '../resources/json-configs/codepainter.json' );
if ( glob ) {

@@ -126,8 +126,8 @@ return lib.format( 'node_modules/codepainter/bin/codepaint xform -j {0} "{1}"',

yuidoc: {
command: function (glob) {
command: function ( glob ) {
glob = glob || './src/';
var files = glob.split(',');
var files = glob.split( ',' );
var yuidoc = commonConfig.yuidoc || {};
var pathToConfig = yuidoc.config || path.resolve( __dirname, '../resources/json-configs/yuidoc.json');
return lib.format('node_modules/yuidocjs/lib/cli.js {0} --config-file={1} --server', files, pathToConfig);
var pathToConfig = yuidoc.config || path.resolve( __dirname, '../resources/json-configs/yuidoc.json' );
return lib.format( 'node_modules/yuidocjs/lib/cli.js {0} --config-file={1} --server', files, pathToConfig );
}

@@ -149,7 +149,7 @@ },

if (!pathToProtractorConfig) {
grunt.fail.warn('Missing protractor config file: ', pathToProtractorConfig);
if ( !pathToProtractorConfig ) {
grunt.fail.warn( 'Missing protractor config file: ', pathToProtractorConfig );
}
commands.push( lib.format('./node_modules/protractor/bin/protractor {0}', pathToProtractorConfig ));
commands.push( lib.format( './node_modules/protractor/bin/protractor {0}', pathToProtractorConfig ));

@@ -156,0 +156,0 @@ return commands.join( '\n' );

module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;
var licenseLocation = path.resolve(__dirname, '../resources/license/license.txt');
var licenseLocation = path.resolve( __dirname, '../resources/license/license.txt' );

@@ -8,0 +8,0 @@ //console.log('license location', licenseLocation);

@@ -5,9 +5,13 @@ module.exports = function ( grunt, pkg, options ) {

var gruntTaskUtils = options.gruntTaskUtils;
var path = require('path');
var path = require( 'path' );
return {
// all: {
// src: [ common.KNO_APP_BUNDLE_RESOURCES_FOLDER + '/translations/**/*.yml' ],
// dest: common.FRONTEND_APP_FOLDER + 'i18n/'
// },
options: {
templateFile: path.resolve(__dirname, '../resources/i18n/i18n.tpl')
templateFile: path.resolve( __dirname, '../resources/i18n/i18n.tpl' )
}
};
};

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

return {
// all: {
// src: common.sourceI18nGeneratedFiles, // directory containing the i18n files
// dest: common.i18nDestFolder, // destination folder
// options: {
// cwd: common.FRONTEND_APP_FOLDER + 'i18n/' relative path to exclude from the files to copy
// }
// }
};
};

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

return {
// hooks: {
// gitHooksDirectory: '../.git/hooks/'
// }
};
};

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

var config = path.resolve(__dirname, '../resources/json-configs/beautify-config.json');
var config = path.resolve( __dirname, '../resources/json-configs/beautify-config.json' );

@@ -18,10 +18,10 @@ return {

}
// 'js-check': {
// src: prepush.jsbeautifier || [],
// options: {
// // verify and rewrite any offending not formatted file
// mode: 'VERIFY_ONLY'
// }
// }
// 'js-check': {
// src: prepush.jsbeautifier || [],
// options: {
// // verify and rewrite any offending not formatted file
// mode: 'VERIFY_ONLY'
// }
// }
};
};
module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;

@@ -10,7 +10,7 @@ var commonConfig = options.commonConfig;

return {
// 'js-check': {
// src: prepush.jscs || []
// },
// 'js-check': {
// src: prepush.jscs || []
// },
options: {
config: path.resolve(__dirname, '../resources/json-configs/.jscs.json')
config: path.resolve( __dirname, '../resources/json-configs/.jscs.json' )
}

@@ -17,0 +17,0 @@ };

module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;

@@ -9,3 +9,3 @@ var commonConfig = options.commonConfig;

var config = path.resolve(__dirname, '../resources/json-configs/.jshintrc');
var config = path.resolve( __dirname, '../resources/json-configs/.jshintrc' );

@@ -19,9 +19,9 @@ // region ### jshint

jshintrc: config,
reporter: require('jshint-stylish')
reporter: require( 'jshint-stylish' )
}
// 'js-check': {
// src: prepush.jshint || []
// }
// 'js-check': {
// src: prepush.jshint || []
// }
};
// endregion
};
module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;

@@ -6,0 +6,0 @@ var commonConfig = options.commonConfig;

module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;

@@ -17,9 +17,9 @@ var commonConfig = options.commonConfig;

}
// 'js-check': {
// files: {
// src: prepush.jsvalidate
// }
// }
// 'js-check': {
// files: {
// src: prepush.jsvalidate
// }
// }
};
// endregion
};
module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;
var commonConfig = options.commonConfig;
return {

@@ -10,0 +9,0 @@

module.exports = function ( grunt, pkg, options ) {
'use strict';
var path = require('path');
var path = require( 'path' );
var gruntTaskUtils = options.gruntTaskUtils;

@@ -6,0 +6,0 @@ var commonConfig = options.commonConfig;

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

@@ -26,3 +26,64 @@ "main": "config-loader.js",

},
"homepage": "https://github.com/royriojas/build-workflow"
"homepage": "https://github.com/royriojas/build-workflow",
"devDependencies": {
"grunt": "~0.4.5",
"grunt-bump": "0.0.15",
"stringformat": "0.0.5",
"browserify-shim": "~3.5.0",
"jquery": "~2.1.1",
"matchdep": "~0.1.2",
"time-grunt": "~0.2.9",
"grunt-contrib-clean": "~0.5.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.5.3",
"grunt-contrib-copy": "~0.5.0",
"grunt-exec": "~0.4.5",
"grunt-csso": "~0.5.3",
"grunt-autoprefixer": "~1.0.0",
"grunt-ez-frontend": "~0.2.21",
"grunt-jsonlint": "~1.0.4",
"grunt-jscs-checker": "0.2.6",
"grunt-jsvalidate": "~0.2.2",
"grunt-newer": "~0.6.1",
"lodash": "~2.4.1",
"codepainter": "~0.3.27",
"marked": "~0.3.1",
"cheerio": "~0.13.1",
"grunt-karma": "~0.8.3",
"grunt-contrib-csslint": "~0.2.0",
"html-entities": "~1.0.10",
"underscore": "~1.6.0",
"karma-coverage": "~0.2.1",
"karma-junit-reporter": "~0.2.2",
"karma-jasmine": "~0.2.2",
"karma-phantomjs-launcher": "~0.1",
"karma-osx-reporter": "~0.1.0",
"karma-spec-reporter": "0.0.13",
"karma-chrome-launcher": "~0.1.4",
"twig": "~0.7.0",
"grunt-watchify": "~0.1.0",
"protractor": "~0.24.2",
"dot": "~1.0.2",
"moment": "~2.8.2",
"es6-promise": "~1.0.0",
"reactify": "~0.14.0",
"browserify-transform-tools": "~1.2.1",
"esprima": "~1.1.0",
"react": "~0.11.1",
"karma-commonjs-plus": "0.0.25",
"karma-mocha": "~0.1.9",
"sinon-chai": "~2.5.0",
"chai": "~1.9.1",
"sinon": "~1.10.3",
"karma-chai-sinon": "~0.1.3",
"jasmine-spec-reporter": "~0.6.0",
"jshint-stylish": "~0.4.0",
"grunt-jsbeautifier": "https://github.com/royriojas/grunt-jsbeautifier/tarball/e69f6ef",
"docco-husky": "https://github.com/royriojas/docco-husky/tarball/d3aaec2",
"karma-react-jsx-preprocessor": "https://github.com/royriojas/karma-react-jsx-preprocessor/tarball/1824de4"
}
}

@@ -24,11 +24,11 @@ module.exports = function ( content ) {

var rallyIdMatcher = /\[(.*)\]/;
var bugIdMatcher = /\[(.*)\]/;
var rallyMatches = subject.match( rallyIdMatcher ) || [];
var rallyId = rallyMatches[ 1 ];
var rallyMatches = subject.match( bugIdMatcher ) || [];
var bugId = rallyMatches[ 1 ];
if ( !rallyId ) {
rallyIdMatcher = /\b([A-Z][A-Z]\d+)\b/;
rallyMatches = subject.match( rallyIdMatcher ) || [];
rallyId = rallyMatches[ 1 ];
if ( !bugId ) {
bugIdMatcher = /\b([A-Z][A-Z]\d+)\b/;
rallyMatches = subject.match( bugIdMatcher ) || [];
bugId = rallyMatches[ 1 ];
}

@@ -40,3 +40,3 @@

shortDescription: subject.replace( regexp, '' ),
rallyId: rallyId
bugId: bugId
};

@@ -43,0 +43,0 @@

@@ -47,6 +47,2 @@ Make sure your commit message looks like:

More info:
http://wiki/display/cloud/Cloud+projects+workflow+with+GIT#CloudprojectsworkflowwithGIT-Commits
===============

@@ -5,3 +5,3 @@ #!/usr/bin/env node

var utils = require( './lib/util.js' );
var prepushCfg = require('./lib/prepush-cfg.json');
var prepushCfg = require( './lib/prepush-cfg.json' );
var path = require( 'path' );

@@ -35,16 +35,16 @@

// var cp2 = exec( 'grunt jshint:js-check jscs:js-check jsvalidate:js-check', function ( err, stdout, stderr ) {
// if ( err ) {
//
// showErrorBlock( 'Review your errors and try again', 'VALIDATION FAILED :' );
// process.exit( 1 );
// }
//
// showSuccessBlock( 'Validation Hook Completed!.' );
//
// } );
//
// cp2.stdout.pipe( createStream());
// var cp2 = exec( 'grunt jshint:js-check jscs:js-check jsvalidate:js-check', function ( err, stdout, stderr ) {
// if ( err ) {
//
// showErrorBlock( 'Review your errors and try again', 'VALIDATION FAILED :' );
// process.exit( 1 );
// }
//
// showSuccessBlock( 'Validation Hook Completed!.' );
//
// } );
//
// cp2.stdout.pipe( createStream());
} );
cp.stdout.pipe( createStream());
var grunt = require( 'grunt' );
var path = require( 'path' );
var lib = require('grunt-ez-frontend/lib/lib');
var lib = require( 'grunt-ez-frontend/lib/lib' );
module.exports = function (cfg) {
module.exports = function ( cfg ) {
var opts = {
suitesFolder : path.resolve('./frontend-app/e2e/suites/'),
suitesFolder: path.resolve( './frontend-app/e2e/suites/' ),
specGlobs: '**/*spec.js'
};
lib.extend(opts, cfg);
lib.extend( opts, cfg );
var protractorPath = path.resolve( path.dirname(require.resolve('protractor')), '../');
var protractorPath = path.resolve( path.dirname( require.resolve( 'protractor' )), '../' );

@@ -26,3 +26,3 @@ // An example configuration file.

chromeOnly: true,
chromeDriver: path.join( protractorPath, '/selenium/chromedriver'),
chromeDriver: path.join( protractorPath, '/selenium/chromedriver' ),
// Capabilities to be passed to the webdriver instance.

@@ -33,3 +33,3 @@ capabilities: {

suites: {
hack: path.resolve( __dirname, './reporter-hack.js') // hack to remove the dot reporter
hack: path.resolve( __dirname, './reporter-hack.js' ) // hack to remove the dot reporter
},

@@ -52,7 +52,7 @@

var specsFiles = path.join(opts.suitesFolder, opts.specGlobs);
var specsFiles = path.join( opts.suitesFolder, opts.specGlobs );
var files = grunt.file.expand( specsFiles );
console.log('files',specsFiles, files);
console.log( 'files', specsFiles, files );

@@ -74,3 +74,3 @@ var getDirectoryNameOfFile = function ( file ) {

config.suites[ dName ] = config.suites[ dName ] || path.join( path.dirname(file), opts.specGlobs);
config.suites[ dName ] = config.suites[ dName ] || path.join( path.dirname( file ), opts.specGlobs );

@@ -82,2 +82,1 @@ } );

};

@@ -20,6 +20,6 @@ module.exports = function ( grunt, pkg, options ) {

var prepushHookConfig = {
pathToSource: path.resolve(gruntWorkingDirectory)
pathToSource: path.resolve( gruntWorkingDirectory )
};
var hooksSourceDirectory = path.resolve(__dirname, '../resources/hooks/')
var hooksSourceDirectory = path.resolve( __dirname, '../resources/hooks/' );

@@ -52,3 +52,3 @@ var hooks = grunt.file.expand( path.join( hooksSourceDirectory, '*.js' ));

var libs = grunt.file.expand( path.join(hooksSourceDirectory, 'lib/**/*.*' ));
var libs = grunt.file.expand( path.join( hooksSourceDirectory, 'lib/**/*.*' ));
libs.forEach(function ( file ) {

@@ -73,3 +73,3 @@ var destName = path.basename( file );

grunt.file.write(path.resolve( gitHooksDir + '/lib/prepush-cfg.json'), JSON.stringify(prepushHookConfig));
grunt.file.write( path.resolve( gitHooksDir + '/lib/prepush-cfg.json' ), JSON.stringify( prepushHookConfig ));

@@ -76,0 +76,0 @@ }

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

gruntTaskUtils.registerTasks( {
'prepush': function (jsTasks ) {
'prepush': function ( jsTasks ) {

@@ -16,12 +16,12 @@ var key = 'js-check';

jsTasks = jsTasks.split(',');
jsTasks = jsTasks.split( ',' );
var tasksToRun = [];
var prepush = options.commonConfig.prepush || {};
var prepush = options.commonConfig.filesToValidate || {};
jsTasks.forEach(function ( task ) {
var files = prepush[task] || [];
var files = prepush[ task ] || [];
if (files.length > 0) {
if ( files.length > 0 ) {
var tConfig = {

@@ -31,7 +31,7 @@ src: files

if (task === 'jsbeautifier') {
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);
onVerificationFailed: function ( result, opts ) {
grunt.fail.fatal( 'File needed beautification: ' + opts.file );
}

@@ -41,3 +41,3 @@ };

grunt.config.set( [task, key], tConfig);
grunt.config.set( [ task, key ], tConfig );
tasksToRun.push( task );

@@ -56,64 +56,4 @@ }

console.log( 'tasks to run', tasksToRun );
grunt.log.ok( 'all validated!' );
// var jsFiles = [];
// var jsonFiles = [];
//
// var filesExpanded = grunt.file.expand( fileGlob );
//
// filesExpanded.forEach(function ( file ) {
// var extname = path.extname( file );
//
// if ( file.indexOf( 'node_modules' ) > -1 ) {
// return;
// }
//
// var f = file; //path.relative( './', file );
// if ( extname === '.js' ) {
// jsFiles.push( f );
// }
// if ( extname === '.json' ) {
// jsonFiles.push( f );
// }
// } );
//
// console.log( jsonFiles, jsFiles );
//
// var tasksToRun = [];
// var key = 'modified';
// if ( jsonFiles.length > 0 ) {
// tasksToRun.push( 'jsonlint' );
// grunt.config.set( [ 'jsonlint', key ], {
// src: jsonFiles
// } );
// }
//
// var jsFilesEntry = {
// src: jsFiles
// };
//
// var jsTasks = [ 'jsbeautifier', 'jscs', 'jshint', 'jsvalidate' ];
//
// jsTasks.forEach(function ( task ) {
// if ( jsFiles.length > 0 ) {
// tasksToRun.push( task );
// grunt.config.set( [ task, key ], jsFilesEntry );
// }
// } );
//
// tasksToRun = tasksToRun.map(function ( task ) {
// return task + ':' + key;
// } );
//
// if ( tasksToRun.length > 0 ) {
// grunt.task.run( tasksToRun );
// }
//
// console.log( 'tasks to run', tasksToRun );
//
// grunt.log.ok( 'all validated!' );
}
} );
};

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

fileGlob = fileGlob.split( ',' );
var filesExpanded = grunt.file.expand( fileGlob );

@@ -20,5 +22,5 @@

if ( file.indexOf( 'node_modules' ) > -1 ) {
return;
}
// if ( file.indexOf( 'node_modules' ) > -1 ) {
// return;
// }

@@ -25,0 +27,0 @@ var f = file; //path.relative( './', file );

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