-
-
Notifications
You must be signed in to change notification settings - Fork 629
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make it easy to fork and release a modified version of lucide. #1607
Comments
@danielbayley would you also be interested in this? |
Ok, I've maybe a good idea for this. I don't want to call it a "fork". But more an "extended" library version of lucide. Creating icon components from icon nodes & second repo ideaWe could add a special function to each package named e.g: // React example
import { createFromIconNodes, createLucideIcon } from '@lucide/react';
import iconNodes from './myIconNodes';
import { PooWithEyes } from '@lucide/extended';
// This function will create object components, which can be destructed as well.
const myIcons = createFromIconNodes({
...iconNodes,
PooWithEyes
});
// Alt: Single icon component generation, every library has already this function.
const PooWithEyesIcon = createLucideIcon('PooWithEyes', PooWithEyes)
// Now you can use the created icons in your React components
function MyComponent() {
return (
<div>
<myIcons.MyIcon1 />
<myIcons.MyIcon2 />
<myIcons.MyIcon3 />
<myIcons.PooWithEyes />
{/* ... */}
</div>
);
} With this, we could make a second repo for all these extra icons that don't make the "main" library. The rules and acceptance criteria of this repo will be more relaxed. Another useful usecase is: for the deprecation of the brand icons in the library. We could move this to a separate library: Why not do this with all our icons/packages?Yeah, probably some people will think of this. The basic answer: is developer experience. Importing icons as components is super easy to work with all these libraries. Changing all our APIs to this format will create a lot of extra steps for devs. So this API should be more for special occasions. Custom iconsThis could be a separate library containing useful functions like For Example import { createIconNodeFromSVG } from '@lucide/utils'
const myIconNode = createIconNodeFromSVG('<svg> .... </svg>');
export const MyIconComponent = createLucideIcon('MyIcon', myIconNode) But under the hood, it will basically do this:
Let me know what you think of this idea. |
I'm biased because of #1594 but that looks like a great idea. |
A nice approach could be to create a release action that builds the package and pushes it to NPM for you. |
@jguddas 100%! |
Package
Description
I would love if I could press fork and with minimal effort release my changes to NPM as new packages.
Use cases
praying-hands
,poo-with-eyes
, etc.Checklist
The text was updated successfully, but these errors were encountered: