-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
[install] improve package.json
validation
#2074
Conversation
alexlamsl
commented
Feb 14, 2023
- report error and exit gracefully instead of crashing
src/install/lockfile.zig
Outdated
@@ -2677,6 +2677,7 @@ pub const Package = extern struct { | |||
total_dependencies_count += @truncate(u32, arr.items.len); | |||
}, | |||
.e_object => |obj| { | |||
if (group.behavior.isWorkspace()) return error.InvalidPackageJSON; |
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.
maybe this should have a more specific error
workspaces must be an array of package name strings, like
"workspaces": [ "./folder/package-name", "./folder/package2" ]
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.
Done in 6164cd6
@@ -2691,7 +2692,7 @@ pub const Package = extern struct { | |||
} | |||
total_dependencies_count += @truncate(u32, obj.properties.len); | |||
}, | |||
else => {}, |
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.
if you do peerDependencies: false
or whatever we can just ignore it IMO
- report error and exit gracefully instead of crashing
a70d0e0
to
6164cd6
Compare
Thanks |