rn-iconify 1.0.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -235
- package/babel.js +14 -0
- package/lib/commonjs/IconRenderer.js +91 -4
- package/lib/commonjs/IconRenderer.js.map +1 -1
- package/lib/commonjs/accessibility/AccessibilityProvider.js +189 -0
- package/lib/commonjs/accessibility/AccessibilityProvider.js.map +1 -0
- package/lib/commonjs/accessibility/index.js +87 -0
- package/lib/commonjs/accessibility/index.js.map +1 -0
- package/lib/commonjs/accessibility/types.js +6 -0
- package/lib/commonjs/accessibility/types.js.map +1 -0
- package/lib/commonjs/accessibility/useAccessibleIcon.js +119 -0
- package/lib/commonjs/accessibility/useAccessibleIcon.js.map +1 -0
- package/lib/commonjs/accessibility/utils.js +231 -0
- package/lib/commonjs/accessibility/utils.js.map +1 -0
- package/lib/commonjs/alias/Icon.js +113 -0
- package/lib/commonjs/alias/Icon.js.map +1 -0
- package/lib/commonjs/alias/IconAliasContext.js +177 -0
- package/lib/commonjs/alias/IconAliasContext.js.map +1 -0
- package/lib/commonjs/alias/createIconAliases.js +222 -0
- package/lib/commonjs/alias/createIconAliases.js.map +1 -0
- package/lib/commonjs/alias/index.js +57 -0
- package/lib/commonjs/alias/index.js.map +1 -0
- package/lib/commonjs/alias/types.js +6 -0
- package/lib/commonjs/alias/types.js.map +1 -0
- package/lib/commonjs/animated/AnimatedIcon.js +116 -0
- package/lib/commonjs/animated/AnimatedIcon.js.map +1 -0
- package/lib/commonjs/animated/index.js +76 -0
- package/lib/commonjs/animated/index.js.map +1 -0
- package/lib/commonjs/animated/presets.js +220 -0
- package/lib/commonjs/animated/presets.js.map +1 -0
- package/lib/commonjs/animated/types.js +71 -0
- package/lib/commonjs/animated/types.js.map +1 -0
- package/lib/commonjs/animated/useIconAnimation.js +313 -0
- package/lib/commonjs/animated/useIconAnimation.js.map +1 -0
- package/lib/commonjs/babel/ast-utils.js +214 -0
- package/lib/commonjs/babel/ast-utils.js.map +1 -0
- package/lib/commonjs/babel/cache-writer.js +281 -0
- package/lib/commonjs/babel/cache-writer.js.map +1 -0
- package/lib/commonjs/babel/collector.js +219 -0
- package/lib/commonjs/babel/collector.js.map +1 -0
- package/lib/commonjs/babel/index.js +104 -0
- package/lib/commonjs/babel/index.js.map +1 -0
- package/lib/commonjs/babel/plugin.js +226 -0
- package/lib/commonjs/babel/plugin.js.map +1 -0
- package/lib/commonjs/babel/types.js +485 -0
- package/lib/commonjs/babel/types.js.map +1 -0
- package/lib/commonjs/bundle/index.js +213 -0
- package/lib/commonjs/bundle/index.js.map +1 -0
- package/lib/commonjs/cache/CacheManager.js +105 -6
- package/lib/commonjs/cache/CacheManager.js.map +1 -1
- package/lib/commonjs/cli/commands/analyze.js +171 -0
- package/lib/commonjs/cli/commands/analyze.js.map +1 -0
- package/lib/commonjs/cli/commands/bundle.js +214 -0
- package/lib/commonjs/cli/commands/bundle.js.map +1 -0
- package/lib/commonjs/cli/index.js +142 -0
- package/lib/commonjs/cli/index.js.map +1 -0
- package/lib/commonjs/cli/parser.js +260 -0
- package/lib/commonjs/cli/parser.js.map +1 -0
- package/lib/commonjs/cli/types.js +42 -0
- package/lib/commonjs/cli/types.js.map +1 -0
- package/lib/commonjs/config/ConfigManager.js +182 -0
- package/lib/commonjs/config/ConfigManager.js.map +1 -0
- package/lib/commonjs/config/index.js +44 -0
- package/lib/commonjs/config/index.js.map +1 -0
- package/lib/commonjs/config/types.js +55 -0
- package/lib/commonjs/config/types.js.map +1 -0
- package/lib/commonjs/createIconSet.js +49 -11
- package/lib/commonjs/createIconSet.js.map +1 -1
- package/lib/commonjs/explorer/IconExplorer.js +827 -0
- package/lib/commonjs/explorer/IconExplorer.js.map +1 -0
- package/lib/commonjs/explorer/iconSets.js +303 -0
- package/lib/commonjs/explorer/iconSets.js.map +1 -0
- package/lib/commonjs/explorer/index.js +93 -0
- package/lib/commonjs/explorer/index.js.map +1 -0
- package/lib/commonjs/explorer/types.js +6 -0
- package/lib/commonjs/explorer/types.js.map +1 -0
- package/lib/commonjs/explorer/useExplorer.js +359 -0
- package/lib/commonjs/explorer/useExplorer.js.map +1 -0
- package/lib/commonjs/index.js +618 -12
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/navigation/createDrawerIcon.js +129 -0
- package/lib/commonjs/navigation/createDrawerIcon.js.map +1 -0
- package/lib/commonjs/navigation/createHeaderIcon.js +185 -0
- package/lib/commonjs/navigation/createHeaderIcon.js.map +1 -0
- package/lib/commonjs/navigation/createTabBarIcon.js +178 -0
- package/lib/commonjs/navigation/createTabBarIcon.js.map +1 -0
- package/lib/commonjs/navigation/index.js +83 -0
- package/lib/commonjs/navigation/index.js.map +1 -0
- package/lib/commonjs/navigation/types.js +94 -0
- package/lib/commonjs/navigation/types.js.map +1 -0
- package/lib/commonjs/navigation/useNavigationIcon.js +128 -0
- package/lib/commonjs/navigation/useNavigationIcon.js.map +1 -0
- package/lib/commonjs/network/IconifyAPI.js +154 -14
- package/lib/commonjs/network/IconifyAPI.js.map +1 -1
- package/lib/commonjs/network/index.js +18 -0
- package/lib/commonjs/network/index.js.map +1 -1
- package/lib/commonjs/performance/PerformanceMonitor.js +327 -0
- package/lib/commonjs/performance/PerformanceMonitor.js.map +1 -0
- package/lib/commonjs/performance/index.js +43 -0
- package/lib/commonjs/performance/index.js.map +1 -0
- package/lib/commonjs/performance/types.js +2 -0
- package/lib/commonjs/performance/types.js.map +1 -0
- package/lib/commonjs/placeholder/PlaceholderFactory.js +111 -0
- package/lib/commonjs/placeholder/PlaceholderFactory.js.map +1 -0
- package/lib/commonjs/placeholder/Pulse.js +77 -0
- package/lib/commonjs/placeholder/Pulse.js.map +1 -0
- package/lib/commonjs/placeholder/Shimmer.js +95 -0
- package/lib/commonjs/placeholder/Shimmer.js.map +1 -0
- package/lib/commonjs/placeholder/Skeleton.js +52 -0
- package/lib/commonjs/placeholder/Skeleton.js.map +1 -0
- package/lib/commonjs/placeholder/index.js +41 -0
- package/lib/commonjs/placeholder/index.js.map +1 -0
- package/lib/commonjs/placeholder/types.js +40 -0
- package/lib/commonjs/placeholder/types.js.map +1 -0
- package/lib/commonjs/theme/IconThemeProvider.js +96 -0
- package/lib/commonjs/theme/IconThemeProvider.js.map +1 -0
- package/lib/commonjs/theme/context.js +53 -0
- package/lib/commonjs/theme/context.js.map +1 -0
- package/lib/commonjs/theme/index.js +52 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/theme/types.js +39 -0
- package/lib/commonjs/theme/types.js.map +1 -0
- package/lib/commonjs/theme/useIconTheme.js +121 -0
- package/lib/commonjs/theme/useIconTheme.js.map +1 -0
- package/lib/module/IconRenderer.js +92 -5
- package/lib/module/IconRenderer.js.map +1 -1
- package/lib/module/accessibility/AccessibilityProvider.js +179 -0
- package/lib/module/accessibility/AccessibilityProvider.js.map +1 -0
- package/lib/module/accessibility/index.js +42 -0
- package/lib/module/accessibility/index.js.map +1 -0
- package/lib/module/accessibility/types.js +2 -0
- package/lib/module/accessibility/types.js.map +1 -0
- package/lib/module/accessibility/useAccessibleIcon.js +112 -0
- package/lib/module/accessibility/useAccessibleIcon.js.map +1 -0
- package/lib/module/accessibility/utils.js +221 -0
- package/lib/module/accessibility/utils.js.map +1 -0
- package/lib/module/alias/Icon.js +105 -0
- package/lib/module/alias/Icon.js.map +1 -0
- package/lib/module/alias/IconAliasContext.js +166 -0
- package/lib/module/alias/IconAliasContext.js.map +1 -0
- package/lib/module/alias/createIconAliases.js +213 -0
- package/lib/module/alias/createIconAliases.js.map +1 -0
- package/lib/module/alias/index.js +45 -0
- package/lib/module/alias/index.js.map +1 -0
- package/lib/module/alias/types.js +2 -0
- package/lib/module/alias/types.js.map +1 -0
- package/lib/module/animated/AnimatedIcon.js +109 -0
- package/lib/module/animated/AnimatedIcon.js.map +1 -0
- package/lib/module/animated/index.js +80 -0
- package/lib/module/animated/index.js.map +1 -0
- package/lib/module/animated/presets.js +209 -0
- package/lib/module/animated/presets.js.map +1 -0
- package/lib/module/animated/types.js +65 -0
- package/lib/module/animated/types.js.map +1 -0
- package/lib/module/animated/useIconAnimation.js +306 -0
- package/lib/module/animated/useIconAnimation.js.map +1 -0
- package/lib/module/babel/ast-utils.js +201 -0
- package/lib/module/babel/ast-utils.js.map +1 -0
- package/lib/module/babel/cache-writer.js +269 -0
- package/lib/module/babel/cache-writer.js.map +1 -0
- package/lib/module/babel/collector.js +214 -0
- package/lib/module/babel/collector.js.map +1 -0
- package/lib/module/babel/index.js +51 -0
- package/lib/module/babel/index.js.map +1 -0
- package/lib/module/babel/plugin.js +220 -0
- package/lib/module/babel/plugin.js.map +1 -0
- package/lib/module/babel/types.js +476 -0
- package/lib/module/babel/types.js.map +1 -0
- package/lib/module/bundle/index.js +205 -0
- package/lib/module/bundle/index.js.map +1 -0
- package/lib/module/cache/CacheManager.js +106 -6
- package/lib/module/cache/CacheManager.js.map +1 -1
- package/lib/module/cli/commands/analyze.js +166 -0
- package/lib/module/cli/commands/analyze.js.map +1 -0
- package/lib/module/cli/commands/bundle.js +208 -0
- package/lib/module/cli/commands/bundle.js.map +1 -0
- package/lib/module/cli/index.js +140 -0
- package/lib/module/cli/index.js.map +1 -0
- package/lib/module/cli/parser.js +251 -0
- package/lib/module/cli/parser.js.map +1 -0
- package/lib/module/cli/types.js +36 -0
- package/lib/module/cli/types.js.map +1 -0
- package/lib/module/components/index.js +27 -1
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/config/ConfigManager.js +173 -0
- package/lib/module/config/ConfigManager.js.map +1 -0
- package/lib/module/config/index.js +28 -0
- package/lib/module/config/index.js.map +1 -0
- package/lib/module/config/types.js +49 -0
- package/lib/module/config/types.js.map +1 -0
- package/lib/module/createIconSet.js +49 -11
- package/lib/module/createIconSet.js.map +1 -1
- package/lib/module/explorer/IconExplorer.js +817 -0
- package/lib/module/explorer/IconExplorer.js.map +1 -0
- package/lib/module/explorer/iconSets.js +291 -0
- package/lib/module/explorer/iconSets.js.map +1 -0
- package/lib/module/explorer/index.js +42 -0
- package/lib/module/explorer/index.js.map +1 -0
- package/lib/module/explorer/types.js +2 -0
- package/lib/module/explorer/types.js.map +1 -0
- package/lib/module/explorer/useExplorer.js +353 -0
- package/lib/module/explorer/useExplorer.js.map +1 -0
- package/lib/module/index.js +26 -11
- package/lib/module/index.js.map +1 -1
- package/lib/module/navigation/createDrawerIcon.js +121 -0
- package/lib/module/navigation/createDrawerIcon.js.map +1 -0
- package/lib/module/navigation/createHeaderIcon.js +175 -0
- package/lib/module/navigation/createHeaderIcon.js.map +1 -0
- package/lib/module/navigation/createTabBarIcon.js +168 -0
- package/lib/module/navigation/createTabBarIcon.js.map +1 -0
- package/lib/module/navigation/index.js +59 -0
- package/lib/module/navigation/index.js.map +1 -0
- package/lib/module/navigation/types.js +88 -0
- package/lib/module/navigation/types.js.map +1 -0
- package/lib/module/navigation/useNavigationIcon.js +121 -0
- package/lib/module/navigation/useNavigationIcon.js.map +1 -0
- package/lib/module/network/IconifyAPI.js +152 -14
- package/lib/module/network/IconifyAPI.js.map +1 -1
- package/lib/module/network/index.js +1 -1
- package/lib/module/network/index.js.map +1 -1
- package/lib/module/performance/PerformanceMonitor.js +317 -0
- package/lib/module/performance/PerformanceMonitor.js.map +1 -0
- package/lib/module/performance/index.js +26 -0
- package/lib/module/performance/index.js.map +1 -0
- package/lib/module/performance/types.js +2 -0
- package/lib/module/performance/types.js.map +1 -0
- package/lib/module/placeholder/PlaceholderFactory.js +105 -0
- package/lib/module/placeholder/PlaceholderFactory.js.map +1 -0
- package/lib/module/placeholder/Pulse.js +70 -0
- package/lib/module/placeholder/Pulse.js.map +1 -0
- package/lib/module/placeholder/Shimmer.js +88 -0
- package/lib/module/placeholder/Shimmer.js.map +1 -0
- package/lib/module/placeholder/Skeleton.js +45 -0
- package/lib/module/placeholder/Skeleton.js.map +1 -0
- package/lib/module/placeholder/index.js +15 -0
- package/lib/module/placeholder/index.js.map +1 -0
- package/lib/module/placeholder/types.js +34 -0
- package/lib/module/placeholder/types.js.map +1 -0
- package/lib/module/theme/IconThemeProvider.js +89 -0
- package/lib/module/theme/IconThemeProvider.js.map +1 -0
- package/lib/module/theme/context.js +47 -0
- package/lib/module/theme/context.js.map +1 -0
- package/lib/module/theme/index.js +19 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/theme/types.js +33 -0
- package/lib/module/theme/types.js.map +1 -0
- package/lib/module/theme/useIconTheme.js +114 -0
- package/lib/module/theme/useIconTheme.js.map +1 -0
- package/lib/typescript/IconRenderer.d.ts +1 -1
- package/lib/typescript/IconRenderer.d.ts.map +1 -1
- package/lib/typescript/accessibility/AccessibilityProvider.d.ts +57 -0
- package/lib/typescript/accessibility/AccessibilityProvider.d.ts.map +1 -0
- package/lib/typescript/accessibility/index.d.ts +37 -0
- package/lib/typescript/accessibility/index.d.ts.map +1 -0
- package/lib/typescript/accessibility/types.d.ts +130 -0
- package/lib/typescript/accessibility/types.d.ts.map +1 -0
- package/lib/typescript/accessibility/useAccessibleIcon.d.ts +111 -0
- package/lib/typescript/accessibility/useAccessibleIcon.d.ts.map +1 -0
- package/lib/typescript/accessibility/utils.d.ts +29 -0
- package/lib/typescript/accessibility/utils.d.ts.map +1 -0
- package/lib/typescript/alias/Icon.d.ts +38 -0
- package/lib/typescript/alias/Icon.d.ts.map +1 -0
- package/lib/typescript/alias/IconAliasContext.d.ts +52 -0
- package/lib/typescript/alias/IconAliasContext.d.ts.map +1 -0
- package/lib/typescript/alias/createIconAliases.d.ts +77 -0
- package/lib/typescript/alias/createIconAliases.d.ts.map +1 -0
- package/lib/typescript/alias/index.d.ts +36 -0
- package/lib/typescript/alias/index.d.ts.map +1 -0
- package/lib/typescript/alias/types.d.ts +115 -0
- package/lib/typescript/alias/types.d.ts.map +1 -0
- package/lib/typescript/animated/AnimatedIcon.d.ts +45 -0
- package/lib/typescript/animated/AnimatedIcon.d.ts.map +1 -0
- package/lib/typescript/animated/index.d.ts +70 -0
- package/lib/typescript/animated/index.d.ts.map +1 -0
- package/lib/typescript/animated/presets.d.ts +35 -0
- package/lib/typescript/animated/presets.d.ts.map +1 -0
- package/lib/typescript/animated/types.d.ts +196 -0
- package/lib/typescript/animated/types.d.ts.map +1 -0
- package/lib/typescript/animated/useIconAnimation.d.ts +64 -0
- package/lib/typescript/animated/useIconAnimation.d.ts.map +1 -0
- package/lib/typescript/babel/ast-utils.d.ts +52 -0
- package/lib/typescript/babel/ast-utils.d.ts.map +1 -0
- package/lib/typescript/babel/cache-writer.d.ts +56 -0
- package/lib/typescript/babel/cache-writer.d.ts.map +1 -0
- package/lib/typescript/babel/collector.d.ts +107 -0
- package/lib/typescript/babel/collector.d.ts.map +1 -0
- package/lib/typescript/babel/index.d.ts +47 -0
- package/lib/typescript/babel/index.d.ts.map +1 -0
- package/lib/typescript/babel/plugin.d.ts +17 -0
- package/lib/typescript/babel/plugin.d.ts.map +1 -0
- package/lib/typescript/babel/types.d.ts +129 -0
- package/lib/typescript/babel/types.d.ts.map +1 -0
- package/lib/typescript/bundle/index.d.ts +161 -0
- package/lib/typescript/bundle/index.d.ts.map +1 -0
- package/lib/typescript/cache/CacheManager.d.ts +52 -4
- package/lib/typescript/cache/CacheManager.d.ts.map +1 -1
- package/lib/typescript/cli/commands/analyze.d.ts +10 -0
- package/lib/typescript/cli/commands/analyze.d.ts.map +1 -0
- package/lib/typescript/cli/commands/bundle.d.ts +10 -0
- package/lib/typescript/cli/commands/bundle.d.ts.map +1 -0
- package/lib/typescript/cli/index.d.ts +7 -0
- package/lib/typescript/cli/index.d.ts.map +1 -0
- package/lib/typescript/cli/parser.d.ts +18 -0
- package/lib/typescript/cli/parser.d.ts.map +1 -0
- package/lib/typescript/cli/types.d.ts +157 -0
- package/lib/typescript/cli/types.d.ts.map +1 -0
- package/lib/typescript/components/Academicons.d.ts +1 -1
- package/lib/typescript/components/AkarIcons.d.ts +1 -1
- package/lib/typescript/components/AntDesign.d.ts +1 -1
- package/lib/typescript/components/Arcticons.d.ts +1 -1
- package/lib/typescript/components/Basil.d.ts +1 -1
- package/lib/typescript/components/Bi.d.ts +1 -1
- package/lib/typescript/components/BitcoinIcons.d.ts +1 -1
- package/lib/typescript/components/Bpmn.d.ts +1 -1
- package/lib/typescript/components/Brandico.d.ts +1 -1
- package/lib/typescript/components/Bx.d.ts +1 -1
- package/lib/typescript/components/Bxl.d.ts +1 -1
- package/lib/typescript/components/Bxs.d.ts +1 -1
- package/lib/typescript/components/Bytesize.d.ts +1 -1
- package/lib/typescript/components/Carbon.d.ts +1 -1
- package/lib/typescript/components/Catppuccin.d.ts +1 -1
- package/lib/typescript/components/Cbi.d.ts +1 -1
- package/lib/typescript/components/Charm.d.ts +1 -1
- package/lib/typescript/components/Ci.d.ts +1 -1
- package/lib/typescript/components/Cib.d.ts +1 -1
- package/lib/typescript/components/Cif.d.ts +1 -1
- package/lib/typescript/components/Cil.d.ts +1 -1
- package/lib/typescript/components/CircleFlags.d.ts +1 -1
- package/lib/typescript/components/Circum.d.ts +1 -1
- package/lib/typescript/components/Clarity.d.ts +1 -1
- package/lib/typescript/components/Codex.d.ts +1 -1
- package/lib/typescript/components/Codicon.d.ts +1 -1
- package/lib/typescript/components/Covid.d.ts +1 -1
- package/lib/typescript/components/Cryptocurrency.d.ts +1 -1
- package/lib/typescript/components/CryptocurrencyColor.d.ts +1 -1
- package/lib/typescript/components/Cuida.d.ts +1 -1
- package/lib/typescript/components/Dashicons.d.ts +1 -1
- package/lib/typescript/components/Devicon.d.ts +1 -1
- package/lib/typescript/components/DeviconPlain.d.ts +1 -1
- package/lib/typescript/components/DinkieIcons.d.ts +1 -1
- package/lib/typescript/components/DuoIcons.d.ts +1 -1
- package/lib/typescript/components/Ei.d.ts +1 -1
- package/lib/typescript/components/El.d.ts +1 -1
- package/lib/typescript/components/EmojioneMonotone.d.ts +1 -1
- package/lib/typescript/components/Entypo.d.ts +1 -1
- package/lib/typescript/components/EntypoSocial.d.ts +1 -1
- package/lib/typescript/components/EosIcons.d.ts +1 -1
- package/lib/typescript/components/Ep.d.ts +1 -1
- package/lib/typescript/components/Et.d.ts +1 -1
- package/lib/typescript/components/Eva.d.ts +1 -1
- package/lib/typescript/components/F7.d.ts +1 -1
- package/lib/typescript/components/Fa.d.ts +1 -1
- package/lib/typescript/components/Fa6Brands.d.ts +1 -1
- package/lib/typescript/components/Fa6Regular.d.ts +1 -1
- package/lib/typescript/components/Fa6Solid.d.ts +1 -1
- package/lib/typescript/components/Fa7Brands.d.ts +1 -1
- package/lib/typescript/components/Fa7Regular.d.ts +1 -1
- package/lib/typescript/components/Fa7Solid.d.ts +1 -1
- package/lib/typescript/components/FaBrands.d.ts +1 -1
- package/lib/typescript/components/FaRegular.d.ts +1 -1
- package/lib/typescript/components/FaSolid.d.ts +1 -1
- package/lib/typescript/components/Fad.d.ts +1 -1
- package/lib/typescript/components/Famicons.d.ts +1 -1
- package/lib/typescript/components/Fe.d.ts +1 -1
- package/lib/typescript/components/Feather.d.ts +1 -1
- package/lib/typescript/components/FileIcons.d.ts +1 -1
- package/lib/typescript/components/Flag.d.ts +1 -1
- package/lib/typescript/components/Flagpack.d.ts +1 -1
- package/lib/typescript/components/FlatUi.d.ts +1 -1
- package/lib/typescript/components/Flowbite.d.ts +1 -1
- package/lib/typescript/components/Fluent.d.ts +1 -1
- package/lib/typescript/components/FluentColor.d.ts +1 -1
- package/lib/typescript/components/FluentEmoji.d.ts +1 -1
- package/lib/typescript/components/FluentEmojiFlat.d.ts +1 -1
- package/lib/typescript/components/FluentEmojiHighContrast.d.ts +1 -1
- package/lib/typescript/components/FluentMdl2.d.ts +1 -1
- package/lib/typescript/components/Fontelico.d.ts +1 -1
- package/lib/typescript/components/Fontisto.d.ts +1 -1
- package/lib/typescript/components/Formkit.d.ts +1 -1
- package/lib/typescript/components/Foundation.d.ts +1 -1
- package/lib/typescript/components/Gala.d.ts +1 -1
- package/lib/typescript/components/GameIcons.d.ts +1 -1
- package/lib/typescript/components/Garden.d.ts +1 -1
- package/lib/typescript/components/Geo.d.ts +1 -1
- package/lib/typescript/components/Gg.d.ts +1 -1
- package/lib/typescript/components/Gis.d.ts +1 -1
- package/lib/typescript/components/GravityUi.d.ts +1 -1
- package/lib/typescript/components/Gridicons.d.ts +1 -1
- package/lib/typescript/components/GrommetIcons.d.ts +1 -1
- package/lib/typescript/components/Guidance.d.ts +1 -1
- package/lib/typescript/components/Healthicons.d.ts +1 -1
- package/lib/typescript/components/Heroicons.d.ts +1 -1
- package/lib/typescript/components/HeroiconsOutline.d.ts +1 -1
- package/lib/typescript/components/HeroiconsSolid.d.ts +1 -1
- package/lib/typescript/components/Hugeicons.d.ts +1 -1
- package/lib/typescript/components/Humbleicons.d.ts +1 -1
- package/lib/typescript/components/Ic.d.ts +1 -1
- package/lib/typescript/components/IcomoonFree.d.ts +1 -1
- package/lib/typescript/components/IconPark.d.ts +1 -1
- package/lib/typescript/components/IconParkOutline.d.ts +1 -1
- package/lib/typescript/components/IconParkSolid.d.ts +1 -1
- package/lib/typescript/components/IconParkTwotone.d.ts +1 -1
- package/lib/typescript/components/Iconamoon.d.ts +1 -1
- package/lib/typescript/components/Iconoir.d.ts +1 -1
- package/lib/typescript/components/Icons8.d.ts +1 -1
- package/lib/typescript/components/Il.d.ts +1 -1
- package/lib/typescript/components/Ion.d.ts +1 -1
- package/lib/typescript/components/Iwwa.d.ts +1 -1
- package/lib/typescript/components/Ix.d.ts +1 -1
- package/lib/typescript/components/Jam.d.ts +1 -1
- package/lib/typescript/components/La.d.ts +1 -1
- package/lib/typescript/components/LetsIcons.d.ts +1 -1
- package/lib/typescript/components/LineMd.d.ts +1 -1
- package/lib/typescript/components/Lineicons.d.ts +1 -1
- package/lib/typescript/components/Logos.d.ts +1 -1
- package/lib/typescript/components/Ls.d.ts +1 -1
- package/lib/typescript/components/Lsicon.d.ts +1 -1
- package/lib/typescript/components/Lucide.d.ts +1 -1
- package/lib/typescript/components/LucideLab.d.ts +1 -1
- package/lib/typescript/components/Mage.d.ts +1 -1
- package/lib/typescript/components/Majesticons.d.ts +1 -1
- package/lib/typescript/components/Maki.d.ts +1 -1
- package/lib/typescript/components/Map.d.ts +1 -1
- package/lib/typescript/components/Marketeq.d.ts +1 -1
- package/lib/typescript/components/MaterialIconTheme.d.ts +1 -1
- package/lib/typescript/components/MaterialSymbols.d.ts +1 -1
- package/lib/typescript/components/MaterialSymbolsLight.d.ts +1 -1
- package/lib/typescript/components/Mdi.d.ts +1 -1
- package/lib/typescript/components/MdiLight.d.ts +1 -1
- package/lib/typescript/components/MedicalIcon.d.ts +1 -1
- package/lib/typescript/components/Memory.d.ts +1 -1
- package/lib/typescript/components/Meteocons.d.ts +1 -1
- package/lib/typescript/components/MeteorIcons.d.ts +1 -1
- package/lib/typescript/components/Mi.d.ts +1 -1
- package/lib/typescript/components/Mingcute.d.ts +1 -1
- package/lib/typescript/components/MonoIcons.d.ts +1 -1
- package/lib/typescript/components/Mynaui.d.ts +1 -1
- package/lib/typescript/components/Nimbus.d.ts +1 -1
- package/lib/typescript/components/Nonicons.d.ts +1 -1
- package/lib/typescript/components/Nrk.d.ts +1 -1
- package/lib/typescript/components/Octicon.d.ts +1 -1
- package/lib/typescript/components/Oi.d.ts +1 -1
- package/lib/typescript/components/Ooui.d.ts +1 -1
- package/lib/typescript/components/Oui.d.ts +1 -1
- package/lib/typescript/components/Pajamas.d.ts +1 -1
- package/lib/typescript/components/Pepicons.d.ts +1 -1
- package/lib/typescript/components/PepiconsPencil.d.ts +1 -1
- package/lib/typescript/components/PepiconsPop.d.ts +1 -1
- package/lib/typescript/components/PepiconsPrint.d.ts +1 -1
- package/lib/typescript/components/Ph.d.ts +1 -1
- package/lib/typescript/components/Picon.d.ts +1 -1
- package/lib/typescript/components/Pixel.d.ts +1 -1
- package/lib/typescript/components/Pixelarticons.d.ts +1 -1
- package/lib/typescript/components/Prime.d.ts +1 -1
- package/lib/typescript/components/Proicons.d.ts +1 -1
- package/lib/typescript/components/Ps.d.ts +1 -1
- package/lib/typescript/components/QlementineIcons.d.ts +1 -1
- package/lib/typescript/components/Quill.d.ts +1 -1
- package/lib/typescript/components/RadixIcons.d.ts +1 -1
- package/lib/typescript/components/Raphael.d.ts +1 -1
- package/lib/typescript/components/Ri.d.ts +1 -1
- package/lib/typescript/components/RivetIcons.d.ts +1 -1
- package/lib/typescript/components/Roentgen.d.ts +1 -1
- package/lib/typescript/components/Si.d.ts +1 -1
- package/lib/typescript/components/SiGlyph.d.ts +1 -1
- package/lib/typescript/components/Sidekickicons.d.ts +1 -1
- package/lib/typescript/components/SimpleIcons.d.ts +1 -1
- package/lib/typescript/components/SimpleLineIcons.d.ts +1 -1
- package/lib/typescript/components/SkillIcons.d.ts +1 -1
- package/lib/typescript/components/Solar.d.ts +1 -1
- package/lib/typescript/components/Stash.d.ts +1 -1
- package/lib/typescript/components/Streamline.d.ts +1 -1
- package/lib/typescript/components/StreamlineBlock.d.ts +1 -1
- package/lib/typescript/components/StreamlineColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineCyber.d.ts +1 -1
- package/lib/typescript/components/StreamlineCyberColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineEmojis.d.ts +1 -1
- package/lib/typescript/components/StreamlineFlex.d.ts +1 -1
- package/lib/typescript/components/StreamlineFlexColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineFreehand.d.ts +1 -1
- package/lib/typescript/components/StreamlineFreehandColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineKameleonColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineLogos.d.ts +1 -1
- package/lib/typescript/components/StreamlinePixel.d.ts +1 -1
- package/lib/typescript/components/StreamlinePlump.d.ts +1 -1
- package/lib/typescript/components/StreamlinePlumpColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineSharp.d.ts +1 -1
- package/lib/typescript/components/StreamlineSharpColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineStickiesColor.d.ts +1 -1
- package/lib/typescript/components/StreamlineUltimate.d.ts +1 -1
- package/lib/typescript/components/StreamlineUltimateColor.d.ts +1 -1
- package/lib/typescript/components/Subway.d.ts +1 -1
- package/lib/typescript/components/SvgSpinners.d.ts +1 -1
- package/lib/typescript/components/SystemUicons.d.ts +1 -1
- package/lib/typescript/components/Tabler.d.ts +1 -1
- package/lib/typescript/components/Tdesign.d.ts +1 -1
- package/lib/typescript/components/Teenyicons.d.ts +1 -1
- package/lib/typescript/components/Temaki.d.ts +1 -1
- package/lib/typescript/components/Token.d.ts +1 -1
- package/lib/typescript/components/TokenBranded.d.ts +1 -1
- package/lib/typescript/components/Topcoat.d.ts +1 -1
- package/lib/typescript/components/Typcn.d.ts +1 -1
- package/lib/typescript/components/Uil.d.ts +1 -1
- package/lib/typescript/components/Uim.d.ts +1 -1
- package/lib/typescript/components/Uis.d.ts +1 -1
- package/lib/typescript/components/Uit.d.ts +1 -1
- package/lib/typescript/components/Uiw.d.ts +1 -1
- package/lib/typescript/components/Unjs.d.ts +1 -1
- package/lib/typescript/components/Vaadin.d.ts +1 -1
- package/lib/typescript/components/Vs.d.ts +1 -1
- package/lib/typescript/components/VscodeIcons.d.ts +1 -1
- package/lib/typescript/components/Websymbol.d.ts +1 -1
- package/lib/typescript/components/Weui.d.ts +1 -1
- package/lib/typescript/components/Whh.d.ts +1 -1
- package/lib/typescript/components/Wi.d.ts +1 -1
- package/lib/typescript/components/Wpf.d.ts +1 -1
- package/lib/typescript/components/Zmdi.d.ts +1 -1
- package/lib/typescript/components/Zondicons.d.ts +1 -1
- package/lib/typescript/components/index.d.ts +38 -1
- package/lib/typescript/components/index.d.ts.map +1 -1
- package/lib/typescript/config/ConfigManager.d.ts +102 -0
- package/lib/typescript/config/ConfigManager.d.ts.map +1 -0
- package/lib/typescript/config/index.d.ts +22 -0
- package/lib/typescript/config/index.d.ts.map +1 -0
- package/lib/typescript/config/types.d.ts +112 -0
- package/lib/typescript/config/types.d.ts.map +1 -0
- package/lib/typescript/createIconSet.d.ts +1 -1
- package/lib/typescript/createIconSet.d.ts.map +1 -1
- package/lib/typescript/explorer/IconExplorer.d.ts +54 -0
- package/lib/typescript/explorer/IconExplorer.d.ts.map +1 -0
- package/lib/typescript/explorer/iconSets.d.ts +35 -0
- package/lib/typescript/explorer/iconSets.d.ts.map +1 -0
- package/lib/typescript/explorer/index.d.ts +33 -0
- package/lib/typescript/explorer/index.d.ts.map +1 -0
- package/lib/typescript/explorer/types.d.ts +329 -0
- package/lib/typescript/explorer/types.d.ts.map +1 -0
- package/lib/typescript/explorer/useExplorer.d.ts +18 -0
- package/lib/typescript/explorer/useExplorer.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +25 -4
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/navigation/createDrawerIcon.d.ts +74 -0
- package/lib/typescript/navigation/createDrawerIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/createHeaderIcon.d.ts +145 -0
- package/lib/typescript/navigation/createHeaderIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/createTabBarIcon.d.ts +99 -0
- package/lib/typescript/navigation/createTabBarIcon.d.ts.map +1 -0
- package/lib/typescript/navigation/index.d.ts +51 -0
- package/lib/typescript/navigation/index.d.ts.map +1 -0
- package/lib/typescript/navigation/types.d.ts +149 -0
- package/lib/typescript/navigation/types.d.ts.map +1 -0
- package/lib/typescript/navigation/useNavigationIcon.d.ts +91 -0
- package/lib/typescript/navigation/useNavigationIcon.d.ts.map +1 -0
- package/lib/typescript/network/IconifyAPI.d.ts +32 -0
- package/lib/typescript/network/IconifyAPI.d.ts.map +1 -1
- package/lib/typescript/network/index.d.ts +2 -1
- package/lib/typescript/network/index.d.ts.map +1 -1
- package/lib/typescript/performance/PerformanceMonitor.d.ts +76 -0
- package/lib/typescript/performance/PerformanceMonitor.d.ts.map +1 -0
- package/lib/typescript/performance/index.d.ts +21 -0
- package/lib/typescript/performance/index.d.ts.map +1 -0
- package/lib/typescript/performance/types.d.ts +156 -0
- package/lib/typescript/performance/types.d.ts.map +1 -0
- package/lib/typescript/placeholder/PlaceholderFactory.d.ts +44 -0
- package/lib/typescript/placeholder/PlaceholderFactory.d.ts.map +1 -0
- package/lib/typescript/placeholder/Pulse.d.ts +18 -0
- package/lib/typescript/placeholder/Pulse.d.ts.map +1 -0
- package/lib/typescript/placeholder/Shimmer.d.ts +19 -0
- package/lib/typescript/placeholder/Shimmer.d.ts.map +1 -0
- package/lib/typescript/placeholder/Skeleton.d.ts +18 -0
- package/lib/typescript/placeholder/Skeleton.d.ts.map +1 -0
- package/lib/typescript/placeholder/index.d.ts +12 -0
- package/lib/typescript/placeholder/index.d.ts.map +1 -0
- package/lib/typescript/placeholder/types.d.ts +63 -0
- package/lib/typescript/placeholder/types.d.ts.map +1 -0
- package/lib/typescript/theme/IconThemeProvider.d.ts +64 -0
- package/lib/typescript/theme/IconThemeProvider.d.ts.map +1 -0
- package/lib/typescript/theme/context.d.ts +24 -0
- package/lib/typescript/theme/context.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +10 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/theme/types.d.ts +85 -0
- package/lib/typescript/theme/types.d.ts.map +1 -0
- package/lib/typescript/theme/useIconTheme.d.ts +78 -0
- package/lib/typescript/theme/useIconTheme.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +58 -1
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/package.json +41 -3
- package/src/IconRenderer.tsx +91 -4
- package/src/accessibility/AccessibilityProvider.tsx +220 -0
- package/src/accessibility/index.ts +63 -0
- package/src/accessibility/types.ts +152 -0
- package/src/accessibility/useAccessibleIcon.ts +220 -0
- package/src/accessibility/utils.ts +180 -0
- package/src/alias/Icon.tsx +113 -0
- package/src/alias/IconAliasContext.tsx +180 -0
- package/src/alias/createIconAliases.tsx +233 -0
- package/src/alias/index.ts +59 -0
- package/src/alias/types.ts +132 -0
- package/src/animated/AnimatedIcon.tsx +116 -0
- package/src/animated/index.ts +97 -0
- package/src/animated/presets.ts +211 -0
- package/src/animated/types.ts +239 -0
- package/src/animated/useIconAnimation.ts +383 -0
- package/src/babel/ast-utils.ts +219 -0
- package/src/babel/cache-writer.ts +323 -0
- package/src/babel/collector.ts +224 -0
- package/src/babel/index.ts +60 -0
- package/src/babel/plugin.ts +254 -0
- package/src/babel/types.ts +717 -0
- package/src/bundle/index.ts +313 -0
- package/src/cache/CacheManager.ts +123 -6
- package/src/cli/commands/analyze.ts +195 -0
- package/src/cli/commands/bundle.ts +231 -0
- package/src/cli/index.ts +153 -0
- package/src/cli/parser.ts +275 -0
- package/src/cli/types.ts +187 -0
- package/src/components/index.ts +52 -1
- package/src/config/ConfigManager.ts +196 -0
- package/src/config/index.ts +34 -0
- package/src/config/types.ts +149 -0
- package/src/createIconSet.tsx +48 -9
- package/src/explorer/IconExplorer.tsx +844 -0
- package/src/explorer/iconSets.ts +334 -0
- package/src/explorer/index.ts +64 -0
- package/src/explorer/types.ts +392 -0
- package/src/explorer/useExplorer.ts +390 -0
- package/src/index.ts +218 -9
- package/src/navigation/createDrawerIcon.tsx +113 -0
- package/src/navigation/createHeaderIcon.tsx +213 -0
- package/src/navigation/createTabBarIcon.tsx +180 -0
- package/src/navigation/index.ts +80 -0
- package/src/navigation/types.ts +155 -0
- package/src/navigation/useNavigationIcon.tsx +156 -0
- package/src/network/IconifyAPI.ts +182 -14
- package/src/network/index.ts +11 -1
- package/src/performance/PerformanceMonitor.ts +367 -0
- package/src/performance/index.ts +39 -0
- package/src/performance/types.ts +185 -0
- package/src/placeholder/PlaceholderFactory.tsx +133 -0
- package/src/placeholder/Pulse.tsx +86 -0
- package/src/placeholder/Shimmer.tsx +104 -0
- package/src/placeholder/Skeleton.tsx +52 -0
- package/src/placeholder/index.ts +21 -0
- package/src/placeholder/types.ts +78 -0
- package/src/theme/IconThemeProvider.tsx +94 -0
- package/src/theme/context.ts +51 -0
- package/src/theme/index.ts +19 -0
- package/src/theme/types.ts +108 -0
- package/src/theme/useIconTheme.ts +119 -0
- package/src/types/index.ts +78 -1
- package/lib/commonjs/components/Phosphor.js +0 -493
- package/lib/commonjs/components/Phosphor.js.map +0 -1
- package/lib/module/components/Phosphor.js +0 -488
- package/lib/module/components/Phosphor.js.map +0 -1
- package/lib/typescript/components/Phosphor.d.ts +0 -472
- package/lib/typescript/components/Phosphor.d.ts.map +0 -1
- package/src/components/Phosphor.tsx +0 -506
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bundle Command
|
|
3
|
+
* Fetches icons and creates an offline bundle file
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
import { EXIT_CODES } from '../types';
|
|
9
|
+
import { analyzeDirectory, getUniqueIcons, parseIconList } from '../parser';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Iconify API base URL
|
|
13
|
+
*/
|
|
14
|
+
const ICONIFY_API = 'https://api.iconify.design';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Fetch timeout in milliseconds
|
|
18
|
+
*/
|
|
19
|
+
const FETCH_TIMEOUT = 30000;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Fetch multiple icons with batching
|
|
23
|
+
*/
|
|
24
|
+
async function fetchIcons(icons, verbose, onProgress) {
|
|
25
|
+
const results = {};
|
|
26
|
+
|
|
27
|
+
// Group by prefix for batch fetching
|
|
28
|
+
const byPrefix = new Map();
|
|
29
|
+
for (const icon of icons) {
|
|
30
|
+
const [prefix, name] = icon.split(':');
|
|
31
|
+
if (!byPrefix.has(prefix)) {
|
|
32
|
+
byPrefix.set(prefix, []);
|
|
33
|
+
}
|
|
34
|
+
byPrefix.get(prefix).push(name);
|
|
35
|
+
}
|
|
36
|
+
let processed = 0;
|
|
37
|
+
const total = icons.length;
|
|
38
|
+
|
|
39
|
+
// Fetch each prefix batch
|
|
40
|
+
for (const [prefix, names] of byPrefix) {
|
|
41
|
+
try {
|
|
42
|
+
const controller = new AbortController();
|
|
43
|
+
const timeout = setTimeout(() => controller.abort(), FETCH_TIMEOUT);
|
|
44
|
+
|
|
45
|
+
// Sort names alphabetically (Iconify best practice)
|
|
46
|
+
const sortedNames = [...names].sort();
|
|
47
|
+
const url = `${ICONIFY_API}/${prefix}.json?icons=${sortedNames.join(',')}`;
|
|
48
|
+
if (verbose) {
|
|
49
|
+
console.log(` Fetching ${sortedNames.length} icons from ${prefix}...`);
|
|
50
|
+
}
|
|
51
|
+
const response = await fetch(url, {
|
|
52
|
+
signal: controller.signal
|
|
53
|
+
});
|
|
54
|
+
clearTimeout(timeout);
|
|
55
|
+
if (!response.ok) {
|
|
56
|
+
console.error(` Failed to fetch ${prefix}: ${response.status}`);
|
|
57
|
+
processed += names.length;
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
const data = await response.json();
|
|
61
|
+
const defaultWidth = data.width ?? 24;
|
|
62
|
+
const defaultHeight = data.height ?? 24;
|
|
63
|
+
for (const name of names) {
|
|
64
|
+
const iconData = data.icons?.[name];
|
|
65
|
+
if (iconData) {
|
|
66
|
+
const width = iconData.width ?? defaultWidth;
|
|
67
|
+
const height = iconData.height ?? defaultHeight;
|
|
68
|
+
const body = iconData.body;
|
|
69
|
+
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 ${width} ${height}">${body}</svg>`;
|
|
70
|
+
results[`${prefix}:${name}`] = {
|
|
71
|
+
svg,
|
|
72
|
+
width,
|
|
73
|
+
height
|
|
74
|
+
};
|
|
75
|
+
} else if (verbose) {
|
|
76
|
+
console.error(` Icon not found: ${prefix}:${name}`);
|
|
77
|
+
}
|
|
78
|
+
processed++;
|
|
79
|
+
onProgress?.(processed, total);
|
|
80
|
+
}
|
|
81
|
+
} catch (error) {
|
|
82
|
+
if (verbose) {
|
|
83
|
+
console.error(` Error fetching ${prefix}:`, error);
|
|
84
|
+
}
|
|
85
|
+
processed += names.length;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return results;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Bundle command implementation
|
|
93
|
+
*/
|
|
94
|
+
export async function bundleCommand(options) {
|
|
95
|
+
const {
|
|
96
|
+
src = './src',
|
|
97
|
+
output = './assets/icons.bundle.json',
|
|
98
|
+
auto = true,
|
|
99
|
+
icons: manualIcons,
|
|
100
|
+
exclude = [],
|
|
101
|
+
verbose = false,
|
|
102
|
+
pretty = false
|
|
103
|
+
} = options;
|
|
104
|
+
console.log('\n📦 rn-iconify Bundle Generator\n');
|
|
105
|
+
let iconsToBundle = [];
|
|
106
|
+
|
|
107
|
+
// Auto-detect icons from source
|
|
108
|
+
if (auto) {
|
|
109
|
+
console.log(`🔍 Analyzing source code in ${src}...`);
|
|
110
|
+
const analysis = analyzeDirectory(src, verbose);
|
|
111
|
+
if (analysis.totalIcons === 0) {
|
|
112
|
+
console.log('⚠️ No icons found in source code.');
|
|
113
|
+
} else {
|
|
114
|
+
console.log(` Found ${analysis.totalIcons} unique icons\n`);
|
|
115
|
+
iconsToBundle = getUniqueIcons(analysis);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// Add manual icons
|
|
120
|
+
if (manualIcons) {
|
|
121
|
+
const parsed = parseIconList(manualIcons);
|
|
122
|
+
console.log(`📋 Adding ${parsed.length} manual icons...`);
|
|
123
|
+
for (const icon of parsed) {
|
|
124
|
+
if (!iconsToBundle.includes(icon)) {
|
|
125
|
+
iconsToBundle.push(icon);
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// Apply exclusions
|
|
131
|
+
if (exclude.length > 0) {
|
|
132
|
+
const beforeCount = iconsToBundle.length;
|
|
133
|
+
iconsToBundle = iconsToBundle.filter(icon => {
|
|
134
|
+
return !exclude.some(pattern => {
|
|
135
|
+
if (pattern.includes('*')) {
|
|
136
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*') + '$');
|
|
137
|
+
return regex.test(icon);
|
|
138
|
+
}
|
|
139
|
+
return icon === pattern;
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
if (verbose) {
|
|
143
|
+
console.log(` Excluded ${beforeCount - iconsToBundle.length} icons`);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
if (iconsToBundle.length === 0) {
|
|
147
|
+
console.error('\n❌ No icons to bundle.');
|
|
148
|
+
console.log(' Use --icons to specify icons manually or check your source code.\n');
|
|
149
|
+
return EXIT_CODES.ERROR;
|
|
150
|
+
}
|
|
151
|
+
console.log(`\n📥 Fetching ${iconsToBundle.length} icons from Iconify API...`);
|
|
152
|
+
|
|
153
|
+
// Progress indicator
|
|
154
|
+
let lastPercent = 0;
|
|
155
|
+
const onProgress = (current, total) => {
|
|
156
|
+
const percent = Math.floor(current / total * 100);
|
|
157
|
+
if (percent >= lastPercent + 10) {
|
|
158
|
+
lastPercent = percent;
|
|
159
|
+
process.stdout.write(` ${percent}%`);
|
|
160
|
+
if (percent < 100) process.stdout.write(' ');
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
const fetchedIcons = await fetchIcons(iconsToBundle, verbose, onProgress);
|
|
164
|
+
console.log('\n');
|
|
165
|
+
const fetchedCount = Object.keys(fetchedIcons).length;
|
|
166
|
+
const failedCount = iconsToBundle.length - fetchedCount;
|
|
167
|
+
if (failedCount > 0) {
|
|
168
|
+
console.log(`⚠️ Failed to fetch ${failedCount} icons`);
|
|
169
|
+
}
|
|
170
|
+
if (fetchedCount === 0) {
|
|
171
|
+
console.error('❌ No icons were fetched. Check your network connection.\n');
|
|
172
|
+
return EXIT_CODES.NETWORK_ERROR;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
// Create bundle
|
|
176
|
+
const bundle = {
|
|
177
|
+
version: '1.0.0',
|
|
178
|
+
generatedAt: new Date().toISOString(),
|
|
179
|
+
icons: fetchedIcons,
|
|
180
|
+
count: fetchedCount
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Ensure output directory exists
|
|
184
|
+
const outputDir = path.dirname(output);
|
|
185
|
+
if (!fs.existsSync(outputDir)) {
|
|
186
|
+
fs.mkdirSync(outputDir, {
|
|
187
|
+
recursive: true
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// Write bundle file
|
|
192
|
+
const jsonContent = pretty ? JSON.stringify(bundle, null, 2) : JSON.stringify(bundle);
|
|
193
|
+
fs.writeFileSync(output, jsonContent, 'utf-8');
|
|
194
|
+
|
|
195
|
+
// Calculate file size
|
|
196
|
+
const stats = fs.statSync(output);
|
|
197
|
+
const sizeKB = (stats.size / 1024).toFixed(2);
|
|
198
|
+
console.log(`✅ Bundle created successfully!`);
|
|
199
|
+
console.log(` Output: ${output}`);
|
|
200
|
+
console.log(` Icons: ${fetchedCount}`);
|
|
201
|
+
console.log(` Size: ${sizeKB} KB\n`);
|
|
202
|
+
console.log('💡 Usage:');
|
|
203
|
+
console.log(" import { loadOfflineBundle } from 'rn-iconify';");
|
|
204
|
+
console.log(` import bundle from '${output.replace(/^\.\//, './')}';`);
|
|
205
|
+
console.log(' loadOfflineBundle(bundle);\n');
|
|
206
|
+
return EXIT_CODES.SUCCESS;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","path","EXIT_CODES","analyzeDirectory","getUniqueIcons","parseIconList","ICONIFY_API","FETCH_TIMEOUT","fetchIcons","icons","verbose","onProgress","results","byPrefix","Map","icon","prefix","name","split","has","set","get","push","processed","total","length","names","controller","AbortController","timeout","setTimeout","abort","sortedNames","sort","url","join","console","log","response","fetch","signal","clearTimeout","ok","error","status","data","json","defaultWidth","width","defaultHeight","height","iconData","body","svg","bundleCommand","options","src","output","auto","manualIcons","exclude","pretty","iconsToBundle","analysis","totalIcons","parsed","includes","beforeCount","filter","some","pattern","regex","RegExp","replace","test","ERROR","lastPercent","current","percent","Math","floor","process","stdout","write","fetchedIcons","fetchedCount","Object","keys","failedCount","NETWORK_ERROR","bundle","version","generatedAt","Date","toISOString","count","outputDir","dirname","existsSync","mkdirSync","recursive","jsonContent","JSON","stringify","writeFileSync","stats","statSync","sizeKB","size","toFixed","SUCCESS"],"sourceRoot":"../../../../src","sources":["cli/commands/bundle.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,OAAO,KAAKC,IAAI,MAAM,MAAM;AAE5B,SAASC,UAAU,QAAQ,UAAU;AACrC,SAASC,gBAAgB,EAAEC,cAAc,EAAEC,aAAa,QAAQ,WAAW;;AAE3E;AACA;AACA;AACA,MAAMC,WAAW,GAAG,4BAA4B;;AAEhD;AACA;AACA;AACA,MAAMC,aAAa,GAAG,KAAK;;AAE3B;AACA;AACA;AACA,eAAeC,UAAUA,CACvBC,KAAe,EACfC,OAAgB,EAChBC,UAAqD,EACoB;EACzE,MAAMC,OAAuE,GAAG,CAAC,CAAC;;EAElF;EACA,MAAMC,QAAQ,GAAG,IAAIC,GAAG,CAAmB,CAAC;EAE5C,KAAK,MAAMC,IAAI,IAAIN,KAAK,EAAE;IACxB,MAAM,CAACO,MAAM,EAAEC,IAAI,CAAC,GAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC;IACtC,IAAI,CAACL,QAAQ,CAACM,GAAG,CAACH,MAAM,CAAC,EAAE;MACzBH,QAAQ,CAACO,GAAG,CAACJ,MAAM,EAAE,EAAE,CAAC;IAC1B;IACAH,QAAQ,CAACQ,GAAG,CAACL,MAAM,CAAC,CAAEM,IAAI,CAACL,IAAI,CAAC;EAClC;EAEA,IAAIM,SAAS,GAAG,CAAC;EACjB,MAAMC,KAAK,GAAGf,KAAK,CAACgB,MAAM;;EAE1B;EACA,KAAK,MAAM,CAACT,MAAM,EAAEU,KAAK,CAAC,IAAIb,QAAQ,EAAE;IACtC,IAAI;MACF,MAAMc,UAAU,GAAG,IAAIC,eAAe,CAAC,CAAC;MACxC,MAAMC,OAAO,GAAGC,UAAU,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
4
|
+
* Command-line tools for icon bundling and analysis
|
|
5
|
+
*/
|
|
6
|
+
import { bundleCommand } from './commands/bundle';
|
|
7
|
+
import { analyzeCommand } from './commands/analyze';
|
|
8
|
+
import { EXIT_CODES } from './types';
|
|
9
|
+
/**
|
|
10
|
+
* Package version
|
|
11
|
+
*/
|
|
12
|
+
const VERSION = '1.0.0';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Help text
|
|
16
|
+
*/
|
|
17
|
+
const HELP = `
|
|
18
|
+
📦 rn-iconify CLI v${VERSION}
|
|
19
|
+
|
|
20
|
+
Usage: npx rn-iconify <command> [options]
|
|
21
|
+
|
|
22
|
+
Commands:
|
|
23
|
+
bundle Generate offline icon bundle
|
|
24
|
+
analyze Analyze icon usage in source code
|
|
25
|
+
help Show this help message
|
|
26
|
+
version Show version
|
|
27
|
+
|
|
28
|
+
Examples:
|
|
29
|
+
npx rn-iconify bundle --auto --output ./assets/icons.json
|
|
30
|
+
npx rn-iconify bundle --icons "mdi:home,mdi:settings"
|
|
31
|
+
npx rn-iconify analyze --src ./src --format table
|
|
32
|
+
npx rn-iconify analyze --detailed
|
|
33
|
+
|
|
34
|
+
Bundle Options:
|
|
35
|
+
--src <path> Source directory to analyze (default: ./src)
|
|
36
|
+
--output <path> Output file path (default: ./assets/icons.bundle.json)
|
|
37
|
+
--auto Auto-detect icons from source code (default: true)
|
|
38
|
+
--icons <list> Comma-separated list of icons to include
|
|
39
|
+
--exclude <list> Comma-separated patterns to exclude
|
|
40
|
+
--verbose Show detailed output
|
|
41
|
+
--pretty Pretty-print JSON output
|
|
42
|
+
|
|
43
|
+
Analyze Options:
|
|
44
|
+
--src <path> Source directory to analyze (default: ./src)
|
|
45
|
+
--format <type> Output format: table, json, markdown (default: table)
|
|
46
|
+
--detailed Show file locations for each icon
|
|
47
|
+
--verbose Show detailed output
|
|
48
|
+
|
|
49
|
+
More info: https://github.com/mogretici/rn-iconify
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Parse command line arguments
|
|
54
|
+
*/
|
|
55
|
+
function parseArgs(args) {
|
|
56
|
+
const command = args[0] || 'help';
|
|
57
|
+
const options = {};
|
|
58
|
+
for (let i = 1; i < args.length; i++) {
|
|
59
|
+
const arg = args[i];
|
|
60
|
+
if (arg.startsWith('--')) {
|
|
61
|
+
const key = arg.slice(2);
|
|
62
|
+
const nextArg = args[i + 1];
|
|
63
|
+
|
|
64
|
+
// Boolean flags
|
|
65
|
+
if (!nextArg || nextArg.startsWith('--') || key === 'auto' || key === 'verbose' || key === 'pretty' || key === 'detailed') {
|
|
66
|
+
options[key] = true;
|
|
67
|
+
} else {
|
|
68
|
+
options[key] = nextArg;
|
|
69
|
+
i++;
|
|
70
|
+
}
|
|
71
|
+
} else if (arg.startsWith('-')) {
|
|
72
|
+
// Short flags
|
|
73
|
+
const key = arg.slice(1);
|
|
74
|
+
options[key] = true;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return {
|
|
78
|
+
command,
|
|
79
|
+
options
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Main CLI entry point
|
|
85
|
+
*/
|
|
86
|
+
async function main() {
|
|
87
|
+
const args = process.argv.slice(2);
|
|
88
|
+
const {
|
|
89
|
+
command,
|
|
90
|
+
options
|
|
91
|
+
} = parseArgs(args);
|
|
92
|
+
switch (command) {
|
|
93
|
+
case 'bundle':
|
|
94
|
+
{
|
|
95
|
+
const bundleOptions = {
|
|
96
|
+
src: options.src,
|
|
97
|
+
output: options.output,
|
|
98
|
+
auto: options.auto !== false,
|
|
99
|
+
icons: options.icons,
|
|
100
|
+
exclude: options.exclude ? options.exclude.split(',') : undefined,
|
|
101
|
+
verbose: options.verbose,
|
|
102
|
+
pretty: options.pretty
|
|
103
|
+
};
|
|
104
|
+
const exitCode = await bundleCommand(bundleOptions);
|
|
105
|
+
process.exit(exitCode);
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
case 'analyze':
|
|
109
|
+
{
|
|
110
|
+
const analyzeOptions = {
|
|
111
|
+
src: options.src,
|
|
112
|
+
format: options.format,
|
|
113
|
+
detailed: options.detailed,
|
|
114
|
+
verbose: options.verbose
|
|
115
|
+
};
|
|
116
|
+
const exitCode = analyzeCommand(analyzeOptions);
|
|
117
|
+
process.exit(exitCode);
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
case 'version':
|
|
121
|
+
case '-v':
|
|
122
|
+
case '--version':
|
|
123
|
+
console.log(`rn-iconify v${VERSION}`);
|
|
124
|
+
process.exit(EXIT_CODES.SUCCESS);
|
|
125
|
+
break;
|
|
126
|
+
case 'help':
|
|
127
|
+
case '-h':
|
|
128
|
+
case '--help':
|
|
129
|
+
default:
|
|
130
|
+
console.log(HELP);
|
|
131
|
+
process.exit(command === 'help' ? EXIT_CODES.SUCCESS : EXIT_CODES.INVALID_ARGS);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Run CLI
|
|
136
|
+
main().catch(error => {
|
|
137
|
+
console.error('Error:', error.message);
|
|
138
|
+
process.exit(EXIT_CODES.ERROR);
|
|
139
|
+
});
|
|
140
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["bundleCommand","analyzeCommand","EXIT_CODES","VERSION","HELP","parseArgs","args","command","options","i","length","arg","startsWith","key","slice","nextArg","main","process","argv","bundleOptions","src","output","auto","icons","exclude","split","undefined","verbose","pretty","exitCode","exit","analyzeOptions","format","detailed","console","log","SUCCESS","INVALID_ARGS","catch","error","message","ERROR"],"sourceRoot":"../../../src","sources":["cli/index.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AAEA,SAASA,aAAa,QAAQ,mBAAmB;AACjD,SAASC,cAAc,QAAQ,oBAAoB;AACnD,SAASC,UAAU,QAAQ,SAAS;AAGpC;AACA;AACA;AACA,MAAMC,OAAO,GAAG,OAA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c,OAAO,CAACa,IAAI,CAAC5B,UAAU,CAACkC,OAAO,CAAC;MAChC;IAEF,KAAK,MAAM;IACX,KAAK,IAAI;IACT,KAAK,QAAQ;IACb;MACEF,OAAO,CAACC,GAAG,CAAC/B,IAAI,CAAC;MACjBa,OAAO,CAACa,IAAI,CAACvB,OAAO,KAAK,MAAM,GAAGL,UAAU,CAACkC,OAAO,GAAGlC,UAAU,CAACmC,YAAY,CAAC;EACnF;AACF;;AAEA;AACArB,IAAI,CAAC,CAAC,CAACsB,KAAK,CAAEC,KAAK,IAAK;EACtBL,OAAO,CAACK,KAAK,CAAC,QAAQ,EAAEA,KAAK,CAACC,OAAO,CAAC;EACtCvB,OAAO,CAACa,IAAI,CAAC5B,UAAU,CAACuC,KAAK,CAAC;AAChC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon Usage Parser
|
|
3
|
+
* Analyzes source code to find icon usage patterns
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import * as fs from 'fs';
|
|
7
|
+
import * as path from 'path';
|
|
8
|
+
/**
|
|
9
|
+
* File extensions to analyze
|
|
10
|
+
*/
|
|
11
|
+
const ANALYZABLE_EXTENSIONS = ['.tsx', '.jsx', '.ts', '.js'];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Regex patterns for finding icon usage
|
|
15
|
+
*/
|
|
16
|
+
const PATTERNS = {
|
|
17
|
+
// JSX component usage: <Mdi name="home" /> or <Mdi name='home' />
|
|
18
|
+
jsxComponent: /<(\w+)\s+[^>]*name\s*=\s*["']([^"']+)["'][^>]*\/?>/g,
|
|
19
|
+
// Import statement to find component names
|
|
20
|
+
iconImport: /import\s*{([^}]+)}\s*from\s*['"]rn-iconify['"]/g,
|
|
21
|
+
// prefetchIcons usage: prefetchIcons(['mdi:home', 'mdi:settings'])
|
|
22
|
+
prefetchIcons: /prefetchIcons\s*\(\s*\[([^\]]+)\]/g,
|
|
23
|
+
// String icon names in arrays or objects: 'mdi:home' or "mdi:home"
|
|
24
|
+
iconString: /['"](\w+:[^'"]+)['"]/g
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Map of component names to icon prefixes
|
|
29
|
+
*/
|
|
30
|
+
const COMPONENT_PREFIX_MAP = {
|
|
31
|
+
Mdi: 'mdi',
|
|
32
|
+
MdiLight: 'mdi-light',
|
|
33
|
+
Heroicons: 'heroicons',
|
|
34
|
+
Lucide: 'lucide',
|
|
35
|
+
Ph: 'ph',
|
|
36
|
+
Feather: 'feather',
|
|
37
|
+
Tabler: 'tabler',
|
|
38
|
+
Bi: 'bi',
|
|
39
|
+
Fa6Solid: 'fa6-solid',
|
|
40
|
+
Fa6Regular: 'fa6-regular',
|
|
41
|
+
Fa6Brands: 'fa6-brands',
|
|
42
|
+
Fa7Solid: 'fa7-solid',
|
|
43
|
+
Ri: 'ri',
|
|
44
|
+
Carbon: 'carbon',
|
|
45
|
+
Fluent: 'fluent',
|
|
46
|
+
MaterialSymbols: 'material-symbols',
|
|
47
|
+
Solar: 'solar',
|
|
48
|
+
Ion: 'ion',
|
|
49
|
+
AntDesign: 'ant-design'
|
|
50
|
+
// Add more mappings as needed
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Get all files recursively from a directory
|
|
55
|
+
*/
|
|
56
|
+
function getFilesRecursively(dir, files = []) {
|
|
57
|
+
if (!fs.existsSync(dir)) {
|
|
58
|
+
return files;
|
|
59
|
+
}
|
|
60
|
+
const entries = fs.readdirSync(dir, {
|
|
61
|
+
withFileTypes: true
|
|
62
|
+
});
|
|
63
|
+
for (const entry of entries) {
|
|
64
|
+
const fullPath = path.join(dir, entry.name);
|
|
65
|
+
|
|
66
|
+
// Skip node_modules and hidden directories
|
|
67
|
+
if (entry.name.startsWith('.') || entry.name === 'node_modules') {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
if (entry.isDirectory()) {
|
|
71
|
+
getFilesRecursively(fullPath, files);
|
|
72
|
+
} else if (ANALYZABLE_EXTENSIONS.includes(path.extname(entry.name))) {
|
|
73
|
+
files.push(fullPath);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
return files;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Parse a single file for icon usage
|
|
81
|
+
*/
|
|
82
|
+
function parseFile(filePath, verbose = false) {
|
|
83
|
+
const usageMap = new Map();
|
|
84
|
+
try {
|
|
85
|
+
const content = fs.readFileSync(filePath, 'utf-8');
|
|
86
|
+
const lines = content.split('\n');
|
|
87
|
+
|
|
88
|
+
// Track which icon components are imported
|
|
89
|
+
const importedComponents = new Set();
|
|
90
|
+
|
|
91
|
+
// Find imports from rn-iconify
|
|
92
|
+
let importMatch;
|
|
93
|
+
PATTERNS.iconImport.lastIndex = 0;
|
|
94
|
+
while ((importMatch = PATTERNS.iconImport.exec(content)) !== null) {
|
|
95
|
+
const imports = importMatch[1].split(',').map(s => s.trim());
|
|
96
|
+
imports.forEach(imp => {
|
|
97
|
+
// Handle renamed imports: Mdi as Icon
|
|
98
|
+
const name = imp.split(/\s+as\s+/)[0].trim();
|
|
99
|
+
if (COMPONENT_PREFIX_MAP[name]) {
|
|
100
|
+
importedComponents.add(name);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
// Find JSX component usage
|
|
106
|
+
for (let lineIndex = 0; lineIndex < lines.length; lineIndex++) {
|
|
107
|
+
const line = lines[lineIndex];
|
|
108
|
+
const lineNum = lineIndex + 1;
|
|
109
|
+
|
|
110
|
+
// Match <ComponentName name="iconName" />
|
|
111
|
+
for (const componentName of importedComponents) {
|
|
112
|
+
const componentRegex = new RegExp(`<${componentName}\\s+[^>]*name\\s*=\\s*["']([^"']+)["']`, 'g');
|
|
113
|
+
let match;
|
|
114
|
+
while ((match = componentRegex.exec(line)) !== null) {
|
|
115
|
+
const iconName = match[1];
|
|
116
|
+
const prefix = COMPONENT_PREFIX_MAP[componentName];
|
|
117
|
+
const fullIconName = `${prefix}:${iconName}`;
|
|
118
|
+
const column = match.index + 1;
|
|
119
|
+
if (!usageMap.has(fullIconName)) {
|
|
120
|
+
usageMap.set(fullIconName, {
|
|
121
|
+
icon: fullIconName,
|
|
122
|
+
count: 0,
|
|
123
|
+
locations: []
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
const usage = usageMap.get(fullIconName);
|
|
127
|
+
usage.count++;
|
|
128
|
+
usage.locations.push({
|
|
129
|
+
file: filePath,
|
|
130
|
+
line: lineNum,
|
|
131
|
+
column
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// Match prefetchIcons and direct string patterns
|
|
137
|
+
PATTERNS.iconString.lastIndex = 0;
|
|
138
|
+
let stringMatch;
|
|
139
|
+
while ((stringMatch = PATTERNS.iconString.exec(line)) !== null) {
|
|
140
|
+
const iconName = stringMatch[1];
|
|
141
|
+
|
|
142
|
+
// Validate icon name format (prefix:name)
|
|
143
|
+
if (iconName.includes(':') && !iconName.includes('/')) {
|
|
144
|
+
if (!usageMap.has(iconName)) {
|
|
145
|
+
usageMap.set(iconName, {
|
|
146
|
+
icon: iconName,
|
|
147
|
+
count: 0,
|
|
148
|
+
locations: []
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
const usage = usageMap.get(iconName);
|
|
152
|
+
usage.count++;
|
|
153
|
+
usage.locations.push({
|
|
154
|
+
file: filePath,
|
|
155
|
+
line: lineNum,
|
|
156
|
+
column: stringMatch.index + 1
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (verbose && usageMap.size > 0) {
|
|
162
|
+
console.log(` Found ${usageMap.size} icons in ${filePath}`);
|
|
163
|
+
}
|
|
164
|
+
} catch (error) {
|
|
165
|
+
if (verbose) {
|
|
166
|
+
console.error(` Error parsing ${filePath}:`, error);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return usageMap;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Merge icon usage maps
|
|
174
|
+
*/
|
|
175
|
+
function mergeUsageMaps(target, source) {
|
|
176
|
+
for (const [icon, usage] of source) {
|
|
177
|
+
if (target.has(icon)) {
|
|
178
|
+
const existing = target.get(icon);
|
|
179
|
+
existing.count += usage.count;
|
|
180
|
+
existing.locations.push(...usage.locations);
|
|
181
|
+
} else {
|
|
182
|
+
target.set(icon, {
|
|
183
|
+
...usage
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Analyze a directory for icon usage
|
|
191
|
+
*/
|
|
192
|
+
export function analyzeDirectory(srcDir, verbose = false) {
|
|
193
|
+
const absolutePath = path.resolve(srcDir);
|
|
194
|
+
if (verbose) {
|
|
195
|
+
console.log(`Analyzing directory: ${absolutePath}`);
|
|
196
|
+
}
|
|
197
|
+
const files = getFilesRecursively(absolutePath);
|
|
198
|
+
if (verbose) {
|
|
199
|
+
console.log(`Found ${files.length} files to analyze`);
|
|
200
|
+
}
|
|
201
|
+
const allUsage = new Map();
|
|
202
|
+
for (const file of files) {
|
|
203
|
+
const fileUsage = parseFile(file, verbose);
|
|
204
|
+
mergeUsageMaps(allUsage, fileUsage);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Group by prefix
|
|
208
|
+
const byPrefix = {};
|
|
209
|
+
const icons = [];
|
|
210
|
+
for (const [iconName, usage] of allUsage) {
|
|
211
|
+
const [prefix] = iconName.split(':');
|
|
212
|
+
if (!byPrefix[prefix]) {
|
|
213
|
+
byPrefix[prefix] = {
|
|
214
|
+
count: 0,
|
|
215
|
+
icons: []
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
byPrefix[prefix].count += usage.count;
|
|
219
|
+
byPrefix[prefix].icons.push(iconName);
|
|
220
|
+
icons.push(usage);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// Sort icons by count (descending)
|
|
224
|
+
icons.sort((a, b) => b.count - a.count);
|
|
225
|
+
return {
|
|
226
|
+
totalIcons: allUsage.size,
|
|
227
|
+
totalUsage: icons.reduce((sum, i) => sum + i.count, 0),
|
|
228
|
+
byPrefix,
|
|
229
|
+
icons,
|
|
230
|
+
filesAnalyzed: files.length,
|
|
231
|
+
timestamp: new Date().toISOString()
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Get unique icon names from analysis result
|
|
237
|
+
*/
|
|
238
|
+
export function getUniqueIcons(result) {
|
|
239
|
+
return result.icons.map(i => i.icon);
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* Parse icon list from string
|
|
244
|
+
*/
|
|
245
|
+
export function parseIconList(input) {
|
|
246
|
+
if (Array.isArray(input)) {
|
|
247
|
+
return input;
|
|
248
|
+
}
|
|
249
|
+
return input.split(',').map(s => s.trim()).filter(Boolean);
|
|
250
|
+
}
|
|
251
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["fs","path","ANALYZABLE_EXTENSIONS","PATTERNS","jsxComponent","iconImport","prefetchIcons","iconString","COMPONENT_PREFIX_MAP","Mdi","MdiLight","Heroicons","Lucide","Ph","Feather","Tabler","Bi","Fa6Solid","Fa6Regular","Fa6Brands","Fa7Solid","Ri","Carbon","Fluent","MaterialSymbols","Solar","Ion","AntDesign","getFilesRecursively","dir","files","existsSync","entries","readdirSync","withFileTypes","entry","fullPath","join","name","startsWith","isDirectory","includes","extname","push","parseFile","filePath","verbose","usageMap","Map","content","readFileSync","lines","split","importedComponents","Set","importMatch","lastIndex","exec","imports","map","s","trim","forEach","imp","add","lineIndex","length","line","lineNum","componentName","componentRegex","RegExp","match","iconName","prefix","fullIconName","column","index","has","set","icon","count","locations","usage","get","file","stringMatch","size","console","log","error","mergeUsageMaps","target","source","existing","analyzeDirectory","srcDir","absolutePath","resolve","allUsage","fileUsage","byPrefix","icons","sort","a","b","totalIcons","totalUsage","reduce","sum","i","filesAnalyzed","timestamp","Date","toISOString","getUniqueIcons","result","parseIconList","input","Array","isArray","filter","Boolean"],"sourceRoot":"../../../src","sources":["cli/parser.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,EAAE,MAAM,IAAI;AACxB,OAAO,KAAKC,IAAI,MAAM,MAAM;AAG5B;AACA;AACA;AACA,MAAMC,qBAAqB,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;;AAE5D;AACA;AACA;AACA,MAAMC,QAAQ,GAAG;EACf;EACAC,YAAY,EAAE,qDAAqD;EAEnE;EACAC,UAAU,EAAE,iDAAiD;EAE7D;EACAC,aAAa,EAAE,oCAAoC;EAEnD;EACAC,UAAU,EAAE;AACd,CAAC;;AAED;AACA;AACA;AACA,MAAMC,oBAA4C,GAAG;EACnDC,GAAG,EAAE,KAAK;EACVC,QAAQ,EAAE,WAAW;EACrBC,SAAS,EAAE,WAAW;EACtBC,MAAM,EAAE,QAAQ;EAChBC,EAAE,EAAE,IAAI;EACRC,OAAO,EAAE,SAAS;EAClBC,MAAM,EAAE,QAAQ;EAChBC,EAAE,EAAE,IAAI;EACRC,QAAQ,EAAE,WAAW;EACrBC,UAAU,EAAE,aAAa;EACzBC,SAAS,EAAE,YAAY;EACvBC,QAAQ,EAAE,WAAW;EACrBC,EAAE,EAAE,IAAI;EACRC,MAAM,EAAE,QAAQ;EAChBC,MAAM,EAAE,QAAQ;EAChBC,eAAe,EAAE,kBAAkB;EACnCC,KAAK,EAAE,OAAO;EACdC,GAAG,EAAE,KAAK;EACVC,SAAS,EAAE;EACX;AACF,CAAC;;AAED;AACA;AACA;AACA,SAASC,mBAAmBA,CAACC,GAAW,EAAEC,KAAe,GAAG,EAAE,EAAY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,CAAC,CAACC,WAAW,CAAC;EACpC,CAAC;AACH;;AAEA;AACA;AACA;AACA,OAAO,SAASC,cAAcA,CAACC,MAAsB,EAAY;EAC/D,OAAOA,MAAM,CAACd,KAAK,CAAC3C,GAAG,CAAEmD,CAAC,IAAKA,CAAC,CAAC9B,IAAI,CAAC;AACxC;;AAEA;AACA;AACA;AACA,OAAO,SAASqC,aAAaA,CAACC,KAAwB,EAAY;EAChE,IAAIC,KAAK,CAACC,OAAO,CAACF,KAAK,CAAC,EAAE;IACxB,OAAOA,KAAK;EACd;EAEA,OAAOA,KAAK,CACTlE,KAAK,CAAC,GAAG,CAAC,CACVO,GAAG,CAAEC,CAAC,IAAKA,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC,CACpB4D,MAAM,CAACC,OAAO,CAAC;AACpB","ignoreList":[]}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CLI Types
|
|
3
|
+
* Type definitions for CLI commands and configuration
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Bundle command options
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Analyze command options
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Icon usage information from code analysis
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Analysis result
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Bundle file structure
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* CLI exit codes
|
|
28
|
+
*/
|
|
29
|
+
export const EXIT_CODES = {
|
|
30
|
+
SUCCESS: 0,
|
|
31
|
+
ERROR: 1,
|
|
32
|
+
INVALID_ARGS: 2,
|
|
33
|
+
FILE_NOT_FOUND: 3,
|
|
34
|
+
NETWORK_ERROR: 4
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EXIT_CODES","SUCCESS","ERROR","INVALID_ARGS","FILE_NOT_FOUND","NETWORK_ERROR"],"sourceRoot":"../../../src","sources":["cli/types.ts"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AA4CA;AACA;AACA;;AA2BA;AACA;AACA;;AAsBA;AACA;AACA;;AAuCA;AACA;AACA;;AA8BA;AACA;AACA;AACA,OAAO,MAAMA,UAAU,GAAG;EACxBC,OAAO,EAAE,CAAC;EACVC,KAAK,EAAE,CAAC;EACRC,YAAY,EAAE,CAAC;EACfC,cAAc,EAAE,CAAC;EACjBC,aAAa,EAAE;AACjB,CAAU","ignoreList":[]}
|