Skip to content

Commit

Permalink
docs: update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
recoluan committed May 21, 2024
1 parent af11f5e commit e049d8c
Show file tree
Hide file tree
Showing 18 changed files with 54 additions and 64 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ node_modules
dist
.cache
.temp
.DS_Store
2 changes: 1 addition & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bannerBrand:
bgImage: '/bg.svg'
title: Revili
description: A command and GUI integration tool based on vite.
tagline: Revili allows you to expand functionality through kit. Kit is a fully functional revili extension package, that includes commands, client and server of GUI. Kit are independent of each other.
tagline: Revili can also be referred to as a Cli tool for quickly assembling Cli tool. Revili combines a series of related capabilities into a capability set through `Kit`, and each kit is independent of each other.
buttons:
- { text: Guide, link: '/docs/guide/introduction.html' }
- { text: Getting Started, link: '/docs/guide/getting-started.html', type: 'plain' }
Expand Down
8 changes: 4 additions & 4 deletions docs/docs/api/client-api.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
---
title: 客户端 API
title: Client API
---

## useClientSocket

- 类型:`{ on: (event: string, handler: (data: any) => void) => void; send: (event: string, data: any) => void; }`
- 描述:客户端与服务端的通信 API。
- 案例:
- Type: `{ on: (event: string, handler: (data: any) => void) => void; send: (event: string, data: any) => void; }`
- Description: The client communicates with the server.
- Example:

```ts
import { useClientSocket } from 'revili/client'
Expand Down
24 changes: 12 additions & 12 deletions docs/docs/api/node-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,31 @@ title: Node API

## defineKit

- 类型:`(options: KitOptions) => Kit`
- 描述:`Revili` 是一款脚手架的模块化方案,可以通过 `defineKit` 生成一个插件实例,对脚手架进行能力增强。
- 案例:
- Type: `(options: KitOptions) => Kit`
- Description: Declare the suite to register custom commands and GUI's local communication service, etc.
- Example:
```ts
import { defineKit, useServerSocket, type Kit } from 'revili/node'

