Vscode-vsce: Four number version string with semver

Created on 20 Jan 2020  路  13Comments  路  Source: microsoft/vscode-vsce

Hello


In my package.json

    "version": "0.0.1-1"

Output of _vsce publish_

 ERROR  The version string '0.0.1-1' doesn't conform to the requirements for a version. It must be one to four numbers in the range 0 to 2147483647, with each number seperated by a period. It must contain at least one non-zero number.


In my package.json

    "version": "0.0.1.1"

Output of _vsce publish_

 ERROR  Invalid extension version '0.0.1.1'

Does vsce support any four-number version string?

I believe, if I am not mistaken, that the former error message is wrong.

Best,
Simon

bug verified

Most helpful comment

@joaomoreno This change breaks our C/C++ extension's vsix publishing. We create vsix's with versions like 0.26.3-insiders4 (https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3-insiders4) and 0.27.0-multiroot2 for internal testing. Can you re-enable our scenario to work?

All 13 comments

Semver doesn't not support four numbers: https://semver.org/

@joaomoreno Semver does support four numbers, the fourth one is called prerelease.

If it would not, vsce erroneously says that the version string must be one to four numbers.

Please update the error message if you do not support prereleases.

Oh I see. Actually, the first error message seems to be coming from the server. I'll update VSCE to catch that error earlier and let the user know what is supported.

Many thanks

@joaomoreno This change breaks our C/C++ extension's vsix publishing. We create vsix's with versions like 0.26.3-insiders4 (https://github.com/microsoft/vscode-cpptools/releases/tag/0.26.3-insiders4) and 0.27.0-multiroot2 for internal testing. Can you re-enable our scenario to work?

ERROR The version string '0.0.1-1' doesn't conform to the requirements for a version. It must be one to four numbers in the range 0 to 2147483647, with each number seperated by a period. It must contain at least one non-zero number.

The four in this error message should be three.

Since semver expects <major>.<minor>.<patch>[-<prerelease>]

The documentation on prerelease is:

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.

This is breaking our build as well. Please reopen and fix this, thanks!

@sherryyshi The workaround we're using is to install "[email protected]" instead of just "vsce".

Oh I see. Actually, the first error message seems to be coming from the server. I'll update VSCE to catch that error earlier and let the user know what is supported.

@joaomoreno, can you please confirm that something changed upstream (on the server) which introduced a regression? Until a few days ago, pre-release fields were supported for several weeks/months, as reported by the many users that have found their workflows broken.

Should the code upstream have not changed, I believe that this might be a poor (limited) implementation of semver parsing on the server. @sguillia's second syntax doesn't seem correct, but the first one should be accepted. The difference compared to other previously working solutions (as reported by @sean-mcmanus), is that @sguillia's pre-release starts with a digit, not an alphabetic character. Is it possible that the server supports pre-releases starting with non-digit characters only? Should that be the case, I would ask to revert https://github.com/microsoft/vscode-vsce/commit/e4a8df59d34e1f6a83776256067cf11bff943f1f ASAP.

VSCE never prevented prerelease fields, but the Marketplace never supported them. The only reason why @sean-mcmanus's scenario works is because those versions were never uploaded to the Marketplace.

I can revert this change on VSCE, since it enables side-loading scenarios. But the Marketplace will stay as is, as it always has.

Fix coming in 1.73.0

Thank you @joaomoreno. Side-loading is an important scenario for us so we appreciate you adding support for prerelease back in.

Yes thank you @joaomoreno :) Our extension is internal to Microsoft and therefore also not in the Marketplace.

Indeed. For future users, the error message from the marketplace should explicitly state that pre-releases are not supported on the marketplace

Was this page helpful?
0 / 5 - 0 ratings