Skip to content
This repository has been archived by the owner on May 11, 2018. It is now read-only.

Support spec option #98

Merged
merged 1 commit into from
Apr 14, 2017
Merged

Support spec option #98

merged 1 commit into from
Apr 14, 2017

Conversation

Jessidhia
Copy link
Member

Passes through spec to plugins.

I think this only affects arrow functions and template strings, but I haven't verified.

src/index.js Outdated
@@ -143,16 +143,24 @@ export const getTargets = (targets = {}) => {
return targetOps;
};

export const validateBoolOption = (name, value, defaultValue) => {
if (typeof value === "undefined") {
Copy link

Choose a reason for hiding this comment

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

Seems like a good place to use Lodash's isUndefined and isBoolean since it's already in the package.json.

Copy link
Member

Choose a reason for hiding this comment

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

in this particular case it's part of the plugin so we would just need to move the dep to deps instead of devDeps

Copy link

Choose a reason for hiding this comment

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

Ah, fair point. Is that something we want to avoid?

Copy link
Member

Choose a reason for hiding this comment

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

In the end it's a build tool so we should use when we would like to - hard for us just to implement everything when it's not needed but yeah something I've been struggling with sometimes. Sure we want to keep low dependencies and everyone complaining about Babel install times but hey we aren't getting any help and it just makes developing that much harder

@yavorsky
Copy link
Member

Nice!

But I want to mention other options too. If I'm not mistaken, asyncGenerators, generators and async options stay uncovered.
Moreover, by combining options, we may face cases when for some plugins we want to use certain option, but not for others.

For example, I want to run transform-es2015-arrow-functions with spec: true, but transform-es2015-template-literals without.

Diving deeper into the code, we may found that many plugins receive options they don't know and don't need (most).

Just topic to discuss rather after PR. During this stage, this PR is a good progress.

@hzoo
Copy link
Member

hzoo commented Jan 5, 2017

@yavorsky that was an issue with preset options when we originally talked about them - users wanted complete control and sebastian didn't want options at all. Logan suggested we allow options with predetermined options at first which is what we have atm

It's true a user might want true for 1 thing and false without but dono how much configurability we want

@hzoo
Copy link
Member

hzoo commented Jan 6, 2017

We should add a spec "integration" test in fixtures. I can do this and then merge

@existentialism
Copy link
Member

@hzoo rebased and added test

@codecov-io
Copy link

codecov-io commented Apr 1, 2017

Codecov Report

Merging #98 into master will increase coverage by 0.16%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #98      +/-   ##
=========================================
+ Coverage   93.03%   93.2%   +0.16%     
=========================================
  Files           4       4              
  Lines         201     206       +5     
  Branches       59      60       +1     
=========================================
+ Hits          187     192       +5     
  Misses          9       9              
  Partials        5       5
Impacted Files Coverage Δ
src/normalize-options.js 90.69% <100%> (+1.22%) ⬆️
src/index.js 95.61% <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 8bca925...367bace. Read the comment docs.

Copy link
Member

@hzoo hzoo left a comment

Choose a reason for hiding this comment

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

this is fine, dono if we want it in 1.x or 2.x

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

Successfully merging this pull request may close these issues.

6 participants