Makes bumping your monorepos workspaces version a breeze 🌬️.
It's mostly useful for those using Yarn Berry (v2/v3), but you can use it with npm, pnpm and Yarn Classic (v1).
-
prewersion
&postwersion
scripts -
npm
,pnpm
,Yarn Classic (v1)
&Yarn Berry (v2, v3)
package managers -
--dry-run
CLI option
-
allowedBranches
configuration key - Specified version support (i.e.
wersion 1.2.3
)
- npm, pnpm or Yarn v1/v3
- Setting the
workspaces
field in yourpackage.json
file (i.e. `"workspaces": ["packages/*"]``)
First, install Wersion:
yarn add -DE wersion
# or
pnpm i -DE wersion
# or
npm i -DE wersion
# or
npm i -g wersion # to install it globally
Simply run:
yarn wersion <release>
# or
pnpm wersion <release>
# or
npx wersion <release>
# or
wersion <release> # if installed globally
<release>
can be one of: "patch", "minor", "major", "prepatch", "preminor", "premajor" or "prewersion".
You can run it with --dry-run
or -d
to see what would happen without actually bumping your packages versions.
In your package.json
:
{
"scripts": {
"prewersion": "echo \"The version will be bumped from v${PREVIOUS_VERSION} to v${NEXT_VERSION}.\"",
"postwersion": "echo \"The version has been bumped from v${PREVIOUS_VERSION} to v${NEXT_VERSION}.\""
}
}