Add a special "stable" version identifier that accepts any stable version
Today the any identifier allows any version (stable or pre-release). Changing that behavior would be a breaking change, hence the proposal for a new stable identifier.
As a concrete use case we advise consumers of the build_* packages to generally use any constraints, because they don't directly interact with the imperative api of the packages. However, we released an 2.0.0-alpha.0 version of build_web_compilers and now they are picking that version up by default, which we expected users to have to explicitly opt into.
cc @munificent wdyt?
now they are picking that version up by default
This should only happen if there are no stable versions. Since all pre-release versions are lower priority than all stable versions, an any clause should only yield a pre-release version when there are no stable ones at all.
Is there something else going on here?
There are stable versions, in the 1.x range, but no 2.x stable versions.
You can repro by creating a pubspec with build_web_compilers: any and doing a pub upgrade, you will get 2.0.0-alpha.0 instead of some 1.x version :(
Note that the pub site properly recognizes it as a pre-release version https://pub.dartlang.org/packages/build_web_compilers
also cc @natebosch
Ok, I got some more information here. It looks like if you have only a dependency on build_web_compilers then you will get the stable version. However, if you add another dependency you can end up getting the alpha version.
The easiest way I have discovered to do that is by adding a dependency on the test package.
For this example my pubspec looks like this:
name: playground
dependencies:
build_web_compilers: any
test: ^1.0.0
Here is a gist with the output of pub upgrade --no-precompile -v https://gist.github.com/jakemac53/081d8f600e0a569c4821c765b65cd506, let me know if there is another better way to print tracing info.
Note that it lists test first (even though it appears in my pubspec 2nd), and it looks like that is leading to the selection of build_web_compilers 2.0.0-alpha.0?
Ah, I think this is ultimately because it selects analyzer 0.36 https://gist.github.com/jakemac53/081d8f600e0a569c4821c765b65cd506, which we don't support in older build_web_compilers.