Skip to content

Commit f21d7da

Browse files
committed
feat: docs
1 parent b4fd94c commit f21d7da

9 files changed

Lines changed: 144 additions & 2 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# 依賴關係
6+
7+
擴充之間的依賴關係
8+
9+
## 聲明依賴
10+
11+
`info.json` 中 聲明
12+
13+
:::tip
14+
15+
依賴中 `trem` 為必須的。
16+
17+
:::
18+
19+
:::tip 版本格式說明
20+
版本號格式為: 主版本.次版本.修訂版本-預發布標識
21+
22+
例如: `3.0.0-pre.1`
23+
24+
支援的版本規則格式:
25+
26+
`>=3.0.0-pre.1` - 大於等於指定版本
27+
28+
`<=3.0.0-pre.4` - 小於等於指定版本
29+
30+
`<3.0.0-pre.4` - 小於指定版本
31+
32+
`>3.0.0-pre.4` - 大於指定版本
33+
34+
`=3.0.0-pre.4` - 等於指定版本
35+
36+
`>=3.0.0-pre.1 <=3.0.0-pre.4` - 版本需同時符合兩個條件
37+
:::
38+
39+
```json
40+
{
41+
// ...
42+
"dependencies": {
43+
"trem": ">=3.0.0" // 擴充所需的 TREM 最低版本
44+
}
45+
// ...
46+
}
47+
```
48+
49+
## 用途
50+
51+
檢查是否有執行擴充所需的其他擴充
52+
53+
:::tip
54+
55+
舉例來說,`websocket` 需要 `exptech` 提供地震報告資料。換句話說,`exptech` 就是 `websocket` 所必需的依賴。
56+
57+
:::

docs/trem/miscellaneous/event.mdx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
sidebar_position: 6
3+
---
4+
5+
# 自定義事件註冊
6+
7+
除了 TREM 本身,擴充還可以分發自己的事件。
8+
9+
:::tip
10+
11+
**自定義事件**是擴充之間,傳遞訊息的一種方式。
12+
13+
:::
14+
15+
## 用法
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
sidebar_position: 1
3+
---
4+
5+
# 事件列表
6+
7+
查看可用的事件。
8+
9+
## 目錄
10+
11+
- onServerStartEvent
12+
13+
## onServerStartEvent
14+
15+
#### 回傳參數 `pid`
16+
17+
當伺服器被啟動

docs/trem/miscellaneous/index.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
sidebar_position: 3
3+
---
4+
5+
# 雜項
6+
7+
這裡紀錄著,一些瑣碎的東西。
8+
9+
## 目錄
10+
11+
- [事件列表](./events_list)
12+
- [版本管理](./version)
13+
- [依賴關係](./dependencies)
14+
- [日誌紀錄](./logger)
15+
- [導入 擴充 的 函數](./require)
16+
- [自定義事件註冊](./event)

docs/trem/miscellaneous/logger.mdx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 4
3+
---
4+
5+
# 日誌紀錄
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
sidebar_position: 5
3+
---
4+
5+
# 導入其他擴充
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
sidebar_position: 2
3+
---
4+
5+
# 版本管理
6+
7+
擴充作者應做好版本管理
8+
9+
## 擴充版本命名方式
10+
11+
`X.Y.Z`
12+
13+
### X 主版號
14+
15+
當產品進行了重大的更新或功能改變,影響了向下相容性,或完全重寫了代碼時,應增加 `主版號`
16+
17+
- 1.5.8 -> 2.0.0
18+
19+
### Y 次版號
20+
21+
擴充新增功能後,應增加 `次版號`,然後 `修訂號` 歸零。
22+
23+
- 1.1.5 -> 1.2.0
24+
25+
### Z 修訂號
26+
27+
擴充修復錯誤或問題增加 `修訂號`

docs/trem/plugin_dev/event.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ sidebar_position: 2
1313
<span style={{ color: "red" }}>❗ 不推薦的做法</span>
1414

1515
:::caution
16-
不保證事件發生後,執行的優先順序,應考慮 [Mixin](./mixin.mdx)
16+
不保證事件發生後,執行的優先順序,應考慮 [Mixin](./mixin)
1717
:::
1818

1919
```js

docs/trem/plugin_dev/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
sidebar_position: 4
2+
sidebar_position: 2
33
---
44

55
# 擴充開發

0 commit comments

Comments
 (0)