diff --git a/deno.json b/deno.json index f3a52b271a..25c2c8b7d9 100644 --- a/deno.json +++ b/deno.json @@ -5,10 +5,9 @@ "catppuccin-repo/": "https://raw.githubusercontent.com/catppuccin/catppuccin/91d6b5433730103c504dcf43583b594e418ee7c1/", "@actions/core": "npm:@actions/core@1.10.1", "@octokit/rest": "npm:@octokit/rest@20.0.2", - "usercss-meta": "npm:usercss-meta@0.12.0", "ajv": "npm:ajv@8.12.0", - "chalk": "npm:chalk@5.3.0", - "less": "npm:less@4.2.0" + "less": "npm:less@4.2.0", + "usercss-meta": "npm:usercss-meta@0.12.0" }, "tasks": { "ci:generate": "deno run -A ./scripts/generate/main.ts", diff --git a/scripts/lint/file-checker.ts b/scripts/lint/file-checker.ts index 8802dc4cd7..c008662196 100644 --- a/scripts/lint/file-checker.ts +++ b/scripts/lint/file-checker.ts @@ -4,7 +4,7 @@ import core from "@actions/core"; import { REPO_ROOT } from "@/deps.ts"; import { log } from "./logger.ts"; -import chalk from "chalk"; +import * as color from "std/fmt/colors.ts"; const requiredFiles = [ "catppuccin.user.css", @@ -39,7 +39,7 @@ export const checkForMissingFiles = async () => { .write(); } else { missingFiles.map((f) => { - log(chalk.red(`Missing file:`) + ` ${f}`, { file: f }, "error"); + log(color.red(`Missing file:`) + ` ${f}`, { file: f }, "error"); }); } diff --git a/scripts/lint/logger.ts b/scripts/lint/logger.ts index c8eba67769..cdce1d771d 100644 --- a/scripts/lint/logger.ts +++ b/scripts/lint/logger.ts @@ -1,5 +1,5 @@ import { sprintf } from "std/fmt/printf.ts"; -import chalk from "chalk"; +import * as color from "std/fmt/colors.ts"; import core from "@actions/core"; export type LoggerProps = core.AnnotationProperties & { content?: string }; @@ -15,7 +15,7 @@ const pretty_print = ( const lines = (props.content ?? "").split("\n"); const error = [ - chalk[severity === "error" ? "red" : "yellow"](severity), + color[severity === "error" ? "red" : "yellow"](severity), message, ].join(" "); @@ -24,7 +24,7 @@ const pretty_print = ( const endCol = (props.endColumn ?? Infinity) - 1; if (i >= startCol && i <= endCol) { - return chalk[severity === "error" ? "red" : "yellow"](char); + return color[severity === "error" ? "red" : "yellow"](char); } else { return char; } @@ -33,7 +33,7 @@ const pretty_print = ( const pad = startLine.toString().length; console.log( [ - chalk.underline( + color.underline( sprintf( "%s%s%d%s%d", file, @@ -46,15 +46,15 @@ const pretty_print = ( sprintf( "%*s│ %s", pad, - chalk.dim(startLine - 1), - chalk.dim(lines[startLine - 2]), + color.dim(String(startLine - 1)), + color.dim(lines[startLine - 2]), ), - sprintf("%*s│ %s", pad, chalk.bold(startLine), line), + sprintf("%*s│ %s", pad, color.bold(String(startLine)), line), sprintf( "%*s│ %s", pad, - chalk.dim(startLine + 1), - chalk.dim(lines[startLine]), + color.dim(String(startLine + 1)), + color.dim(lines[startLine]), ), sprintf("%*s╰─► %s", pad, "", error), undefined, diff --git a/scripts/lint/metadata.ts b/scripts/lint/metadata.ts index e85019bd47..95c547e695 100644 --- a/scripts/lint/metadata.ts +++ b/scripts/lint/metadata.ts @@ -1,7 +1,7 @@ -import chalk from "chalk"; // @deno-types="../usercss-meta.d.ts"; import usercssMeta from "usercss-meta"; import { log } from "./logger.ts"; +import * as color from "std/fmt/colors.ts"; import { sprintf } from "std/fmt/printf.ts"; import type { WalkEntry } from "std/fs/mod.ts"; import { relative } from "std/path/mod.ts"; @@ -39,9 +39,9 @@ export const verifyMetadata = ( const message = sprintf( "Metadata %s should be %s but is %s", - chalk.bold(k), - chalk.green(v), - chalk.red(defacto), + color.bold(k), + color.green(v), + color.red(String(defacto)), ); log(message, { diff --git a/scripts/lint/stylelint.ts b/scripts/lint/stylelint.ts index 243823500a..552f71d46f 100644 --- a/scripts/lint/stylelint.ts +++ b/scripts/lint/stylelint.ts @@ -1,6 +1,6 @@ import { deepMerge } from "std/collections/mod.ts"; -import chalk from "chalk"; +import * as color from "std/fmt/colors.ts"; import stylelint from "npm:stylelint"; import stylelintConfigStandard from "npm:stylelint-config-standard"; import stylelintConfigRecommended from "npm:stylelint-config-recommended"; @@ -182,7 +182,7 @@ export const lint = (entry: WalkEntry, content: string, fix: boolean) => { // some cleanup for fancier logging, dims the rule name const message = warning.text?.replace( new RegExp(`\\(?${warning.rule}\\)?`), - chalk.dim(`(${warning.rule})`), + color.dim(`(${warning.rule})`), ) ?? "unspecified stylelint error"; log(message, {