Skip to content

Add the @plone/registry/app-info virtual module - #403

Open
sneridagh wants to merge 1 commit into
mainfrom
sneridagh/registry-app-info
Open

sneridagh wants to merge 1 commit into
mainfrom
sneridagh/registry-app-info

Conversation

@sneridagh

Copy link
Copy Markdown
Member

Adds @plone/registry/app-info, a virtual module like @plone/registry/blocks-docs and @plone/registry/plate-editor. Its default export is the name and version of the app (from its package.json) and of each of its add-ons, in add-on order:

import appInfo from '@plone/registry/app-info';
// { name: '@plone/aurora', version: '1.0.0-alpha.23', addons: [{ name: '@plone/cmsui', version: '…' }, …] }
  • The Vite plugin writes .plone/registry.appInfo.js and aliases the import to it. It holds only names and versions, never file system paths, so client code can import it.
  • virtual/app-info.js is the empty fallback for unit tests, Storybook and type checks, following virtual/README.md.
  • The site overview reads the app version from it instead of importing apps/aurora/package.json from cmsui, which only worked inside this monorepo.

This is the base for #368: the installed add-ons list can be read from appInfo.addons instead of the addonsInfo export of the add-ons loader, which carries the absolute paths of the machine that built the app.

The addonsInfo export of the loader stays for now: apps/aurora/app/routes.ts (through registry.addonsInfo.json) and Volto still read it.

Tested: registry and SiteOverview unit tests, check:ts, and an Aurora build (the info lands only in the control panels chunk, with no local paths in the client bundle).

Assisted-by: Claude Opus 5.5

The Plone registry Vite plugin generates .plone/registry.appInfo.js with
the name and version of the app and of its add-ons, in add-on order, and
aliases @plone/registry/app-info to it. It has no file system paths, so
client code can import it. Outside of a Vite app it resolves to an empty
fallback in virtual/.

The site overview reads the app version from it instead of importing the
Aurora app's package.json from cmsui.

Assisted-by: Claude Opus 5.5
@read-the-docs-community

Copy link
Copy Markdown

Documentation build overview

📚 plone-registry | 🛠️ Build #35723427 | 📁 Comparing d24012c against latest (7e3cc8f)

  🔍 Preview build  

1 file changed
± conceptual-guides/add-on-loader.html

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant