// Hook eseguito una sola volta all'avvio del server Next. // L'unico compito attuale è il bootstrap del factory preset quando data/ è vuoto. export async function register() { // Esegui solo nel runtime Node (l'instrumentation può girare anche su Edge, // dove fs/spawn non esistono). if (process.env.NEXT_RUNTIME !== 'nodejs') return; const { bootstrapFromFactoryPresetIfEmpty } = await import('@/lib/bootstrap'); try { await bootstrapFromFactoryPresetIfEmpty(); } catch (err) { console.warn('[instrumentation] Bootstrap error:', err); } }