mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-03-30 13:43:26 +08:00
fix: remove duplicate hooks declaration from plugin.json
Fixes #103, #106, #108 Claude Code automatically loads hooks/hooks.json by convention. Explicitly declaring it in plugin.json causes a duplicate detection error: "Duplicate hooks file detected" Added regression test to prevent this from being reintroduced.
This commit is contained in:
@@ -325,6 +325,22 @@ async function runTests() {
|
||||
}
|
||||
})) passed++; else failed++;
|
||||
|
||||
// plugin.json validation
|
||||
console.log('\nplugin.json Validation:');
|
||||
|
||||
if (test('plugin.json does NOT have explicit hooks declaration', () => {
|
||||
// Claude Code automatically loads hooks/hooks.json by convention.
|
||||
// Explicitly declaring it in plugin.json causes a duplicate detection error.
|
||||
// See: https://github.com/affaan-m/everything-claude-code/issues/103
|
||||
const pluginPath = path.join(__dirname, '..', '..', '.claude-plugin', 'plugin.json');
|
||||
const plugin = JSON.parse(fs.readFileSync(pluginPath, 'utf8'));
|
||||
|
||||
assert.ok(
|
||||
!plugin.hooks,
|
||||
'plugin.json should NOT have "hooks" field - Claude Code auto-loads hooks/hooks.json'
|
||||
);
|
||||
})) passed++; else failed++;
|
||||
|
||||
// Summary
|
||||
console.log('\n=== Test Results ===');
|
||||
console.log(`Passed: ${passed}`);
|
||||
|
||||
Reference in New Issue
Block a user