From 378f68bb5fd5d7e992c2cf097a2dd2025f0544dd Mon Sep 17 00:00:00 2001 From: Qubasa Date: Thu, 19 Jun 2025 16:52:45 +0200 Subject: [PATCH 1/2] clan-app: ui-2d remove unecessary imports --- pkgs/clan-app/ui-2d/package.json | 4 ++-- pkgs/clan-app/ui-2d/src/Form/fields/TextInput.tsx | 1 - pkgs/clan-app/ui-2d/src/api/index.tsx | 6 ++---- pkgs/clan-app/ui-2d/src/components/RemoteForm.tsx | 2 +- .../ui-2d/src/components/fileSelect/index.tsx | 3 +-- pkgs/clan-app/ui-2d/src/contexts/clan.tsx | 1 - pkgs/clan-app/ui-2d/src/index.tsx | 2 -- pkgs/clan-app/ui-2d/src/queries/index.ts | 1 - pkgs/clan-app/ui-2d/src/routes/clans/details.tsx | 11 +++-------- pkgs/clan-app/ui-2d/src/routes/flash/view.tsx | 2 +- .../routes/machines/components/MachineActionsBar.tsx | 8 ++++---- .../src/routes/machines/components/MachineForm.tsx | 8 +++----- .../machines/components/MachineGeneralFields.tsx | 2 -- .../machines/components/MachineHardwareInfo.tsx | 1 - .../src/routes/machines/install/hardware-step.tsx | 2 -- 15 files changed, 17 insertions(+), 37 deletions(-) diff --git a/pkgs/clan-app/ui-2d/package.json b/pkgs/clan-app/ui-2d/package.json index 9b70c9bb5..c1fe54e38 100644 --- a/pkgs/clan-app/ui-2d/package.json +++ b/pkgs/clan-app/ui-2d/package.json @@ -9,8 +9,8 @@ "build": "npm run check && npm run test && vite build && npm run convert-html", "convert-html": "node gtk.webview.js", "serve": "vite preview", - "check": "tsc --noEmit --skipLibCheck && eslint ./src", - "knip": "knip", + "check": "tsc --noEmit --skipLibCheck && eslint ./src --fix", + "knip": "knip --fix", "test": "vitest run --project unit --typecheck", "storybook": "storybook", "storybook-build": "storybook build", diff --git a/pkgs/clan-app/ui-2d/src/Form/fields/TextInput.tsx b/pkgs/clan-app/ui-2d/src/Form/fields/TextInput.tsx index 24f3ca357..7487fabb9 100644 --- a/pkgs/clan-app/ui-2d/src/Form/fields/TextInput.tsx +++ b/pkgs/clan-app/ui-2d/src/Form/fields/TextInput.tsx @@ -5,7 +5,6 @@ import { InputLabel, InputVariant, } from "@/src/components/inputBase"; -import { Typography } from "@/src/components/Typography"; import { FieldLayout } from "./layout"; interface TextInputProps { diff --git a/pkgs/clan-app/ui-2d/src/api/index.tsx b/pkgs/clan-app/ui-2d/src/api/index.tsx index 46c01eb12..ad429b585 100644 --- a/pkgs/clan-app/ui-2d/src/api/index.tsx +++ b/pkgs/clan-app/ui-2d/src/api/index.tsx @@ -1,8 +1,6 @@ -import schema from "@/api/API.json" with { type: "json" }; -import { API, Error as ApiError } from "@/api/API"; -import { nanoid } from "nanoid"; +import { API } from "@/api/API"; import { Schema as Inventory } from "@/api/Inventory"; -import { toast, Toast } from "solid-toast"; +import { toast } from "solid-toast"; import { ErrorToastComponent, CancelToastComponent, diff --git a/pkgs/clan-app/ui-2d/src/components/RemoteForm.tsx b/pkgs/clan-app/ui-2d/src/components/RemoteForm.tsx index 1974eb11d..4a751f478 100644 --- a/pkgs/clan-app/ui-2d/src/components/RemoteForm.tsx +++ b/pkgs/clan-app/ui-2d/src/components/RemoteForm.tsx @@ -5,7 +5,7 @@ import { TextInput } from "@/src/Form/fields/TextInput"; import { SelectInput } from "@/src/Form/fields/Select"; import { FileInput } from "@/src/components/FileInput"; import { FieldLayout } from "@/src/Form/fields/layout"; -import { InputLabel, InputBase } from "@/src/components/inputBase"; +import { InputLabel } from "@/src/components/inputBase"; import Icon from "@/src/components/icon"; import { Loader } from "@/src/components/v2/Loader/Loader"; import { Button } from "@/src/components/v2/Button/Button"; diff --git a/pkgs/clan-app/ui-2d/src/components/fileSelect/index.tsx b/pkgs/clan-app/ui-2d/src/components/fileSelect/index.tsx index cfd8c6622..7e6617700 100644 --- a/pkgs/clan-app/ui-2d/src/components/fileSelect/index.tsx +++ b/pkgs/clan-app/ui-2d/src/components/fileSelect/index.tsx @@ -1,9 +1,8 @@ import { FileInput, type FileInputProps } from "@/src/components/FileInput"; // Assuming FileInput can take a ref and has onClick import { Typography } from "@/src/components/Typography"; import Fieldset from "@/src/Form/fieldset"; -import Icon from "@/src/components/icon"; // For displaying file icons +// For displaying file icons import { callApi } from "@/src/api"; -import type { FieldValues } from "@modular-forms/solid"; import { Show, For, type Component, type JSX } from "solid-js"; // Types for the file dialog options passed to callApi diff --git a/pkgs/clan-app/ui-2d/src/contexts/clan.tsx b/pkgs/clan-app/ui-2d/src/contexts/clan.tsx index 765b66d43..1ce982976 100644 --- a/pkgs/clan-app/ui-2d/src/contexts/clan.tsx +++ b/pkgs/clan-app/ui-2d/src/contexts/clan.tsx @@ -1,5 +1,4 @@ import { createContext, createEffect, JSX, useContext } from "solid-js"; -import { callApi } from "@/src/api"; import { activeClanURI, addClanURI, diff --git a/pkgs/clan-app/ui-2d/src/index.tsx b/pkgs/clan-app/ui-2d/src/index.tsx index 664fac32b..a6561dcd6 100644 --- a/pkgs/clan-app/ui-2d/src/index.tsx +++ b/pkgs/clan-app/ui-2d/src/index.tsx @@ -13,7 +13,6 @@ import { import { Layout } from "./layout/layout"; import { ClanDetails, ClanList, CreateClan } from "./routes/clans"; import { Flash } from "./routes/flash/view"; -import { HostList } from "./routes/hosts/view"; import { Welcome } from "./routes/welcome"; import { Toaster } from "solid-toast"; import { ModuleList } from "./routes/modules/list"; @@ -21,7 +20,6 @@ import { ModuleDetails } from "./routes/modules/details"; import { ModuleDetails as AddModule } from "./routes/modules/add"; import { ApiTester } from "./api_test"; import { IconVariant } from "./components/icon"; -import { Components } from "./routes/components"; import { VarsPage } from "./routes/machines/install/vars-step"; import { ClanProvider } from "./contexts/clan"; diff --git a/pkgs/clan-app/ui-2d/src/queries/index.ts b/pkgs/clan-app/ui-2d/src/queries/index.ts index 7c442999d..220d1bd07 100644 --- a/pkgs/clan-app/ui-2d/src/queries/index.ts +++ b/pkgs/clan-app/ui-2d/src/queries/index.ts @@ -1,6 +1,5 @@ import { useQuery } from "@tanstack/solid-query"; import { callApi } from "../api"; -import toast from "solid-toast"; interface ModulesFilter { features: string[]; diff --git a/pkgs/clan-app/ui-2d/src/routes/clans/details.tsx b/pkgs/clan-app/ui-2d/src/routes/clans/details.tsx index c9d0c940b..bdd41125f 100644 --- a/pkgs/clan-app/ui-2d/src/routes/clans/details.tsx +++ b/pkgs/clan-app/ui-2d/src/routes/clans/details.tsx @@ -1,17 +1,12 @@ -import { callApi, ClanServiceInstance, SuccessQuery } from "@/src/api"; +import { callApi, SuccessQuery } from "@/src/api"; import { useParams } from "@solidjs/router"; -import { createQuery, useQueryClient } from "@tanstack/solid-query"; -import { createSignal, For, Match, Switch } from "solid-js"; +import { useQueryClient } from "@tanstack/solid-query"; +import { Match, Switch } from "solid-js"; import { createForm, - FieldValues, - getValue, - getValues, required, - setValue, SubmitHandler, } from "@modular-forms/solid"; -import { TextInput } from "@/src/Form/fields/TextInput"; import toast from "solid-toast"; import { Button } from "../../components/Button/Button"; import Icon from "@/src/components/icon"; diff --git a/pkgs/clan-app/ui-2d/src/routes/flash/view.tsx b/pkgs/clan-app/ui-2d/src/routes/flash/view.tsx index d33e37e95..ec91d3d51 100644 --- a/pkgs/clan-app/ui-2d/src/routes/flash/view.tsx +++ b/pkgs/clan-app/ui-2d/src/routes/flash/view.tsx @@ -15,7 +15,7 @@ import { getValues, } from "@modular-forms/solid"; import { createQuery } from "@tanstack/solid-query"; -import { createEffect, createSignal, For, Show } from "solid-js"; // For, Show might not be needed directly here now +import { createEffect, createSignal } from "solid-js"; // For, Show might not be needed directly here now import toast from "solid-toast"; import { FieldLayout } from "@/src/Form/fields/layout"; import { InputLabel } from "@/src/components/inputBase"; diff --git a/pkgs/clan-app/ui-2d/src/routes/machines/components/MachineActionsBar.tsx b/pkgs/clan-app/ui-2d/src/routes/machines/components/MachineActionsBar.tsx index 7776bac75..591df6e15 100644 --- a/pkgs/clan-app/ui-2d/src/routes/machines/components/MachineActionsBar.tsx +++ b/pkgs/clan-app/ui-2d/src/routes/machines/components/MachineActionsBar.tsx @@ -12,10 +12,10 @@ export function MachineActionsBar(props: MachineActionsBarProps) { return (
-
+