feat: parse optionalDependencies from v1 lockfiles#30
Merged
robertohuertasm merged 2 commits intorobertohuertasm:masterfrom Sep 11, 2025
Merged
feat: parse optionalDependencies from v1 lockfiles#30robertohuertasm merged 2 commits intorobertohuertasm:masterfrom
robertohuertasm merged 2 commits intorobertohuertasm:masterfrom
Conversation
Owner
robertohuertasm
left a comment
There was a problem hiding this comment.
There's a formatting issue. Let's fix that and we should be ready to merge.
Thanks for your contribution ❤️
robertohuertasm
approved these changes
Sep 11, 2025
Owner
|
@Smona your change has been already published to crates.io. Thank you again for your contribution! |
Smona
added a commit
to Smona/nu_plugin_yarn_lock
that referenced
this pull request
Sep 11, 2025
now that support for optionalDependencies has been merged! robertohuertasm/yarn-lock-parser#30
Contributor
Author
|
Yay, thanks for getting it released so quickly! And thanks for the crate as well, it enabled me to write a yarn lockfile serde plugin for nushell in pure rust, removing a noticeable delay when parsing lockfiles compared to the initial implementation using the official parser with nodejs 🦀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a quick shot at parsing
optionalDependenciesfrom yarn v1 lockfiles. Admittedly I have no experience withnomand very little experience with parsers in general, so this mostly works off of the existing implementation. I couldn't find a clean boundary to reuse the parser between both tags, so i went with a WET approach, but if you see a way to reuse the format definition between the two (which is identical besides the leading tag), please let me know!Test cases are updated & passing, and a couple now test parsing optional dependencies, using a real v1 lockfile entry with one of each type of dependency.
Resolves #29