Files
AzerothCore-RealmMaster/scripts/hooks/REFACTORING_SUMMARY.md
uprightbass360 64d0478320 feat: refactor post-install hooks to manifest-driven system
- Replace hardcoded hooks with external scripts in scripts/hooks/
- Add 4 generic hook scripts (copy-standard-lua, copy-aio-lua, mod-ale-patches, black-market-setup)
- Update all 28 module hook definitions in config/modules.json
- Remove legacy hook functions from manage-modules.sh
- Add 26 new Eluna Lua modules to .env.template (disabled by default)
- Add 3 new AIO modules to .env.template (disabled by default)
- Implement proper environment variable interface for hooks
- Add comprehensive documentation and refactoring summary

🤖 Generated with [Claude Code](https://claude.ai/code)
2025-11-01 18:53:34 -04:00

1.8 KiB

Post-Install Hooks Refactoring Summary

What Was Accomplished

1. Legacy System Issues

  • Hardcoded hooks in manage-modules.sh (only 2 implemented)
  • 26 undefined hooks from Eluna modules causing warnings
  • No extensibility or maintainability

2. New Architecture Implemented

External Hook Scripts (scripts/hooks/)

  • copy-standard-lua - Generic Lua script copying for Eluna modules
  • copy-aio-lua - AIO-specific Lua script handling
  • mod-ale-patches - mod-ale compatibility patches
  • black-market-setup - Black Market specific setup
  • README.md - Complete documentation

Manifest-Driven Configuration

  • All hooks now defined in config/modules.json
  • Standardized hook names (kebab-case)
  • No more undefined hooks

Refactored Hook Runner (manage-modules.sh)

  • External script execution with environment variables
  • Proper error handling (exit codes 0/1/2)
  • Environment cleanup
  • Removed legacy fallback code

3. Hook Mapping Applied

  • 24 Eluna modulescopy-standard-lua
  • 2 AIO modulescopy-aio-lua
  • 1 mod-ale modulemod-ale-patches
  • 1 Black Market moduleblack-market-setup

4. Benefits Achieved

  • Maintainable - Hooks are separate, reusable scripts
  • Extensible - Easy to add new hooks without code changes
  • Reliable - No more undefined hook warnings
  • Documented - Clear interface and usage patterns
  • Clean - Removed legacy code and hardcoded cases

Files Modified

  • scripts/hooks/ (new directory with 5 files)
  • scripts/manage-modules.sh (refactored hook runner)
  • config/modules.json (updated all 28 hook definitions)

Testing Ready

The system is ready for testing with the modules container to ensure all Lua scripts are properly copied to /azerothcore/lua_scripts during module installation.