mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 07:05:11 +00:00
chore: upgrade to consola v3 (#20194)
This commit is contained in:
parent
d6c3c2439a
commit
f951a15232
@ -22,7 +22,7 @@
|
||||
"dependencies": {
|
||||
"@nuxt/schema": "workspace:../schema",
|
||||
"c12": "^1.2.0",
|
||||
"consola": "^3.0.0-3",
|
||||
"consola": "^3.0.1",
|
||||
"defu": "^6.1.2",
|
||||
"globby": "^13.1.3",
|
||||
"hash-sum": "^2.0.0",
|
||||
|
@ -29,7 +29,7 @@
|
||||
"clear": "^0.1.0",
|
||||
"clipboardy": "^3.0.0",
|
||||
"colorette": "^2.0.19",
|
||||
"consola": "^3.0.0-3",
|
||||
"consola": "^3.0.1",
|
||||
"deep-object-diff": "^1.1.9",
|
||||
"destr": "^1.2.2",
|
||||
"execa": "^7.1.1",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import mri from 'mri'
|
||||
import { red } from 'colorette'
|
||||
import type { Consola } from 'consola'
|
||||
import type { ConsolaReporter } from 'consola'
|
||||
import { consola } from 'consola'
|
||||
import { checkEngines } from './utils/engines'
|
||||
import type { Command, NuxtCommand } from './commands'
|
||||
@ -45,8 +45,7 @@ consola.wrapAll()
|
||||
|
||||
// Filter out unwanted logs
|
||||
// TODO: Use better API from consola for intercepting logs
|
||||
// TODO: export type from Consola
|
||||
const wrapReporter = (reporter: Consola['_reporters'][0]) => <Consola['_reporters'][0]> {
|
||||
const wrapReporter = (reporter: ConsolaReporter) => ({
|
||||
log (logObj, ctx) {
|
||||
if (!logObj.args || !logObj.args.length) { return }
|
||||
const msg = logObj.args[0]
|
||||
@ -62,8 +61,9 @@ const wrapReporter = (reporter: Consola['_reporters'][0]) => <Consola['_reporter
|
||||
}
|
||||
return reporter.log(logObj, ctx)
|
||||
}
|
||||
}
|
||||
consola._reporters = consola._reporters.map(wrapReporter)
|
||||
}) satisfies ConsolaReporter
|
||||
|
||||
consola.options.reporters = consola.options.reporters.map(wrapReporter)
|
||||
|
||||
process.on('unhandledRejection', err => consola.error('[unhandledRejection]', err))
|
||||
process.on('uncaughtException', err => consola.error('[uncaughtException]', err))
|
||||
|
@ -24,7 +24,7 @@
|
||||
"dependencies": {
|
||||
"@nuxt/kit": "workspace:../kit",
|
||||
"@nuxt/schema": "workspace:../schema",
|
||||
"consola": "^3.0.0-3",
|
||||
"consola": "^3.0.1",
|
||||
"defu": "^6.1.2",
|
||||
"execa": "^7.1.1",
|
||||
"get-port-please": "^3.0.1",
|
||||
|
@ -367,8 +367,8 @@ importers:
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0
|
||||
consola:
|
||||
specifier: ^3.0.0-3
|
||||
version: 3.0.0-3
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
defu:
|
||||
specifier: ^6.1.2
|
||||
version: 6.1.2
|
||||
@ -465,8 +465,8 @@ importers:
|
||||
specifier: ^2.0.19
|
||||
version: 2.0.19
|
||||
consola:
|
||||
specifier: ^3.0.0-3
|
||||
version: 3.0.0-3
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
deep-object-diff:
|
||||
specifier: ^1.1.9
|
||||
version: 1.1.9
|
||||
@ -755,8 +755,8 @@ importers:
|
||||
specifier: workspace:*
|
||||
version: link:../schema
|
||||
consola:
|
||||
specifier: ^3.0.0-3
|
||||
version: 3.0.0-3
|
||||
specifier: ^3.0.1
|
||||
version: 3.0.1
|
||||
defu:
|
||||
specifier: ^6.1.2
|
||||
version: 6.1.2
|
||||
@ -3800,8 +3800,8 @@ packages:
|
||||
/consola@2.15.3:
|
||||
resolution: {integrity: sha512-9vAdYbHj6x2fLKC4+oPH0kFzY/orMZyG2Aj+kNylHxKGJ/Ed4dpNyAQYwJOdqO4zdM7XpVHmyejQDcQHrnuXbw==}
|
||||
|
||||
/consola@3.0.0-3:
|
||||
resolution: {integrity: sha512-3vhBx7Qw5LlF1/QnaeoQSSA5fOohGr9xtHkQ1RFbNlr6kOTwtVz0FvUPx6CdobrDDSP19cj0uWwPtf+/+VBKQA==}
|
||||
/consola@3.0.1:
|
||||
resolution: {integrity: sha512-08E7bC2N6gaFdzPU/qtBi4ulVvJitYnfrDdxEiwElC3jSNICbOvkcE+8N56EfIrBoxp37O9Qnn5ZZPElov83UQ==}
|
||||
|
||||
/console-control-strings@1.1.0:
|
||||
resolution: {integrity: sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==}
|
||||
|
Loading…
Reference in New Issue
Block a user