651989c423
Simplified dependency installation by moving from TypeScript runtime bootstrap to bash-based checks in plugin manifest. This reduces complexity and code size while maintaining the same functionality.
Changes:
- Added bash conditional dependency checks to all 5 hooks in hooks.json
- Check runs before each hook: [ ! -d "${CLAUDE_PLUGIN_ROOT}/scripts/node_modules" ] && cd "${CLAUDE_PLUGIN_ROOT}/scripts" && npm install || true
- Reverted all hook TypeScript files to use simple static imports (removed dynamic imports)
- Removed src/shared/bootstrap.ts (44 lines)
- Removed ensureDependencies() calls from all hook entry points
Benefits:
- Simpler architecture using native bash instead of TypeScript
- Net reduction of 157 lines of code
- No runtime overhead when dependencies already installed
- Uses plugin manifest's command hook feature as intended
- Faster and more efficient
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
18 lines
406 B
TypeScript
18 lines
406 B
TypeScript
|
|
/**
|
|
* Summary Hook Entry Point - Stop
|
|
* Standalone executable for plugin hooks
|
|
*/
|
|
|
|
import { summaryHook } from '../../hooks/summary.js';
|
|
import { stdin } from 'process';
|
|
|
|
// Read input from stdin
|
|
let input = '';
|
|
stdin.on('data', (chunk) => input += chunk);
|
|
stdin.on('end', async () => {
|
|
const parsed = input.trim() ? JSON.parse(input) : undefined;
|
|
await summaryHook(parsed);
|
|
process.exit(0);
|
|
});
|