Publishing some modules from a larger project - splitting out parts of a monorepo

When developing, often there are parts of the project that are worth releasing as separate independent projects. There is a tool from the Symfony authors - https://github.com/splitsh/lite - which can assist, but it took a little working out.

The script I've ended up using is below. I run it from the root of the project.

It should be usable by simply adjusting the few variables are the top and then run the script with bash.