Provide root package version as PENPOT_MCP_VERSION in plugin

Update current root package version using set-version script
This commit is contained in:
Dominik Jain
2026-03-27 14:57:17 +01:00
committed by Alonso Torres
parent 0122eaa391
commit 905f4fa5dd
3 changed files with 10 additions and 2 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "@penpot/mcp",
"version": "1.0.0",
"version": "2.15.0-rc.1.153",
"description": "MCP server for Penpot integration",
"bin": {
"penpot-mcp": "./bin/mcp-local.js"

View File

@@ -2,3 +2,4 @@
declare const IS_MULTI_USER_MODE: boolean;
declare const PENPOT_MCP_WEBSOCKET_URL: string;
declare const PENPOT_MCP_VERSION: string;

View File

@@ -1,10 +1,16 @@
import { defineConfig } from "vite";
import livePreview from "vite-live-preview";
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const rootPkg = require("../../package.json");
let WS_URI = process.env.WS_URI || "http://localhost:4402";
let SERVER_HOST = process.env.PENPOT_MCP_PLUGIN_SERVER_HOST ?? "localhost";
let MCP_VERSION = JSON.stringify(rootPkg.version);
console.log("Will define PENPOT_MCP_WEBSOCKET_URL as:", JSON.stringify(WS_URI));
console.log("PENPOT_MCP_WEBSOCKET_URL:", JSON.stringify(WS_URI));
console.log("PENPOT_MCP_VERSION:", MCP_VERSION);
export default defineConfig({
base: "./",
@@ -37,5 +43,6 @@ export default defineConfig({
},
define: {
PENPOT_MCP_WEBSOCKET_URL: JSON.stringify(WS_URI),
PENPOT_MCP_VERSION: MCP_VERSION,
},
});