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 = [] 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)})`)

View File

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

View File

@ -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: {

View File

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

View File

@ -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,

View File

@ -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,