const demoKit: Kit = defineKit({
// 插件名称
// The name of the kit
name: 'revili-kit-demo',

// GUI 客户端开发框架,默认 vue,后面会拓展 reactservletweb component
// The GUI client development framework, default vue, and will expand react, servlet, web component, etc.
webFramework: 'vue'

// 参考 https://vitejs.dev/config/
// Refer to https://vitejs.dev/config/
viteOptions: {}

// 注册可以和 GUI 通信的服务
// Register for services that can communicate with GUI
registerService(server) {
// ...
},

// 注册 command 命令
// Register the command
registerCommand({ program }) {
program.command('test').action(() => {
console.log('你触发了 test 命令')
console.log('You triggered the test command!')
})
},
})
Expand All @@ -50,9 +50,9 @@ interface KitOptions {

## useServerSocket

- 类型:`(server: ViteDevServer) => WebSocketServer | null`
- 描述:服务端与客户端的通信 API。
- 案例:
- Type: `(server: ViteDevServer) => WebSocketServer | null`
- Description: The server communicates with the client.
- Example:
```ts
import {defineKit, useServerSocket, type Kit} from 'revili/node'

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/guide/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: 快速开始
title: Getting Started
---

## 依赖环境
## Environment

- [Node.js v18 & v20+](https://nodejs.org/en/)

Expand All @@ -12,7 +12,7 @@ title: 快速开始
npm install revili@next -g
revili add @revili/revili-kit-demo@next

# command 'start' is registered from revili
# command 'start' is build-in from revili
revili start

# command 'path' is registered from @revili/revili-kit-demo
Expand Down
Binary file added docs/docs/guide/images/revili-flow-svg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/docs/guide/images/revili-flow-svg.svg

This file was deleted.

14 changes: 8 additions & 6 deletions docs/docs/guide/introduction.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
---
title: 介绍
title: Introduce
---

## 简介
## Introduce

Revili is a command and GUI integration tool based on vite.
`Revili` is a command and GUI integration tool based on `Vite`, which can also be referred to as a Cli tool for quickly assembling Cli tool.

Revili allows you to expand functionality through kit. Kit is a fully functional revili extension package, that includes commands, client and server of GUI. Kit are independent of each other.
`Revili` combines a series of related capabilities into a capability set through `Kit`, and each kit is independent of each other. Therefore, the original intention of `Revili` is to enable web front-end developers to crystallize their experience and ideas into standardized capabilities (development kits) and share these capabilities (publish kits).

## 脚手架工作流程
The capabilities contained in a Kit are divided into two parts: custom commands and GUI. The two are independent and do not rely on each other, allowing users to only develop one of them based on their habits. At the same time, they can also serve as different manifestations of the same functionality, allowing users to choose the way they use based on their habits or interests.

<img src="./images/revili-flow-svg.svg" width="500" />
## Workflow

<img src="./images/revili-flow-svg.png" width="500" />
19 changes: 6 additions & 13 deletions docs/docs/guide/kit.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
---
title: 开发套件
title: Develop Kit
---

::: tip
Revili 允许您通过套件扩展功能。套件 KIT 是一个功能齐全的 Revili 扩展包,包括命令、客户端和服务器的图形用户界面。套件 KIT是相互独立的。

**套件示例:**
1. [revili-kit-demo-vue](https://github.com/revilijs/revili-kit-demo-vue)
If your kit is to be published to npm, please refer to **Standard Kit**; if your kit is only used in your own project, please refer to **Local Kit**.
:::

::: warning
如果您的套件要发布到 npm,请参考 **标准套件**;如果您的套件仅用于自己的项目中,请参考 **本地套件**
:::
## Standard Kit

## 标准套件

### 初始化
### Initialization

```
├── dist
Expand All @@ -37,7 +30,7 @@ npm install revili@next -g
revili create:kit
```

### 开发
### Development

套件的开发分为两部分,**自定义命令****GUI**

Expand Down Expand Up @@ -224,7 +217,7 @@ npm run build
npm run publish
```

## 本地套件
## Local Kit

### 初始化

Expand Down
2 changes: 1 addition & 1 deletion docs/zh/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bannerBrand:
bgImage: '/bg.svg'
title: Revili
description: 一款基于 Vite 的脚手架模块化解决方案。
tagline: Revili 允许您通过套件扩展功能。套件 KIT 是一个功能齐全的 Revili 扩展包,包括命令、客户端和服务器的图形用户界面。套件 KIT是相互独立的
tagline: Revili 也可以称之为快速组装脚手架的脚手架。Revili 通过套件 Kit 将一系列相关的能力组合在一起,形成一个能力集合,每个套件是相互独立的
buttons:
- { text: 指南, link: '/docs/guide/introduction.html' }
- { text: 快速开始, link: '/docs/guide/getting-started.html', type: 'plain' }
Expand Down
2 changes: 1 addition & 1 deletion docs/zh/docs/api/node-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Node API
## defineKit

- 类型:`(options: KitOptions) => Kit`
- 描述:`Revili` 是一款脚手架的模块化方案,可以通过 `defineKit` 生成一个插件实例,对脚手架进行能力增强
- 描述:对套件进行声明,用来注册自定义命令和 GUI 的本地通信服务等
- 案例:
```ts
import { defineKit, useServerSocket, type Kit } from 'revili/node'
Expand Down
Binary file modified docs/zh/docs/guide/.DS_Store
Binary file not shown.
20 changes: 10 additions & 10 deletions docs/zh/docs/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,48 @@ title: 快速开始

- [Node.js v18 & v20+](https://nodejs.org/en/)

## Try
## 尝试

```bash
npm install revili@next -g
revili add @revili/revili-kit-demo@next

# command 'start' is registered from revili
# 'start' 命令是 revili 内置的
revili start

# command 'path' is registered from @revili/revili-kit-demo
# 'path' 命令是从套件 @revili/revili-kit-demo
revili path
```

## Built-in commands
## 内置命令

### add

Install the kit.
安装并激活套件。

```bash
revili add @revili/revili-kit-demo
```

### remove

Remove the kit.
移除套件。

```bash
revili remove @revili/revili-kit-demo
```

### use

Switch the kit.
激活套件。

```bash
revili use @revili/revili-kit-demo
```

### start

Start the local services provided by the kit.
启动套件提供的 GUI 服务。

```bash
revili use @revili/revili-kit-demo
Expand All @@ -56,11 +56,11 @@ revili start

### ls/list

Check the added kits.
列出安装过的套件。

```bash
revili ls

# or
# 或者
revili list
```
Binary file added docs/zh/docs/guide/images/revili-flow-svg.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/zh/docs/guide/images/revili-flow-svg.svg

This file was deleted.

10 changes: 6 additions & 4 deletions docs/zh/docs/guide/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ title: 介绍

## 简介

Revili is a command and GUI integration tool based on vite.
`Revili` 是一个基于 `Vite` 的命令和图形用户界面集成工具,也可以称之为快速组装脚手架的脚手架。

Revili allows you to expand functionality through kit. Kit is a fully functional revili extension package, that includes commands, client and server of GUI. Kit are independent of each other.
`Revili` 通过套件 Kit 将一系列相关的能力组合在一起,形成一个能力集合,每个套件是相互独立的。所以 `Revili` 的初衷就是让 Web 前端开发者将自己的经验和想法沉淀成规范的能力(开发套件),并且还可以将这些能力分享出去(发布套件)。

## 脚手架工作流程
套件 Kit 包含的能力分为两部分,自定义命令 和 GUI。两者本身是独立的,不相互依赖,可以根据用户习惯只开发其中一种能力;同时也可以作为相通功能的不同表现形式,让用户根据自己的习惯或兴趣去选择使用方式。

<img src="./images/revili-flow-svg.svg" width="500" />
## 工作流程

<img src="./images/revili-flow-svg.png" width="700" />
7 changes: 0 additions & 7 deletions docs/zh/docs/guide/kit.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ title: 开发套件
---

::: tip
Revili 允许您通过套件扩展功能。套件 KIT 是一个功能齐全的 Revili 扩展包,包括命令、客户端和服务器的图形用户界面。套件 KIT是相互独立的。

**套件示例:**
1. [revili-kit-demo-vue](https://github.com/revilijs/revili-kit-demo-vue)
:::

::: warning
如果您的套件要发布到 npm,请参考 **标准套件**;如果您的套件仅用于自己的项目中,请参考 **本地套件**
:::

Expand Down
1 change: 1 addition & 0 deletions scripts/docs-deploy.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
cd docs
pnpm install
pnpm build
cd .vuepress/dist

Expand Down

0 comments on commit e049d8c

Please sign in to comment.