Make monocart-coverage-reports an optional peer dep #537
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.
I noticed in 13979a7 that you fixed it being a "required" peer dep by not declaring it at all.
Package managers like
pnpm
(or others) may use a stricternode_modules
layout which would preventc8
from accessingmonocart-coverage-reports
because it's not a declared dependency.Instead of not declaring the dep, you can still use a peer dep but just mark it optional. Users installing
c8
will not getmonocart-coverage-reports
automatically, which I believe is what you intended. But, installing it later will ensure that it's correctly linked.As an example, see https://github.com/microsoft/TypeChat/blob/ce83b7f63f19786106f82a37ca154bbb579d960b/typescript/package.json#L43-L54, which declares deps on libraries that can plug into TypeChat, but are not hard deps.
(I also find this to more clearly show intent to people reading the package or analyzing their deps.)