build: publish to JSR (#78)

* build(deno.json): add jsr info

* refactor(mod.ts): add explicit types

* ci: add publish step to JSR
This commit is contained in:
Hammy 2024-03-25 22:17:04 +00:00 committed by GitHub
parent 563cdbccc8
commit 7e613fee08
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 4 deletions

View File

@ -52,6 +52,9 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
- name: Publish to JSR
run: deno publish
- name: Upload the palette files
env:
GH_TOKEN: ${{ github.token }}

View File

@ -1,4 +1,7 @@
{
"name": "@catppuccin/palette",
"version": "1.1.0",
"exports": "./mod.ts",
"importMap": "./import_map.json",
"exclude": [
"dist"
@ -13,6 +16,5 @@
"build:palettes": "deno run -A ./scripts/build_palettes.ts",
"build": "deno task build:npm & deno task build:palettes",
"generate": "deno run -A ./scripts/gen_palette.ts"
},
"version": "1.1.0"
}
}

6
mod.ts
View File

@ -185,7 +185,7 @@ export type ColorFormat = Readonly<{
/**
* All flavors of Catppuccin
*/
export const flavors = entriesFromObject(definitions)
export const flavors: CatppuccinFlavors = entriesFromObject(definitions)
.reduce((acc, [flavorName, flavor]) => {
acc[flavorName] = {
...flavor,
@ -197,4 +197,6 @@ export const flavors = entriesFromObject(definitions)
/**
* A typed `Object.entries()` iterable of all Catppuccin flavors
*/
export const flavorEntries = entriesFromObject(flavors);
export const flavorEntries: Entries<CatppuccinFlavors> = entriesFromObject(
flavors,
);