Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,32 +36,44 @@ jobs:
- name: Install dependencies
run: bun install

- name: Check proposal matches PR number
- name: Check RFC number matches PR number
run: |
BASE_SHA="${{ github.event.pull_request.base.sha }}"
HEAD_SHA="${{ github.event.pull_request.head.sha }}"
PR_NUMBER="${{ github.event.pull_request.number }}"

CHANGED_PROPOSALS=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" -- 'proposals/' \
| grep -v '^proposals/0000-template\.md$' || true)
# Grandfathered RFCs that predate the PR number convention
GRANDFATHERED="5 15 23 24 27 29 33"

COUNT=$(echo "$CHANGED_PROPOSALS" | grep -c . || true)
# Only check newly added RFC files, not moved/renamed ones
CHANGED_RFCS=$(git diff --name-only --diff-filter=A "$BASE_SHA" "$HEAD_SHA" -- 'rfcs/' \
| grep -v '^rfcs/0000-template\.md$' || true)

COUNT=$(echo "$CHANGED_RFCS" | grep -c . || true)

if [ "$COUNT" -gt 1 ]; then
echo "::error::PR touches $COUNT proposals. Only one proposal per PR is allowed."
echo "$CHANGED_PROPOSALS"
echo "::error::PR touches $COUNT RFCs. Only one RFC per PR is allowed."
echo "$CHANGED_RFCS"
exit 1
fi

if [ "$COUNT" -eq 1 ]; then
FILE=$(echo "$CHANGED_PROPOSALS" | head -1)
FILE=$(echo "$CHANGED_RFCS" | head -1)
FILENAME=$(basename "$FILE")
FILE_NUMBER=$(echo "$FILENAME" | grep -oE '^[0-9]+' || true)
# Strip leading zeros for comparison
FILE_NUM=$((10#$FILE_NUMBER))

# Skip check for grandfathered RFCs
for GF in $GRANDFATHERED; do
if [ "$FILE_NUM" -eq "$GF" ]; then
echo "RFC $FILE_NUM is grandfathered, skipping PR number check."
exit 0
fi
done

if [ "$FILE_NUM" -ne "$PR_NUMBER" ]; then
echo "::error::Proposal number ($FILE_NUM from $FILENAME) does not match PR number ($PR_NUMBER)."
echo "::error::RFC number ($FILE_NUM from $FILENAME) does not match PR number ($PR_NUMBER)."
exit 1
fi
fi
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches:
- develop
pull_request:
types: [opened, closed, reopened]
branches:
- develop

permissions:
contents: read
Expand All @@ -23,6 +27,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0

- name: Setup Bun
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/preview.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: RFC Preview

on:
pull_request:
branches:
- develop

permissions:
contents: read
deployments: write

jobs:
preview:
env:
GH_TOKEN: ${{ github.token }}
runs-on: ubuntu-latest
environment:
name: rfc-preview
url: ${{ steps.upload.outputs.artifact-url }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Bun
uses: oven-sh/setup-bun@v2

- name: Install dependencies
run: bun install

- name: Build preview
run: bun run index.ts --preview

- name: Upload RFC preview
id: upload
uses: actions/upload-artifact@v7
with:
name: rfc-preview-pr-${{ github.event.pull_request.number }}
path: ./dist/preview.html
archive: false
33 changes: 13 additions & 20 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,12 @@ Static site generator for Vortex RFC proposals built with Bun.
```
index.ts - Main build script and dev server
styles.css - Site styling (light/dark themes)
proposed/ - RFC markdown files in proposed state
accepted/ - RFC markdown files in accepted state
completed/ - RFC markdown files in completed state
rfcs/ - RFC markdown files (merged to develop = accepted)
dist/ - Build output (gitignored)
```

RFC filenames follow the format `NNNN-slug.md` (e.g., `0001-galp-patches.md`).
Numbering is global across all states - no duplicates allowed.
RFC filenames follow the format `NNNN-slug.md` (e.g., `0027-patches-format.md`).
The RFC number must match the PR number used to propose it. No duplicate numbers allowed.

## Commands

Expand All @@ -26,29 +24,24 @@ bun run clean # Remove dist/

## How the Build Works

1. Scans `proposed/`, `accepted/`, `completed/` for RFC files
1. Scans `rfcs/` for RFC markdown files
2. Parses RFC number from filename (e.g., `0002-foo.md` → RFC 0002)
3. Determines state from containing folder
4. Extracts title from first `# ` heading
5. Converts markdown to HTML using `Bun.markdown.html()`
6. Generates `dist/index.html` (table of contents with filter UI)
7. Generates `dist/rfc/{number}.html` for each RFC
3. Extracts title from first `# ` heading
4. Converts markdown to HTML using `Bun.markdown.html()`
5. Generates `dist/index.html` (table of contents)
6. Generates `dist/rfc/{number}.html` for each RFC

## Dev Server

- Uses `Bun.serve()` to serve static files from `dist/`
- Watches `proposed/`, `accepted/`, `completed/`, and `styles.css` for changes
- Watches `rfcs/` and `styles.css` for changes
- SSE endpoint at `/__reload` for live reload

## RFC States
## RFC Workflow

RFCs progress through three states by moving files between folders:

- **proposed**: New RFCs under discussion
- **accepted**: Approved RFCs ready for implementation
- **completed**: Fully implemented RFCs

The index page shows a state pill for each RFC and supports filtering by state.
1. Open a PR with a new file `rfcs/NNNN-slug.md` where NNNN matches the PR number
2. PR builds a preview artifact for reviewers
3. Merging the PR to `develop` accepts the RFC

## Styling

Expand Down
Empty file removed accepted/.keep
Empty file.
Empty file removed completed/.keep
Empty file.
Loading
Loading