Skip to content

Commit 9683b83

Browse files
committed
Fix npm package to include UI build in dist/ui/, bump to 1.0.4
Copy UI build output into dist/ui/ so it's included in the npm package. Resolve UI static path with fallback for both npm package and dev layouts.
1 parent b1877f8 commit 9683b83

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

package-lock.json

Lines changed: 7 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@prih/mcp-graph-memory",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "MCP server for semantic graph memory from markdown files",
55
"main": "dist/cli/index.js",
66
"bin": {
@@ -9,7 +9,7 @@
99
"scripts": {
1010
"build": "npm run build:server && npm run build:ui",
1111
"build:server": "rm -rf dist && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
12-
"build:ui": "cd ui && npm run build",
12+
"build:ui": "cd ui && npm run build && cp -r dist ../dist/ui",
1313
"start": "node dist/index.js",
1414
"dev": "tsc --watch",
1515
"cli": "node dist/cli/index.js",
@@ -41,7 +41,6 @@
4141
},
4242
"files": [
4343
"dist/",
44-
"ui/dist/",
4544
"README.md"
4645
],
4746
"publishConfig": {

src/api/rest/index.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import fs from 'fs';
12
import path from 'path';
23
import express from 'express';
34
import cors from 'cors';
@@ -94,8 +95,10 @@ export function createRestApp(projectManager: ProjectManager): express.Express {
9495
app.use('/api/projects/:projectId/graph', createGraphRouter());
9596
app.use('/api/projects/:projectId/tools', createToolsRouter(projectManager));
9697

97-
// Serve UI static files (ui/dist)
98-
const uiDist = path.resolve(__dirname, '../../../ui/dist');
98+
// Serve UI static files — check dist/ui/ (npm package) then ui/dist/ (dev)
99+
const uiDistPkg = path.resolve(__dirname, '../../ui');
100+
const uiDistDev = path.resolve(__dirname, '../../../ui/dist');
101+
const uiDist = fs.existsSync(uiDistPkg) ? uiDistPkg : uiDistDev;
99102
app.use(express.static(uiDist));
100103

101104
// SPA fallback: serve index.html for non-API routes

0 commit comments

Comments
 (0)