feat(icons): auto-register icons used by library components#523
Merged
kelsos merged 1 commit intorotki:mainfrom Apr 28, 2026
Merged
feat(icons): auto-register icons used by library components#523kelsos merged 1 commit intorotki:mainfrom
kelsos merged 1 commit intorotki:mainfrom
Conversation
Scan src/components at library build time and emit dist/library-icons.json with every icon name referenced by library components. The vite plugin seeds its scanResult with this baseline at configResolved, so consumers of components like RuiDateTimePicker (lu-calendar-days), RuiTimePicker (lu-clock), or any other library component never need to register those icons themselves.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #523 +/- ##
==========================================
- Coverage 84.89% 84.73% -0.17%
==========================================
Files 143 143
Lines 5217 5227 +10
Branches 1554 1556 +2
==========================================
Hits 4429 4429
- Misses 788 798 +10 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Library-internal icons (e.g.
lu-calendar-daysinRuiDateTimePicker,lu-clockinRuiTimePicker, the dozens used byRuiCalendar,RuiCheckbox,RuiDataTable, etc.) were never registered automatically — every consumer would have to add them via the plugin'sincludeoption, or hit a runtime "Icons "..." not found" warning the first time the component rendered.Now:
scripts/scan-library-icons.tsstep (run fromdist-build.mjsafter web-types) scanssrc/components/**/*.{vue,ts}(excluding specs/stories) and writes the validated icon list todist/library-icons.json.ruiIconsPluginreadsdist/library-icons.jsonatconfigResolvedand seeds itsscanResult.iconswith this baseline.include.Verified the example app's plugin now logs
Loaded 30 baseline icons used by library componentsand the detected-icon count went from 31 → 56.Test plan
pnpm run typecheckcleanpnpm -w run lintcleanpnpm --filter @rotki/ui-library run test:run(1072 pass)pnpm run test:e2e(280 pass)pnpm --filter @rotki/ui-library run build:prodemitsdist/library-icons.json