-
Notifications
You must be signed in to change notification settings - Fork 28
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: lockfile parser must always return depTree.name
#29
Conversation
depTree.name
depTree.name
depTree.name
depTree.name
lib/parsers/index.ts
Outdated
const manifestFile = JSON.parse(manifestFileContents); | ||
// Fallback to the file name if name is not set | ||
if (!manifestFile.name) { | ||
manifestFile.name = manifestFileName; |
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.
Can I suggest to move all logic relevant to manifestFileName
to /lib/index.ts
? Looks like it is not related to parsers because they only need to parse existing file. And also it is less changes (do not need to pass manifestFileName
everywhere).
lib/index.ts
Outdated
@@ -21,7 +21,7 @@ export { | |||
}; | |||
|
|||
async function buildDepTree( | |||
manifestFileContents: string, lockFileContents: string, | |||
manifestFileContents: string, manifestFileName: string, lockFileContents: string, |
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.
Let's maybe make it last argument and make it optional? This way you'll keep API consistent.
b2aae05
to
3a9d98a
Compare
🎉 This PR is included in version 1.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
What this does
When package name is missing use manifest filename instead
More information
https://snyksec.atlassian.net/browse/SC-6758
Also related to https://github.com/snyk/npm-deps/pull/53 and https://github.com/snyk/registry/pull/6331