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: Exporting values. (#396) #398

Merged
merged 8 commits into from
Feb 8, 2018
Merged

feat: Exporting values. (#396) #398

merged 8 commits into from
Feb 8, 2018

Conversation

AndrewLeedham
Copy link
Contributor

Added defined values to the exported JSON object. As discussed in #396

file.exports = message(result, "classes");
file.exports = Object.assign(
Object.create(null),
mapValues(file.values, (obj) => [ obj.value ]),
Copy link
Owner

Choose a reason for hiding this comment

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

Since @value statements don't have a composition graph to follow I don't think wrapping them in an array is worth it. This can probably mix in file.values directly instead.

Side benefit is that classes & @values are easily differentiated just by glancing at them.

Copy link
Owner

Choose a reason for hiding this comment

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

Whoops, ignore that. Forgot that the output method expects everything to be an array so it can .join them. This still feels a bit weird, but it's easier to go w/ the flow on it than to add special logic elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I played with changing the join function to check if it is an array. But it made more sense just to wrap the value in an array.

@tivac
Copy link
Owner

tivac commented Feb 8, 2018

Good sleuthing! I forgot about the values-export plugin that merges that all together.

@tivac
Copy link
Owner

tivac commented Feb 8, 2018

Would you run npm test -- -u to update all the snapshot tests w/ the new output? Travis should succeed after that.

@tivac tivac merged commit 479866d into tivac:master Feb 8, 2018
@tivac
Copy link
Owner

tivac commented Feb 8, 2018

🎉

tivac pushed a commit that referenced this pull request Feb 9, 2018
BREAKING CHANGE: Values will now be exported alongside composed classes

Fixes #396
@tivac
Copy link
Owner

tivac commented Feb 9, 2018

This is published as 8.0.0, thanks again!

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