Declare several frontends#

This guide shows you how to declare the apps of a repository with [[component]] tables. The example repository develops its frontend packages in a Volto app and in an Aurora app.

The repository has this layout.

backend/                  Plone backend app
volto/                    Volto app, with mrs.developer.json
aurora/                   Aurora app, with pnpm-workspace.yaml
packages/acme-videos/     Python package, installed in the backend
packages/volto-videos/    Volto add-on, installed in the Volto app
packages/aurora-videos/   Aurora add-on, installed in the Aurora app
packages/videos-core/     Node package, installed in both frontend apps

Important

Components need specification 2 of repository.toml. If the file has no spec_version = "2" line, follow Migrate from repoplone 1 first.

Start from the derived components#

Let repoplone write the components it derives today.

uvx repoplone settings migrate --components

The command adds a backend and a frontend component, and a components list to every package. It keeps the comments of the file. Run it with --dry-run first to see the result without writing it.

Declare one component per app#

Edit the [[component]] tables so that there is one per app. Name each component after the make target that installs it: volto for make volto-install.

[[component]]
name = "backend"
type = "python-plone"
path = "backend"

[[component]]
name = "volto"
type = "node-volto"
path = "volto"
changelog_package = "@acme/volto-videos"

[[component]]
name = "aurora"
type = "node-aurora"
path = "aurora"
changelog_package = "@acme/aurora-videos"

The type gives each component its base package: Products.CMFPlone, @plone/volto, and @plone/aurora. Set base_package only when the app builds on something else, such as a Volto distribution.

changelog_package names the package whose changelog repoplone copies to the app’s own CHANGELOG.md at release time. Leave it out when the app keeps no changelog of its own.

List the components of each package#

Give every package the list of apps that install it. The shared package lists both frontend apps.

[[package]]
type = "node"
name = "@acme/videos-core"
path = "packages/videos-core"
changelog = "packages/videos-core/CHANGELOG.md"
components = ["volto", "aurora"]

Remove primary and base_package from the packages. With components declared, they have no effect, and repoplone warns about them.

A package without components is still versioned and released. No app installs it, and no component reports it.

Check the result#

List the base packages of each app.

uvx repoplone deps info

The table has one row per component: Backend, Volto, and Aurora, with their base packages. Compare the versions the apps pin with the latest releases.

uvx repoplone deps check

Check the folders that trigger each app in CI.

uvx repoplone settings github-outputs

The paths-filter block lists packages/videos-core/** under both volto and aurora.

Match the Makefile targets#

repoplone deps sync and repoplone deps upgrade install an app with make <component>-install after they change its pins. Check that the Makefile at the root of the repository has one such target per component.

.PHONY: volto-install
volto-install: ## Install the Volto app
	$(MAKE) -C volto install

.PHONY: aurora-install
aurora-install: ## Install the Aurora app
	$(MAKE) -C aurora install

See also