chore: 安全升级并完善 CI/测试
- 升级 js-yaml 修复生产依赖漏洞 - 新增 CI:lint/test/build - 增加书签处理单测与可测性导出"- 生成器补充 config/user 缺失提示 - 增加 lint/format/check 脚本与 Prettier 配置 - 统一行尾策略并支持书签确定性输出"
This commit is contained in:
@@ -519,6 +519,19 @@ function loadConfig() {
|
||||
|
||||
// 根据优先级顺序选择最高优先级的配置
|
||||
if (hasUserModularConfig) {
|
||||
// 配置采用“完全替换”策略:一旦存在 config/user/,将不会回退到 config/_default/
|
||||
if (!fs.existsSync('config/user/site.yml')) {
|
||||
console.error('[ERROR] 检测到 config/user/ 目录,但缺少 config/user/site.yml。');
|
||||
console.error('[ERROR] 由于配置采用“完全替换”策略,系统不会从 config/_default/ 补齐缺失配置。');
|
||||
console.error('[ERROR] 解决方法:先完整复制 config/_default/ 到 config/user/,再按需修改。');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!fs.existsSync('config/user/pages')) {
|
||||
console.warn('[WARN] 检测到 config/user/ 目录,但缺少 config/user/pages/。部分页面内容可能为空。');
|
||||
console.warn('[WARN] 建议:复制 config/_default/pages/ 到 config/user/pages/,再按需修改。');
|
||||
}
|
||||
|
||||
// 1. 最高优先级: config/user/ 目录
|
||||
config = loadModularConfig('config/user');
|
||||
} else if (hasDefaultModularConfig) {
|
||||
|
||||
Reference in New Issue
Block a user