feat: add icon lib description for lucide-react#12
Conversation
- Bump @types/node to ^24.0.15 and add missing React type dependencies - Add build tooling dependencies (@file-services/node, tsx) - Remove unused type dependencies (@types/prop-types, @types/scheduler) - Update lucide-react package build configuration
AviVahl
left a comment
There was a problem hiding this comment.
Use conventional commits for PR title.
Add PR description.
the problem with the .json approach is that it is untyped, so when the package user imports it, everything is loose and could easily break with future changes of this package.
|
|
||
| const svgsByContent = new Map<string, IconData>(); | ||
|
|
||
| for (const [exportName, IconComponent] of Object.entries(lucideReact)) { |
There was a problem hiding this comment.
lucide-react exports the same icon 3 times:
- Speaker
- LucideSpeaker
- SpeakerIcon
So while we could list all 3, we could just list "Speaker", and use the "SpeakerIcon" export (for less code confusion)
There was a problem hiding this comment.
could iterate on lucideReact.icons instead to avoid the duplicates
| if (svgsByContent.has(svgString)) { | ||
| const existing = svgsByContent.get(svgString)!; | ||
| // Keep the shortest name | ||
| if (exportName.length < existing.name.length) { |
There was a problem hiding this comment.
while this works for the Abc/LucideAbc/AbcIcon case, this makes no sense for icons that are being renamed (with the old one kept around)
There was a problem hiding this comment.
iterate on lucideReact.icons and avoid checking for same-content and aliases.
| }, | ||
| "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": { | ||
| "version": "3.4.3", | ||
| "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz", |
There was a problem hiding this comment.
you've messed up the package-lock.json
this happens if you npm i without a package-lock, but with existing node_modules.
- Remove tsx from root package dependencies and related esbuild packages - Add new build script (do-build.ts) for lucide-react package - Update lucide-react package configuration and README - Add LICENSE file to lucide-react package - Update TypeScript configurations across packages
add a list of icons and a pre-rendered version for lucide-react icons