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

feat(builder): support adding custom middlewares #6342

Merged
merged 2 commits into from
Sep 2, 2019

Conversation

pimlie
Copy link

@pimlie pimlie commented Sep 2, 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

It seems that the middleware template in vue-app contains some business logic which should be moved to the builder class. This logic prevents me from adding a custom middleware (using the build:templates hook) in nuxt/press which has a webpack alias as path so it cant/shouldnt be resolved with relativeToBuild.

This pr moves that logic into the resolveMiddleware method of the builder class. Not sure if its needed, but to prevent a breaking change I have kept the resolve logic in the middleware template for now.

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.

@pimlie pimlie requested a review from a team September 2, 2019 09:13
galvez
galvez previously approved these changes Sep 2, 2019
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.

+1

@codecov-io
Copy link

codecov-io commented Sep 2, 2019

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff            @@
##             dev    #6342      +/-   ##
=========================================
+ Coverage   95.7%   95.71%   +<.01%     
=========================================
  Files         79       79              
  Lines       2656     2661       +5     
  Branches     685      685              
=========================================
+ Hits        2542     2547       +5     
  Misses        98       98              
  Partials      16       16
Flag Coverage Δ
#e2e 100% <ø> (ø) ⬆️
#fixtures 50.65% <100%> (+0.09%) ⬆️
#unit 92.37% <100%> (+0.01%) ⬆️
Impacted Files Coverage Δ
packages/builder/src/builder.js 99.62% <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 0daaf87...402b76c. Read the comment docs.

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.

5 participants