Skip to content

Commit

Permalink
Updates various devDependencies (GoogleChrome#2357)
Browse files Browse the repository at this point in the history
* Updates various devDependencies

* Swithcing back to Object

* Switch node back to 8

* Revert a test changee
  • Loading branch information
jeffposnick authored Feb 7, 2020
1 parent 7eb0a51 commit 8e2db21
Show file tree
Hide file tree
Showing 95 changed files with 7,576 additions and 9,804 deletions.
10 changes: 9 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,15 @@ module.exports = {
plugins: [
'jsdoc',
],
settings: {
jsdoc: {
preferredTypes: {
object: 'Object',
},
},
},
overrides: [{
files: ['test/**/*.{js,mjs}'],
parser: 'babel-eslint',
env: {
mocha: true,
},
Expand Down Expand Up @@ -140,4 +146,6 @@ module.exports = {
'no-console': 0,
},
}],
// eslint can't parse some of these files.
ignorePatterns: ['**/wasm-project/**'],
};
2 changes: 1 addition & 1 deletion demos/src/workbox-broadcast-update/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ workbox.setConfig({


const broadcastUpdate = new workbox.broadcastUpdate.BroadcastCacheUpdate(
'broadcast-update-demo'
'broadcast-update-demo',
);

const initialResponse = new Response('Response 1', {
Expand Down
2 changes: 1 addition & 1 deletion demos/src/workbox-cacheable-response/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ app.get('/api/is-response-cacheable',
} else {
res.send(`This response has no 'X-Is-Cacheable' header`);
}
}
},
);
2 changes: 1 addition & 1 deletion demos/src/workbox-expiration/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const updateEntry = async (entryID) => {

openCache.put(
`example-entry-${entryID}`,
new Response(`Hello from entry number ${entryID}`)
new Response(`Hello from entry number ${entryID}`),
);

expirationManager.updateTimestamp(`example-entry-${entryID}`);
Expand Down
2 changes: 1 addition & 1 deletion demos/src/workbox-range-requests/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ workbox.routing.registerRoute(
plugins: [
new workbox.rangeRequests.RangeRequestsPlugin(),
],
})
}),
);

workbox.core.skipWaiting();
Expand Down
4 changes: 2 additions & 2 deletions demos/src/workbox-strategies/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ self.addEventListener('install', (event) => {
.then((cache) => {
return cache.put(
new Request('/public/cache-only-populated-cache'),
new Response('Hello from the populated cache.')
new Response('Hello from the populated cache.'),
);
})
}),
);
});
2 changes: 1 addition & 1 deletion demos/src/workbox-streams/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const streamsStrategy = workbox.streams.strategy([
// Once the strategy is configured, the actual routing looks clean.
workbox.routing.registerRoute(
new RegExp('iframe$'),
streamsStrategy
streamsStrategy,
);

workbox.core.skipWaiting();
Expand Down
4 changes: 2 additions & 2 deletions demos/src/workbox-sw/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ workbox.precaching.precacheAndRoute([
// Demonstrates using default cache
workbox.routing.registerRoute(
new RegExp('.*\\.(?:js)'),
new workbox.strategies.NetworkFirst()
new workbox.strategies.NetworkFirst(),
);

// Demonstrates a custom cache name for a route.
Expand All @@ -25,5 +25,5 @@ workbox.routing.registerRoute(
maxEntries: 3,
}),
],
})
}),
);
4 changes: 2 additions & 2 deletions gulp-tasks/build-browser-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ gulp.task('build-browser-packages:browser-bundle', gulp.series(
'browser',
buildBrowserBundle,
constants.BUILD_TYPES[buildKey],
))
)),
));

gulp.task('build-browser-packages:version-module', gulp.series(
packageRunnner(
'build-browser-packages:version-module',
'browser',
versionModule)
versionModule),
));

gulp.task('build-browser-packages', gulp.series(
Expand Down
4 changes: 2 additions & 2 deletions gulp-tasks/build-node-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ gulp.task('build-node-packages', gulp.series(
packageRunnner(
'build-node-packages',
'node',
buildNodePackage
)
buildNodePackage,
),
));
6 changes: 3 additions & 3 deletions gulp-tasks/build-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ gulp.task('build-packages:clean', gulp.series(
packageRunnner(
'build-packages:clean',
'all',
cleanPackage
)
cleanPackage,
),
));

