Open felipecrs opened 1 year ago
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.
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 thevolta
key in thepackage.json
.Writing the full version as opposed to writing just
@18
to thepackage.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:.node-version
from18.14.2
to18.17.0
..tea.yml
automatically to perform the pinning process on the current folder.