Skip to content

Commit 2d66b7b

Browse files
committed
fix: revert "perf(deps): replace debug with obug (#21107)"
This reverts commit acfe939.
1 parent a668014 commit 2d66b7b

File tree

8 files changed

+358
-202
lines changed

8 files changed

+358
-202
lines changed

.github/renovate.json5

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636

3737
// breaking changes
3838
"kill-port", // `kill-port:^2.0.0 has perf issues (#8392)
39-
40-
// v1 is a drop-in replacement for debug, while v2 introduces breaking changes
41-
"obug",
4239
],
4340
"github-actions": {
4441
"managerFilePatterns": [

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"@types/babel__preset-env": "^7.10.0",
4747
"@types/convert-source-map": "^2.0.3",
4848
"@types/cross-spawn": "^6.0.6",
49+
"@types/debug": "^4.1.12",
4950
"@types/estree": "^1.0.8",
5051
"@types/etag": "^1.8.4",
5152
"@types/less": "^3.0.8",
@@ -64,7 +65,7 @@
6465
"picocolors": "^1.1.1",
6566
"playwright-chromium": "^1.56.1",
6667
"prettier": "3.6.2",
67-
"rolldown": "^1.0.0-beta.51",
68+
"rolldown": "^1.0.0-beta.50",
6869
"rollup": "^4.43.0",
6970
"simple-git-hooks": "^2.13.1",
7071
"tsx": "^4.20.6",

packages/vite/LICENSE.md

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,33 @@ Repository: https://github.com/mathiasbynens/cssesc
534534
535535
---------------------------------------
536536

537+
## debug
538+
License: MIT
539+
By: Josh Junon, TJ Holowaychuk, Nathan Rajlich, Andrew Rhyne
540+
Repository: https://github.com/debug-js/debug
541+
542+
> (The MIT License)
543+
>
544+
> Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
545+
> Copyright (c) 2018-2021 Josh Junon
546+
>
547+
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software
548+
> and associated documentation files (the 'Software'), to deal in the Software without restriction,
549+
> including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
550+
> and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
551+
> subject to the following conditions:
552+
>
553+
> The above copyright notice and this permission notice shall be included in all copies or substantial
554+
> portions of the Software.
555+
>
556+
> THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
557+
> LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
558+
> IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
559+
> WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
560+
> SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
561+
562+
---------------------------------------
563+
537564
## dotenv
538565
License: BSD-2-Clause
539566
Repository: https://github.com/motdotla/dotenv
@@ -1295,14 +1322,13 @@ Repository: https://github.com/lukeed/mrmime
12951322
12961323
---------------------------------------
12971324

1298-
## normalize-path
1325+
## ms
12991326
License: MIT
1300-
By: Jon Schlinkert, Blaine Bublitz
1301-
Repository: https://github.com/jonschlinkert/normalize-path
1327+
Repository: https://github.com/vercel/ms
13021328

13031329
> The MIT License (MIT)
13041330
>
1305-
> Copyright (c) 2014-2018, Jon Schlinkert.
1331+
> Copyright (c) 2020 Vercel, Inc.
13061332
>
13071333
> Permission is hereby granted, free of charge, to any person obtaining a copy
13081334
> of this software and associated documentation files (the "Software"), to deal
@@ -1311,27 +1337,27 @@ Repository: https://github.com/jonschlinkert/normalize-path
13111337
> copies of the Software, and to permit persons to whom the Software is
13121338
> furnished to do so, subject to the following conditions:
13131339
>
1314-
> The above copyright notice and this permission notice shall be included in
1315-
> all copies or substantial portions of the Software.
1340+
> The above copyright notice and this permission notice shall be included in all
1341+
> copies or substantial portions of the Software.
13161342
>
13171343
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13181344
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13191345
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13201346
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13211347
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1322-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1323-
> THE SOFTWARE.
1348+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1349+
> SOFTWARE.
13241350
13251351
---------------------------------------
13261352

1327-
## object-assign
1353+
## normalize-path
13281354
License: MIT
1329-
By: Sindre Sorhus
1330-
Repository: https://github.com/sindresorhus/object-assign
1355+
By: Jon Schlinkert, Blaine Bublitz
1356+
Repository: https://github.com/jonschlinkert/normalize-path
13311357

13321358
> The MIT License (MIT)
13331359
>
1334-
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
1360+
> Copyright (c) 2014-2018, Jon Schlinkert.
13351361
>
13361362
> Permission is hereby granted, free of charge, to any person obtaining a copy
13371363
> of this software and associated documentation files (the "Software"), to deal
@@ -1353,16 +1379,14 @@ Repository: https://github.com/sindresorhus/object-assign
13531379
13541380
---------------------------------------
13551381

1356-
## obug
1382+
## object-assign
13571383
License: MIT
1358-
By: Kevin Deng
1359-
Repository: https://github.com/sxzz/obug
1384+
By: Sindre Sorhus
1385+
Repository: https://github.com/sindresorhus/object-assign
13601386

13611387
> The MIT License (MIT)
13621388
>
1363-
> Copyright © 2025-PRESENT Kevin Deng (https://github.com/sxzz)
1364-
> Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
1365-
> Copyright (c) 2018-2021 Josh Junon
1389+
> Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
13661390
>
13671391
> Permission is hereby granted, free of charge, to any person obtaining a copy
13681392
> of this software and associated documentation files (the "Software"), to deal
@@ -1371,16 +1395,16 @@ Repository: https://github.com/sxzz/obug
13711395
> copies of the Software, and to permit persons to whom the Software is
13721396
> furnished to do so, subject to the following conditions:
13731397
>
1374-
> The above copyright notice and this permission notice shall be included in all
1375-
> copies or substantial portions of the Software.
1398+
> The above copyright notice and this permission notice shall be included in
1399+
> all copies or substantial portions of the Software.
13761400
>
13771401
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
13781402
> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13791403
> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13801404
> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
13811405
> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1382-
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1383-
> SOFTWARE.
1406+
> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1407+
> THE SOFTWARE.
13841408
13851409
---------------------------------------
13861410

packages/vite/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
"convert-source-map": "^2.0.0",
113113
"cors": "^2.8.5",
114114
"cross-spawn": "^7.0.6",
115-
"obug": "^1.0.2",
115+
"debug": "^4.4.3",
116116
"dotenv": "^17.2.3",
117117
"dotenv-expand": "^12.0.3",
118118
"es-module-lexer": "^1.7.0",
@@ -137,8 +137,8 @@
137137
"postcss-modules": "^6.0.1",
138138
"premove": "^4.0.0",
139139
"resolve.exports": "^2.0.3",
140-
"rolldown": "^1.0.0-beta.51",
141-
"rolldown-plugin-dts": "^0.18.0",
140+
"rolldown": "^1.0.0-beta.50",
141+
"rolldown-plugin-dts": "^0.17.8",
142142
"rollup-plugin-license": "^3.6.0",
143143
"sass": "^1.94.0",
144144
"sass-embedded": "^1.93.3",

packages/vite/rolldown.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ const nodeConfig = defineConfig({
7575
index: path.resolve(__dirname, 'src/node/index.ts'),
7676
cli: path.resolve(__dirname, 'src/node/cli.ts'),
7777
},
78+
resolve: {
79+
alias: {
80+
// we can always use node version (the default entry point has browser support)
81+
debug: 'debug/src/node.js',
82+
},
83+
},
7884
external: [
7985
/^vite\//,
8086
'fsevents',

packages/vite/src/node/utils.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ import fsp from 'node:fs/promises'
1414
import remapping from '@jridgewell/remapping'
1515
import type { DecodedSourceMap, RawSourceMap } from '@jridgewell/remapping'
1616
import colors from 'picocolors'
17-
import type { Debugger } from 'obug'
18-
import debug from 'obug'
17+
import debug from 'debug'
1918
import type MagicString from 'magic-string'
2019
import type { Equal } from '@type-challenges/utils'
2120

@@ -184,11 +183,13 @@ export type ViteDebugScope = `vite:${string}`
184183
export function createDebugger(
185184
namespace: ViteDebugScope,
186185
options: DebuggerOptions = {},
187-
): Debugger['log'] | undefined {
186+
): debug.Debugger['log'] | undefined {
188187
const log = debug(namespace)
189188
const { onlyWhenFocused, depth } = options
190189

190+
// @ts-expect-error - The log function is bound to inspectOpts, but the type is not reflected
191191
if (depth && log.inspectOpts && log.inspectOpts.depth == null) {
192+
// @ts-expect-error - The log function is bound to inspectOpts, but the type is not reflected
192193
log.inspectOpts.depth = options.depth
193194
}
194195

0 commit comments

Comments
 (0)