Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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)
18 changes: 17 additions & 1 deletion scripts/build/electronRuntimeDocs.mjs
Original file line number Diff line number Diff line change
@@ -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"]),
});

Expand Down
13 changes: 12 additions & 1 deletion tests/unit/electron-packaging.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand All @@ -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")
Expand All @@ -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);

Expand Down
Loading