Skip to content
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

Document the version of Herocions this gem supports? #33

Closed
nickjj opened this issue Feb 25, 2023 · 10 comments
Closed

Document the version of Herocions this gem supports? #33

nickjj opened this issue Feb 25, 2023 · 10 comments

Comments

@nickjj
Copy link
Contributor

nickjj commented Feb 25, 2023

Hi,

Great gem!

I'm about to try it out and was wondering if you were open to documenting the version of Herocions used in the readme file?

I know it mentions there's 292 icons which matches the 292 icons available in Heroicons v2.0.16 based on viewing https://heroicons.com/ at the time of making this issue (it may change in the future).

For folks who might be on the fence on trying this out, it would be beneficial to see something like:

The latest rails_heroicon is built with Heroicons v2.0.16 (292 icons)

On that note, are you programmatically syncing releases to Tailwindlabs' repo or is it done manually?

@abeidahmed
Copy link
Owner

Thank you for creating the issue, @nickjj.

I'm about to try it out and was wondering if you were open to documenting the version of Herocions used in the readme file?

Yes, that'd be great. Would you mind creating a PR? Thanks.

On that note, are you programmatically syncing releases to Tailwindlabs' repo or is it done manually?

At the moment we are syncing it manually, but I'm open to hearing ideas on how we can achieve this programmatically.

@nickjj
Copy link
Contributor Author

nickjj commented Feb 26, 2023

Would you mind creating a PR? Thanks.

Done.

but I'm open to hearing ideas on how we can achieve this programmatically

How do you sync it manually?

@abeidahmed
Copy link
Owner

How do you sync it manually?

I often visit the heroicons official repo and scan their commits. If they add/update icons, I manually update this repo too.

@nickjj
Copy link
Contributor Author

nickjj commented Feb 26, 2023

I often visit the heroicons official repo and scan their commits.

Is this the general workflow?

  1. Visit https://github.com/tailwindlabs/heroicons manually
  2. Discover there's new icons
  3. Check the commits by eye
  4. Copy / paste any changes into your compressed/icons.json file
  5. Commit your changes
  6. Push it and release a new version of your gem

For step 4 do you grab the changes from the optimized/ directory where 20/solid is your "mini" and 24 is for the normal sized outline and solid icons?

@abeidahmed
Copy link
Owner

abeidahmed commented Feb 26, 2023

Copy / paste any changes into your compressed/icons.json file

I add the icons to icons directory and then run the compress script. This script adds the icons to the icons.json file.

For step 4 do you grab the changes from the optimized/ directory where 20/solid is your "mini" and 24 is for the normal sized outline and solid icons?

I copy the icons from https://github.com/tailwindlabs/heroicons/tree/master/src. Yes, 20/solid is "mini", 24/outline is "outline", and 24/solid is "solid". This is the same pattern that https://heroicons.com/ follows in listing the icons.

To summarize, this is the workflow:

  1. Visit https://github.com/tailwindlabs/heroicons manually
  2. Discover there's new icons
  3. Check the commits by eye
  4. Add icons to the icons directory
  5. Run compress script
  6. Commit your changes
  7. Push it and release a new version of your gem

@nickjj
Copy link
Contributor Author

nickjj commented Feb 26, 2023

I think these steps could be automated in a GitHub Action.

A daily or weekly script could:

  1. Check https://github.com/tailwindlabs/heroicons/releases/latest which redirects to the latest release
    • You can use GitHub's API to grab the specific version
  2. Modify your gem to store the version you're using so it can be compared to the latest version
    • Option 1: Use v2.0.16.json instead of icons.json, but this will make git diffing hard since the file name changed?
    • Option 2: Add a _version field to the icons.json, not bad but feels like it's mixing concerns of icons and metadata?
    • Option 3: Write a separate TAILWINDLABS_HEROICONS_VERSION file somewhere within the gem, pretty good?
  3. A script compares the latest version to any of the above options, if there's a difference:
    • Make a new branch in your repo
    • Clone https://github.com/tailwindlabs/heroicons
    • Copy all of the tailwindlabs/heroicons icons into your repo's icons folder
      • Is there a difference between src/ and optimized/?
    • Update your version based on step 2
    • Update your readme to reference the version from what I added in this issue's PR
    • Commit the changes and push the branch
    • Open a PR in your own repo so you can review it as a human

At this point you can merge it and cut a gem release. I don't know your workflow for updating the changelog but that step could be done manually in the PR or after you merge it but before you build a new gem.

What do you think?

@abeidahmed
Copy link
Owner

Option 3: Write a separate TAILWINDLABS_HEROICONS_VERSION file somewhere within the gem, pretty good?

This seems like the best option in my opinion.

Yeah, I'm pretty happy with the steps that you described above. I think that would get rid of all the manual steps that I do right now to update the icons.

One question: How do we test the workflow? Do we have to wait for a new release from https://github.com/tailwindlabs/heroicons to verify that the workflow works as expected?

@nickjj
Copy link
Contributor Author

nickjj commented Mar 1, 2023

Do you want me to close this issue and make a new for the automation workflow?

One question: How do we test the workflow?

For development I'd suggest creating it all as an offline script that you can run on the command line on your dev box without needing to push any commits. This way it can be tested in isolation with a number of different inputs. Then once it's good to go drop it into a GitHub Action.

As a first-time-end-to-end test maybe a 2nd private repo could be created just to make sure the GitHub Action portion works. I don't really know of a better way to test GitHub Actions unless you start looking into solutions like https://github.com/nektos/act (I haven't yet btw).

@abeidahmed
Copy link
Owner

Do you want me to close this issue and make a new for the automation workflow?

Sure, that would be great for keeping issues separate.

As a first-time-end-to-end test maybe a 2nd private repo could be created just to make sure the GitHub Action portion works. I don't really know of a better way to test GitHub Actions unless you start looking into solutions like https://github.com/nektos/act (I haven't yet btw).

Got it. Looks like a cool project on its own to learn and explore more about GitHub actions. Thanks for the help.

@nickjj
Copy link
Contributor Author

nickjj commented Mar 2, 2023

This issue's task of documenting the herocions version is complete so I closed it.

A continuation of the discussion around making it easier to keep this gem up to date has been opened here: #36

@nickjj nickjj closed this as completed Mar 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants