From 04fc6733956fae59b9aebdbf52e10510d34192af Mon Sep 17 00:00:00 2001 From: baptistecdr Date: Wed, 25 Dec 2024 06:50:32 +0100 Subject: [PATCH] Remove React Loader Spinner, migrate to my Aria2 package --- package-lock.json | 223 ++++------------------------ package.json | 7 +- scripts/generate-manifest.js | 2 +- src/background/background.ts | 2 +- src/popup/components/server-tab.tsx | 18 +-- 5 files changed, 33 insertions(+), 219 deletions(-) diff --git a/package-lock.json b/package-lock.json index 69715851..d3127ede 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,13 +8,13 @@ "name": "aria2-integration", "version": "4.10.4-SNAPSHOT.0", "dependencies": { + "@baptistecdr/aria2": "4.1.4", "@stdlib/regexp-basename-posix": "0.2.2", "@stdlib/regexp-basename-windows": "0.2.3", "@stdlib/regexp-dirname-posix": "0.2.1", "@stdlib/regexp-dirname-windows": "0.2.1", "@testing-library/react": "16.1.0", "@testing-library/user-event": "14.5.2", - "aria2": "4.1.2", "bootstrap": "5.3.3", "bootstrap-icons": "1.11.3", "class-transformer": "0.5.1", @@ -24,7 +24,6 @@ "react": "19.0.0", "react-bootstrap": "2.10.7", "react-dom": "19.0.0", - "react-loader-spinner": "6.1.6", "reflect-metadata": "0.2.2", "uuid": "11.0.3", "webextension-polyfill": "0.12.0" @@ -345,6 +344,15 @@ "node": ">=6.9.0" } }, + "node_modules/@baptistecdr/aria2": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@baptistecdr/aria2/-/aria2-4.1.4.tgz", + "integrity": "sha512-yRphx3TfU5mX9VGlRd3Um0ev+8cfZNsasygVSQDK9k+O++iFM3sZKRmSd+dBOXWv1V1GeN0kqauRvchYf+AZYg==", + "license": "ISC", + "engines": { + "node": ">= 20" + } + }, "node_modules/@biomejs/biome": { "version": "1.9.4", "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.9.4.tgz", @@ -551,27 +559,6 @@ "node": ">= 0.10.4" } }, - "node_modules/@emotion/is-prop-valid": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@emotion/is-prop-valid/-/is-prop-valid-1.2.2.tgz", - "integrity": "sha512-uNsoYd37AFmaCdXlg6EYD1KaPOaRWRByMCYzbKUX4+hhMfrxdVSelShywL4JVaAeM/eHUOSprYBQls+/neX3pw==", - "license": "MIT", - "dependencies": { - "@emotion/memoize": "^0.8.1" - } - }, - "node_modules/@emotion/memoize": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", - "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", - "license": "MIT" - }, - "node_modules/@emotion/unitless": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.1.tgz", - "integrity": "sha512-KOEGMu6dmJZtpadb476IsZBclKvILjopjUii3V+7MnXIQCYh8W3NgNcgwo21n9LXZX6EDIKvqfjYxXebDwxKmQ==", - "license": "MIT" - }, "node_modules/@esbuild/aix-ppc64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", @@ -2345,12 +2332,6 @@ "dev": true, "license": "MIT" }, - "node_modules/@types/stylis": { - "version": "4.2.5", - "resolved": "https://registry.npmjs.org/@types/stylis/-/stylis-4.2.5.tgz", - "integrity": "sha512-1Xve+NMN7FWjY14vLoY5tL3BVEQ/n42YLwaqJIPYhotZ9uBHt87VceMwWQpzmdEt2TNXIorIFG+YeCUUW7RInw==", - "license": "MIT" - }, "node_modules/@types/uuid": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-10.0.0.tgz", @@ -2742,19 +2723,6 @@ "dequal": "^2.0.3" } }, - "node_modules/aria2": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/aria2/-/aria2-4.1.2.tgz", - "integrity": "sha512-qTBr2RY8RZQmiUmbj2KXFvkErNxU4aTHZszszzwhE8svy2PEVX+IYR/c4Rp9Tuw4QkeU8cylGy6McV6Yl8i7Qw==", - "license": "ISC", - "dependencies": { - "node-fetch": "^2.6.1", - "ws": "^7.4.0" - }, - "engines": { - "node": ">= 10" - } - }, "node_modules/array-differ": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-4.0.0.tgz", @@ -3363,15 +3331,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/camelize": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/camelize/-/camelize-1.0.1.tgz", - "integrity": "sha512-dU+Tx2fsypxTgtLoE36npi3UqcjSSMNYfkqgmoEhtZrraP5VWq0K7FkWVTYa8eMPtnU/G2txVsfdCJTn9uzpuQ==", - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/caniuse-lite": { "version": "1.0.30001684", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001684.tgz", @@ -3908,15 +3867,6 @@ "dev": true, "license": "ISC" }, - "node_modules/css-color-keywords": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/css-color-keywords/-/css-color-keywords-1.0.0.tgz", - "integrity": "sha512-FyyrDHZKEjXDpNJYvVsV960FiqQyXc/LlYmsxl2BcdMb2WPx0OGRVgTg55rPSyLSNMqP52R9r8geSp7apN3Ofg==", - "license": "ISC", - "engines": { - "node": ">=4" - } - }, "node_modules/css-select": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", @@ -3934,17 +3884,6 @@ "url": "https://github.com/sponsors/fb55" } }, - "node_modules/css-to-react-native": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/css-to-react-native/-/css-to-react-native-3.2.0.tgz", - "integrity": "sha512-e8RKaLXMOFii+02mOlqwjbD00KSEKqblnpO9e++1aXS1fPQOpS1YoqdVHBqPjHNoxeF2mimzVqawm2KCbEdtHQ==", - "license": "MIT", - "dependencies": { - "camelize": "^1.0.0", - "css-color-keywords": "^1.0.0", - "postcss-value-parser": "^4.0.2" - } - }, "node_modules/css-what": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", @@ -6713,6 +6652,7 @@ "version": "3.3.8", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "dev": true, "funding": [ { "type": "github", @@ -6738,7 +6678,10 @@ "version": "2.6.11", "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "whatwg-url": "^5.0.0" }, @@ -7638,40 +7581,6 @@ "node": ">= 0.4" } }, - "node_modules/postcss": { - "version": "8.4.38", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.38.tgz", - "integrity": "sha512-Wglpdk03BSfXkHoQa3b/oulrotAkwrlLDRSOb9D0bN86FdRyE9lppSp33aHNPgBa0JKCoB+drFLZkQoRRYae5A==", - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/postcss/" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/postcss" - }, - { - "type": "github", - "url": "https://github.com/sponsors/ai" - } - ], - "license": "MIT", - "dependencies": { - "nanoid": "^3.3.7", - "picocolors": "^1.0.0", - "source-map-js": "^1.2.0" - }, - "engines": { - "node": "^10 || ^12 || >=14" - } - }, - "node_modules/postcss-value-parser": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-4.2.0.tgz", - "integrity": "sha512-1NNCs6uurfkVbeXG4S8JFT9t19m45ICnif8zWLd5oPSZ50QnwMfK+H3jv408d4jw/7Bttv5axS5IiHoLaVNHeQ==", - "license": "MIT" - }, "node_modules/prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", @@ -8034,29 +7943,6 @@ "integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==", "license": "MIT" }, - "node_modules/react-loader-spinner": { - "version": "6.1.6", - "resolved": "https://registry.npmjs.org/react-loader-spinner/-/react-loader-spinner-6.1.6.tgz", - "integrity": "sha512-x5h1Jcit7Qn03MuKlrWcMG9o12cp9SNDVHVJTNRi9TgtGPKcjKiXkou4NRfLAtXaFB3+Z8yZsVzONmPzhv2ErA==", - "license": "MIT", - "dependencies": { - "react-is": "^18.2.0", - "styled-components": "^6.1.2" - }, - "engines": { - "node": ">= 12" - }, - "peerDependencies": { - "react": "^16.0.0 || ^17.0.0 || ^18.0.0", - "react-dom": "^16.0.0 || ^17.0.0 || ^18.0.0" - } - }, - "node_modules/react-loader-spinner/node_modules/react-is": { - "version": "18.3.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-18.3.1.tgz", - "integrity": "sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==", - "license": "MIT" - }, "node_modules/react-refresh": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.14.2.tgz", @@ -8618,12 +8504,6 @@ "sha.js": "bin.js" } }, - "node_modules/shallowequal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz", - "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ==", - "license": "MIT" - }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -8747,6 +8627,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, "license": "BSD-3-Clause", "engines": { "node": ">=0.10.0" @@ -8991,46 +8872,6 @@ "integrity": "sha512-H2N9c26eXjzL/S/K+i/RHHcFanE74dptvvjM8iwzwbVcWY/zjBbgRqF3K0DY4+OD+uTTASTBvDoxPDaPN02D7g==", "dev": true }, - "node_modules/styled-components": { - "version": "6.1.13", - "resolved": "https://registry.npmjs.org/styled-components/-/styled-components-6.1.13.tgz", - "integrity": "sha512-M0+N2xSnAtwcVAQeFEsGWFFxXDftHUD7XrKla06QbpUMmbmtFBMMTcKWvFXtWxuD5qQkB8iU5gk6QASlx2ZRMw==", - "license": "MIT", - "dependencies": { - "@emotion/is-prop-valid": "1.2.2", - "@emotion/unitless": "0.8.1", - "@types/stylis": "4.2.5", - "css-to-react-native": "3.2.0", - "csstype": "3.1.3", - "postcss": "8.4.38", - "shallowequal": "1.1.0", - "stylis": "4.3.2", - "tslib": "2.6.2" - }, - "engines": { - "node": ">= 16" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/styled-components" - }, - "peerDependencies": { - "react": ">= 16.8.0", - "react-dom": ">= 16.8.0" - } - }, - "node_modules/styled-components/node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==", - "license": "0BSD" - }, - "node_modules/stylis": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.3.2.tgz", - "integrity": "sha512-bhtUjWd/z6ltJiQwg0dUfxEJ+W+jdqQd8TbWLWyeIJHlnsqmGLRFFd8e5mA0AZi/zx90smXRlN66YMTcaSFifg==", - "license": "MIT" - }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -9143,7 +8984,10 @@ "version": "0.0.3", "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", - "license": "MIT" + "dev": true, + "license": "MIT", + "optional": true, + "peer": true }, "node_modules/tsconfck": { "version": "3.1.4", @@ -9698,13 +9542,19 @@ "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", - "license": "BSD-2-Clause" + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "peer": true }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, "license": "MIT", + "optional": true, + "peer": true, "dependencies": { "tr46": "~0.0.3", "webidl-conversions": "^3.0.0" @@ -9859,27 +9709,6 @@ "dev": true, "license": "ISC" }, - "node_modules/ws": { - "version": "7.5.10", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", - "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", - "license": "MIT", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, "node_modules/xdg-basedir": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-5.1.0.tgz", diff --git a/package.json b/package.json index 2562556e..6b2487da 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@stdlib/regexp-dirname-windows": "0.2.1", "@testing-library/react": "16.1.0", "@testing-library/user-event": "14.5.2", - "aria2": "4.1.2", + "@baptistecdr/aria2": "4.1.4", "bootstrap": "5.3.3", "bootstrap-icons": "1.11.3", "class-transformer": "0.5.1", @@ -30,7 +30,6 @@ "react": "19.0.0", "react-bootstrap": "2.10.7", "react-dom": "19.0.0", - "react-loader-spinner": "6.1.6", "reflect-metadata": "0.2.2", "uuid": "11.0.3", "webextension-polyfill": "0.12.0" @@ -57,10 +56,6 @@ "overrides": { "vite-plugin-node-polyfills": { "vite": "6.0.5" - }, - "react-loader-spinner": { - "react": "19.0.0", - "react-dom": "19.0.0" } } } diff --git a/scripts/generate-manifest.js b/scripts/generate-manifest.js index 757f83da..36182526 100755 --- a/scripts/generate-manifest.js +++ b/scripts/generate-manifest.js @@ -25,4 +25,4 @@ if (process.env.BROWSER === "firefox") { manifest.host_permissions = ["*://*/*"]; } -fs.writeFileSync("./dist/manifest.json", JSON.stringify(manifest)); +fs.writeFileSync("./dist/manifest.json", JSON.stringify(manifest, null, 2)); diff --git a/src/background/background.ts b/src/background/background.ts index 60cf9b2d..edc366e4 100644 --- a/src/background/background.ts +++ b/src/background/background.ts @@ -3,7 +3,7 @@ import type Server from "@/models/server"; import GlobalStat from "@/popup/models/global-stat"; import { basename, dirname } from "@/stdlib"; // @ts-expect-error No type information for aria2 -import Aria2 from "aria2"; +import Aria2 from "@baptistecdr/aria2"; import { plainToInstance } from "class-transformer"; import type { Cookies, Downloads, Menus, Tabs } from "webextension-polyfill"; import browser from "webextension-polyfill"; diff --git a/src/popup/components/server-tab.tsx b/src/popup/components/server-tab.tsx index e504048b..73d8db67 100644 --- a/src/popup/components/server-tab.tsx +++ b/src/popup/components/server-tab.tsx @@ -7,12 +7,11 @@ import ServerTask from "@/popup/components/server-task"; import GlobalStat from "@/popup/models/global-stat"; import { Task } from "@/popup/models/task"; // @ts-expect-error No type information for aria2 -import Aria2 from "aria2"; +import Aria2 from "@baptistecdr/aria2"; import { plainToInstance } from "class-transformer"; import { type FileSizeOptionsBase, filesize } from "filesize"; import { type Dispatch, type SetStateAction, useCallback, useEffect, useState } from "react"; import { Button, Col, Container, Row } from "react-bootstrap"; -import { Oval } from "react-loader-spinner"; import "bootstrap/dist/css/bootstrap.css"; import "bootstrap/dist/js/bootstrap"; import "./server-tab.css"; @@ -80,18 +79,9 @@ function ServerTab({ setExtensionOptions, extensionOptions, server }: Props) { - +
+ Loading... +