@0x/sra-spec 中文文档教程

发布于 3年前 浏览 26 项目主页 更新于 3年前

@0x/sra-spec

包含标准中继 API OpenAPI 规范

该软件包同时分发了 javascript 对象版本和 json 版本。

可以在此处找到带有 API 的已部署 ReDoc 静态站点 http://sra-spec.s3-website-us-east- 1.amazonaws.com/。

Usage

import { api } from '@0x/sra-spec';

Installation

yarn install

Development

您可以启动一个开发服务器,该服务器将为 ReDoc 文档实例提供服务。 它使用 lib/ 中的 api.json 文件(您必须至少使用 yarn buildyarn build-json 构建一次),它基于从 src 导出的 api 对象。

yarn watch_without_deps

该进程将监视更改,但不会热重载,因此您必须刷新页面才能看到更改。

Contributing

我们欢迎来自更广泛社区的改进和修复! 要报告此包中的错误,请在此存储库中创建一个问题。

请在开始之前阅读我们的贡献指南

Install dependencies

如果您没有启用 yarn workspaces (Yarn < v1.0) - 启用它们:

yarn config set workspaces-experimental true

然后安装依赖

yarn install

Build

项 要构建此包和它依赖的所有其他 monorepo 包,请从 monorepo 根目录运行以下命令:

PKG=@0x/sra-spec yarn build

或持续重建关于更改:

PKG=@0x/sra-spec yarn watch

Static Site

我们还在 S3 上托管文档的静态 HTML 版本,以便于分享。

要构建和部署站点,请运行

yarn deploy-site

注意:在部署站点时,它会说该站点可通过不存在的 URL 访问。 请忽略并使用上面的(现已更新)URL。

Clean

yarn clean

Lint

yarn lint

Run Tests

yarn test

@0x/sra-spec

Contains the Standard Relayer API OpenAPI Spec.

The package distributes both a javascript object version and a json version.

A deployed ReDoc static site with the API can be found here http://sra-spec.s3-website-us-east-1.amazonaws.com/.

Usage

import { api } from '@0x/sra-spec';

Installation

yarn install

Development

You can start a development server that will serve a ReDoc documentation instance. It uses the api.json file from lib/ (you must have built at least once with yarn build or yarn build-json) that is based on the api object exported from src.

yarn watch_without_deps

The process will watch for changes, but will not hot-reload so you must refresh the page to see the changes.

Contributing

We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository.

Please read our contribution guidelines before getting started.

Install dependencies

If you don't have yarn workspaces enabled (Yarn < v1.0) - enable them:

yarn config set workspaces-experimental true

Then install dependencies

yarn install

Build

To build this package and all other monorepo packages that it depends on, run the following from the monorepo root directory:

PKG=@0x/sra-spec yarn build

Or continuously rebuild on change:

PKG=@0x/sra-spec yarn watch

Static Site

We also host a static HTML version of the docs on S3 for easy sharing.

To build and deploy the site run

yarn deploy-site

NOTE: On deploying the site, it will say the site is available at a non-existent URL. Please ignore and use the (now updated) URL above.

Clean

yarn clean

Lint

yarn lint

Run Tests

yarn test
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文