|
2 | 2 | /** |
3 | 3 | * Postversion hook for packages/mcp-server. When `npm version` bumps the |
4 | 4 | * MCP server, propagate the same version string to every file that pins the |
5 | | - * pluginos version: peer package.json manifests, the DXT manifest (both the |
6 | | - * top-level `version` and its `server.mcp_config.args` pin), and the |
7 | | - * hardcoded npx args inside the Figma plugin's UI sources. |
| 5 | + * pluginos version: peer package.json manifests and the DXT manifest (both |
| 6 | + * the top-level `version` and its `server.mcp_config.args` pin). |
| 7 | + * |
| 8 | + * Note: the Figma plugin UI (`bridge-plugin/src/ui-entry.ts` and |
| 9 | + * `bootloader.html`) reads `mcp-server/package.json#version` at webpack |
| 10 | + * build time, so no source-file rewrite is needed there. |
8 | 11 | */ |
9 | 12 | constfs=require("node:fs"); |
10 | 13 | constpath=require("node:path"); |
@@ -40,20 +43,3 @@ if (Array.isArray(dxt?.server?.mcp_config?.args)) { |
40 | 43 | } |
41 | 44 | fs.writeFileSync(dxtAbs,JSON.stringify(dxt,null,2)+"\n"); |
42 | 45 | console.log(`Bumped ${dxtManifestRel} → ${newVersion}`); |
43 | | - |
44 | | -// Sources that hardcode `pluginos@<version>` in copy-paste MCP config snippets. |
45 | | -// These use a regex swap so formatting is preserved. |
46 | | -constsourceTargets=[ |
47 | | -"packages/bridge-plugin/src/ui-entry.ts", |
48 | | -"packages/bridge-plugin/src/bootloader.html", |
49 | | -]; |
50 | | - |
51 | | -for(constrelofsourceTargets){ |
52 | | -constabs=path.join(repoRoot,rel); |
53 | | -constbefore=fs.readFileSync(abs,"utf8"); |
54 | | -constafter=before.replace(/pluginos@\d+\.\d+\.\d+/g,`pluginos@${newVersion}`); |
55 | | -if(after!==before){ |
56 | | -fs.writeFileSync(abs,after); |
57 | | -console.log(`Bumped ${rel} → pluginos@${newVersion}`); |
58 | | -} |
59 | | -} |
0 commit comments