vibetunnel/web/scripts/build.js
Mario Zechner f71b6d4bd7 feat: Create test infrastructure for component testing
- Rename terminal test bundle to generic test bundle (test.js)
- Create organized test structure in src/client/test/
- Move test HTML files to src/client/assets/test/
- Fix terminal-test component API usage and styling
- Fix Monaco editor worker loading issues by disabling workers
- Use AMD loader approach for Monaco initialization
- Apply Tailwind classes instead of inline CSS

The test infrastructure now supports isolated component testing with
individual HTML pages for each component. Monaco editor works with
syntax highlighting using the default vs-dark theme.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-23 04:25:56 +02:00

71 lines
No EOL
2 KiB
JavaScript

const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
const esbuild = require('esbuild');
const { prodOptions } = require('./esbuild-config.js');
async function build() {
console.log('Starting build process...');
// Ensure directories exist
console.log('Creating directories...');
execSync('node scripts/ensure-dirs.js', { stdio: 'inherit' });
// Copy assets
console.log('Copying assets...');
execSync('node scripts/copy-assets.js', { stdio: 'inherit' });
// Build CSS
console.log('Building CSS...');
execSync('npx tailwindcss -i ./src/client/styles.css -o ./public/bundle/styles.css --minify', { stdio: 'inherit' });
// Bundle client JavaScript
console.log('Bundling client JavaScript...');
try {
// Build main app bundle
await esbuild.build({
...prodOptions,
entryPoints: ['src/client/app-entry.ts'],
outfile: 'public/bundle/client-bundle.js',
});
// Build test bundle
await esbuild.build({
...prodOptions,
entryPoints: ['src/client/test-entry.ts'],
outfile: 'public/bundle/test.js',
});
console.log('Client bundles built successfully');
} catch (error) {
console.error('Build failed:', error);
process.exit(1);
}
// Build server TypeScript
console.log('Building server...');
execSync('tsc', { stdio: 'inherit' });
// Build native executable
console.log('Building native executable...');
// Check for --custom-node flag
const useCustomNode = process.argv.includes('--custom-node');
if (useCustomNode) {
console.log('Using custom Node.js for smaller binary size...');
execSync('node build-native.js --custom-node', { stdio: 'inherit' });
} else {
console.log('Using system Node.js...');
execSync('node build-native.js', { stdio: 'inherit' });
}
console.log('Build completed successfully!');
}
// Run the build
build().catch(error => {
console.error('Build failed:', error);
process.exit(1);
});