refactor(scripts): cleanup & enforce code style (#1388)

This commit is contained in:
uncenter authored and GitHub committed 2024-10-27 15:32:00 -04:00
1 parent 7db9b234c1
commit 5d74d700a2
23 files changed
+290 -270

No files matched your search

+2 -9
View File
@@ -1,9 +1,2 @@
export * as UserStylesSchema from "@/types/userstyles.d.ts";
export * as PortsSchema from "catppuccin-repo/resources/types/ports.d.ts";
import { Entries } from "type-fest";
declare global {
interface ObjectConstructor {
entries<T extends object>(o: T): Entries<T>;
}
}
export * as UserstylesSchema from "@/types/userstyles.d.ts";
export * as PortsSchema from "@catppuccin/catppuccin/resources/types/ports.d.ts";
+15
View File
@@ -0,0 +1,15 @@
import { REPO_ROOT, USERSTYLES_SCHEMA } from "@/constants.ts";
import * as path from "@std/path";
import { compile, type JSONSchema } from "json-schema-to-typescript";
const TYPES_ROOT = path.join(REPO_ROOT, "scripts/types");
const types = await compile(
USERSTYLES_SCHEMA as JSONSchema,
"UserstylesSchema",
{
bannerComment: "// deno-fmt-ignore-file",
},
);
Deno.writeTextFileSync(path.join(TYPES_ROOT, "userstyles.d.ts"), types);