oceanpress 1.0.3 → 1.0.9

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/CLAUDE.md ADDED
@@ -0,0 +1,3 @@
1
+ - 可以先运行 pnpm tsc 检查你的程序是否在类型上正确
2
+ - 应该使用 tsx 直接运行 ts 文件
3
+ - 可以在当前目录下运行 `pnpm cli build --config "./store/configs" --output "/home/gs/opensource_code/doc/docs"` 查看你的修改是否能够正常运行
package/README.md CHANGED
@@ -1,3 +1,83 @@
1
1
  # OceanPress Frontend
2
2
 
3
- 这个是 OceanPress 的核心库,包含了前端应用和命令行程序
3
+ 这个是 OceanPress 的核心库,包含了前端应用和命令行程序。
4
+
5
+ ## CLI 命令详解
6
+
7
+ ### 1. 构建静态站点 (build)
8
+
9
+ 将思源笔记本的内容转换为静态网站:
10
+
11
+ ```bash
12
+ oceanpress build -c <配置文件路径> -o <输出目录>
13
+ ```
14
+
15
+ **选项:**
16
+ - `-c, --config <string>` - 指定配置文件的位置
17
+ - `-o, --output <string>` - 指定输出目录位置
18
+
19
+ **示例:**
20
+ ```bash
21
+ oceanpress build -c ./config.json -o ./dist
22
+ ```
23
+
24
+ ### 2. 启动开发服务器 (server)
25
+
26
+ 运行动态代理服务器用于开发和预览:
27
+
28
+ ```bash
29
+ oceanpress server -c <配置文件路径>
30
+ ```
31
+
32
+ **选项:**
33
+ - `-c, --config <string>` - 指定配置文件的位置
34
+ - `-h, --host <string>` - web服务绑定到的地址(默认:127.0.0.1)
35
+ - `-p, --port <number>` - web服务绑定到的端口(默认:80)
36
+ - `--cache <boolean>` - 配置为 true 时开启缓存,默认为 false 不开启缓存
37
+
38
+ **示例:**
39
+ ```bash
40
+ # 使用默认端口
41
+ oceanpress server -c ./config.json
42
+
43
+ # 指定端口和主机
44
+ oceanpress server -c ./config.json -p 3000 -h 0.0.0.0
45
+
46
+ # 开启缓存
47
+ oceanpress server -c ./config.json --cache true
48
+ ```
49
+
50
+ ### 3. 部署站点 (deploy)
51
+
52
+ 将生成的站点部署到远程服务器:
53
+
54
+ ```bash
55
+ oceanpress deploy -c <配置文件路径> -h <API地址> -k <API密钥>
56
+ ```
57
+
58
+ **选项:**
59
+ - `-c, --config <string>` - 指定配置文件的位置
60
+ - `-h, --apiBase <string>` - OceanPress server 地址
61
+ - `-k, --apiKey <string>` - OceanPress server Api 密钥
62
+
63
+ **示例:**
64
+ ```bash
65
+ oceanpress deploy -c ./config.json -h https://api.example.com -k your-api-key
66
+ ```
67
+
68
+ ## 配置文件
69
+
70
+ OceanPress 使用 JSON 格式的配置文件来定义站点的基本信息和构建参数。配置文件通常包含:
71
+
72
+ - 站点名称和描述
73
+ - 思源笔记本的连接配置
74
+ - 主题和样式设置
75
+ - 插件配置
76
+
77
+ ## 技术栈
78
+
79
+ - Vue 3
80
+ - TypeScript
81
+ - Hono
82
+ - Effect
83
+ - Commander.js