Socket
Socket
Sign inDemoInstall

workbox-build

Package Overview
Dependencies
Maintainers
4
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workbox-build - npm Package Compare versions

Comparing version 3.2.0 to 3.3.0

README.md

2

build/cdn-details.json

@@ -5,3 +5,3 @@ {

"releasesDir": "releases",
"latestVersion": "3.2.0"
"latestVersion": "3.3.0"
}

@@ -53,3 +53,4 @@ 'use strict';

maxEntries: joi.number().min(1),
maxAgeSeconds: joi.number().min(1)
maxAgeSeconds: joi.number().min(1),
purgeOnQuotaError: joi.boolean().default(defaults.purgeOnQuotaError)
}).or('maxEntries', 'maxAgeSeconds'),

@@ -56,0 +57,0 @@ networkTimeoutSeconds: joi.number().min(1),

@@ -20,2 +20,3 @@ 'use strict';

module.exports = {
clientsClaim: false,
globFollow: true,

@@ -25,8 +26,8 @@ globIgnores: ['**/node_modules/**/*'],

globStrict: true,
importWorkboxFrom: 'cdn',
injectionPointRegexp: /(\.precacheAndRoute\()\s*\[\s*\]\s*(\)|,)/,
maximumFileSizeToCacheInBytes: 2 * 1024 * 1024,
clientsClaim: false,
navigateFallback: undefined,
skipWaiting: false,
importWorkboxFrom: 'cdn',
injectionPointRegexp: /(\.precacheAndRoute\()\s*\[\s*\]\s*(\)|,)/
purgeOnQuotaError: false,
skipWaiting: false
};
'use strict';
var _toConsumableArray2 = require('babel-runtime/helpers/toConsumableArray');
var _toConsumableArray3 = _interopRequireDefault(_toConsumableArray2);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*

@@ -19,7 +25,31 @@ Copyright 2017 Google Inc.

