@changw98ic/dashboard 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -11
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @changw98ic/dashboard
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
可视化面板后端,基于 Fastify 暴露项目、章节、实体和统计接口。
|
|
4
4
|
|
|
5
5
|
## 安装
|
|
6
6
|
|
|
@@ -8,33 +8,44 @@
|
|
|
8
8
|
npm install @changw98ic/dashboard
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## 代码使用
|
|
12
12
|
|
|
13
13
|
```typescript
|
|
14
14
|
import { createDashboard } from '@changw98ic/dashboard';
|
|
15
15
|
|
|
16
|
-
const dashboard = createDashboard({
|
|
16
|
+
const dashboard = await createDashboard({
|
|
17
17
|
port: 3000,
|
|
18
|
-
|
|
18
|
+
host: 'localhost',
|
|
19
|
+
projectRoot: '/path/to/novel',
|
|
19
20
|
});
|
|
20
21
|
|
|
21
22
|
await dashboard.start();
|
|
22
23
|
```
|
|
23
24
|
|
|
24
|
-
##
|
|
25
|
+
## CLI 使用
|
|
26
|
+
|
|
27
|
+
`webnovel` 命令来自 `@changw98ic/cli`,不是本包直接提供:
|
|
25
28
|
|
|
26
29
|
```bash
|
|
27
|
-
|
|
30
|
+
# 临时执行
|
|
31
|
+
cd /path/to/novel
|
|
32
|
+
npx @changw98ic/cli dashboard --port 3000
|
|
33
|
+
|
|
34
|
+
# 或全局安装 @changw98ic/cli 后执行
|
|
35
|
+
webnovel dashboard --port 3000
|
|
28
36
|
```
|
|
29
37
|
|
|
30
|
-
##
|
|
38
|
+
## 运行说明
|
|
31
39
|
|
|
32
|
-
|
|
40
|
+
- `createDashboard()` 是异步工厂函数,需要先 `await`。
|
|
41
|
+
- 未显式传入 `staticDir` 时,会自动探测前端构建目录。
|
|
42
|
+
- 如果未找到静态资源,会退化为 API-only 模式,接口仍可访问。
|
|
33
43
|
|
|
34
|
-
##
|
|
44
|
+
## 文档
|
|
35
45
|
|
|
36
|
-
|
|
46
|
+
- 项目主页:<https://github.com/changw98ic/webnovel-writer-skill#readme>
|
|
47
|
+
- 工作区包总览:`packages/README.md`
|
|
37
48
|
|
|
38
49
|
## License
|
|
39
50
|
|
|
40
|
-
|
|
51
|
+
GPL-3.0-or-later
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@changw98ic/dashboard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "可视化面板 - Fastify 后端",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"@fastify/cors": "^9.0.1",
|
|
43
43
|
"@fastify/static": "^7.0.4",
|
|
44
44
|
"fastify": "^4.29.1",
|
|
45
|
-
"@changw98ic/core": "1.0.
|
|
46
|
-
"@changw98ic/data": "1.0.
|
|
45
|
+
"@changw98ic/core": "1.0.1",
|
|
46
|
+
"@changw98ic/data": "1.0.2"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"@types/node": "^20.19.37",
|