File tree Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Expand file tree Collapse file tree 2 files changed +17
-5
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " mcp-framework" ,
3- "version" : " 0.1.9 " ,
3+ "version" : " 0.1.10 " ,
44 "description" : " Framework for building Model Context Protocol (MCP) servers in Typescript" ,
55 "type" : " module" ,
66 "author" : " Alex Andru <alex@andru.codes>" ,
2020 "mcp-build" : " ./dist/cli/framework/build.js"
2121 },
2222 "scripts" : {
23- "build" : " tsc " ,
23+ "build" : " node ./dist/cli/framework/build.js " ,
2424 "watch" : " tsc --watch" ,
25- "test" : " jest" ,
26- "prepare" : " npm run build"
25+ "prepare" : " tsc && node ./dist/cli/framework/build.js"
2726 },
2827 "keywords" : [
2928 " mcp" ,
Original file line number Diff line number Diff line change 22import { spawnSync } from "child_process" ;
33import { readFileSync , writeFileSync } from "fs" ;
44import { join } from "path" ;
5+ import { platform } from "os" ;
56
67export function buildFramework ( ) {
78 runTsc ( ) ;
@@ -10,13 +11,25 @@ export function buildFramework() {
1011}
1112
1213function runTsc ( ) {
13- const tscPath = join ( process . cwd ( ) , "node_modules" , ".bin" , "tsc" ) ;
14+ const isWindows = platform ( ) === "win32" ;
15+ const tscPath = join (
16+ process . cwd ( ) ,
17+ "node_modules" ,
18+ ".bin" ,
19+ isWindows ? "tsc.cmd" : "tsc"
20+ ) ;
21+
1422 const tsc = spawnSync ( tscPath , [ ] , {
1523 stdio : "inherit" ,
1624 shell : true ,
25+ env : {
26+ ...process . env ,
27+ PATH : process . env . PATH ,
28+ } ,
1729 } ) ;
1830
1931 if ( tsc . status !== 0 ) {
32+ console . error ( "TypeScript compilation failed" ) ;
2033 process . exit ( tsc . status ?? 1 ) ;
2134 }
2235}
You can’t perform that action at this time.
0 commit comments