Skip to content

Commit acc5152

Browse files
sxzzAriPerkkio
andauthored
perf: replace debug with obug (#9057)
Co-authored-by: Ari Perkkiö <[email protected]>
1 parent 9d1763d commit acc5152

File tree

14 files changed

+81
-141
lines changed

14 files changed

+81
-141
lines changed

packages/coverage-istanbul/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,16 @@
4545
},
4646
"dependencies": {
4747
"@istanbuljs/schema": "^0.1.3",
48-
"debug": "catalog:",
4948
"istanbul-lib-coverage": "catalog:",
5049
"istanbul-lib-instrument": "^6.0.3",
5150
"istanbul-lib-report": "catalog:",
5251
"istanbul-lib-source-maps": "catalog:",
5352
"istanbul-reports": "catalog:",
5453
"magicast": "catalog:",
54+
"obug": "catalog:",
5555
"tinyrainbow": "catalog:"
5656
},
5757
"devDependencies": {
58-
"@types/debug": "catalog:",
5958
"@types/istanbul-lib-coverage": "catalog:",
6059
"@types/istanbul-lib-instrument": "^1.7.8",
6160
"@types/istanbul-lib-report": "catalog:",

packages/coverage-istanbul/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vite, Vi
55
import { existsSync, promises as fs } from 'node:fs'
66
// @ts-expect-error missing types
77
import { defaults as istanbulDefaults } from '@istanbuljs/schema'
8-
import createDebug from 'debug'
98
import libCoverage from 'istanbul-lib-coverage'
109
import { createInstrumenter } from 'istanbul-lib-instrument'
1110
import libReport from 'istanbul-lib-report'
1211
import libSourceMaps from 'istanbul-lib-source-maps'
1312
import reports from 'istanbul-reports'
1413
import { parseModule } from 'magicast'
14+
import { createDebug } from 'obug'
1515
import c from 'tinyrainbow'
1616
import { BaseCoverageProvider } from 'vitest/coverage'
1717
import { isCSSRequest } from 'vitest/node'

packages/coverage-v8/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,16 @@
5757
"@bcoe/v8-coverage": "^1.0.2",
5858
"@vitest/utils": "workspace:*",
5959
"ast-v8-to-istanbul": "^0.3.8",
60-
"debug": "catalog:",
6160
"istanbul-lib-coverage": "catalog:",
6261
"istanbul-lib-report": "catalog:",
6362
"istanbul-lib-source-maps": "catalog:",
6463
"istanbul-reports": "catalog:",
6564
"magicast": "catalog:",
65+
"obug": "catalog:",
6666
"std-env": "catalog:",
6767
"tinyrainbow": "catalog:"
6868
},
6969
"devDependencies": {
70-
"@types/debug": "catalog:",
7170
"@types/istanbul-lib-coverage": "catalog:",
7271
"@types/istanbul-lib-report": "catalog:",
7372
"@types/istanbul-lib-source-maps": "catalog:",

packages/coverage-v8/src/provider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@ import { fileURLToPath } from 'node:url'
77
// @ts-expect-error -- untyped
88
import { mergeProcessCovs } from '@bcoe/v8-coverage'
99
import astV8ToIstanbul from 'ast-v8-to-istanbul'
10-
import createDebug from 'debug'
1110
import libCoverage from 'istanbul-lib-coverage'
1211
import libReport from 'istanbul-lib-report'
1312
import libSourceMaps from 'istanbul-lib-source-maps'
1413
import reports from 'istanbul-reports'
1514
import { parseModule } from 'magicast'
15+
import { createDebug } from 'obug'
1616
import { normalize } from 'pathe'
1717
import { provider } from 'std-env'
1818
import c from 'tinyrainbow'

packages/vitest/package.json

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@
135135
"peerDependencies": {
136136
"@edge-runtime/vm": "*",
137137
"@opentelemetry/api": "^1.9.0",
138-
"@types/debug": "^4.1.12",
139138
"@types/node": "^20.0.0 || ^22.0.0 || >=24.0.0",
140139
"@vitest/browser-playwright": "workspace:*",
141140
"@vitest/browser-preview": "workspace:*",
@@ -151,9 +150,6 @@
151150
"@opentelemetry/api": {
152151
"optional": true
153152
},
154-
"@types/debug": {
155-
"optional": true
156-
},
157153
"@types/node": {
158154
"optional": true
159155
},
@@ -184,10 +180,10 @@
184180
"@vitest/snapshot": "workspace:*",
185181
"@vitest/spy": "workspace:*",
186182
"@vitest/utils": "workspace:*",
187-
"debug": "catalog:",
188183
"es-module-lexer": "^1.7.0",
189184
"expect-type": "^1.2.2",
190185
"magic-string": "catalog:",
186+
"obug": "catalog:",
191187
"pathe": "catalog:",
192188
"picomatch": "^4.0.3",
193189
"std-env": "catalog:",
@@ -204,7 +200,6 @@
204200
"@jridgewell/trace-mapping": "catalog:",
205201
"@opentelemetry/api": "^1.9.0",
206202
"@sinonjs/fake-timers": "14.0.0",
207-
"@types/debug": "catalog:",
208203
"@types/estree": "catalog:",
209204
"@types/istanbul-lib-coverage": "catalog:",
210205
"@types/istanbul-reports": "catalog:",

packages/vitest/src/utils/debugger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { Debugger } from 'debug'
2-
import createDebug from 'debug'
1+
import type { Debugger } from 'obug'
2+
import { createDebug } from 'obug'
33

44
export function createDebugger(namespace: `vitest:${string}`): Debugger | undefined {
55
const debug = createDebug(namespace)

packages/web-worker/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@
4141
"vitest": "workspace:*"
4242
},
4343
"dependencies": {
44-
"debug": "catalog:"
44+
"obug": "catalog:"
4545
},
4646
"devDependencies": {
47-
"@types/debug": "catalog:",
4847
"@types/ungap__structured-clone": "^1.2.0",
4948
"@ungap/structured-clone": "^1.3.0"
5049
}

packages/web-worker/src/utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1+
import type { Debugger } from 'obug'
12
import type { WorkerGlobalState } from 'vitest'
23
import type { CloneOption } from './types'
34
import ponyfillStructuredClone from '@ungap/structured-clone'
4-
import createDebug from 'debug'
5+
import { createDebug } from 'obug'
56

6-
export const debug: createDebug.Debugger = createDebug('vitest:web-worker')
7+
export const debug: Debugger = createDebug('vitest:web-worker')
78

89
export function getWorkerState(): WorkerGlobalState {
910
// @ts-expect-error untyped global

0 commit comments

Comments
 (0)