idea/discussion: just thinking aloud, comment whatever you think that could be wrong or could be improved.
Long git tags are awful:
{
"dependencies": {
"some-package": "github:ramasilveyra/private-registry#some-package-v1.0.0-gitpkg"
}
}
maybe instead we could use the gitpkg: shortcut that infers the gitpkg registry from the field gitpkg.registry:
{
"dependencies": {
"some-package": "gitpkg:^1.0.0"
},
"gitpkg": {
"registry": "git@github.com:ramasilveyra/private-registry.git"
}
}
even we could have multiples gitpkg registries:
{
"dependencies": {
"some-package": "gitpkg:private:^1.0.0",
"other-package": "gitpkg:public:^1.0.0"
},
"gitpkg": {
"registries": {
"private": "git@github.com:ramasilveyra/private-registry.git",
"public": "git@github.com:ramasilveyra/public-registry.git"
}
}
}
For semver ranges if we can make the git tag name to be the same of the package even for scoped packages (see #4) the work on the npm client will be:
- List git tags using
ls-remote.
- Select the correct version.
- Fetch.
Long git tags are awful:
{ "dependencies": { "some-package": "github:ramasilveyra/private-registry#some-package-v1.0.0-gitpkg" } }maybe instead we could use the
gitpkg:shortcut that infers the gitpkg registry from the fieldgitpkg.registry:{ "dependencies": { "some-package": "gitpkg:^1.0.0" }, "gitpkg": { "registry": "git@github.com:ramasilveyra/private-registry.git" } }even we could have multiples gitpkg registries:
{ "dependencies": { "some-package": "gitpkg:private:^1.0.0", "other-package": "gitpkg:public:^1.0.0" }, "gitpkg": { "registries": { "private": "git@github.com:ramasilveyra/private-registry.git", "public": "git@github.com:ramasilveyra/public-registry.git" } } }For semver ranges if we can make the git tag name to be the same of the package even for scoped packages (see #4) the work on the npm client will be:
ls-remote.