Skip to content

Commit

Permalink
chore: update mod.ts & release please config
Browse files Browse the repository at this point in the history
  • Loading branch information
sgoudham committed Sep 20, 2024
1 parent f3b4e8d commit b481dff
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
dist/
node_modules/
.DS_STORE
6 changes: 5 additions & 1 deletion mod.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { assertEquals } from "std/assert/assert_equals.ts";

import { flavorEntries, flavors } from "@catppuccin/palette";
import { flavorEntries, flavors, version } from "@catppuccin/palette";
import palette from "@/palette.json" with { type: "json" };

Deno.test("flavorEntries", () => {
Expand All @@ -21,3 +21,7 @@ Deno.test("flavors", () => {
);
});
});

Deno.test("version", () => {
assertEquals(version, "1.2.0"); // x-release-please-version
});
24 changes: 16 additions & 8 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,17 +187,25 @@ export type ColorFormat = Readonly<{
accent: boolean;
}>;

const { version: jsonVersion, ...jsonFlavors } = definitions;

/**
* The version of the Catppuccin palette
*/
export const version = jsonVersion;

/**
* All flavors of Catppuccin
*/
export const flavors: CatppuccinFlavors = entriesFromObject(definitions)
.reduce((acc, [flavorName, flavor]) => {
acc[flavorName] = {
...flavor,
colorEntries: entriesFromObject(flavor.colors),
};
return acc;
}, {} as CatppuccinFlavors);
export const flavors: CatppuccinFlavors = entriesFromObject(
jsonFlavors,
).reduce((acc, [flavorName, flavor]) => {
acc[flavorName] = {
...flavor,
colorEntries: entriesFromObject(flavor.colors),
};
return acc;
}, {} as CatppuccinFlavors);

/**
* A typed `Object.entries()` iterable of all Catppuccin flavors
Expand Down
9 changes: 9 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
"path": "deno.json",
"type": "json",
"jsonpath": "$.version"
},
{
"path": "palette.json",
"type": "json",
"jsonpath": "$.version"
},
{
"type": "generic",
"path": "mod.test.ts"
}
]
}
Expand Down

0 comments on commit b481dff

Please sign in to comment.