Compare commits

...

2 Commits

Author SHA1 Message Date
diegosouzapw
3e56c46feb docs(changelog): point the PR-5 fragment at #13235 2026-09-10 13:35:57 -03:00
diegosouzapw
2a9364d451 chore(electron): prune the root-level files of every translated docs mirror
The desktop runtime reads exactly one slice of docs/i18n: the translated
docs/** tree, through the in-app docs route (src/lib/docsI18nPath.ts pins
the path). Each locale's root-level mirrors — README.md, llm.txt, CLAUDE.md,
GEMINI.md, CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md — exist for
GitHub readers and are never opened by the packaged app, so they leave the
bundle together with the translated CHANGELOG that was already pruned.

Measured on release/v3.8.51 with 51 locales: docs/i18n is 139 MB, of which
25.7 MB is the served docs/** tree (kept), 103.5 MB the CHANGELOG mirrors
(already pruned) and 11.4 MB these root files (pruned now). The plan's D4
called for dropping docs/i18n entirely; that would have broken localized
docs inside the app, which is why the served subtree stays.
2026-09-10 13:30:27 -03:00
3 changed files with 30 additions and 2 deletions

View File

@@ -0,0 +1 @@
- **chore(electron):** the desktop bundle no longer ships the root-level files of every translated docs mirror (`README.md`, `llm.txt`, `CLAUDE.md`, `GEMINI.md`, `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`) — the packaged app only reads `docs/i18n/<locale>/docs/**`, which stays. Saves ~11 MB on top of the translated CHANGELOGs already pruned. (#0000)

View File

@@ -1,8 +1,24 @@
import { existsSync, lstatSync, readdirSync, rmSync } from "node:fs";
import { join, relative, resolve, sep } from "node:path";
// The packaged app reads exactly one slice of the translated mirrors:
// `docs/i18n/<locale>/docs/**`, through the in-app docs route (the path is
// pinned by src/lib/docsI18nPath.ts). Everything at a locale's root — the
// README, llm.txt and the agent/contributor guides — is authoring material
// mirrored for GitHub readers and never opened by the runtime, so it leaves
// the bundle together with the translated CHANGELOG (~115 MB across 51
// locales, 103 MB of it CHANGELOG). The translated `docs/**` tree stays.
export const ELECTRON_RUNTIME_DOC_PRUNE_RULES = Object.freeze({
localeRootFiles: Object.freeze(["CHANGELOG.md"]),
localeRootFiles: Object.freeze([
"CHANGELOG.md",
"CLAUDE.md",
"CODE_OF_CONDUCT.md",
"CONTRIBUTING.md",
"GEMINI.md",
"README.md",
"SECURITY.md",
"llm.txt",
]),
authoringDirectories: Object.freeze(["docs/research", "docs/superpowers"]),
});

View File

@@ -73,6 +73,8 @@ test("electron docs manifest prunes authoring payloads without removing runtime
["docs/guides/CODEX-CLI-CONFIGURATION.md", "# Codex CLI"],
["docs/i18n/ko/docs/guides/ELECTRON_GUIDE.md", "# Electron"],
["docs/i18n/ko/CHANGELOG.md", "translated release history"],
["docs/i18n/ko/README.md", "translated readme"],
["docs/i18n/ko/llm.txt", "translated llm summary"],
["docs/i18n/fr/CHANGELOG.md", "historique traduit"],
["docs/research/desktop-notes.md", "authoring notes"],
["docs/superpowers/plans/desktop-plan.md", "implementation plan"],
@@ -87,16 +89,23 @@ test("electron docs manifest prunes authoring payloads without removing runtime
const result = pruneElectronRuntimeDocs(bundleRoot);
// Only `docs/i18n/<locale>/docs/**` is read at runtime (the in-app docs
// route, see src/lib/docsI18nPath.ts); every root-level mirror of a locale
// is authoring material and leaves the bundle with the CHANGELOG.
assert.deepEqual(result.removedPaths, [
"docs/i18n/fr/CHANGELOG.md",
"docs/i18n/ko/CHANGELOG.md",
"docs/i18n/ko/README.md",
"docs/i18n/ko/llm.txt",
"docs/research",
"docs/superpowers",
]);
assert.equal(result.removedFiles, 4);
assert.equal(result.removedFiles, 6);
assert.equal(
result.removedBytes,
Buffer.byteLength("translated release history") +
Buffer.byteLength("translated readme") +
Buffer.byteLength("translated llm summary") +
Buffer.byteLength("historique traduit") +
Buffer.byteLength("authoring notes") +
Buffer.byteLength("implementation plan")
@@ -106,6 +115,8 @@ test("electron docs manifest prunes authoring payloads without removing runtime
assert.equal(existsSync(join(bundleRoot, "docs/guides/CODEX-CLI-CONFIGURATION.md")), true);
assert.equal(existsSync(join(bundleRoot, "docs/i18n/ko/docs/guides/ELECTRON_GUIDE.md")), true);
assert.equal(existsSync(join(bundleRoot, "docs/i18n/ko/CHANGELOG.md")), false);
assert.equal(existsSync(join(bundleRoot, "docs/i18n/ko/README.md")), false);
assert.equal(existsSync(join(bundleRoot, "docs/i18n/ko/llm.txt")), false);
assert.equal(existsSync(join(bundleRoot, "docs/research")), false);
assert.equal(existsSync(join(bundleRoot, "docs/superpowers")), false);