You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This feature is important to have in this repository; a contrib plugin wouldn't do
Describe the user story
I have an internal use case where I want certain packages to be resolved by an in-house plugin.
Describe the solution you'd like
I've found that I can't use a plugin to resolve packages that use the normal dependency syntax, e.g. "@my-org/my-package": "^1.0.0". See discussion: #6658
As a second-best solution, I was thinking of using a custom protocol to indicate that the package should be resolved by the plugin, e.g.
"custom:@my-org/my-package": "^1.0.0"
However, that doesn't work either:
➤ YN0000: · Yarn 4.6.0
➤ YN0000: ┌ Project validation
➤ YN0057: │ @my-org/my-app: Parsing failed for the dependency name 'custom:@my-org/my-package'
The request here is to allow plugins to register a custom protocol.
Describe the drawbacks of your solution
Having dependencies use a custom protocol would mean that downstream packages would be "locked in" to using Yarn with a plugin capable of resolving that protocol.
Describe alternatives you've considered
As mentioned above, I'd prefer to do without the custom protocol and instead have my plugin logic determine which packages it should resolve. However, to do that I'd need a way to make my plugin take precedence over the built-in resolvers.
The text was updated successfully, but these errors were encountered:
A custom protocol goes to the range of a descriptor
"@my-org/my-package": "custom:^1.0.0"
You can then define a resolver for the custom: protocol via a plugin.
You can also use the defaultProtocol config to default all direct dependency ranges without an explicit protocol to your custom protocol, allowing you to intercept resolution of direct dependencies.
To intercept all dependency resolution, you can use the reduceDependency hook to change the descriptors of transitive dependencies.
Describe the user story
I have an internal use case where I want certain packages to be resolved by an in-house plugin.
Describe the solution you'd like
I've found that I can't use a plugin to resolve packages that use the normal dependency syntax, e.g.
"@my-org/my-package": "^1.0.0"
. See discussion: #6658As a second-best solution, I was thinking of using a custom protocol to indicate that the package should be resolved by the plugin, e.g.
However, that doesn't work either:
The request here is to allow plugins to register a custom protocol.
Describe the drawbacks of your solution
Having dependencies use a custom protocol would mean that downstream packages would be "locked in" to using Yarn with a plugin capable of resolving that protocol.
Describe alternatives you've considered
As mentioned above, I'd prefer to do without the custom protocol and instead have my plugin logic determine which packages it should resolve. However, to do that I'd need a way to make my plugin take precedence over the built-in resolvers.
The text was updated successfully, but these errors were encountered: