Files
Podcast-Generator/web/test-build.js
hex2077 719eb14927 feat: 添加播客生成器Web应用基础架构
实现基于Next.js的播客生成器Web应用,包含以下主要功能:
- 完整的Next.js项目结构配置
- 播客生成API接口
- 音频文件服务API
- TTS配置管理
- 响应式UI组件
- 本地存储和状态管理
- 音频可视化组件
- 全局样式和主题配置

新增配置文件包括:
- Next.js、Tailwind CSS、ESLint等工具配置
- 环境变量示例文件
- 启动脚本和构建检查脚本
- 类型定义和工具函数库
2025-08-14 23:44:18 +08:00

60 lines
1.7 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env node
const { spawn } = require('child_process');
const path = require('path');
console.log('🔍 检查Next.js应用构建状态...\n');
// 检查TypeScript类型
console.log('1. 检查TypeScript类型...');
const typeCheck = spawn('npm', ['run', 'type-check'], {
stdio: 'inherit',
shell: true,
cwd: __dirname
});
typeCheck.on('close', (code) => {
if (code === 0) {
console.log('✅ TypeScript类型检查通过\n');
// 检查ESLint
console.log('2. 检查代码规范...');
const lint = spawn('npm', ['run', 'lint'], {
stdio: 'inherit',
shell: true,
cwd: __dirname
});
lint.on('close', (lintCode) => {
if (lintCode === 0) {
console.log('✅ 代码规范检查通过\n');
// 尝试构建
console.log('3. 尝试构建应用...');
const build = spawn('npm', ['run', 'build'], {
stdio: 'inherit',
shell: true,
cwd: __dirname
});
build.on('close', (buildCode) => {
if (buildCode === 0) {
console.log('\n🎉 应用构建成功!');
console.log('\n📋 下一步:');
console.log('1. 配置环境变量:编辑 .env.local');
console.log('2. 启动开发服务器npm run dev');
console.log('3. 访问应用http://localhost:3000');
} else {
console.log('\n❌ 构建失败,请检查错误信息');
process.exit(1);
}
});
} else {
console.log('\n⚠ 代码规范检查有警告,但可以继续');
}
});
} else {
console.log('\n❌ TypeScript类型检查失败');
process.exit(1);
}
});