diff --git a/.ua/backlog.json b/.ua/backlog.json index 895f6a9..4ab1bea 100644 --- a/.ua/backlog.json +++ b/.ua/backlog.json @@ -364,6 +364,30 @@ "acceptance": "pnpm-lock.yaml 提交入库;ARCHITECTURE.md 目录树补 scripts/(gitea.mjs/gitea-api.mjs 一句话说明)、COMMITTING.md、ITERATION.md、.ua/backlog.json、.ua/iterations.log、pnpm-workspace.yaml;npm run check 全绿", "status": "done", "notes": "来源:审计应修 #6 + 建议 #7" + }, + { + "id": "g01", + "title": "ua docs 幂等化:llms-full.txt 时间戳不弄脏工作区", + "motivation": "llms-full.txt 头部含 generatedAt,每次 ua docs 重写必然弄脏工作区,与 index 幂等化(f05)同类问题", + "acceptance": "内容与现有文件仅时间戳之差时不写入;npm run docs 连跑两次 git status 干净", + "status": "done", + "notes": "自补:延续 f05 方案" + }, + { + "id": "g02", + "title": "新增 image 图片组件(缩略图 + 点击预览)", + "motivation": "皮肤包缺常规媒体组件,img 缩略图 + 遮罩预览是常规表单/详情页刚需", + "acceptance": "image({src, alt, width?}) 返回缩略图,点击开遮罩大图(Esc/点击遮罩关闭,reduced-motion 兜底);manifest/docs/llms-full/README/demo 同步;npm run check 全绿", + "status": "open", + "notes": "自补:组件补充方向" + }, + { + "id": "g03", + "title": "textField/textarea/inputNumber 补 prefix/suffix 附加内容槽", + "motivation": "搜索框放大镜、金额单位等前后缀是输入组件高频需求,目前只能外部拼装", + "acceptance": "三个输入组件新增 prefix/suffix(string|HTMLElement),渲染为输入框内侧前后附加块;manifest 参数表与 llms-full 同步;npm run check 全绿", + "status": "open", + "notes": "自补:可用性细节方向" } ] } diff --git a/packages/tools/cli/bin/ua.js b/packages/tools/cli/bin/ua.js index 048557b..bcc7c66 100644 --- a/packages/tools/cli/bin/ua.js +++ b/packages/tools/cli/bin/ua.js @@ -56,9 +56,9 @@ function collectManifests() { return out; } -/*** 内容无变化则跳过写入(幂等,行尾归一化防 CRLF 误判),避免时间戳刷新弄脏工作区 ***/ -function writeIfChanged(file, content) { - if (fs.existsSync(file) && fs.readFileSync(file, 'utf8').replace(/\r\n/g, '\n') === content) return false; +/*** 内容无变化则跳过写入(幂等,行尾归一化防 CRLF 误判;norm 可剔除时间戳后再比对),避免弄脏工作区 ***/ +function writeIfChanged(file, content, norm = (s) => s) { + if (fs.existsSync(file) && norm(fs.readFileSync(file, 'utf8').replace(/\r\n/g, '\n')) === norm(content)) return false; fs.writeFileSync(file, content); return true; } @@ -356,7 +356,9 @@ function cmdDocs() { fs.writeFileSync(path.join(outDir, 'index.html'), renderDocs(index, tokens)); const demoSrc = path.join(ROOT, 'apps', 'demo', 'dist', 'demo.html'); // 演示页拷入文档站供 iframe if (fs.existsSync(demoSrc)) fs.copyFileSync(demoSrc, path.join(outDir, 'demo.html')); - fs.writeFileSync(LLMS_FULL, renderAgentDocs(index, tokens)); + // llms-full 头部时间戳仅生成时刻之差视为无变化(与 index 幂等化同方案) + const normTs = (s) => s.replace(/自动生成于 [^,]*/, '自动生成于 X'); + writeIfChanged(LLMS_FULL, renderAgentDocs(index, tokens), normTs); console.log( `docs generated -> apps/docs/index.html + demo.html, llms-full.txt (${index.packages.length} packages)`, );