refactor(renderer): route all Phosphor icon imports through ui/icons barrel
Create src/renderer/components/ui/icons.ts as the single re-export point
for every Phosphor icon the renderer touches, then rewrite the 95 files
that previously imported directly from "@phosphor-icons/react" to pull
from the relative-path-to-barrel instead. The TitleBar commit earlier
in this series already used ui/icons; this commit extends the pattern
to the rest of the renderer.
Benefits now wired in:
- one location where bundle tree-shaking can be reasoned about,
- typos like Briefcase vs BriefCase show up against a finite list,
- re-theming or swapping icon sets is a one-file edit,
- a lint rule that flags raw @phosphor-icons/react imports can be
added later without mass-rewriting call sites.
The barrel also re-exports the `Icon` type so call sites that type
icon props against the Phosphor component type work unchanged.
Test count stays at 363 passing; typecheck stays at 156 errors.
This commit is contained in:
1 parent
364f1683e3
commit
75022f82c5
95 files changed
+424
-94
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { Buildings, FolderOpen } from "@phosphor-icons/react";
|
||||
import { Buildings, FolderOpen } from "../ui/icons";
|
||||
import type { ConnectorId } from "@shared/types";
|
||||
import { ActionButton, Input, TextArea, Select } from "../ui";
|
||||
import { OnboardingStep } from "./OnboardingStep";
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ArrowRight, Brain, UserCircle, type Icon } from "@phosphor-icons/react";
|
||||
import { ArrowRight, Brain, UserCircle, type Icon } from "../ui/icons";
|
||||
import { OnboardingStep } from "./OnboardingStep";
|
||||
import { useOnboarding } from "./OnboardingContext";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { CheckCircle, Rocket } from "@phosphor-icons/react";
|
||||
import { CheckCircle, Rocket } from "../ui/icons";
|
||||
import { ActionButton } from "../ui";
|
||||
import { useOnboarding } from "./OnboardingContext";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { Cpu, Lightning } from "@phosphor-icons/react";
|
||||
import { Cpu, Lightning } from "../ui/icons";
|
||||
import { ActionButton, Input, TextArea } from "../ui";
|
||||
import { getStepNumber, TOTAL_STEPS } from "./OnboardingHero";
|
||||
import { useOnboarding } from "./OnboardingContext";
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ArrowRight,
|
||||
ArrowCounterClockwise,
|
||||
Terminal,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../ui/icons";
|
||||
import { ActionButton } from "../ui";
|
||||
import type { TerminalCommandKey } from "@shared/contracts";
|
||||
import { OnboardingStep } from "./OnboardingStep";
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Rocket,
|
||||
SlidersHorizontal,
|
||||
Target,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../ui/icons";
|
||||
import type { AppLocale } from "@shared/locale";
|
||||
|
||||
export type OnboardingStep =
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useState } from "react";
|
||||
import { ArrowRight, FloppyDisk, SignIn } from "@phosphor-icons/react";
|
||||
import { ArrowRight, FloppyDisk, SignIn } from "../ui/icons";
|
||||
import { ActionButton } from "../ui";
|
||||
import {
|
||||
CompatProviderCard,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
CaretRight,
|
||||
FloppyDisk,
|
||||
Terminal,
|
||||
} from "@phosphor-icons/react";
|
||||
} from "../ui/icons";
|
||||
import type { ProfileSnapshot } from "@shared/types";
|
||||
import type { TerminalCommandKey } from "@shared/contracts";
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { motion } from "framer-motion";
|
||||
import { GlobeSimple, Rocket } from "@phosphor-icons/react";
|
||||
import { GlobeSimple, Rocket } from "../ui/icons";
|
||||
import type { AppLocale } from "@shared/locale";
|
||||
import { APP_LOCALES, LOCALE_LABELS } from "@shared/locale";
|
||||
import { ActionButton } from "../ui";
|
||||
|
||||
Reference in new issue
Block a user