feat(cli, config): cli.bannerColor option (#6399)

This commit is contained in:
Daniel Roe 2019-09-30 10:46:58 +02:00 committed by Pooya Parsa
parent 578d5d41f4
commit 46a7a67ad4
6 changed files with 15 additions and 5 deletions

View File

@ -20,7 +20,8 @@ export function showBanner (nuxt, showMemoryUsage = true) {
const messageLines = []
// 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
titleLines.push(`Running in ${nuxt.options.dev ? chalk.bold.blue('development') : chalk.bold.green('production')} mode (${chalk.bold(nuxt.options.mode)})`)

View File

@ -17,7 +17,9 @@ describe('cli/utils', () => {
showBanner({
options: {
cli: {}
cli: {
bannerColor: 'green'
}
},
server: {
listeners

View File

@ -129,6 +129,7 @@ describe('cli/utils', () => {
jest.spyOn(fmt, 'successBox').mockImplementation(successBox)
const badgeMessages = [ 'badgeMessage' ]
const bannerColor = 'green'
const listeners = [
{ url: 'first' },
{ url: 'second' }
@ -137,7 +138,8 @@ describe('cli/utils', () => {
showBanner({
options: {
cli: {
badgeMessages
badgeMessages,
bannerColor
}
},
server: {
@ -163,7 +165,8 @@ describe('cli/utils', () => {
showBanner({
options: {
cli: {
badgeMessages: []
badgeMessages: [],
bannerColor: 'green'
}
},
server: {

View File

@ -1,3 +1,4 @@
export default () => ({
badgeMessages: []
badgeMessages: [],
bannerColor: 'green'
})

View File

@ -149,6 +149,7 @@ Object {
"buildModules": Array [],
"cli": Object {
"badgeMessages": Array [],
"bannerColor": "green",
},
"css": Array [],
"debug": false,

View File

@ -129,6 +129,7 @@ Object {
"buildModules": Array [],
"cli": Object {
"badgeMessages": Array [],
"bannerColor": "green",
},
"css": Array [],
"debug": undefined,
@ -480,6 +481,7 @@ Object {
"buildModules": Array [],
"cli": Object {
"badgeMessages": Array [],
"bannerColor": "green",
},
"css": Array [],
"debug": undefined,