Reconsider major.minor pinning #12
Comments
I don't see how this is going to be an issue in practice (or I'm misunderstanding what you're saying here). Is there anyone who actually needs to target a specific patch version of a library with a specific typings file? That seems theoretical at best. |
Yes. Gulp is currently in an alpha, and someone recently contributed typings for it. |
It's an alpha, without a major version bump, with breaking changes? |
No, it's |
Or the granularity does not matter? It's the same as though |
Also, I think you'll need to do some tagging trickery here too - otherwise people doing Edit: If you decide the granularity does not matter, let's make an issue tracking the tagging - we definitely don't want the |
We can funnel through any prerelease metadata, so if the types file says it's for |
Seems reasonable. Still a little scared of it since it's against semver and I haven't though about what might happen, but at least proxying pre-release info is a plus 👍 |
Now that even TypeScript has been bitten by the bad semver implementation with microsoft/TypeScript#14555, is it possible to open this discussion up to finding a solution? Using the pre-release metadata might be a possible approach using NPM if there's a way to ensure breaking changes in the pre-release don't satisfy ( Edit: There's not a way that I have found yet, FYI. Pre-release versioning seems like a pain and it may be worth asking NPM for guidance/changes in this area so that |
Actually, I think I just realised how this can be done with NPM and zero changes required. According to https://docs.npmjs.com/misc/semver#prerelease-tags and semver.maxSatisfying(['7.0.2-v1', '7.0.1-v1'], '^7.0.1-v1') Edit: This is only from the publishing side. I figure the tooling side will be up to MicroSoft on how the definition communicates a breaking change to the publisher. It also relies on you sticking with pre-release versioning, because once a stable version that's larger appears it'll use that. Weird right? You'd think if you installed a pre-release you should probably be stuck on it until you explicitly move to the stable versions. |
I brought this up before offline, but I want to post it here to discuss it thoroughly. The current implementation pins to
major.minor
which blocks people from typing anything with a smaller version. This is a bit of an issue for anyone wanting to type/use pre-release software, or if something needs to be added for an actual patch release (though that breaks semantic versioning, not everyone follows it correctly - including TypeScript - and it could occur more likely on0.x
versions where semver doesn't actually apply).The way this is solved in Typings is by using the build metadata part of semver. Specifically,
2.0.0+timestamp
.The text was updated successfully, but these errors were encountered: