-
Notifications
You must be signed in to change notification settings - Fork 11
Version mapping between distribution channels and registry #5
Comments
This issue definitely needs more context. It seems to be missing any information to know what it's about 😛 |
Updated the comment. Is it better now? 😄 |
Yes, thanks. I went against this approach because it's tightly coupled with GitHub namespaces and GitHub repo names are generally more fragile than registries. Also, doing this is impossible in a lot of cases - there's a lot of projects on NPM that don't have a registry field. How would one install using an NPM name to the GitHub name in the registry here? |
Agree to what you say. There are many projects don't live on github and only available through the distributing channel ( There is no need in back-referencing the source of the code, e.g. github or gitlab or private. When I say it ties to the source code or repo, I mean it ties to them conceptually. i.e. 1-1 map between them. To the user, they would only know (or care) where they get the package from. So At such, and for searchability, it is much better to structure the registry as it is right now ( So to maintain the 1-1 mapping, we could record the distribution channel(s) in the This means, in {
"sources": {
"npm": "1.2.3", // or semver syntax
"bower": "1.2.4",
...
}
} And in the registry, it remains the same. UPDATE: can add a method |
The benefit of keeping the version in the typed-repo's Is there a better way to do this? |
@unional having multiple fields for versions makes it a little tricky and I don't think anyone has a setup where the versions will be different anyway. I had an issue open to allow the version field to be a semantic version range and use that for warnings. |
I think it does exists. For example, TypeScript node and NuGet version are different, and modules that removed from specific source (e.g. Another example is git. it has different versions available on different platforms. I'm not sure if all these are related or relevant, so please correct me if I'm wrong. I thought this might be an issue so I bring it up. 😄 |
The versions are in sync though, it's not a matter that you have two different distributions of the source code with different versions. E.g. https://www.nuget.org/packages/Microsoft.TypeScript.Compiler/. The only case I can think of is if a platform used a different versioning scheme, but we should specify we only handle semver anyway. |
Did we resolve this? I'm going to close unless you think we should re-open 😄 |
Yeah, this can be closed. Thou still not 100% sure about version matching. e.g. https://github.com/Microsoft/TypeScript/releases/tag/v1.8.2
May be bring it up in NPM registry discussion? |
No, that's the wrong place. Let's always use the NPM version, since it's semver (it's |
I agree that the version in registry should be normalized (e.g. using "npm version"). What I try to say is not that. It's about mapping. In other words, I'm thinking about discovery, not delivery. When user install packages from NuGet (or github using tag, bower, jspm, etc, AND local discoveries for all distribution channels), how to:
|
So, should the registry use compatibility ranges? Or should the compatibility range live in |
thinking out loud:
Re-opening the issue. 🌹 |
I think the NPM registry concept might not able to address this. In this context "Typings" refers to the code, either NPM procedure:
Non NPM procedure (using NuGet as example):
For this point, the current registry is a better approach. |
On the NPM side, it's easy to get a specific version list - as far as I can tell the only tricky part is (re)implementing search. For example, https://registry.npmjs.org/express. On non-NPM, it should look the same, except we can optimise the server-side. For example, I can implement an endpoint like Edit: FWIW, I believe the intersection is the best solution. Does that mean the registry begins to support ranges as keys or do we keep that info only in |
Also one more point is does |
We could add maps to the registry to. {
"alias": "npm/batch"
} Is that what you mean? Like one definition is an alias of the other in terms of the type definition? |
Yes, but the other way around: // @typings/{npm-batch,batch}/typings.json
{
"alias": "nuget/batch"
} Update: {
"alias": ":distribution-channel/:distribution-channel-package-name"
} |
Sorry, not follow "on the other way around". I thought it was immaterial? Are you saying the alias is from the same source as the versions? |
We are talking about step 3 in #5 (comment), right? |
Let's get to aliases later, it won't work with incompatible version schemes. Also, none of this works without semver either. So let's forget aliasing. |
Fair enough. And as you pointed out, the NPM route is do-able. 👍 |
Yes, both would work the same - just offload certain pieces here or there. The latest deployment to the API demonstrate a more NPM-like approach where every version is being published. I'll investigate using semver ranges in the registry and doing intersections. |
I believe the registry entry (e.g.
domready.json
) should be tied to the source code (the repo) instead of the distribution channel (npm
,bower
,jspm
,Duo
, evengithub
(as distribution channel)).So here is an attempt to describe how will it look like in that scenario.
For versioning (draft):
jspm
may need to resolve to local or endpoint to get the right source + version. Duplicating it here could be a lot of maintenance work.The text was updated successfully, but these errors were encountered: