fix: fetch-sources passes file path to parseFrontmatter (expects raw text)#101
Merged
Conversation
…text) Regression introduced in PR #100 (the architecture refactor). When I extracted the YAML-front-matter parser to src/lib/frontmatter.mjs, I kept its interface as `parseFrontmatter(rawText)` — but in fetch-sources.mjs I called it as `parseFrontmatter(filePath)`. The regex matched nothing, every product's `docs_repo` came back undefined, every product hit the `continue`, and `vendor/` stayed empty. CI then built with no vendor checkout, so the `softwareDocs` and `manpages` collections were empty, ~970 internal doc/manpage links went missing, and lychee reported 8 broken internal links (the README and installation hrefs that had nothing to point at). The live site deployed from this broken build. Fix: readFileSync(join(softwareDir, file), 'utf8') before calling parseFrontmatter, matching what asciidoc.ts already does through its adocLoader. Verified locally: - parseFrontmatter(readFileSync('src/content/software/rnp.md', 'utf8')) returns docs_repo + docs_ref correctly - rm -rf vendor && npm run fetch-sources clones all 3 products - npm run build: no empty-collection warnings - npm run check:links: "OK — all internal href/src targets exist"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Regression introduced in PR #100 (the architecture refactor). When I extracted the YAML-front-matter parser to
src/lib/frontmatter.mjs, I kept its interface asparseFrontmatter(rawText)— but infetch-sources.mjsI called it asparseFrontmatter(filePath). The regex matched nothing, every product'sdocs_repocame back undefined, every product hit thecontinue, andvendor/stayed empty.CI then built with no vendor checkout, so the
softwareDocsandmanpagescollections were empty, ~970 internal doc/manpage links went missing, and lychee reported 8 broken internal links (the README and installation hrefs that had nothing to point at).The live site deployed from this broken build.
Fix
Matching what
asciidoc.tsalready does through itsadocLoader.Test plan
parseFrontmatter(readFileSync('src/content/software/rnp.md', 'utf8'))returnsdocs_repo+docs_refcorrectlyrm -rf vendor && npm run fetch-sourcesclones all 3 products (py-rnp, rnp@v0.18.1, ruby-rnp)npm run build: no "collection does not exist or is empty" warningsnpm run check:links: "OK — all internal href/src targets exist in dist/."