Skip to content
Verified

Versioning

A plugin's version is a plain string comparison between the catalog document and what a project has installed, there is no semver range matching.

A plugin's version lives in two places: doc.version on the catalog document (the latest uploaded version), and app_plugins_purchased[plugin_name].version on each project that installed it (the version that project actually has). Nothing keeps these in sync automatically.

Where the version comes from

upload_plugin sets doc.version differently depending on where the package lives:

  • npm package source: read straight off the registry with getPackageManifest(plugin_name), so it is whatever npm version produced when the author last ran npm publish. Every first-party plugin's package.json has a pub script for this: npm version patch --force && npm publish --access public.
  • xuda_hosted package source (no npm publish involved, the working copy is packed and hosted by the platform itself): doc.version is whatever was sent in the request, or 0.1.0 if nothing was.

install_plugin copies doc.version onto the project's app_plugins_purchased entry at the moment of install. A later upload_plugin that bumps the catalog document's version does not touch projects that already installed an earlier one, they keep the version they installed until something installs the new one over it.

How a stale install is surfaced

There is no automatic update. What exists is a visual comparison: the plugin card's version badge compares app_plugins_purchased[plugin_name].version (what is installed) against the catalog document's version (the latest), rendering the installed number in green when they match and amber when they do not. Nothing forces the reinstall, an owner (or an installer) re-running install_plugin on the same project is what pulls the newer version in, the same call used for a first install.

Updating a plugin you own

The dashboard's Update with AI button, shown on a plugin's card to its owner, does not bump the version itself. It opens the Ask AI assistant pre-seeded with metadata: { plugin_action: 'modify', plugin_name, widget_type: plugin.plugin_type } and a prompt naming the plugin (updateWithAi() in Tab_plugins.vue), which drives the AI plugin builder (ai_module.create_plugin_via_ai, the same generator utils/create_plugin_via_ai.mjs calls directly) to edit the plugin's code and re-upload it, that upload is what advances doc.version.

A code/npm update never re-enters review

upload_plugin treats any update where visibility is already 'private', or skip_publish_review is set, as a private code change: it carries the plugin's existing visibility and publish_stat forward untouched rather than resubmitting it for marketplace review. Going from private to public is only ever publish_plugin, a separate, explicit action; see publishing.