catppuccin / palette

🎨 Soothing pastel theme to use within your projects!
https://www.npmjs.com/package/@catppuccin/palette
MIT License
457 stars 36 forks source link

feat: add version key into `palette.json` #91

Closed sgoudham closed 1 month ago

sgoudham commented 2 months ago

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 commented 2 months ago

Fix the CI :+1:

sgoudham commented 1 month ago

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.