UNPKG

windflow-css

Version:

A modern CSS framework inspired by Tailwind with enhanced features

165 lines (136 loc) • 4.77 kB
#!/usr/bin/env node /** * WindFlow Examples Verification Script * Verifies that all CSS classes used in examples are available in the generated CSS */ const fs = require('fs'); const path = require('path'); // Read the generated CSS const cssPath = path.join(__dirname, '..', 'dist', 'windflow.css'); const css = fs.readFileSync(cssPath, 'utf8'); // Example files to check const exampleFiles = [ 'examples/advanced-components.html', 'examples/real-world-examples.html', 'examples/playground.html' ]; // Critical CSS classes that should be present const criticalClasses = [ // Animations 'animate-pulse', 'animate-bounce', 'animate-glow', 'animate-neon', 'animate-typewriter', 'animate-glitch', 'animate-float', 'animate-levitate', 'animate-rubber-band', 'animate-tada', // Hover effects 'hover:animate-bounce', 'hover:animate-shake', 'hover:animate-glitch', 'btn-hover-lift', 'btn-hover-glow', 'btn-hover-scale', 'card-hover-float', 'card-hover-tilt', // Loading components 'loading-dots', 'loading-bars', 'loading-spinner', 'loading-pulse-ring', // Theme system 'theme-dark', 'theme-cyberpunk', 'theme-glassmorphism', 'theme-retro', 'text-theme-primary', 'bg-theme-surface', 'border-theme-border', // Theme-specific components 'neon-text', 'neon-border', 'cyber-grid', 'glass-card', 'glass-nav', 'retro-text', 'scanlines', // Text effects 'text-typewriter', 'text-glitch', // 3D transforms 'perspective-lg', 'transform-3d', 'backface-hidden', 'rotate-y-180', // Advanced gradients 'bg-gradient-conic', 'bg-gradient-radial', 'bg-aurora', 'bg-mesh-gradient', // Modern CSS 'backdrop-blur-lg', 'clip-star', 'aspect-video', // Responsive and dark mode 'dark:bg-gray-900', 'md:grid-cols-2', 'lg:grid-cols-3' ]; console.log('šŸ” WindFlow Examples Verification\n'); let allPassed = true; let totalChecks = 0; let passedChecks = 0; // Check critical classes console.log('šŸ“‹ Checking Critical CSS Classes...'); criticalClasses.forEach(className => { totalChecks++; let searchClass = className; // Handle escaped characters in CSS for hover and responsive classes if (className.includes(':')) { searchClass = className.replace(':', '\\:'); } if (css.includes(`.${searchClass}`)) { console.log(` āœ… ${className}`); passedChecks++; } else { console.log(` āŒ ${className} - MISSING`); allPassed = false; } }); // Check example files exist and are readable console.log('\nšŸ“„ Checking Example Files...'); exampleFiles.forEach(filePath => { totalChecks++; const fullPath = path.join(__dirname, '..', filePath); if (fs.existsSync(fullPath)) { const content = fs.readFileSync(fullPath, 'utf8'); if (content.includes('windflow.css')) { console.log(` āœ… ${filePath} - Links to WindFlow CSS`); passedChecks++; } else { console.log(` āŒ ${filePath} - Missing WindFlow CSS link`); allPassed = false; } } else { console.log(` āŒ ${filePath} - File not found`); allPassed = false; } }); // Check keyframes console.log('\nšŸŽ¬ Checking Animation Keyframes...'); const keyframes = [ 'wf-spin', 'wf-pulse', 'wf-bounce', 'wf-glow', 'wf-neon', 'wf-typewriter', 'wf-glitch', 'wf-float', 'wf-rubber-band', 'wf-tada', 'wf-aurora' ]; keyframes.forEach(keyframe => { totalChecks++; if (css.includes(`@keyframes ${keyframe}`)) { console.log(` āœ… @keyframes ${keyframe}`); passedChecks++; } else { console.log(` āŒ @keyframes ${keyframe} - MISSING`); allPassed = false; } }); // Check theme variables console.log('\nšŸŽØ Checking Theme Variables...'); const themeVariables = [ '--wf-primary', '--wf-secondary', '--wf-background', '--wf-surface', '--wf-text', '--wf-border' ]; themeVariables.forEach(variable => { totalChecks++; if (css.includes(variable)) { console.log(` āœ… ${variable}`); passedChecks++; } else { console.log(` āŒ ${variable} - MISSING`); allPassed = false; } }); // File size check const cssSize = fs.statSync(cssPath).size; const cssKB = (cssSize / 1024).toFixed(2); console.log(`\nšŸ“Š CSS File Size: ${cssKB}KB`); if (cssSize < 100000) { // Less than 100KB console.log(' āš ļø CSS file seems too small, possible build issue'); allPassed = false; } // Final results console.log('\n' + '='.repeat(50)); console.log(`šŸ“ˆ Results: ${passedChecks}/${totalChecks} checks passed`); if (allPassed) { console.log('šŸŽ‰ All examples are working correctly!'); console.log('āœ… WindFlow CSS is ready for production use'); process.exit(0); } else { console.log('āŒ Some issues found. Please check the output above.'); console.log('šŸ”§ Run `npm run build` to regenerate CSS'); process.exit(1); }