@serwist/sw 9.0.0-preview.10 → 9.0.0-preview.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,8 @@ export type HandlePrecachingOptions = {
16
16
  cleanupOutdatedCaches?: boolean;
17
17
  } & ({
18
18
  /**
19
- * An URL that should point to a HTML
20
- * file with which navigation requests for URLs that aren't precached will be fulfilled.
21
- * For more complex cases, consider `@serwist/sw.fallbacks`instead.
19
+ * An URL that should point to a HTML file with which navigation requests for URLs that aren't
20
+ * precached will be fulfilled.
22
21
  */
23
22
  navigateFallback: string;
24
23
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"handlePrecaching.d.ts","sourceRoot":"","sources":["../src/handlePrecaching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7C;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GAAG,CACA;IACE;;;;OAIG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC,GACD;IAAE,gBAAgB,CAAC,EAAE,KAAK,CAAA;CAAE,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,4EAAqF,uBAAuB,KAAG,IAoB3I,CAAC"}
1
+ {"version":3,"file":"handlePrecaching.d.ts","sourceRoot":"","sources":["../src/handlePrecaching.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAI/E,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,eAAe,CAAC,EAAE,CAAC,aAAa,GAAG,MAAM,CAAC,EAAE,CAAC;IAC7C;;OAEG;IACH,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC;;;;OAIG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC,GAAG,CACA;IACE;;;OAGG;IACH,gBAAgB,EAAE,MAAM,CAAC;IACzB;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,EAAE,CAAC;IACrC;;;OAGG;IACH,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC,GACD;IAAE,gBAAgB,CAAC,EAAE,KAAK,CAAA;CAAE,CAC/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,4EAAqF,uBAAuB,KAAG,IAoB3I,CAAC"}
package/dist/index.js CHANGED
@@ -27,13 +27,13 @@ const fallbacks = ({ runtimeCaching, entries, precacheOptions })=>{
27
27
  const handlePrecaching = ({ precacheEntries, precacheOptions, cleanupOutdatedCaches: cleanupOutdatedCaches$1 = false, ...options })=>{
28
28
  if (!!precacheEntries && precacheEntries.length > 0) {
29
29
  precacheAndRoute(precacheEntries, precacheOptions);
30
- }
31
- if (cleanupOutdatedCaches$1) cleanupOutdatedCaches();
32
- if (options.navigateFallback) {
33
- registerRoute(new NavigationRoute(createHandlerBoundToURL(options.navigateFallback), {
34
- allowlist: options.navigateFallbackAllowlist,
35
- denylist: options.navigateFallbackDenylist
36
- }));
30
+ if (cleanupOutdatedCaches$1) cleanupOutdatedCaches();
31
+ if (options.navigateFallback) {
32
+ registerRoute(new NavigationRoute(createHandlerBoundToURL(options.navigateFallback), {
33
+ allowlist: options.navigateFallbackAllowlist,
34
+ denylist: options.navigateFallbackDenylist
35
+ }));
36
+ }
37
37
  }
38
38
  };
39
39
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serwist/sw",
3
- "version": "9.0.0-preview.10",
3
+ "version": "9.0.0-preview.12",
4
4
  "type": "module",
5
5
  "description": "This module makes it easy to get started with the Serwist service worker libraries.",
6
6
  "files": [
@@ -28,23 +28,23 @@
28
28
  "./package.json": "./package.json"
29
29
  },
30
30
  "dependencies": {
31
- "@serwist/background-sync": "9.0.0-preview.10",
32
- "@serwist/broadcast-update": "9.0.0-preview.10",
33
- "@serwist/cacheable-response": "9.0.0-preview.10",
34
- "@serwist/core": "9.0.0-preview.10",
35
- "@serwist/expiration": "9.0.0-preview.10",
36
- "@serwist/google-analytics": "9.0.0-preview.10",
37
- "@serwist/navigation-preload": "9.0.0-preview.10",
38
- "@serwist/precaching": "9.0.0-preview.10",
39
- "@serwist/range-requests": "9.0.0-preview.10",
40
- "@serwist/routing": "9.0.0-preview.10",
41
- "@serwist/strategies": "9.0.0-preview.10"
31
+ "@serwist/background-sync": "9.0.0-preview.12",
32
+ "@serwist/broadcast-update": "9.0.0-preview.12",
33
+ "@serwist/cacheable-response": "9.0.0-preview.12",
34
+ "@serwist/core": "9.0.0-preview.12",
35
+ "@serwist/expiration": "9.0.0-preview.12",
36
+ "@serwist/google-analytics": "9.0.0-preview.12",
37
+ "@serwist/navigation-preload": "9.0.0-preview.12",
38
+ "@serwist/precaching": "9.0.0-preview.12",
39
+ "@serwist/range-requests": "9.0.0-preview.12",
40
+ "@serwist/routing": "9.0.0-preview.12",
41
+ "@serwist/strategies": "9.0.0-preview.12"
42
42
  },
43
43
  "devDependencies": {
44
44
  "rollup": "4.9.6",
45
45
  "typescript": "5.4.0-dev.20240206",
46
- "@serwist/constants": "9.0.0-preview.10",
47
- "@serwist/utils": "9.0.0-preview.10"
46
+ "@serwist/constants": "9.0.0-preview.12",
47
+ "@serwist/utils": "9.0.0-preview.12"
48
48
  },
49
49
  "peerDependencies": {
50
50
  "typescript": ">=5.0.0"
@@ -20,9 +20,8 @@ export type HandlePrecachingOptions = {
20
20
  } & (
21
21
  | {
22
22
  /**
23
- * An URL that should point to a HTML
24
- * file with which navigation requests for URLs that aren't precached will be fulfilled.
25
- * For more complex cases, consider `@serwist/sw.fallbacks`instead.
23
+ * An URL that should point to a HTML file with which navigation requests for URLs that aren't
24
+ * precached will be fulfilled.
26
25
  */
27
26
  navigateFallback: string;
28
27
  /**
@@ -52,16 +51,16 @@ export const handlePrecaching = ({ precacheEntries, precacheOptions, cleanupOutd
52
51
  * See https://goo.gl/S9QRab
53
52
  */
54
53
  precacheAndRoute(precacheEntries, precacheOptions);
55
- }
56
54
 
57
- if (cleanupOutdatedCaches) cleanupOutdatedCachesImpl();
55
+ if (cleanupOutdatedCaches) cleanupOutdatedCachesImpl();
58
56
 
59
- if (options.navigateFallback) {
60
- registerRoute(
61
- new NavigationRoute(createHandlerBoundToURL(options.navigateFallback), {
62
- allowlist: options.navigateFallbackAllowlist,
63
- denylist: options.navigateFallbackDenylist,
64
- }),
65
- );
57
+ if (options.navigateFallback) {
58
+ registerRoute(
59
+ new NavigationRoute(createHandlerBoundToURL(options.navigateFallback), {
60
+ allowlist: options.navigateFallbackAllowlist,
61
+ denylist: options.navigateFallbackDenylist,
62
+ }),
63
+ );
64
+ }
66
65
  }
67
66
  };