@leeovery/claude-manager 2.0.3 → 2.0.5

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.
package/README.md CHANGED
@@ -57,6 +57,16 @@ The manager will:
57
57
 
58
58
  That's it. Future `npm install` and `npm update` runs will automatically sync all plugins.
59
59
 
60
+ ### pnpm
61
+
62
+ pnpm requires claude-manager as a direct dependency (it doesn't expose binaries from transitive dependencies):
63
+
64
+ ```bash
65
+ pnpm add @leeovery/claude-manager @your-org/claude-your-plugin
66
+ ```
67
+
68
+ pnpm also blocks postinstall scripts by default. After installing, run `pnpm approve-builds` to approve the packages, then `pnpm install` again.
69
+
60
70
  ## How It Works
61
71
 
62
72
  1. Plugin packages have `@leeovery/claude-manager` as a dependency
@@ -98,6 +108,8 @@ The manager provides a CLI tool for managing plugins:
98
108
  | `npx claude-plugins add <package>` | Manually add a plugin |
99
109
  | `npx claude-plugins remove <package>` | Remove a plugin and its assets |
100
110
 
111
+ For pnpm users, use `pnpm exec claude-plugins` instead of `npx claude-plugins`.
112
+
101
113
  ## Creating Plugins
102
114
 
103
115
  Want to create your own skill or command packages?
@@ -4,8 +4,10 @@ import {
4
4
  } from "./chunk-2SM5GQ6P.js";
5
5
 
6
6
  // src/postinstall.ts
7
- import { existsSync } from "fs";
8
- import { join, resolve } from "path";
7
+ import { existsSync, symlinkSync, mkdirSync } from "fs";
8
+ import { join, resolve, dirname } from "path";
9
+ import { fileURLToPath } from "url";
10
+ var __dirname = dirname(fileURLToPath(import.meta.url));
9
11
  function findProjectRoot() {
10
12
  const initCwd = process.env.INIT_CWD;
11
13
  if (initCwd && existsSync(join(initCwd, "package.json"))) {
@@ -32,6 +34,25 @@ function main() {
32
34
  console.log("[claude-manager] Added prepare hook to package.json");
33
35
  console.log("[claude-manager] Plugins will sync on npm install AND npm update");
34
36
  }
37
+ ensureBinSymlink(projectRoot);
38
+ }
39
+ function ensureBinSymlink(projectRoot) {
40
+ const binDir = join(projectRoot, "node_modules", ".bin");
41
+ const binPath = join(binDir, "claude-plugins");
42
+ if (existsSync(binPath)) {
43
+ return;
44
+ }
45
+ const cliPath = join(__dirname, "cli.js");
46
+ if (!existsSync(cliPath)) {
47
+ return;
48
+ }
49
+ try {
50
+ if (!existsSync(binDir)) {
51
+ mkdirSync(binDir, { recursive: true });
52
+ }
53
+ symlinkSync(cliPath, binPath);
54
+ } catch {
55
+ }
35
56
  }
36
57
  main();
37
58
  //# sourceMappingURL=postinstall.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/postinstall.ts"],"sourcesContent":["/**\n * Postinstall script for claude-manager\n *\n * This runs when claude-manager itself is installed as a dependency.\n * It injects a 'prepare' hook into the project's package.json\n * so that `claude-plugins install` runs on both npm install AND npm update.\n */\n\nimport { existsSync } from 'node:fs';\nimport { join, resolve } from 'node:path';\nimport { injectPrepareHook } from './lib/hooks.js';\n\nfunction findProjectRoot(): string | null {\n // When running as postinstall of claude-manager,\n // we're in node_modules/claude-manager\n // The project root is two levels up\n\n // Try environment variable first (set by npm)\n const initCwd = process.env.INIT_CWD;\n if (initCwd && existsSync(join(initCwd, 'package.json'))) {\n return initCwd;\n }\n\n // Walk up from current directory\n let dir = process.cwd();\n while (dir !== '/') {\n // Skip if we're inside node_modules\n if (!dir.includes('node_modules') && existsSync(join(dir, 'package.json'))) {\n return dir;\n }\n dir = resolve(dir, '..');\n }\n\n return null;\n}\n\nfunction main() {\n // Skip if running in CI or during package publish\n if (process.env.CI || process.env.npm_config_global) {\n return;\n }\n\n const projectRoot = findProjectRoot();\n\n if (!projectRoot) {\n // Can't find project root, skip silently\n return;\n }\n\n // Inject the prepare hook (runs on both npm install and npm update)\n if (injectPrepareHook(projectRoot)) {\n console.log('[claude-manager] Added prepare hook to package.json');\n console.log('[claude-manager] Plugins will sync on npm install AND npm update');\n }\n}\n\nmain();\n"],"mappings":";;;;;;AAQA,SAAS,kBAAkB;AAC3B,SAAS,MAAM,eAAe;AAG9B,SAAS,kBAAiC;AAMxC,QAAM,UAAU,QAAQ,IAAI;AAC5B,MAAI,WAAW,WAAW,KAAK,SAAS,cAAc,CAAC,GAAG;AACxD,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,QAAQ,IAAI;AACtB,SAAO,QAAQ,KAAK;AAElB,QAAI,CAAC,IAAI,SAAS,cAAc,KAAK,WAAW,KAAK,KAAK,cAAc,CAAC,GAAG;AAC1E,aAAO;AAAA,IACT;AACA,UAAM,QAAQ,KAAK,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;AAEA,SAAS,OAAO;AAEd,MAAI,QAAQ,IAAI,MAAM,QAAQ,IAAI,mBAAmB;AACnD;AAAA,EACF;AAEA,QAAM,cAAc,gBAAgB;AAEpC,MAAI,CAAC,aAAa;AAEhB;AAAA,EACF;AAGA,MAAI,kBAAkB,WAAW,GAAG;AAClC,YAAQ,IAAI,qDAAqD;AACjE,YAAQ,IAAI,kEAAkE;AAAA,EAChF;AACF;AAEA,KAAK;","names":[]}
1
+ {"version":3,"sources":["../src/postinstall.ts"],"sourcesContent":["/**\n * Postinstall script for claude-manager\n *\n * This runs when claude-manager itself is installed as a dependency.\n * It injects a 'prepare' hook into the project's package.json\n * so that `claude-plugins install` runs on both npm install AND npm update.\n */\n\nimport { existsSync, symlinkSync, mkdirSync, unlinkSync } from 'node:fs';\nimport { join, resolve, dirname } from 'node:path';\nimport { fileURLToPath } from 'node:url';\nimport { injectPrepareHook } from './lib/hooks.js';\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\n\nfunction findProjectRoot(): string | null {\n // When running as postinstall of claude-manager,\n // we're in node_modules/claude-manager\n // The project root is two levels up\n\n // Try environment variable first (set by npm)\n const initCwd = process.env.INIT_CWD;\n if (initCwd && existsSync(join(initCwd, 'package.json'))) {\n return initCwd;\n }\n\n // Walk up from current directory\n let dir = process.cwd();\n while (dir !== '/') {\n // Skip if we're inside node_modules\n if (!dir.includes('node_modules') && existsSync(join(dir, 'package.json'))) {\n return dir;\n }\n dir = resolve(dir, '..');\n }\n\n return null;\n}\n\nfunction main() {\n // Skip if running in CI or during package publish\n if (process.env.CI || process.env.npm_config_global) {\n return;\n }\n\n const projectRoot = findProjectRoot();\n\n if (!projectRoot) {\n // Can't find project root, skip silently\n return;\n }\n\n // Inject the prepare hook (runs on both npm install and npm update)\n if (injectPrepareHook(projectRoot)) {\n console.log('[claude-manager] Added prepare hook to package.json');\n console.log('[claude-manager] Plugins will sync on npm install AND npm update');\n }\n\n // Ensure bin symlink exists (needed for pnpm which doesn't link transitive dep bins)\n ensureBinSymlink(projectRoot);\n}\n\nfunction ensureBinSymlink(projectRoot: string): void {\n const binDir = join(projectRoot, 'node_modules', '.bin');\n const binPath = join(binDir, 'claude-plugins');\n\n // Skip if symlink already exists\n if (existsSync(binPath)) {\n return;\n }\n\n // Our CLI is in the same directory as this postinstall script (dist/)\n const cliPath = join(__dirname, 'cli.js');\n\n if (!existsSync(cliPath)) {\n return;\n }\n\n try {\n // Ensure .bin directory exists\n if (!existsSync(binDir)) {\n mkdirSync(binDir, { recursive: true });\n }\n\n // Create symlink\n symlinkSync(cliPath, binPath);\n } catch {\n // Silently fail - user can add as direct dependency if needed\n }\n}\n\nmain();\n"],"mappings":";;;;;;AAQA,SAAS,YAAY,aAAa,iBAA6B;AAC/D,SAAS,MAAM,SAAS,eAAe;AACvC,SAAS,qBAAqB;AAG9B,IAAM,YAAY,QAAQ,cAAc,YAAY,GAAG,CAAC;AAExD,SAAS,kBAAiC;AAMxC,QAAM,UAAU,QAAQ,IAAI;AAC5B,MAAI,WAAW,WAAW,KAAK,SAAS,cAAc,CAAC,GAAG;AACxD,WAAO;AAAA,EACT;AAGA,MAAI,MAAM,QAAQ,IAAI;AACtB,SAAO,QAAQ,KAAK;AAElB,QAAI,CAAC,IAAI,SAAS,cAAc,KAAK,WAAW,KAAK,KAAK,cAAc,CAAC,GAAG;AAC1E,aAAO;AAAA,IACT;AACA,UAAM,QAAQ,KAAK,IAAI;AAAA,EACzB;AAEA,SAAO;AACT;AAEA,SAAS,OAAO;AAEd,MAAI,QAAQ,IAAI,MAAM,QAAQ,IAAI,mBAAmB;AACnD;AAAA,EACF;AAEA,QAAM,cAAc,gBAAgB;AAEpC,MAAI,CAAC,aAAa;AAEhB;AAAA,EACF;AAGA,MAAI,kBAAkB,WAAW,GAAG;AAClC,YAAQ,IAAI,qDAAqD;AACjE,YAAQ,IAAI,kEAAkE;AAAA,EAChF;AAGA,mBAAiB,WAAW;AAC9B;AAEA,SAAS,iBAAiB,aAA2B;AACnD,QAAM,SAAS,KAAK,aAAa,gBAAgB,MAAM;AACvD,QAAM,UAAU,KAAK,QAAQ,gBAAgB;AAG7C,MAAI,WAAW,OAAO,GAAG;AACvB;AAAA,EACF;AAGA,QAAM,UAAU,KAAK,WAAW,QAAQ;AAExC,MAAI,CAAC,WAAW,OAAO,GAAG;AACxB;AAAA,EACF;AAEA,MAAI;AAEF,QAAI,CAAC,WAAW,MAAM,GAAG;AACvB,gBAAU,QAAQ,EAAE,WAAW,KAAK,CAAC;AAAA,IACvC;AAGA,gBAAY,SAAS,OAAO;AAAA,EAC9B,QAAQ;AAAA,EAER;AACF;AAEA,KAAK;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leeovery/claude-manager",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "packageManager": "pnpm@10.27.0",
5
5
  "description": "Plugin manager for Claude Code skills and commands",
6
6
  "type": "module",