Skip to content

Commit ae22549

Browse files
acolytec3lightclientzcstarrbomanaps
authored
Switch docs back to openrpc v2 (#667)
* add docusaurus * update deploy scripts * clean up stuff * update action * workflow dispatch trigger * build against main * push build to correct place * use correct working directory * fix references * update build artifact path in deploy workflow * consolidate in base dir * more cleanup * add test deploy ci * add workflow_dispatch * fix deploy script * build specs and website * don't throw on broken links * update baseUrl * make ESM/CJS stuff play nice * clean up links and docusaurus references * more link cleanup * update links to point to ethereum * remove docu boilerplate * build docs too * Update docs/reference/intro.md Co-authored-by: lightclient <[email protected]> * Update docusaurus.config.ts Co-authored-by: lightclient <[email protected]> * remove old deployment job * remove gatsby * update generator to v2 * Update openrpc version * Update prepare script * move build script to correct place * Add config to prep step * update ci * use correct trigger * remove config * add write permission * push to master * remove docusaurus nonsense * update node evn * commit package-lock only * switch to module * put prefix back to empty string * specify prefix * use crazy-max edit after build add contents write add path-prefix use peaceiris rework install setup rebuild gatsby again update config and deployment Add actions bot back to peace iris * update spellcheck * make repo name dynamic * dynamically add all md to menu * Remove copy docs step and reorder menu links * update support for latest generator This change allows for documentation assets to be copied by the generator into the proper build locations, eliminating the need for manual copy. * remove node options detritus from deploy * chore: change to mdx * Replace styled table with remarkGfm plugin * Clean up links and add tests/quickstart to docs * update test deploy to check on node 20, 22, 24 --------- Co-authored-by: lightclient <[email protected]> Co-authored-by: lightclient <[email protected]> Co-authored-by: Zane Starr <[email protected]> Co-authored-by: bomanaps <[email protected]>
1 parent 24604b8 commit ae22549

23 files changed

+11753
-34128
lines changed

.github/workflows/deploy.yaml

Lines changed: 20 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,48 +6,29 @@ on:
66
- main
77
workflow_dispatch:
88

9-
jobs:
10-
build:
11-
name: Build Docusaurus
12-
runs-on: ubuntu-latest
13-
steps:
14-
- uses: actions/checkout@v4
15-
with:
16-
fetch-depth: 0
17-
- uses: actions/setup-node@v4
18-
with:
19-
node-version: 20
20-
cache: npm
9+
env:
10+
GITHUB_REPOSITORY: ${{ github.repository }}
2111

22-
- name: Install dependencies
23-
run: npm install --frozen-lockfile
24-
25-
- name: Build specs and website
26-
run: |
27-
npm run build
28-
npm run build:docs
29-
30-
- name: Upload Build Artifact
31-
uses: actions/upload-pages-artifact@v3
32-
with:
33-
path: build
34-
35-
deploy:
36-
name: Deploy to GitHub Pages
37-
needs: build
38-
39-
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
12+
jobs:
13+
deploy-gh-pages:
4014
permissions:
41-
pages: write # to deploy to Pages
42-
id-token: write # to verify the deployment originates from an appropriate source
43-
44-
# Deploy to the github-pages environment
45-
environment:
46-
name: github-pages
47-
url: ${{ steps.deployment.outputs.page_url }}
15+
pages: write
16+
id-token: write
17+
contents: write
4818

4919
runs-on: ubuntu-latest
5020
steps:
21+
- uses: actions/checkout@v4
22+
- name: Use Node.js 22
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '22'
26+
- run: npm ci
27+
- run: npm run build
28+
- run: npm run build:docs
5129
- name: Deploy to GitHub Pages
52-
id: deployment
53-
uses: actions/deploy-pages@v4
30+
uses: peaceiris/actions-gh-pages@v4
31+
with:
32+
github_token: ${{ secrets.GITHUB_TOKEN }}
33+
publish_dir: build/docs/gatsby/public
34+
commit_message: "Deploy to GitHub Pages"

.github/workflows/test-deploy.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@ jobs:
1212
test-deploy:
1313
name: Test deployment
1414
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [20, 22, 24]
1518
steps:
1619
- uses: actions/checkout@v4
1720
with:
1821
fetch-depth: 0
1922
- uses: actions/setup-node@v4
2023
with:
21-
node-version: 20
24+
node-version: ${{ matrix.node-version }}
2225
cache: npm
2326

2427
- name: Install dependencies

.github/workflows/test.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ jobs:
66
lint-and-check:
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
10-
- name: Use Node.js 15.x
11-
uses: actions/setup-node@v1
9+
- uses: actions/checkout@v4
10+
- name: Use Node.js 22
11+
uses: actions/setup-node@v4
1212
with:
13-
node-version: ^15.x
13+
node-version: 22
1414
- run: npm ci
1515
- run: npm run build
1616
- run: npm run lint

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,3 @@ data.json
77
schema.json
88
*.dic
99
.idea/
10-
.docusaurus

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ Ethereum clients as modules that can be swapped at will.
1111

1212
### Contributing
1313

14-
Please see the contributors guide in [`docs/making-changes.md`][making-changes]
14+
Please see the [contributors guide][contributors-guide]
1515
for general information about the process of standardizing new API methods and
1616
making changes to existing ones. Information on test generation can be found
17-
in [`tests/README.md`][test-gen]
17+
in [test-gen][test-gen]
1818

1919
The specification itself is written in [OpenRPC][openrpc]. Refer to the OpenRPC
2020
specification and the JSON schema [specification][json-schema] to get started.
@@ -112,8 +112,8 @@ This repository is licensed under [CC0](LICENSE).
112112
[validator]: https://open-rpc.github.io/schema-utils-js/functions/validateOpenRPCDocument.html
113113
[graphql-schema]: http://graphql-schema.ethdevops.io/?url=https://raw.githubusercontent.com/ethereum/execution-apis/main/graphql.json
114114
[eip-1767]: https://eips.ethereum.org/EIPS/eip-1767
115-
[making-changes]: docs/making-changes.md
115+
[contributors-guide]: docs/reference/contributors-guide.md
116116
[json-schema]: https://json-schema.org
117117
[hive]: https://github.com/ethereum/hive
118118
[rpc-compat]: https://github.com/ethereum/hive/tree/master/simulators/ethereum/rpc-compat
119-
[test-gen]: tests/README.md
119+
[test-gen]: docs/reference/tests.md

css/custom.css

Lines changed: 0 additions & 30 deletions
This file was deleted.

docs/config/gatsby-config.js

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
const remarkGfm = require('remark-gfm');
2+
3+
module.exports = {
4+
pathPrefix: "/execution-apis",
5+
siteMetadata: {
6+
title: 'Ethereum JSON-RPC Specification',
7+
description: 'A specification of the standard interface for Ethereum clients.',
8+
siteUrl: process.env.GITHUB_REPOSITORY
9+
? `https://${process.env.GITHUB_REPOSITORY.split('/')[0]}.github.io/execution-apis`
10+
: 'https://ethereum.github.io/execution-apis', // fallback for local development
11+
logoUrl: 'https://raw.githubusercontent.com/open-rpc/design/master/icons/open-rpc-logo-noText/open-rpc-logo-noText%20(PNG)/256x256.png',
12+
primaryColor: '#3f51b5', //material-ui primary color
13+
secondaryColor: '#f50057', //material-ui secondary color
14+
author: '',
15+
menuLinks: [
16+
{ name: 'Introduction', link: '/intro' },
17+
{
18+
name: 'API Documentation',
19+
link: '/api-documentation'
20+
},
21+
{ name: 'Quickstart', link: '/quickstart' },
22+
{ name: 'Contributors Guide', link: '/contributors-guide' },
23+
{ name: 'Testing', link: '/tests'},
24+
{ name: 'Ethsimulatev1 notes', link: '/ethsimulatev1-notes' },
25+
],
26+
footerLinks: [
27+
{
28+
name: 'OpenRPC',
29+
link: 'https://open-rpc.org'
30+
}
31+
]
32+
},
33+
plugins: [
34+
{
35+
resolve: 'gatsby-plugin-mdx',
36+
options: {
37+
extensions: ['.mdx', '.md'],
38+
gatsbyRemarkPlugins: [
39+
{
40+
resolve: 'gatsby-remark-autolink-headers',
41+
options: {
42+
icon: false,
43+
},
44+
},
45+
],
46+
mdxOptions: {
47+
remarkPlugins: [remarkGfm],
48+
},
49+
},
50+
},
51+
"gatsby-openrpc-theme",
52+
{
53+
resolve: 'gatsby-plugin-manifest',
54+
options: {
55+
name: 'pristine-site',
56+
short_name: 'pristine-site',
57+
start_url: '/execution-apis/',
58+
background_color: 'transparent',
59+
theme_color: '#3f51b5',
60+
display: 'minimal-ui',
61+
icon: 'src/images/gatsby-icon.png', // This path is relative to the root of the site.
62+
},
63+
},
64+
"gatsby-plugin-image",
65+
"gatsby-plugin-sharp",
66+
"gatsby-transformer-sharp",
67+
{
68+
resolve: "gatsby-source-filesystem",
69+
options: {
70+
name: "images",
71+
path: __dirname + '/src/images',
72+
},
73+
},
74+
{
75+
resolve: "gatsby-source-filesystem",
76+
options: {
77+
name: "docs",
78+
path: __dirname + '/../../../docs/reference',
79+
},
80+
},
81+
],
82+
}

docs/reference/making-changes.md renamed to docs/reference/contributors-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,4 +115,4 @@ others don't.
115115

116116
[exec-apis]: https://github.com/ethereum/execution-apis
117117
[pm]: https://github.com/ethereum/pm
118-
[test-gen]: https://github.com/ethereum/execution-apis/blob/main/tests/README.md
118+
[test-gen]: https://github.com/ethereum/execution-apis/blob/main/tests/README.md

docs/ethsimulatev1-notes.md renamed to docs/reference/ethsimulatev1-notes.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Unlike `eth_call`, `eth_simulateV1`'s calls are conducted inside blocks. We don'
3232

3333
## Default values for transactions
3434
As eth_simulate is an extension to `eth_call` we want to enable the nice user experience that the user does not need to provide all required values for a transaction. We are assuming following defaults if the variable is not provided by the user:
35+
3536
| parameter name | description |
3637
-----------------|-----------------------
3738
| type | `0x2` |

docs/reference/intro.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
---
2-
slug: /
3-
sidebar_position: 1
4-
---
51

62
# Introduction
73

@@ -40,4 +36,4 @@ Each category serves specific purposes and provides different functionalities fo
4036

4137
## Contributing
4238

43-
We welcome contributions to improve this documentation. Please see our [Making Changes](/reference/making-changes) guide for more information on how to contribute.
39+
We welcome contributions to improve this documentation. Please see our [Contributors Guide](/reference/contributors-guide) guide for more information on how to contribute.

0 commit comments

Comments
 (0)