Get the current plugin version (PanelFlyout) from the manifest?

Welcome all my friends .
I’m having a little problem with my plugin
My code is :

const pluginVersion = require("uxp").versions.plugin;
console.log("Plugin Version - v"+pluginVersion);

I want to make it appear
it should appear in the drop-down list of the my plugin.

With regards …
Mohamed Fathi… :pray:

Try this instead:

const { versions } = require("uxp");
console.log("Plugin Version - v" + versions.plugin);
console.log("UXP Version - v" + versions.uxp);

Your code should work though…

Hi @Mohamad
It is not quite clear to me where the version information should be shown.
Do you mean inside the Plugins menu?

hi Timothy.
The code works fine, but the problem lies in the menu for the plugin.
The result of the console:

However, when I open the plugin drop-down menu, the plugin version does not appear as it is in manifest.json.
This result:

With regards…
Mohamed Fathi… :pray:

Hi @Mohamad
The only way I know is to add a “dummy” command to the manifest.json file:

  "entrypoints": [
      "type": "command",
      "id" : "versionInfo",
      "label": "Version v1.2.3"

This would show the version as a “static” info and must be edited manually each time you change the verison number.


I don’t see a way to change the EntryPoint information dynamically via Javascript.

Try this if you want to show the version in the plugin’s menu.

const { entrypoints } = require("uxp");
const { versions } = require("uxp");
const pluginVersion = versions.plugin;

  panels: {
   pluginId: { // plugin id from manifest file
      show(body) {
         menuItems: [
          id: "pluginVersion",
          label: `Plugin Version ${pluginVersion}`,
          checked: false,
          enabled: false,
        }, ]
1 Like

I will try and see the results and share it :smiling_face:

hi Wanokuni.
I am very grateful for your help :wine_glass: