-
Notifications
You must be signed in to change notification settings - Fork 404
#349: Use js-yaml to parse json, yaml, and yml config files #634
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
#349: Use js-yaml to parse json, yaml, and yml config files #634
Conversation
hello @fillerwriter this is certainly a welcome surprise! thanks for this initial bit of work - I am excited to round out PL Node support with yaml. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will review this in earnest, but can already see that this may cause problems in the dev-3.0
branch, where we made a bunch of var
to const
or let
changes already. If you'd be so kind as to alter statements back to var
, this will make for an easier merge later.
@bmuenzenmeyer No problem. I've swapped out the consts that fall outside the additional work I've done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making those changes. Will pay dividends down the road.
Individual patterns can also have data associated with them, which we implement within pattern_assembler.js
here: https://github.com/pattern-lab/patternlab-node/blob/master/core/lib/pattern_assembler.js#L319-L358
For this to be truly feature complete against #349 and the specification, I'd ask that we support pattern-level yaml too.
…r to use helper methods
@bmuenzenmeyer Apologies for letting this sit for a bit. I ended up refactoring the logic for loading the config files into helper functions, and swapped out the implementation across the board. I'd like to tighten up the implementation before merging in. If you have any input, I'm interested in hearing it. :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was initially extremely confusing to me because I thought configFileLoader was referring to patternlab-config.json
when it actuality it was dealing with data.
I like the direction of further encapsulating this data, somewhat similar to how we have a dedicated markdown_parser
now.
would you be willing to change this to, say, perhaps data_loader
?
Sweet. I like I'm hoping to get to this today/tomorrow. |
@bmuenzenmeyer Ready for review. Thanks for your patience. |
Great work! Sorry this took so long! It will be in the next release |
Addresses #349
Summary of changes: Refactored buildPatternData to use js-yaml library to parse all the config files. Added a unit test to ensure we're picking up the appropriate files.