ef70b1d8e1
## 新增内容 ### 附录文档扩展 - 扩展前端项目架构文档 (frontend-project-architecture.md) - 扩展后端项目架构文档 (backend-project-architecture.md) - 扩展数据治理文档 (data-governance.md) - 扩展数据可视化文档 (data-visualization.md) - 扩展分布式系统文档 (distributed-systems.md) - 扩展高可用文档 (high-availability.md) - 扩展单体到微服务文档 (monolith-to-microservices.md) - 扩展系统设计方法论文档 (system-design-methodology.md) - 扩展 Docker 容器文档 (docker-containers.md) - 扩展 Kubernetes 文档 (kubernetes.md) - 扩展 Linux 基础文档 (linux-basics.md) - 扩展神经网络文档 (neural-networks.md) ### 新增交互式组件 - 数据治理组件: DataQualityDemo, DataGovernanceFrameworkDemo, DataLineageDemo - 数据可视化组件: ChartTypeSelectorDemo, DashboardLayoutDemo - 分布式系统组件: CAPTheoremDemo, ConsistencyModelsDemo, DistributedChallengesDemo - 高可用组件: AvailabilityCalculatorDemo, FailoverStrategyDemo - 系统设计组件: SystemDesignStepsDemo, CapacityEstimationDemo - Docker 容器组件: DockerArchitectureDemo, DockerLifecycleDemo - Kubernetes 组件: K8sArchitectureDemo, K8sWorkloadsDemo - Linux 基础组件: LinuxFileSystemDemo, LinuxCommandDemo, LinuxPermissionsDemo - 神经网络组件: NeuronDemo, NetworkLayersDemo, NetworkArchitectureDemo - 单体到微服务组件: ArchEvolutionDemo - 项目架构组件: ProjectArchitectureComparisonDemo - 附录导航组件: AppendixFlowMap ### 英文版重构 - 将 en-us 目录重命名为 en - 更新相关配置和组件中的语言代码 ## Bug 修复 - 修复 index.js 中重复的组件导入语句导致的 build 失败 - 恢复被注释的 InvertedIndexDemo 和 SearchRelevanceDemo 导入 - 修复 HomeFeatures.vue 中 en-us 与 config.mjs 中 en 不一致导致的语言切换问题 ## 其他改进 - 添加构建脚本 (scripts/build.mjs) - 更新依赖版本
53 lines
1.8 KiB
JavaScript
53 lines
1.8 KiB
JavaScript
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function walk(dir) {
|
|
let results = [];
|
|
const list = fs.readdirSync(dir);
|
|
list.forEach(function (file) {
|
|
file = dir + '/' + file;
|
|
const stat = fs.statSync(file);
|
|
if (stat && stat.isDirectory()) {
|
|
results = results.concat(walk(file));
|
|
} else {
|
|
if (file.endsWith('.vue')) results.push(file);
|
|
}
|
|
});
|
|
return results;
|
|
}
|
|
|
|
const vueFiles = walk('docs/.vitepress/theme/components');
|
|
|
|
vueFiles.forEach(file => {
|
|
const lines = fs.readFileSync(file, 'utf8').split('\n');
|
|
let bracketDepth = 0;
|
|
let insideScript = false;
|
|
|
|
lines.forEach((line, index) => {
|
|
if (line.includes('<script setup')) {
|
|
insideScript = true;
|
|
bracketDepth = 0;
|
|
return;
|
|
}
|
|
if (line.includes('</script>')) {
|
|
insideScript = false;
|
|
}
|
|
|
|
if (insideScript) {
|
|
// Check for setInterval BEFORE updating bracket depth for the current line
|
|
// because `setInterval(() => {` will increase depth but the call ITSELF is at depth 0
|
|
if (line.includes('setInterval') && bracketDepth === 0) {
|
|
console.log(`Top-level setInterval: ${file}:${index + 1} - ${line.trim()}`);
|
|
}
|
|
|
|
// Simple Bracket Depth Counting
|
|
// Handle one-liners like `if (x) { ... }` natively by adding/subtracting on the same line
|
|
// Wait, we only care about trailing brackets basically. Ignore string contents for simplicity.
|
|
// This heuristic is usually fine for formatting standard vue codes
|
|
const openCount = (line.match(/\{/g) || []).length;
|
|
const closeCount = (line.match(/\}/g) || []).length;
|
|
bracketDepth += openCount - closeCount;
|
|
}
|
|
});
|
|
});
|