@docusaurus/plugin-pwa 3.10.2 → 4.0.0-canary-6808

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.
package/lib/registerSw.js CHANGED
@@ -52,7 +52,7 @@ async function getIsAppInstalledRelatedApps() {
52
52
  const relatedApps = await navigator.getInstalledRelatedApps();
53
53
  return relatedApps.some((app) => app.platform === 'webapp');
54
54
  }
55
- catch (e) {
55
+ catch {
56
56
  // Error might be thrown when Docusaurus is embedded in an iframe:
57
57
  // registerSW failed DOMException: Failed to execute 'getInstalledRelatedApps' on 'Navigator': getInstalledRelatedApps() is only supported in top-level browsing contexts.
58
58
  return false;
package/lib/sw.js CHANGED
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /* eslint-disable no-restricted-globals */
8
7
  import { PrecacheController } from 'workbox-precaching';
9
8
  function parseSwParams() {
10
9
  const params = JSON.parse(new URLSearchParams(self.location.search).get('params'));
@@ -50,7 +49,6 @@ function getPossibleURLs(url) {
50
49
  }
51
50
  (async () => {
52
51
  const params = parseSwParams();
53
- // eslint-disable-next-line no-underscore-dangle
54
52
  const precacheManifest = self.__WB_MANIFEST;
55
53
  const controller = new PrecacheController({
56
54
  // Safer to turn this true?
@@ -20,7 +20,7 @@
20
20
  margin: 0;
21
21
  }
22
22
 
23
- @media screen and (max-width: 500px) {
23
+ @media screen and (width <= 500px) {
24
24
  .popup {
25
25
  width: 100%;
26
26
  bottom: 0;
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@docusaurus/plugin-pwa",
3
- "version": "3.10.2",
3
+ "version": "4.0.0-canary-6808",
4
4
  "description": "Docusaurus Plugin to add PWA support.",
5
5
  "main": "lib/index.js",
6
6
  "types": "src/plugin-pwa.d.ts",
7
7
  "scripts": {
8
- "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && prettier --config ../../.prettierrc --write \"lib/theme/**/*.js\"",
8
+ "build": "tsc --build && node ../../admin/scripts/copyUntypedFiles.js && oxfmt \"lib/theme/**/*.js\"",
9
9
  "watch": "run-p -c copy:watch build:watch",
10
10
  "build:watch": "tsc --build --watch",
11
11
  "copy:watch": "node ../../admin/scripts/copyUntypedFiles.js --watch"
@@ -20,36 +20,36 @@
20
20
  },
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@babel/core": "^7.25.9",
24
- "@babel/preset-env": "^7.25.9",
25
- "@docusaurus/bundler": "3.10.2",
26
- "@docusaurus/core": "3.10.2",
27
- "@docusaurus/logger": "3.10.2",
28
- "@docusaurus/theme-common": "3.10.2",
29
- "@docusaurus/theme-translations": "3.10.2",
30
- "@docusaurus/types": "3.10.2",
31
- "@docusaurus/utils": "3.10.2",
32
- "@docusaurus/utils-validation": "3.10.2",
33
- "babel-loader": "^9.2.1",
34
- "clsx": "^2.0.0",
35
- "core-js": "^3.31.1",
36
- "tslib": "^2.6.0",
37
- "webpack": "^5.95.0",
38
- "webpack-merge": "^5.9.0",
39
- "workbox-build": "^7.0.0",
40
- "workbox-precaching": "^7.0.0",
41
- "workbox-window": "^7.0.0"
23
+ "@babel/core": "^7.29.7",
24
+ "@babel/preset-env": "^7.29.7",
25
+ "@docusaurus/bundler": "4.0.0-canary-6808",
26
+ "@docusaurus/core": "4.0.0-canary-6808",
27
+ "@docusaurus/logger": "4.0.0-canary-6808",
28
+ "@docusaurus/theme-common": "4.0.0-canary-6808",
29
+ "@docusaurus/theme-translations": "4.0.0-canary-6808",
30
+ "@docusaurus/types": "4.0.0-canary-6808",
31
+ "@docusaurus/utils": "4.0.0-canary-6808",
32
+ "@docusaurus/utils-validation": "4.0.0-canary-6808",
33
+ "babel-loader": "^10.1.1",
34
+ "clsx": "^2.1.1",
35
+ "core-js": "^3.50.0",
36
+ "tslib": "^2.8.1",
37
+ "webpack": "^5.110.3",
38
+ "webpack-merge": "^6.0.1",
39
+ "workbox-build": "^7.4.1",
40
+ "workbox-precaching": "^7.4.1",
41
+ "workbox-window": "^7.4.1"
42
42
  },
43
43
  "devDependencies": {
44
- "@docusaurus/module-type-aliases": "3.10.2",
45
- "fs-extra": "^11.1.0"
44
+ "@docusaurus/module-type-aliases": "4.0.0-canary-6808",
45
+ "fs-extra": "^11.4.0"
46
46
  },
47
47
  "peerDependencies": {
48
- "react": "^18.0.0 || ^19.0.0",
49
- "react-dom": "^18.0.0 || ^19.0.0"
48
+ "react": "^19.3.0",
49
+ "react-dom": "^19.3.0"
50
50
  },
51
51
  "engines": {
52
- "node": ">=20.0"
52
+ "node": ">=24.14"
53
53
  },
54
- "gitHead": "f37f9035584917a97a260b91fc2842cba4f8b94f"
54
+ "gitHead": "91e445730a91fbe20dd5fefae560303a0c655aa7"
55
55
  }
package/src/registerSw.ts CHANGED
@@ -74,7 +74,7 @@ async function getIsAppInstalledRelatedApps() {
74
74
  try {
75
75
  const relatedApps = await navigator.getInstalledRelatedApps();
76
76
  return relatedApps.some((app) => app.platform === 'webapp');
77
- } catch (e) {
77
+ } catch {
78
78
  // Error might be thrown when Docusaurus is embedded in an iframe:
79
79
  // registerSW failed DOMException: Failed to execute 'getInstalledRelatedApps' on 'Navigator': getInstalledRelatedApps() is only supported in top-level browsing contexts.
80
80
  return false;
package/src/sw.ts CHANGED
@@ -4,7 +4,6 @@
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  */
7
- /* eslint-disable no-restricted-globals */
8
7
 
9
8
  import {PrecacheController, type PrecacheEntry} from 'workbox-precaching';
10
9
 
@@ -62,7 +61,6 @@ function getPossibleURLs(url: string) {
62
61
  (async () => {
63
62
  const params = parseSwParams();
64
63
 
65
- // eslint-disable-next-line no-underscore-dangle
66
64
  const precacheManifest = (
67
65
  self as typeof globalThis & {__WB_MANIFEST: (string | PrecacheEntry)[]}
68
66
  ).__WB_MANIFEST;
@@ -20,7 +20,7 @@
20
20
  margin: 0;
21
21
  }
22
22
 
23
- @media screen and (max-width: 500px) {
23
+ @media screen and (width <= 500px) {
24
24
  .popup {
25
25
  width: 100%;
26
26
  bottom: 0;