@ztffn/presentation-generator-plugin 1.0.9 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/index.js +12 -9
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -160,7 +160,7 @@ async function resolveInstallTarget() {
160
160
  };
161
161
  }
162
162
 
163
- function writeSettings(settingsPath, installDir) {
163
+ function writeSettings(settingsPath) {
164
164
  let settings = {};
165
165
  if (fs.existsSync(settingsPath)) {
166
166
  try {
@@ -170,11 +170,13 @@ function writeSettings(settingsPath, installDir) {
170
170
  }
171
171
  }
172
172
 
173
- if (!settings.enabledPlugins || typeof settings.enabledPlugins !== "object" || Array.isArray(settings.enabledPlugins)) {
174
- settings.enabledPlugins = {};
173
+ if (!Array.isArray(settings.enabledPlugins)) {
174
+ settings.enabledPlugins = [];
175
175
  }
176
176
 
177
- settings.enabledPlugins[PLUGIN_NAME] = installDir;
177
+ if (!settings.enabledPlugins.includes(PLUGIN_NAME)) {
178
+ settings.enabledPlugins.push(PLUGIN_NAME);
179
+ }
178
180
 
179
181
  fs.mkdirSync(path.dirname(settingsPath), { recursive: true });
180
182
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
@@ -184,9 +186,10 @@ function removeFromSettings(settingsPath) {
184
186
  if (!fs.existsSync(settingsPath)) return;
185
187
  try {
186
188
  const settings = JSON.parse(fs.readFileSync(settingsPath, "utf8"));
187
- if (!settings.enabledPlugins || typeof settings.enabledPlugins !== "object") return;
188
- if (PLUGIN_NAME in settings.enabledPlugins) {
189
- delete settings.enabledPlugins[PLUGIN_NAME];
189
+ if (!Array.isArray(settings.enabledPlugins)) return;
190
+ const filtered = settings.enabledPlugins.filter((p) => p !== PLUGIN_NAME);
191
+ if (filtered.length !== settings.enabledPlugins.length) {
192
+ settings.enabledPlugins = filtered;
190
193
  fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
191
194
  console.log(`Removed entry from ${settingsPath}`);
192
195
  }
@@ -237,7 +240,7 @@ async function install() {
237
240
  console.log(`\nInstalled v${meta.version} to: ${label}`);
238
241
 
239
242
  console.log("\nRegistering plugin with Claude Code...");
240
- writeSettings(settingsPath, installDir);
243
+ writeSettings(settingsPath);
241
244
 
242
245
  const settingsLabel = scope === "project" ? ".claude/settings.json" : "~/.claude/settings.json";
243
246
  console.log(`Plugin registered in ${settingsLabel} ✓`);
@@ -273,7 +276,7 @@ async function update() {
273
276
 
274
277
  console.log(`\n${label}: updating v${before || "unknown"} → v${meta.version}...`);
275
278
  await downloadAndExtract(meta.version, meta.tarball, installDir);
276
- writeSettings(settingsPath, installDir);
279
+ writeSettings(settingsPath);
277
280
  console.log(`${label}: updated to v${meta.version} ✓`);
278
281
  }
279
282
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztffn/presentation-generator-plugin",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "Claude Code plugin for generating graph-based presentations",
5
5
  "bin": {
6
6
  "presentation-generator-plugin": "bin/index.js"