diff --git a/.gitignore b/.gitignore index 22fbd73..af18188 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ node_modules dist .cache .temp +.DS_Store diff --git a/docs/README.md b/docs/README.md index e87c109..2e3b4ca 100644 --- a/docs/README.md +++ b/docs/README.md @@ -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' } diff --git a/docs/docs/api/client-api.md b/docs/docs/api/client-api.md index 142af03..9c9c414 100644 --- a/docs/docs/api/client-api.md +++ b/docs/docs/api/client-api.md @@ -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' diff --git a/docs/docs/api/node-api.md b/docs/docs/api/node-api.md index 657854e..30e53a5 100644 --- a/docs/docs/api/node-api.md +++ b/docs/docs/api/node-api.md @@ -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,后面会拓展 react、servlet、web 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!!') }) }, }) @@ -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' diff --git a/docs/docs/guide/getting-started.md b/docs/docs/guide/getting-started.md index efe7a70..690451d 100644 --- a/docs/docs/guide/getting-started.md +++ b/docs/docs/guide/getting-started.md @@ -1,8 +1,8 @@ --- -title: 快速开始 +title: Getting Started --- -## 依赖环境 +## Environment - [Node.js v18 & v20+](https://nodejs.org/en/) @@ -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 diff --git a/docs/docs/guide/images/revili-flow-svg.png b/docs/docs/guide/images/revili-flow-svg.png new file mode 100644 index 0000000..f11cf65 Binary files /dev/null and b/docs/docs/guide/images/revili-flow-svg.png differ diff --git a/docs/docs/guide/images/revili-flow-svg.svg b/docs/docs/guide/images/revili-flow-svg.svg deleted file mode 100644 index 4fefb87..0000000 --- a/docs/docs/guide/images/revili-flow-svg.svg +++ /dev/null @@ -1 +0,0 @@ -开始解析 reviliConfig注册 reviliConfig注册 start 命令执行 start 命令注册 kit 中的页面注册 kit 中的 server function(动态注册 Vite 插件)启动 GUI(动态注册 Vite 插件)注册 kit 中的命令解析 userConfig解析 plugins缓存页面组件结束模块化节点流程节点流程子节点 diff --git a/docs/docs/guide/introduction.md b/docs/docs/guide/introduction.md index 3913ca6..ec819d8 100644 --- a/docs/docs/guide/introduction.md +++ b/docs/docs/guide/introduction.md @@ -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. - \ No newline at end of file +## Workflow + + \ No newline at end of file diff --git a/docs/docs/guide/kit.md b/docs/docs/guide/kit.md index 7ba07c5..7fa1fc8 100644 --- a/docs/docs/guide/kit.md +++ b/docs/docs/guide/kit.md @@ -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 @@ -37,7 +30,7 @@ npm install revili@next -g revili create:kit ``` -### 开发 +### Development 套件的开发分为两部分,**自定义命令** 和 **GUI**。 @@ -224,7 +217,7 @@ npm run build npm run publish ``` -## 本地套件 +## Local Kit ### 初始化 diff --git a/docs/zh/README.md b/docs/zh/README.md index 8859470..6a0e37b 100644 --- a/docs/zh/README.md +++ b/docs/zh/README.md @@ -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' } diff --git a/docs/zh/docs/api/node-api.md b/docs/zh/docs/api/node-api.md index 657854e..619d80c 100644 --- a/docs/zh/docs/api/node-api.md +++ b/docs/zh/docs/api/node-api.md @@ -5,7 +5,7 @@ title: Node API ## defineKit - 类型:`(options: KitOptions) => Kit` -- 描述:`Revili` 是一款脚手架的模块化方案,可以通过 `defineKit` 生成一个插件实例,对脚手架进行能力增强。 +- 描述:对套件进行声明,用来注册自定义命令和 GUI 的本地通信服务等。 - 案例: ```ts import { defineKit, useServerSocket, type Kit } from 'revili/node' diff --git a/docs/zh/docs/guide/.DS_Store b/docs/zh/docs/guide/.DS_Store index c76ca83..99dc5cd 100644 Binary files a/docs/zh/docs/guide/.DS_Store and b/docs/zh/docs/guide/.DS_Store differ diff --git a/docs/zh/docs/guide/getting-started.md b/docs/zh/docs/guide/getting-started.md index efe7a70..2dc6b27 100644 --- a/docs/zh/docs/guide/getting-started.md +++ b/docs/zh/docs/guide/getting-started.md @@ -6,24 +6,24 @@ 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 @@ -31,7 +31,7 @@ revili add @revili/revili-kit-demo ### remove -Remove the kit. +移除套件。 ```bash revili remove @revili/revili-kit-demo @@ -39,7 +39,7 @@ revili remove @revili/revili-kit-demo ### use -Switch the kit. +激活套件。 ```bash revili use @revili/revili-kit-demo @@ -47,7 +47,7 @@ revili use @revili/revili-kit-demo ### start -Start the local services provided by the kit. +启动套件提供的 GUI 服务。 ```bash revili use @revili/revili-kit-demo @@ -56,11 +56,11 @@ revili start ### ls/list -Check the added kits. +列出安装过的套件。 ```bash revili ls -# or +# 或者 revili list ``` diff --git a/docs/zh/docs/guide/images/revili-flow-svg.png b/docs/zh/docs/guide/images/revili-flow-svg.png new file mode 100644 index 0000000..f11cf65 Binary files /dev/null and b/docs/zh/docs/guide/images/revili-flow-svg.png differ diff --git a/docs/zh/docs/guide/images/revili-flow-svg.svg b/docs/zh/docs/guide/images/revili-flow-svg.svg deleted file mode 100644 index 4fefb87..0000000 --- a/docs/zh/docs/guide/images/revili-flow-svg.svg +++ /dev/null @@ -1 +0,0 @@ -开始解析 reviliConfig注册 reviliConfig注册 start 命令执行 start 命令注册 kit 中的页面注册 kit 中的 server function(动态注册 Vite 插件)启动 GUI(动态注册 Vite 插件)注册 kit 中的命令解析 userConfig解析 plugins缓存页面组件结束模块化节点流程节点流程子节点 diff --git a/docs/zh/docs/guide/introduction.md b/docs/zh/docs/guide/introduction.md index 3913ca6..ef927ca 100644 --- a/docs/zh/docs/guide/introduction.md +++ b/docs/zh/docs/guide/introduction.md @@ -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。两者本身是独立的,不相互依赖,可以根据用户习惯只开发其中一种能力;同时也可以作为相通功能的不同表现形式,让用户根据自己的习惯或兴趣去选择使用方式。 - \ No newline at end of file +## 工作流程 + + \ No newline at end of file diff --git a/docs/zh/docs/guide/kit.md b/docs/zh/docs/guide/kit.md index 7ba07c5..84b1e48 100644 --- a/docs/zh/docs/guide/kit.md +++ b/docs/zh/docs/guide/kit.md @@ -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,请参考 **标准套件**;如果您的套件仅用于自己的项目中,请参考 **本地套件**。 ::: diff --git a/scripts/docs-deploy.sh b/scripts/docs-deploy.sh index 5ef86bf..4c963ea 100644 --- a/scripts/docs-deploy.sh +++ b/scripts/docs-deploy.sh @@ -1,4 +1,5 @@ cd docs +pnpm install pnpm build cd .vuepress/dist