Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@
"bin": {
"discloud": "bin/discloud"
},
"engines": {
"node": ">=20.12"
},
"scripts": {
"watch": "npm-run-all -p watch:*",
"watch:esbuild": "node esbuild.mjs --watch",
"watch:tsc": "tsc --noEmit --watch",
"prepublish": "node esbuild.mjs --production",
"test": "npm run test:ts && tsc --outDir out && npm run test:node",
"prepublish": "npm run build",
"build": "node esbuild.mjs --production",
"test": "npm run test:ts && npm run build && npm run test:node",
"test:node": "node --test \"**/test/**/*.test.?(c|m)js\"",
"test:ts": "tsc --noEmit"
},
Expand All @@ -28,7 +32,6 @@
"@discloudapp/util": "^0.10.5",
"@inquirer/prompts": "^7.5.3",
"adm-zip": "^0.5.16",
"chalk": "^5.4.1",
"easy-table": "^1.2.0",
"ejs": "^3.1.10",
"glob": "^11.0.2",
Expand Down
20 changes: 10 additions & 10 deletions src/structures/print/console.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { type RESTApiBaseResult } from "@discloudapp/api-types/v2";
import chalk from "chalk";
import Table from "easy-table";
import ora, { type Ora } from "ora";
import { styleText } from "util";
import type Core from "../../core";
import { type IPrint } from "../../interfaces/print";

Expand Down Expand Up @@ -32,7 +32,7 @@ export default class ConsolePrint implements IPrint {
bold(first: any, ...args: any) {
this.#stopSpin();

if (typeof first === "string") return console.log(chalk.bold(first), ...args);
if (typeof first === "string") return console.log(styleText("bold", first), ...args);
console.log(first, ...args);
}

Expand All @@ -54,15 +54,15 @@ export default class ConsolePrint implements IPrint {
error(first: any, ...args: any) {
this.#stopSpin();

if (typeof first === "string") return console.error(`%s ${first}`, chalk.red("[error]"), ...args);
console.error(chalk.red("[error]"), first, ...args);
if (typeof first === "string") return console.error(`%s ${first}`, styleText("red", "[error]"), ...args);
console.error(styleText("red", "[error]"), first, ...args);
}

info(first: any, ...args: any) {
this.#stopSpin();

if (typeof first === "string") return console.info(`%s ${first}`, chalk.blue("[info]"), ...args);
console.info(chalk.blue("[info]"), first, ...args);
if (typeof first === "string") return console.info(`%s ${first}`, styleText("blue", "[info]"), ...args);
console.info(styleText("blue", "[info]"), first, ...args);
}

log(...args: any) {
Expand All @@ -85,8 +85,8 @@ export default class ConsolePrint implements IPrint {
success(first: any, ...args: any): void {
this.#stopSpin();

if (typeof first === "string") return console.log(`%s ${first}`, chalk.green("[success]"), ...args);
console.log(chalk.green("[success]"), first, ...args);
if (typeof first === "string") return console.log(`%s ${first}`, styleText("green", "[success]"), ...args);
console.log(styleText("green", "[success]"), first, ...args);
}

table<T>(objOrArray: T, excludeKeys?: any[]) {
Expand All @@ -100,8 +100,8 @@ export default class ConsolePrint implements IPrint {
warn(first: any, ...args: any): void {
this.#stopSpin();

if (typeof first === "string") return console.warn(`%s ${first}`, chalk.yellow("[warn]"), ...args);
console.warn(chalk.yellow("[warn]"), first, ...args);
if (typeof first === "string") return console.warn(`%s ${first}`, styleText("yellow", "[warn]"), ...args);
console.warn(styleText("yellow", "[warn]"), first, ...args);
}

write(text: string) {
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,7 @@ chalk@^4.0.0, chalk@^4.0.2:
ansi-styles "^4.1.0"
supports-color "^7.1.0"

chalk@^5.2.0, chalk@^5.3.0, chalk@^5.4.1:
chalk@^5.2.0, chalk@^5.3.0:
version "5.4.1"
resolved "https://registry.yarnpkg.com/chalk/-/chalk-5.4.1.tgz#1b48bf0963ec158dce2aacf69c093ae2dd2092d8"
integrity sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==
Expand Down
Loading