-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# 依賴關係 | ||
|
||
擴充之間的依賴關係 | ||
|
||
## 聲明依賴 | ||
|
||
在 `info.json` 中 聲明 | ||
|
||
:::tip | ||
|
||
依賴中 `trem` 為必須的。 | ||
|
||
::: | ||
|
||
:::tip 版本格式說明 | ||
版本號格式為: 主版本.次版本.修訂版本-預發布標識 | ||
|
||
例如: `3.0.0-pre.1` | ||
|
||
支援的版本規則格式: | ||
|
||
`>=3.0.0-pre.1` - 大於等於指定版本 | ||
|
||
`<=3.0.0-pre.4` - 小於等於指定版本 | ||
|
||
`<3.0.0-pre.4` - 小於指定版本 | ||
|
||
`>3.0.0-pre.4` - 大於指定版本 | ||
|
||
`=3.0.0-pre.4` - 等於指定版本 | ||
|
||
`>=3.0.0-pre.1 <=3.0.0-pre.4` - 版本需同時符合兩個條件 | ||
::: | ||
|
||
```json | ||
{ | ||
// ... | ||
"dependencies": { | ||
"trem": ">=3.0.0" // 擴充所需的 TREM 最低版本 | ||
} | ||
// ... | ||
} | ||
``` | ||
|
||
## 用途 | ||
|
||
檢查是否有執行擴充所需的其他擴充 | ||
|
||
:::tip | ||
|
||
舉例來說,`websocket` 需要 `exptech` 提供地震報告資料。換句話說,`exptech` 就是 `websocket` 所必需的依賴。 | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
sidebar_position: 6 | ||
--- | ||
|
||
# 自定義事件註冊 | ||
|
||
除了 TREM 本身,擴充還可以分發自己的事件。 | ||
|
||
:::tip | ||
|
||
**自定義事件**是擴充之間,傳遞訊息的一種方式。 | ||
|
||
::: | ||
|
||
## 用法 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
sidebar_position: 1 | ||
--- | ||
|
||
# 事件列表 | ||
|
||
查看可用的事件。 | ||
|
||
## 目錄 | ||
|
||
- onServerStartEvent | ||
|
||
## onServerStartEvent | ||
|
||
#### 回傳參數 `pid` | ||
|
||
當伺服器被啟動 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
sidebar_position: 3 | ||
--- | ||
|
||
# 雜項 | ||
|
||
這裡紀錄著,一些瑣碎的東西。 | ||
|
||
## 目錄 | ||
|
||
- [事件列表](./events_list) | ||
- [版本管理](./version) | ||
- [依賴關係](./dependencies) | ||
- [日誌紀錄](./logger) | ||
- [導入 擴充 的 函數](./require) | ||
- [自定義事件註冊](./event) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
--- | ||
|
||
# 日誌紀錄 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
sidebar_position: 5 | ||
--- | ||
|
||
# 導入其他擴充 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 版本管理 | ||
|
||
擴充作者應做好版本管理 | ||
|
||
## 擴充版本命名方式 | ||
|
||
`X.Y.Z` | ||
|
||
### X 主版號 | ||
|
||
當產品進行了重大的更新或功能改變,影響了向下相容性,或完全重寫了代碼時,應增加 `主版號`。 | ||
|
||
- 1.5.8 -> 2.0.0 | ||
|
||
### Y 次版號 | ||
|
||
擴充新增功能後,應增加 `次版號`,然後 `修訂號` 歸零。 | ||
|
||
- 1.1.5 -> 1.2.0 | ||
|
||
### Z 修訂號 | ||
|
||
擴充修復錯誤或問題增加 `修訂號`。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
sidebar_position: 2 | ||
--- | ||
|
||
# 擴充開發 | ||
|