From cd8feeabd2a714f93dd11d82502e57cebc476113 Mon Sep 17 00:00:00 2001 From: Ryan Walters Date: Thu, 21 Aug 2025 22:04:08 -0500 Subject: [PATCH] chore: use path aliasing --- src/App.tsx | 8 ++++---- src/bindings.ts | 8 ++++---- src/components/drop-overlay.tsx | 4 ++-- src/lib/format.test.ts | 2 +- src/main.tsx | 4 ++-- vite.config.ts | 1 - 6 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 8af324e..47c052c 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ -import { useDragDropPaths } from "./hooks/useDragDropPaths"; -import Graph from "./components/graph"; -import DropOverlay from "./components/drop-overlay"; -import type { Frame } from "./types/graph"; +import { useDragDropPaths } from "@/hooks/useDragDropPaths"; +import Graph from "@/components/graph"; +import DropOverlay from "@/components/drop-overlay"; +import type { Frame } from "@/types/graph"; function App() { const data: Frame[] = []; diff --git a/src/bindings.ts b/src/bindings.ts index 596bb75..6a92700 100644 --- a/src/bindings.ts +++ b/src/bindings.ts @@ -1,8 +1,8 @@ // Import generated TypeScript types from ts-rs -import type { StreamResult } from "./bindings/StreamResult"; -import type { StreamDetail } from "./bindings/StreamDetail"; -import type { StreamResultError } from "./bindings/StreamResultError"; -import type { MediaType } from "./bindings/MediaType"; +import type { StreamResult } from "@/bindings/StreamResult"; +import type { StreamDetail } from "@/bindings/StreamDetail"; +import type { StreamResultError } from "@/bindings/StreamResultError"; +import type { MediaType } from "@/bindings/MediaType"; export type { StreamResult, StreamDetail, StreamResultError, MediaType }; // Tauri invoke wrapper diff --git a/src/components/drop-overlay.tsx b/src/components/drop-overlay.tsx index a0b36d6..d9f8db7 100644 --- a/src/components/drop-overlay.tsx +++ b/src/components/drop-overlay.tsx @@ -10,8 +10,8 @@ import { Music, XCircle, } from "lucide-react"; -import { commands } from "../bindings"; -import type { MediaType, StreamDetail } from "../bindings"; +import { commands } from "@/bindings"; +import type { MediaType, StreamDetail } from "@/bindings"; type DropOverlayProps = { paths: string[]; diff --git a/src/lib/format.test.ts b/src/lib/format.test.ts index fb85b3e..ad87b08 100644 --- a/src/lib/format.test.ts +++ b/src/lib/format.test.ts @@ -1,4 +1,4 @@ -import { formatBytes } from "./format.js"; +import { formatBytes } from "@/lib/format"; import { test, expect } from "vitest"; test("formats bytes less than 1024", () => { diff --git a/src/main.tsx b/src/main.tsx index 9ce9875..87fd0ef 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -1,7 +1,7 @@ import React from "react"; import ReactDOM from "react-dom/client"; -import App from "./App"; -import "./global.css"; +import App from "@/App"; +import "@/global.css"; ReactDOM.createRoot(document.getElementById("root") as HTMLElement).render( diff --git a/vite.config.ts b/vite.config.ts index ec61a78..20b2c8d 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -3,7 +3,6 @@ import react from "@vitejs/plugin-react"; import tailwindcss from "@tailwindcss/vite"; import path from "path"; -// @ts-expect-error process is a nodejs global const host = process.env.TAURI_DEV_HOST; // https://vite.dev/config/