集成 OpenHub 与 WeKnora Page AI
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env node
|
||||
"use strict";
|
||||
|
||||
const assert = require("node:assert");
|
||||
const fs = require("node:fs");
|
||||
const path = require("node:path");
|
||||
|
||||
const ROOT = process.cwd();
|
||||
const OUTPUT_DIR = path.join(ROOT, "tmp", "task789-weknora-kb-page-ui-reference-static-smoke");
|
||||
const RESULT_PATH = path.join(OUTPUT_DIR, "result.json");
|
||||
const REFERENCE_DOC = "design/07-ai/reference/7-68-weknora-kb-page-ui-reference-v1.md";
|
||||
|
||||
function read(relativePath) {
|
||||
return fs.readFileSync(path.join(ROOT, relativePath), "utf8");
|
||||
}
|
||||
|
||||
function assertContains(content, needle) {
|
||||
assert(content.includes(needle), `reference doc 缺少: ${needle}`);
|
||||
}
|
||||
|
||||
function main() {
|
||||
fs.mkdirSync(OUTPUT_DIR, { recursive: true });
|
||||
assert(fs.existsSync(path.join(ROOT, REFERENCE_DOC)), `${REFERENCE_DOC} 不存在`);
|
||||
|
||||
const doc = read(REFERENCE_DOC);
|
||||
for (const required of [
|
||||
"/mnt/Data1T/Mnote_data/weknora/WeKnora/frontend/src/views/knowledge/KnowledgeBaseList.vue",
|
||||
"/mnt/Data1T/Mnote_data/weknora/WeKnora/frontend/src/views/knowledge/KnowledgeBase.vue",
|
||||
"/mnt/Data1T/Mnote_data/weknora/WeKnora/frontend/src/views/knowledge/components/DocumentListView.vue",
|
||||
"/mnt/Data1T/Mnote_data/weknora/WeKnora/frontend/src/views/knowledge/components/KbUploadSourceDropdown.vue",
|
||||
"/mnt/Data1T/Mnote_data/weknora/WeKnora/frontend/src/components/knowledge-processing-timeline.vue",
|
||||
"providerKnowledgeId",
|
||||
"不能直接接管的边界",
|
||||
"MNote 最小呈现建议",
|
||||
]) {
|
||||
assertContains(doc, required);
|
||||
}
|
||||
|
||||
const result = {
|
||||
ok: true,
|
||||
checkedFiles: [REFERENCE_DOC],
|
||||
assertions: {
|
||||
referenceDocExists: true,
|
||||
weknoraKbListPathRecorded: true,
|
||||
weknoraKbDetailPathRecorded: true,
|
||||
documentListPathRecorded: true,
|
||||
uploadDropdownPathRecorded: true,
|
||||
processingTimelinePathRecorded: true,
|
||||
mnoteMappingRecorded: true,
|
||||
boundariesRecorded: true,
|
||||
minimumStructureRecorded: true,
|
||||
},
|
||||
};
|
||||
fs.writeFileSync(RESULT_PATH, `${JSON.stringify(result, null, 2)}\n`, "utf8");
|
||||
console.log(JSON.stringify(result, null, 2));
|
||||
}
|
||||
|
||||
main();
|
||||
Reference in New Issue
Block a user