Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

Commit

Permalink
chore: update to latest dependencies and gulp 4
Browse files Browse the repository at this point in the history
  • Loading branch information
web-padawan committed Mar 12, 2019
1 parent cd40b00 commit c72b4a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -35,7 +35,8 @@ jobs:
script:
- if [[ "$POLYMER" = "2" ]]; then
npm -q i && npm i -q --no-save bower polymer-cli && bower -q i &&
gulp lint version:check &&
npm run lint &&
npm run version:check &&
polymer lint --rules polymer-2 --input ./src/*.html ./theme/**/*.html &&
if [[ "$TRAVIS_EVENT_TYPE" != "pull_request" && "$TRAVIS_BRANCH" != quick/* ]]; then
if [[ "$TEST_SUITE" = "visual_tests" ]]; then
Expand Down
12 changes: 6 additions & 6 deletions gulpfile.js
Expand Up @@ -15,8 +15,6 @@ const semver = require('semver');
const fs = require('fs');
const path = require('path');

gulp.task('lint', ['lint:js', 'lint:html', 'lint:css']);

gulp.task('lint:js', function() {
return gulp.src([
'*.js',
Expand Down Expand Up @@ -62,6 +60,8 @@ gulp.task('lint:css', function() {
}));
});

gulp.task('lint', gulp.parallel('lint:js', 'lint:html', 'lint:css'));

// https://github.com/bower/bower/issues/2522
gulp.task('bower:check', function(cb) {
function verifyIfPresent(resolvedPackage, bowerJson, dependenciesPath) {
Expand Down Expand Up @@ -104,7 +104,7 @@ gulp.task('bower:check', function(cb) {
cb(bowerJsonValid ? null : new Error(`Bower has dependencies resolutions that violate semver and don't allow webjars.org deployment.`));
});

gulp.task('version:check', ['bower:check'], function() {
gulp.task('version:check', gulp.series('bower:check', function() {
const expectedVersion = new RegExp('^' + require('./package.json').version + '$');
return gulp.src(['src/*.html'])
.pipe(htmlExtract({sel: 'script'}))
Expand All @@ -113,9 +113,9 @@ gulp.task('version:check', ['bower:check'], function() {
.pipe(replace(/.*\n.*return '(.*)'.*/, '$1'))
.pipe(grepContents(expectedVersion, {invert: true}))
.pipe(expect({reportUnexpected: true}, []));
});
}));

gulp.task('version:update', ['version:check'], function() {
gulp.task('version:update', gulp.series('version:check', function() {
// Should be run from 'preversion'
// Assumes that the old version is in package.json and the new version in the `npm_package_version` environment variable
const oldversion = require('./package.json').version;
Expand All @@ -130,4 +130,4 @@ gulp.task('version:update', ['version:check'], function() {
.pipe(replace(oldversion, newversion))
.pipe(gulp.dest('src'))
.pipe(git.add());
});
}));
4 changes: 3 additions & 1 deletion package.json
Expand Up @@ -24,11 +24,13 @@
],
"scripts": {
"test": "wct",
"lint": "gulp lint",
"version:check": "gulp version:check",
"prestart": "polymer analyze vaadin-* > analysis.json",
"start": "polymer serve --open",
"preversion": "gulp version:update"
},
"devDependencies": {
"@vaadin/vaadin-component-dev-dependencies": "^1.0.0"
"@vaadin/vaadin-component-dev-dependencies": "^2.0.0"
}
}

0 comments on commit c72b4a9

Please sign in to comment.