()
| 43 | } |
| 44 | |
| 45 | function measureBuildTime() { |
| 46 | logSection('Measuring Build Time'); |
| 47 | |
| 48 | log('Building Storybook...', colors.yellow); |
| 49 | const startTime = Date.now(); |
| 50 | |
| 51 | try { |
| 52 | // Clean previous build |
| 53 | if (fs.existsSync('storybook-static')) { |
| 54 | execSync('rm -rf storybook-static', { stdio: 'ignore' }); |
| 55 | } |
| 56 | |
| 57 | // Build Storybook |
| 58 | execSync('npm run build-storybook', { |
| 59 | stdio: 'pipe', |
| 60 | encoding: 'utf-8' |
| 61 | }); |
| 62 | |
| 63 | const buildTime = Date.now() - startTime; |
| 64 | log(`✓ Build completed in ${formatTime(buildTime)}`, colors.green); |
| 65 | |
| 66 | return buildTime; |
| 67 | } catch (error) { |
| 68 | log('✗ Build failed', colors.red); |
| 69 | console.error(error.message); |
| 70 | return null; |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | function analyzeBuildOutput() { |
| 75 | logSection('Analyzing Build Output'); |
no test coverage detected