diff --git a/cli/package.json b/cli/package.json index 7c67ec13..4bcb0d9a 100644 --- a/cli/package.json +++ b/cli/package.json @@ -66,10 +66,10 @@ "@octokit/rest": "^22.0.1", "clipanion": "^4.0.0-rc.4", "colorette": "^2.0.20", - "debug": "^4.4.3", "emnapi": "^1.7.0", "es-toolkit": "^1.41.0", "js-yaml": "^4.1.0", + "obug": "^2.0.0", "semver": "^7.7.3", "typanion": "^3.14.0" }, @@ -77,7 +77,6 @@ "@emnapi/runtime": "^1.7.0", "@oxc-node/core": "^0.0.34", "@std/toml": "npm:@jsr/std__toml@^1.0.11", - "@types/debug": "^4.1.12", "@types/inquirer": "^9.0.9", "@types/js-yaml": "^4.0.9", "@types/node": "^24.10.0", diff --git a/cli/src/utils/log.ts b/cli/src/utils/log.ts index d75e2c19..66b9aa98 100644 --- a/cli/src/utils/log.ts +++ b/cli/src/utils/log.ts @@ -1,12 +1,7 @@ import * as colors from 'colorette' -import rawDebug from 'debug' +import { createDebug } from 'obug' -// debug('%i', 'This is an info') -rawDebug.formatters.i = (v) => { - return colors.green(v) -} - -declare module 'debug' { +declare module 'obug' { interface Debugger { info: typeof console.error warn: typeof console.error @@ -15,7 +10,14 @@ declare module 'debug' { } export const debugFactory = (namespace: string) => { - const debug = rawDebug(`napi:${namespace}`) + const debug = createDebug(`napi:${namespace}`, { + formatters: { + // debug('%i', 'This is an info') + i(v) { + return colors.green(v) + }, + }, + }) debug.info = (...args: any[]) => console.error(colors.black(colors.bgGreen(' INFO ')), ...args) diff --git a/yarn.lock b/yarn.lock index f76b116b..e8a54380 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1132,7 +1132,6 @@ __metadata: "@octokit/rest": "npm:^22.0.1" "@oxc-node/core": "npm:^0.0.34" "@std/toml": "npm:@jsr/std__toml@^1.0.11" - "@types/debug": "npm:^4.1.12" "@types/inquirer": "npm:^9.0.9" "@types/js-yaml": "npm:^4.0.9" "@types/node": "npm:^24.10.0" @@ -1140,12 +1139,12 @@ __metadata: ava: "npm:^6.4.1" clipanion: "npm:^4.0.0-rc.4" colorette: "npm:^2.0.20" - debug: "npm:^4.4.3" emnapi: "npm:^1.7.0" empathic: "npm:^2.0.0" env-paths: "npm:^3.0.0" es-toolkit: "npm:^1.41.0" js-yaml: "npm:^4.1.0" + obug: "npm:^2.0.0" prettier: "npm:^3.6.2" semver: "npm:^7.7.3" tsdown: "npm:^0.16.1" @@ -10089,6 +10088,18 @@ __metadata: languageName: node linkType: hard +"obug@npm:^2.0.0": + version: 2.0.0 + resolution: "obug@npm:2.0.0" + peerDependencies: + ms: ^2.0.0 + peerDependenciesMeta: + ms: + optional: true + checksum: 10c0/6508c9e1bdeebfd940e13bd974833c3ed176fb07828b1e7aea5e51fcae3498ce8b4f1f7a7871fd4953a3e5ba445c9cd2824ccdf2488af7ee0f68dbecca29bf75 + languageName: node + linkType: hard + "once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0"