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

pkgx pin node@18 #21

Open
felipecrs opened this issue Jul 30, 2023 · 1 comment
Open

pkgx pin node@18 #21

felipecrs opened this issue Jul 30, 2023 · 1 comment

Comments

@felipecrs
Copy link

I am a big fan of Volta, and I believe it was quite revolutionary when it first appeared. I switched from NVM to it, and I never looked back. I always wished there were tools like Volta but for other things like Python and Java. To my happy surprise, tea is becoming it.

Maybe some other day I'll elaborate more on why I think tea is very similar to Volta.

There is a handy tool in Volta which is: volta pin node@18 npm@9, which calculates the full sharp version of node and npm matching the version constraint and writes it to the volta key in the package.json.

Writing the full version as opposed to writing just @18 to the package.json has advantages, like bringing reproducibility to CI/CD builds and colleagues environments. We can't deny things breaks sometimes even for packages adopting semantic versioning.

Nevertheless, it would be quite painful having to search the web for the latest node@18 and npm@9 every time I want to upgrade to latest patch or minor.

Maybe some command like tea pin node@18 could:

  1. Fetch the latest version of node@18
  2. Find where node's version was fetched from. Example:
$ cat .node-version
18.14.2
  1. Make the replacement automatically, i.e. change .node-version from 18.14.2 to 18.17.0.
  2. If no file or source of the version was found, tea could create a .tea.yml automatically to perform the pinning process on the current folder.
@mxcl
Copy link
Member

mxcl commented Jul 30, 2023

all files tea supports are considered before defining the pkgenv so we could just default to tea.yaml or some other file like tea.lock.yaml.

This is a good op for adding a new pkg to tea that “provides” tea-pin since tea automatically installs anything that is requested and understands how to install commands on itself. Could be a separate project if you have interest.

we would then roll the feature into tea proper once it has matured

Otherwise I do not currently have good understanding on how pinning would work so it's not in my immediate attention.

However I agree that such a feature has definite value.

@mxcl mxcl added the enhancement New feature or request label Sep 11, 2023
@mxcl mxcl removed the enhancement New feature or request label Oct 20, 2023
@felipecrs felipecrs changed the title tea pin node@18 pkgx pin node@18 Mar 9, 2024
@mxcl mxcl transferred this issue from pkgxdev/pkgx Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants