Skip to content

Publish synced llms files as static assets#134

Merged
justin808 merged 1 commit into
mainfrom
fix/publish-llms-static-files
Jun 27, 2026
Merged

Publish synced llms files as static assets#134
justin808 merged 1 commit into
mainfrom
fix/publish-llms-static-files

Conversation

@justin808

Copy link
Copy Markdown
Member

Summary

  • sync upstream root llms.txt, llms-full.txt, and llms-full-pro.txt into content/upstream/static
  • copy those synced files into the Docusaurus static/ root during prepare so Cloudflare serves /llms*.txt
  • add regression coverage for both sync staging and static publishing, while keeping generated copies ignored

Why merge

shakacode/react_on_rails now successfully dispatches docs-site rebuilds after root llms* changes, but the public endpoints still return 404 because this site never copied those upstream root files into the Docusaurus static output. This PR closes that gap without changing canonical content ownership.

Test plan

  • node --test scripts/sync-docs.test.mjs scripts/prepare-docs.test.mjs scripts/docs-layout.test.mjs
  • git diff --check
  • npm run prepare
  • npm run install:site
  • npm run build (passes; existing broken-link/anchor warnings remain)
  • verified prototypes/docusaurus/build/llms.txt, llms-full.txt, and llms-full-pro.txt are present

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jun 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@justin808, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 25 minutes and 19 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 74df623f-348b-469c-b93f-a4a6eeb90bcf

📥 Commits

Reviewing files that changed from the base of the PR and between ee56bcb and 2e461dd.

📒 Files selected for processing (6)
  • .gitignore
  • scripts/prepare-docs.mjs
  • scripts/prepare-docs.test.mjs
  • scripts/sync-docs.mjs
  • scripts/sync-docs.test.mjs
  • scripts/synced-static-files.mjs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/publish-llms-static-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Jun 27, 2026

Copy link
Copy Markdown

Greptile Summary

This PR publishes synced llms*.txt files through the Docusaurus static root. The main changes are:

  • Adds a shared list of root llms*.txt files.
  • Syncs those files into content/upstream/static.
  • Copies staged files into prototypes/docusaurus/static during docs preparation.
  • Adds tests for sync staging and static publishing.
  • Ignores the generated staged and published copies.

Confidence Score: 4/5

The static publishing path can remove generated endpoints, and the new sync test can overwrite workspace state.

  • Missing staged llms*.txt files make prepare delete existing Docusaurus static copies.
  • The sync test deletes the real content/upstream directory instead of using an isolated output root.
  • The shared module and ignore rules are straightforward.

scripts/prepare-docs.mjs and scripts/sync-docs.test.mjs

Important Files Changed

Filename Overview
.gitignore Ignores generated upstream static files and generated Docusaurus llms*.txt copies.
scripts/prepare-docs.mjs Adds static-file publishing, but the copy path can delete existing endpoint files when staged sources are missing.
scripts/prepare-docs.test.mjs Adds temp-dir coverage for copying all expected synced static files into the Docusaurus static root.
scripts/sync-docs.mjs Adds staging for upstream root llms*.txt files and warns when a source file is missing.
scripts/sync-docs.test.mjs Adds end-to-end sync coverage, but the test mutates the repository's real content/upstream directory.
scripts/synced-static-files.mjs Adds a small shared constant for the synced static filenames.

Reviews (1): Last reviewed commit: "Publish synced llms files as static asse..." | Re-trigger Greptile

Comment thread scripts/prepare-docs.mjs
Comment on lines +859 to +864
await fs.rm(targetFile, { force: true });
if (!(await exists(sourceFile))) {
continue;
}

await fs.copyFile(sourceFile, targetFile);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Missing Source Deletes Endpoint

When content/upstream/static is missing one of the synced llms*.txt files, this removes the existing Docusaurus static file before the missing-source check skips the copy. A standalone prepare:docs run or a partial sync can silently drop a previously generated endpoint from the site build and make /llms-full-pro.txt or the other static paths return 404.

Suggested change
await fs.rm(targetFile, { force: true });
if (!(await exists(sourceFile))) {
continue;
}
await fs.copyFile(sourceFile, targetFile);
if (!(await exists(sourceFile))) {
continue;
}
await fs.copyFile(sourceFile, targetFile);

await writeFakeUpstream(upstreamRoot);

const upstreamContent = path.join(workspaceRoot, "content", "upstream");
await fs.rm(upstreamContent, { recursive: true, force: true });

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Test Deletes Workspace State

This deletes content/upstream in the real checkout, while the temp-dir cleanup only covers the fake source repo. Running this test leaves the workspace populated with fake upstream docs on success, and an interruption or sync failure after this line can remove the developer's generated docs/static/changelog state until they run a full sync again.

@github-actions

Copy link
Copy Markdown

Cloudflare preview deployed.

@justin808

Copy link
Copy Markdown
Member Author

Merging under maintainer authority because this PR is the remaining downstream fix exposed by shakacode/react_on_rails#4219: the upstream repo now dispatches docs-site rebuilds successfully, but the hosted /llms*.txt endpoints stay 404 unless reactonrails.com copies the synced root llms files into Docusaurus static output. Local verification passed (script tests, prepare, install, build with existing warnings), and hosted build/deploy plus Greptile/CodeRabbit are green.

@justin808 justin808 merged commit 03b0161 into main Jun 27, 2026
4 checks passed
@justin808 justin808 deleted the fix/publish-llms-static-files branch June 27, 2026 04:15
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