Skip to content

Commit 4f0337a

Browse files
committed
Fix gulp 4 issues
1 parent 7071cd5 commit 4f0337a

File tree

6 files changed

+5919
-6691
lines changed

6 files changed

+5919
-6691
lines changed

.travis.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,6 @@ cache:
1111
before_script:
1212
- npm install -g gulp-cli@1
1313
- gulp lint-eslint
14-
# TODO(dfreedm): re-enable after making update-types work
15-
#- >-
16-
# npm run update-types && git diff --exit-code || (echo -e
17-
# '\n\033[31mERROR:\033[0m Typings are stale. Please run "npm run
18-
# update-types".' && false)
1914
script:
2015
- node ./node_modules/.bin/polymer test --npm --module-resolution=node -l chrome
2116
- node ./node_modules/.bin/polymer test --npm --module-resolution=node -l firefox

externs/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# TODO(timvdlippe): Ignore all files here once we can generate them.
2+
# *
3+
!.gitignore
4+
!.npmignore

externs/.npmignore

Whitespace-only changes.

gulpfile.js

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
const gulp = require('gulp');
1515
const gulpif = require('gulp-if');
16-
const runseq = require('run-sequence');
1716
const del = require('del');
1817
const eslint = require('gulp-eslint');
1918
const fs = require('fs-extra');
@@ -31,8 +30,7 @@ const replace = require('gulp-replace');
3130
const DIST_DIR = 'dist';
3231
const BUNDLED_DIR = path.join(DIST_DIR, 'bundled');
3332
const COMPILED_DIR = path.join(DIST_DIR, 'compiled');
34-
const POLYMER_LEGACY = 'polymer.html';
35-
const POLYMER_ELEMENT = 'polymer-element.html';
33+
const POLYMER_LEGACY = 'polymer-legacy.js';
3634

3735
const {PolymerProject, HtmlSplitter} = require('polymer-build');
3836

@@ -64,8 +62,6 @@ class BackfillStream extends Transform {
6462
}
6563
}
6664

67-
let CLOSURE_LINT_ONLY = false;
68-
6965
let firstImportFinder = dom5.predicates.AND(
7066
dom5.predicates.hasTagName('link'), dom5.predicates.hasAttrValue('rel', 'import')
7167
);
@@ -129,8 +125,7 @@ gulp.task('generate-typescript', async () => {
129125
}
130126
});
131127

132-
gulp.task('closure', gulp.series('generate-externs', () => {
133-
128+
const runClosureOnly = ({lintOnly}) => () => {
134129
let entry, splitRx, joinRx, addClosureTypes;
135130

136131
function config(path) {
@@ -164,7 +159,7 @@ gulp.task('closure', gulp.series('generate-externs', () => {
164159

165160
let closurePluginOptions;
166161

167-
if (CLOSURE_LINT_ONLY) {
162+
if (lintOnly) {
168163
closurePluginOptions = {
169164
logger: closureLintLogger
170165
};
@@ -179,7 +174,7 @@ gulp.task('closure', gulp.series('generate-externs', () => {
179174
assume_function_wrapper: true,
180175
rewrite_polyfills: false,
181176
new_type_inf: true,
182-
checks_only: CLOSURE_LINT_ONLY,
177+
checks_only: lintOnly,
183178
polymer_version: 2,
184179
externs: [
185180
'bower_components/shadycss/externs/shadycss-externs.js',
@@ -219,12 +214,15 @@ gulp.task('closure', gulp.series('generate-externs', () => {
219214
.pipe(gulpif(joinRx, minimalDocument()))
220215
.pipe(gulpif(joinRx, size({title: 'closure size', gzip: true, showTotal: false, showFiles: true})))
221216
.pipe(gulp.dest(COMPILED_DIR));
222-
}));
217+
};
223218

224-
gulp.task('lint-closure', (done) => {
225-
CLOSURE_LINT_ONLY = true;
226-
runseq('closure', done);
227-
});
219+
gulp.task('closure', gulp.series('generate-externs', runClosureOnly({
220+
lintOnly: false
221+
})));
222+
223+
gulp.task('lint-closure', runClosureOnly({
224+
lintOnly: true
225+
}));
228226

229227
gulp.task('estimate-size', gulp.series('clean', () => {
230228

@@ -272,13 +270,11 @@ gulp.task('lint-eslint', function() {
272270
.pipe(eslint.failAfterError());
273271
});
274272

275-
gulp.task('lint', (done) => {
276-
runseq('lint-eslint', 'lint-closure', done);
277-
});
273+
// TODO(timvdlippe): Add back `, 'lint-closure'` once closure lint works again
274+
gulp.task('lint', gulp.series('lint-eslint'));
278275

279-
gulp.task('update-types', (done) => {
280-
runseq('generate-externs', 'generate-typescript', done);
281-
});
276+
// TODO(timvdlippe): Add back `'generate-externs',` once we can generate externs again
277+
gulp.task('generate-types', gulp.series('generate-typescript'));
282278

283279
gulp.task('update-version', () => {
284280
return gulp.src('lib/utils/boot.js')

0 commit comments

Comments
 (0)