diff --git a/react-app/.gitignore b/react-app/.gitignore index 0bb4a787..b6d3e9f6 100644 --- a/react-app/.gitignore +++ b/react-app/.gitignore @@ -14,5 +14,5 @@ dist-ssr .idea # compiled -utils/core/hmr-core/**/*.js +utils/core/**/*.js public/manifest.json diff --git a/react-app/manifest.ts b/react-app/manifest.js similarity index 78% rename from react-app/manifest.ts rename to react-app/manifest.js index 025a3789..2298bdad 100644 --- a/react-app/manifest.ts +++ b/react-app/manifest.js @@ -1,9 +1,9 @@ -import packageJson from '../package.json'; +import packageJson from '../package.json' assert { type: 'json' }; /** * After changing, please reload the extension at `chrome://extensions` */ -const manifest: chrome.runtime.ManifestV3 = { +const manifest = { manifest_version: 3, name: packageJson.name, version: packageJson.version, @@ -21,7 +21,7 @@ const manifest: chrome.runtime.ManifestV3 = { default_icon: 'icon-34.png', }, icons: { - '128': 'icon-128.png', + 128: 'icon-128.png', }, content_scripts: [ { @@ -31,7 +31,7 @@ const manifest: chrome.runtime.ManifestV3 = { ], web_accessible_resources: [ { - resources: ['assets/js/*.js', 'assets/svg/*.svg', 'icon-128.png', 'icon-34.png'], + resources: ['assets/js/*.js', 'assets/css/*.css', 'assets/svg/*.svg', 'icon-128.png', 'icon-34.png'], matches: ['*://*/*'], }, ], diff --git a/react-app/package-lock.json b/react-app/package-lock.json index 4609585e..aad6d072 100644 --- a/react-app/package-lock.json +++ b/react-app/package-lock.json @@ -37,7 +37,7 @@ "@types/ws": "8.5.7", "@typescript-eslint/eslint-plugin": "6.7.5", "@typescript-eslint/parser": "6.7.5", - "@vitejs/plugin-react": "4.1.0", + "@vitejs/plugin-react": "4.2.0", "chokidar": "3.5.3", "cross-env": "7.0.3", "eslint": "8.51.0", @@ -51,10 +51,10 @@ "fs-extra": "11.1.1", "npm-run-all": "4.1.5", "prettier": "3.0.3", - "rollup": "4.2.0", + "rollup": "4.3.0", "ts-loader": "9.5.0", "typescript": "5.2.2", - "vite": "4.4.11", + "vite": "5.0.2", "ws": "8.14.2" } }, @@ -80,11 +80,11 @@ } }, "node_modules/@babel/code-frame": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", - "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.4.tgz", + "integrity": "sha512-r1IONyb6Ia+jYR2vvIDhdWdlTGhqbBoFqLTQidzZ4kepUFH15ejXvFHxCVbtl7BOXIudsIubf4E81xeA3h3IXA==", "dependencies": { - "@babel/highlight": "^7.22.13", + "@babel/highlight": "^7.23.4", "chalk": "^2.4.2" }, "engines": { @@ -100,20 +100,20 @@ } }, "node_modules/@babel/core": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.2.tgz", - "integrity": "sha512-n7s51eWdaWZ3vGT2tD4T7J6eJs3QoBXydv7vkUM06Bf1cbVD2Kc2UrkzhiQwobfV7NwOnQXYL7UBJ5VPU+RGoQ==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.23.3.tgz", + "integrity": "sha512-Jg+msLuNuCJDyBvFv5+OKOUjWMZgd85bKjbICd3zWrKAo+bJ49HJufi7CQE0q0uR8NGyO6xkCACScNqyjHSZew==", "dependencies": { "@ampproject/remapping": "^2.2.0", "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/generator": "^7.23.3", "@babel/helper-compilation-targets": "^7.22.15", - "@babel/helper-module-transforms": "^7.23.0", + "@babel/helper-module-transforms": "^7.23.3", "@babel/helpers": "^7.23.2", - "@babel/parser": "^7.23.0", + "@babel/parser": "^7.23.3", "@babel/template": "^7.22.15", - "@babel/traverse": "^7.23.2", - "@babel/types": "^7.23.0", + "@babel/traverse": "^7.23.3", + "@babel/types": "^7.23.3", "convert-source-map": "^2.0.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -142,11 +142,11 @@ } }, "node_modules/@babel/generator": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", - "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.4.tgz", + "integrity": "sha512-esuS49Cga3HcThFNebGhlgsrVLkvhqvYDTzgjfFFlHJcIfLe5jFmRRfCQ1KuBfc4Jrtn3ndLgKWAKjBE+IraYQ==", "dependencies": { - "@babel/types": "^7.23.0", + "@babel/types": "^7.23.4", "@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/trace-mapping": "^0.3.17", "jsesc": "^2.5.1" @@ -232,9 +232,9 @@ } }, "node_modules/@babel/helper-module-transforms": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", - "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.3.tgz", + "integrity": "sha512-7bBs4ED9OmswdfDzpz4MpWgSrV7FXlc3zIagvLFjS5H+Mk7Snr21vQ6QwrsoCGMfNC4e4LQPdoULEt4ykz0SRQ==", "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -280,9 +280,9 @@ } }, "node_modules/@babel/helper-string-parser": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", - "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.23.4.tgz", + "integrity": "sha512-803gmbQdqwdf4olxrX4AJyFBV/RTr3rSmOj0rKwesmzlfhYNDEs+/iOcznzpNWlJlIlTJC2QfPFcHB6DlzdVLQ==", "engines": { "node": ">=6.9.0" } @@ -317,11 +317,11 @@ } }, "node_modules/@babel/highlight": { - "version": "7.22.13", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.13.tgz", - "integrity": "sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.23.4.tgz", + "integrity": "sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==", "dependencies": { - "@babel/helper-validator-identifier": "^7.22.5", + "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", "js-tokens": "^4.0.0" }, @@ -330,9 +330,9 @@ } }, "node_modules/@babel/parser": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", - "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.4.tgz", + "integrity": "sha512-vf3Xna6UEprW+7t6EtOmFpHNAuxw3xqPZghy+brsnusscJRW5BMUzzHZc5ICjULee81WeUV2jjakG09MDglJXQ==", "bin": { "parser": "bin/babel-parser.js" }, @@ -355,9 +355,9 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-self": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.22.5.tgz", - "integrity": "sha512-nTh2ogNUtxbiSbxaT4Ds6aXnXEipHweN9YRgOX/oNXdf0cCrGn/+2LozFa3lnPV5D90MkjhgckCPBrsoSc1a7g==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.23.3.tgz", + "integrity": "sha512-qXRvbeKDSfwnlJnanVRp0SfuWE5DQhwQr5xtLBzp56Wabyo+4CMosF6Kfp+eOD/4FYpql64XVJ2W0pVLlJZxOQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -370,9 +370,9 @@ } }, "node_modules/@babel/plugin-transform-react-jsx-source": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.22.5.tgz", - "integrity": "sha512-yIiRO6yobeEIaI0RTbIr8iAK9FcBHLtZq0S89ZPjDLQXBA4xvghaKqI0etp/tF3htTM0sazJKKLz9oEiGRtu7w==", + "version": "7.23.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.23.3.tgz", + "integrity": "sha512-91RS0MDnAWDNvGC6Wio5XYkyWI39FMFO+JK9+4AlgaTH+yWwVTsw7/sn6LK0lH7c5F+TFkpv/3LfCJ1Ydwof/g==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -409,18 +409,18 @@ } }, "node_modules/@babel/traverse": { - "version": "7.23.2", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", - "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.4.tgz", + "integrity": "sha512-IYM8wSUwunWTB6tFC2dkKZhxbIjHoWemdK+3f8/wq8aKhbUscxD5MX72ubd90fxvFknaLPeGw5ycU84V1obHJg==", "dependencies": { - "@babel/code-frame": "^7.22.13", - "@babel/generator": "^7.23.0", + "@babel/code-frame": "^7.23.4", + "@babel/generator": "^7.23.4", "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-function-name": "^7.23.0", "@babel/helper-hoist-variables": "^7.22.5", "@babel/helper-split-export-declaration": "^7.22.6", - "@babel/parser": "^7.23.0", - "@babel/types": "^7.23.0", + "@babel/parser": "^7.23.4", + "@babel/types": "^7.23.4", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -429,11 +429,11 @@ } }, "node_modules/@babel/types": { - "version": "7.23.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", - "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", + "version": "7.23.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.4.tgz", + "integrity": "sha512-7uIFwVYpoplT5jp/kVv6EF93VaJ8H+Yn5IczYiaAi98ajzjfoZfslet/e0sLh+wVBjb2qqIut1b0S26VSafsSQ==", "dependencies": { - "@babel/helper-string-parser": "^7.22.5", + "@babel/helper-string-parser": "^7.23.4", "@babel/helper-validator-identifier": "^7.22.20", "to-fast-properties": "^2.0.0" }, @@ -599,9 +599,9 @@ "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==" }, "node_modules/@esbuild/android-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.20.tgz", - "integrity": "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.7.tgz", + "integrity": "sha512-YGSPnndkcLo4PmVl2tKatEn+0mlVMr3yEpOOT0BeMria87PhvoJb5dg5f5Ft9fbCVgtAz4pWMzZVgSEGpDAlww==", "cpu": [ "arm" ], @@ -615,9 +615,9 @@ } }, "node_modules/@esbuild/android-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.20.tgz", - "integrity": "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.7.tgz", + "integrity": "sha512-YEDcw5IT7hW3sFKZBkCAQaOCJQLONVcD4bOyTXMZz5fr66pTHnAet46XAtbXAkJRfIn2YVhdC6R9g4xa27jQ1w==", "cpu": [ "arm64" ], @@ -631,9 +631,9 @@ } }, "node_modules/@esbuild/android-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.20.tgz", - "integrity": "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.7.tgz", + "integrity": "sha512-jhINx8DEjz68cChFvM72YzrqfwJuFbfvSxZAk4bebpngGfNNRm+zRl4rtT9oAX6N9b6gBcFaJHFew5Blf6CvUw==", "cpu": [ "x64" ], @@ -647,9 +647,9 @@ } }, "node_modules/@esbuild/darwin-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.20.tgz", - "integrity": "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.7.tgz", + "integrity": "sha512-dr81gbmWN//3ZnBIm6YNCl4p3pjnabg1/ZVOgz2fJoUO1a3mq9WQ/1iuEluMs7mCL+Zwv7AY5e3g1hjXqQZ9Iw==", "cpu": [ "arm64" ], @@ -663,9 +663,9 @@ } }, "node_modules/@esbuild/darwin-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.20.tgz", - "integrity": "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.7.tgz", + "integrity": "sha512-Lc0q5HouGlzQEwLkgEKnWcSazqr9l9OdV2HhVasWJzLKeOt0PLhHaUHuzb8s/UIya38DJDoUm74GToZ6Wc7NGQ==", "cpu": [ "x64" ], @@ -679,9 +679,9 @@ } }, "node_modules/@esbuild/freebsd-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.20.tgz", - "integrity": "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.7.tgz", + "integrity": "sha512-+y2YsUr0CxDFF7GWiegWjGtTUF6gac2zFasfFkRJPkMAuMy9O7+2EH550VlqVdpEEchWMynkdhC9ZjtnMiHImQ==", "cpu": [ "arm64" ], @@ -695,9 +695,9 @@ } }, "node_modules/@esbuild/freebsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.20.tgz", - "integrity": "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.7.tgz", + "integrity": "sha512-CdXOxIbIzPJmJhrpmJTLx+o35NoiKBIgOvmvT+jeSadYiWJn0vFKsl+0bSG/5lwjNHoIDEyMYc/GAPR9jxusTA==", "cpu": [ "x64" ], @@ -711,9 +711,9 @@ } }, "node_modules/@esbuild/linux-arm": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.20.tgz", - "integrity": "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.7.tgz", + "integrity": "sha512-Y+SCmWxsJOdQtjcBxoacn/pGW9HDZpwsoof0ttL+2vGcHokFlfqV666JpfLCSP2xLxFpF1lj7T3Ox3sr95YXww==", "cpu": [ "arm" ], @@ -727,9 +727,9 @@ } }, "node_modules/@esbuild/linux-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.20.tgz", - "integrity": "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.7.tgz", + "integrity": "sha512-inHqdOVCkUhHNvuQPT1oCB7cWz9qQ/Cz46xmVe0b7UXcuIJU3166aqSunsqkgSGMtUCWOZw3+KMwI6otINuC9g==", "cpu": [ "arm64" ], @@ -743,9 +743,9 @@ } }, "node_modules/@esbuild/linux-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.20.tgz", - "integrity": "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.7.tgz", + "integrity": "sha512-2BbiL7nLS5ZO96bxTQkdO0euGZIUQEUXMTrqLxKUmk/Y5pmrWU84f+CMJpM8+EHaBPfFSPnomEaQiG/+Gmh61g==", "cpu": [ "ia32" ], @@ -759,9 +759,9 @@ } }, "node_modules/@esbuild/linux-loong64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.20.tgz", - "integrity": "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.7.tgz", + "integrity": "sha512-BVFQla72KXv3yyTFCQXF7MORvpTo4uTA8FVFgmwVrqbB/4DsBFWilUm1i2Oq6zN36DOZKSVUTb16jbjedhfSHw==", "cpu": [ "loong64" ], @@ -775,9 +775,9 @@ } }, "node_modules/@esbuild/linux-mips64el": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.20.tgz", - "integrity": "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.7.tgz", + "integrity": "sha512-DzAYckIaK+pS31Q/rGpvUKu7M+5/t+jI+cdleDgUwbU7KdG2eC3SUbZHlo6Q4P1CfVKZ1lUERRFP8+q0ob9i2w==", "cpu": [ "mips64el" ], @@ -791,9 +791,9 @@ } }, "node_modules/@esbuild/linux-ppc64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.20.tgz", - "integrity": "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.7.tgz", + "integrity": "sha512-JQ1p0SmUteNdUaaiRtyS59GkkfTW0Edo+e0O2sihnY4FoZLz5glpWUQEKMSzMhA430ctkylkS7+vn8ziuhUugQ==", "cpu": [ "ppc64" ], @@ -807,9 +807,9 @@ } }, "node_modules/@esbuild/linux-riscv64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.20.tgz", - "integrity": "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.7.tgz", + "integrity": "sha512-xGwVJ7eGhkprY/nB7L7MXysHduqjpzUl40+XoYDGC4UPLbnG+gsyS1wQPJ9lFPcxYAaDXbdRXd1ACs9AE9lxuw==", "cpu": [ "riscv64" ], @@ -823,9 +823,9 @@ } }, "node_modules/@esbuild/linux-s390x": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.20.tgz", - "integrity": "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.7.tgz", + "integrity": "sha512-U8Rhki5PVU0L0nvk+E8FjkV8r4Lh4hVEb9duR6Zl21eIEYEwXz8RScj4LZWA2i3V70V4UHVgiqMpszXvG0Yqhg==", "cpu": [ "s390x" ], @@ -839,9 +839,9 @@ } }, "node_modules/@esbuild/linux-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.20.tgz", - "integrity": "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.7.tgz", + "integrity": "sha512-ZYZopyLhm4mcoZXjFt25itRlocKlcazDVkB4AhioiL9hOWhDldU9n38g62fhOI4Pth6vp+Mrd5rFKxD0/S+7aQ==", "cpu": [ "x64" ], @@ -855,9 +855,9 @@ } }, "node_modules/@esbuild/netbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.20.tgz", - "integrity": "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.7.tgz", + "integrity": "sha512-/yfjlsYmT1O3cum3J6cmGG16Fd5tqKMcg5D+sBYLaOQExheAJhqr8xOAEIuLo8JYkevmjM5zFD9rVs3VBcsjtQ==", "cpu": [ "x64" ], @@ -871,9 +871,9 @@ } }, "node_modules/@esbuild/openbsd-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.20.tgz", - "integrity": "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.7.tgz", + "integrity": "sha512-MYDFyV0EW1cTP46IgUJ38OnEY5TaXxjoDmwiTXPjezahQgZd+j3T55Ht8/Q9YXBM0+T9HJygrSRGV5QNF/YVDQ==", "cpu": [ "x64" ], @@ -887,9 +887,9 @@ } }, "node_modules/@esbuild/sunos-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.20.tgz", - "integrity": "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.7.tgz", + "integrity": "sha512-JcPvgzf2NN/y6X3UUSqP6jSS06V0DZAV/8q0PjsZyGSXsIGcG110XsdmuWiHM+pno7/mJF6fjH5/vhUz/vA9fw==", "cpu": [ "x64" ], @@ -903,9 +903,9 @@ } }, "node_modules/@esbuild/win32-arm64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.20.tgz", - "integrity": "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.7.tgz", + "integrity": "sha512-ZA0KSYti5w5toax5FpmfcAgu3ZNJxYSRm0AW/Dao5up0YV1hDVof1NvwLomjEN+3/GMtaWDI+CIyJOMTRSTdMw==", "cpu": [ "arm64" ], @@ -919,9 +919,9 @@ } }, "node_modules/@esbuild/win32-ia32": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.20.tgz", - "integrity": "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.7.tgz", + "integrity": "sha512-CTOnijBKc5Jpk6/W9hQMMvJnsSYRYgveN6O75DTACCY18RA2nqka8dTZR+x/JqXCRiKk84+5+bRKXUSbbwsS0A==", "cpu": [ "ia32" ], @@ -935,9 +935,9 @@ } }, "node_modules/@esbuild/win32-x64": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.20.tgz", - "integrity": "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.7.tgz", + "integrity": "sha512-gRaP2sk6hc98N734luX4VpF318l3w+ofrtTu9j5L8EQXF+FzQKV6alCOHMVoJJHvVK/mGbwBXfOL1HETQu9IGQ==", "cpu": [ "x64" ], @@ -1461,9 +1461,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.2.0.tgz", - "integrity": "sha512-8PlggAxGxavr+pkCNeV1TM2wTb2o+cUWDg9M1cm9nR27Dsn287uZtSLYXoQqQcmq+sYfF7lHfd3sWJJinH9GmA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.3.0.tgz", + "integrity": "sha512-/4pns6BYi8MXdwnXM44yoGAcFYVHL/BYlB2q1HXZ6AzH++LaiEVWFpBWQ/glXhbMbv3E3o09igrHFbP/snhAvA==", "cpu": [ "arm" ], @@ -1474,9 +1474,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.2.0.tgz", - "integrity": "sha512-+71T85hbMFrJI+zKQULNmSYBeIhru55PYoF/u75MyeN2FcxE4HSPw20319b+FcZ4lWx2Nx/Ql9tN+hoaD3GH/A==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.3.0.tgz", + "integrity": "sha512-nLO/JsL9idr416vzi3lHm3Xm+QZh4qHij8k3Er13kZr5YhL7/+kBAx84kDmPc7HMexLmwisjDCeDIKNFp8mDlQ==", "cpu": [ "arm64" ], @@ -1487,9 +1487,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.2.0.tgz", - "integrity": "sha512-IIIQLuG43QIElT1JZqUP/zqIdiJl4t9U/boa0GZnQTw9m1X0k3mlBuysbgYXeloLT1RozdL7bgw4lpSaI8GOXw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.3.0.tgz", + "integrity": "sha512-dGhVBlllt4iHwTGy21IEoMOTN5wZoid19zEIxsdY29xcEiOEHqzDa7Sqrkh5OE7LKCowL61eFJXxYe/+pYa7ZQ==", "cpu": [ "arm64" ], @@ -1500,9 +1500,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.2.0.tgz", - "integrity": "sha512-BXcXvnLaea1Xz900omrGJhxHFJfH9jZ0CpJuVsbjjhpniJ6qiLXz3xA8Lekaa4MuhFcJd4f0r+Ky1G4VFbYhWw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.3.0.tgz", + "integrity": "sha512-h8wRfHeLEbU3NzaP1Oku7BYXCJQiTRr+8U0lklyOQXxXiEpHLL8tk1hFl+tezoRKLcPJD7joKaK74ASsqt3Ekg==", "cpu": [ "x64" ], @@ -1513,9 +1513,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.2.0.tgz", - "integrity": "sha512-f4K3MKw9Y4AKi4ANGnmPIglr+S+8tO858YrGVuqAHXxJdVghBmz9CPU9kDpOnGvT4g4vg5uNyIFpOOFvffXyMA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.3.0.tgz", + "integrity": "sha512-wP4VgR/gfV18sylTuym3sxRTkAgUR2vh6YLeX/GEznk5jCYcYSlx585XlcUcl0c8UffIZlRJ09raWSX3JDb4GA==", "cpu": [ "arm" ], @@ -1526,9 +1526,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.2.0.tgz", - "integrity": "sha512-bNsTYQBgp4H7w6cT7FZhesxpcUPahsSIy4NgdZjH1ZwEoZHxi4XKglj+CsSEkhsKi+x6toVvMylhjRKhEMYfnA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.3.0.tgz", + "integrity": "sha512-v/14JCYVkqRSJeQbxFx4oUkwVQQw6lFMN7bd4vuARBc3X2lmomkxBsc+BFiIDL/BK+CTx5AOh/k9XmqDnKWRVg==", "cpu": [ "arm64" ], @@ -1539,9 +1539,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.2.0.tgz", - "integrity": "sha512-Jp1NxBJpGLuxRU2ihrQk4IZ+ia5nffobG6sOFUPW5PMYkF0kQtxEbeDuCa69Xif211vUOcxlOnf5IOEIpTEySA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.3.0.tgz", + "integrity": "sha512-tNhfYqFH5OxtRzfkTOKdgFYlPSZnlDLNW4+leNEvQZhwTJxoTwsZAAhR97l3qVry/kkLyJPBK+Q8EAJLPinDIg==", "cpu": [ "arm64" ], @@ -1552,9 +1552,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.2.0.tgz", - "integrity": "sha512-3p3iRtQmv2aXw+vtKNyZMLOQ+LSRsqArXjKAh2Oj9cqwfIRe7OXvdkOzWfZOIp1F/x5KJzVAxGxnniF4cMbnsQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.3.0.tgz", + "integrity": "sha512-pw77m8QywdsoFdFOgmc8roF1inBI0rciqzO8ffRUgLoq7+ee9o5eFqtEcS6hHOOplgifAUUisP8cAnwl9nUYPw==", "cpu": [ "x64" ], @@ -1565,9 +1565,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.2.0.tgz", - "integrity": "sha512-atih7IF/reUZe4LBLC5Izd44hth2tfDIG8LaPp4/cQXdHh9jabcZEvIeRPrpDq0i/Uu487Qu5gl5KwyAnWajnw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.3.0.tgz", + "integrity": "sha512-tJs7v2MnV2F8w6X1UpPHl/43OfxjUy9SuJ2ZPoxn79v9vYteChVYO/ueLHCpRMmyTUIVML3N9z4azl9ENH8Xxg==", "cpu": [ "x64" ], @@ -1578,9 +1578,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.2.0.tgz", - "integrity": "sha512-vYxF3tKJeUE4ceYzpNe2p84RXk/fGK30I8frpRfv/MyPStej/mRlojztkN7Jtd1014HHVeq/tYaMBz/3IxkxZw==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.3.0.tgz", + "integrity": "sha512-OKGxp6kATQdTyI2DF+e9s+hB3/QZB45b6e+dzcfW1SUqiF6CviWyevhmT4USsMEdP3mlpC9zxLz3Oh+WaTMOSw==", "cpu": [ "arm64" ], @@ -1591,9 +1591,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.2.0.tgz", - "integrity": "sha512-1LZJ6zpl93SaPQvas618bMFarVwufWTaczH4ESAbFcwiC4OtznA6Ym+hFPyIGaJaGEB8uMWWac0uXGPXOg5FGA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.3.0.tgz", + "integrity": "sha512-DDZ5AH68JJ2ClQFEA1aNnfA7Ybqyeh0644rGbrLOdNehTmzfICHiWSn0OprzYi9HAshTPQvlwrM+bi2kuaIOjQ==", "cpu": [ "ia32" ], @@ -1604,9 +1604,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.2.0.tgz", - "integrity": "sha512-dgQfFdHCNg08nM5zBmqxqc9vrm0DVzhWotpavbPa0j4//MAOKZEB75yGAfzQE9fUJ+4pvM1239Y4IhL8f6sSog==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.3.0.tgz", + "integrity": "sha512-dMvGV8p92GQ8jhNlGIKpyhVZPzJlT258pPrM5q2F8lKcc9Iv9BbfdnhX1OfinYWnb9ms5zLw6MlaMnqLfUkKnQ==", "cpu": [ "x64" ], @@ -1665,9 +1665,9 @@ } }, "node_modules/@types/babel__core": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.2.tgz", - "integrity": "sha512-pNpr1T1xLUc2l3xJKuPtsEky3ybxN3m4fJkknfIpTCTfIZCDW57oAg+EfCgIIp2rvCe0Wn++/FfodDS4YXxBwA==", + "version": "7.20.5", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", + "integrity": "sha512-qoQprZvz5wQFJwMDqeseRXWv3rqMvhgpbXFfVyWhbx9X47POIA6i/+dXefEmZKoAgOaTdaIgNSMqMIU61yRyzA==", "dev": true, "dependencies": { "@babel/parser": "^7.20.7", @@ -1678,18 +1678,18 @@ } }, "node_modules/@types/babel__generator": { - "version": "7.6.5", - "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.5.tgz", - "integrity": "sha512-h9yIuWbJKdOPLJTbmSpPzkF67e659PbQDba7ifWm5BJ8xTv+sDmS7rFmywkWOvXedGTivCdeGSIIX8WLcRTz8w==", + "version": "7.6.7", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.7.tgz", + "integrity": "sha512-6Sfsq+EaaLrw4RmdFWE9Onp63TOUue71AWb4Gpa6JxzgTYtimbM086WnYTy2U67AofR++QKCo08ZP6pwx8YFHQ==", "dev": true, "dependencies": { "@babel/types": "^7.0.0" } }, "node_modules/@types/babel__template": { - "version": "7.4.2", - "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.2.tgz", - "integrity": "sha512-/AVzPICMhMOMYoSx9MoKpGDKdBRsIXMNByh1PXSZoa+v6ZoLa8xxtsT/uLQ/NJm0XVAWl/BvId4MlDeXJaeIZQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.4.tgz", + "integrity": "sha512-h/NUaSyG5EyxBIp8YRxo4RMe2/qQgvyowRwVMzhYhBCONbW8PUsg4lkFMrhgZhUe5z3L3MiLDuvyJ/CaPa2A8A==", "dev": true, "dependencies": { "@babel/parser": "^7.1.0", @@ -1697,9 +1697,9 @@ } }, "node_modules/@types/babel__traverse": { - "version": "7.20.2", - "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.2.tgz", - "integrity": "sha512-ojlGK1Hsfce93J0+kn3H5R73elidKUaZonirN33GSmgTUMpzI/MIFfSpF3haANe3G1bEBS9/9/QEqwTzwqFsKw==", + "version": "7.20.4", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.20.4.tgz", + "integrity": "sha512-mSM/iKUk5fDDrEV/e83qY+Cr3I1+Q3qqTuEn++HAWYjEa1+NxZr6CNrcJGf2ZTnq4HoFGC3zaTPZTobCzCFukA==", "dev": true, "dependencies": { "@babel/types": "^7.20.7" @@ -2047,22 +2047,22 @@ } }, "node_modules/@vitejs/plugin-react": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.1.0.tgz", - "integrity": "sha512-rM0SqazU9iqPUraQ2JlIvReeaxOoRj6n+PzB1C0cBzIbd8qP336nC39/R9yPi3wVcah7E7j/kdU1uCUqMEU4OQ==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.2.0.tgz", + "integrity": "sha512-+MHTH/e6H12kRp5HUkzOGqPMksezRMmW+TNzlh/QXfI8rRf6l2Z2yH/v12no1UvTwhZgEDMuQ7g7rrfMseU6FQ==", "dev": true, "dependencies": { - "@babel/core": "^7.22.20", - "@babel/plugin-transform-react-jsx-self": "^7.22.5", - "@babel/plugin-transform-react-jsx-source": "^7.22.5", - "@types/babel__core": "^7.20.2", + "@babel/core": "^7.23.3", + "@babel/plugin-transform-react-jsx-self": "^7.23.3", + "@babel/plugin-transform-react-jsx-source": "^7.23.3", + "@types/babel__core": "^7.20.4", "react-refresh": "^0.14.0" }, "engines": { "node": "^14.18.0 || >=16.0.0" }, "peerDependencies": { - "vite": "^4.2.0" + "vite": "^4.2.0 || ^5.0.0" } }, "node_modules/@webassemblyjs/ast": { @@ -3240,9 +3240,9 @@ } }, "node_modules/esbuild": { - "version": "0.18.20", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.20.tgz", - "integrity": "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==", + "version": "0.19.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.7.tgz", + "integrity": "sha512-6brbTZVqxhqgbpqBR5MzErImcpA0SQdoKOkcWK/U30HtQxnokIpG3TX2r0IJqbFUzqLjhU/zC1S5ndgakObVCQ==", "dev": true, "hasInstallScript": true, "bin": { @@ -3252,28 +3252,28 @@ "node": ">=12" }, "optionalDependencies": { - "@esbuild/android-arm": "0.18.20", - "@esbuild/android-arm64": "0.18.20", - "@esbuild/android-x64": "0.18.20", - "@esbuild/darwin-arm64": "0.18.20", - "@esbuild/darwin-x64": "0.18.20", - "@esbuild/freebsd-arm64": "0.18.20", - "@esbuild/freebsd-x64": "0.18.20", - "@esbuild/linux-arm": "0.18.20", - "@esbuild/linux-arm64": "0.18.20", - "@esbuild/linux-ia32": "0.18.20", - "@esbuild/linux-loong64": "0.18.20", - "@esbuild/linux-mips64el": "0.18.20", - "@esbuild/linux-ppc64": "0.18.20", - "@esbuild/linux-riscv64": "0.18.20", - "@esbuild/linux-s390x": "0.18.20", - "@esbuild/linux-x64": "0.18.20", - "@esbuild/netbsd-x64": "0.18.20", - "@esbuild/openbsd-x64": "0.18.20", - "@esbuild/sunos-x64": "0.18.20", - "@esbuild/win32-arm64": "0.18.20", - "@esbuild/win32-ia32": "0.18.20", - "@esbuild/win32-x64": "0.18.20" + "@esbuild/android-arm": "0.19.7", + "@esbuild/android-arm64": "0.19.7", + "@esbuild/android-x64": "0.19.7", + "@esbuild/darwin-arm64": "0.19.7", + "@esbuild/darwin-x64": "0.19.7", + "@esbuild/freebsd-arm64": "0.19.7", + "@esbuild/freebsd-x64": "0.19.7", + "@esbuild/linux-arm": "0.19.7", + "@esbuild/linux-arm64": "0.19.7", + "@esbuild/linux-ia32": "0.19.7", + "@esbuild/linux-loong64": "0.19.7", + "@esbuild/linux-mips64el": "0.19.7", + "@esbuild/linux-ppc64": "0.19.7", + "@esbuild/linux-riscv64": "0.19.7", + "@esbuild/linux-s390x": "0.19.7", + "@esbuild/linux-x64": "0.19.7", + "@esbuild/netbsd-x64": "0.19.7", + "@esbuild/openbsd-x64": "0.19.7", + "@esbuild/sunos-x64": "0.19.7", + "@esbuild/win32-arm64": "0.19.7", + "@esbuild/win32-ia32": "0.19.7", + "@esbuild/win32-x64": "0.19.7" } }, "node_modules/escalade": { @@ -6151,9 +6151,9 @@ } }, "node_modules/rollup": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.2.0.tgz", - "integrity": "sha512-deaMa9Z+jPVeBD2dKXv+h7EbdKte9++V2potc/ADqvVgEr6DEJ3ia9u0joarjC2lX/ubaCRYz3QVx0TzuVqAJA==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.3.0.tgz", + "integrity": "sha512-scIi1NrKLDIYSPK66jjECtII7vIgdAMFmFo8h6qm++I6nN9qDSV35Ku6erzGVqYjx+lj+j5wkusRMr++8SyDZg==", "dev": true, "bin": { "rollup": "dist/bin/rollup" @@ -6163,18 +6163,18 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.2.0", - "@rollup/rollup-android-arm64": "4.2.0", - "@rollup/rollup-darwin-arm64": "4.2.0", - "@rollup/rollup-darwin-x64": "4.2.0", - "@rollup/rollup-linux-arm-gnueabihf": "4.2.0", - "@rollup/rollup-linux-arm64-gnu": "4.2.0", - "@rollup/rollup-linux-arm64-musl": "4.2.0", - "@rollup/rollup-linux-x64-gnu": "4.2.0", - "@rollup/rollup-linux-x64-musl": "4.2.0", - "@rollup/rollup-win32-arm64-msvc": "4.2.0", - "@rollup/rollup-win32-ia32-msvc": "4.2.0", - "@rollup/rollup-win32-x64-msvc": "4.2.0", + "@rollup/rollup-android-arm-eabi": "4.3.0", + "@rollup/rollup-android-arm64": "4.3.0", + "@rollup/rollup-darwin-arm64": "4.3.0", + "@rollup/rollup-darwin-x64": "4.3.0", + "@rollup/rollup-linux-arm-gnueabihf": "4.3.0", + "@rollup/rollup-linux-arm64-gnu": "4.3.0", + "@rollup/rollup-linux-arm64-musl": "4.3.0", + "@rollup/rollup-linux-x64-gnu": "4.3.0", + "@rollup/rollup-linux-x64-musl": "4.3.0", + "@rollup/rollup-win32-arm64-msvc": "4.3.0", + "@rollup/rollup-win32-ia32-msvc": "4.3.0", + "@rollup/rollup-win32-x64-msvc": "4.3.0", "fsevents": "~2.3.2" } }, @@ -7230,29 +7230,29 @@ } }, "node_modules/vite": { - "version": "4.4.11", - "resolved": "https://registry.npmjs.org/vite/-/vite-4.4.11.tgz", - "integrity": "sha512-ksNZJlkcU9b0lBwAGZGGaZHCMqHsc8OpgtoYhsQ4/I2v5cnpmmmqe5pM4nv/4Hn6G/2GhTdj0DhZh2e+Er1q5A==", + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.0.2.tgz", + "integrity": "sha512-6CCq1CAJCNM1ya2ZZA7+jS2KgnhbzvxakmlIjN24cF/PXhRMzpM/z8QgsVJA/Dm5fWUWnVEsmtBoMhmerPxT0g==", "dev": true, "dependencies": { - "esbuild": "^0.18.10", - "postcss": "^8.4.27", - "rollup": "^3.27.1" + "esbuild": "^0.19.3", + "postcss": "^8.4.31", + "rollup": "^4.2.0" }, "bin": { "vite": "bin/vite.js" }, "engines": { - "node": "^14.18.0 || >=16.0.0" + "node": "^18.0.0 || >=20.0.0" }, "funding": { "url": "https://github.com/vitejs/vite?sponsor=1" }, "optionalDependencies": { - "fsevents": "~2.3.2" + "fsevents": "~2.3.3" }, "peerDependencies": { - "@types/node": ">= 14", + "@types/node": "^18.0.0 || >=20.0.0", "less": "*", "lightningcss": "^1.21.0", "sass": "*", @@ -7284,22 +7284,6 @@ } } }, - "node_modules/vite/node_modules/rollup": { - "version": "3.29.4", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-3.29.4.tgz", - "integrity": "sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==", - "dev": true, - "bin": { - "rollup": "dist/bin/rollup" - }, - "engines": { - "node": ">=14.18.0", - "npm": ">=8.0.0" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, "node_modules/void-elements": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-3.1.0.tgz", diff --git a/react-app/package.json b/react-app/package.json index 29eda49a..00bf86ca 100644 --- a/react-app/package.json +++ b/react-app/package.json @@ -6,8 +6,8 @@ "build:firefox": "tsc --noEmit && cross-env __FIREFOX__=true vite build", "build:watch": "cross-env __DEV__=true vite build -w --mode development", "build:firefox:watch": "cross-env __DEV__=true __FIREFOX__=true vite build -w --mode development", - "build:hmr": "rollup --config utils/core/hmr-core/reload/rollup.config.mjs", - "wss": "node utils/core/hmr-core/reload/initReloadServer.js", + "build:hmr": "rollup --config utils/core/reload/rollup.config.mjs", + "wss": "node utils/core/reload/initReloadServer.js", "dev": "npm run build:hmr && (run-p wss build:watch)", "dev:firefox": "npm run build:hmr && (run-p wss build:firefox:watch)", "lint": "eslint src --ext .ts", @@ -45,7 +45,7 @@ "@types/ws": "8.5.7", "@typescript-eslint/eslint-plugin": "6.7.5", "@typescript-eslint/parser": "6.7.5", - "@vitejs/plugin-react": "4.1.0", + "@vitejs/plugin-react": "4.2.0", "chokidar": "3.5.3", "cross-env": "7.0.3", "eslint": "8.51.0", @@ -59,10 +59,10 @@ "fs-extra": "11.1.1", "npm-run-all": "4.1.5", "prettier": "3.0.3", - "rollup": "4.2.0", + "rollup": "4.3.0", "ts-loader": "9.5.0", "typescript": "5.2.2", - "vite": "4.4.11", + "vite": "5.0.2", "ws": "8.14.2" } } diff --git a/react-app/src/pages/popup/Popup.tsx b/react-app/src/pages/popup/Popup.tsx index 2efb368b..0d40ff9b 100644 --- a/react-app/src/pages/popup/Popup.tsx +++ b/react-app/src/pages/popup/Popup.tsx @@ -14,8 +14,8 @@ import urls from '@utils/endpoints/urls'; import React from 'react'; import { useTranslation } from 'react-i18next'; import { createHashRouter } from 'react-router-dom'; -import '../internationalization'; import { toast } from 'react-toastify'; +import '../internationalization'; const hashRouting = createHashRouter([ { @@ -39,6 +39,7 @@ const hashRouting = createHashRouter([ element: , }, ]); + const Popup = () => { const { isDarkMode } = useTernaryDarkMode(); diff --git a/react-app/utils/core/hmr-core/plugins/custom-dynamic-import.ts b/react-app/utils/core/hmr-core/plugins/custom-dynamic-import.ts deleted file mode 100644 index 34c114a9..00000000 --- a/react-app/utils/core/hmr-core/plugins/custom-dynamic-import.ts +++ /dev/null @@ -1,34 +0,0 @@ -import type { PluginOption } from 'vite'; - -export default function customDynamicImport(): PluginOption { - return { - name: 'custom-dynamic-import', - renderDynamicImport({ moduleId }) { - if (!moduleId.includes('node_modules')) { - // ↑ dont modify any import from node_modules - if (process.env.__FIREFOX__) { - return { - left: ` - { - const dynamicImport = (path) => import(path); - dynamicImport(browser.runtime.getURL('./') + - `, - right: ".split('../').join(''))}", - }; - } - return { - left: ` - { - const dynamicImport = (path) => import(path); - dynamicImport( - `, - right: ')}', - }; - } - return { - left: 'import(', - right: ')', - }; - }, - }; -} diff --git a/react-app/utils/core/hmr-core/plugins/make-manifest.ts b/react-app/utils/core/hmr-core/plugins/make-manifest.ts deleted file mode 100644 index 9b6a99d1..00000000 --- a/react-app/utils/core/hmr-core/plugins/make-manifest.ts +++ /dev/null @@ -1,38 +0,0 @@ -import * as fs from 'fs'; -import * as path from 'path'; -import type { PluginOption } from 'vite'; -import colorLog from '../log'; -import ManifestParser from '../manifest-parser'; - -const { resolve } = path; - -const distDir = resolve(__dirname, '..', '..', '..', '..', 'dist'); -const publicDir = resolve(__dirname, '..', '..', '..', '..', 'public'); - -export default function makeManifest(manifest: chrome.runtime.ManifestV3, config: { isDev: boolean }): PluginOption { - function makeManifest(to: string) { - if (!fs.existsSync(to)) { - fs.mkdirSync(to); - } - const manifestPath = resolve(to, 'manifest.json'); - - fs.writeFileSync(manifestPath, ManifestParser.convertManifestToString(manifest)); - - colorLog(`Manifest file copy complete: ${manifestPath}`, 'success'); - } - - return { - name: 'make-manifest', - buildStart() { - if (config.isDev) { - makeManifest(distDir); - } - }, - buildEnd() { - if (config.isDev) { - return; - } - makeManifest(publicDir); - }, - }; -} diff --git a/react-app/utils/core/hmr-core/plugins/watch-rebuild.ts b/react-app/utils/core/hmr-core/plugins/watch-rebuild.ts deleted file mode 100644 index ea617387..00000000 --- a/react-app/utils/core/hmr-core/plugins/watch-rebuild.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { resolve } from 'path'; -import type { PluginOption } from 'vite'; - -const rootDir = resolve(__dirname, '..', '..', '..', '..'); -const manifestFile = resolve(rootDir, 'manifest.ts'); -const viteConfigFile = resolve(rootDir, 'vite.config.ts'); - -export default function watchRebuild(): PluginOption { - return { - name: 'watch-rebuild', - async buildStart() { - this.addWatchFile(manifestFile); - this.addWatchFile(viteConfigFile); - }, - }; -} diff --git a/react-app/utils/core/hmr-core/reload/constant.ts b/react-app/utils/core/hmr-core/reload/constant.ts deleted file mode 100644 index 548669d8..00000000 --- a/react-app/utils/core/hmr-core/reload/constant.ts +++ /dev/null @@ -1,5 +0,0 @@ -export const LOCAL_RELOAD_SOCKET_PORT = 8081; -export const LOCAL_RELOAD_SOCKET_URL = `ws://localhost:${LOCAL_RELOAD_SOCKET_PORT}`; -export const UPDATE_PENDING_MESSAGE = 'wait_update'; -export const UPDATE_REQUEST_MESSAGE = 'do_update'; -export const UPDATE_COMPLETE_MESSAGE = 'done_update'; diff --git a/react-app/utils/core/hmr-core/reload/initReloadServer.ts b/react-app/utils/core/hmr-core/reload/initReloadServer.ts deleted file mode 100644 index 7f17838a..00000000 --- a/react-app/utils/core/hmr-core/reload/initReloadServer.ts +++ /dev/null @@ -1,65 +0,0 @@ -import chokidar from 'chokidar'; -import { WebSocket, WebSocketServer } from 'ws'; -import { - LOCAL_RELOAD_SOCKET_PORT, - LOCAL_RELOAD_SOCKET_URL, - UPDATE_COMPLETE_MESSAGE, - UPDATE_PENDING_MESSAGE, - UPDATE_REQUEST_MESSAGE, -} from './constant'; -import MessageInterpreter from './interpreter'; -import { debounce } from './utils'; - -const clientsThatNeedToUpdate: Set = new Set(); - -function initReloadServer() { - const wss = new WebSocketServer({ port: LOCAL_RELOAD_SOCKET_PORT }); - - wss.on('listening', () => console.log(`[HRS] Server listening at ${LOCAL_RELOAD_SOCKET_URL}`)); - - wss.on('connection', ws => { - clientsThatNeedToUpdate.add(ws); - - ws.addEventListener('close', () => clientsThatNeedToUpdate.delete(ws)); - ws.addEventListener('message', event => { - const message = MessageInterpreter.receive(String(event.data)); - if (message.type === UPDATE_COMPLETE_MESSAGE) { - ws.close(); - } - }); - }); -} - -/** CHECK:: src file was updated **/ -const debounceSrc = debounce(function (path: string) { - // Normalize path on Windows - const pathConverted = path.replace(/\\/g, '/'); - clientsThatNeedToUpdate.forEach((ws: WebSocket) => - ws.send( - MessageInterpreter.send({ - type: UPDATE_PENDING_MESSAGE, - path: pathConverted, - }), - ), - ); - // Delay waiting for public assets to be copied -}, 400); -chokidar.watch('src').on('all', (event, path) => debounceSrc(path)); - -/** CHECK:: build was completed **/ -const debounceDist = debounce(() => { - clientsThatNeedToUpdate.forEach((ws: WebSocket) => { - ws.send(MessageInterpreter.send({ type: UPDATE_REQUEST_MESSAGE })); - }); -}, 100); -chokidar.watch('dist').on('all', event => { - // Ignore unlink, unlinkDir and change events - // that happen in beginning of build:watch and - // that will cause ws.send() if it takes more than 400ms - // to build (which it might). This fixes: - // https://github.com/Jonghakseo/chrome-extension-boilerplate-react-vite/issues/100 - if (event !== 'add' && event !== 'addDir') return; - debounceDist(); -}); - -initReloadServer(); diff --git a/react-app/utils/core/hmr-core/reload/interpreter/types.ts b/react-app/utils/core/hmr-core/reload/interpreter/types.ts deleted file mode 100644 index 831010a4..00000000 --- a/react-app/utils/core/hmr-core/reload/interpreter/types.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { UPDATE_COMPLETE_MESSAGE, UPDATE_PENDING_MESSAGE, UPDATE_REQUEST_MESSAGE } from '../constant'; - -type UpdatePendingMessage = { - type: typeof UPDATE_PENDING_MESSAGE; - path: string; -}; - -type UpdateRequestMessage = { - type: typeof UPDATE_REQUEST_MESSAGE; -}; - -type UpdateCompleteMessage = { type: typeof UPDATE_COMPLETE_MESSAGE }; - -export type SerializedMessage = string; -export type ReloadMessage = UpdateCompleteMessage | UpdateRequestMessage | UpdatePendingMessage; diff --git a/react-app/utils/core/hmr-core/reload/rollup.config.mjs b/react-app/utils/core/hmr-core/reload/rollup.config.mjs deleted file mode 100644 index 8be81cbb..00000000 --- a/react-app/utils/core/hmr-core/reload/rollup.config.mjs +++ /dev/null @@ -1,28 +0,0 @@ -import typescript from '@rollup/plugin-typescript'; - -const plugins = [typescript()]; - -export default [ - { - plugins, - input: 'utils/core/hmr-core/reload/initReloadServer.ts', - output: { - file: 'utils/core/hmr-core/reload/initReloadServer.js', - }, - external: ['ws', 'chokidar', 'timers'], - }, - { - plugins, - input: 'utils/core/hmr-core/reload/injections/script.ts', - output: { - file: 'utils/core/hmr-core/reload/injections/script.js', - }, - }, - { - plugins, - input: 'utils/core/hmr-core/reload/injections/view.ts', - output: { - file: 'utils/core/hmr-core/reload/injections/view.js', - }, - }, -]; diff --git a/react-app/utils/core/hmr-core/log.ts b/react-app/utils/core/log.ts similarity index 96% rename from react-app/utils/core/hmr-core/log.ts rename to react-app/utils/core/log.ts index 73b60705..71b9fe5c 100644 --- a/react-app/utils/core/hmr-core/log.ts +++ b/react-app/utils/core/log.ts @@ -1,5 +1,5 @@ type ColorType = 'success' | 'info' | 'error' | 'warning' | keyof typeof COLORS; -export type ValueOf = T[keyof T]; +type ValueOf = T[keyof T]; export default function colorLog(message: string, type?: ColorType) { let color: ValueOf; diff --git a/react-app/utils/core/hmr-core/manifest-parser/index.ts b/react-app/utils/core/manifest-parser/index.ts similarity index 100% rename from react-app/utils/core/hmr-core/manifest-parser/index.ts rename to react-app/utils/core/manifest-parser/index.ts diff --git a/react-app/utils/core/hmr-core/plugins/add-hmr.ts b/react-app/utils/core/plugins/add-hmr.ts similarity index 100% rename from react-app/utils/core/hmr-core/plugins/add-hmr.ts rename to react-app/utils/core/plugins/add-hmr.ts diff --git a/react-app/utils/core/plugins/custom-dynamic-import.ts b/react-app/utils/core/plugins/custom-dynamic-import.ts new file mode 100644 index 00000000..6717fd1a --- /dev/null +++ b/react-app/utils/core/plugins/custom-dynamic-import.ts @@ -0,0 +1,19 @@ +import type { PluginOption } from 'vite'; + +export default function customDynamicImport(): PluginOption { + return { + name: 'custom-dynamic-import', + renderDynamicImport({ moduleId }) { + if (!moduleId.includes('node_modules') && process.env.__FIREFOX__) { + return { + left: `import(browser.runtime.getURL('./') + `, + right: ".split('../').join(''));", + }; + } + return { + left: 'import(', + right: ')', + }; + }, + }; +} diff --git a/react-app/utils/core/plugins/make-manifest.ts b/react-app/utils/core/plugins/make-manifest.ts new file mode 100644 index 00000000..9e4184f5 --- /dev/null +++ b/react-app/utils/core/plugins/make-manifest.ts @@ -0,0 +1,49 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as process from 'process'; +import url from 'url'; +import type { PluginOption } from 'vite'; +import colorLog from '../log'; +import ManifestParser from '../manifest-parser'; + +const { resolve } = path; + +const rootDir = resolve(__dirname, '../../..'); +const distDir = resolve(rootDir, 'dist'); +const manifestFile = resolve(rootDir, 'manifest.js'); + +const getManifestWithCacheBurst = (): Promise<{ default: chrome.runtime.ManifestV3 }> => { + const withCacheBurst = (path: string) => `${path}?${Date.now().toString()}`; + /** + * In Windows, import() doesn't work without file:// protocol. + * So, we need to convert path to file:// protocol. (url.pathToFileURL) + */ + if (process.platform === 'win32') { + return import(withCacheBurst(url.pathToFileURL(manifestFile).href)); + } + return import(withCacheBurst(manifestFile)); +}; + +export default function makeManifest(): PluginOption { + function makeManifest(manifest: chrome.runtime.ManifestV3, to: string) { + if (!fs.existsSync(to)) { + fs.mkdirSync(to); + } + const manifestPath = resolve(to, 'manifest.json'); + + fs.writeFileSync(manifestPath, ManifestParser.convertManifestToString(manifest)); + + colorLog(`Manifest file copy complete: ${manifestPath}`, 'success'); + } + + return { + name: 'make-manifest', + buildStart() { + this.addWatchFile(manifestFile); + }, + async writeBundle() { + const manifest = await getManifestWithCacheBurst(); + makeManifest(manifest.default, distDir); + }, + }; +} diff --git a/react-app/utils/core/plugins/watch-rebuild.ts b/react-app/utils/core/plugins/watch-rebuild.ts new file mode 100644 index 00000000..0ea06a74 --- /dev/null +++ b/react-app/utils/core/plugins/watch-rebuild.ts @@ -0,0 +1,18 @@ +import type { PluginOption } from 'vite'; +import { WebSocket } from 'ws'; +import { LOCAL_RELOAD_SOCKET_URL } from '../reload/constant'; +import MessageInterpreter from '../reload/interpreter'; + +export default function watchRebuild(): PluginOption { + const ws = new WebSocket(LOCAL_RELOAD_SOCKET_URL); + return { + name: 'watch-rebuild', + writeBundle() { + /** + * When the build is complete, send a message to the reload server. + * The reload server will send a message to the client to reload or refresh the extension. + */ + ws.send(MessageInterpreter.send({ type: 'build_complete' })); + }, + }; +} diff --git a/react-app/utils/core/reload/constant.ts b/react-app/utils/core/reload/constant.ts new file mode 100644 index 00000000..de2d84fb --- /dev/null +++ b/react-app/utils/core/reload/constant.ts @@ -0,0 +1,2 @@ +export const LOCAL_RELOAD_SOCKET_PORT = 8081; +export const LOCAL_RELOAD_SOCKET_URL = `ws://localhost:${LOCAL_RELOAD_SOCKET_PORT}`; diff --git a/react-app/utils/core/hmr-core/reload/initReloadClient.ts b/react-app/utils/core/reload/initReloadClient.ts similarity index 62% rename from react-app/utils/core/hmr-core/reload/initReloadClient.ts rename to react-app/utils/core/reload/initReloadClient.ts index 537293fb..1cd3fb04 100644 --- a/react-app/utils/core/hmr-core/reload/initReloadClient.ts +++ b/react-app/utils/core/reload/initReloadClient.ts @@ -1,26 +1,28 @@ -import { TVoid } from '@types'; -import { - LOCAL_RELOAD_SOCKET_URL, - UPDATE_COMPLETE_MESSAGE, - UPDATE_PENDING_MESSAGE, - UPDATE_REQUEST_MESSAGE, -} from './constant'; +import { LOCAL_RELOAD_SOCKET_URL } from './constant'; import MessageInterpreter from './interpreter'; let needToUpdate = false; -export default function initReloadClient({ watchPath, onUpdate }: { watchPath: string; onUpdate: TVoid }): WebSocket { +export default function initReloadClient({ + watchPath, + onUpdate, + onForceReload, +}: { + watchPath: string; + onUpdate: () => void; + onForceReload?: () => void; +}): WebSocket { const socket = new WebSocket(LOCAL_RELOAD_SOCKET_URL); function sendUpdateCompleteMessage() { - socket.send(MessageInterpreter.send({ type: UPDATE_COMPLETE_MESSAGE })); + socket.send(MessageInterpreter.send({ type: 'done_update' })); } socket.addEventListener('message', event => { const message = MessageInterpreter.receive(String(event.data)); switch (message.type) { - case UPDATE_REQUEST_MESSAGE: { + case 'do_update': { if (needToUpdate) { sendUpdateCompleteMessage(); needToUpdate = false; @@ -28,19 +30,26 @@ export default function initReloadClient({ watchPath, onUpdate }: { watchPath: s } return; } - case UPDATE_PENDING_MESSAGE: { + case 'wait_update': { if (!needToUpdate) { needToUpdate = message.path.includes(watchPath); } return; } + case 'force_reload': { + onForceReload?.(); + return; + } } }); socket.onclose = () => { - console.warn( + console.log( `Reload server disconnected.\nPlease check if the WebSocket server is running properly on ${LOCAL_RELOAD_SOCKET_URL}. This feature detects changes in the code and helps the browser to reload the extension or refresh the current tab.`, ); + setTimeout(() => { + initReloadClient({ watchPath, onUpdate }); + }, 1000); }; return socket; diff --git a/react-app/utils/core/reload/initReloadServer.ts b/react-app/utils/core/reload/initReloadServer.ts new file mode 100644 index 00000000..a9c7871b --- /dev/null +++ b/react-app/utils/core/reload/initReloadServer.ts @@ -0,0 +1,55 @@ +import chokidar from 'chokidar'; +import { WebSocket, WebSocketServer } from 'ws'; +import { LOCAL_RELOAD_SOCKET_PORT, LOCAL_RELOAD_SOCKET_URL } from '../reload/constant'; +import MessageInterpreter from './interpreter'; +import { debounce } from './utils'; + +const clientsThatNeedToUpdate: Set = new Set(); +let needToForceReload = false; + +function initReloadServer() { + const wss = new WebSocketServer({ port: LOCAL_RELOAD_SOCKET_PORT }); + + wss.on('listening', () => console.log(`[HRS] Server listening at ${LOCAL_RELOAD_SOCKET_URL}`)); + + wss.on('connection', ws => { + clientsThatNeedToUpdate.add(ws); + + ws.addEventListener('close', () => clientsThatNeedToUpdate.delete(ws)); + ws.addEventListener('message', event => { + if (typeof event.data !== 'string') return; + + const message = MessageInterpreter.receive(event.data); + + if (message.type === 'done_update') { + ws.close(); + } + if (message.type === 'build_complete') { + clientsThatNeedToUpdate.forEach((ws: WebSocket) => ws.send(MessageInterpreter.send({ type: 'do_update' }))); + if (needToForceReload) { + needToForceReload = false; + clientsThatNeedToUpdate.forEach((ws: WebSocket) => + ws.send(MessageInterpreter.send({ type: 'force_reload' })), + ); + } + } + }); + }); +} + +/** CHECK:: src file was updated **/ +const debounceSrc = debounce(function (path: string) { + // Normalize path on Windows + const pathConverted = path.replace(/\\/g, '/'); + clientsThatNeedToUpdate.forEach((ws: WebSocket) => + ws.send(MessageInterpreter.send({ type: 'wait_update', path: pathConverted })), + ); +}, 100); +chokidar.watch('src', { ignorePermissionErrors: true }).on('all', (_, path) => debounceSrc(path)); + +/** CHECK:: manifest.js was updated **/ +chokidar.watch('manifest.js', { ignorePermissionErrors: true }).on('all', () => { + needToForceReload = true; +}); + +initReloadServer(); diff --git a/react-app/utils/core/hmr-core/reload/injections/script.ts b/react-app/utils/core/reload/injections/script.ts similarity index 51% rename from react-app/utils/core/hmr-core/reload/injections/script.ts rename to react-app/utils/core/reload/injections/script.ts index d02ac7da..01dee569 100644 --- a/react-app/utils/core/hmr-core/reload/injections/script.ts +++ b/react-app/utils/core/reload/injections/script.ts @@ -1,12 +1,13 @@ import initReloadClient from '../initReloadClient'; export default function addHmrIntoScript(watchPath: string) { + const reload = () => { + chrome.runtime.reload(); + }; + initReloadClient({ watchPath, - onUpdate: () => { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-ignore - chrome.runtime.reload(); - }, + onUpdate: reload, + onForceReload: reload, }); } diff --git a/react-app/utils/core/hmr-core/reload/injections/view.ts b/react-app/utils/core/reload/injections/view.ts similarity index 100% rename from react-app/utils/core/hmr-core/reload/injections/view.ts rename to react-app/utils/core/reload/injections/view.ts diff --git a/react-app/utils/core/hmr-core/reload/interpreter/index.ts b/react-app/utils/core/reload/interpreter/index.ts similarity index 50% rename from react-app/utils/core/hmr-core/reload/interpreter/index.ts rename to react-app/utils/core/reload/interpreter/index.ts index 2ef2318d..57ceaeca 100644 --- a/react-app/utils/core/hmr-core/reload/interpreter/index.ts +++ b/react-app/utils/core/reload/interpreter/index.ts @@ -1,13 +1,13 @@ -import type { ReloadMessage, SerializedMessage } from './types'; +import type { SerializedMessage, WebSocketMessage } from '../interpreter/types'; export default class MessageInterpreter { // eslint-disable-next-line @typescript-eslint/no-empty-function private constructor() {} - static send(message: ReloadMessage): SerializedMessage { + static send(message: WebSocketMessage): SerializedMessage { return JSON.stringify(message); } - static receive(serializedMessage: SerializedMessage): ReloadMessage { + static receive(serializedMessage: SerializedMessage): WebSocketMessage { return JSON.parse(serializedMessage); } } diff --git a/react-app/utils/core/reload/interpreter/types.ts b/react-app/utils/core/reload/interpreter/types.ts new file mode 100644 index 00000000..b73762c4 --- /dev/null +++ b/react-app/utils/core/reload/interpreter/types.ts @@ -0,0 +1,18 @@ +type UpdatePendingMessage = { + type: 'wait_update'; + path: string; +}; +type UpdateRequestMessage = { + type: 'do_update'; +}; +type UpdateCompleteMessage = { type: 'done_update' }; +type BuildCompletionMessage = { type: 'build_complete' }; +type ForceReloadMessage = { type: 'force_reload' }; + +export type SerializedMessage = string; +export type WebSocketMessage = + | UpdateCompleteMessage + | UpdateRequestMessage + | UpdatePendingMessage + | BuildCompletionMessage + | ForceReloadMessage; diff --git a/react-app/utils/core/reload/rollup.config.mjs b/react-app/utils/core/reload/rollup.config.mjs new file mode 100644 index 00000000..8153884b --- /dev/null +++ b/react-app/utils/core/reload/rollup.config.mjs @@ -0,0 +1,28 @@ +import typescript from "@rollup/plugin-typescript"; + +const plugins = [typescript()]; + +export default [ + { + plugins, + input: 'utils/core/reload/initReloadServer.ts', + output: { + file: 'utils/core/reload/initReloadServer.js', + }, + external: ['ws', 'chokidar', 'timers'], + }, + { + plugins, + input: 'utils/core/reload/injections/script.ts', + output: { + file: 'utils/core/reload/injections/script.js', + }, + }, + { + plugins, + input: 'utils/core/reload/injections/view.ts', + output: { + file: 'utils/core/reload/injections/view.js', + }, + }, +]; diff --git a/react-app/utils/core/hmr-core/reload/utils.ts b/react-app/utils/core/reload/utils.ts similarity index 100% rename from react-app/utils/core/hmr-core/reload/utils.ts rename to react-app/utils/core/reload/utils.ts diff --git a/react-app/vite.config.ts b/react-app/vite.config.ts index ae5eb3c3..b447d192 100644 --- a/react-app/vite.config.ts +++ b/react-app/vite.config.ts @@ -1,11 +1,10 @@ import react from '@vitejs/plugin-react'; -import path, { resolve } from 'path'; +import { resolve } from 'path'; import { defineConfig } from 'vite'; -import manifest from './manifest'; -import addHmr from './utils/core/hmr-core/plugins/add-hmr'; -import customDynamicImport from './utils/core/hmr-core/plugins/custom-dynamic-import'; -import makeManifest from './utils/core/hmr-core/plugins/make-manifest'; -import watchRebuild from './utils/core/hmr-core/plugins/watch-rebuild'; +import addHmr from './utils/core/plugins/add-hmr'; +import customDynamicImport from './utils/core/plugins/custom-dynamic-import'; +import makeManifest from './utils/core/plugins/make-manifest'; +import watchRebuild from './utils/core/plugins/watch-rebuild'; const rootDir = resolve(__dirname); const outDir = resolve(rootDir, 'dist'); @@ -49,11 +48,11 @@ export default defineConfig({ }, }, plugins: [ + makeManifest(), react(), - makeManifest(manifest, { isDev }), customDynamicImport(), addHmr({ background: enableHmrInBackgroundScript, view: true }), - watchRebuild(), + isDev && watchRebuild(), ], publicDir, build: { @@ -71,18 +70,7 @@ export default defineConfig({ output: { entryFileNames: 'src/pages/[name]/index.js', chunkFileNames: isDev ? 'assets/js/[name].js' : 'assets/js/[name].[hash].js', - assetFileNames: assetInfo => { - const { dir, name: _name } = path.parse(assetInfo.name); - const assetFolder = dir.split('/').at(-1); - const name = assetFolder + firstUpperCase(_name); - return `assets/[ext]/${name}.chunk.[ext]`; - }, }, }, }, }); - -function firstUpperCase(str: string) { - const firstAlphabet = new RegExp(/( |^)[a-z]/, 'g'); - return str.toLowerCase().replace(firstAlphabet, L => L.toUpperCase()); -}