From f06227fcfe86bb9594e2eeca86cbe87f72faf82b Mon Sep 17 00:00:00 2001 From: itsOdell Date: Thu, 16 May 2024 07:12:54 -0400 Subject: [PATCH 1/4] feat(renderer/components): created index file for re-exports This allos us to have a shorter import path along with more flexibility to import more local files --- src/renderer/src/components/backdrop/index.ts | 1 + src/renderer/src/components/bottom-panel/index.ts | 1 + src/renderer/src/components/button/index.ts | 1 + src/renderer/src/components/checkbox-field/index.ts | 1 + src/renderer/src/components/game-card/index.ts | 1 + src/renderer/src/components/header/index.ts | 1 + src/renderer/src/components/hero/index.ts | 1 + src/renderer/src/components/link/index.ts | 1 + src/renderer/src/components/modal/index.ts | 1 + src/renderer/src/components/sidebar/index.ts | 1 + src/renderer/src/components/text-field/index.ts | 1 + 11 files changed, 11 insertions(+) create mode 100644 src/renderer/src/components/backdrop/index.ts create mode 100644 src/renderer/src/components/bottom-panel/index.ts create mode 100644 src/renderer/src/components/button/index.ts create mode 100644 src/renderer/src/components/checkbox-field/index.ts create mode 100644 src/renderer/src/components/game-card/index.ts create mode 100644 src/renderer/src/components/header/index.ts create mode 100644 src/renderer/src/components/hero/index.ts create mode 100644 src/renderer/src/components/link/index.ts create mode 100644 src/renderer/src/components/modal/index.ts create mode 100644 src/renderer/src/components/sidebar/index.ts create mode 100644 src/renderer/src/components/text-field/index.ts diff --git a/src/renderer/src/components/backdrop/index.ts b/src/renderer/src/components/backdrop/index.ts new file mode 100644 index 000000000..4a243af74 --- /dev/null +++ b/src/renderer/src/components/backdrop/index.ts @@ -0,0 +1 @@ +export * from "./backdrop"; diff --git a/src/renderer/src/components/bottom-panel/index.ts b/src/renderer/src/components/bottom-panel/index.ts new file mode 100644 index 000000000..1e3631a18 --- /dev/null +++ b/src/renderer/src/components/bottom-panel/index.ts @@ -0,0 +1 @@ +export * from "./bottom-panel"; diff --git a/src/renderer/src/components/button/index.ts b/src/renderer/src/components/button/index.ts new file mode 100644 index 000000000..fd4663cba --- /dev/null +++ b/src/renderer/src/components/button/index.ts @@ -0,0 +1 @@ +export * from "./button"; diff --git a/src/renderer/src/components/checkbox-field/index.ts b/src/renderer/src/components/checkbox-field/index.ts new file mode 100644 index 000000000..2b8573b48 --- /dev/null +++ b/src/renderer/src/components/checkbox-field/index.ts @@ -0,0 +1 @@ +export * from "./checkbox-field"; diff --git a/src/renderer/src/components/game-card/index.ts b/src/renderer/src/components/game-card/index.ts new file mode 100644 index 000000000..35d187f33 --- /dev/null +++ b/src/renderer/src/components/game-card/index.ts @@ -0,0 +1 @@ +export * from "./game-card"; diff --git a/src/renderer/src/components/header/index.ts b/src/renderer/src/components/header/index.ts new file mode 100644 index 000000000..885394097 --- /dev/null +++ b/src/renderer/src/components/header/index.ts @@ -0,0 +1 @@ +export * from "./header"; diff --git a/src/renderer/src/components/hero/index.ts b/src/renderer/src/components/hero/index.ts new file mode 100644 index 000000000..a6707fec9 --- /dev/null +++ b/src/renderer/src/components/hero/index.ts @@ -0,0 +1 @@ +export * from "./hero"; diff --git a/src/renderer/src/components/link/index.ts b/src/renderer/src/components/link/index.ts new file mode 100644 index 000000000..eec6e4849 --- /dev/null +++ b/src/renderer/src/components/link/index.ts @@ -0,0 +1 @@ +export * from "./link"; diff --git a/src/renderer/src/components/modal/index.ts b/src/renderer/src/components/modal/index.ts new file mode 100644 index 000000000..2c5b312e4 --- /dev/null +++ b/src/renderer/src/components/modal/index.ts @@ -0,0 +1 @@ +export * from "./modal"; diff --git a/src/renderer/src/components/sidebar/index.ts b/src/renderer/src/components/sidebar/index.ts new file mode 100644 index 000000000..ea31f26c1 --- /dev/null +++ b/src/renderer/src/components/sidebar/index.ts @@ -0,0 +1 @@ +export * from "./sidebar"; diff --git a/src/renderer/src/components/text-field/index.ts b/src/renderer/src/components/text-field/index.ts new file mode 100644 index 000000000..29467791d --- /dev/null +++ b/src/renderer/src/components/text-field/index.ts @@ -0,0 +1 @@ +export * from "./text-field"; From 2797e79a451ac2561d6f435b49ca04578c804052 Mon Sep 17 00:00:00 2001 From: itsOdell Date: Thu, 16 May 2024 07:55:25 -0400 Subject: [PATCH 2/4] refactor: updated import paths from renderer/components --- src/renderer/src/components/index.ts | 20 ++++++++++---------- src/renderer/src/components/modal/modal.tsx | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/renderer/src/components/index.ts b/src/renderer/src/components/index.ts index 70777fead..3fb2fcd28 100644 --- a/src/renderer/src/components/index.ts +++ b/src/renderer/src/components/index.ts @@ -1,10 +1,10 @@ -export * from "./bottom-panel/bottom-panel"; -export * from "./button/button"; -export * from "./game-card/game-card"; -export * from "./header/header"; -export * from "./hero/hero"; -export * from "./modal/modal"; -export * from "./sidebar/sidebar"; -export * from "./text-field/text-field"; -export * from "./checkbox-field/checkbox-field"; -export * from "./link/link"; +export * from "./bottom-panel"; +export * from "./button"; +export * from "./game-card"; +export * from "./header"; +export * from "./hero"; +export * from "./modal"; +export * from "./sidebar"; +export * from "./text-field"; +export * from "./checkbox-field"; +export * from "./link"; diff --git a/src/renderer/src/components/modal/modal.tsx b/src/renderer/src/components/modal/modal.tsx index 696189ad8..7beccfae0 100644 --- a/src/renderer/src/components/modal/modal.tsx +++ b/src/renderer/src/components/modal/modal.tsx @@ -4,7 +4,7 @@ import { XIcon } from "@primer/octicons-react"; import * as styles from "./modal.css"; -import { Backdrop } from "../backdrop/backdrop"; +import { Backdrop } from "../backdrop"; import { useTranslation } from "react-i18next"; export interface ModalProps { From cf2359fdee12586d367077d77801c65d6036df44 Mon Sep 17 00:00:00 2001 From: itsOdell Date: Thu, 16 May 2024 08:00:32 -0400 Subject: [PATCH 3/4] refactor: replace theme import path with path alias for clean imports Every theme.css import that is away by 3 directories (e.g ../../../themes.css) is replaced with a path alias (e.g @renderer/theme.css) --- .../src/pages/game-details/hero/hero-panel-actions.css.ts | 2 +- src/renderer/src/pages/game-details/hero/hero-panel.css.ts | 2 +- .../installation-guides/dodi-installation-guide.css.ts | 2 +- .../installation-guides/online-fix-installation-guide.css.ts | 2 +- .../src/pages/game-details/sidebar/how-long-to-beat-section.tsx | 2 +- src/renderer/src/pages/game-details/sidebar/sidebar.css.ts | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/renderer/src/pages/game-details/hero/hero-panel-actions.css.ts b/src/renderer/src/pages/game-details/hero/hero-panel-actions.css.ts index 6280c8ce3..c97a0f61f 100644 --- a/src/renderer/src/pages/game-details/hero/hero-panel-actions.css.ts +++ b/src/renderer/src/pages/game-details/hero/hero-panel-actions.css.ts @@ -1,6 +1,6 @@ import { style } from "@vanilla-extract/css"; -import { vars } from "../../../theme.css"; +import { vars } from "@renderer/theme.css"; export const heroPanelAction = style({ border: `solid 1px ${vars.color.muted}`, diff --git a/src/renderer/src/pages/game-details/hero/hero-panel.css.ts b/src/renderer/src/pages/game-details/hero/hero-panel.css.ts index 640196e66..fb6d8e73f 100644 --- a/src/renderer/src/pages/game-details/hero/hero-panel.css.ts +++ b/src/renderer/src/pages/game-details/hero/hero-panel.css.ts @@ -1,5 +1,5 @@ import { style } from "@vanilla-extract/css"; -import { SPACING_UNIT, vars } from "../../../theme.css"; +import { SPACING_UNIT, vars } from "@renderer/theme.css"; export const panel = style({ width: "100%", diff --git a/src/renderer/src/pages/game-details/installation-guides/dodi-installation-guide.css.ts b/src/renderer/src/pages/game-details/installation-guides/dodi-installation-guide.css.ts index d95add53d..4e485cefa 100644 --- a/src/renderer/src/pages/game-details/installation-guides/dodi-installation-guide.css.ts +++ b/src/renderer/src/pages/game-details/installation-guides/dodi-installation-guide.css.ts @@ -1,4 +1,4 @@ -import { vars } from "../../../theme.css"; +import { vars } from "@renderer/theme.css"; import { keyframes, style } from "@vanilla-extract/css"; export const slideIn = keyframes({ diff --git a/src/renderer/src/pages/game-details/installation-guides/online-fix-installation-guide.css.ts b/src/renderer/src/pages/game-details/installation-guides/online-fix-installation-guide.css.ts index 891f11be4..9eb386480 100644 --- a/src/renderer/src/pages/game-details/installation-guides/online-fix-installation-guide.css.ts +++ b/src/renderer/src/pages/game-details/installation-guides/online-fix-installation-guide.css.ts @@ -1,4 +1,4 @@ -import { SPACING_UNIT } from "../../../theme.css"; +import { SPACING_UNIT } from "@renderer/theme.css"; import { style } from "@vanilla-extract/css"; export const passwordField = style({ diff --git a/src/renderer/src/pages/game-details/sidebar/how-long-to-beat-section.tsx b/src/renderer/src/pages/game-details/sidebar/how-long-to-beat-section.tsx index ab4e7a4c2..758bf10c5 100644 --- a/src/renderer/src/pages/game-details/sidebar/how-long-to-beat-section.tsx +++ b/src/renderer/src/pages/game-details/sidebar/how-long-to-beat-section.tsx @@ -1,7 +1,7 @@ import Skeleton, { SkeletonTheme } from "react-loading-skeleton"; import { useTranslation } from "react-i18next"; import type { HowLongToBeatCategory } from "@types"; -import { vars } from "../../../theme.css"; +import { vars } from "@renderer/theme.css"; import * as styles from "./sidebar.css"; const durationTranslation: Record = { diff --git a/src/renderer/src/pages/game-details/sidebar/sidebar.css.ts b/src/renderer/src/pages/game-details/sidebar/sidebar.css.ts index cae988ab4..6d730c9eb 100644 --- a/src/renderer/src/pages/game-details/sidebar/sidebar.css.ts +++ b/src/renderer/src/pages/game-details/sidebar/sidebar.css.ts @@ -1,6 +1,6 @@ import { globalStyle, style } from "@vanilla-extract/css"; -import { SPACING_UNIT, vars } from "../../../theme.css"; +import { SPACING_UNIT, vars } from "@renderer/theme.css"; export const contentSidebar = style({ borderLeft: `solid 1px ${vars.color.border};`, From e17f200ad8f0b7c48fffd2a7cde53a7952c5818f Mon Sep 17 00:00:00 2001 From: itsOdell Date: Thu, 16 May 2024 08:08:37 -0400 Subject: [PATCH 4/4] chore: added newlines to satisfy prettier --- src/renderer/src/components/backdrop/index.ts | 2 +- src/renderer/src/components/bottom-panel/index.ts | 2 +- src/renderer/src/components/button/index.ts | 2 +- src/renderer/src/components/checkbox-field/index.ts | 2 +- src/renderer/src/components/game-card/index.ts | 2 +- src/renderer/src/components/header/index.ts | 2 +- src/renderer/src/components/hero/index.ts | 2 +- src/renderer/src/components/link/index.ts | 2 +- src/renderer/src/components/modal/index.ts | 2 +- src/renderer/src/components/sidebar/index.ts | 2 +- src/renderer/src/components/text-field/index.ts | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/renderer/src/components/backdrop/index.ts b/src/renderer/src/components/backdrop/index.ts index 4a243af74..52258e652 100644 --- a/src/renderer/src/components/backdrop/index.ts +++ b/src/renderer/src/components/backdrop/index.ts @@ -1 +1 @@ -export * from "./backdrop"; +export * from "./backdrop"; diff --git a/src/renderer/src/components/bottom-panel/index.ts b/src/renderer/src/components/bottom-panel/index.ts index 1e3631a18..0016f6994 100644 --- a/src/renderer/src/components/bottom-panel/index.ts +++ b/src/renderer/src/components/bottom-panel/index.ts @@ -1 +1 @@ -export * from "./bottom-panel"; +export * from "./bottom-panel"; diff --git a/src/renderer/src/components/button/index.ts b/src/renderer/src/components/button/index.ts index fd4663cba..98d55acde 100644 --- a/src/renderer/src/components/button/index.ts +++ b/src/renderer/src/components/button/index.ts @@ -1 +1 @@ -export * from "./button"; +export * from "./button"; diff --git a/src/renderer/src/components/checkbox-field/index.ts b/src/renderer/src/components/checkbox-field/index.ts index 2b8573b48..ddfca0f3e 100644 --- a/src/renderer/src/components/checkbox-field/index.ts +++ b/src/renderer/src/components/checkbox-field/index.ts @@ -1 +1 @@ -export * from "./checkbox-field"; +export * from "./checkbox-field"; diff --git a/src/renderer/src/components/game-card/index.ts b/src/renderer/src/components/game-card/index.ts index 35d187f33..01bf003df 100644 --- a/src/renderer/src/components/game-card/index.ts +++ b/src/renderer/src/components/game-card/index.ts @@ -1 +1 @@ -export * from "./game-card"; +export * from "./game-card"; diff --git a/src/renderer/src/components/header/index.ts b/src/renderer/src/components/header/index.ts index 885394097..49ac70fe2 100644 --- a/src/renderer/src/components/header/index.ts +++ b/src/renderer/src/components/header/index.ts @@ -1 +1 @@ -export * from "./header"; +export * from "./header"; diff --git a/src/renderer/src/components/hero/index.ts b/src/renderer/src/components/hero/index.ts index a6707fec9..5e2d3caf3 100644 --- a/src/renderer/src/components/hero/index.ts +++ b/src/renderer/src/components/hero/index.ts @@ -1 +1 @@ -export * from "./hero"; +export * from "./hero"; diff --git a/src/renderer/src/components/link/index.ts b/src/renderer/src/components/link/index.ts index eec6e4849..6fc151afb 100644 --- a/src/renderer/src/components/link/index.ts +++ b/src/renderer/src/components/link/index.ts @@ -1 +1 @@ -export * from "./link"; +export * from "./link"; diff --git a/src/renderer/src/components/modal/index.ts b/src/renderer/src/components/modal/index.ts index 2c5b312e4..031608e25 100644 --- a/src/renderer/src/components/modal/index.ts +++ b/src/renderer/src/components/modal/index.ts @@ -1 +1 @@ -export * from "./modal"; +export * from "./modal"; diff --git a/src/renderer/src/components/sidebar/index.ts b/src/renderer/src/components/sidebar/index.ts index ea31f26c1..01acaeffb 100644 --- a/src/renderer/src/components/sidebar/index.ts +++ b/src/renderer/src/components/sidebar/index.ts @@ -1 +1 @@ -export * from "./sidebar"; +export * from "./sidebar"; diff --git a/src/renderer/src/components/text-field/index.ts b/src/renderer/src/components/text-field/index.ts index 29467791d..ef65a68d5 100644 --- a/src/renderer/src/components/text-field/index.ts +++ b/src/renderer/src/components/text-field/index.ts @@ -1 +1 @@ -export * from "./text-field"; +export * from "./text-field";