From 84b72f6f2988121277bffcb5eb0474a47c2940a1 Mon Sep 17 00:00:00 2001 From: Alex Andru Date: Tue, 21 Jan 2025 00:41:25 +0100 Subject: [PATCH] fix:scope --- package.json | 2 +- src/cli/framework/build.ts | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 932ff81..8ac92e5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mcp-framework", - "version": "0.1.15", + "version": "0.1.17", "description": "Framework for building Model Context Protocol (MCP) servers in Typescript", "type": "module", "author": "Alex Andru ", diff --git a/src/cli/framework/build.ts b/src/cli/framework/build.ts index bf5faa7..70d6bd4 100644 --- a/src/cli/framework/build.ts +++ b/src/cli/framework/build.ts @@ -4,20 +4,26 @@ import { join } from "path"; export async function buildFramework() { const projectDir = process.cwd(); - + try { - await execa("npx", ["tsc"], { + console.log(`Building project in: ${projectDir}`); + + await execa("tsc", [], { stdio: "inherit", reject: true, + cwd: projectDir }); - const indexPath = join(projectDir, "dist", "index.js"); + const distPath = join(projectDir, "dist"); + const projectIndexPath = join(distPath, "index.js"); const shebang = "#!/usr/bin/env node\n"; - const content = await readFile(indexPath, "utf8"); + const content = await readFile(projectIndexPath, "utf8"); if (!content.startsWith(shebang)) { - await writeFile(indexPath, shebang + content); + await writeFile(projectIndexPath, shebang + content); } + + console.log("Build complete!"); } catch (error) { console.error("Build failed:", error instanceof Error ? error.message : error); process.exit(1);