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: allow using ES imports syntax in the controllers #15

Merged
merged 7 commits into from
Oct 26, 2021
Merged

Conversation

rchl
Copy link
Collaborator

@rchl rchl commented Oct 25, 2021

Convert the code to use the ES imports syntax to enable controllers to
use the ES imports syntax.

While this appears to be just a refactor, it actually allows the user
to use the ES imports syntax in the controllers so I'm considering it
a fix (or a feature, depending on how you look at it).

Fixes #12

Convert the code to use the ES imports syntax to enable controllers to
use the ES imports syntax.

While this appears to be just a refactor, it actually allows the user
to use the ES imports syntax in the controllers so I'm considering it
a fix (or a feature, depending on how you look at it).

Fixes #12
@rchl
Copy link
Collaborator Author

rchl commented Oct 25, 2021

I'm aware that this would normally be a nightmare to review since it's almost impossible to verify that all the interleaving code is working properly and that the returned promises are awaited when needed (especially with lacking types). But hopefully once I get tests to pass it will be enough of a confirmation that things are sound.

@rchl
Copy link
Collaborator Author

rchl commented Oct 25, 2021

Tests pass locally but fail in CI. Maybe just need a higher timeout on CI...

@rchl
Copy link
Collaborator Author

rchl commented Oct 25, 2021

Higher timeout helped. The tests might be a bit slower because they run through esm now.

I'm not sure what codecov is on about.

@ezypeeze
Copy link
Owner

ezypeeze commented Oct 26, 2021

Excellent work!

About the codecov, these looks to be the problem (istanbuljs/nyc#1287 (comment))

EDIT
Did some commits to try to fix this on your PR, hope you don't mind :)

EDIT 2
Worked well, it even increased the coverage rate 🎆
https://codecov.io/gh/ezypeeze/nuxt-neo/commit/2a40f7361ad7b1b750de3d2beaca6a00a7092f26/

@codecov-commenter
Copy link

codecov-commenter commented Oct 26, 2021

Codecov Report

Merging #15 (106e704) into master (3431b1b) will increase coverage by 5.16%.
The diff coverage is 97.18%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #15      +/-   ##
==========================================
+ Coverage   90.95%   96.11%   +5.16%     
==========================================
  Files           5        5              
  Lines         199      567     +368     
==========================================
+ Hits          181      545     +364     
- Misses         18       22       +4     
Impacted Files Coverage Δ
lib/module.js 83.33% <77.77%> (+8.33%) ⬆️
lib/server_middleware/api.js 100.00% <100.00%> (+4.34%) ⬆️
lib/utility/body_parser.js 100.00% <100.00%> (ø)
lib/utility/controllers.js 100.00% <100.00%> (+3.61%) ⬆️
lib/utility/http_errors.js 80.00% <0.00%> (+8.57%) ⬆️

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 3431b1b...106e704. Read the comment docs.

Copy link
Collaborator Author

@rchl rchl left a comment

Choose a reason for hiding this comment

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

Your changes look great. Just made a one minor comment.

.eslintrc Show resolved Hide resolved
@rchl
Copy link
Collaborator Author

rchl commented Oct 26, 2021

Current changes look good to me.

Not sure what kind of merge strategy do you prefer: squash and merge everything into one commit or keep some of your separate (in which case I would have to rewrite history to squash my fixups).

@ezypeeze
Copy link
Owner

Current changes look good to me.

Not sure what kind of merge strategy do you prefer: squash and merge everything into one commit or keep some of your separate (in which case I would have to rewrite history to squash my fixups).

I normally prefer squash commits, keeps the master clean, what about you?

@rchl
Copy link
Collaborator Author

rchl commented Oct 26, 2021

Yes, same.

@rchl rchl changed the title fix: allow using the ES imports syntax in the controllers fix: allow using ES imports syntax in the controllers Oct 26, 2021
@rchl rchl merged commit 3af9aad into master Oct 26, 2021
@rchl rchl deleted the fix/es-imports branch October 26, 2021 18:52
@ezypeeze
Copy link
Owner

Yes, same.

Sweet, should we release a minor version for this?

@rchl
Copy link
Collaborator Author

rchl commented Oct 26, 2021

Let's do so right after handling some dependency updates (most are "dev" so not really relevant but just to be done with it).

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

Successfully merging this pull request may close these issues.

ES syntax not supported in api controllers
3 participants