Community icon indicating copy to clipboard operation
Community copied to clipboard

Create a workflow to automatically update presets.json

Open tfuxu opened this issue 3 years ago • 9 comments

A simple CI action that would fetch a name and raw link of a newly added preset should be enough.

Also, there could be added a workflow that would check before merging a PR if a preset doesn't have any JSON errors in it. Here's a popular linter that could be used for it: https://github.com/zaach/jsonlint

tfuxu avatar Aug 25 '22 16:08 tfuxu

I've got the same idea :D

0xMRTT avatar Aug 25 '22 17:08 0xMRTT

Idea:

  1. A workflow create a in-presets.json with all presets stored in the repo
  2. Presets stored outside are added by users in out-presets.json
  3. Another workflow merge two presets files in presets.json and run jsonlint

0xMRTT avatar Sep 02 '22 14:09 0xMRTT

  1. A workflow create a in-presets.json with all presets stored in the repo

Wouldn't it be simpler to just append presets.json with new values?

  1. Presets stored outside are added by users in out-presets.json

For presets stored outside, maybe a better approach than a current one would be to allow users to have their own repositories of presets, and as we now have preferences in Gradience, we could put here a option to provide a custom presets.json location for user-defined preset repositories.

tfuxu avatar Sep 02 '22 18:09 tfuxu

Oh great idea 💡

We can add a dconf key with a list of all repos (gradience official repo will be first and if the user disable all repo it will be selected ? Or gradience will say "no repo" ?)

0xMRTT avatar Sep 02 '22 18:09 0xMRTT

We can add a dconf key with a list of all repos (gradience official repo will be first and if the user disable all repo it will be selected ? Or gradience will say "no repo" ?)

That's actually a pretty hard question. One the one side, a list with custom repos hardcoded into Gradience would allow users to discover interesting presets, but on the other side, after some time that list will become too big to be scrollable in preferences.

tfuxu avatar Sep 02 '22 19:09 tfuxu

We can implement a kind of pagination like in Extension Manager and a search

0xMRTT avatar Sep 02 '22 19:09 0xMRTT

We can implement a kind of pagination like in Extension Manager and a search

We can add something like 'Repositories' tab in presets manager so user will have a easy way to enable a repository if it is on any of our databases (so probably something with the same format as presets.json with a name of repository and a link), and add an option in preferences to add custom repositories that are not available from presets manager.

tfuxu avatar Sep 02 '22 22:09 tfuxu

Sounds gøød 👍

0xMRTT avatar Sep 02 '22 22:09 0xMRTT

Also an action to merge official and curated and put this in presets.json in main

daudix avatar Sep 25 '22 13:09 daudix

After 215 days, a lot of manual edits of preset list files, endless amount of json f'ups, the automatic preset list generation is here for both for next and main :partying_face: :tada:

Thanks to @dominichayesferen for making this possible!

daudix avatar Mar 28 '23 01:03 daudix