Skip to content

Conversation

@edison-cy-yang
Copy link
Contributor

@edison-cy-yang edison-cy-yang commented Dec 19, 2025

Motivations

We want to publish atlantis file content as JSON files served on the doc site for other apps to consume.

Changes

Added

  • buildAtlantisStaticContent.ts - It goes through the repo by package and glob types, extracts the file content for each file into a JSON entry.

Changed

  • Trigger the script to be run in npm run build of packages site

Deprecated

Removed

Fixed

Security

Testing

  • npm run build:static-content from packages/site and confirm the 10 JSON files are served in the doc site

Changes can be
tested via Pre-release


In Atlantis we use Github's built in pull request reviews.

@edison-cy-yang edison-cy-yang changed the title build(site): Build static content and serve in doc site build(docx): Build static content and serve in doc site Dec 19, 2025
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 19, 2025

Deploying atlantis with  Cloudflare Pages  Cloudflare Pages

Latest commit: f9ff871
Status: ✅  Deploy successful!
Preview URL: https://54751d90.atlantis.pages.dev
Branch Preview URL: https://job-146515-atlantis-copy-bui.atlantis.pages.dev

View logs

@edison-cy-yang edison-cy-yang marked this pull request as ready for review December 23, 2025 19:07
@edison-cy-yang edison-cy-yang requested a review from a team as a code owner December 23, 2025 19:07
styles.css.backup

# Generated static content files (only generated in CI)
packages/site/public/staticContent/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The JSON files are added to packages/site/public/staticContent/ first, then get copied to /dist in npm run copyFiles. It has to be in /public first so they can also be served in local dev

import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
import { createRequire } from "module";
import path, { dirname } from "path";
// eslint-disable-next-line import/order
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this eslint-disable comment necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the rule to not have line breaks between import groups conflicts with the require() import below this, where it expects empty line below the import statement 🫣

I couldn't get it to use import .. from

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds like the ESLint rule needs to be tweaked, but I understand if you don't want to do it - totally out of scope.

Comment on lines 127 to 133
path.join(docsDir, "getting-started-with-react"),
path.join(docsDir, "guides"),
path.join(docsDir, "hooks"),
path.join(docsDir, "introduction"),
path.join(docsDir, "packages"),
path.join(docsDir, "patterns"),
path.join(docsDir, "proposals"),
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm wondering if there's any use in including all of those? I don't think there's any harm, but I also don't see how including stuff like "getting-started-with-react", "introduction" and "proposals" would be useful for the LLM.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True, I'll clean up some of these, they were brought over from the other repo

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned them up here. Also corrected some of the designDocs path that were wrong.

Copy link
Contributor

@nad182 nad182 left a comment

Choose a reason for hiding this comment

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

Looks good to me. Left 2 non-blocking questions/comments.

Comment on lines 125 to 130
path.join(siteContentDir, "changelog"),
path.join(docsDir, "content"),
path.join(docsDir, "getting-started-with-react"),
path.join(docsDir, "guides"),
path.join(docsDir, "hooks"),
path.join(docsDir, "introduction"),
path.join(docsDir, "packages"),
path.join(docsDir, "patterns"),
path.join(docsDir, "proposals"),
path.join(siteContentDir, "guides"),
path.join(siteContentDir, "hooks"),
path.join(siteContentDir, "packages"),
path.join(siteContentDir, "patterns"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Interesting. I hadn't realized that we had those folders in 2 places. Good catch!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There used to be in /docs and got moved

Copy link
Contributor

Choose a reason for hiding this comment

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

Yep, I understand. I still see them there, but I realize now that the correct content is in the dirs that you have now.

@edison-cy-yang edison-cy-yang merged commit 9fffd40 into master Jan 2, 2026
15 checks passed
@edison-cy-yang edison-cy-yang deleted the JOB-146515-atlantis-copy-build-static-content-script-and-trigger-it-to-run-in-ci branch January 2, 2026 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

3 participants