Upgrade a Volto distribution#

This guide shows you how to upgrade a frontend whose base package is a Volto distribution. It also shows how to release a distribution so that projects built on it can follow it.

Name the distribution as the base package#

A frontend built on a distribution names it as its base package. Without components, set it on the primary Node package.

[[package]]
type = "node-volto"
name = "my-site"
path = "frontend/packages/my-site"
base_package = "@kitconcept/volto-intranet"

With components, set it on the component instead.

[[component]]
name = "frontend"
type = "node-volto"
path = "frontend"
base_package = "@kitconcept/volto-intranet"

Upgrade the frontend#

Upgrade to the latest release of the distribution.

uvx repoplone deps upgrade frontend

Or to a version of your choice.

uvx repoplone deps upgrade frontend 3.0.0

repoplone pins the distribution in the package.json of the frontend. When the distribution’s published package.json has a volto_version field, repoplone also does the following.

  • It fetches the versions the distribution enforces, and its volto_version, from the npm registry.

  • It writes them to distribution.json at the root of the frontend workspace.

  • It aligns the @plone/volto tag in mrs.developer.json with the distribution’s volto_version.

The project’s .pnpmfile.cjs hook reads distribution.json and overrides those versions across the workspace when pnpm installs it. repoplone then runs make frontend-install, which updates the lockfile.

repoplone deps check and repoplone versions dependencies report both the distribution and the Volto core version it uses.

Stamp the Volto version when you release a distribution#

A distribution advertises the Volto core version it targets with a volto_version field in its package.json. Projects built on the distribution read that field when they upgrade.

Stamp the field when you release the distribution. In the distribution package’s .release-it.json, run the stamp after the version bump.

{
  "hooks": {
    "after:bump": [
      "uvx repoplone deps stamp-volto-version",
      "git add package.json"
    ]
  }
}

deps stamp-volto-version reads the @plone/volto tag from mrs.developer.json and writes it, unchanged, to the volto_version field of the primary Node package’s package.json. It finds repository.toml by walking up from the current folder. It works from the package folder where release-it runs.

To stamp a package other than the primary one, name it.

uvx repoplone deps stamp-volto-version --package @kitconcept/volto-intranet

See also