Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Sep 30, 2019

Conversation

danielroe
Copy link
Member

@danielroe danielroe commented Sep 11, 2019

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

This exposes a build.bannerColor option to change the color of the Nuxt title in the CLI banner.

Resolves: #6397

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes
    I think that might be overkill for a simple cosmetic change
  • All new and existing tests are passing.

@codecov-io
Copy link

codecov-io commented Sep 11, 2019

Codecov Report

Merging #6399 into dev will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #6399      +/-   ##
==========================================
+ Coverage   95.65%   95.65%   +<.01%     
==========================================
  Files          79       79              
  Lines        2692     2693       +1     
  Branches      696      696              
==========================================
+ Hits         2575     2576       +1     
  Misses        101      101              
  Partials       16       16
Flag Coverage Δ
#e2e 100% <ø> (ø) ⬆️
#fixtures 50.68% <0%> (-0.02%) ⬇️
#unit 92.35% <100%> (ø) ⬆️
Impacted Files Coverage Δ
packages/config/src/config/cli.js 100% <ø> (ø) ⬆️
packages/cli/src/utils/banner.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 686720f...a42432d. Read the comment docs.

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't include typescript logic here. It may be better an option to customize color.

@danielroe danielroe changed the title feat(cli): display blue 'Nuxt' banner if running with TS feat(cli, config): exposes a build.ui.titleColor option to change the color of the Nuxt title Sep 26, 2019
@danielroe
Copy link
Member Author

We don't include typescript logic here. It may be better an option to customize color.

I've exposed a build.ui.titleColor option, with the idea that more ui options could be exposed in future. Is this the right location for this option? If so, I'll prepare a PR updating @nuxt/typescript and @nuxt/types.

@danielroe danielroe requested a review from pi0 September 26, 2019 12:57
Copy link

@galvez galvez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd call it bannerColor instead of ui.titleColor, since we don't immediately have any other options to place under that key.

@danielroe danielroe changed the title feat(cli, config): exposes a build.ui.titleColor option to change the color of the Nuxt title feat(cli, config): exposes a build.bannerColor option to change the color of the Nuxt title Sep 27, 2019
@danielroe
Copy link
Member Author

I'd call it bannerColor instead of ui.titleColor, since we don't immediately have any other options to place under that key.

Done!

@danielroe danielroe requested a review from galvez September 27, 2019 17:00
@@ -20,7 +20,11 @@ export function showBanner (nuxt, showMemoryUsage = true) {
const messageLines = []

// Name and version
titleLines.push(`${chalk.green.bold('Nuxt.js')} ${nuxt.constructor.version}`)
let bannerColor = 'green'
if (nuxt.options.build) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a CLI config why in build namespace? 🤔We have config/cli namespace.

@@ -20,7 +20,11 @@ export function showBanner (nuxt, showMemoryUsage = true) {
const messageLines = []

// Name and version
titleLines.push(`${chalk.green.bold('Nuxt.js')} ${nuxt.constructor.version}`)
let bannerColor = 'green'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep defaults in config package (test snapshots require update)

Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks ❤️

@pi0 pi0 changed the title feat(cli, config): exposes a build.bannerColor option to change the color of the Nuxt title feat(cli, config): config.bannerColor option Sep 30, 2019
@pi0 pi0 changed the title feat(cli, config): config.bannerColor option feat(cli, config): cli.bannerColor option Sep 30, 2019
@pi0 pi0 merged commit 46a7a67 into nuxt:dev Sep 30, 2019
@pi0 pi0 mentioned this pull request Sep 30, 2019
@danielroe danielroe deleted the add-blue-for-typescript branch September 30, 2019 13:15
@kevinmarrec
Copy link
Contributor

@danielroe @pi0 Is there any reason the banner border color hasn't be set to the new option ? :P

@kevinmarrec
Copy link
Contributor

image

@Exeteres
Copy link

Exeteres commented Oct 1, 2019

I have the same question 😳

@danielroe
Copy link
Member Author

@kevinmarrec @Exeteres I like the idea! (Mind you, in production mode there will be green in the picture too.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change banner color
6 participants