Skip to content
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

fix(config): normalize build.indicator: true to default value #8030

Merged
merged 4 commits into from Sep 9, 2020

Conversation

remigermain
Copy link

@remigermain remigermain commented Sep 7, 2020

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

when you set indicator to true in nuxt.config , the component nuxt-build-indicator build failed.
so when is set to true, we replace it by default value.
nuxt.config.js:

build: {
   indicator: true,
   ...
}

output: nuxt-build-indicator.vue

export default {
  ...
  computed: {
     // options is generate by template
     // options: () => (<%= JSON.stringify(buildIndicator) %>),
      options: () => (true),
      indicatorStyle () {
          const [d1, d2] = this.options.position.split('-') // error when access position in bollean
       ...
     }
  }
 ...
}

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. (PR: #)
  • I have added tests to cover my changes (if not applicable, please state why)
  • All new and existing tests are passing.

@codecov-commenter
Copy link

codecov-commenter commented Sep 7, 2020

Codecov Report

Merging #8030 into dev will decrease coverage by 0.00%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #8030      +/-   ##
==========================================
- Coverage   68.87%   68.86%   -0.01%     
==========================================
  Files          91       91              
  Lines        3849     3851       +2     
  Branches     1044     1045       +1     
==========================================
+ Hits         2651     2652       +1     
- Misses        971      972       +1     
  Partials      227      227              
Flag Coverage Δ
#unittests 68.86% <50.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
packages/config/src/options.js 94.87% <50.00%> (-0.39%) ⬇️

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 a7da6fd...4739072. Read the comment docs.

@@ -472,6 +472,12 @@ export function getNuxtConfig (_options) {

// ----- Builtin modules -----

// Indicator
// Change boolean true to default nuxt value
if (typeof options.build.indicator === 'boolean' && options.build.indicator) {
Copy link
Member

Choose a reason for hiding this comment

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

Can be options.build.indicator === true

@pi0 pi0 changed the title fix(config): indicator set to true fix(config): handle indicator: true Sep 9, 2020
@pi0 pi0 changed the title fix(config): handle indicator: true fix(config): normalize build.indicator: true to default value Sep 9, 2020
@pi0 pi0 merged commit 7e3532e into nuxt:dev Sep 9, 2020
@pi0
Copy link
Member

pi0 commented Sep 9, 2020

Thanks for PR @remigermain ❤️

@pi0 pi0 mentioned this pull request Sep 9, 2020
@danielroe danielroe added the 2.x label Jan 18, 2023
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.

None yet

5 participants