seo-generator-server/tests/trend-demo.js
StillHammer f51c4095f6 Add modular pipeline demo system with real module integration
- Add complete modular demo interface (public/modular-pipeline-demo.html)
- Add standalone demo server (simple-server.js) on port 3333
- Integrate real SelectiveCore, AdversarialCore, HumanSimulation, PatternBreaking modules
- Add configurable pipeline with step-by-step content transformation display
- Add new trend management and workflow configuration modules
- Add comprehensive test suite for full pipeline validation
- Update core modules for better modular integration and demo compatibility

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 16:03:20 +08:00

111 lines
3.9 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// ========================================
// DEMO SYSTÈME TENDANCES
// Démo directe du système de tendances configurables
// ========================================
const { TrendManager } = require('../lib/trend-prompts/TrendManager');
async function demoTrends() {
console.log('🎯 === DEMO SYSTÈME DE TENDANCES ===\n');
// Initialiser TrendManager
const trendManager = new TrendManager();
// 1. LISTER TENDANCES DISPONIBLES
console.log('📋 Tendances disponibles:');
const trends = trendManager.getAvailableTrends();
trends.forEach(trend => {
console.log(`${trend.id} (${trend.category})`);
console.log(` ${trend.description}\n`);
});
// 2. SÉLECTIONNER UNE TENDANCE
console.log('🎯 Test tendance "eco-responsable":');
await trendManager.setTrend('eco-responsable');
const currentTrend = trendManager.getCurrentTrend();
console.log(` ✅ Tendance active: ${currentTrend.name}`);
console.log(` 📝 Description: ${currentTrend.description}`);
// 3. CONFIGURATION COUCHE TECHNIQUE
console.log('\n⚙ Configuration couche technique avec tendance:');
const techConfig = trendManager.getLayerConfig('technical', { intensity: 0.9 });
console.log(' • Target Terms:', techConfig.targetTerms);
console.log(' • Focus Areas:', techConfig.focusAreas);
console.log(' • Intensité:', techConfig.intensity);
// 4. CONFIGURATION COUCHE STYLE
console.log('\n🎨 Configuration couche style avec tendance:');
const styleConfig = trendManager.getLayerConfig('style');
console.log(' • Target Style:', styleConfig.targetStyle);
console.log(' • Tone:', styleConfig.tone);
console.log(' • Values:', styleConfig.values);
// 5. TEST AUTRE TENDANCE
console.log('\n🚀 Test tendance "tech-innovation":');
await trendManager.setTrend('tech-innovation');
const techInnovConfig = trendManager.getLayerConfig('technical');
console.log(' • Target Terms:', techInnovConfig.targetTerms);
console.log(' • Style:', techInnovConfig.targetStyle);
// 6. TENDANCE SAISONNIÈRE
console.log('\n🍂 Test tendance "automne-cocooning":');
await trendManager.setTrend('automne-cocooning');
const cocoConfig = trendManager.getLayerConfig('style');
console.log(' • Target Terms:', cocoConfig.targetTerms);
console.log(' • Tone:', cocoConfig.tone);
// 7. STATUS FINAL
console.log('\n📊 Status final:');
const status = trendManager.getStatus();
console.log(` • Tendance active: ${status.activeTrend.name}`);
console.log(` • Tendances disponibles: ${status.availableTrends}`);
console.log(` • Tendances custom: ${status.customTrends}`);
console.log('\n✅ === DEMO TERMINÉE ===');
}
// CRÉER TENDANCE PERSONNALISÉE
async function demoCustomTrend() {
console.log('\n✨ === DEMO TENDANCE PERSONNALISÉE ===\n');
const trendManager = new TrendManager();
// Créer tendance "luxe-parisien"
const luxeTrend = {
name: 'Luxe Parisien',
description: 'Élégance et raffinement à la française',
config: {
technical: {
targetTerms: ['élégant', 'raffiné', 'prestigieux', 'exclusif', 'haut de gamme'],
focusAreas: ['design français', 'savoir-faire', 'exclusivité']
},
style: {
targetStyle: 'élégant et sophistiqué',
tone: 'raffiné et prestigieux',
values: ['élégance', 'tradition', 'excellence']
}
}
};
trendManager.createCustomTrend('luxe-parisien', luxeTrend);
await trendManager.setTrend('luxe-parisien');
console.log('🏛️ Tendance "Luxe Parisien" créée et appliquée:');
const config = trendManager.getLayerConfig('style');
console.log(' • Target Terms:', config.targetTerms);
console.log(' • Target Style:', config.targetStyle);
console.log(' • Values:', config.values);
console.log('\n✅ === TENDANCE PERSONNALISÉE OK ===');
}
// EXÉCUTER DEMO
if (require.main === module) {
demoTrends()
.then(() => demoCustomTrend())
.catch(console.error);
}