Skip to content
This repository has been archived by the owner on Oct 28, 2020. It is now read-only.

React application to build documentation from OpenRPC schema

License

Notifications You must be signed in to change notification settings

avto-dev/open-rpc-docs-builder-docker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

OpenRPC documentation builder

Build Build Test Status Docker Pulls Issues License

This tool build documentation from OpenRPC schema. It based on OpenRPC docs-react component and create-react-app.

You must put open-rpc schema into /app/src/schema/openrpc.json file, then run yarn run build.

Also you can put any additional files into public directory, all files from public will be moved into build directory with built documentation.

Environment variables

Tool support all environment variables from create-react-app

Additional variables

Name Possible values Default Description
REACT_APP_THEME dark, light light Application theme

Examples

All supported docker tags can be found here.

Build using volumes

Run into your shell (your open-rpc schema must be located in ./path/to/your/openrpc.json):

$ mkdir ./public # create directory for generated assets

$ docker run \
    --rm \
    --user "$(id -u):$(id -g)" \
    -v $(pwd)/path/to/your/openrpc.json:/app/src/schema/openrpc.json:ro \
    -v $(pwd)/public:/app/build:rw \
    avtodev/open-rpc-docs-builder:1.3 \
    yarn run build

And then watch into ./public directory.

Docker usage example

FROM avtodev/open-rpc-docs-builder:1.3 AS builder

# Copy openrpc.json file into `/app/src/schemas` derictory
COPY --chown=node ./openrpc.json /app/src/schemas/openrpc.json
# You can copy additional json-schema files into public directory
COPY --chown=node ./schemas/json-schema /app/public/schema

RUN yarn run build

# Optional you can copy built documentation into any other container (eg.: nginx)
FROM alpine:latest

COPY --from=builder /app/build /public

Releasing

New versions publishing is very simple - just update dependencies version(s) in ./package.json file (or make any another changes) and "publish" new release using repo releases page. This action will trigger docker images (re)building (eg.: release v1.2.3 will create or update docker images with tags 1.2 and 1.2.3).

Release version (and git tag, of course) MUST starts with v prefix (eg.: v0.0.1 or v1.2.3) and follows semantic versioning rules

Do not forget to update docker image version tag in "usage example" above

License

MIT. Use anywhere for your pleasure.