Skip to content
Open
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
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
.PHONY: default build serve lint clean

default: build serve

build:
npx swagger-cli bundle ./beacon-node-oapi.yaml -r -t yaml -o ./deploy/beacon-node-oapi.yaml
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we wanna copy files like index.html here as well?

- name: Prepare deploy directory
run: |
mkdir ./deploy
cp -r dist ./deploy
cp -r assets ./deploy
cp index.html ./deploy


serve:
npx http-server -c-1 deploy -o "/?urls.primaryName=dev"

lint:
npx @redocly/cli lint beacon-node-oapi.yaml

clean:
rm -f ./deploy/beacon-node-oapi.yaml
41 changes: 16 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,26 @@ to perform validator related tasks, called "duties", on the beacon chain.

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

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

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

##### NodeJs
```
npm install simplehttpserver -g
```bash
# Build and serve the spec (default)
make

# Build only
make build

# OR
# Serve only (after building)
make serve

yarn global add simplehttpserver
# Run linting
make lint

simplehttpserver
# Clean build artifacts
make clean
```
And api spec will render on [http://localhost:8000](http://localhost:8000).

### Usage

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

To run lint locally, install linter with
```
npm install -g @redocly/cli
# OR
yarn global add @redocly/cli
```
and run lint with
To run lint locally, run
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
To run lint locally, run
To run lint locally

```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
```
```bash

redocly lint beacon-node-oapi.yaml
make lint
```

## Releasing
Expand Down