gulp.task('build-packages:build', gulp.series(
Expand All @@ -55,5 +55,5 @@ gulp.task('build-packages:build', gulp.series(

gulp.task('build-packages', gulp.series(
'build-packages:clean',
'build-packages:build'
'build-packages:build',
));
4 changes: 2 additions & 2 deletions gulp-tasks/build-window-packages.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ gulp.task('build-window-packages:window-bundle', gulp.series(
'window',
buildWindowBundle,
constants.BUILD_TYPES[buildKey],
))
)),
));

gulp.task('build-window-packages:version-module', gulp.series(
packageRunnner(
'build-window-packages:version-module',
'window',
versionModule)
versionModule),
));

gulp.task('build-window-packages', gulp.series(
Expand Down
4 changes: 2 additions & 2 deletions gulp-tasks/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ gulp.task('lerna-bootstrap', () => {
// If it's not a star, we can scope the build to a specific project.
return lernaWrapper.bootstrap(
'--include-dependencies',
'--scope', global.packageOrStar
'--scope', global.packageOrStar,
);
});

Expand All @@ -29,7 +29,7 @@ gulp.task('lerna-bootstrap', () => {
// Make sure this runs **before** lerna-bootstrap.
gulp.task('build:update-cdn-details', async function() {
const cdnDetails = await fs.readJSON(path.join(
__dirname, '..', 'cdn-details.json'
__dirname, '..', 'cdn-details.json',
));

const workboxBuildPath = path.join(
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ You can view a friendlier UI by running
`);
params.push(
'--template', path.join(
__dirname, '..', 'infra', 'templates', 'reference-docs', 'jsdoc'
__dirname, '..', 'infra', 'templates', 'reference-docs', 'jsdoc',
),
'--query', queryString,
);
Expand Down
6 changes: 3 additions & 3 deletions gulp-tasks/publish-cdn.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ const cleanTagName = (name) => {

const findMissingCDNTags = async (tagsData) => {
const missingTags = [];
for (let tagData of tagsData) {
let exists = await cdnUploadHelper.tagExists(cleanTagName(tagData.name));
for (const tagData of tagsData) {
const exists = await cdnUploadHelper.tagExists(cleanTagName(tagData.name));

if (!exists) {
missingTags.push(tagData);
Expand Down Expand Up @@ -66,7 +66,7 @@ gulp.task('publish-cdn:generate-from-tags', async () => {
logHelper.log(`No tags missing from CDN.`);
}

for (let tagData of missingTags) {
for (const tagData of missingTags) {
// Override the git branch here since we aren't actually
// using a tagged release.
await handleCDNUpload(tagData.name, tagData.name);
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/publish-github.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ gulp.task('publish-github:generate-from-tags', async () => {
return;
}

for (let tagInfo of tagsToBuild) {
for (const tagInfo of tagsToBuild) {
await handleGithubRelease(
tagInfo.name, tagInfo.name, taggedReleases[tagInfo.name]);
}
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/test-integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const runFiles = (filePaths) => {
// Run the tests.
mocha.run(function(failureCount) {
if (failureCount > 0) {
return reject(`${failureCount} tests failed.`);
return reject(new Error(`${failureCount} tests failed.`));
}
resolve();
});
Expand Down
4 changes: 2 additions & 2 deletions gulp-tasks/test-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const runNodeTestSuite = async (testPath, nodeEnv) => {
};

const runNodeTestsWithEnv = async (testGroup, nodeEnv) => {
let globConfig = {
const globConfig = {
ignore: [
'**/all/**',
],
Expand Down Expand Up @@ -83,7 +83,7 @@ gulp.task('test-node:coverage', () => {
runOptions.push('--');
runOptions.push('--include');
runOptions.push(
path.posix.join('packages', global.packageOrStar, '**', '*')
path.posix.join('packages', global.packageOrStar, '**', '*'),
);
}
return spawn(getNpmCmd(), runOptions);
Expand Down
4 changes: 2 additions & 2 deletions gulp-tasks/utils/build-browser-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ module.exports = async (packagePath, buildType) => {
// there is nothing to build
if (!fs.existsSync(packageIndex)) {
logHelper.error(ERROR_NO_MODULE_INDEX + packageName);
return Promise.reject(ERROR_NO_MODULE_INDEX + packageName);
return Promise.reject(new Error(ERROR_NO_MODULE_INDEX + packageName));
}

const pkgJson = require(path.join(packagePath, 'package.json'));
if (!pkgJson.workbox || !pkgJson.workbox.browserNamespace) {
logHelper.error(ERROR_NO_NAMSPACE + ' ' + packageName);
return Promise.reject(ERROR_NO_NAMSPACE + ' ' + packageName);
return Promise.reject(new Error(ERROR_NO_NAMSPACE + ' ' + packageName));
}

let outputFilename = pkgJson.workbox.outputFilename || packageName;
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/utils/build-window-bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async (packagePath, buildType) => {
// there is nothing to build
if (!fs.existsSync(moduleBrowserPath)) {
logHelper.error(ERROR_NO_MODULE_BROWSER + packageName);
return Promise.reject(ERROR_NO_MODULE_BROWSER + packageName);
return Promise.reject(new Error(ERROR_NO_MODULE_BROWSER + packageName));
}

const outputDirectory = path.join(
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/utils/cdn-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ class CDNHelper {
throw err;
}
publicUrls.push(
`${cdnDetails.origin}/${cdnDetails.bucketName}/${destination}`
`${cdnDetails.origin}/${cdnDetails.bucketName}/${destination}`,
);
}

Expand Down
4 changes: 2 additions & 2 deletions gulp-tasks/utils/github-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
https://opensource.org/licenses/MIT.
*/

const GitHubApi = require('@octokit/rest');
const octokit = require('@octokit/rest').Octokit;
const semver = require('semver');

const constants = require('./constants');

const github = new GitHubApi();
const github = octokit();

// github.authenticate() is synchronous, and it only stores the credentials for
// the next request, so it should be called once per method that requires auth.
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/utils/package-runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ function getPackages(typeFilter) {
return glob.sync(
`packages/${global.packageOrStar}/package.json`, {
absolute: true,
}
},
).filter((pathToPackageJson) => {
const pkgInfo = require(pathToPackageJson);
const packageType = pkgInfo.workbox.packageType;
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/utils/rollup-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ module.exports = {
}
plugins.push(babel(babelConfig));

let minifyBuild = buildType === constants.BUILD_TYPES.prod;
const minifyBuild = buildType === constants.BUILD_TYPES.prod;
if (minifyBuild) {
const terserOptions = {
module: buildFormat === 'esm' ? true : false,
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/utils/spawn-promise-wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = (command, args, options = {}) => {
if (code === 0) {
resolve();
} else {
reject(`Error ${code} returned from ${command} ${args}`);
reject(new Error(`Error ${code} returned from ${command} ${args}`));
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion gulp-tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ gulp.task('watch', gulp.series(
.on('change', function(path, stats) {
logHelper.log(`gulp.watch() was triggered by '${path}'`);
});
}
},
));
2 changes: 1 addition & 1 deletion infra/templates/reference-docs/jsdoc/publish.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports.publish = function(data, opts, tutorials) {
docletHelper.getCategory('classes')
.concat(docletHelper.getCategory('namespaces'))
.concat(docletHelper.getCategory('interfaces')),
global.env.opts.query ? global.env.opts.query.basepath : ''
global.env.opts.query ? global.env.opts.query.basepath : '',
);
job.generateIndexAll(Object.keys(docletHelper.longname));
};
2 changes: 1 addition & 1 deletion infra/testing/activate-and-control.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ module.exports = async (swURL) => {
return;
}

let serviceWorker = registration.installing;
const serviceWorker = registration.installing;

// We unregister all service workers after each test - this should
// always trigger an install state change
Expand Down
2 changes: 1 addition & 1 deletion infra/testing/create-webpack-asset-plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CreateWebpackAssetPlugin {
(compilation) => compilation.assets[this.name] = {
source: () => this.name,
size: () => this.name.length,
}
},
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion infra/testing/generate-variant-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const generateVariantTests = (itTitle, variants, func) => {
// Use .call to get the correct `this` binding needed by mocha.
// eslint-disable-next-line no-invalid-this
return func.call(this, variant);
}
},
);
});
};
Expand Down
1 change: 1 addition & 0 deletions infra/utils/AsyncDebounce.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class AsyncDebounce {

call() {
if (!this._promise) {
/* eslint-disable no-async-promise-executor */
this._promise = new Promise(async (resolve) => {
do {
this._needsRecall = false;
Expand Down
Loading

0 comments on commit 8e2db21

Please sign in to comment.