Skip to content

Commit

Permalink
Merge pull request #541 from osano/gulp4
Browse files Browse the repository at this point in the history
upgrade gulp & made package changes to reflect Osano as repo owner
  • Loading branch information
arlogilbert authored May 23, 2019
2 parents 5ee2890 + 080a5f9 commit 2b3191a
Show file tree
Hide file tree
Showing 9 changed files with 4,752 additions and 53 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
node_modules/
.idea
.vscode
.code-workspace
*.code-workspace
.DS_Store
build-verify/
build/
build-verify/
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
language: node_js
node_js:
- '4.1'
- 'lts/*'
install:
- npm install
- npm install -g gulp
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cookieconsent",
"version": "3.1.0",
"version": "3.1.1",
"homepage": "http://cookieconsent.osano.com/",
"authors": ["Osano"],
"description": "Osano cookie consent plugin",
Expand Down
12 changes: 6 additions & 6 deletions build/cookieconsent.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build/cookieconsent.min.js

Large diffs are not rendered by default.

47 changes: 20 additions & 27 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
var gulp = require('gulp');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var minifyJS = require('gulp-uglify');
var minifyCSS = require('gulp-minify-css');
var deleteDirs = require('del');
var runSequence = require('run-sequence');
var autoprefixer = require('gulp-autoprefixer');
var bump = require('gulp-bump');
var yargs = require('yargs');
var diff = require('gulp-diff');
const gulp = require('gulp');
const concat = require('gulp-concat');
const minifyJS = require('gulp-terser');
const minifyCSS = require('gulp-clean-css');
const deleteDirs = require('del');
const autoprefixer = require('gulp-autoprefixer');
const bump = require('gulp-bump');
const yargs = require('yargs');
const diff = require('gulp-diff-4');


var buildFolder = './build';
var jsBuildFiles = [
let buildFolder = './build';
const jsBuildFiles = [
'./src/cookieconsent.js'
];
var cssBuildFiles = [
const cssBuildFiles = [
// defined explicitly so they are combined in order
'./src/styles/animation.css',
'./src/styles/base.css',
Expand Down Expand Up @@ -46,38 +44,33 @@ gulp.task('minify:css', function () {
.pipe(gulp.dest(buildFolder)); // save under a new name
});

gulp.task('bump', function(callback) {
gulp.task('bump', function() {
return gulp.src(['./bower.json', './package.json'])
.pipe(bump({'version': yargs.argv.tag}))
.pipe(gulp.dest('./'))
});

gulp.task('build', function(callback) {
return runSequence('cleanup:begin', 'minify:js', 'minify:css', callback);
});
gulp.task('build', gulp.series('cleanup:begin', 'minify:js', 'minify:css'));

gulp.task('verify', function(callback) {
gulp.task('verify', function() {
buildFolder = "./build-verify";
return runSequence('cleanup:begin', 'minify:js', 'minify:css', 'verify:diff', callback);
return new Promise(gulp.series('cleanup:begin', 'minify:js', 'minify:css', 'verify:diff'));
});

gulp.task('verify:diff', function(callback) {
gulp.task('verify:diff', function() {
return gulp.src('./build/*')
.pipe(diff('./build-verify'))
.pipe(diff.reporter({ fail: true }));
});

gulp.task('build:release', function(callback) {
gulp.task('build:release', function() {
if (yargs.argv.tag===undefined) {
throw "A version number (e.g. 3.0.1) is required to build a release of cookieconsent"
}

return runSequence('build', 'bump', callback)
return new Promise(gulp.series('build', 'bump'));
});

gulp.task('watch', function() {
gulp.watch(cssBuildFiles.concat(jsBuildFiles), ['build']);
});

function _minify(opts) {
}
});
Loading

0 comments on commit 2b3191a

Please sign in to comment.