Skip to content

Commit 5204836

Browse files
tadasantclaude
andcommitted
fix: add missing prepare-publish.js script for claude-code-agent v0.0.2
CRITICAL FIX: The 0.0.1 release was published without any compiled JavaScript files because the prepare-publish.js script was missing. This caused `npx claude-code-agent-mcp-server` to fail with "command not found". Changes: - Added prepare-publish.js script to build and bundle the package - Updated prepublishOnly script to run prepare-publish.js - Bumped version to 0.0.2 - Updated CHANGELOG.md with fix details The package will now correctly include the build/ directory with all executable code when published to npm. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent b0965cf commit 5204836

File tree

4 files changed

+79
-3
lines changed

4 files changed

+79
-3
lines changed

experimental/claude-code-agent/CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@ All notable changes to the Claude Code Agent MCP Server will be documented in th
44

55
## [Unreleased]
66

7+
## [0.0.2] - 2025-10-08
8+
9+
**CRITICAL FIX:**
10+
11+
- Added missing `prepare-publish.js` script that caused the 0.0.1 release to be published without any compiled JavaScript files
12+
- Updated `prepublishOnly` script to properly build and bundle the package before publishing
13+
- The npm package now correctly includes the `build/` directory with all executable code
14+
15+
**Technical Details:**
16+
17+
This fix resolves the issue where `npx claude-code-agent-mcp-server` would fail with "command not found" because the published package only contained README.md and package.json. The package now includes all necessary files for execution.
18+
719
## [0.0.1] - 2025-10-04
820

921
Initial release of the Claude Code Agent MCP Server - an agentic MCP configuration solution that solves the "tool overload" problem by enabling dynamic Claude Code subagent spawning with only relevant MCP servers.

experimental/claude-code-agent/local/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-code-agent-mcp-server",
3-
"version": "0.0.1",
3+
"version": "0.0.2",
44
"description": "Local implementation of claude-code-agent MCP server",
55
"mcpName": "claude-code-agent",
66
"main": "build/index.js",
@@ -23,7 +23,7 @@
2323
"start": "node build/index.js",
2424
"dev": "tsx src/index.ts",
2525
"prebuild": "cd ../shared && npm run build && cd ../local && node setup-dev.js",
26-
"prepublishOnly": "node ../scripts/prepare-npm-readme.js",
26+
"prepublishOnly": "node prepare-publish.js && node ../scripts/prepare-npm-readme.js",
2727
"lint": "eslint . --ext .ts,.tsx",
2828
"lint:fix": "eslint . --ext .ts,.tsx --fix",
2929
"format": "prettier --write .",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env node
2+
import { cp, rm } from 'fs/promises';
3+
import { join, dirname } from 'path';
4+
import { fileURLToPath } from 'url';
5+
import { execSync } from 'child_process';
6+
7+
const __dirname = dirname(fileURLToPath(import.meta.url));
8+
9+
async function prepare() {
10+
console.log('Preparing for publish...');
11+
12+
// First, ensure TypeScript is available
13+
console.log('Installing TypeScript for build...');
14+
try {
15+
execSync('npm install --no-save typescript @types/node', { stdio: 'inherit' });
16+
} catch (e) {
17+
console.error('Failed to install TypeScript:', e.message);
18+
process.exit(1);
19+
}
20+
21+
// Build shared directory first
22+
const sharedDir = join(__dirname, '../shared');
23+
console.log('Building shared directory...');
24+
try {
25+
execSync('npm install && npm run build', { cwd: sharedDir, stdio: 'inherit' });
26+
} catch (e) {
27+
console.error('Failed to build shared directory:', e.message);
28+
process.exit(1);
29+
}
30+
31+
// Set up the shared directory for the build
32+
console.log('Setting up shared directory for build...');
33+
try {
34+
// Create a symlink for the build process (like setup-dev.js does)
35+
await rm(join(__dirname, 'shared'), { recursive: true, force: true });
36+
execSync(`node setup-dev.js`, { cwd: __dirname, stdio: 'inherit' });
37+
} catch (e) {
38+
console.error('Failed to set up shared directory:', e.message);
39+
process.exit(1);
40+
}
41+
42+
// Now build the local package
43+
console.log('Building local package...');
44+
try {
45+
execSync('npx tsc && npx tsc -p tsconfig.integration.json', { stdio: 'inherit' });
46+
} catch (e) {
47+
console.error('Failed to build local package:', e.message);
48+
process.exit(1);
49+
}
50+
51+
// Clean up the symlink and copy the actual files for publishing
52+
try {
53+
await rm(join(__dirname, 'shared'), { recursive: true, force: true });
54+
} catch (e) {
55+
// Ignore if doesn't exist
56+
}
57+
58+
// Copy the built shared files
59+
await cp(join(__dirname, '../shared/build'), join(__dirname, 'shared'), { recursive: true });
60+
61+
console.log('Copied shared files to local package');
62+
}
63+
64+
prepare().catch(console.error);

experimental/claude-code-agent/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)