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

Chore: refactor normalizeOptions and the resolver pipeline #159

Merged
merged 5 commits into from
Apr 9, 2017

Conversation

fatfisz
Copy link
Contributor

@fatfisz fatfisz commented Apr 9, 2017

This is the last one of my refactors. Changes here:

  • moving normalizeOptions to a separate file, which separates it from the visitor code. Makes the intent in index.js more clear IMO, because there is a lot less to look at now.
  • making resolvers into a pipeline-ish thing: there was a pattern which was repeated three times and so it made sense to let JS go over the resolvers in the right order (a bit more clear now - one array with all of them) instead of repeating the code.
  • moving types into state - a thing I experimented with in another plugin. It allows moving the visitor code out of the main export function, which I also did.
  • adding more tests for yet undocumented scenarios.

Edit: added the point about types.
Edit: added the point about the tests.

@fatfisz fatfisz self-assigned this Apr 9, 2017
@fatfisz fatfisz requested a review from tleunen April 9, 2017 12:01
@codecov
Copy link

codecov bot commented Apr 9, 2017

Codecov Report

Merging #159 into beta will not change coverage.
The diff coverage is 100%.

Impacted Files Coverage Δ
src/normalizeOptions.js 100% <100%> (ø)
src/getRealPath.js 100% <100%> (ø) ⬆️
src/index.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 f4dd533...5455f59. Read the comment docs.

@codecov
Copy link

codecov bot commented Apr 9, 2017

Codecov Report

Merging #159 into beta will not change coverage.
The diff coverage is 100%.

Impacted Files Coverage Δ
src/transformers/call.js 100% <100%> (ø) ⬆️
src/getRealPath.js 100% <100%> (ø) ⬆️
src/index.js 100% <100%> (ø) ⬆️
src/utils.js 100% <100%> (ø) ⬆️
src/normalizeOptions.js 100% <100%> (ø)
src/transformers/import.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 f4dd533...55f0545. Read the comment docs.

@tleunen
Copy link
Owner

tleunen commented Apr 9, 2017

Thanks @fatfisz. Looks good.

@tleunen tleunen merged commit e9f9bf6 into beta Apr 9, 2017
@tleunen tleunen deleted the yet-another-refactor branch April 9, 2017 17:19
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.

2 participants