primer / octicons

A scalable set of icons handcrafted with <3 by GitHub
https://primer.style/foundations/icons
MIT License
8.32k stars 827 forks source link

Generate a Figma component library #385

Closed colebemis closed 3 years ago

colebemis commented 4 years ago

Problem

Since https://github.com/primer/octicons/pull/374 was merged, the Octicons Figma component library is no longer the source of truth for the Octicons packages (See https://github.com/primer/octicons/issues/372 for more details). While this change solved several problems, it also disconnected the Octicons Figma component library from the rest of the Octicons packages, which means the Figma component library now has to be kept up-to-date manually.

Solution

It would be nice if we could create a Figma component library that automatically updated every time a commit was pushed to the master branch of primer/octicons. However, I don't think that is possible with Figma's current API (I'd love to be wrong about this 🙏).

Until Figma releases a write API, let's build a Figma plugin to automatically generate a component library using the SVGs stored in the primer/octicons repo. Every time the Figma plugin is run it should:

Here's what the workflow for keeping the Octicons Figma component library up-to-date would look like for maintainers using this plugin:

  1. Notice that a new version of the Octicons packages have been released
  2. Go to the Octicons Figma file
  3. Run the Figma plugin
  4. Publish the library
  5. Done 🎉

cc @ashygee

ashygee commented 4 years ago

This is really exciting @colebemis !

Is there a way we can ensure that maintainers don't fall behind on Octicons releases? That's the only step I'm a little wary of.

Also, would we need write any specific to checks to ensure that we are not duplicating any icons based on filenames or possibly linting the SVGs so we don't accidentally get two of the same icon that are named differently?

colebemis commented 4 years ago

Is there a way we can ensure that maintainers don't fall behind on Octicons releases? That's the only step I'm a little wary of.

I'm a little worried about this too. I can't think of a great solution to this. Maybe we set up a GitHub action to send a Slack reminder to update the component library every time there is a new release of Octicons?

Also, would we need write any specific to checks to ensure that we are not duplicating any icons based on filenames or possibly linting the SVGs so we don't accidentally get two of the same icon that are named differently?

We'll probably handle all these checks during the build step before releasing the packages so I don't think we need to worry about it on the Figma side.

github-actions[bot] commented 3 years ago

Hi! This issue has been marked as stale because it has been open with no activity for 180 days. You can comment on the issue or remove the stale label to keep it open. If you do nothing, this issue will be closed in 7 days.