Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add latest tag in publishToNpm #206

Closed
dblock opened this issue May 22, 2023 · 5 comments · Fixed by #492
Closed

Add latest tag in publishToNpm #206

dblock opened this issue May 22, 2023 · 5 comments · Fixed by #492
Assignees
Labels
enhancement New feature or request

Comments

@dblock
Copy link
Member

dblock commented May 22, 2023

Is your feature request related to a problem? Please describe

Coming from opensearch-project/opensearch-js#521, looks like we need to npm-dist-tag as part of publishToNpm.

Describe the solution you'd like

Mark the newly released JS component as latest in npm as part of publishing.

Describe alternatives you've considered

No response

Additional context

No response

@gaiksaya
Copy link
Member

Latest is the default behavior AFAIK @dblock. I believe we need an option to "NOT" tag recent release as latest?
https://www.npmjs.com/package/@opensearch-project/opensearch?activeTab=versions
Looks like 1.2.0 was released few weeks ago where was 2.2.1 being latest was released a month ago?

@bbarani
Copy link
Member

bbarani commented May 22, 2023

@gaiksaya Looks like you can use this command to tag another version as latest

npm dist-tag add <pkg name>@<version> latest

Only caveat is the fact that NPM seems to tag the new version as latest by default so we might need to pass the tags (1.x vs 2.x vs latest)explicitly for every release.

@gaiksaya
Copy link
Member

Wondering if it might be a good time to introduce something like https://stackoverflow.com/questions/68230173/publishing-a-previous-major-version-to-npm-with-no-tag-and-avoiding-latest
We have been doing this for our docker images where v1 represents latest of v1.x series and v2 represents latests version of 2.x series

@zelinh zelinh removed the untriaged label May 23, 2023
@wbeckler
Copy link

I think this command right here is where we need to make sure this is actually the latest, and if not, then override the false addition of "latest" by using --tag [something_other_than+latest] as per https://docs.npmjs.com/adding-dist-tags-to-packages

@gaiksaya
Copy link
Member

Thanks for bringing this into notice. I missed it.

Publishing a package sets the latest tag to the published version unless the --tag option is used. For example, npm publish --tag=beta.
By default, npm install (without any @ or @ specifier) installs the latest tag.

https://docs.npmjs.com/cli/v9/commands/npm-dist-tag#description
Looks like @dblock already opened the bug report. Will work on it soon.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

5 participants