openupm / openupm-cli

The OpenUPM-CLI is a command-line interface for maintaining UPM registries.
https://openupm.com
BSD 3-Clause "New" or "Revised" License
241 stars 13 forks source link

Packages added with the OpenUPM CLI always install the latest version, even if it is a preview #64

Closed SimonDarksideJ closed 1 week ago

SimonDarksideJ commented 1 year ago

Bug report

Bug category

Steps to reproduce

What is expected?

The latest RELEASE version should be installed.

What is actually happening?

The latest release, which is a preview is installed

Other relevant information

favoyang commented 1 year ago

When you publish a package, the latest tag is automatically set to the published version, unless you use the --tag option. For example, you can use npm publish --tag=beta to set a specific tag.

By default, if you use npm install (without adding @ or @), it installs the latest tag.

When you handle the publishing process manually, you can choose whether to mark a pre-release as the latest "dist-tag" or assign a particular tag. OpenUPM automates the process, so it designates the new release as the latest.

One solution could be adding the --stable flag to the openupm-cli install command, which would disregard pre-release versions.

Another option is to link the Git tag to the npm dist-tag. For instance, mapping 1.0.3-pre.2 to the pre dist-tag. This way, the "stable" version is installed by default, unless you specify --tag pre. However, this approach requires testing to determine how Unity handles different dist-tags or whether it simply ignores them. Keep in mind that our decisions usually aim to find a balance that aligns with Unity's behavior.

ComradeVanti commented 1 week ago

I'm closing this issue in favor of #395. @SimonDarksideJ please take a look there for updates.