主要更新: - 更新所有12个产业的教务系统数据和功能 - 删除所有 node_modules 文件夹(节省3.7GB) - 删除所有 .yoyo 缓存文件夹(节省1.2GB) - 删除所有 dist 构建文件(节省55MB) 项目优化: - 项目大小从 8.1GB 减少到 3.2GB(节省60%空间) - 保留完整的源代码和配置文件 - .gitignore 已配置,防止再次提交大文件 启动脚本: - start-industry.sh/bat/ps1 脚本会自动检测并安装依赖 - 首次启动时自动运行 npm install - 支持单个或批量启动产业系统 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
39 lines
1.3 KiB
JavaScript
39 lines
1.3 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// 读取mockData.js
|
|
const mockDataPath = path.join(__dirname, 'src/data/mockData.js');
|
|
const content = fs.readFileSync(mockDataPath, 'utf-8');
|
|
|
|
// 提取垂直能力课部分
|
|
const verticalMatch = content.match(/name:\s*"垂直能力课"[\s\S]*?units:\s*\[([\s\S]*?)\]\s*,\s*\/\/ 保留原始list/);
|
|
|
|
if (verticalMatch) {
|
|
const unitsContent = verticalMatch[1];
|
|
|
|
// 提取所有unit名称
|
|
const unitNames = [...unitsContent.matchAll(/name:\s*"([^"]+)",\s*courses:/g)].map(m => m[1]);
|
|
|
|
console.log('垂直能力课的units数量:', unitNames.length);
|
|
console.log('\nunits列表:');
|
|
unitNames.forEach((name, index) => {
|
|
console.log(` ${index + 1}. ${name}`);
|
|
});
|
|
|
|
// 统计每个unit的课程数
|
|
console.log('\n每个unit的课程数:');
|
|
const unitBlocks = unitsContent.split(/\},\s*\{/).filter(Boolean);
|
|
|
|
unitNames.forEach((name, index) => {
|
|
const unitPattern = new RegExp(`name:\\s*"${name.replace(/[()]/g, '\\$&')}"[\\s\\S]*?courses:\\s*\\[([\\s\\S]*?)\\]`, 'g');
|
|
const match = unitPattern.exec(unitsContent);
|
|
if (match) {
|
|
const coursesContent = match[1];
|
|
const courseCount = (coursesContent.match(/\{[^}]*id:\s*\d+/g) || []).length;
|
|
console.log(` ${name}: ${courseCount}个课程`);
|
|
}
|
|
});
|
|
} else {
|
|
console.log('未找到垂直能力课的units结构');
|
|
}
|