-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add a protocol for generate docs
- Loading branch information
Showing
6 changed files
with
110 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"name": "@nailyjs/rpc-docs-protocol", | ||
"type": "module", | ||
"version": "1.0.14", | ||
"description": "Json-RPC 2.0 protocol docs implementation.", | ||
"author": "Naily Zero <[email protected]> (https://naily.cc)", | ||
"keywords": [ | ||
"json-rpc", | ||
"rpc", | ||
"naily" | ||
], | ||
"exports": { | ||
".": { | ||
"types": "./dist/index.d.ts", | ||
"import": "./dist/index.js", | ||
"require": "./dist/index.cjs" | ||
} | ||
}, | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.js", | ||
"types": "./dist/index.d.ts", | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
"build": "tsup", | ||
"watch": "tsup -w" | ||
}, | ||
"dependencies": { | ||
"@nailyjs/rpc": "workspace:*", | ||
"@types/json-schema": "^7.0.15", | ||
"json-schema": "^0.4.0", | ||
"zod": "^3.23.8" | ||
}, | ||
"devDependencies": { | ||
"tsup": "^8.3.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import type { JSONSchema7 as JSONSchema } from 'json-schema' | ||
|
||
export interface JsonRpcParamsObject { | ||
description?: string | ||
name?: string | ||
required?: boolean | ||
schema?: JSONSchema | ||
} | ||
|
||
export interface JsonRpcResultObject { | ||
description?: string | ||
schema?: JSONSchema | ||
} | ||
|
||
export interface JsonRpcDocsObject { | ||
description?: string | ||
summary?: string | ||
tags?: string[] | ||
params: JsonRpcParamsObject[] | ||
result?: JsonRpcResultObject | ||
} | ||
|
||
export interface JsonRpcDoc { | ||
jsonrpc: '2.0' | ||
tags: string[] | ||
docs: Record<string, JsonRpcDocsObject> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2022", | ||
"module": "ES2022", | ||
"moduleResolution": "Bundler" | ||
}, | ||
"include": ["src"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { defineConfig } from 'tsup' | ||
|
||
export default defineConfig({ | ||
entry: { | ||
index: './src/index.ts', | ||
}, | ||
dts: true, | ||
sourcemap: true, | ||
clean: true, | ||
format: ['cjs', 'esm'], | ||
}) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.