diff --git a/tools/fix-dts.mts b/tools/fix-dts.mts index c4ed69b..8b46af9 100644 --- a/tools/fix-dts.mts +++ b/tools/fix-dts.mts @@ -1,5 +1,8 @@ import { readdir, readFile, writeFile, lstat } from "node:fs/promises"; import { join, resolve } from "node:path"; +import k from "kleur"; + +const dtsPath = resolve("./dist/lib/"); /** Adds two spaces to the end of each line in JSDoc comments to preserve the meticulous line breaks */ async function addTrailingSpaces(filePath: string) { @@ -30,4 +33,11 @@ async function processRecursive(directory: string) { } } -processRecursive("./dist/lib"); +try { + await processRecursive(dtsPath); + + console.log(k.green(`Fixed all .d.ts files in ${k.reset(`'${dtsPath}'`)}`)); +} +catch(err) { + console.error(k.red(`Encountered error while fixing .d.ts files in ${k.reset(`'${dtsPath}'`)}:\n`), err); +} diff --git a/tools/post-build-global.mts b/tools/post-build-global.mts index 2eaf39e..915c9fc 100644 --- a/tools/post-build-global.mts +++ b/tools/post-build-global.mts @@ -1,5 +1,6 @@ import { access, constants as fsconstants, readFile, writeFile } from "node:fs/promises"; import { resolve } from "node:path"; +import k from "kleur"; import pkg from "../package.json" with { type: "json" }; const { exit } = process; @@ -43,7 +44,7 @@ async function run() { .replace(/^\s*'use strict';\s*(\r?\n){1,2}/gm, ""); await writeFile(iifeBundlePath, finalBundle, "utf8"); - console.log(`\x1b[32mGlobal bundle at path \x1b[0m'${iifeBundlePath}'\x1b[32m has been updated\x1b[0m`); + console.log(k.green(`Successfully updated global bundle at path ${k.reset(`'${iifeBundlePath}'`)}\n`)); setImmediate(() => exit(0)); }