From 5d9f33d52c402be64a92ed48b688af8493845b35 Mon Sep 17 00:00:00 2001 From: pixelass Date: Fri, 7 Jun 2024 14:32:18 +0200 Subject: [PATCH] chore: update types --- package-lock.json | 8 +- package.json | 2 +- src/client/organisms/sidebar-button/index.tsx | 87 ------------------- src/electron/helpers/services/comfyui.ts | 5 +- src/electron/helpers/services/vector-store.ts | 4 +- .../helpers/utils/__tests__/git.test.ts | 6 +- src/electron/helpers/utils/git.ts | 4 +- 7 files changed, 16 insertions(+), 100 deletions(-) delete mode 100644 src/client/organisms/sidebar-button/index.tsx diff --git a/package-lock.json b/package-lock.json index d7481deb7..9606d7edf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -55,7 +55,7 @@ "@types/lodash": "^4.17.4", "@types/node": "^20.14.2", "@types/node-7z": "^2.1.8", - "@types/react": "^18.3.3", + "@types/react": "18.3.1", "@types/react-custom-scrollbars": "^4.0.13", "@types/react-dom": "^18.3.0", "@types/react-file-icon": "^1.0.4", @@ -7722,9 +7722,9 @@ "dev": true }, "node_modules/@types/react": { - "version": "18.3.3", - "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.3.tgz", - "integrity": "sha512-hti/R0pS0q1/xx+TsI73XIqk26eBsISZ2R0wUijXIngRK9R/e7Xw/cXVxQK7R5JjW+SV4zGcn5hXjudkN/pLIw==", + "version": "18.3.1", + "resolved": "https://registry.npmjs.org/@types/react/-/react-18.3.1.tgz", + "integrity": "sha512-V0kuGBX3+prX+DQ/7r2qsv1NsdfnCLnTgnRJ1pYnxykBhGMz+qj+box5lq7XsO5mtZsBqpjwwTu/7wszPfMBcw==", "dev": true, "dependencies": { "@types/prop-types": "*", diff --git a/package.json b/package.json index 4fdffdb55..3746761de 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "@types/lodash": "^4.17.4", "@types/node": "^20.14.2", "@types/node-7z": "^2.1.8", - "@types/react": "^18.3.3", + "@types/react": "^18.3.1", "@types/react-custom-scrollbars": "^4.0.13", "@types/react-dom": "^18.3.0", "@types/react-file-icon": "^1.0.4", diff --git a/src/client/organisms/sidebar-button/index.tsx b/src/client/organisms/sidebar-button/index.tsx deleted file mode 100644 index 829da861f..000000000 --- a/src/client/organisms/sidebar-button/index.tsx +++ /dev/null @@ -1,87 +0,0 @@ -import Box from "@mui/joy/Box"; -import type { ButtonProps } from "@mui/joy/Button"; -import Button from "@mui/joy/Button"; -import Tooltip from "@mui/joy/Tooltip"; -import Link from "next/link"; -import { useRouter } from "next/router"; -import { useTranslation } from "next-i18next"; -import type { Except } from "type-fest"; - -export function SidebarButton({ - children, - href, - target, - disabled, - ...properties -}: Except, "component">) { - const { - i18n: { language: locale }, - } = useTranslation(["common"]); - const { pathname } = useRouter(); - const href_ = `/${locale}${href}`; - const isActive = pathname.replace("/[locale]", "") === href; - - return ( - - - {href && !target ? ( - - - - ) : ( - - )} - - - ); -} diff --git a/src/electron/helpers/services/comfyui.ts b/src/electron/helpers/services/comfyui.ts index dcde0d7e0..01153ae05 100644 --- a/src/electron/helpers/services/comfyui.ts +++ b/src/electron/helpers/services/comfyui.ts @@ -1,7 +1,8 @@ import fsp from "node:fs/promises"; import axios from "axios"; -import { execa, type ExecaChildProcess } from "execa"; +import type { ResultPromise } from "execa"; +import { execa } from "execa"; import WebSocket from "ws"; import { stringify } from "yaml"; @@ -48,7 +49,7 @@ export enum ComfyUIStatus { */ export class ComfyUI { public static instance: ComfyUI | null = null; - private process: ExecaChildProcess | undefined; + private process: ResultPromise> | undefined; private url: string; private host: string; private port: number; diff --git a/src/electron/helpers/services/vector-store.ts b/src/electron/helpers/services/vector-store.ts index bab87189a..c69012640 100644 --- a/src/electron/helpers/services/vector-store.ts +++ b/src/electron/helpers/services/vector-store.ts @@ -5,7 +5,7 @@ import type { EmbeddingsInterface } from "@langchain/core/embeddings"; import type { Schemas as QdrantSchemas } from "@qdrant/js-client-rest"; import { QdrantClient } from "@qdrant/js-client-rest"; import axios from "axios"; -import type { ExecaChildProcess } from "execa"; +import type { ResultPromise } from "execa"; import { execa } from "execa"; import { v4 } from "uuid"; @@ -21,7 +21,7 @@ export interface ServiceReadyConfig { export class VectorStore { private static instance: VectorStore | null = null; private client: QdrantClient | null = null; - private process: ExecaChildProcess | undefined; + private process: ResultPromise> | undefined; private embeddings: EmbeddingsInterface; private host: string; private port: number; diff --git a/src/electron/helpers/utils/__tests__/git.test.ts b/src/electron/helpers/utils/__tests__/git.test.ts index c6f80d4ee..445c60900 100644 --- a/src/electron/helpers/utils/__tests__/git.test.ts +++ b/src/electron/helpers/utils/__tests__/git.test.ts @@ -1,6 +1,6 @@ import fs from "node:fs"; -import type { ExecaChildProcess } from "execa"; +import type { ResultPromise } from "execa"; import { execa } from "execa"; jest.mock("execa"); @@ -196,7 +196,9 @@ describe("clone", () => { }), }, }; - mockedExeca.mockReturnValueOnce(mockChildProcess as unknown as ExecaChildProcess); + mockedExeca.mockReturnValueOnce( + mockChildProcess as unknown as ResultPromise> + ); const onProgressMock = jest.fn(); diff --git a/src/electron/helpers/utils/git.ts b/src/electron/helpers/utils/git.ts index 347943d0a..e3d5eebba 100644 --- a/src/electron/helpers/utils/git.ts +++ b/src/electron/helpers/utils/git.ts @@ -1,7 +1,7 @@ import fs from "node:fs"; import path from "node:path"; -import type { ExecaChildProcess } from "execa"; +import type { ResultPromise } from "execa"; import { execa } from "execa"; import { createDirectory } from "@/electron/utils/fs"; @@ -39,7 +39,7 @@ export async function clone(repository: string, destination: string, options?: G createDirectory(destinationPath); - let process_: ExecaChildProcess | null = null; + let process_: ResultPromise> | null = null; function cancel() { if (process_) {