jacobparis-insiders / sly

Monorepo for Sly CLI
https://sly-cli.fly.dev/
157 stars 11 forks source link

feature: add @blueprintjs/icons to registry #2

Closed switz closed 1 year ago

switz commented 1 year ago

This PR adds support for @blueprintjs/icons to resolve #1

It also adds svgo which dynamically reduces svg size immensely for blueprint icons. I understand you may not want to add more dependencies, but this makes a huge difference.

before svgo:

'<!-- @blueprintjs/icons -->\n<!-- https://github.com/palantir/blueprint/blob/develop/LICENSE -->\n<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n<path fill-rule="evenodd" clip-rule="evenodd" d="M12 0C11.4477 0 11 0.447715 11 1V3H9C8.44772 3 8 3.44772 8 4C8 4.55228 8.44771 5 9 5H11V7C11 7.55228 11.4477 8 12 8C12.5523 8 13 7.55228 13 7V5H15C15.5523 5 16 4.55228 16 4C16 3.44772 15.5523 3 15 3H13V1C13 0.447715 12.5523 0 12 0ZM0 4C0 3.44772 0.447715 3 1 3H4.5C5.05228 3 5.5 3.44772 5.5 4C5.5 4.55228 5.05228 5 4.5 5H2V7C2 7.55228 1.55228 8 1 8C0.447715 8 0 7.55228 0 7V4ZM1 16C0.447715 16 0 15.5523 0 15V12C0 11.4477 0.447715 11 1 11C1.55228 11 2 11.4477 2 12V14H4.5C5.05228 14 5.5 14.4477 5.5 15C5.5 15.5523 5.05228 16 4.5 16H1ZM12 16C12.2652 16 12.5196 15.8946 12.7071 15.7071C12.8946 15.5196 13 15.2652 13 15V12C13 11.4477 12.5523 11 12 11C11.4477 11 11 11.4477 11 12V14L9 14C8.44772 14 8 14.4477 8 15C8 15.5523 8.44771 16 9 16L12 16ZM6.5 12C7.88071 12 9 10.8807 9 9.5C9 8.11929 7.88071 7 6.5 7C5.11929 7 4 8.11929 4 9.5C4 10.8807 5.11929 12 6.5 12Z" />\n</svg>\n'
--

after svgo:

'<!-- @blueprintjs/icons -->\n<!-- https://github.com/palantir/blueprint/blob/develop/LICENSE -->\n<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16"><path fill-rule="evenodd" d="M12 0a1 1 0 0 0-1 1v2H9a1 1 0 0 0 0 2h2v2a1 1 0 1 0 2 0V5h2a1 1 0 1 0 0-2h-2V1a1 1 0 0 0-1-1ZM0 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 0 2H2v2a1 1 0 0 1-2 0V4Zm1 12a1 1 0 0 1-1-1v-3a1 1 0 1 1 2 0v2h2.5a1 1 0 1 1 0 2H1Zm11 0a1 1 0 0 0 1-1v-3a1 1 0 1 0-2 0v2H9a1 1 0 1 0 0 2h3Zm-5.5-4a2.5 2.5 0 1 0 0-5 2.5 2.5 0 0 0 0 5Z" clip-rule="evenodd"/></svg>'

Hope this PR helps!

switz commented 1 year ago

anything need to done here to get this merged?

jacobparis commented 1 year ago

Hey sorry I forgot to turn on notifications for this repo! Just saw this now

This looks great, thanks for building it!

jacobparis commented 1 year ago

Hey sorry finally got time to go through this

I understand now what you're saying about svgo, and I think it's acceptable to add for this use-case.

I had to make one change to add the registry to the index, but approved and merging.