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

Deserialization support #12

Open
chris-olszewski opened this issue Feb 16, 2023 · 3 comments
Open

Deserialization support #12

chris-olszewski opened this issue Feb 16, 2023 · 3 comments

Comments

@chris-olszewski
Copy link

Hello, I'm in need of getting being able to pragmatically parse/edit/write yarn.lock files both for yarn 1 and 2+. The current parser looks like it is only taking common fields between the two formats in order to provide a unified interface across the two lockfile versions.

Would PRs that make roundtrips possible be appreciated/considered for this project?

@robertohuertasm
Copy link
Owner

HI @chris-olszewski! Not sure if I understood "roundtrips" meaning (non-native speaker, sorry), but in any case, if what you're asking is adding the ability to have more properties in the entries to cover all the possibilities, that could work. Or, expressed in another way, as long as the current API is not broken, I think it should be fine. I created this crate because I needed to have this kind of abstraction between yarn. lock versions but I don't see why not to incorporate new functionality.

@robertohuertasm
Copy link
Owner

By the way, thanks for your proposal! 🙌🏻 ❤️

@chris-olszewski
Copy link
Author

Not sure if I understood "roundtrips" meaning

Ah sorry, I want to add a new to_string function where lockfile_str == yarn_lock_parser::to_string(yarn_lock_parser::parse_str(lockfile_str)?).

I'll put together a quick PR for that adds this support for yarn 1. Thanks for responding!

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

No branches or pull requests

2 participants