Skip to content

refactor(readme-sync): move synced upstream README under src/upstream/ - #978

Open
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-directory-layout-audit-001
Open

refactor(readme-sync): move synced upstream README under src/upstream/#978
kitsuyui wants to merge 1 commit into
mainfrom
fix/audit-directory-layout-audit-001

Conversation

@kitsuyui

@kitsuyui kitsuyui commented Sep 8, 2026

Copy link
Copy Markdown
Member

Why

src/ mixed website implementation files (index.tsx, readme-html-sanitizer.ts) with src/readme.md, a verbatim synced copy of the upstream gitignore-in/gitignore-in README. Looking at the directory tree alone did not distinguish local implementation from the external sync target, which risks contributors editing src/readme.md as ordinary documentation and breaking bun run check:readme.

What changed

  • Moved src/readme.md to src/upstream/readme.md (git rename, content unchanged).
  • Updated the raw import in src/index.tsx to ./upstream/readme.md?raw.
  • Updated scripts/check-readme-sync.ts (local file URL, ENOENT guidance message, and the out-of-sync error message) to point at the new path.
  • Updated scripts/check-readme-html-elements.ts (file URL and console error text) to the new path.
  • Updated scripts/check-readme-sync.test.ts expectation for the ENOENT guidance message.
  • Updated README.md to describe src/upstream/ as the location for files synced from other repositories.

No behavior changes: the README sync check still compares the same local file content against the same pinned upstream commit, and the rendered page still imports the same markdown content, just from its new path.

Verification

  • bun test scripts/check-readme-sync.test.ts -- 14 pass, 0 fail.
  • bun run check:readme-html -- passes against the new src/upstream/readme.md path.
  • bun run check:readme -- reaches the local-file read step correctly (fails only on the outbound network fetch to raw.githubusercontent.com, which this sandbox blocks; that step is unrelated to the path change).
  • biome check . -- passes (fixed one import-order finding introduced by the edit).
  • bun install in this sandbox required overriding BUN_TMPDIR/BUN_INSTALL_CACHE_DIR/HOME to writable paths and --ignore-scripts (the sandbox has no node binary for cypress's postinstall); this is a pre-existing local environment limitation unrelated to this change, not a change to the project's install process.

Finding: audit-directory-layout-audit-001.

src/ mixed website implementation files with a file synced verbatim
from gitignore-in/gitignore-in's README, so the tree alone did not
show which files were local implementation versus an external
sync target. Move the synced copy into src/upstream/ and update the
sync check, HTML allowlist check, and the raw import that renders it
so the split is visible without reading source.
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Code Metrics Report

main (6219157) #978 (271c93f) +/-
Coverage 91.2% 91.2% 0.0%
Code to Test Ratio 1:0.9 1:0.9 0.0
Test Execution Time 13s 10s -3s
Details
  |                     | main (6219157) | #978 (271c93f) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          91.2% |          91.2% | 0.0% |
  |   Files             |              3 |              3 |    0 |
  |   Lines             |            114 |            114 |    0 |
  |   Covered           |            104 |            104 |    0 |
  | Code to Test Ratio  |          1:0.9 |          1:0.9 |  0.0 |
  |   Code              |            306 |            306 |    0 |
  |   Test              |            288 |            288 |    0 |
+ | Test Execution Time |            13s |            10s |  -3s |

Code coverage of files in pull request scope (90.9% → 90.9%)

Files Coverage +/- Status
src/index.tsx 85.7% 0.0% modified
src/readme-html-sanitizer.ts 91.2% 0.0% modified

Reported by octocov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant