UNPKG

mcpresso

Version:

TypeScript package for Model Context Protocol (MCP) utilities and tools

27 lines (26 loc) โ€ข 1.15 kB
import { Command } from 'commander'; import chalk from 'chalk'; import { execSync } from 'child_process'; export const build = new Command('build') .description('Build the project for production') .option('--clean', 'Clean build directory before building') .action(async (options) => { try { console.log(chalk.blue.bold('๐Ÿ”จ Building mcpresso project...\n')); if (options.clean) { console.log(chalk.gray('๐Ÿงน Cleaning build directory...')); execSync('rm -rf dist', { stdio: 'inherit' }); } console.log(chalk.gray('๐Ÿ“ฆ Building with Bun...')); execSync('bun build src/server.ts --outdir dist --target node', { stdio: 'inherit' }); console.log(chalk.gray('โœ… Type checking...')); execSync('tsc --noEmit', { stdio: 'inherit' }); console.log(chalk.green.bold('\nโœ… Build completed successfully!')); console.log(chalk.gray('๐Ÿ“ Output: dist/')); console.log(chalk.gray('๐Ÿš€ Ready for deployment!')); } catch (error) { console.error(chalk.red('โŒ Build failed:'), error); process.exit(1); } });