Skip to content

Commit c44a54d

Browse files
committed
Add Makefile for streamlined build process and update README with simplified instructions
1 parent 7d3a047 commit c44a54d

File tree

2 files changed

+31
-25
lines changed

2 files changed

+31
-25
lines changed

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.PHONY: default build serve lint clean
2+
3+
default: build serve
4+
5+
build:
6+
npx swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml
7+
8+
serve:
9+
npx http-server -c-1 deploy -o "/?urls.primaryName=dev"
10+
11+
lint:
12+
npx @redocly/cli lint beacon-node-oapi.yaml
13+
14+
clean:
15+
rm -f ./deploy/beacon-node-oapi.yaml

README.md

Lines changed: 16 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,27 +22,26 @@ to perform validator related tasks, called "duties", on the beacon chain.
2222

2323
The goal of this specification is to promote interoperability between various beacon node implementations.
2424

25-
## Render
26-
To render spec in browser you will need any http server to load `index.html` file
27-
in root of the repo.
25+
## Build and Serve Locally
2826

29-
##### Python
30-
```
31-
python -m http.server 8080
32-
```
33-
And api spec will render on [http://localhost:8080](http://localhost:8080).
27+
The easiest way to build and serve the API spec locally is using the provided Makefile:
3428

35-
##### NodeJs
36-
```
37-
npm install simplehttpserver -g
29+
```bash
30+
# Build and serve the spec (default)
31+
make
32+
33+
# Build only
34+
make build
3835

39-
# OR
36+
# Serve only (after building)
37+
make serve
4038

41-
yarn global add simplehttpserver
39+
# Run linting
40+
make lint
4241

43-
simplehttpserver
42+
# Clean build artifacts
43+
make clean
4444
```
45-
And api spec will render on [http://localhost:8000](http://localhost:8000).
4645

4746
### Usage
4847

@@ -53,17 +52,9 @@ Users may need to tick the "Disable Cache" box in their browser's developer tool
5352
## Contributing
5453
Api spec is checked for lint errors before merge.
5554

56-
To run lint locally, install linter with
57-
```
58-
npm install -g @redocly/cli
59-
60-
# OR
61-
62-
yarn global add @redocly/cli
63-
```
64-
and run lint with
55+
To run lint locally, run
6556
```
66-
redocly lint beacon-node-oapi.yaml
57+
make lint
6758
```
6859

6960
## Releasing

0 commit comments

Comments
 (0)