mirror of
https://github.com/aaronsb/obsidian-mcp-plugin.git
synced 2026-07-22 16:40:32 +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.'
33 lines
1.1 KiB
JavaScript
33 lines
1.1 KiB
JavaScript
#!/usr/bin/env node
|
||
// Set the plugin description in package.json (the single source of truth).
|
||
// Run via `make set-description DESC='...'`, which then runs sync-version.mjs
|
||
// to propagate it into manifest.json. Avoids hand-editing either JSON file.
|
||
|
||
import { readFileSync, writeFileSync } from 'fs';
|
||
|
||
const desc = process.argv[2];
|
||
|
||
if (!desc || !desc.trim()) {
|
||
console.error("❌ No description given. Usage: make set-description DESC='Your text.'");
|
||
process.exit(1);
|
||
}
|
||
|
||
// Obsidian's plugin guidelines cap the catalog description at 250 chars.
|
||
if (desc.length > 250) {
|
||
console.error(`❌ Description is ${desc.length} chars; Obsidian's limit is 250.`);
|
||
process.exit(1);
|
||
}
|
||
|
||
try {
|
||
const pkg = JSON.parse(readFileSync('package.json', 'utf-8'));
|
||
if (pkg.description === desc) {
|
||
console.log('ℹ️ Description unchanged.');
|
||
process.exit(0);
|
||
}
|
||
pkg.description = desc;
|
||
writeFileSync('package.json', JSON.stringify(pkg, null, 2) + '\n');
|
||
console.log(`✅ package.json description set (${desc.length} chars). Run sync-version to propagate.`);
|
||
} catch (error) {
|
||
console.error('❌ Failed to set description:', error.message);
|
||
process.exit(1);
|
||
}
|