The plugin manifest
Six files a plugin can ship, each one a different entry point, and the manifest that records which of them exist.
A plugin's manifest is not a file you write. It is computed by the platform the moment a plugin is
uploaded: validate_plugin() looks on disk for exactly six filenames, records which ones exist
(and whether each was found at the package root or under dist/), and saves the result as
doc.manifest on the plugin's catalog document. Everything downstream, the runtime's loader, the
install consent screen, the dashboard's setup button, reads that manifest rather than probing the
package itself.
The six files
A plugin ships whichever of these its kind needs. plugins/@xuda.io/xuda-ui-plugin-moment/src has
only index.mjs and runtime.mjs; plugins/@xuda.io/xuda-library-plugin-xlsx has index.mjs and
server.mjs; plugins/@xuda.io/xuda-dbs-plugin-couchdb has index.mjs and server.mjs.
Root or dist/
validate_plugin() looks for each file first at the package root, then at dist/<file>. Either
location satisfies the manifest, so a plugin built with Vite (most of the ones under
plugins/@xuda.io/) ships source under src/ and lets its build write the manifest files into
dist/.
runtime.css (and any other manifest CSS) is only ever picked up when its matching .mjs was
found under dist/, never from the package root. The runtime checks
manifest[resource].dist && manifest[resource].css before it will fetch the stylesheet, so a plugin with a root-level runtime.mjs and a root-level style.css
passes validation (exist: true on both) but the runtime never loads the CSS. Ship through
dist/ if the plugin needs its stylesheet to actually load.
What the manifest is used for
- Loading a UI plugin. The runtime refuses to run a UI plugin at all
unless the manifest shows both
runtime.mjsandindex.mjspresent; then it importsindex.mjsforproperties, resolves each property's value (includingxu-exp:expression bindings) against the element's attributes, importsruntime.mjs, and callsfn. - The install consent screen. Manifest presence turns straight into the sentences a
user reads before installing: shipping
server.mjssays "Runs its own code on Xuda servers, inside your project"; shippingruntime.mjssays "Runs its own code inside your published app, in the browser of everyone who uses it";studio.mjsandsetup.mjsget their own lines too. - The dashboard's Setup button. A plugin's setup screen only shows when
manifest['index.mjs'].existis true and that module is not empty, or the plugin has a dependency with its own setup.