From bfac91eb3cdd75275c99e68ea0e7a0141e8afcb8 Mon Sep 17 00:00:00 2001 From: Wonsuk Choi Date: Sun, 2 Aug 2026 23:56:29 +0900 Subject: [PATCH 1/2] refactor(*): migrate deprecated phosphor icon names to 'Icon' suffix --- scripts/generate-phosphor-icon-registry.mjs | 11 +- src/builder/templates.ts | 40 +- src/components/ApplicationStarter.tsx | 64 +- src/components/AuthenticatedUserMenu.tsx | 24 +- src/components/Avatar.tsx | 4 +- src/components/AvatarCropModal.tsx | 4 +- src/components/BlogAuthorFilter.tsx | 11 +- src/components/Breadcrumbs.tsx | 4 +- src/components/CodeExplorerTopBar.tsx | 23 +- src/components/CopyPageDropdown.tsx | 8 +- src/components/Doc.tsx | 8 +- src/components/DocFeedbackFloatingButton.tsx | 12 +- src/components/DocFeedbackNote.tsx | 26 +- src/components/DocFeedbackProvider.tsx | 4 +- src/components/ExampleDeployDialog.tsx | 38 +- src/components/FeatureGrid.tsx | 4 +- src/components/FeedbackLeaderboard.tsx | 10 +- src/components/FeedbackModerationList.tsx | 14 +- src/components/FilterComponents.tsx | 44 +- src/components/FrameworkCard.tsx | 6 +- src/components/ImageUpload.client.tsx | 8 +- src/components/LibrariesBrowser.tsx | 8 +- src/components/LibrariesOverlay.tsx | 6 +- src/components/LibraryDownloadsMicro.tsx | 8 +- src/components/LibraryGridCard.tsx | 6 +- src/components/LibraryLayout.tsx | 19 +- src/components/LibraryStatsSection.tsx | 6 +- src/components/LibraryTestimonials.tsx | 4 +- src/components/LoginModal.tsx | 4 +- src/components/MegaMenuItem.tsx | 4 +- src/components/Navbar.tsx | 84 +- src/components/NavbarAuthControls.tsx | 4 +- src/components/NavbarCartButton.tsx | 6 +- src/components/NewsletterSignup.tsx | 8 +- src/components/NotFound.tsx | 50 +- src/components/NotesModerationList.tsx | 6 +- src/components/OpenSourceStats.tsx | 12 +- src/components/OssSponsorsSection.tsx | 4 +- src/components/PaginationControls.tsx | 6 +- src/components/PartnersSection.tsx | 4 +- src/components/PartnersSponsorsSection.tsx | 6 +- src/components/PartnershipCallout.tsx | 2 +- src/components/SearchButton.tsx | 12 +- src/components/SearchModal.tsx | 102 +- src/components/Select.tsx | 9 +- src/components/ShowcaseCard.tsx | 16 +- src/components/ShowcaseDetail.tsx | 26 +- src/components/ShowcaseGallery.tsx | 4 +- src/components/ShowcaseModerationList.tsx | 32 +- src/components/ShowcaseSection.tsx | 6 +- src/components/ShowcaseSubmitForm.tsx | 6 +- src/components/Spinner.tsx | 4 +- src/components/TableComponents.tsx | 8 +- src/components/ThemeToggle.tsx | 8 +- src/components/TocMobile.tsx | 4 +- src/components/UserFeedbackSection.tsx | 16 +- src/components/VersionSelect.tsx | 4 +- .../AccountProfilePictureSection.client.tsx | 14 +- src/components/admin/AdminAccessDenied.tsx | 4 +- src/components/admin/DocsCacheTab.tsx | 28 +- src/components/admin/UserAvatar.tsx | 6 +- src/components/application-builder/parts.tsx | 12 +- src/components/builder/BuilderSummary.tsx | 34 +- src/components/builder/BuilderWorkspace.tsx | 6 +- src/components/builder/CustomAddonDialog.tsx | 24 +- .../builder/CustomTemplateDialog.tsx | 24 +- src/components/builder/DeployDialog.tsx | 38 +- src/components/builder/FeaturePicker.tsx | 22 +- src/components/charts/ChartControls.tsx | 6 +- src/components/charts/ChartsCatalogPages.tsx | 6 +- src/components/ds/BrandAssets.tsx | 4 +- src/components/ds/DsKit.tsx | 25 +- src/components/ds/phosphor-icons.generated.ts | 6046 ++++++++--------- src/components/ds/ui/index.tsx | 8 +- src/components/game/ui/CompleteOverlay.tsx | 12 +- src/components/game/ui/GameHUD.tsx | 16 +- src/components/game/ui/StatsHUD.tsx | 4 +- src/components/home/HomeCommunitySection.tsx | 4 +- src/components/home/HomeNewsletterSection.tsx | 4 +- .../home/HomeSocialProofSection.tsx | 4 +- src/components/landing/AiLanding.tsx | 52 +- .../landing/ChartsCatalogGallery.tsx | 17 +- .../landing/ChartsLandingGraphics.tsx | 8 +- src/components/landing/CliLanding.tsx | 28 +- src/components/landing/ConfigLanding.tsx | 26 +- src/components/landing/DbLanding.tsx | 41 +- src/components/landing/DevtoolsLanding.tsx | 60 +- src/components/landing/FormLanding.tsx | 20 +- src/components/landing/HighlightLanding.tsx | 24 +- src/components/landing/HotkeysLanding.tsx | 30 +- src/components/landing/IntentLanding.tsx | 38 +- .../landing/LandingCopyPromptButton.tsx | 6 +- src/components/landing/LibraryLanding.tsx | 32 +- src/components/landing/MarkdownLanding.tsx | 44 +- src/components/landing/PacerLanding.tsx | 15 +- src/components/landing/QueryLanding.tsx | 15 +- src/components/landing/RangerLanding.tsx | 20 +- src/components/landing/RouterLanding.tsx | 34 +- src/components/landing/StartLanding.tsx | 44 +- src/components/landing/StoreLanding.tsx | 26 +- src/components/landing/TableLanding.tsx | 38 +- src/components/landing/VirtualLanding.tsx | 40 +- src/components/landing/WorkflowLanding.tsx | 32 +- src/components/markdown/CodeBlockView.tsx | 4 +- src/components/markdown/MarkdownContent.tsx | 12 +- src/components/npm-stats/BaselineSection.tsx | 22 +- src/components/npm-stats/ChartControls.tsx | 30 +- .../npm-stats/DisabledChartActions.tsx | 6 +- .../npm-stats/LatestBucketNavigator.tsx | 26 +- src/components/npm-stats/NPMStatsChart.tsx | 20 +- src/components/npm-stats/PackagePills.tsx | 20 +- src/components/npm-stats/PackageSearch.tsx | 2 +- src/components/npm-stats/StatsTable.tsx | 6 +- src/components/shop/CartDrawer.tsx | 18 +- src/components/shop/ui/Qty.tsx | 6 +- src/components/stack/CategoryArticle.tsx | 80 +- src/libraries/ai.tsx | 8 +- src/libraries/cli.tsx | 20 +- src/libraries/config.tsx | 8 +- src/libraries/db.tsx | 8 +- src/libraries/devtools.tsx | 8 +- src/libraries/form.tsx | 8 +- src/libraries/hotkeys.tsx | 12 +- src/libraries/icons.ts | 80 +- src/libraries/intent.tsx | 12 +- src/libraries/pacer.tsx | 12 +- src/libraries/query.tsx | 8 +- src/libraries/ranger.tsx | 12 +- src/libraries/router.tsx | 12 +- src/libraries/start.tsx | 8 +- src/libraries/store.tsx | 8 +- src/libraries/table.tsx | 12 +- src/libraries/virtual.tsx | 12 +- src/libraries/workflow.tsx | 12 +- .../$libraryId/$version.docs.blog.tsx | 4 +- .../$libraryId/$version.docs.contributors.tsx | 8 +- ...n.docs.framework.$framework.examples.$.tsx | 8 +- .../$libraryId/$version.docs.npm-stats.tsx | 6 +- src/routes/account/feedback.tsx | 8 +- src/routes/account/index.tsx | 15 +- src/routes/account/integrations.tsx | 46 +- src/routes/account/notes.tsx | 4 +- src/routes/account/submissions.tsx | 30 +- src/routes/admin/audit.tsx | 10 +- src/routes/admin/feedback_.$id.tsx | 40 +- src/routes/admin/github-stats.tsx | 19 +- src/routes/admin/index.tsx | 72 +- src/routes/admin/intent.tsx | 32 +- src/routes/admin/logins.tsx | 6 +- src/routes/admin/npm-stats.tsx | 9 +- src/routes/admin/roles.$roleId.tsx | 20 +- src/routes/admin/roles.index.tsx | 38 +- src/routes/admin/route.tsx | 50 +- src/routes/admin/showcases_.$id.tsx | 68 +- src/routes/admin/users.$userId.tsx | 32 +- src/routes/admin/users.tsx | 17 +- src/routes/ads.tsx | 4 +- src/routes/blog.index.tsx | 2 +- src/routes/brand-guide.tsx | 6 +- src/routes/dashboard.tsx | 6 +- src/routes/ds.buttons.tsx | 86 +- src/routes/ds.collapsible.tsx | 6 +- src/routes/ds.dropdown.tsx | 23 +- src/routes/ds.eyebrow.tsx | 16 +- src/routes/ds.iconography.lazy.tsx | 21 +- src/routes/ds.index.tsx | 68 +- src/routes/ds.navbar.tsx | 32 +- src/routes/ds.stats.tsx | 8 +- src/routes/ethos.tsx | 20 +- src/routes/index.tsx | 30 +- src/routes/intent/registry/$packageName.tsx | 8 +- src/routes/learn.tsx | 32 +- src/routes/maintainers.tsx | 18 +- src/routes/merch.tsx | 20 +- src/routes/paid-support.tsx | 15 +- src/routes/partners.$partner.tsx | 16 +- src/routes/partners.railway.tsx | 48 +- src/routes/shop.cart.tsx | 8 +- src/routes/shop.search.tsx | 2 +- src/routes/stats/npm/index.tsx | 4 +- src/routes/tenets.tsx | 32 +- src/routes/workshops.tsx | 56 +- 182 files changed, 4861 insertions(+), 4702 deletions(-) diff --git a/scripts/generate-phosphor-icon-registry.mjs b/scripts/generate-phosphor-icon-registry.mjs index 251e6fe73..2a3eaf74f 100644 --- a/scripts/generate-phosphor-icon-registry.mjs +++ b/scripts/generate-phosphor-icon-registry.mjs @@ -9,17 +9,14 @@ const iconNames = readdirSync(path.join(packageRoot, 'dist/csr')) .filter((fileName) => fileName.endsWith('.es.js')) .map((fileName) => fileName.slice(0, -'.es.js'.length)) .sort((a, b) => a.localeCompare(b)) -const getLocalName = (iconName) => - iconName === 'Infinity' ? 'InfinityIcon' : iconName -const getImportSpecifier = (iconName) => { - const localName = getLocalName(iconName) - return localName === iconName ? iconName : `${iconName} as ${localName}` -} +// Every icon module exports both `Name` (deprecated) and `NameIcon`. The +// suffixed export is the supported one and never collides with a JS global. +const getLocalName = (iconName) => `${iconName}Icon` const imports = iconNames .map( (iconName) => - `import { ${getImportSpecifier(iconName)} } from '@phosphor-icons/react/${iconName}'`, + `import { ${getLocalName(iconName)} } from '@phosphor-icons/react/${iconName}'`, ) .join('\n') const entries = iconNames diff --git a/src/builder/templates.ts b/src/builder/templates.ts index 941aaa6d4..7e3c2105b 100644 --- a/src/builder/templates.ts +++ b/src/builder/templates.ts @@ -7,16 +7,16 @@ import type { Icon } from '@phosphor-icons/react' import { - Rocket, - Robot, - SquaresFour, - FileText, - HardDrives, - Radio, - Globe, - HardDrive, - Plus, - ShoppingBag, + RocketIcon, + RobotIcon, + SquaresFourIcon, + FileTextIcon, + HardDrivesIcon, + RadioIcon, + GlobeIcon, + HardDriveIcon, + PlusIcon, + ShoppingBagIcon, } from '@phosphor-icons/react' export interface Template { @@ -39,7 +39,7 @@ export const TEMPLATES: Array