/**
 * Dev helper: print which modules are active given the current
 * `modules.config.ts`. Useful for sanity-checking before a build.
 *
 * Run: `npm run modules:list`
 */

import { getAllManifests, isModuleEnabled, getModuleWarnings } from '@/core/modules';

console.log('\nMailforge Plugin — active module configuration:\n');

const all = getAllManifests();
const colW = Math.max(...all.map((m) => m.id.length)) + 2;

for (const m of all) {
  const status = isModuleEnabled(m.id) ? '✓ enabled' : '✗ disabled';
  console.log(`  ${m.id.padEnd(colW)} ${status}   — ${m.label}`);
}

const warnings = getModuleWarnings();
if (warnings.length > 0) {
  console.log('\nWarnings:');
  for (const w of warnings) console.log(`  ⚠ ${w}`);
}

console.log('');
