Skip to content

open-rpc/tools

Repository files navigation

OpenRPC Tools

OpenRPC Logo

A collection of developer tools for the OpenRPC ecosystem.

Conventional Commits License

Table of Contents

Overview

OpenRPC Tools is a monorepo containing various tools and utilities for working with the OpenRPC specification. These tools help developers create, validate, document, and interact with JSON-RPC APIs using the OpenRPC standard.

The OpenRPC specification provides a way to describe JSON-RPC 2.0 APIs in a machine-readable format, similar to how OpenAPI/Swagger works for REST APIs. This repository contains React components, utilities, and applications that make working with OpenRPC documents easier.

Packages

Package Description Link
@open-rpc/inspector A tool to create, modify and execute JSON-RPC requests README
@open-rpc/docs-react React component for rendering OpenRPC documentation README
@open-rpc/extensions Collection of OpenRPC Specification Extensions README
@open-rpc/playground Editor and live-preview for OpenRPC documents README
@open-rpc/logs-react React component for displaying JSON-RPC logs README
@open-rpc/json-schema-to-react-tree React component to visually display JSON Schemas README
@open-rpc/monaco-editor-react Monaco editor with OpenRPC support README

Installation

This project requires Node.js version 20 or higher.

To install all dependencies and build all packages:

npm install
npm run build

Development

This repository is structured as a monorepo using npm workspaces. To work on a specific package:

cd packages/<package-name>
npm install
npm start

For testing:

# Run tests for all packages
npm test

# Run tests for a specific package
cd packages/<package-name>
npm test

Building Packages

To build an individual package, navigate to the package directory and run the build:package script:

# Navigate to the package directory
cd packages/<package-name>

# Build the package
npm run build:package

The build process respects dependencies between packages, so if you build a package that depends on another package, the dependency will be built first.

Version Management

This project uses Changesets to manage versions and generate changelogs.

Creating a Changeset

When making changes that should result in a version bump, create a changeset using the npm script:

npm run changeset

This will prompt you to:

  1. Select the packages that have changed
  2. Choose the semver increment (major, minor, patch)
  3. Provide a description of the changes

The changeset will be added to the .changeset directory and should be committed with your changes.

If your PR doesn't require a version change, you can create an empty changeset:

npm run changeset -- --empty

This creates a special changeset that satisfies the PR validation check without triggering a version bump.

Automated Versioning and Publishing

The versioning and publishing process is handled automatically by GitHub Actions:

  1. When a PR is opened, the CI checks for the presence of a changeset
  2. When a PR is merged to main, the changesets/action:
    • Updates package versions based on the changesets
    • Generates changelog entries
    • Publishes packages to npm

For more details on the CI/CD process, see the workflow files in the .github/workflows directory.

Contributing

We welcome contributions to any of the packages in this repository! Please read the following documents before contributing:

When contributing code changes, please also include a changeset describing your changes as described in the Version Management section.

Changelog

This project uses a semantic-release style changelog generator. For more information on how changelogs are generated and maintained, see CHANGELOG_GUIDE.md.

License

Apache 2.0

Resources