From 1c309d8d347b96ecaea5308850fd065bb4c7fc00 Mon Sep 17 00:00:00 2001 From: Woonggi Min Date: Sun, 31 May 2026 15:28:47 +0900 Subject: [PATCH] test(codex): guard package-qualified install docs Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus --- script/lazycodex-install-docs.test.ts | 38 +++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 script/lazycodex-install-docs.test.ts diff --git a/script/lazycodex-install-docs.test.ts b/script/lazycodex-install-docs.test.ts new file mode 100644 index 000000000..ed8ec43eb --- /dev/null +++ b/script/lazycodex-install-docs.test.ts @@ -0,0 +1,38 @@ +/// + +import { describe, expect, test } from "bun:test" +import { readFileSync } from "node:fs" + +const repoRoot = new URL("../", import.meta.url) + +const installDocs = [ + "README.md", + "README.ko.md", + "README.ja.md", + "README.ru.md", + "README.zh-cn.md", + "docs/guide/installation.md", + "docs/reference/cli.md", + "packages/omo-codex/README.md", + "packages/omo-codex/MARKETPLACE.md", + "packages/omo-codex/plugin/components/comment-checker/README.md", + "packages/omo-codex/plugin/components/lsp/README.md", + "packages/omo-codex/plugin/components/rules/README.md", + "packages/omo-codex/plugin/components/ultrawork/README.md", + "packages/omo-codex/plugin/components/ulw-loop/README.md", +] + +const UNQUALIFIED_OMO_INSTALL = /(^|[^\w@/-])bunx\s+omo\s+install\b/u + +describe("LazyCodex install documentation", () => { + test("uses the scoped package-backed command for Codex Light install surfaces", () => { + for (const docPath of installDocs) { + // #given + const content = readFileSync(new URL(docPath, repoRoot), "utf8") + + // #then + expect(content, `${docPath} must not point users at the broken unscoped lazycodex package`).not.toContain("bunx lazycodex install") + expect(content, `${docPath} must not point users at the unrelated unscoped omo package`).not.toMatch(UNQUALIFIED_OMO_INSTALL) + } + }) +})