@ztffn/presentation-generator-plugin 1.0.0 → 1.0.3

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.
@@ -20,7 +20,9 @@ jobs:
20
20
  node-version: "20"
21
21
  registry-url: "https://registry.npmjs.org"
22
22
 
23
- - run: npm publish --provenance --access public
23
+ - run: npm publish --access public
24
+ env:
25
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
24
26
 
25
27
  release-zip:
26
28
  name: Create GitHub Release with zip
package/README.md CHANGED
@@ -20,16 +20,14 @@ Requires Claude Code 1.0.33 or later.
20
20
  claude --plugin-dir /path/to/presentation-generator-plugin
21
21
  ```
22
22
 
23
- To always have it available in a project, add it to `.claude/settings.json`:
23
+ To always have it available in a project, register it with Claude Code:
24
24
 
25
- ```json
26
- {
27
- "plugins": [
28
- { "path": "/path/to/presentation-generator-plugin" }
29
- ]
30
- }
25
+ ```bash
26
+ claude plugin install /path/to/presentation-generator-plugin --scope project
31
27
  ```
32
28
 
29
+ This writes the correct entry to `.claude/settings.json`. Commit that file to share the plugin with your team.
30
+
33
31
  To update: download the new zip from Releases, replace the old folder.
34
32
 
35
33
  ### Option B — install via npx (requires Node.js 18+ and GitHub auth)
package/bin/index.js CHANGED
@@ -51,71 +51,23 @@ function getLatestRemoteVersion() {
51
51
  return result ? result.replace(/^v/, "") : null;
52
52
  }
53
53
 
54
- function printSettingsHelp() {
55
- const settingsPath = path.join(process.cwd(), ".claude", "settings.json");
56
- const settingsExists = fs.existsSync(settingsPath);
54
+ function registerPlugin() {
55
+ console.log("\nRegistering plugin with Claude Code...");
57
56
 
58
- console.log("\nAdd the plugin to your project:");
59
- console.log(
60
- ` File: ${path.join(process.cwd(), ".claude", "settings.json")}`
57
+ const result = spawnSync(
58
+ "claude",
59
+ ["plugin", "install", INSTALL_DIR, "--scope", "project"],
60
+ { encoding: "utf8", stdio: "inherit" }
61
61
  );
62
62
 
63
- if (settingsExists) {
64
- let settings;
65
- try {
66
- settings = JSON.parse(fs.readFileSync(settingsPath, "utf8"));
67
- } catch {
68
- settings = {};
69
- }
70
- const plugins = settings.plugins || [];
71
- const alreadyAdded = plugins.some((p) => p.path === INSTALL_DIR);
72
- if (alreadyAdded) {
73
- console.log(" Already configured in settings.json ✓");
74
- return;
75
- }
76
- }
77
-
78
- console.log(
79
- ` Add: { "plugins": [{ "path": "${INSTALL_DIR}" }] }\n`
80
- );
81
-
82
- // Offer to auto-configure
83
- try {
84
- const readline = require("readline").createInterface({
85
- input: process.stdin,
86
- output: process.stdout,
87
- });
88
- readline.question(
89
- "Auto-add to .claude/settings.json? [Y/n] ",
90
- (answer) => {
91
- readline.close();
92
- if (answer.toLowerCase() !== "n") {
93
- addToSettings(settingsPath);
94
- }
95
- }
96
- );
97
- } catch {
98
- // non-interactive context
99
- }
100
- }
101
-
102
- function addToSettings(settingsPath) {
103
- const dir = path.dirname(settingsPath);
104
- if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
105
-
106
- let settings = {};
107
- if (fs.existsSync(settingsPath)) {
108
- try {
109
- settings = JSON.parse(fs.readFileSync(settingsPath, "utf8"));
110
- } catch {}
111
- }
112
-
113
- settings.plugins = settings.plugins || [];
114
- const alreadyAdded = settings.plugins.some((p) => p.path === INSTALL_DIR);
115
- if (!alreadyAdded) {
116
- settings.plugins.push({ path: INSTALL_DIR });
117
- fs.writeFileSync(settingsPath, JSON.stringify(settings, null, 2) + "\n");
118
- console.log(" settings.json updated ✓");
63
+ if (result.status === 0) {
64
+ console.log("Plugin registered in .claude/settings.json ✓");
65
+ console.log("Commit that file to share the plugin with your team.");
66
+ } else {
67
+ console.log("\nCould not auto-register. Add manually:");
68
+ console.log(` claude plugin install "${INSTALL_DIR}" --scope project`);
69
+ console.log(` Or load for a single session:`);
70
+ console.log(` claude --plugin-dir "${INSTALL_DIR}"`);
119
71
  }
120
72
  }
121
73
 
@@ -130,11 +82,11 @@ function install() {
130
82
 
131
83
  if (latest && installed && installed !== latest) {
132
84
  console.log(`\nPlugin already installed (v${installed}).`);
133
- console.log(`v${latest} is available — run: npx @huma/presentation-generator-plugin update\n`);
85
+ console.log(`v${latest} is available — run: npx @ztffn/presentation-generator-plugin update\n`);
134
86
  } else {
135
87
  console.log(`\nPlugin already installed (v${installed || "unknown"}). Nothing to do.\n`);
136
88
  }
137
- printSettingsHelp();
89
+ registerPlugin();
138
90
  return;
139
91
  }
140
92
 
@@ -142,7 +94,7 @@ function install() {
142
94
  fs.mkdirSync(path.dirname(INSTALL_DIR), { recursive: true });
143
95
  run(`git clone ${REPO_URL} "${INSTALL_DIR}"`);
144
96
  console.log(`\nInstalled to: ${INSTALL_DIR}`);
145
- printSettingsHelp();
97
+ registerPlugin();
146
98
  }
147
99
 
148
100
  function update() {
@@ -160,10 +112,12 @@ function update() {
160
112
 
161
113
  const after = getInstalledVersion();
162
114
  if (before !== after) {
163
- console.log(`\nUpdated v${before} → v${after} ✓\n`);
115
+ console.log(`\nUpdated v${before} → v${after} ✓`);
164
116
  } else {
165
- console.log(`\nAlready up to date (v${after}) ✓\n`);
117
+ console.log(`\nAlready up to date (v${after}) ✓`);
166
118
  }
119
+
120
+ registerPlugin();
167
121
  }
168
122
 
169
123
  function checkUpdate() {
@@ -195,7 +149,7 @@ function uninstall() {
195
149
  }
196
150
  fs.rmSync(INSTALL_DIR, { recursive: true, force: true });
197
151
  console.log(`\nRemoved: ${INSTALL_DIR}`);
198
- console.log("You may also want to remove the plugin entry from .claude/settings.json\n");
152
+ console.log("You may also want to run: claude plugin uninstall presentation-generator\n");
199
153
  }
200
154
 
201
155
  function help() {
@@ -203,7 +157,7 @@ function help() {
203
157
  presentation-generator-plugin v${CURRENT_VERSION}
204
158
 
205
159
  Commands:
206
- install Clone plugin to ~/.claude/plugins/ and configure project
160
+ install Clone plugin to ~/.claude/plugins/ and register with Claude Code
207
161
  update Pull latest changes from GitHub
208
162
  check-update Report whether an update is available
209
163
  uninstall Remove plugin from ~/.claude/plugins/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ztffn/presentation-generator-plugin",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "Claude Code plugin for generating graph-based presentations",
5
5
  "bin": {
6
6
  "presentation-generator-plugin": "bin/index.js"