plone / volto

React-based frontend for the Plone Content Management System
https://demo.plone.org/
MIT License
426 stars 575 forks source link

Add dependencies syncronizer utility #5879

Closed sneridagh closed 1 month ago

sneridagh commented 1 month ago

Now you can run it directly from the core repo:

node ./packages/scripts/volto-update-deps.js path/to/my/project

Once released, if you have installed `@plone/scripts:

pnpm run volto-update-deps path/to/my/project

or

./node_modules/.bin/volto-update-deps.js path/to/my/project

It will sync the dependencies and devDependencies with the ones in Volto. It never removes dependencies (for obvious reasons).

It eases the upgrades by not having to modify manually versions over and over. This will allow to move to pnpm everywhere :)

The setup is already being tested with the current setup.

netlify[bot] commented 1 month ago

Deploy Preview for volto canceled.

Name Link
Latest commit fb5115a475c5aa0f311c32a5ea53dee31d7a9023
Latest deploy log https://app.netlify.com/sites/volto/deploys/65f6d7b3d1a9c20008b84d98
netlify[bot] commented 1 month ago

Deploy Preview for plone-components canceled.

Name Link
Latest commit fb5115a475c5aa0f311c32a5ea53dee31d7a9023
Latest deploy log https://app.netlify.com/sites/plone-components/deploys/65f6d7b3d0631f00087bd6d5
wesleybl commented 1 month ago

@sneridagh will it be possible to synchronize versions, even after the app has already been created?

sneridagh commented 1 month ago

@wesleybl that's the idea, did you notice the bin for the dep_sync.js script?

https://github.com/plone/volto/pull/5879/files#diff-ed280c356cb0a2ae65c222c2c764601fde58b2e937106442118bcc0245185faf

sneridagh commented 1 month ago

Muahahaha next will be green :)

ichim-david commented 1 month ago

@sneridagh this is awesome, my only nitpick is regarding the actual command name depssync. I would rather have it depsSync, taking the queues from the package.json dependencies devDependencies. It makes it easier to read to have that camelCase naming since it's two words in one

@sneridagh taking a better look at my node_modules/.bin folder I see that all of the commands are split by a dash only as such we should do the same deps-sync just like we have "dry-release".

davisagli commented 1 month ago

@sneridagh @ichim-david the bin folder is a flat namespace. I would name it something that makes it clearer the command comes from volto, like volto-update-deps

(Really I'd rather have one volto-dev command with multiple subcommands, but that is a project for another day.)

sneridagh commented 1 month ago

@davisagli @ichim-david doh, it seems I didn't commited the key file :)