docs: move translated READMEs under docs/readme (#2165)
Move all 18 translated READMEs into docs/readme/ and keep the English entry at the repository root. Update navigation, guide/image paths, website discovery and documentation checks together. Preserve the contributor's work and current main content. Cover every translated command and HTML destination, and repair the verified Persian heading fragments. Validation: 203 focused tests on the synchronized head, plus 119 tests and documentation checks on the integration with main fc0dbe7f9; 1,501 local references and 399 authored fragments verified. The complete CI workflow passes. The upstream x64 dylib fixture correction is included; an unchanged-checkout rerun cleared the earlier deadline timing assertion. Closes #2141 Co-authored-by: Aimal Khan <94559553+aimalexe@users.noreply.github.com> Co-authored-by: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Kaoru0822
factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
parent
865c35e25a
commit
cbe769b504
@@ -118,14 +118,21 @@ it("reuses only scheduled qualification and preserves every explicit full reques
|
||||
).toBe("fast");
|
||||
});
|
||||
|
||||
it("keeps every translated root README and authored guide on the documentation lane", async () => {
|
||||
it("keeps every translated README and authored guide on the documentation lane", async () => {
|
||||
const { directory, base } = await fixture();
|
||||
const readmes = (await readdir(new URL("../../../", import.meta.url))).filter(
|
||||
(name) => /^README(?:_.*)?\.md$/u.test(name),
|
||||
);
|
||||
const translated = (
|
||||
await readdir(new URL("../../../docs/readme/", import.meta.url))
|
||||
)
|
||||
.filter((name) => /^README_.*\.md$/u.test(name))
|
||||
.map((name) => `docs/readme/${name}`);
|
||||
expect(readmes).toContain("README.md");
|
||||
expect(translated.length).toBeGreaterThan(0);
|
||||
const head = await change(directory, [
|
||||
...readmes,
|
||||
...translated,
|
||||
"docs/guide.md",
|
||||
"AGENTS.md",
|
||||
"CONTRIBUTING.md",
|
||||
@@ -198,7 +205,7 @@ it("emits an observational owner proposal without changing ordinary or full port
|
||||
it("does not charge a documentation PR for unrelated implementation updates on main", async () => {
|
||||
const { directory, base } = await fixture();
|
||||
await git(directory, ["switch", "-c", "docs/change"]);
|
||||
const head = await change(directory, ["README_zh-TW.md"]);
|
||||
const head = await change(directory, ["docs/readme/README_zh-TW.md"]);
|
||||
await git(directory, ["switch", "main"]);
|
||||
const advancedBase = await change(directory, ["src/anotherProvider.ts"]);
|
||||
expect(advancedBase).not.toBe(base);
|
||||
@@ -240,7 +247,7 @@ it("retains complete checks when implementation is renamed into documentation",
|
||||
|
||||
it("keeps main pushes scoped when a successful ancestor baseline is available", async () => {
|
||||
const { directory, base } = await fixture();
|
||||
const head = await change(directory, ["README_ja.md"]);
|
||||
const head = await change(directory, ["docs/readme/README_ja.md"]);
|
||||
expect(await classify(directory, base, head, "push")).toMatchObject({
|
||||
tier: "fast",
|
||||
code: false,
|
||||
@@ -474,7 +481,10 @@ it.each([
|
||||
{ code: false, website: true, package: false },
|
||||
],
|
||||
["scripts/website_i18n.py", { code: false, website: true, package: false }],
|
||||
["README_ja.md", { code: false, docs: true, website: true, package: false }],
|
||||
[
|
||||
"docs/readme/README_ja.md",
|
||||
{ code: false, docs: true, website: true, package: false },
|
||||
],
|
||||
[
|
||||
".github/workflows/website-pages.yml",
|
||||
{ code: false, website: true, package: false },
|
||||
@@ -928,7 +938,7 @@ it.each(["workflow_dispatch", "schedule"])(
|
||||
it("honors ci:full for successive PR revisions", async () => {
|
||||
const { directory, base } = await fixture();
|
||||
const first = await change(directory, ["README.md"]);
|
||||
const second = await change(directory, ["README_ja.md"]);
|
||||
const second = await change(directory, ["docs/readme/README_ja.md"]);
|
||||
for (const head of [first, second]) {
|
||||
expect(
|
||||
await classify(directory, base, head, "pull_request", true),
|
||||
|
||||
@@ -37,6 +37,53 @@ import {
|
||||
const root = fileURLToPath(new URL("../../..", import.meta.url));
|
||||
const temporaryRoots: string[] = [];
|
||||
|
||||
const README_FACT_FIXTURE_PATHS = [
|
||||
"README.md",
|
||||
"docs/readme/README_zh.md",
|
||||
"docs/readme/README_ja.md",
|
||||
"docs/readme/README_ko.md",
|
||||
"docs/readme/README_ar.md",
|
||||
"website/locales/languages.json",
|
||||
"docs/installation.md",
|
||||
"AGENTS.md",
|
||||
".github/pull_request_template.md",
|
||||
] as const;
|
||||
|
||||
const README_LINK_DRIFT_MUTATIONS = [
|
||||
[
|
||||
"(../installation.md#supported-agents)",
|
||||
"(../installation.md#missing-agents)",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-CN/missing/",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-TW/guides/native/",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-CN/guides/native/?other=1",
|
||||
],
|
||||
[
|
||||
'src="../assets/rea-hopper-analysis.png"',
|
||||
'src="../assets/missing-hopper.png"',
|
||||
],
|
||||
['href="https://discord.gg/GkcryMnJDM"', 'href="https://discord.gg/missing"'],
|
||||
] as const;
|
||||
|
||||
const seedReadmeFactFixture = async (directory: string) => {
|
||||
for (const path of README_FACT_FIXTURE_PATHS) {
|
||||
const destination = join(directory, path);
|
||||
await mkdir(dirname(destination), { recursive: true });
|
||||
await copyFile(join(root, path), destination);
|
||||
}
|
||||
await mkdir(join(directory, "skills/reverse-engineer-anything"), {
|
||||
recursive: true,
|
||||
});
|
||||
};
|
||||
|
||||
afterEach(async () => {
|
||||
await Promise.all(
|
||||
temporaryRoots
|
||||
@@ -176,49 +223,14 @@ describe("canonical product catalog drift", () => {
|
||||
it("keeps translated readmes linked to canonical setup and tool details", async () => {
|
||||
const directory = await createTestTempDirectory("rea-readme-facts-");
|
||||
temporaryRoots.push(directory);
|
||||
const paths = [
|
||||
"README.md",
|
||||
"README_zh.md",
|
||||
"README_ja.md",
|
||||
"README_ko.md",
|
||||
"README_ar.md",
|
||||
"website/locales/languages.json",
|
||||
"docs/installation.md",
|
||||
"AGENTS.md",
|
||||
".github/pull_request_template.md",
|
||||
];
|
||||
for (const path of paths) {
|
||||
const destination = join(directory, path);
|
||||
await mkdir(dirname(destination), { recursive: true });
|
||||
await copyFile(join(root, path), destination);
|
||||
}
|
||||
await mkdir(join(directory, "skills/reverse-engineer-anything"), {
|
||||
recursive: true,
|
||||
});
|
||||
const translatedPath = join(directory, "README_zh.md");
|
||||
await seedReadmeFactFixture(directory);
|
||||
const translatedPath = join(directory, "docs/readme/README_zh.md");
|
||||
const translated = await readFile(translatedPath, "utf8");
|
||||
const catalog = await createProductCatalog(root);
|
||||
await expect(documentationFactIssues(directory, catalog)).resolves.toEqual(
|
||||
[],
|
||||
);
|
||||
for (const [original, changed] of [
|
||||
[
|
||||
"(docs/installation.md#supported-agents)",
|
||||
"(docs/installation.md#missing-agents)",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-CN/missing/",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-TW/guides/native/",
|
||||
],
|
||||
[
|
||||
"https://rea.tools/zh-CN/guides/native/",
|
||||
"https://rea.tools/zh-CN/guides/native/?other=1",
|
||||
],
|
||||
] as const) {
|
||||
for (const [original, changed] of README_LINK_DRIFT_MUTATIONS) {
|
||||
expect(translated).toContain(original);
|
||||
await writeFile(
|
||||
translatedPath,
|
||||
@@ -228,11 +240,10 @@ describe("canonical product catalog drift", () => {
|
||||
await expect(
|
||||
documentationFactIssues(directory, catalog),
|
||||
).resolves.toEqual([
|
||||
"README_zh.md: documentation links differ from README.md",
|
||||
"docs/readme/README_zh.md: documentation links differ from README.md",
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
it("fails check mode without rewriting a stale generated artifact", async () => {
|
||||
const directory = await createTestTempDirectory("rea-generated-check-");
|
||||
temporaryRoots.push(directory);
|
||||
|
||||
@@ -4,26 +4,6 @@ import { resolve } from "node:path";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { PRODUCT_IDENTITY } from "../../src/identity.js";
|
||||
|
||||
const translatedReadmes = [
|
||||
"README_zh.md",
|
||||
"README_zh-TW.md",
|
||||
"README_ja.md",
|
||||
"README_ko.md",
|
||||
"README_tr.md",
|
||||
"README_ru.md",
|
||||
"README_vi.md",
|
||||
"README_th.md",
|
||||
"README_de.md",
|
||||
"README_es.md",
|
||||
"README_fr.md",
|
||||
"README_uk.md",
|
||||
"README_pl.md",
|
||||
"README_pt-BR.md",
|
||||
"README_ar.md",
|
||||
"README_fa.md",
|
||||
"README_id.md",
|
||||
] as const;
|
||||
|
||||
const jsonExamples = (content: string): unknown[] =>
|
||||
[...content.matchAll(/```json\s*([\s\S]*?)```/gu)].map((match): unknown =>
|
||||
JSON.parse(match[1] ?? ""),
|
||||
@@ -64,6 +44,14 @@ describe("onboarding documentation product facts", () => {
|
||||
});
|
||||
|
||||
it("keeps translated onboarding commands aligned with the English examples", async () => {
|
||||
const inventory = JSON.parse(
|
||||
await readFile(resolve("website/locales/languages.json"), "utf8"),
|
||||
) as { code: string; readme: string }[];
|
||||
const translatedReadmes = inventory
|
||||
.filter((language) => language.code !== "en")
|
||||
.map((language) => language.readme);
|
||||
expect(translatedReadmes).toContain("docs/readme/README_it.md");
|
||||
expect(translatedReadmes).toHaveLength(18);
|
||||
const english = shellExamples(await readFile(resolve("README.md"), "utf8"));
|
||||
for (const path of translatedReadmes)
|
||||
expect(
|
||||
@@ -71,4 +59,21 @@ describe("onboarding documentation product facts", () => {
|
||||
path,
|
||||
).toEqual(english);
|
||||
});
|
||||
|
||||
it("preserves Persian joiners in links to GitHub-rendered headings", async () => {
|
||||
const persian = await readFile(resolve("docs/readme/README_fa.md"), "utf8");
|
||||
// Confirmed against GitHub's rendered README, which retains U+200C.
|
||||
for (const heading of [
|
||||
"REA چگونه کار میکند",
|
||||
"چه چیزهایی را میتوان تحلیل کرد",
|
||||
"نمونههای عملی",
|
||||
"پرسشهای متداول",
|
||||
"بهروزرسانی REA",
|
||||
]) {
|
||||
expect(persian).toContain(`## ${heading}`);
|
||||
expect(persian).toContain(
|
||||
`](#${heading.toLowerCase().replaceAll(" ", "-")})`,
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user