Skip to content
This repository was archived by the owner on May 21, 2026. It is now read-only.

Commit a5a504d

Browse files
committed
feat: enhance create-mcp-use-app with new UI templates and improved server resources
- Added new UI templates for data visualization and Kanban board in `create-mcp-use-app`. - Updated `pnpm-lock.yaml` to include new dependencies for the UI templates. - Refactored server resource definitions to improve structure and added annotations for better documentation. - Modified `copy-templates` script in `package.json` to use a dedicated script for copying templates. - Enhanced styling and layout for data visualization components to improve user experience.
1 parent 1dbe763 commit a5a504d

10 files changed

Lines changed: 358 additions & 598 deletions

File tree

packages/create-mcp-use-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
"scripts": {
3333
"build": "npm run clean && tsup src/index.ts --format esm && tsc --emitDeclarationOnly --declaration && npm run copy-templates",
3434
"clean": "rm -rf dist tsconfig.tsbuildinfo",
35-
"copy-templates": "mkdir -p dist/templates && cp -r src/templates/* dist/templates/",
35+
"copy-templates": "node scripts/copy-templates.js",
3636
"dev": "tsc --build --watch",
3737
"test": "vitest",
3838
"lint": "eslint ."
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env node
2+
3+
import { promises as fs } from 'fs';
4+
import path from 'path';
5+
import { fileURLToPath } from 'url';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = path.dirname(__filename);
9+
10+
const sourceDir = path.join(__dirname, '..', 'src', 'templates');
11+
const targetDir = path.join(__dirname, '..', 'dist', 'templates');
12+
13+
async function copyDir(src, dest, excludeDirs = ['node_modules']) {
14+
try {
15+
await fs.mkdir(dest, { recursive: true });
16+
17+
const entries = await fs.readdir(src, { withFileTypes: true });
18+
19+
for (const entry of entries) {
20+
const srcPath = path.join(src, entry.name);
21+
const destPath = path.join(dest, entry.name);
22+
23+
// Skip excluded directories
24+
if (entry.isDirectory() && excludeDirs.includes(entry.name)) {
25+
console.log(`Skipping ${entry.name}/`);
26+
continue;
27+
}
28+
29+
if (entry.isDirectory()) {
30+
await copyDir(srcPath, destPath, excludeDirs);
31+
} else {
32+
await fs.copyFile(srcPath, destPath);
33+
console.log(`Copied ${entry.name}`);
34+
}
35+
}
36+
} catch (error) {
37+
console.error('Error copying templates:', error);
38+
process.exit(1);
39+
}
40+
}
41+
42+
// Ensure target directory exists
43+
await fs.mkdir(targetDir, { recursive: true });
44+
45+
console.log('Copying templates...');
46+
await copyDir(sourceDir, targetDir);
47+
console.log('Templates copied successfully!');

0 commit comments

Comments
 (0)