mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
feat(cli, config): cli.bannerColor
option (#6399)
This commit is contained in:
parent
578d5d41f4
commit
46a7a67ad4
@ -20,7 +20,8 @@ export function showBanner (nuxt, showMemoryUsage = true) {
|
|||||||
const messageLines = []
|
const messageLines = []
|
||||||
|
|
||||||
// Name and version
|
// Name and version
|
||||||
titleLines.push(`${chalk.green.bold('Nuxt.js')} ${nuxt.constructor.version}`)
|
const { bannerColor } = nuxt.options.cli
|
||||||
|
titleLines.push(`${chalk[bannerColor].bold('Nuxt.js')} ${nuxt.constructor.version}`)
|
||||||
|
|
||||||
// Running mode
|
// Running mode
|
||||||
titleLines.push(`Running in ${nuxt.options.dev ? chalk.bold.blue('development') : chalk.bold.green('production')} mode (${chalk.bold(nuxt.options.mode)})`)
|
titleLines.push(`Running in ${nuxt.options.dev ? chalk.bold.blue('development') : chalk.bold.green('production')} mode (${chalk.bold(nuxt.options.mode)})`)
|
||||||
|
@ -17,7 +17,9 @@ describe('cli/utils', () => {
|
|||||||
|
|
||||||
showBanner({
|
showBanner({
|
||||||
options: {
|
options: {
|
||||||
cli: {}
|
cli: {
|
||||||
|
bannerColor: 'green'
|
||||||
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
listeners
|
listeners
|
||||||
|
@ -129,6 +129,7 @@ describe('cli/utils', () => {
|
|||||||
jest.spyOn(fmt, 'successBox').mockImplementation(successBox)
|
jest.spyOn(fmt, 'successBox').mockImplementation(successBox)
|
||||||
|
|
||||||
const badgeMessages = [ 'badgeMessage' ]
|
const badgeMessages = [ 'badgeMessage' ]
|
||||||
|
const bannerColor = 'green'
|
||||||
const listeners = [
|
const listeners = [
|
||||||
{ url: 'first' },
|
{ url: 'first' },
|
||||||
{ url: 'second' }
|
{ url: 'second' }
|
||||||
@ -137,7 +138,8 @@ describe('cli/utils', () => {
|
|||||||
showBanner({
|
showBanner({
|
||||||
options: {
|
options: {
|
||||||
cli: {
|
cli: {
|
||||||
badgeMessages
|
badgeMessages,
|
||||||
|
bannerColor
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
@ -163,7 +165,8 @@ describe('cli/utils', () => {
|
|||||||
showBanner({
|
showBanner({
|
||||||
options: {
|
options: {
|
||||||
cli: {
|
cli: {
|
||||||
badgeMessages: []
|
badgeMessages: [],
|
||||||
|
bannerColor: 'green'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
server: {
|
server: {
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
export default () => ({
|
export default () => ({
|
||||||
badgeMessages: []
|
badgeMessages: [],
|
||||||
|
bannerColor: 'green'
|
||||||
})
|
})
|
||||||
|
@ -149,6 +149,7 @@ Object {
|
|||||||
"buildModules": Array [],
|
"buildModules": Array [],
|
||||||
"cli": Object {
|
"cli": Object {
|
||||||
"badgeMessages": Array [],
|
"badgeMessages": Array [],
|
||||||
|
"bannerColor": "green",
|
||||||
},
|
},
|
||||||
"css": Array [],
|
"css": Array [],
|
||||||
"debug": false,
|
"debug": false,
|
||||||
|
@ -129,6 +129,7 @@ Object {
|
|||||||
"buildModules": Array [],
|
"buildModules": Array [],
|
||||||
"cli": Object {
|
"cli": Object {
|
||||||
"badgeMessages": Array [],
|
"badgeMessages": Array [],
|
||||||
|
"bannerColor": "green",
|
||||||
},
|
},
|
||||||
"css": Array [],
|
"css": Array [],
|
||||||
"debug": undefined,
|
"debug": undefined,
|
||||||
@ -480,6 +481,7 @@ Object {
|
|||||||
"buildModules": Array [],
|
"buildModules": Array [],
|
||||||
"cli": Object {
|
"cli": Object {
|
||||||
"badgeMessages": Array [],
|
"badgeMessages": Array [],
|
||||||
|
"bannerColor": "green",
|
||||||
},
|
},
|
||||||
"css": Array [],
|
"css": Array [],
|
||||||
"debug": undefined,
|
"debug": undefined,
|
||||||
|
Loading…
Reference in New Issue
Block a user