-
Notifications
You must be signed in to change notification settings - Fork 30
build(docx): Build static content and serve in doc site #2857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
build(docx): Build static content and serve in doc site #2857
Conversation
Deploying atlantis with
|
| 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 |
| styles.css.backup | ||
|
|
||
| # Generated static content files (only generated in CI) | ||
| packages/site/public/staticContent/ |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
| 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"), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
nad182
left a comment
There was a problem hiding this 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.
| 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"), |
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
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
npm run buildof packages siteDeprecated
Removed
Fixed
Security
Testing
npm run build:static-contentfrompackages/siteand confirm the 10 JSON files are served in the doc siteChanges can be
tested via Pre-release
In Atlantis we use Github's built in pull request reviews.