mirror of
https://github.com/aaronsb/obsidian-mcp-plugin.git
synced 2026-07-22 06:45:14 +00:00
package.json is now the single source of truth for the plugin description (as it already effectively is for version). sync-version.mjs propagates it into manifest.json; mcpb/manifest.json keeps its Claude-Desktop-specific description and is intentionally not synced. Adds scripts/set-description.mjs + 'make set-description DESC=...' so neither JSON file is hand-edited (250-char Obsidian limit enforced). Rewrites the word-salad description to reality-based copy naming the actual client and mechanism: 'Give Claude Desktop and other AI assistants semantic access to your notes through a built-in Model Context Protocol (MCP) server.'
40 lines
No EOL
1.5 KiB
JavaScript
40 lines
No EOL
1.5 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
import { readFileSync, writeFileSync } from 'fs';
|
|
|
|
try {
|
|
// Read version from package.json
|
|
const packageJson = JSON.parse(readFileSync('package.json', 'utf-8'));
|
|
const version = packageJson.version;
|
|
|
|
// package.json is the single source of truth for both version and the
|
|
// plugin description. mcpb/manifest.json keeps its own Claude-Desktop
|
|
// specific description and is intentionally not synced here.
|
|
const description = packageJson.description;
|
|
|
|
// Read and update manifest.json
|
|
const manifest = JSON.parse(readFileSync('manifest.json', 'utf-8'));
|
|
manifest.version = version;
|
|
manifest.description = description;
|
|
|
|
// Write updated manifest.json
|
|
writeFileSync('manifest.json', JSON.stringify(manifest, null, 2) + '\n');
|
|
|
|
// Read and update mcpb/manifest.json (MCPB bundle for Claude Desktop)
|
|
const mcpbManifest = JSON.parse(readFileSync('mcpb/manifest.json', 'utf-8'));
|
|
mcpbManifest.version = version;
|
|
writeFileSync('mcpb/manifest.json', JSON.stringify(mcpbManifest, null, 2) + '\n');
|
|
|
|
// Update version.ts
|
|
const versionTs = `// Version is injected at build time by sync-version.mjs
|
|
export function getVersion(): string {
|
|
return '${version}';
|
|
}
|
|
`;
|
|
writeFileSync('src/version.ts', versionTs);
|
|
|
|
console.log(`✅ Synced version ${version} + description to manifest.json (version also: mcpb/manifest.json, version.ts)`);
|
|
} catch (error) {
|
|
console.error('❌ Failed to sync version:', error.message);
|
|
process.exit(1);
|
|
} |