惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
有赞技术团队
有赞技术团队
IT之家
IT之家
博客园 - 聂微东
Jina AI
Jina AI
Hugging Face - Blog
Hugging Face - Blog
Last Week in AI
Last Week in AI
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
小众软件
小众软件
爱范儿
爱范儿
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
阮一峰的网络日志
阮一峰的网络日志
宝玉的分享
宝玉的分享
博客园 - 三生石上(FineUI控件)
大猫的无限游戏
大猫的无限游戏
博客园 - Franky
量子位
月光博客
月光博客
博客园 - 【当耐特】
博客园 - 叶小钗

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(docs): clean link audit temp docs · openclaw/openclaw...
vincentkoc · 2026-06-01 · via Recent Commits to openclaw:main

@@ -275,47 +275,66 @@ export function sanitizeDocsConfigForEnglishOnly(value) {

275275

return Object.keys(sanitized).length > 0 ? sanitized : undefined;

276276

}

277277278-

function prepareMirroredDocsDir(sourceDir = DOCS_DIR) {

278+

/**

279+

* @param {string} [sourceDir]

280+

* @param {{

281+

* resolveClawHubRepoPathImpl?: typeof resolveClawHubRepoPath;

282+

* syncClawHubDocsTreeImpl?: typeof syncClawHubDocsTree;

283+

* }} [options]

284+

*/

285+

export function prepareMirroredDocsDir(sourceDir = DOCS_DIR, options = {}) {

279286

const sourceRoot = path.resolve(sourceDir);

280287

if (sourceRoot !== path.resolve(DOCS_DIR)) {

281288

return { dir: sourceRoot, mirroredClawHub: false, cleanup: () => {} };

282289

}

283290284-

const clawhubRepo = resolveClawHubRepoPath("", { required: false });

291+

const resolveClawHubRepoPathImpl = options.resolveClawHubRepoPathImpl ?? resolveClawHubRepoPath;

292+

const syncClawHubDocsTreeImpl = options.syncClawHubDocsTreeImpl ?? syncClawHubDocsTree;

293+

const clawhubRepo = resolveClawHubRepoPathImpl("", { required: false });

285294

if (!clawhubRepo) {

286295

return { dir: sourceRoot, mirroredClawHub: false, cleanup: () => {} };

287296

}

288297289298

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docs-link-audit-"));

290-

fs.cpSync(sourceRoot, tempDir, { recursive: true });

291-

syncClawHubDocsTree(tempDir, { repoPath: clawhubRepo, required: false });

292-

return {

293-

dir: tempDir,

294-

mirroredClawHub: true,

295-

cleanup: () => fs.rmSync(tempDir, { recursive: true, force: true }),

296-

};

299+

try {

300+

fs.cpSync(sourceRoot, tempDir, { recursive: true });

301+

syncClawHubDocsTreeImpl(tempDir, { repoPath: clawhubRepo, required: false });

302+

return {

303+

dir: tempDir,

304+

mirroredClawHub: true,

305+

cleanup: () => fs.rmSync(tempDir, { recursive: true, force: true }),

306+

};

307+

} catch (error) {

308+

fs.rmSync(tempDir, { recursive: true, force: true });

309+

throw error;

310+

}

297311

}

298312299313

export function prepareAnchorAuditDocsDir(sourceDir = DOCS_DIR) {

300314

const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-docs-anchor-audit-"));

301-

fs.cpSync(sourceDir, tempDir, { recursive: true });

315+

try {

316+

fs.cpSync(sourceDir, tempDir, { recursive: true });

302317303-

for (const entry of fs.readdirSync(tempDir, { withFileTypes: true })) {

304-

if (!entry.isDirectory()) {

305-

continue;

306-

}

307-

if (!isGeneratedTranslatedDoc(`${entry.name}/`)) {

308-

continue;

318+

for (const entry of fs.readdirSync(tempDir, { withFileTypes: true })) {

319+

if (!entry.isDirectory()) {

320+

continue;

321+

}

322+

if (!isGeneratedTranslatedDoc(`${entry.name}/`)) {

323+

continue;

324+

}

325+

fs.rmSync(path.join(tempDir, entry.name), { recursive: true, force: true });

309326

}

310-

fs.rmSync(path.join(tempDir, entry.name), { recursive: true, force: true });

311-

}

312327313-

const docsJsonPath = path.join(tempDir, "docs.json");

314-

const docsConfig = JSON.parse(fs.readFileSync(docsJsonPath, "utf8"));

315-

const sanitized = sanitizeDocsConfigForEnglishOnly(docsConfig);

316-

fs.writeFileSync(docsJsonPath, `${JSON.stringify(sanitized, null, 2)}\n`, "utf8");

328+

const docsJsonPath = path.join(tempDir, "docs.json");

329+

const docsConfig = JSON.parse(fs.readFileSync(docsJsonPath, "utf8"));

330+

const sanitized = sanitizeDocsConfigForEnglishOnly(docsConfig);

331+

fs.writeFileSync(docsJsonPath, `${JSON.stringify(sanitized, null, 2)}\n`, "utf8");

317332318-

return tempDir;

333+

return tempDir;

334+

} catch (error) {

335+

fs.rmSync(tempDir, { recursive: true, force: true });

336+

throw error;

337+

}

319338

}

320339321340

/** @param {string} version */

@@ -528,6 +547,11 @@ export function auditDocsLinks(options = {}) {

528547

* platform?: NodeJS.Platform;

529548

* spawnSyncImpl?: typeof spawnSync;

530549

* prepareAnchorAuditDocsDirImpl?: (sourceDir?: string) => string;

550+

* prepareMirroredDocsDirImpl?: (sourceDir?: string) => {

551+

* dir: string;

552+

* mirroredClawHub: boolean;

553+

* cleanup: () => void;

554+

* };

531555

* cleanupAnchorAuditDocsDirImpl?: (dir: string) => void;

532556

* }} [options]

533557

*/

@@ -540,10 +564,12 @@ export function runDocsLinkAuditCli(options = {}) {

540564

const cleanupAnchorAuditDocsDirImpl =

541565

options.cleanupAnchorAuditDocsDirImpl ??

542566

((dir) => fs.rmSync(dir, { recursive: true, force: true }));

543-

const mirroredDocsDir = prepareMirroredDocsDir(DOCS_DIR);

544-

const anchorDocsDir = prepareAnchorAuditDocsDirImpl(mirroredDocsDir.dir);

567+

const prepareMirroredDocsDirImpl = options.prepareMirroredDocsDirImpl ?? prepareMirroredDocsDir;

568+

const mirroredDocsDir = prepareMirroredDocsDirImpl(DOCS_DIR);

569+

let anchorDocsDir;

545570546571

try {

572+

anchorDocsDir = prepareAnchorAuditDocsDirImpl(mirroredDocsDir.dir);

547573

// Use the npm Mintlify package explicitly. Some developer machines also

548574

// have the Swift Package Manager tool named `mint` on PATH, and that

549575

// binary exits with "command 'broken-links' not found".

@@ -565,7 +591,9 @@ export function runDocsLinkAuditCli(options = {}) {

565591566592

return result.status ?? 1;

567593

} finally {

568-

cleanupAnchorAuditDocsDirImpl(anchorDocsDir);

594+

if (anchorDocsDir) {

595+

cleanupAnchorAuditDocsDirImpl(anchorDocsDir);

596+

}

569597

mirroredDocsDir.cleanup();

570598

}

571599

}