gulp-rb-validate-bower
Advanced tools
Comparing version 0.0.5 to 0.0.6
41
index.js
@@ -20,6 +20,6 @@ /* jslint node: true */ | ||
if (abort) { | ||
gutil.log('[' + guideline + '] ' + gutil.colors.white(tag + ": ") + gutil.colors.red(mistake) + " [Level: RED]"); | ||
gutil.log('[' + guideline + '] ' + gutil.colors.white(tag + ": ") + gutil.colors.red(mistake) + " [Level Red]"); | ||
errorBreak = true; | ||
} else { | ||
gutil.log('[' + guideline + '] ' + gutil.colors.white(tag + ": ") + gutil.colors.yellow(mistake)); | ||
gutil.log('[' + guideline + '] ' + gutil.colors.white(tag + ": ") + gutil.colors.yellow(mistake) + " [Level Orange]"); | ||
} | ||
@@ -33,6 +33,12 @@ } | ||
if (version.match(/\d+/) < 3) { | ||
validationError('Bootstrap version must be 3 or higher', module + ' -> ' + version, 'CI-FE-ERROR', true); | ||
validationError('Grid framework - Bootstrap version must be 3 or higher', module + ' -> ' + version, 'CI-FE-1006', true); | ||
} | ||
} | ||
function checkjQuery(module, version) { | ||
if (version.match(/\d+/) < 2) { | ||
validationError('jQuery Version should be 2.x', module + ' -> ' + version, 'CI-FE-5011a', false); | ||
} | ||
} | ||
/** | ||
@@ -51,3 +57,3 @@ * Check Angular Version | ||
if (!v || Number(digits[0]) < 1 || (Number(digits[0]) === 1 && (!digits[1] || Number(digits[1]) < 5))) { | ||
validationError('Angular version must be 1.5 or higher', module + ' -> ' + version, 'CI-FE-5010a', true); | ||
validationError('AngularJS version must be 1.5 or higher', module + ' -> ' + version, 'CI-FE-5010a', true); | ||
} | ||
@@ -79,20 +85,23 @@ } | ||
if (!dependencies.hasOwnProperty('bootstrap')) { | ||
validationError('Missing dependency', 'bootstrap', 'CI-FE-1006', true); | ||
if (!dependencies.hasOwnProperty('bootstrap') && !dependencies.hasOwnProperty('bootstrap-sass')) { | ||
validationError('Grid framework - Missing dependency', 'bootstrap', 'CI-FE-1006', true); | ||
} | ||
if (!dependencies.hasOwnProperty('angular')) { | ||
validationError('Missing dependency', 'angular', 'CI-FE-5010', true); | ||
if (!dependencies.hasOwnProperty('angular') && !dependencies.hasOwnProperty('jquery')) { | ||
validationError('UI framework - Missing dependency', 'angular / jQuery', 'CI-FE-1009', true); | ||
} | ||
else if (dependencies.hasOwnProperty('angular') && dependencies.hasOwnProperty('jquery')) { | ||
validationError('Only use one UI framework', 'Angular OR jQuery', 'CI-FE-1009', true); | ||
} | ||
if (!dependencies.hasOwnProperty('angular-translate')) { | ||
validationError('Missing dependency', 'angular-translate', 'CI-FE-1019', true); | ||
validationError('Internationalization/Localization - Missing dependency', 'angular-translate', 'CI-FE-1019', false); | ||
} | ||
if (dependencies.hasOwnProperty('angular-route')) { | ||
validationError('Angular routing does not work with Liferay integration', 'angular-route', 'CI-FE-WARNING', false); | ||
validationError('Angular routing does not work with Liferay', 'angular-route', 'CI-FE-WARNING', false); | ||
} | ||
if (dependencies.hasOwnProperty('angular-ui-router')) { | ||
validationError('Angular routing does not work with Liferay integration', 'angular-ui-router', 'CI-FE-WARNING', false); | ||
validationError('Angular routing does not work with Liferay', 'angular-ui-router', 'CI-FE-WARNING', false); | ||
} | ||
@@ -112,6 +121,10 @@ } | ||
if (module === 'bootstrap') { | ||
if (module === 'bootstrap' || module === 'bootstrap-sass') { | ||
checkBootstrap(module, dependencies[module]); | ||
} | ||
if (module === 'jquery') { | ||
checkjQuery(module, dependencies[module]); | ||
} | ||
if (module === 'angular') { | ||
@@ -154,4 +167,4 @@ checkAngular(module, dependencies[module]); | ||
if (options.abortOnError && errorBreak) { | ||
gutil.log(gutil.colors.red("Critical validation error -> ABORT")); | ||
if (options.exitOnError && errorBreak) { | ||
gutil.log(gutil.colors.red("Critical validation error -> EXIT") + " (exitOnError is active)"); | ||
process.exit(1); | ||
@@ -158,0 +171,0 @@ } |
{ | ||
"name": "gulp-rb-validate-bower", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "Gulp plugin to check bower.json according to Web Frontend Guidelines", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6768
142