diff --git a/packages/mcp-server/build b/packages/mcp-server/build index e88aeb3..c1de500 100644 --- a/packages/mcp-server/build +++ b/packages/mcp-server/build @@ -24,16 +24,7 @@ node scripts/postprocess-dist-package-json.cjs # build to .js/.mjs/.d.ts files npm exec tsc-multi -# we need to add exports = module.exports = Anthropic TypeScript to index.js; -# No way to get that from index.ts because it would cause compile errors -# when building .mjs -DIST_PATH=./dist node ../../scripts/utils/fix-index-exports.cjs - -# with "moduleResolution": "nodenext", if ESM resolves to index.d.ts, -# it'll have TS errors on the default import. But if it resolves to -# index.d.mts the default import will work (even though both files have -# the same export default statement) -cp dist/index.d.ts dist/index.d.mts + cp tsconfig.dist-src.json dist/src/tsconfig.json # Add proper Node.js shebang to the top of the file diff --git a/packages/mcp-server/package.json b/packages/mcp-server/package.json index 1847635..b6bb18c 100644 --- a/packages/mcp-server/package.json +++ b/packages/mcp-server/package.json @@ -41,7 +41,7 @@ "ts-jest": "^29.1.0", "ts-morph": "^19.0.0", "ts-node": "^10.5.0", - "tsc-multi": "^1.1.0", + "tsc-multi": "https://github.com/stainless-api/tsc-multi/releases/download/v1.1.3/tsc-multi.tgz", "tsconfig-paths": "^4.0.0", "typescript": "^4.8.2" }, @@ -51,23 +51,12 @@ }, "exports": { ".": { - "require": { - "types": "./dist/index.d.ts", - "default": "./dist/index.js" - }, - "types": "./dist/index.d.mts", + "require": "./dist/index.js", "default": "./dist/index.mjs" }, - "./*.mjs": { - "types": "./dist/*.d.ts", - "default": "./dist/*.mjs" - }, - "./*.js": { - "types": "./dist/*.d.ts", - "default": "./dist/*.js" - }, + "./*.mjs": "./dist/*.mjs", + "./*.js": "./dist/*.js", "./*": { - "types": "./dist/*.d.ts", "require": "./dist/*.js", "default": "./dist/*.mjs" } diff --git a/packages/mcp-server/src/tools.ts b/packages/mcp-server/src/tools.ts new file mode 100644 index 0000000..7e516de --- /dev/null +++ b/packages/mcp-server/src/tools.ts @@ -0,0 +1 @@ +export * from './tools/index'; diff --git a/packages/mcp-server/tsconfig.build.json b/packages/mcp-server/tsconfig.build.json index f1828ab..9cd534a 100644 --- a/packages/mcp-server/tsconfig.build.json +++ b/packages/mcp-server/tsconfig.build.json @@ -5,8 +5,8 @@ "compilerOptions": { "rootDir": "./dist/src", "paths": { - "isaacus-mcp/*": ["src/*"], - "isaacus-mcp": ["src/index.ts"] + "isaacus-mcp/*": ["dist/src/*"], + "isaacus-mcp": ["dist/src/index.ts"] }, "noEmit": false, "declaration": true,