-
Notifications
You must be signed in to change notification settings - Fork 17
Improve RFD site deployment for other orgs #189
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
Draft
benjaminleonard
wants to merge
17
commits into
main
Choose a base branch
from
customisable-site
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
b25f121
First pass at RFD site config file
benjaminleonard 48bab9b
Test docker
benjaminleonard 456adb6
PR review tweaks
benjaminleonard fc471fc
Fix typo
benjaminleonard dbcf660
Merge branch 'main' into customisable-site
benjaminleonard 65bdd90
Fix `headScript` typo
benjaminleonard 0f07198
Merge branch 'main' into customisable-site
benjaminleonard b982db6
DS update
benjaminleonard d949675
AI PR improvements
benjaminleonard 0eecfd0
Merge auth provider + storage abstractions from #190 (no Deno)
benjaminleonard 5f4911d
AIPR
benjaminleonard daa6b63
Remove chromatic
benjaminleonard 78f843a
Simplify login
benjaminleonard ace1156
Simplify external site config
benjaminleonard 8c18d9d
unset `AUTH_PROVIDERS` now means no providers
benjaminleonard 54bcbec
Reduce test flaking
benjaminleonard cf2fa9a
Fmt
benjaminleonard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,22 @@ | ||
| fly.toml | ||
| /node_modules | ||
| # Dependencies (reinstalled in Docker) | ||
| node_modules | ||
|
|
||
| # Build artifacts (regenerated in Docker) | ||
| .cache | ||
| /build | ||
| /.react-router | ||
|
|
||
| # Environment files (provided at runtime) | ||
| .env | ||
|
|
||
| # Version control (not needed in image) | ||
| .git | ||
| .github | ||
|
|
||
| # Testing (not needed in production) | ||
| test | ||
| test-results | ||
|
|
||
| # System files | ||
| *.log | ||
| .DS_Store | ||
| .env | ||
| /.cache | ||
| /public/build | ||
| /build |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,4 @@ test-results/ | |
|
|
||
| /app/components/icons | ||
|
|
||
| // chromatic | ||
| build-archive.log | ||
| test-results/ | ||
|
|
||
| .react-router/ | ||
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| # CLAUDE.md | ||
|
|
||
| This file provides guidance to Claude Code (claude.ai/code) when working with code in this | ||
| repository. | ||
|
|
||
| ## Project Overview | ||
|
|
||
| RFD Site is Oxide Computer Company's web frontend for browsing, searching, and reading RFDs | ||
| (Requests for Discussion). Built with React Router v7 (formerly Remix) and deployed on | ||
| Vercel. | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| npm run dev # Start dev server on localhost:3000 | ||
| npm run build # Production build (react-router build) | ||
| npm run test # Run unit tests with Vitest | ||
| npm run tsc # Type check without emitting | ||
| npm run lint # ESLint | ||
| npm run fmt # Format with Prettier | ||
| npm run fmt:check # Check formatting | ||
| npm run e2ec # Run Playwright E2E tests (Chrome) | ||
| ``` | ||
|
|
||
| ### Running a Single Test | ||
|
|
||
| ```bash | ||
| npm run test -- path/to/file.test.ts # Run specific test file | ||
| npm run test -- --grep "test name" # Run tests matching pattern | ||
| npx playwright test --project=chrome test.ts # Run specific E2E test | ||
| ``` | ||
|
|
||
| ### Local RFD Authoring Mode | ||
|
|
||
| Preview RFDs from a local clone of the rfd repo: | ||
|
|
||
| ```bash | ||
| LOCAL_RFD_REPO=~/oxide/rfd npm run dev | ||
| ``` | ||
|
|
||
| This mode reads RFD files directly from the specified directory without needing API | ||
| credentials. | ||
|
|
||
| ## Architecture | ||
|
|
||
| ### Data Flow: Local vs Remote Mode | ||
|
|
||
| The app operates in two modes controlled by `LOCAL_RFD_REPO` env var: | ||
|
|
||
| - **Local mode** (`app/services/rfd.local.server.ts`): Reads AsciiDoc files directly from a | ||
| local rfd repo clone. Used for authoring/previewing. | ||
| - **Remote mode** (`app/services/rfd.remote.server.ts`): Fetches from the rfd-api backend. | ||
| Used in production with OAuth authentication. | ||
|
|
||
| The unified interface in `app/services/rfd.server.ts` abstracts this, calling either backend | ||
| based on `isLocalMode()`. | ||
|
|
||
| ### Routing | ||
|
|
||
| Uses React Router v7 file-based routing (`@react-router/fs-routes`). Routes are in | ||
| `app/routes/`: | ||
|
|
||
| - `_index.tsx` - RFD listing page | ||
| - `rfd.$slug.tsx` - Individual RFD view | ||
| - `auth.*.tsx` - OAuth flows (GitHub, Google) | ||
| - `api.*.tsx` - API endpoints | ||
|
|
||
| ### Content Rendering | ||
|
|
||
| RFDs are written in AsciiDoc and rendered with `@oxide/react-asciidoc`. Custom block | ||
| renderers live in `app/components/AsciidocBlocks/` (Mermaid diagrams, syntax-highlighted | ||
| code listings, images). | ||
|
|
||
| ### Path Alias | ||
|
|
||
| `~/` maps to `./app/` (configured in tsconfig.json). | ||
|
|
||
| ## Key Dependencies | ||
|
|
||
| - `@oxide/react-asciidoc` - AsciiDoc renderer | ||
| - `@oxide/rfd.ts` - TypeScript client for rfd-api | ||
| - `@oxide/design-system` - Oxide's component library | ||
| - `@tanstack/react-query` - Data fetching for PR discussions | ||
| - `shiki` - Syntax highlighting | ||
| - `mermaid` - Diagram rendering |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| FROM node:22-alpine AS development-dependencies-env | ||
| COPY . /app | ||
| WORKDIR /app | ||
| RUN npm ci | ||
|
|
||
| FROM node:22-alpine AS production-dependencies-env | ||
| COPY ./package.json package-lock.json /app/ | ||
| WORKDIR /app | ||
| RUN npm ci --omit=dev | ||
|
|
||
| FROM node:22-alpine AS build-env | ||
| COPY . /app/ | ||
| COPY --from=development-dependencies-env /app/node_modules /app/node_modules | ||
| WORKDIR /app | ||
| RUN npm run build | ||
|
|
||
| FROM node:22-alpine | ||
| ENV NODE_ENV=production | ||
| COPY ./package.json package-lock.json /app/ | ||
| COPY --from=production-dependencies-env /app/node_modules /app/node_modules | ||
| COPY --from=build-env /app/build /app/build | ||
| COPY --from=build-env /app/public /app/public | ||
| WORKDIR /app | ||
| CMD ["npm", "run", "start"] |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
Going to switch to a local regression test like the console and docs