updating typescript version and types (#3181)

* updating typescript version and types

* Updating dependencies types dependencies
This commit is contained in:
Adriana Jara
2023-05-17 15:02:57 -07:00
committed by GitHub
parent 9ba1caaad4
commit 2a327311e8
24 changed files with 16271 additions and 11425 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 10.x
node-version: 16.x
- name: Get npm cache directory
id: npm-cache
@@ -39,7 +39,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: 12.x
node-version: 16.x
- uses: actions/cache@v2
with:
+4
View File
@@ -82,6 +82,10 @@ async function generateWorkboxBuildJSONSchema(packagePath) {
schema.definitions.OnSyncCallback = {};
}
if (schema.definitions.AbortSignal) {
schema.definitions.AbortSignal = {};
}
if (schema.definitions.RouteMatchCallback) {
schema.definitions.RouteMatchCallback = {};
}
+1396 -747
View File
File diff suppressed because it is too large Load Diff
+6 -6
View File
@@ -22,8 +22,8 @@
"@types/fs-extra": "^9.0.5",
"@types/lodash": "^4.14.165",
"@types/stringify-object": "^3.3.0",
"@typescript-eslint/eslint-plugin": "^4.32.0",
"@typescript-eslint/parser": "^4.32.0",
"@typescript-eslint/eslint-plugin": "^5.59.0",
"@typescript-eslint/parser": "^5.59.0",
"acorn": "^8.0.1",
"babel-plugin-transform-async-to-promises": "^0.8.15",
"babylon": "^6.18.0",
@@ -71,16 +71,16 @@
"require-dir": "^1.2.0",
"rollup": "^2.43.1",
"rollup-plugin-terser": "^7.0.0",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-typescript2": "^0.34.1",
"selenium-assistant": "^6.1.1",
"semver": "^7.3.2",
"serve-index": "^1.9.1",
"service-worker-mock": "^1.9.3",
"sinon": "^9.0.3",
"tempy": "^0.6.0",
"type-fest": "^2.3.4",
"typescript": "^4.4.3",
"typescript-json-schema": "^0.51.0",
"type-fest": "^3.8.0",
"typescript": "^4.9.5",
"typescript-json-schema": "^0.56.0",
"upath": "^1.2.0",
"webpack-v4": "npm:webpack@^4.44.2",
"webpack-v5": "npm:webpack@^5.9.0",
+5294 -5003
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -64,6 +64,6 @@
},
"types": "build/index.d.ts",
"devDependencies": {
"@types/node": "^16.10.2"
"@types/node": "^18.15.11"
}
}
@@ -628,6 +628,9 @@
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/ReadableStream<any>"
},
{
"$ref": "#/definitions/Blob"
},
@@ -637,9 +640,6 @@
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
@@ -670,19 +670,26 @@
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
"$ref": "#/definitions/Record<string,string>"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
"items": [
{
"type": "string"
},
{
"type": "string"
}
],
"minItems": 2,
"maxItems": 2
}
},
{
"$ref": "#/definitions/Record<string,string>"
"$ref": "#/definitions/Headers"
}
]
},
@@ -739,7 +746,9 @@
}
]
},
"window": {}
"window": {
"type": "null"
}
},
"additionalProperties": false
},
@@ -749,13 +758,13 @@
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"__@toStringTag@25": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"__@toStringTag@25",
"byteLength"
]
},
@@ -763,14 +772,7 @@
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
"$ref": "#/definitions/ArrayBufferLike"
},
"byteLength": {
"type": "number"
@@ -786,16 +788,26 @@
"byteOffset"
]
},
"ArrayBufferLike": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"__@species@598": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"__@toStringTag@25": {
"type": "string",
"enum": [
"SharedArrayBuffer"
@@ -804,11 +816,23 @@
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"__@species@598",
"__@toStringTag@25",
"byteLength"
]
},
"ReadableStream<any>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Blob": {
"type": "object",
"properties": {
@@ -833,50 +857,15 @@
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"Record<string,string>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
"additionalProperties": false
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"AbortSignal": {},
"RouteMatchCallback": {}
},
"$schema": "http://json-schema.org/draft-07/schema#"
@@ -158,601 +158,7 @@
"sticky",
"unicode"
]
},
"GoogleAnalyticsInitializeOptions": {
"type": "object",
"properties": {
"cacheName": {
"type": "string"
},
"parameterOverrides": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"hitFilter": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
"RuntimeCaching": {
"type": "object",
"properties": {
"handler": {
"description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
"anyOf": [
{
"$ref": "#/definitions/RouteHandlerCallback"
},
{
"$ref": "#/definitions/RouteHandlerObject"
},
{
"enum": [
"CacheFirst",
"CacheOnly",
"NetworkFirst",
"NetworkOnly",
"StaleWhileRevalidate"
],
"type": "string"
}
]
},
"method": {
"description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
"default": "GET",
"enum": [
"DELETE",
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
],
"type": "string"
},
"options": {
"type": "object",
"properties": {
"backgroundSync": {
"description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"options": {
"$ref": "#/definitions/QueueOptions"
}
},
"additionalProperties": false,
"required": [
"name"
]
},
"broadcastUpdate": {
"description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"channelName": {
"type": "string"
},
"options": {
"$ref": "#/definitions/BroadcastCacheUpdateOptions"
}
},
"additionalProperties": false,
"required": [
"options"
]
},
"cacheableResponse": {
"description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheableResponseOptions"
},
"cacheName": {
"description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
"type": [
"null",
"string"
]
},
"expiration": {
"description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/ExpirationPluginOptions"
},
"networkTimeoutSeconds": {
"description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
"type": "number"
},
"plugins": {
"description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
"type": "array",
"items": {
"$ref": "#/definitions/WorkboxPlugin"
}
},
"precacheFallback": {
"description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"fallbackURL": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"fallbackURL"
]
},
"rangeRequests": {
"description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "boolean"
},
"fetchOptions": {
"description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/RequestInit"
},
"matchOptions": {
"description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheQueryOptions"
}
},
"additionalProperties": false
},
"urlPattern": {
"description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"$ref": "#/definitions/RouteMatchCallback"
},
{
"type": "string"
}
]
}
},
"additionalProperties": false,
"required": [
"handler",
"urlPattern"
]
},
"RouteHandlerCallback": {},
"RouteHandlerObject": {
"description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
"type": "object",
"properties": {
"handle": {
"$ref": "#/definitions/RouteHandlerCallback"
}
},
"additionalProperties": false,
"required": [
"handle"
]
},
"QueueOptions": {
"type": "object",
"properties": {
"forceSyncFallback": {
"type": "boolean"
},
"maxRetentionTime": {
"type": "number"
},
"onSync": {
"$ref": "#/definitions/OnSyncCallback"
}
},
"additionalProperties": false
},
"OnSyncCallback": {},
"BroadcastCacheUpdateOptions": {
"type": "object",
"properties": {
"headersToCheck": {
"type": "array",
"items": {
"type": "string"
}
},
"generatePayload": {
"type": "object",
"additionalProperties": false
},
"notifyAllClients": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheableResponseOptions": {
"type": "object",
"properties": {
"statuses": {
"type": "array",
"items": {
"type": "number"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"ExpirationPluginOptions": {
"type": "object",
"properties": {
"maxEntries": {
"type": "number"
},
"maxAgeSeconds": {
"type": "number"
},
"matchOptions": {
"$ref": "#/definitions/CacheQueryOptions"
},
"purgeOnQuotaError": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheQueryOptions": {
"type": "object",
"properties": {
"ignoreMethod": {
"type": "boolean"
},
"ignoreSearch": {
"type": "boolean"
},
"ignoreVary": {
"type": "boolean"
}
},
"additionalProperties": false
},
"WorkboxPlugin": {
"description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
"type": "object",
"properties": {
"cacheDidUpdate": {},
"cachedResponseWillBeUsed": {},
"cacheKeyWillBeUsed": {},
"cacheWillUpdate": {},
"fetchDidFail": {},
"fetchDidSucceed": {},
"handlerDidComplete": {},
"handlerDidError": {},
"handlerDidRespond": {},
"handlerWillRespond": {},
"handlerWillStart": {},
"requestWillFetch": {}
},
"additionalProperties": false
},
"CacheDidUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"CachedResponseWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheKeyWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheWillUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidFailCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidSucceedCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidCompleteCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidErrorCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillStartCallback": {
"type": "object",
"additionalProperties": false
},
"RequestWillFetchCallback": {
"type": "object",
"additionalProperties": false
},
"RequestInit": {
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/Blob"
},
{
"$ref": "#/definitions/FormData"
},
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
"string"
]
}
]
},
"cache": {
"enum": [
"default",
"force-cache",
"no-cache",
"no-store",
"only-if-cached",
"reload"
],
"type": "string"
},
"credentials": {
"enum": [
"include",
"omit",
"same-origin"
],
"type": "string"
},
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/Record<string,string>"
}
]
},
"integrity": {
"type": "string"
},
"keepalive": {
"type": "boolean"
},
"method": {
"type": "string"
},
"mode": {
"enum": [
"cors",
"navigate",
"no-cors",
"same-origin"
],
"type": "string"
},
"redirect": {
"enum": [
"error",
"follow",
"manual"
],
"type": "string"
},
"referrer": {
"type": "string"
},
"referrerPolicy": {
"enum": [
"",
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"strict-origin-when-cross-origin",
"unsafe-url"
],
"type": "string"
},
"signal": {
"anyOf": [
{
"$ref": "#/definitions/AbortSignal"
},
{
"type": "null"
}
]
},
"window": {}
},
"additionalProperties": false
},
"ArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"byteLength"
]
},
"ArrayBufferView": {
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"buffer",
"byteLength",
"byteOffset"
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"type": "string",
"enum": [
"SharedArrayBuffer"
]
}
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"byteLength"
]
},
"Blob": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"size",
"type"
]
},
"FormData": {
"type": "object",
"additionalProperties": false
},
"URLSearchParams": {
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"RouteMatchCallback": {}
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
@@ -173,601 +173,7 @@
"sticky",
"unicode"
]
},
"GoogleAnalyticsInitializeOptions": {
"type": "object",
"properties": {
"cacheName": {
"type": "string"
},
"parameterOverrides": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"hitFilter": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
"RuntimeCaching": {
"type": "object",
"properties": {
"handler": {
"description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
"anyOf": [
{
"$ref": "#/definitions/RouteHandlerCallback"
},
{
"$ref": "#/definitions/RouteHandlerObject"
},
{
"enum": [
"CacheFirst",
"CacheOnly",
"NetworkFirst",
"NetworkOnly",
"StaleWhileRevalidate"
],
"type": "string"
}
]
},
"method": {
"description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
"default": "GET",
"enum": [
"DELETE",
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
],
"type": "string"
},
"options": {
"type": "object",
"properties": {
"backgroundSync": {
"description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"options": {
"$ref": "#/definitions/QueueOptions"
}
},
"additionalProperties": false,
"required": [
"name"
]
},
"broadcastUpdate": {
"description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"channelName": {
"type": "string"
},
"options": {
"$ref": "#/definitions/BroadcastCacheUpdateOptions"
}
},
"additionalProperties": false,
"required": [
"options"
]
},
"cacheableResponse": {
"description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheableResponseOptions"
},
"cacheName": {
"description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
"type": [
"null",
"string"
]
},
"expiration": {
"description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/ExpirationPluginOptions"
},
"networkTimeoutSeconds": {
"description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
"type": "number"
},
"plugins": {
"description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
"type": "array",
"items": {
"$ref": "#/definitions/WorkboxPlugin"
}
},
"precacheFallback": {
"description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"fallbackURL": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"fallbackURL"
]
},
"rangeRequests": {
"description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "boolean"
},
"fetchOptions": {
"description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/RequestInit"
},
"matchOptions": {
"description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheQueryOptions"
}
},
"additionalProperties": false
},
"urlPattern": {
"description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"$ref": "#/definitions/RouteMatchCallback"
},
{
"type": "string"
}
]
}
},
"additionalProperties": false,
"required": [
"handler",
"urlPattern"
]
},
"RouteHandlerCallback": {},
"RouteHandlerObject": {
"description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
"type": "object",
"properties": {
"handle": {
"$ref": "#/definitions/RouteHandlerCallback"
}
},
"additionalProperties": false,
"required": [
"handle"
]
},
"QueueOptions": {
"type": "object",
"properties": {
"forceSyncFallback": {
"type": "boolean"
},
"maxRetentionTime": {
"type": "number"
},
"onSync": {
"$ref": "#/definitions/OnSyncCallback"
}
},
"additionalProperties": false
},
"OnSyncCallback": {},
"BroadcastCacheUpdateOptions": {
"type": "object",
"properties": {
"headersToCheck": {
"type": "array",
"items": {
"type": "string"
}
},
"generatePayload": {
"type": "object",
"additionalProperties": false
},
"notifyAllClients": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheableResponseOptions": {
"type": "object",
"properties": {
"statuses": {
"type": "array",
"items": {
"type": "number"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"ExpirationPluginOptions": {
"type": "object",
"properties": {
"maxEntries": {
"type": "number"
},
"maxAgeSeconds": {
"type": "number"
},
"matchOptions": {
"$ref": "#/definitions/CacheQueryOptions"
},
"purgeOnQuotaError": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheQueryOptions": {
"type": "object",
"properties": {
"ignoreMethod": {
"type": "boolean"
},
"ignoreSearch": {
"type": "boolean"
},
"ignoreVary": {
"type": "boolean"
}
},
"additionalProperties": false
},
"WorkboxPlugin": {
"description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
"type": "object",
"properties": {
"cacheDidUpdate": {},
"cachedResponseWillBeUsed": {},
"cacheKeyWillBeUsed": {},
"cacheWillUpdate": {},
"fetchDidFail": {},
"fetchDidSucceed": {},
"handlerDidComplete": {},
"handlerDidError": {},
"handlerDidRespond": {},
"handlerWillRespond": {},
"handlerWillStart": {},
"requestWillFetch": {}
},
"additionalProperties": false
},
"CacheDidUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"CachedResponseWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheKeyWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheWillUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidFailCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidSucceedCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidCompleteCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidErrorCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillStartCallback": {
"type": "object",
"additionalProperties": false
},
"RequestWillFetchCallback": {
"type": "object",
"additionalProperties": false
},
"RequestInit": {
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/Blob"
},
{
"$ref": "#/definitions/FormData"
},
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
"string"
]
}
]
},
"cache": {
"enum": [
"default",
"force-cache",
"no-cache",
"no-store",
"only-if-cached",
"reload"
],
"type": "string"
},
"credentials": {
"enum": [
"include",
"omit",
"same-origin"
],
"type": "string"
},
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/Record<string,string>"
}
]
},
"integrity": {
"type": "string"
},
"keepalive": {
"type": "boolean"
},
"method": {
"type": "string"
},
"mode": {
"enum": [
"cors",
"navigate",
"no-cors",
"same-origin"
],
"type": "string"
},
"redirect": {
"enum": [
"error",
"follow",
"manual"
],
"type": "string"
},
"referrer": {
"type": "string"
},
"referrerPolicy": {
"enum": [
"",
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"strict-origin-when-cross-origin",
"unsafe-url"
],
"type": "string"
},
"signal": {
"anyOf": [
{
"$ref": "#/definitions/AbortSignal"
},
{
"type": "null"
}
]
},
"window": {}
},
"additionalProperties": false
},
"ArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"byteLength"
]
},
"ArrayBufferView": {
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"buffer",
"byteLength",
"byteOffset"
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"type": "string",
"enum": [
"SharedArrayBuffer"
]
}
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"byteLength"
]
},
"Blob": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"size",
"type"
]
},
"FormData": {
"type": "object",
"additionalProperties": false
},
"URLSearchParams": {
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"RouteMatchCallback": {}
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
@@ -606,6 +606,9 @@
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/ReadableStream<any>"
},
{
"$ref": "#/definitions/Blob"
},
@@ -615,9 +618,6 @@
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
@@ -648,19 +648,26 @@
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
"$ref": "#/definitions/Record<string,string>"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
"items": [
{
"type": "string"
},
{
"type": "string"
}
],
"minItems": 2,
"maxItems": 2
}
},
{
"$ref": "#/definitions/Record<string,string>"
"$ref": "#/definitions/Headers"
}
]
},
@@ -717,7 +724,9 @@
}
]
},
"window": {}
"window": {
"type": "null"
}
},
"additionalProperties": false
},
@@ -727,13 +736,13 @@
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"__@toStringTag@25": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"__@toStringTag@25",
"byteLength"
]
},
@@ -741,14 +750,7 @@
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
"$ref": "#/definitions/ArrayBufferLike"
},
"byteLength": {
"type": "number"
@@ -764,16 +766,26 @@
"byteOffset"
]
},
"ArrayBufferLike": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"__@species@598": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"__@toStringTag@25": {
"type": "string",
"enum": [
"SharedArrayBuffer"
@@ -782,11 +794,23 @@
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"__@species@598",
"__@toStringTag@25",
"byteLength"
]
},
"ReadableStream<any>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Blob": {
"type": "object",
"properties": {
@@ -811,50 +835,15 @@
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"Record<string,string>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
"additionalProperties": false
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"AbortSignal": {},
"RouteMatchCallback": {}
},
"$schema": "http://json-schema.org/draft-07/schema#"
@@ -161,601 +161,7 @@
"sticky",
"unicode"
]
},
"GoogleAnalyticsInitializeOptions": {
"type": "object",
"properties": {
"cacheName": {
"type": "string"
},
"parameterOverrides": {
"type": "object",
"additionalProperties": {
"type": "string"
}
},
"hitFilter": {
"type": "object",
"additionalProperties": false
}
},
"additionalProperties": false
},
"RuntimeCaching": {
"type": "object",
"properties": {
"handler": {
"description": "This determines how the runtime route will generate a response.\nTo use one of the built-in {@link workbox-strategies}, provide its name,\nlike `'NetworkFirst'`.\nAlternatively, this can be a {@link workbox-core.RouteHandler} callback\nfunction with custom response logic.",
"anyOf": [
{
"$ref": "#/definitions/RouteHandlerCallback"
},
{
"$ref": "#/definitions/RouteHandlerObject"
},
{
"enum": [
"CacheFirst",
"CacheOnly",
"NetworkFirst",
"NetworkOnly",
"StaleWhileRevalidate"
],
"type": "string"
}
]
},
"method": {
"description": "The HTTP method to match against. The default value of `'GET'` is normally\nsufficient, unless you explicitly need to match `'POST'`, `'PUT'`, or\nanother type of request.",
"default": "GET",
"enum": [
"DELETE",
"GET",
"HEAD",
"PATCH",
"POST",
"PUT"
],
"type": "string"
},
"options": {
"type": "object",
"properties": {
"backgroundSync": {
"description": "Configuring this will add a\n{@link workbox-background-sync.BackgroundSyncPlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"options": {
"$ref": "#/definitions/QueueOptions"
}
},
"additionalProperties": false,
"required": [
"name"
]
},
"broadcastUpdate": {
"description": "Configuring this will add a\n{@link workbox-broadcast-update.BroadcastUpdatePlugin} instance to the\n{@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"channelName": {
"type": "string"
},
"options": {
"$ref": "#/definitions/BroadcastCacheUpdateOptions"
}
},
"additionalProperties": false,
"required": [
"options"
]
},
"cacheableResponse": {
"description": "Configuring this will add a\n{@link workbox-cacheable-response.CacheableResponsePlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheableResponseOptions"
},
"cacheName": {
"description": "If provided, this will set the `cacheName` property of the\n{@link workbox-strategies} configured in `handler`.",
"type": [
"null",
"string"
]
},
"expiration": {
"description": "Configuring this will add a\n{@link workbox-expiration.ExpirationPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/ExpirationPluginOptions"
},
"networkTimeoutSeconds": {
"description": "If provided, this will set the `networkTimeoutSeconds` property of the\n{@link workbox-strategies} configured in `handler`. Note that only\n`'NetworkFirst'` and `'NetworkOnly'` support `networkTimeoutSeconds`.",
"type": "number"
},
"plugins": {
"description": "Configuring this allows the use of one or more Workbox plugins that\ndon't have \"shortcut\" options (like `expiration` for\n{@link workbox-expiration.ExpirationPlugin}). The plugins provided here\nwill be added to the {@link workbox-strategies} configured in `handler`.",
"type": "array",
"items": {
"$ref": "#/definitions/WorkboxPlugin"
}
},
"precacheFallback": {
"description": "Configuring this will add a\n{@link workbox-precaching.PrecacheFallbackPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "object",
"properties": {
"fallbackURL": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"fallbackURL"
]
},
"rangeRequests": {
"description": "Enabling this will add a\n{@link workbox-range-requests.RangeRequestsPlugin} instance to\nthe {@link workbox-strategies} configured in `handler`.",
"type": "boolean"
},
"fetchOptions": {
"description": "Configuring this will pass along the `fetchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/RequestInit"
},
"matchOptions": {
"description": "Configuring this will pass along the `matchOptions` value to\nthe {@link workbox-strategies} configured in `handler`.",
"$ref": "#/definitions/CacheQueryOptions"
}
},
"additionalProperties": false
},
"urlPattern": {
"description": "This match criteria determines whether the configured handler will\ngenerate a response for any requests that don't match one of the precached\nURLs. If multiple `RuntimeCaching` routes are defined, then the first one\nwhose `urlPattern` matches will be the one that responds.\n\nThis value directly maps to the first parameter passed to\n{@link workbox-routing.registerRoute}. It's recommended to use a\n{@link workbox-core.RouteMatchCallback} function for greatest flexibility.",
"anyOf": [
{
"$ref": "#/definitions/RegExp"
},
{
"$ref": "#/definitions/RouteMatchCallback"
},
{
"type": "string"
}
]
}
},
"additionalProperties": false,
"required": [
"handler",
"urlPattern"
]
},
"RouteHandlerCallback": {},
"RouteHandlerObject": {
"description": "An object with a `handle` method of type `RouteHandlerCallback`.\n\nA `Route` object can be created with either an `RouteHandlerCallback`\nfunction or this `RouteHandler` object. The benefit of the `RouteHandler`\nis it can be extended (as is done by the `workbox-strategies` package).",
"type": "object",
"properties": {
"handle": {
"$ref": "#/definitions/RouteHandlerCallback"
}
},
"additionalProperties": false,
"required": [
"handle"
]
},
"QueueOptions": {
"type": "object",
"properties": {
"forceSyncFallback": {
"type": "boolean"
},
"maxRetentionTime": {
"type": "number"
},
"onSync": {
"$ref": "#/definitions/OnSyncCallback"
}
},
"additionalProperties": false
},
"OnSyncCallback": {},
"BroadcastCacheUpdateOptions": {
"type": "object",
"properties": {
"headersToCheck": {
"type": "array",
"items": {
"type": "string"
}
},
"generatePayload": {
"type": "object",
"additionalProperties": false
},
"notifyAllClients": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheableResponseOptions": {
"type": "object",
"properties": {
"statuses": {
"type": "array",
"items": {
"type": "number"
}
},
"headers": {
"type": "object",
"additionalProperties": {
"type": "string"
}
}
},
"additionalProperties": false
},
"ExpirationPluginOptions": {
"type": "object",
"properties": {
"maxEntries": {
"type": "number"
},
"maxAgeSeconds": {
"type": "number"
},
"matchOptions": {
"$ref": "#/definitions/CacheQueryOptions"
},
"purgeOnQuotaError": {
"type": "boolean"
}
},
"additionalProperties": false
},
"CacheQueryOptions": {
"type": "object",
"properties": {
"ignoreMethod": {
"type": "boolean"
},
"ignoreSearch": {
"type": "boolean"
},
"ignoreVary": {
"type": "boolean"
}
},
"additionalProperties": false
},
"WorkboxPlugin": {
"description": "An object with optional lifecycle callback properties for the fetch and\ncache operations.",
"type": "object",
"properties": {
"cacheDidUpdate": {},
"cachedResponseWillBeUsed": {},
"cacheKeyWillBeUsed": {},
"cacheWillUpdate": {},
"fetchDidFail": {},
"fetchDidSucceed": {},
"handlerDidComplete": {},
"handlerDidError": {},
"handlerDidRespond": {},
"handlerWillRespond": {},
"handlerWillStart": {},
"requestWillFetch": {}
},
"additionalProperties": false
},
"CacheDidUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"CachedResponseWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheKeyWillBeUsedCallback": {
"type": "object",
"additionalProperties": false
},
"CacheWillUpdateCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidFailCallback": {
"type": "object",
"additionalProperties": false
},
"FetchDidSucceedCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidCompleteCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidErrorCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerDidRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillRespondCallback": {
"type": "object",
"additionalProperties": false
},
"HandlerWillStartCallback": {
"type": "object",
"additionalProperties": false
},
"RequestWillFetchCallback": {
"type": "object",
"additionalProperties": false
},
"RequestInit": {
"type": "object",
"properties": {
"body": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/ArrayBufferView"
},
{
"$ref": "#/definitions/Blob"
},
{
"$ref": "#/definitions/FormData"
},
{
"$ref": "#/definitions/URLSearchParams"
},
{
"$ref": "#/definitions/ReadableStream<Uint8Array>"
},
{
"type": [
"null",
"string"
]
}
]
},
"cache": {
"enum": [
"default",
"force-cache",
"no-cache",
"no-store",
"only-if-cached",
"reload"
],
"type": "string"
},
"credentials": {
"enum": [
"include",
"omit",
"same-origin"
],
"type": "string"
},
"headers": {
"anyOf": [
{
"$ref": "#/definitions/Headers"
},
{
"type": "array",
"items": {
"type": "array",
"items": {
"type": "string"
}
}
},
{
"$ref": "#/definitions/Record<string,string>"
}
]
},
"integrity": {
"type": "string"
},
"keepalive": {
"type": "boolean"
},
"method": {
"type": "string"
},
"mode": {
"enum": [
"cors",
"navigate",
"no-cors",
"same-origin"
],
"type": "string"
},
"redirect": {
"enum": [
"error",
"follow",
"manual"
],
"type": "string"
},
"referrer": {
"type": "string"
},
"referrerPolicy": {
"enum": [
"",
"no-referrer",
"no-referrer-when-downgrade",
"origin",
"origin-when-cross-origin",
"same-origin",
"strict-origin",
"strict-origin-when-cross-origin",
"unsafe-url"
],
"type": "string"
},
"signal": {
"anyOf": [
{
"$ref": "#/definitions/AbortSignal"
},
{
"type": "null"
}
]
},
"window": {}
},
"additionalProperties": false
},
"ArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@toStringTag": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"__@toStringTag",
"byteLength"
]
},
"ArrayBufferView": {
"type": "object",
"properties": {
"buffer": {
"anyOf": [
{
"$ref": "#/definitions/ArrayBuffer"
},
{
"$ref": "#/definitions/SharedArrayBuffer"
}
]
},
"byteLength": {
"type": "number"
},
"byteOffset": {
"type": "number"
}
},
"additionalProperties": false,
"required": [
"buffer",
"byteLength",
"byteOffset"
]
},
"SharedArrayBuffer": {
"type": "object",
"properties": {
"byteLength": {
"type": "number"
},
"__@species": {
"$ref": "#/definitions/SharedArrayBuffer"
},
"__@toStringTag": {
"type": "string",
"enum": [
"SharedArrayBuffer"
]
}
},
"additionalProperties": false,
"required": [
"__@species",
"__@toStringTag",
"byteLength"
]
},
"Blob": {
"type": "object",
"properties": {
"size": {
"type": "number"
},
"type": {
"type": "string"
}
},
"additionalProperties": false,
"required": [
"size",
"type"
]
},
"FormData": {
"type": "object",
"additionalProperties": false
},
"URLSearchParams": {
"type": "object",
"additionalProperties": false
},
"ReadableStream<Uint8Array>": {
"type": "object",
"properties": {
"locked": {
"type": "boolean"
}
},
"additionalProperties": false,
"required": [
"locked"
]
},
"Headers": {
"type": "object",
"additionalProperties": false
},
"Record<string,string>": {
"type": "object",
"additionalProperties": false
},
"AbortSignal": {
"type": "object",
"properties": {
"aborted": {
"type": "boolean"
},
"onabort": {
"anyOf": [
{
"type": "object",
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"additionalProperties": false,
"required": [
"aborted",
"onabort"
]
},
"RouteMatchCallback": {}
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
+9320 -3682
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -46,7 +46,7 @@
"devDependencies": {
"@types/common-tags": "^1.8.0",
"@types/fs-extra": "^9.0.1",
"@types/inquirer": "^7.3.0",
"@types/inquirer": "^9.0.3",
"@types/stringify-object": "^3.3.0",
"@types/update-notifier": "^4.1.1"
}
@@ -7,7 +7,8 @@
*/
import assert from 'assert';
import {Answers, Question, prompt} from 'inquirer';
import {Answers, Question} from 'inquirer';
import inquirer from 'inquirer';
import {oneLine as ol} from 'common-tags';
import {constants} from '../constants';
@@ -26,7 +27,7 @@ const configLocationQuestion: Question<Answers> = {
* @return {Promise<Answers>} The answers from inquirer.
*/
function askQuestion(): Promise<Answers> {
return prompt([configLocationQuestion]);
return inquirer.prompt([configLocationQuestion]);
}
export async function askConfigLocation(): Promise<string> {
@@ -7,7 +7,8 @@
*/
import assert from 'assert';
import {Answers, prompt} from 'inquirer';
import {Answers} from 'inquirer';
import inquirer from 'inquirer';
import glob from 'glob';
import ora from 'ora';
import upath from 'upath';
@@ -80,7 +81,7 @@ async function askQuestion(globDirectory: string): Promise<Answers> {
assert(fileExtensions.length > 0, errors['no-file-extensions-found']);
return prompt([
return inquirer.prompt([
{
name,
message: 'Which file types would you like to precache?',
@@ -9,7 +9,7 @@
import assert from 'assert';
import fse from 'fs-extra';
import glob from 'glob';
import {prompt, Separator} from 'inquirer';
import inquirer from 'inquirer';
import {oneLine as ol} from 'common-tags';
import {errors} from '../errors';
@@ -52,18 +52,21 @@ async function askQuestion(): Promise<{
globDirectory: string;
manualDirectoryInput?: string;
}> {
const subdirectories: (string | InstanceType<typeof Separator>)[] =
const subdirectories: (string | InstanceType<typeof inquirer.Separator>)[] =
await getSubdirectories();
if (subdirectories.length > 0) {
const manualEntryChoice = 'Manually enter path';
return prompt([
return inquirer.prompt([
{
name: questionRootDirectory,
type: 'list',
message: ol`What is the root of your web app (i.e. which directory do
you deploy)?`,
choices: subdirectories.concat([new Separator(), manualEntryChoice]),
choices: subdirectories.concat([
new inquirer.Separator(),
manualEntryChoice,
]),
},
{
name: questionManualInput,
@@ -74,7 +77,7 @@ async function askQuestion(): Promise<{
]);
}
return prompt([
return inquirer.prompt([
{
name: questionRootDirectory,
message: ROOT_PROMPT,
@@ -7,7 +7,7 @@
*/
import assert from 'assert';
import {prompt} from 'inquirer';
import inquirer from 'inquirer';
import {oneLine as ol} from 'common-tags';
import {errors} from '../errors';
@@ -28,7 +28,7 @@ async function askQuestion(): Promise<{
shouldAskForIgnoreURLParametersMatching: boolean;
ignoreURLParametersMatching?: string;
}> {
return prompt([
return inquirer.prompt([
{
name: question_shouldAskForIgnoreURLParametersMatching,
message: ol`Does your web app manifest include search parameter(s)
@@ -7,7 +7,8 @@
*/
import assert from 'assert';
import {Answers, prompt} from 'inquirer';
import {Answers} from 'inquirer';
import inquirer from 'inquirer';
import upath from 'upath';
import {errors} from '../errors';
@@ -20,7 +21,7 @@ const name = 'swDest';
* @return {Promise<Answers>} The answers from inquirer.
*/
function askQuestion(defaultDir: string): Promise<Answers> {
return prompt([
return inquirer.prompt([
{
name,
message: `Where would you like your service worker file to be saved?`,
@@ -6,7 +6,8 @@
https://opensource.org/licenses/MIT.
*/
import {Answers, prompt} from 'inquirer';
import {Answers} from 'inquirer';
import inquirer from 'inquirer';
import {oneLine as ol} from 'common-tags';
// The key used for the question/answer.
@@ -16,7 +17,7 @@ const name = 'swSrc';
* @return {Promise<Answers>} The answers from inquirer.
*/
function askQuestion(): Promise<Answers> {
return prompt([
return inquirer.prompt([
{
name,
message: ol`Where's your existing service worker file? To be used with
+1 -1
View File
@@ -32,7 +32,7 @@ const logger = (
: (() => {
// Don't overwrite this value if it's already set.
// See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923
if (!('__WB_DISABLE_DEV_LOGS' in self)) {
if (!('__WB_DISABLE_DEV_LOGS' in globalThis)) {
self.__WB_DISABLE_DEV_LOGS = false;
}
+9 -3
View File
@@ -77,9 +77,15 @@ function concatenate(sourcePromises: Promise<StreamSource>[]): {
const stream = new ReadableStream({
pull(controller: ReadableStreamDefaultController<any>) {
return readerPromises[i]
.then((reader) => reader.read())
.then((reader) => {
if (reader instanceof ReadableStreamDefaultReader) {
return reader.read();
} else {
return;
}
})
.then((result) => {
if (result.done) {
if (result?.done) {
if (process.env.NODE_ENV !== 'production') {
logMessages.push([
'Reached the end of source:',
@@ -113,7 +119,7 @@ function concatenate(sourcePromises: Promise<StreamSource>[]): {
// The `pull` method is defined because we're inside it.
return this.pull!(controller);
} else {
controller.enqueue(result.value);
controller.enqueue(result?.value);
}
})
.catch((error) => {
+109 -56
View File
@@ -6,7 +6,7 @@
"packages": {
"": {
"name": "workbox-webpack-plugin",
"version": "6.5.3",
"version": "6.5.4",
"license": "MIT",
"dependencies": {
"fast-json-stable-stringify": "^2.1.0",
@@ -15,7 +15,8 @@
"webpack-sources": "^1.4.3"
},
"devDependencies": {
"@types/webpack": "^5.28.0"
"@types/node": "^18.15.11",
"@types/webpack": "^5.28.1"
},
"engines": {
"node": ">=10.0.0"
@@ -53,14 +54,14 @@
"integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ=="
},
"node_modules/@types/node": {
"version": "17.0.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz",
"integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA=="
"version": "18.15.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
"integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
"node_modules/@types/webpack": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz",
"integrity": "sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==",
"version": "5.28.1",
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.1.tgz",
"integrity": "sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==",
"dev": true,
"dependencies": {
"@types/node": "*",
@@ -252,25 +253,30 @@
}
},
"node_modules/browserslist": {
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"version": "4.21.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz",
"integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
}
],
"dependencies": {
"caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17",
"escalade": "^3.1.1",
"node-releases": "^2.0.1",
"picocolors": "^1.0.0"
"caniuse-lite": "^1.0.30001449",
"electron-to-chromium": "^1.4.284",
"node-releases": "^2.0.8",
"update-browserslist-db": "^1.0.10"
},
"bin": {
"browserslist": "cli.js"
},
"engines": {
"node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
},
"node_modules/buffer-from": {
@@ -279,13 +285,23 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"node_modules/caniuse-lite": {
"version": "1.0.30001312",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz",
"integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ==",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
}
"version": "1.0.30001480",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz",
"integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/caniuse-lite"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
]
},
"node_modules/chrome-trace-event": {
"version": "1.0.3",
@@ -301,9 +317,9 @@
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"node_modules/electron-to-chromium": {
"version": "1.4.71",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz",
"integrity": "sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw=="
"version": "1.4.367",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.367.tgz",
"integrity": "sha512-mNuDxb+HpLhPGUKrg0hSxbTjHWw8EziwkwlJNkFUj3W60ypigLDRVz04vU+VRsJPi8Gub+FDhYUpuTm9xiEwRQ=="
},
"node_modules/enhanced-resolve": {
"version": "5.9.0",
@@ -466,9 +482,9 @@
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
},
"node_modules/node-releases": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz",
"integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg=="
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz",
"integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w=="
},
"node_modules/picocolors": {
"version": "1.0.0",
@@ -664,6 +680,35 @@
"yarn": "*"
}
},
"node_modules/update-browserslist-db": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",
"integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==",
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/browserslist"
},
{
"type": "tidelift",
"url": "https://tidelift.com/funding/github/npm/browserslist"
},
{
"type": "github",
"url": "https://github.com/sponsors/ai"
}
],
"dependencies": {
"escalade": "^3.1.1",
"picocolors": "^1.0.0"
},
"bin": {
"update-browserslist-db": "cli.js"
},
"peerDependencies": {
"browserslist": ">= 4.21.0"
}
},
"node_modules/uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
@@ -778,14 +823,14 @@
"integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ=="
},
"@types/node": {
"version": "17.0.18",
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.18.tgz",
"integrity": "sha512-eKj4f/BsN/qcculZiRSujogjvp5O/k4lOW5m35NopjZM/QwLOR075a8pJW5hD+Rtdm2DaCVPENS6KtSQnUD6BA=="
"version": "18.15.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
"integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
"@types/webpack": {
"version": "5.28.0",
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.0.tgz",
"integrity": "sha512-8cP0CzcxUiFuA9xGJkfeVpqmWTk9nx6CWwamRGCj95ph1SmlRRk9KlCZ6avhCbZd4L68LvYT6l1kpdEnQXrF8w==",
"version": "5.28.1",
"resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-5.28.1.tgz",
"integrity": "sha512-qw1MqGZclCoBrpiSe/hokSgQM/su8Ocpl3L/YHE0L6moyaypg4+5F7Uzq7NgaPKPxUxUbQ4fLPLpDWdR27bCZw==",
"dev": true,
"requires": {
"@types/node": "*",
@@ -963,15 +1008,14 @@
"requires": {}
},
"browserslist": {
"version": "4.19.1",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.19.1.tgz",
"integrity": "sha512-u2tbbG5PdKRTUoctO3NBD8FQ5HdPh1ZXPHzp1rwaa5jTc+RV9/+RlWiAIKmjRPQF+xbGM9Kklj5bZQFa2s/38A==",
"version": "4.21.5",
"resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.21.5.tgz",
"integrity": "sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w==",
"requires": {
"caniuse-lite": "^1.0.30001286",
"electron-to-chromium": "^1.4.17",
"escalade": "^3.1.1",
"node-releases": "^2.0.1",
"picocolors": "^1.0.0"
"caniuse-lite": "^1.0.30001449",
"electron-to-chromium": "^1.4.284",
"node-releases": "^2.0.8",
"update-browserslist-db": "^1.0.10"
}
},
"buffer-from": {
@@ -980,9 +1024,9 @@
"integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="
},
"caniuse-lite": {
"version": "1.0.30001312",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001312.tgz",
"integrity": "sha512-Wiz1Psk2MEK0pX3rUzWaunLTZzqS2JYZFzNKqAiJGiuxIjRPLgV6+VDPOg6lQOUxmDwhTlh198JsTTi8Hzw6aQ=="
"version": "1.0.30001480",
"resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001480.tgz",
"integrity": "sha512-q7cpoPPvZYgtyC4VaBSN0Bt+PJ4c4EYRf0DrduInOz2SkFpHD5p3LnvEpqBp7UnJn+8x1Ogl1s38saUxe+ihQQ=="
},
"chrome-trace-event": {
"version": "1.0.3",
@@ -995,9 +1039,9 @@
"integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ=="
},
"electron-to-chromium": {
"version": "1.4.71",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.71.tgz",
"integrity": "sha512-Hk61vXXKRb2cd3znPE9F+2pLWdIOmP7GjiTj45y6L3W/lO+hSnUSUhq+6lEaERWBdZOHbk2s3YV5c9xVl3boVw=="
"version": "1.4.367",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.367.tgz",
"integrity": "sha512-mNuDxb+HpLhPGUKrg0hSxbTjHWw8EziwkwlJNkFUj3W60ypigLDRVz04vU+VRsJPi8Gub+FDhYUpuTm9xiEwRQ=="
},
"enhanced-resolve": {
"version": "5.9.0",
@@ -1126,9 +1170,9 @@
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw=="
},
"node-releases": {
"version": "2.0.2",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.2.tgz",
"integrity": "sha512-XxYDdcQ6eKqp/YjI+tb2C5WM2LgjnZrfYg4vgQt49EK268b6gYCHsBLrK2qvJo4FmCtqmKezb0WZFK4fkrZNsg=="
"version": "2.0.10",
"resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.10.tgz",
"integrity": "sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w=="
},
"picocolors": {
"version": "1.0.0",
@@ -1242,6 +1286,15 @@
"resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz",
"integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg=="
},
"update-browserslist-db": {
"version": "1.0.11",
"resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz",
"integrity": "sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA==",
"requires": {
"escalade": "^3.1.1",
"picocolors": "^1.0.0"
}
},
"uri-js": {
"version": "4.4.1",
"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
+2 -1
View File
@@ -31,7 +31,8 @@
"webpack": "^4.4.0 || ^5.9.0"
},
"devDependencies": {
"@types/webpack": "^5.28.0"
"@types/node": "^18.15.11",
"@types/webpack": "^5.28.1"
},
"author": "Google's Web DevRel Team",
"license": "MIT",
+1
View File
@@ -28,6 +28,7 @@ module.exports = {
'@typescript-eslint/prefer-regexp-exec': 'off',
'@typescript-eslint/require-await': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'block-scoped-var': 'error',
'eol-last': 'error',
'eqeqeq': 'error',