@foldkit/vite-plugin 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +12 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -45,7 +45,15 @@ const startMcpWebSocketServer = (port) => {
45
45
  const wss = new WebSocketServer({ port });
46
46
  mcpWebSocketServer = wss;
47
47
  wss.on('error', error => {
48
- console.error(`[foldkit:devTools] MCP relay failed to start on port ${port}; continuing without the relay`, error);
48
+ if ('code' in error && error.code === 'EADDRINUSE') {
49
+ console.error(`\n[foldkit:devTools] Port ${port} is already in use, so the DevTools MCP relay could not start.\n` +
50
+ `[foldkit:devTools] This usually means another Foldkit project is already running and bound to this port.\n` +
51
+ `[foldkit:devTools] Until the port is freed, agents will not be able to connect to this app via the Foldkit DevTools MCP server.\n` +
52
+ `[foldkit:devTools] Stop the other project, or set a different \`devToolsMcpPort\` in this project's vite config.\n`);
53
+ }
54
+ else {
55
+ console.error(`[foldkit:devTools] MCP relay failed to start on port ${port}; continuing without the relay`, error);
56
+ }
49
57
  mcpWebSocketServer = null;
50
58
  });
51
59
  wss.on('connection', client => {
@@ -64,7 +72,9 @@ const startMcpWebSocketServer = (port) => {
64
72
  console.error('[foldkit:devTools] MCP client error', error);
65
73
  });
66
74
  });
67
- console.log(`[foldkit:devTools] MCP relay listening on ws://localhost:${port}`);
75
+ wss.on('listening', () => {
76
+ console.log(`[foldkit:devTools] MCP relay listening on ws://localhost:${port}`);
77
+ });
68
78
  };
69
79
  const stopMcpWebSocketServer = () => {
70
80
  const clients = Effect.runSync(Ref.get(mcpClientsRef));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foldkit/vite-plugin",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "Vite plugin for Foldkit hot module reloading with state preservation",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -17,7 +17,7 @@
17
17
  ],
18
18
  "peerDependencies": {
19
19
  "effect": "^3.18.2",
20
- "foldkit": "^0.76.0",
20
+ "foldkit": "^0",
21
21
  "vite": "^7.0.0"
22
22
  },
23
23
  "dependencies": {
@@ -28,7 +28,7 @@
28
28
  "effect": "^3.19.19",
29
29
  "typescript": "^6.0.2",
30
30
  "vite": "^7.3.1",
31
- "foldkit": "0.76.0"
31
+ "foldkit": "0.81.1"
32
32
  },
33
33
  "keywords": [
34
34
  "vite",