feat: update docs
This commit is contained in:
parent
07a1aad784
commit
778bb77d6a
@ -39,7 +39,11 @@ export default {
|
||||
title: 'Getting started',
|
||||
'title.zh-CN': '快速开始',
|
||||
type: 'group',
|
||||
children: ['/development/index', '/development/your-fisrt-plugin'],
|
||||
children: [
|
||||
'/development/index',
|
||||
'/development/your-fisrt-plugin',
|
||||
'/development/learning-guide',
|
||||
],
|
||||
},
|
||||
{
|
||||
title: 'Extension Guides',
|
||||
|
@ -1,30 +1,117 @@
|
||||
# 学习路线指南
|
||||
|
||||
## 1. 从安装 NocoBase 开始
|
||||
## 第一步:从安装运行 NocoBase 开始
|
||||
|
||||
NocoBase 支持三种安装方式:
|
||||
主要的命令包括:
|
||||
|
||||
- Docker 安装(推荐)
|
||||
- create-nocobase-app 安装
|
||||
- Git 源码安装
|
||||
|
||||
## 2. 了解 NocoBase CLI
|
||||
|
||||
NocoBase CLI 旨在帮助你开发、构建和部署 NocoBase 应用。
|
||||
|
||||
最常用的命令包括:
|
||||
|
||||
- `yarn nocobase install`
|
||||
- `yarn nocobase upgrade`
|
||||
- `yarn dev`
|
||||
- `yarn test`
|
||||
- `yarn start`
|
||||
- `yarn build`
|
||||
- `yarn pm <method> <plugin>`
|
||||
|
||||
## 3. 了解插件管理器
|
||||
下载
|
||||
|
||||
```bash
|
||||
yarn pm <method> <plugin>
|
||||
yarn create/git clone
|
||||
yarn install
|
||||
```
|
||||
|
||||
安装
|
||||
|
||||
```bash
|
||||
yarn nocobase install
|
||||
```
|
||||
|
||||
运行
|
||||
|
||||
```bash
|
||||
# for development
|
||||
yarn dev
|
||||
|
||||
# for production
|
||||
yarn build
|
||||
yarn start
|
||||
```
|
||||
|
||||
## 第二步:了解 NocoBase 平台提供的核心功能
|
||||
|
||||
主要的三部分包括:
|
||||
|
||||
- UI 设计器:主要包括区块、字段和操作
|
||||
- 插件管理器:功能需求扩展
|
||||
- 配置中心:已激活插件提供的配置功能
|
||||
|
||||
## 第三步:进一步了解插件管理器的使用
|
||||
|
||||
NocoBase 提供了简易的插件管理器界面,但是在界面上只能处理本地插件的 enable、disable 和 remove,完整的操作需要通过 CLI
|
||||
|
||||
```bash
|
||||
# 创建插件
|
||||
yarn pm create hello
|
||||
# 注册插件
|
||||
yarn pm add hello
|
||||
# 激活插件
|
||||
yarn pm enable hello
|
||||
# 禁用插件
|
||||
yarn pm disable hello
|
||||
# 删除插件
|
||||
yarn pm remove hello
|
||||
```
|
||||
|
||||
更多插件示例,查看 packages/samples,通过 samples 插件能够了解插件的基本用法,就可以进一步开发插件了。
|
||||
|
||||
## 第四步:开发新插件,了解模块分布
|
||||
|
||||
[编写第一个插件](/development/your-fisrt-plugin) 章节,虽然简单的讲述了插件的主要开发流程,但是为了更快速的介入插件细节,你可能需要进一步了解 NocoBase 框架的模块分布:
|
||||
|
||||
- Server
|
||||
- Collections & Fields:主要用于系统表配置,业务表建议在「配置中心 - 数据表配置」里配置
|
||||
- Resources & Actions:主要用于扩展 Action API
|
||||
- Middleware:中间件
|
||||
- Events:事件
|
||||
- I18n:服务端国际化
|
||||
- Client
|
||||
- UI Schema Designer:页面设计器
|
||||
- UI Router:有自定义页面需求时
|
||||
- Settings Center:为插件提供配置页面
|
||||
- I18n:客户端国际化
|
||||
- Devtools
|
||||
- Commands:自定义命令行
|
||||
- Migrations:迁移脚本
|
||||
|
||||
## 第五步:查阅各模块主要 API
|
||||
|
||||
查看各模块的 packages/samples,进一步了解模块主要 API 的用法
|
||||
|
||||
- Server
|
||||
- Collections & Fields
|
||||
- db.collection
|
||||
- db.import
|
||||
- Resources & Actions
|
||||
- app.resourcer.define
|
||||
- app.resourcer.registerActions
|
||||
- Middleware
|
||||
- app.use
|
||||
- app.acl.use
|
||||
- app.resourcer.use
|
||||
- Events
|
||||
- app.on
|
||||
- app.db.on
|
||||
- I18n
|
||||
- app.i18n
|
||||
- ctx.i18n
|
||||
- Client
|
||||
- UI Schema Designer
|
||||
- SchemaComponent
|
||||
- SchemaInitializer
|
||||
- SchemaSettings
|
||||
- UI Router
|
||||
- RouteSwitchProvider
|
||||
- RouteSwitch
|
||||
- Settings Center
|
||||
- SettingsCenterProvider
|
||||
- I18n
|
||||
- app.i18n
|
||||
- useTranslation
|
||||
- Devtools
|
||||
- Commands
|
||||
- app.command
|
||||
- app.findCommand
|
||||
- Migrations
|
||||
- app.db.addMigration
|
||||
- app.db.addMigrations
|
||||
|
@ -2,19 +2,10 @@
|
||||
|
||||
在此之前,需要先安装好 NocoBase:
|
||||
|
||||
- create-nocobase-app 安装
|
||||
- Git 源码安装
|
||||
- [create-nocobase-app 安装](/getting-started/installation/create-nocobase-app)
|
||||
- [Git 源码安装](/getting-started/installation/git-clone)
|
||||
|
||||
相关安装、启动命令如下:
|
||||
|
||||
```bash
|
||||
cd my-nocobase-app
|
||||
yarn install
|
||||
yarn nocobase install
|
||||
yarn dev
|
||||
```
|
||||
|
||||
插件开发和调试,需要在开发环境并通过 `yarn dev` 启动。做好准备之后,我们就可以开始 NocoBase 的插件开发之旅了。
|
||||
安装好 NocoBase 之后,我们就可以开始插件开发之旅了。
|
||||
|
||||
## 创建插件
|
||||
|
||||
@ -91,6 +82,17 @@ yarn pm add hello
|
||||
yarn pm enable hello
|
||||
```
|
||||
|
||||
## 启动应用
|
||||
|
||||
```bash
|
||||
# for development
|
||||
yarn dev
|
||||
|
||||
# for production
|
||||
yarn build
|
||||
yarn start
|
||||
```
|
||||
|
||||
## 体验插件功能
|
||||
|
||||
访问地址 http://localhost:13000/api/hello:get
|
||||
|
Loading…
Reference in New Issue
Block a user