aaronsb_obsidian-mcp-plugin/scripts/set-description.mjs
Aaron Bockelie 46ed67361a chore(meta): make pattern for plugin description; rewrite copy
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.'
2026-05-16 12:07:52 -05:00

33 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/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);
}