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
@@ -0,0 +1,124 @@
|
||||
/**
|
||||
* Central barrel for all Phosphor icons used across the renderer.
|
||||
*
|
||||
* Every renderer component imports icons from this module so that:
|
||||
* - bundle tree-shaking has a single module boundary to look at,
|
||||
* - typos like `BriefCase` vs `Briefcase` surface in one place,
|
||||
* - swapping icon sets later means touching one file.
|
||||
*
|
||||
* Keep this list sorted alphabetically. When a new icon is needed,
|
||||
* add it here first, then import from "@/components/ui/icons" (or the
|
||||
* relative path from the file). Raw `@phosphor-icons/react` imports
|
||||
* outside this file should be treated as a regression.
|
||||
*/
|
||||
export {
|
||||
ArrowBendUpLeft,
|
||||
ArrowClockwise,
|
||||
ArrowCounterClockwise,
|
||||
ArrowRight,
|
||||
ArrowSquareOut,
|
||||
ArrowsClockwise,
|
||||
At,
|
||||
Bell,
|
||||
BookOpen,
|
||||
Brain,
|
||||
Briefcase,
|
||||
Browser,
|
||||
Buildings,
|
||||
CalendarBlank,
|
||||
Camera,
|
||||
CaretDown,
|
||||
CaretRight,
|
||||
CaretUp,
|
||||
CaretUpDown,
|
||||
ChartLine,
|
||||
ChatCircle,
|
||||
ChatCircleDots,
|
||||
ChatTeardrop,
|
||||
Check,
|
||||
CheckCircle,
|
||||
CheckSquare,
|
||||
Circle,
|
||||
CircleNotch,
|
||||
Clock,
|
||||
ClockCounterClockwise,
|
||||
Command,
|
||||
Copy,
|
||||
Cpu,
|
||||
CurrencyCircleDollar,
|
||||
DiscordLogo,
|
||||
Download,
|
||||
EnvelopeSimple,
|
||||
Eye,
|
||||
FacebookLogo,
|
||||
FileCode,
|
||||
FileText,
|
||||
Fire,
|
||||
FloppyDisk,
|
||||
FolderOpen,
|
||||
FolderSimple,
|
||||
Funnel,
|
||||
Gear,
|
||||
GithubLogo,
|
||||
Globe,
|
||||
GlobeHemisphereWest,
|
||||
GlobeSimple,
|
||||
HardDrive,
|
||||
Hash,
|
||||
Heart,
|
||||
Heartbeat,
|
||||
Hourglass,
|
||||
InstagramLogo,
|
||||
Kanban,
|
||||
Key,
|
||||
Lightbulb,
|
||||
Lightning,
|
||||
Link,
|
||||
LinkedinLogo,
|
||||
ListChecks,
|
||||
MagnifyingGlass,
|
||||
Megaphone,
|
||||
Minus,
|
||||
MonitorPlay,
|
||||
MusicNote,
|
||||
NotePencil,
|
||||
Notebook,
|
||||
PaperPlaneTilt,
|
||||
Paperclip,
|
||||
Pause,
|
||||
Pencil,
|
||||
PinterestLogo,
|
||||
Play,
|
||||
Plugs,
|
||||
Plus,
|
||||
PuzzlePiece,
|
||||
RedditLogo,
|
||||
Robot,
|
||||
Rocket,
|
||||
Rows,
|
||||
ShieldCheck,
|
||||
SidebarSimple,
|
||||
SignIn,
|
||||
SlidersHorizontal,
|
||||
Square,
|
||||
SquaresFour,
|
||||
Target,
|
||||
TelegramLogo,
|
||||
Terminal,
|
||||
TerminalWindow,
|
||||
TiktokLogo,
|
||||
Timer,
|
||||
Trash,
|
||||
Tray,
|
||||
UserCircle,
|
||||
UserPlus,
|
||||
UsersThree,
|
||||
Warning,
|
||||
WarningCircle,
|
||||
WhatsappLogo,
|
||||
XCircle,
|
||||
XLogo,
|
||||
YoutubeLogo,
|
||||
} from "@phosphor-icons/react";
|
||||
export { X } from "@phosphor-icons/react";
|
||||
export type { Icon } from "@phosphor-icons/react";
|
||||
Reference in new issue
Block a user