docs: update doc
This commit is contained in:
parent
8cf1efb21f
commit
b876796cdf
7
.github/workflows/vercel.yml
vendored
7
.github/workflows/vercel.yml
vendored
@ -4,7 +4,6 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- feature/docs
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
deploy:
|
deploy:
|
||||||
@ -25,10 +24,10 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-node-
|
${{ runner.os }}-node-
|
||||||
|
|
||||||
- run: npm install
|
- run: yarn install
|
||||||
- run: npm run bootstrap
|
- run: yarn bootstrap
|
||||||
- run: echo "API_URL=${{ secrets.API_URL }}" >> .env
|
- run: echo "API_URL=${{ secrets.API_URL }}" >> .env
|
||||||
- run: npm run build-docs
|
- run: yarn build-docs
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
uses: amondnet/vercel-action@v19
|
uses: amondnet/vercel-action@v19
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
lib/
|
lib/
|
||||||
|
esm/
|
||||||
.env
|
.env
|
||||||
.DS_Store
|
.DS_Store
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
@ -4,68 +4,17 @@ order: 3
|
|||||||
|
|
||||||
# Installation and Startup Process
|
# Installation and Startup Process
|
||||||
|
|
||||||
## Installation
|
## app.init
|
||||||
|
|
||||||
```bash
|
- app.load()
|
||||||
yarn nocobase init
|
- db.sync()
|
||||||
```
|
- db.emitAsync('init')
|
||||||
|
|
||||||
- app.constructor()
|
## app.start
|
||||||
- app.parse()
|
|
||||||
- yarn nocobase init
|
|
||||||
Initialize the installation
|
|
||||||
- app.load()
|
|
||||||
Load the configuration
|
|
||||||
- app.exitAsync('beforeLoad')
|
|
||||||
Hook before all configurations are loaded
|
|
||||||
- app.pluginManager.load()
|
|
||||||
Load the configurations of all active plugins in order
|
|
||||||
- Load the configuration of plugin-collections
|
|
||||||
- Add app.on('init') listener
|
|
||||||
- db.getModel('collections').load()
|
|
||||||
Import the collections table configuration into db.table()
|
|
||||||
- app.db.sync({force: false})
|
|
||||||
Execute sync again to create the data table configured in the collections table
|
|
||||||
- app.exitAsync('afterLoad')
|
|
||||||
All hooks after the configuration is loaded
|
|
||||||
- app.db.sync({force: true})
|
|
||||||
Generate data tables, fields, indexes, etc. according to the configuration
|
|
||||||
- app.emitAsync('init')
|
|
||||||
Perform all init listeners, generally initialized data operations
|
|
||||||
- trigger the init event of plugin-collections and the data table is created
|
|
||||||
- app.stop()
|
|
||||||
End
|
|
||||||
|
|
||||||
## Startup
|
- app.load()
|
||||||
|
- db.emitAsync('start')
|
||||||
```bash
|
- Load the collections configuration in the database
|
||||||
yarn nocobase start --init --sync
|
- Load the pm configuration in the database
|
||||||
# --init for quick installation at startup
|
- Start the activated plugin
|
||||||
# --sync to quickly build or update tables when app.collection() is updated in the development environment
|
- app.listen()
|
||||||
```
|
|
||||||
|
|
||||||
- app.constructor()
|
|
||||||
- app.parse()
|
|
||||||
- yarn nocobase start
|
|
||||||
Initialize the installation
|
|
||||||
- app.load()
|
|
||||||
Load the configuration
|
|
||||||
- app.exitAsync('beforeLoad')
|
|
||||||
Hook before all configurations are loaded
|
|
||||||
- app.pluginManager.load()
|
|
||||||
Load the configurations of all active plugins in order
|
|
||||||
- Load the configuration of plugin-collections
|
|
||||||
- Add app.on('start') listener
|
|
||||||
- db.getModel('collections').load()
|
|
||||||
Import the collections table configuration into db.table(), no need for db.sync in the start process
|
|
||||||
- app.exitAsync('afterLoad')
|
|
||||||
All hooks after configuration loading
|
|
||||||
- app.db.sync({force: false})
|
|
||||||
yarn nocobase start --sync to quickly build or update tables when there are updates
|
|
||||||
yarn nocobase start --init quick init
|
|
||||||
- app.emitAsync('init')
|
|
||||||
yarn nocobase start --init shortcut init
|
|
||||||
- app.exitAsync('start')
|
|
||||||
Execute all start listeners, usually reading some necessary data from the data table
|
|
||||||
- app.listen()
|
|
||||||
Start the http server
|
|
||||||
|
@ -4,70 +4,18 @@ order: 3
|
|||||||
|
|
||||||
# 项目安装和启动流程
|
# 项目安装和启动流程
|
||||||
|
|
||||||
## 项目安装
|
## app.init
|
||||||
|
|
||||||
```bash
|
- app.load()
|
||||||
yarn nocobase init
|
- db.sync()
|
||||||
```
|
- db.emitAsync('init')
|
||||||
|
|
||||||
- app.constructor()
|
## app.start
|
||||||
- app.parse()
|
|
||||||
- yarn nocobase init
|
|
||||||
初始化安装
|
|
||||||
- app.load()
|
|
||||||
加载配置
|
|
||||||
- app.emitAsync('beforeLoad')
|
|
||||||
所有配置加载之前的钩子
|
|
||||||
- app.pluginManager.load()
|
|
||||||
按顺序载入所有激活的插件的配置
|
|
||||||
- 加载 plugin-collections 的配置
|
|
||||||
- 添加 app.on('init') 监听
|
|
||||||
- db.getModel('collections').load()
|
|
||||||
把 collections 表的配置都导入 db.table()
|
|
||||||
- app.db.sync({force: false})
|
|
||||||
再执行 sync,创建 collections 表里配置的数据表
|
|
||||||
- app.emitAsync('afterLoad')
|
|
||||||
所有配置加载之后的钩子
|
|
||||||
- app.db.sync({force: true})
|
|
||||||
根据配置生成数据表、字段、索引等
|
|
||||||
- app.emitAsync('init')
|
|
||||||
执行所有 init listeners,一般是初始化的数据操作
|
|
||||||
- 触发 plugin-collections 的 init 事件,数据表就创建好了
|
|
||||||
- app.stop()
|
|
||||||
结束
|
|
||||||
|
|
||||||
## 项目启动
|
- app.load()
|
||||||
|
- db.emitAsync('start')
|
||||||
|
- 加载数据库里的 collections 配置
|
||||||
|
- 加载数据库里的 pm 配置
|
||||||
|
- 启动激活的插件
|
||||||
|
- app.listen()
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn nocobase start --init --sync
|
|
||||||
# --init 用于启动时快捷安装
|
|
||||||
# --sync 开发环境时,当 app.collection() 有更新时快速建表或更新表
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
- app.constructor()
|
|
||||||
- app.parse()
|
|
||||||
- yarn nocobase start
|
|
||||||
初始化安装
|
|
||||||
- app.load()
|
|
||||||
加载配置
|
|
||||||
- app.emitAsync('beforeLoad')
|
|
||||||
所有配置加载之前的钩子
|
|
||||||
- app.pluginManager.load()
|
|
||||||
按顺序载入所有激活的插件的配置
|
|
||||||
- 加载 plugin-collections 的配置
|
|
||||||
- 添加 app.on('start') 监听
|
|
||||||
- db.getModel('collections').load()
|
|
||||||
把 collections 表的配置都导入 db.table(),在 start 流程里不需要再 db.sync
|
|
||||||
- app.emitAsync('afterLoad')
|
|
||||||
所有配置加载之后的钩子
|
|
||||||
- app.db.sync({force: false})
|
|
||||||
yarn nocobase start --sync 有更新时快速建表或更新表
|
|
||||||
yarn nocobase start --init 快捷 init
|
|
||||||
- app.emitAsync('init')
|
|
||||||
yarn nocobase start --init 快捷 init
|
|
||||||
- app.emitAsync('start')
|
|
||||||
执行所有 start listeners,一般是从数据表里读取一些必要的数据
|
|
||||||
- app.listen()
|
|
||||||
启动 http server
|
|
||||||
|
@ -194,7 +194,11 @@ await db.sequelize.models.posts_tags.sync();
|
|||||||
|
|
||||||
```ts
|
```ts
|
||||||
interface updateField {
|
interface updateField {
|
||||||
(name: string, options: FieldOptions): Field;
|
(name: string, data: FieldOptions, options?: UpdateFieldOptions): Field;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface UpdateFieldOptions {
|
||||||
|
force?: boolean;
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -222,7 +222,8 @@ collection 的事件(都是同步的)
|
|||||||
|
|
||||||
model 的事件(异步的)
|
model 的事件(异步的)
|
||||||
|
|
||||||
- `<modelName>.<hookType>`
|
- `<modelHookType>`
|
||||||
|
- `<modelName>.<modelHookType>`
|
||||||
|
|
||||||
##### Examples
|
##### Examples
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user