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

feat: add version key into palette.json #91

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

sgoudham
Copy link
Contributor

@sgoudham sgoudham commented Sep 8, 2024

This PR adds the current version of the palette JSON into the JSON itself.

Setting as draft for now to make sure the method in which we get the JSON and update it is how we want it.

@sgoudham sgoudham changed the title Feat/palette version feat: add palette version into JSON Sep 8, 2024
Copy link
Member

@backwardspy backwardspy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

love it 👍

@sgoudham
Copy link
Contributor Author

sgoudham commented Sep 8, 2024

Fix the CI 👍

"Destructuring in exports is not supported. Instead of destructuring,
export each symbol individually."

ref: https://jsr.io/docs/about-slow-types#typescript-restrictions
@sgoudham sgoudham marked this pull request as ready for review September 20, 2024 01:14
@sgoudham
Copy link
Contributor Author

sgoudham commented Sep 20, 2024

Updated the mod.ts file to make sure that the types line up and a simple test to make sure it's exported with the right version. Release please is in charge of updating both the version in the palette json and the test when the release PR is merged. Funnily enough, you can probably remove the code in gen_palette.ts for updating the version since release please can technically do it but it feels weird to do that. Both versions should line up anyways since they are updated at the same time.

We don't want this to be a breaking change so I've just added another export version. If we wanted to redo the type structure to come under, for example, a global CatppuccinPalette type, it could look like the following:

/**
 * The full Catppuccin palette with the current version and all flavors.
 */
export type CatppuccinPalette = {
  version: string;
} & Flavors<CatppuccinFlavor>;

However, don't really see a reason to break it right now and I believe users can alias the import version in their own files so don't need to worry about naming and stuff.

@sgoudham sgoudham changed the title feat: add palette version into JSON feat: version key into palette.json Sep 20, 2024
@sgoudham sgoudham changed the title feat: version key into palette.json feat: add version key into palette.json Sep 20, 2024
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

Successfully merging this pull request may close these issues.

2 participants