projekt0n / github-nvim-theme

Github's Neovim themes
MIT License
2.02k stars 105 forks source link

ci: Get and update primer primitives automatically #253

Closed tmillr closed 1 year ago

tmillr commented 1 year ago

Introduce a GitHub workflow which runs on a schedule 3 times per week to pull in all of the exact color definitions for each theme directly from the @primer/primitives npm package. This pr adds a package.json file for clarity and for dependency tracking/declarations, as well as a new workflow file which is quite simple and uses npm. The workflow goes something like this:

  1. Install the latest version of the @primer/primitives npm package in CI
  2. Extract the color definition JSON files for each theme
  3. Convert each JSON file to Lua, so that they can easily be required
  4. Place these new Lua files under the new directory lua/github-theme/palettes/primitives
  5. Run make fmt to format all Lua files
  6. Use/run the peter-evans/create-pull-request@v5 gh action, which will create a pr if there were any updates/changes

These color definitions will live under the new directory lua/github-theme/palettes/primitives and may be required from Lua at runtime (e.g. in order to build up specs).

The workflow may also be run manually via workflow_dispatch.

ful1e5 commented 1 year ago

@tmillr, I'm getting ready to launch a major version of this colorscheme, which will be released soon. Once it's out, I'll review your pull requests (PRs) and merge them into the main branch. This approach will give us a solid base version that incorporates the newly added feature and allows us to track any additional modifications you mentioned. It will facilitate easier identification and monitoring of changes, enabling us to release minor versions accordingly.

Thank you for your understanding.

tmillr commented 1 year ago

@tmillr, I'm getting ready to launch a major version of this colorscheme, which will be released soon. Once it's out, I'll review your pull requests (PRs) and merge them into the main branch. This approach will give us a solid base version that incorporates the newly added feature and allows us to track any additional modifications you mentioned. It will facilitate easier identification and monitoring of changes, enabling us to release minor versions accordingly.

Thank you for your understanding.

Awesome sounds good!

tmillr commented 1 year ago

I ran/tested the embedded shell script locally and then was able to successfully require() the generated Lua files. It should be all good to go!