vibetunnel/web/scripts/build.js
Mario Zechner d4b8748b22 Reorganize server structure for clarity
- Rename index.ts to cli.ts as single entry point
- Merge app.ts and shutdown-state.ts into server.ts
- Update all imports and references to use new structure
- Update e2e tests and dev script to spawn via cli.ts
- Remove execution code from server.ts (only cli.ts executes)
- Clean up tsconfig.client.json exclude path

This creates a cleaner separation where cli.ts is the only entry
point that decides whether to run server or forward mode.

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-06-21 16:44:56 +02:00

34 lines
No EOL
1.2 KiB
JavaScript

const { execSync } = require('child_process');
const fs = require('fs');
const path = require('path');
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...');
execSync('esbuild src/client/app-entry.ts --bundle --outfile=public/bundle/client-bundle.js --format=esm --minify', { stdio: 'inherit' });
execSync('esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/bundle/terminal.js --format=esm --minify', { stdio: 'inherit' });
// Build server TypeScript
console.log('Building server...');
execSync('tsc', { stdio: 'inherit' });
// Build native executable if requested
if (process.argv.includes('--native')) {
console.log('Building native executable...');
execSync('node build-native.js', { stdio: 'inherit' });
}
console.log('Build completed successfully!');