Skip to content

Commit be9b070

Browse files
authored
Bring over docs generation scripts from PR 11044 (#1)
1 parent 0003740 commit be9b070

22 files changed

Lines changed: 3307 additions & 29 deletions

.github/workflows/sync.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99
inputs:
1010
tag:
11-
description: "Release tag"
11+
description: 'Release tag'
1212
required: true
1313

1414
jobs:
@@ -27,8 +27,7 @@ jobs:
2727
with:
2828
repository: remix-run/remix
2929
path: remix
30-
# TODO: Once merged, update this to checkout the tag
31-
ref: brophdawg11/docs-auto-generate
30+
ref: ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag || github.event.inputs.tag }}
3231
fetch-depth: 0
3332
fetch-tags: true
3433

@@ -41,22 +40,33 @@ jobs:
4140
uses: actions/setup-node@v4
4241
with:
4342
node-version: 24
44-
cache: "pnpm"
43+
cache: 'pnpm'
4544
cache-dependency-path: remix/pnpm-lock.yaml
4645

47-
- name: Install Remix dependencies
46+
- name: Install/Build remix-api-docs
47+
working-directory: remix-api-docs
48+
run: pnpm install --frozen-lockfile
49+
50+
- name: Install/Build remix
4851
id: remix
4952
working-directory: remix
5053
run: |
5154
pnpm install --frozen-lockfile
55+
pnpm build
5256
echo "remix_sha=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT
5357
5458
- name: Sync Docs
5559
working-directory: remix-api-docs
5660
run: |
57-
./sync.sh ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag || github.event.inputs.tag }}
61+
rm -f docs/index.html
62+
rm -rf docs/assets
63+
rm -rf docs/api
64+
65+
pnpm run docs --tag ${{ github.event_name == 'repository_dispatch' && github.event.client_payload.tag || github.event.inputs.tag }}
66+
pnpm run prerender --all
5867
5968
git add docs/
69+
6070
if [ -z "$(git status --porcelain)" ]; then
6171
echo "No changes detected"
6272
exit 0

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
node_modules/

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/
2+
docs/
3+
node_modules/
4+
pnpm-lock.yaml

.prettierrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"semi": false,
4+
"singleQuote": true,
5+
"useTabs": false
6+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# Remix API Documentation
22

3-
This repo houses the automatically generated API documentation for [Remix](https://github.com/remix-run/remix)
3+
This repo builds and houses the automatically generated API documentation for [Remix](https://github.com/remix-run/remix)

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "remix-api-docs",
3+
"private": true,
4+
"type": "module",
5+
"dependencies": {
6+
"front-matter": "^4.0.2",
7+
"marked": "^17.0.1",
8+
"node-html-parser": "^7.0.2",
9+
"remix": "github:remix-run/remix#preview/main&path:packages/remix",
10+
"semver": "^7.7.3",
11+
"shiki": "^3.22.0",
12+
"tsx": "^4.21.0",
13+
"typedoc": "^0.28.15"
14+
},
15+
"devDependencies": {
16+
"@types/hast": "^3.0.4",
17+
"@types/node": "^25.2.3",
18+
"@types/semver": "^7.5.8",
19+
"prettier": "^3.5.3"
20+
},
21+
"scripts": {
22+
"dev": "tsx --watch src/server/index.ts",
23+
"docs": "node src/generate/index.ts",
24+
"docs:debug": "DEBUG=1 pnpm run docs",
25+
"format": "prettier --write .",
26+
"prerender": "tsx src/server/prerender.ts",
27+
"prerender:serve": "npx http-server -p 3000 build/site",
28+
"serve": "tsx src/server/index.ts",
29+
"typecheck": "tsgo --noEmit"
30+
}
31+
}

0 commit comments

Comments
 (0)