Skip to content

Commit 4a5fadb

Browse files
authored
Merge pull request #703 from swisnl/major-deps-upgrade
Upgrade to gulp 4
2 parents 32bdc38 + 8e463e7 commit 4a5fadb

File tree

5 files changed

+1108
-1626
lines changed

5 files changed

+1108
-1626
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ env:
1616
matrix:
1717
include:
1818
- language: node_js
19-
node_js: "8"
19+
node_js: "10"
2020
env: JQUERY=1
2121
- language: node_js
22-
node_js: "8"
22+
node_js: "10"
2323
env: JQUERY=2
2424
- language: node_js
25-
node_js: "8"
25+
node_js: "10"
2626
env: JQUERY=3
2727
- language: php
2828
php: 5.5

gulpfile.js

Lines changed: 26 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,6 @@ gulp.task('jshint', function (cb) {
6868
],cb);
6969
});
7070

71-
gulp.task('jscs', function (cb) {
72-
// Broken in new release...
73-
return;
74-
pump([
75-
gulp.src(scripts.src),
76-
plugins.jscs(),
77-
plugins.jscs.reporter(),
78-
plugins.jscs.reporter('fail')
79-
], cb);
80-
});
81-
82-
gulp.task('js', ['jshint', 'jscs', 'jslibs', 'jsdist']);
83-
8471
gulp.task('jsdist', function (cb) {
8572
pump([
8673
gulp.src(scripts.src),
@@ -110,25 +97,14 @@ gulp.task('jslibs', function (cb){
11097
});
11198

11299
gulp.task('css', function (cb) {
113-
pump([
100+
return pump([
114101
gulp.src(styles.src),
115102
sass(),
116103
plugins.csslint('src/.csslintrc'),
117104
plugins.csslint.formatter(),
118105
plugins.sourcemaps.init(),
119106
plugins.replace(replacement.regexp, replacement.filter),
120-
plugins.autoprefixer({
121-
browsers: [
122-
'Android 2.3',
123-
'Android >= 4',
124-
'Chrome >= 20',
125-
'Firefox >= 24',
126-
'Explorer >= 8',
127-
'iOS >= 6',
128-
'Opera >= 12',
129-
'Safari >= 6'
130-
]
131-
}),
107+
plugins.autoprefixer(),
132108
plugins.csscomb('src/.csscomb.json'),
133109
plugins.rename(styles.name),
134110
gulp.dest(styles.dest),
@@ -139,11 +115,11 @@ gulp.task('css', function (cb) {
139115
], cb);
140116
});
141117

142-
gulp.task('build-icons', function () {
118+
gulp.task('build-icons', function (done) {
143119
var iconfont = require('gulp-iconfont');
144120
var consolidate = require('gulp-consolidate');
145121

146-
gulp.src(icons.src)
122+
return gulp.src(icons.src)
147123
.pipe(iconfont({
148124
fontName: 'context-menu-icons',
149125
fontHeight: 1024,
@@ -171,28 +147,38 @@ gulp.task('build-icons', function () {
171147
.pipe(gulp.dest('src/sass')); // set path to export your sample HTML
172148
})
173149
.pipe(gulp.dest(icons.fontOutputPath));
150+
174151
});
175152

176153
/**
177154
* Update paths in integration tests that are generated by the documentation
178155
* generator so they use the local source.
179156
*/
180157
gulp.task('integration-test-paths', function(){
181-
182-
183158
return gulp.src('test/integration/html/*.html').
184-
pipe(plugins.replace('https\:\/\/swisnl\.github\.io\/jQuery-contextMenu\/dist\/jquery\.ui\.position\.min\.js', '\.\.\/\.\.\/\.\.\/dist\/jquery\.ui\.position\.min\.js')).
185-
pipe(plugins.replace('https\:\/\/swisnl\.github\.io\/jQuery\-contextMenu\/dist\/', '\.\.\/\.\.\/\.\.\/src\/')).
186-
pipe(plugins.replace('\/src\/jquery.contextMenu.css', '\/dist\/jquery.contextMenu.css')).
187-
pipe(gulp.dest('test/integration/html/'));
159+
pipe(plugins.replace('https\:\/\/swisnl\.github\.io\/jQuery-contextMenu\/dist\/jquery\.ui\.position\.min\.js', '\.\.\/\.\.\/\.\.\/dist\/jquery\.ui\.position\.min\.js')).
160+
pipe(plugins.replace('https\:\/\/swisnl\.github\.io\/jQuery\-contextMenu\/dist\/', '\.\.\/\.\.\/\.\.\/src\/')).
161+
pipe(plugins.replace('\/src\/jquery.contextMenu.css', '\/dist\/jquery.contextMenu.css')).
162+
pipe(gulp.dest('test/integration/html/'));
188163
});
189164

190165

191-
gulp.task('watch', ['js', 'css'], function () {
192-
gulp.watch(scripts.src, ['js']);
193-
gulp.watch(styles.all, ['css']);
194-
});
195166

196-
gulp.task('build', ['build-icons', 'css', 'js', 'integration-test-paths']);
197167

198-
gulp.task('default', ['watch']);
168+
gulp.task('js', gulp.series('jshint', 'jsdist', (done) => {
169+
done();
170+
}));
171+
172+
173+
gulp.task('watch', gulp.parallel('js', 'css', function (done) {
174+
gulp.watch(scripts.src,gulp.series('js'));
175+
gulp.watch(styles.all, gulp.series('css'));
176+
done();
177+
}));
178+
gulp.task('build', gulp.series('build-icons', 'css', 'js', 'integration-test-paths', (done) => {
179+
done();
180+
}));
181+
182+
gulp.task('default', gulp.series('watch', (done) => {
183+
done();
184+
}));

package.json

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
},
1313
"devDependencies": {
1414
"doctoc": "^1.3.1",
15-
"gulp": "^3.9.1",
16-
"gulp-autoprefixer": "^5.0.0",
17-
"gulp-clean-css": "^3.9.3",
15+
"gulp": "^4.0.2",
16+
"gulp-autoprefixer": "^7.0.1",
17+
"gulp-clean-css": "^4.2.0",
1818
"gulp-concat": "~2.6.0",
1919
"gulp-consolidate": "^0.2.0",
2020
"gulp-csscomb": "^3.0.8",
@@ -25,28 +25,28 @@
2525
"gulp-iconfont": "^10.0.1",
2626
"gulp-jscs": "^4.1.0",
2727
"gulp-jshint": "^2.1.0",
28-
"gulp-load-plugins": "^1.3.0",
28+
"gulp-load-plugins": "^2.0.1",
2929
"gulp-qunit": "^2.0.0",
3030
"gulp-rename": "^1.2.2",
3131
"gulp-replace": "^1.0.0",
3232
"gulp-sass": "^4.0.1",
3333
"gulp-sourcemaps": "^2.6.4",
3434
"gulp-uglify": "^3.0.0",
3535
"jshint": "^2.9.4",
36-
"karma": "^2.0.0",
37-
"karma-chrome-launcher": "^2.0.0",
36+
"karma": "^4.3.0",
37+
"karma-chrome-launcher": "^3.1.0",
3838
"karma-phantomjs-launcher": "^1.0.2",
39-
"karma-qunit": "^2.0.1",
40-
"karma-sauce-launcher": "1.2.0",
39+
"karma-qunit": "^4.0.0",
40+
"karma-sauce-launcher": "2.0.2",
4141
"lodash": "^4.17.5",
4242
"pump": "^3.0.0",
4343
"qunit": "^2.0.1",
4444
"qunitjs": "^2.0.1",
4545
"wdio-dot-reporter": "^0.0.10",
4646
"wdio-mocha-framework": "^0.6.2",
4747
"wdio-sauce-service": "^0.4.8",
48-
"wdio-selenium-standalone-service": "^0.0.10",
49-
"webdriverio": "^4.12.0"
48+
"wdio-selenium-standalone-service": "^0.0.12",
49+
"webdriverio": "^5.14.3"
5050
},
5151
"description": "Management facility for context menus. Developed for a large number of triggering objects. HTML5 Polyfill",
5252
"keywords": [
@@ -90,5 +90,15 @@
9090
"test-unit": "./node_modules/karma/bin/karma start",
9191
"test-sauce": "./node_modules/karma/bin/karma start karma-saucelabs.conf.js",
9292
"test-accept": "./node_modules/.bin/wdio wdio.conf.js"
93-
}
93+
},
94+
"browserslist": [
95+
"Android 2.3",
96+
"Android >= 4",
97+
"Chrome >= 20",
98+
"Firefox >= 24",
99+
"Explorer >= 8",
100+
"iOS >= 6",
101+
"Opera >= 12",
102+
"Safari >= 6"
103+
]
94104
}

src/sass/icons/_variables.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DON'T MANUALLY EDIT THIS FILE; run `gulp build-icons` instead.
2-
$context-menu-icons-cachebust: "1zyug";
2+
$context-menu-icons-cachebust: "2fybw";
33
$context-menu-icons: (
44
add: "EA01",
55
copy: "EA02",

0 commit comments

Comments
 (0)