// TODO (jeffposnick): More flexibility in case naming conventions change.
// This is the build type that is expected to be present "by default".
var DEFAULT_BUILD_TYPE = 'prod';
/**
* Switches a string from using the "default" build type to an alternative
* build type. In practice, this is used to swap out "prod" for "dev" in the
* filename of a Workbox library.
*
* @param {string} source The path to a file, which will normally contain
* DEFAULT_BUILD_TYPE somewhere in it.
* @param {string} buildType The alternative build type value to swap in.
* @return {string} source, with the last occurrence of DEFAULT_BUILD_TYPE
* replaced with buildType.
* @private
*/
module.exports = function (source, buildType) {
return source.replace(DEFAULT_BUILD_TYPE, buildType);
// If we want the DEFAULT_BUILD_TYPE, then just return things as-is.
if (buildType === DEFAULT_BUILD_TYPE) {
return source;
}
// Otherwise, look for the last instance of DEFAULT_BUILD_TYPE, and replace it
// with the new buildType. This is easier via split/join than RegExp.
var parts = source.split(DEFAULT_BUILD_TYPE);
// Join the last two split parts with the new buildType. (If parts only has
// one item, this will be a no-op.)
var replaced = parts.slice(parts.length - 2).join(buildType);
// Take the remaining parts, if any exist, and join them with the replaced
// part using the DEFAULT_BUILD_TYPE, to restore any other matches as-is.
return [].concat((0, _toConsumableArray3.default)(parts.slice(0, parts.length - 2)), [replaced]).join(DEFAULT_BUILD_TYPE);
};
{
"name": "workbox-build",
"version": "3.2.0",
"version": "3.3.0",
"description": "A module that integrates into your build process, helping you generate a manifest of local files that workbox-sw should precache.",

@@ -30,14 +30,14 @@ "keywords": [

"pretty-bytes": "^4.0.2",
"workbox-background-sync": "^3.2.0",
"workbox-broadcast-cache-update": "^3.2.0",
"workbox-cache-expiration": "^3.2.0",
"workbox-cacheable-response": "^3.2.0",
"workbox-core": "^3.2.0",
"workbox-google-analytics": "^3.2.0",
"workbox-precaching": "^3.2.0",
"workbox-range-requests": "^3.2.0",
"workbox-routing": "^3.2.0",
"workbox-strategies": "^3.2.0",
"workbox-streams": "^3.2.0",
"workbox-sw": "^3.2.0"
"workbox-background-sync": "^3.3.0",
"workbox-broadcast-cache-update": "^3.3.0",
"workbox-cache-expiration": "^3.3.0",
"workbox-cacheable-response": "^3.3.0",
"workbox-core": "^3.3.0",
"workbox-google-analytics": "^3.3.0",
"workbox-precaching": "^3.3.0",
"workbox-range-requests": "^3.3.0",
"workbox-routing": "^3.3.0",
"workbox-strategies": "^3.3.0",
"workbox-streams": "^3.3.0",
"workbox-sw": "^3.3.0"
},

@@ -44,0 +44,0 @@ "main": "build/index.js",

@@ -5,3 +5,3 @@ {

"releasesDir": "releases",
"latestVersion": "3.2.0"
"latestVersion": "3.3.0"
}

@@ -58,2 +58,3 @@ /*

maxAgeSeconds: joi.number().min(1),
purgeOnQuotaError: joi.boolean().default(defaults.purgeOnQuotaError),
}).or('maxEntries', 'maxAgeSeconds'),

@@ -60,0 +61,0 @@ networkTimeoutSeconds: joi.number().min(1),

@@ -18,2 +18,3 @@ /*

module.exports = {
clientsClaim: false,
globFollow: true,

@@ -23,8 +24,8 @@ globIgnores: ['**/node_modules/**/*'],

globStrict: true,
importWorkboxFrom: 'cdn',
injectionPointRegexp: /(\.precacheAndRoute\()\s*\[\s*\]\s*(\)|,)/,
maximumFileSizeToCacheInBytes: 2 * 1024 * 1024,
clientsClaim: false,
navigateFallback: undefined,
purgeOnQuotaError: false,
skipWaiting: false,
importWorkboxFrom: 'cdn',
injectionPointRegexp: /(\.precacheAndRoute\()\s*\[\s*\]\s*(\)|,)/,
};

@@ -17,7 +17,34 @@ /*

// TODO (jeffposnick): More flexibility in case naming conventions change.
// This is the build type that is expected to be present "by default".
const DEFAULT_BUILD_TYPE = 'prod';
/**
* Switches a string from using the "default" build type to an alternative
* build type. In practice, this is used to swap out "prod" for "dev" in the
* filename of a Workbox library.
*
* @param {string} source The path to a file, which will normally contain
* DEFAULT_BUILD_TYPE somewhere in it.
* @param {string} buildType The alternative build type value to swap in.
* @return {string} source, with the last occurrence of DEFAULT_BUILD_TYPE
* replaced with buildType.
* @private
*/
module.exports = (source, buildType) => {
return source.replace(DEFAULT_BUILD_TYPE, buildType);
// If we want the DEFAULT_BUILD_TYPE, then just return things as-is.
if (buildType === DEFAULT_BUILD_TYPE) {
return source;
}
// Otherwise, look for the last instance of DEFAULT_BUILD_TYPE, and replace it
// with the new buildType. This is easier via split/join than RegExp.
const parts = source.split(DEFAULT_BUILD_TYPE);
// Join the last two split parts with the new buildType. (If parts only has
// one item, this will be a no-op.)
const replaced = parts.slice(parts.length - 2).join(buildType);
// Take the remaining parts, if any exist, and join them with the replaced
// part using the DEFAULT_BUILD_TYPE, to restore any other matches as-is.
return [
...parts.slice(0, parts.length - 2),
replaced,
].join(DEFAULT_BUILD_TYPE);
};
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc