-
Notifications
You must be signed in to change notification settings - Fork 4
Description
a component can "substitute" another component in a build. this is convenient for forks and different "versions" of components. this is important because you don't want to include multiple copies/versions of a component
substitutes must be API compatible.
ex. if you have a fork, you can replace all copies of the original component with your fork in your build:
{
"name": "emitter",
"repo": "jonathanong/emitter",
"substitutes": {
"component/emitter": "*"
}
}this will handle cases where you don't want multiple copies of emitter included in the build, but want a different emitter, such as one that handles name spaces or something.
you can also substitute older versions of yourself. this tells people "this version is API compatible with these versions", and makes pinning dependencies less of an issue:
{
"name": "emitter",
"repo": "component/emitter",
"version": "1.9.0",
"substitutes": {
"component/emitter": ">= 1 < 2"
}
}so any builds that include "component/emitter": "1.0.1" will still use 1.9.0 in the build as it's "API compatible", assuming 1.9.0 is already included in the build.
this would also help in discovery with the registry. we could also add similar properties primarily for discovery such as alternatives, extends, etc.