In order to enforce local dependency resolution, PNPM offers the workspace:(*|^|~) protocol to resolve a local dependency version.
However, It seems the plugin does not provide built-in support for this (especially for the no-branch-dependencies and restrict-ranges rules). But, the plugin is flexible enough to provide escape hatches through verbose configuration (a good example is available here).
To allow a wider adoption and ease the consumer experience, It would be really great to consider PNPM also a first-class citizen to remove avoidable extra configurations consumer side (the workspace version protocol is also used on other package managers like yarn).
What do you think?
Implementation suggestion
Here're some thoughts on how it can be implemented:
For the restrict-ranges implementation with workspace protocol support, we can strip the workspace:xxx part and check the xxx part based on the provided versionTypes or versionRegex. This implementation is inspired by what's done Changesets side 👍 .
For the no-branch-in-dependencies rules, we can ignore version starting with /^workspace:/.
Description
In order to enforce local dependency resolution, PNPM offers the workspace:(*|^|~) protocol to resolve a local dependency version.
However, It seems the plugin does not provide built-in support for this (especially for the no-branch-dependencies and restrict-ranges rules). But, the plugin is flexible enough to provide escape hatches through verbose configuration (a good example is available here).
To allow a wider adoption and ease the consumer experience, It would be really great to consider PNPM also a first-class citizen to remove avoidable extra configurations consumer side (the workspace version protocol is also used on other package managers like yarn).
What do you think?
Implementation suggestion
Here're some thoughts on how it can be implemented:
restrict-ranges
implementation with workspace protocol support, we can strip theworkspace:xxx
part and check thexxx
part based on the providedversionTypes
orversionRegex
. This implementation is inspired by what's done Changesets side 👍 .no-branch-in-dependencies
rules, we can ignore version starting with/^workspace:/
.