diff --git a/crates/librqbit/webui/package.json b/crates/librqbit/webui/package.json index 208f6b27..c067e381 100644 --- a/crates/librqbit/webui/package.json +++ b/crates/librqbit/webui/package.json @@ -1,4 +1,5 @@ { + "name": "rqbit-webui", "private": true, "type": "module", "scripts": { diff --git a/desktop/package-lock.json b/desktop/package-lock.json index 0534907f..3f3b4bc3 100644 --- a/desktop/package-lock.json +++ b/desktop/package-lock.json @@ -12,7 +12,8 @@ "react": "^18.2.0", "react-bootstrap": "^2.9.1", "react-dom": "^18.2.0", - "react-icons": "^4.12.0" + "react-icons": "^4.12.0", + "rqbit-webui": "file:../crates/librqbit/webui" }, "devDependencies": { "@tauri-apps/cli": ">=2.0.0-alpha.16", @@ -24,6 +25,28 @@ "vite": "^4.5.1" } }, + "../crates/librqbit/webui": { + "name": "rqbit-webui", + "dependencies": { + "@vitejs/plugin-react": "^4.2.1", + "lodash.debounce": "^4.0.8", + "react": "^18.2.0", + "react-bootstrap": "^2.9.1", + "react-dom": "^18.2.0", + "react-icons": "^4.12.0" + }, + "devDependencies": { + "@types/lodash.debounce": "^4.0.9", + "@types/react": "^18.2.38", + "@types/react-dom": "^18.2.16", + "prettier": "3.1.0", + "typescript": "^5.3.2", + "vite": "^4.5.1" + } + }, + "../crates/librqbit/webui/src": { + "extraneous": true + }, "node_modules/@ampproject/remapping": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", @@ -1680,6 +1703,10 @@ "fsevents": "~2.3.2" } }, + "node_modules/rqbit-webui": { + "resolved": "../crates/librqbit/webui", + "link": true + }, "node_modules/scheduler": { "version": "0.23.0", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.0.tgz", diff --git a/desktop/package.json b/desktop/package.json index 56b31e23..d693001b 100644 --- a/desktop/package.json +++ b/desktop/package.json @@ -10,6 +10,7 @@ }, "dependencies": { "@tauri-apps/api": "^1.5.1", + "rqbit-webui": "file:../crates/librqbit/webui", "lodash.debounce": "^4.0.8", "react": "^18.2.0", "react-bootstrap": "^2.9.1", diff --git a/desktop/src/api.tsx b/desktop/src/api.tsx index b2e1810e..f2f99809 100644 --- a/desktop/src/api.tsx +++ b/desktop/src/api.tsx @@ -6,7 +6,7 @@ import { TorrentDetails, TorrentStats, ErrorDetails, -} from "./rqbit-webui-src/api-types"; +} from "rqbit-webui/src/api-types"; import { InvokeArgs, invoke } from "@tauri-apps/api/tauri"; diff --git a/desktop/src/configure.tsx b/desktop/src/configure.tsx index 88f943d6..2bfe644a 100644 --- a/desktop/src/configure.tsx +++ b/desktop/src/configure.tsx @@ -1,9 +1,9 @@ import React, { useState } from "react"; import { RqbitDesktopConfig } from "./configuration"; import { Button, Form, Modal, Row, Tab, Tabs } from "react-bootstrap"; +import { ErrorComponent } from "rqbit-webui/src/components/ErrorComponent"; import { invokeAPI } from "./api"; -import { ErrorDetails } from "./rqbit-webui-src/api-types"; -import { ErrorComponent } from "./rqbit-webui-src/components/ErrorComponent"; +import { ErrorDetails } from "rqbit-webui/src/api-types"; const FormCheck: React.FC<{ label: string; diff --git a/desktop/src/rqbit-desktop.tsx b/desktop/src/rqbit-desktop.tsx index 4e7bcdde..183646ce 100644 --- a/desktop/src/rqbit-desktop.tsx +++ b/desktop/src/rqbit-desktop.tsx @@ -1,11 +1,10 @@ import { useState } from "react"; -import { RqbitWebUI } from "./rqbit-webui-src/rqbit-web"; +import { RqbitWebUI } from "rqbit-webui/src/rqbit-web"; import { CurrentDesktopState, RqbitDesktopConfig } from "./configuration"; import { ConfigModal } from "./configure"; -import { IconButton } from "./rqbit-webui-src/components/IconButton"; -import { BsBodyText, BsSliders2 } from "react-icons/bs"; -import { LogStreamModal } from "./rqbit-webui-src/components/LogStreamModal"; -import { APIContext } from "./rqbit-webui-src/context"; +import { IconButton } from "rqbit-webui/src/components/IconButton"; +import { BsSliders2 } from "react-icons/bs"; +import { APIContext } from "rqbit-webui/src/context"; import { makeAPI } from "./api"; export const RqbitDesktop: React.FC<{ diff --git a/desktop/src/rqbit-webui-src b/desktop/src/rqbit-webui-src deleted file mode 120000 index da181613..00000000 --- a/desktop/src/rqbit-webui-src +++ /dev/null @@ -1 +0,0 @@ -../../crates/librqbit/webui/src/ \ No newline at end of file