mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 05:35:13 +00:00
chore: use consola to log out compatibility info (#28854)
This commit is contained in:
parent
5a5bc5d606
commit
2c1dfcf81d
@ -104,8 +104,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
|
|
||||||
const shouldShowPrompt = nuxt.options.dev && hasTTY && !isCI
|
const shouldShowPrompt = nuxt.options.dev && hasTTY && !isCI
|
||||||
if (!shouldShowPrompt) {
|
if (!shouldShowPrompt) {
|
||||||
// eslint-disable-next-line no-console
|
logger.info(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
||||||
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function promptAndUpdate () {
|
async function promptAndUpdate () {
|
||||||
@ -114,8 +113,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
default: true,
|
default: true,
|
||||||
})
|
})
|
||||||
if (result !== true) {
|
if (result !== true) {
|
||||||
// eslint-disable-next-line no-console
|
logger.info(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
||||||
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +147,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
consola.error(`Failed to update config: ${message}`)
|
consola.error(`Failed to update config: ${message}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-console
|
logger.info(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
||||||
console.log(`Using \`${fallbackCompatibilityDate}\` as fallback compatibility date.`)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
nuxt.hooks.hookOnce('nitro:init', (nitro) => {
|
nuxt.hooks.hookOnce('nitro:init', (nitro) => {
|
||||||
@ -159,8 +156,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
nitro.hooks.hookOnce('compiled', () => {
|
nitro.hooks.hookOnce('compiled', () => {
|
||||||
warnedAboutCompatDate = true
|
warnedAboutCompatDate = true
|
||||||
// Print warning
|
// Print warning
|
||||||
// eslint-disable-next-line no-console
|
logger.info(`Nuxt now supports pinning the behavior of provider and deployment presets with a compatibility date. We recommend you specify a \`compatibilityDate\` in your \`nuxt.config\` file, or set an environment variable, such as \`COMPATIBILITY_DATE=${todaysDate}\`.`)
|
||||||
console.info(`Nuxt now supports pinning the behavior of provider and deployment presets with a compatibility date. We recommend you specify a \`compatibilityDate\` in your \`nuxt.config\` file, or set an environment variable, such as \`COMPATIBILITY_DATE=${todaysDate}\`.`)
|
|
||||||
if (shouldShowPrompt) { promptAndUpdate() }
|
if (shouldShowPrompt) { promptAndUpdate() }
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -669,8 +665,7 @@ async function initNuxt (nuxt: Nuxt) {
|
|||||||
// Show compatibility version banner when Nuxt is running with a compatibility version
|
// Show compatibility version banner when Nuxt is running with a compatibility version
|
||||||
// that is different from the current major version
|
// that is different from the current major version
|
||||||
if (!(satisfies(nuxt._version, nuxt.options.future.compatibilityVersion + '.x'))) {
|
if (!(satisfies(nuxt._version, nuxt.options.future.compatibilityVersion + '.x'))) {
|
||||||
// eslint-disable-next-line no-console
|
logger.info(`Running with compatibility version \`${nuxt.options.future.compatibilityVersion}\``)
|
||||||
console.info(`Running with compatibility version \`${nuxt.options.future.compatibilityVersion}\``)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
await nuxt.callHook('ready', nuxt)
|
await nuxt.callHook('ready', nuxt)
|
||||||
|
Loading…
Reference in New Issue
Block a user