Skip to content

Commit 437e86a

Browse files
tadasantclaude
andcommitted
fix: restore missing prepare-publish.js for claude-code-agent (v0.0.4)
The prepare-publish.js file was accidentally deleted during the directory architecture refactoring in commit 1a5f484. This restores the file with the correct implementation following the same pattern as other MCP servers. Also bumps version to 0.0.4 to trigger CI build and verify the fix works. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1a5f484 commit 437e86a

File tree

4 files changed

+67
-3
lines changed

4 files changed

+67
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "claude-code-agent-mcp-server",
3-
"version": "0.0.3",
3+
"version": "0.0.4",
44
"description": "Local implementation of claude-code-agent MCP server",
55
"mcpName": "claude-code-agent",
66
"main": "build/index.js",
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.

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)