blade-ui-kit / blade-icons

A package to easily make use of SVG icons in your Laravel Blade views.
https://blade-ui-kit.com/blade-icons
MIT License
2.21k stars 148 forks source link

Add a generator Icon Set config #210

Closed mallardduck closed 1 year ago

mallardduck commented 1 year ago

This change adds in a new IconSetConfig that authors can use to more configure their icon sets. With this they have easier to use DX for the options provided by icon set configs.

After this change icon sets can be configured with:

return [
    IconSetConfig::build(
        source: __DIR__.'/../lucide/icons',
        destination: __DIR__.'/../resources/svg',
        safe: true,
        after: $svgNormalization,
    ),
];

Before:

return [
    [
        'source' => __DIR__.'/../lucide/icons',
        'destination' => __DIR__.'/../resources/svg',
        'after' => $svgNormalization,
        'safe' => true,
    ],
];

Example PRs for icon packages:

driesvints commented 1 year ago

Feel free to undraft this once it's ready 👍

mallardduck commented 1 year ago

Wanted to make some example PRs for Icon packages to validate things more. Got that all sorted and things are looking pretty good, so ready for review!

driesvints commented 1 year ago

I'm going to be honest here: I don't want to maintain this code. Right now I don't see anything bad with the array based config and don't consider an object replacement to be an improvement. So, with all respect to the work you've done, I'm going to decline here, sorry.

mallardduck commented 1 year ago

Fair enough - I feel like array based configs are suboptimal for the reasons I expressed before. Mainly due to there being no method to ensure the array conforms to our expected shape. Thus requires reading the docs for something that could be learnable via better DX. However if you don't see an issue with those areas I won't change your mind. Cheers