Skip to content

Conversation

@fredvd
Copy link
Member

@fredvd fredvd commented Mar 13, 2023

Add pins for people using Volta for automatic node/yarn/npm tooling pins & installation/shims.

@petschki
Copy link
Member

what's volta?

@fredvd
Copy link
Member Author

fredvd commented Mar 22, 2023

google for 'volta node' ;-)

https://volta.sh/

An IMHO much more convenient and less bloated alternative for nvm.

@jensens
Copy link
Member

jensens commented Mar 22, 2023

Volto, Volta, 🤪

@petschki
Copy link
Member

My first thought: this is a typo 🫣

@mauritsvanrees
Copy link
Member

Interesting!

Trying it out, starting on master:

$ node --version; yarn --version
v18.14.2
1.22.5
$ git checkout volta_pins 
Switched to branch 'volta_pins'
Your branch is up to date with 'origin/volta_pins'.
$ node --version; yarn --version
v16.19.1
1.22.19

If you don't have those versions yet, Volta will automatically download them.

Nice! I am in favour.

Would be nice for mockup as well, where I always have to check if I need node 14, 16 or 18, and I don't think it is documented. Might be only a problem for the branch used in Plone 5.2 though.

@fredvd
Copy link
Member Author

fredvd commented Apr 22, 2023

What I like about Volta is that it has the same functionality as nvm where it manages and downloads separate installs of node/npm/yarn versions. But it also has out of the box automatic activation in a proeject dir. With nvm you need to follow extra instructions to add stuff to your bashrc/profile and nvm is subjectively slower for me. I think it activates on 'cd'-ing in to a directory and uses shell commands.

The Volta shims are binaries and work almost instantly. And if you don't (want to) use Volta, the pins in the package.json are ignored.

Copy link
Member

@petschki petschki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I always make nvm use 18 ... would do it for volta too.

"url": "https://github.com/plone/mockup.git"
},
"volta": {
"node": "16.19.1",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"node": "16.19.1",
"node": "18.17.0",

Copy link
Member

@thet thet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also switched to volta from nvm.‌ Actually I did like nvm too because it did what it meant to do :) But volta is the more modern alternative.

I'm 👎 on this PR as it adds some tool-specific artefacts which IMO do not belong into this repo.
It's like pyenv's .python-version file which you also wouldn't add to the python repos.

Instead, let's define the compatible node version following standard package.json metadata fields.
Here is an alternative PR to this one: plone/mockup#1465

Update: This is actually the PR relevant for plone.app.mosaic: #634

@thet
Copy link
Member

thet commented May 19, 2025

I quickly checked the volta docs and cannot find an example where a similar file like .python-version is used, which could be added to the local checkout of this repository but excluded in .gitignore.

Bummer.

But I'm still -1 on adding tool config like this to the repo. Okay, we can argue similarly on other tools like yarn - why is there a yarn.lock then?
But when going this way and adding the volta field to package.json we would end up ultimately in an unmaintainable blob of different tool configs which would be constantly outdated and hard to remove because someone could still depend on it... Especially in the JavaScript world where there are million of tools competing for attention.

@petschki
Copy link
Member

I'll close this in favor of #634

@petschki petschki closed this May 20, 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

Successfully merging this pull request may close these issues.

5 participants