Skip to content

Commit a7243e1

Browse files
committed
chore(workspace): 补全 workspace 元数据,统一各 crate 发布字段
1 parent 93b2f96 commit a7243e1

21 files changed

Lines changed: 431 additions & 81 deletions

File tree

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ jobs:
2929

3030
- run: cargo clippy --workspace -- -D warnings
3131

32-
- run: cargo test --workspace --features sculk-core/ci
32+
- run: cargo test --workspace --features sculk/ci

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
members = ["core", "cli", "tui"]
33
resolver = "3"
44

5+
[workspace.package]
6+
authors = ["KercyDing"]
7+
edition = "2024"
8+
license = "GPL-3.0"
9+
repository = "https://github.com/KercyDing/sculk"
10+
rust-version = "1.89"
11+
version = "0.1.0"
12+
513
[workspace.dependencies]
6-
sculk-core = { path = "core" }
14+
sculk = { path = "core", version = "0.1.0" }
715
anyhow = "1.0"
816
iroh = "0.96"
917
tokio = { version = "1.49", features = ["full"] }

Justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,11 @@ check:
3434

3535
# 离线测试
3636
test:
37-
cargo nextest run --workspace --features sculk-core/ci --no-tests=pass
37+
cargo nextest run --workspace --features sculk/ci --no-tests=pass
3838

3939
# 网络集成测试
4040
test-e2e:
41-
cargo nextest run -p sculk-core --test p2p_test --no-tests=pass
41+
cargo nextest run -p sculk --test p2p_test --no-tests=pass
4242

4343
# 全量测试
4444
test-all: test test-e2e

README.md

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# sculk
22

3+
[![crates.io](https://img.shields.io/crates/v/sculk.svg)](https://crates.io/crates/sculk)
4+
[![docs.rs](https://docs.rs/sculk/badge.svg)](https://docs.rs/sculk)
5+
[![license](https://img.shields.io/crates/l/sculk.svg)](LICENSE)
6+
37
一个面向 Minecraft 联机的 P2P 隧道项目,基于 iroh/QUIC,提供:
48
- `sculk`:命令行客户端(CLI)
59
- `sculk-tui`:终端图形客户端(TUI)
6-
- `sculk-core`:可复用隧道核心库
10+
- `sculk`:可复用隧道核心库
711

812
> Sculk(幽匿)是 Minecraft 深暗之域中悄然蔓延的脉络,无声地在节点间传递信号。
913
>
@@ -13,7 +17,7 @@
1317

1418
这是一个 Rust workspace:
1519

16-
- `core` (`sculk-core`):隧道能力与票据协议
20+
- `core` (`sculk`):隧道能力与票据协议
1721
- `IrohTunnel::host/join`
1822
- `Ticket``sculk://...`
1923
- `TunnelConfig` / `TunnelEvent`
@@ -42,25 +46,35 @@
4246
#### macOS / Linux
4347

4448
```sh
45-
curl -fsSL https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/install/install.sh | sh
49+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/install/install.sh)"
4650
```
4751

4852
#### Windows PowerShell
4953

5054
```powershell
51-
irm https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/install/install.ps1 | iex
55+
& $([scriptblock]::Create((irm https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/install/install.ps1)))
5256
```
5357

5458
脚本会交互式询问安装:
5559
1. `sculk`
5660
2. `sculk-tui`
5761
3. 全部
5862

59-
### 方式二:从源码安装
63+
### 方式二:从 crates.io 安装
64+
65+
```sh
66+
cargo install sculk-cli
67+
cargo install sculk-tui
68+
```
69+
70+
### 方式三:从源码安装
6071

6172
```sh
6273
cargo install --path cli
6374
cargo install --path tui
75+
76+
# 或使用 just
77+
just install-all
6478
```
6579

6680
## 卸载
@@ -70,13 +84,13 @@ cargo install --path tui
7084
#### macOS / Linux
7185

7286
```sh
73-
curl -fsSL https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/uninstall/uninstall.sh | sh
87+
sh -c "$(curl -fsSL https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/uninstall/uninstall.sh)"
7488
```
7589

7690
#### Windows PowerShell
7791

7892
```powershell
79-
irm https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/uninstall/uninstall.ps1 | iex
93+
& $([scriptblock]::Create((irm https://raw.githubusercontent.com/KercyDing/sculk/main/scripts/uninstall/uninstall.ps1)))
8094
```
8195

8296
### Cargo 卸载(注意包名)

cli/Cargo.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
[package]
22
name = "sculk-cli"
3-
version = "0.1.0"
4-
edition = "2024"
3+
categories = ["network-programming", "command-line-utilities"]
4+
description = "Minecraft P2P multiplayer tunnel CLI"
5+
documentation = "https://docs.rs/sculk-cli"
6+
include = ["/src/**", "/Cargo.toml", "/README.md"]
7+
keywords = ["minecraft", "p2p", "tunnel", "cli"]
8+
readme = "README.md"
9+
authors.workspace = true
10+
edition.workspace = true
11+
license.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
14+
version.workspace = true
515

616
[dependencies]
7-
sculk-core = { workspace = true, features = ["persist", "clipboard"] }
17+
sculk = { workspace = true, features = ["persist", "clipboard"] }
818
anyhow.workspace = true
919
clap.workspace = true
1020
tokio.workspace = true

cli/README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# sculk-cli
2+
3+
Minecraft P2P multiplayer tunnel CLI, built on [sculk](https://crates.io/crates/sculk).
4+
5+
## Installation
6+
7+
```sh
8+
cargo install sculk-cli
9+
```
10+
11+
> The binary is named `sculk`, the crate name is `sculk-cli`.
12+
13+
## Usage
14+
15+
### Host
16+
17+
```sh
18+
sculk host
19+
```
20+
21+
Options:
22+
- `-p <PORT>` — Local MC server port (default: 25565)
23+
- `--password <PWD>` — Connection password
24+
- `--max-players <N>` — Maximum player count
25+
- `--relay <URL>` — Override relay address
26+
- `--new-key` — Force generate a new secret key
27+
28+
### Join
29+
30+
```sh
31+
sculk join "sculk://..."
32+
```
33+
34+
Options:
35+
- `-p <PORT>` — Local inbound listen port (default: 30000)
36+
- `--password <PWD>` — Join password
37+
- `--max-retries <N>` — Max reconnection attempts (omit for unlimited)
38+
39+
### Relay Configuration
40+
41+
```sh
42+
sculk relay --list
43+
sculk relay --url https://your-relay.example.com
44+
sculk relay --reset
45+
```
46+
47+
---
48+
49+
## 中文说明
50+
51+
Minecraft P2P 联机隧道命令行客户端,基于 [sculk](https://crates.io/crates/sculk)
52+
53+
### 安装
54+
55+
```sh
56+
cargo install sculk-cli
57+
```
58+
59+
> 二进制名是 `sculk`,Cargo 包名是 `sculk-cli`
60+
61+
### 使用
62+
63+
#### 建房
64+
65+
```sh
66+
sculk host
67+
```
68+
69+
常用参数:
70+
- `-p <PORT>` — 本地 MC 服务端端口(默认 25565)
71+
- `--password <PWD>` — 连接密码
72+
- `--max-players <N>` — 最大玩家数
73+
- `--relay <URL>` — 覆盖 relay 地址
74+
- `--new-key` — 强制生成新密钥
75+
76+
#### 加入
77+
78+
```sh
79+
sculk join "sculk://..."
80+
```
81+
82+
常用参数:
83+
- `-p <PORT>` — 本地入站监听端口(默认 30000)
84+
- `--password <PWD>` — 加入密码
85+
- `--max-retries <N>` — 最大重连次数(不传=无限)
86+
87+
#### 中继配置
88+
89+
```sh
90+
sculk relay --list
91+
sculk relay --url https://your-relay.example.com
92+
sculk relay --reset
93+
```
94+
95+
更多信息见[项目主页](https://github.com/KercyDing/sculk)

cli/src/main.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use std::path::PathBuf;
99
use std::time::Duration;
1010

1111
use clap::{CommandFactory, Parser, Subcommand};
12-
use sculk_core::persist::{self, Profile};
13-
use sculk_core::tunnel::{IrohTunnel, TunnelConfig, TunnelEvent};
12+
use sculk::persist::{self, Profile};
13+
use sculk::tunnel::{IrohTunnel, TunnelConfig, TunnelEvent};
1414
use tracing_subscriber::EnvFilter;
1515

1616
const CLAP_STYLES: clap::builder::styling::Styles = clap::builder::styling::Styles::styled()
@@ -41,7 +41,7 @@ enum Commands {
4141
/// 作为房主启动并暴露本地 MC 服务端
4242
Host {
4343
/// 本地 Minecraft 服务端端口
44-
#[arg(short, long, default_value_t = sculk_core::DEFAULT_MC_PORT)]
44+
#[arg(short, long, default_value_t = sculk::DEFAULT_MC_PORT)]
4545
port: u16,
4646
/// 强制重新生成新密钥
4747
#[arg(long)]
@@ -67,7 +67,7 @@ enum Commands {
6767
/// 房主提供的 ticket
6868
ticket: String,
6969
/// 本地给 MC 客户端连接的端口
70-
#[arg(short, long, default_value_t = sculk_core::DEFAULT_INLET_PORT)]
70+
#[arg(short, long, default_value_t = sculk::DEFAULT_INLET_PORT)]
7171
port: u16,
7272
/// 路径状态打印间隔(秒,默认 0: 仅变化时输出)
7373
#[arg(short, long, default_value_t = 0)]
@@ -138,7 +138,7 @@ async fn run_command(cli: Cli) -> anyhow::Result<()> {
138138
let quoted = format!("\"{ticket_str}\"");
139139
println!("Ticket: {quoted}");
140140

141-
if sculk_core::clipboard::clipboard_copy(&quoted) {
141+
if sculk::clipboard::clipboard_copy(&quoted) {
142142
println!("(Copied to clipboard)");
143143
}
144144

@@ -166,7 +166,7 @@ async fn run_command(cli: Cli) -> anyhow::Result<()> {
166166
password,
167167
max_retries,
168168
} => {
169-
let ticket: sculk_core::tunnel::Ticket =
169+
let ticket: sculk::tunnel::Ticket =
170170
ticket.parse().map_err(|e| anyhow::anyhow!("{e}"))?;
171171
if let Some(ref url) = ticket.relay_url {
172172
println!("Relay: {url}");
@@ -274,7 +274,7 @@ mod tests {
274274
fn parse_join_defaults() {
275275
let cli = Cli::try_parse_from(["sculk", "join", "ticket"]).expect("parse join");
276276
assert!(
277-
matches!(cli.command, Commands::Join { port, .. } if port == sculk_core::DEFAULT_INLET_PORT)
277+
matches!(cli.command, Commands::Join { port, .. } if port == sculk::DEFAULT_INLET_PORT)
278278
);
279279
}
280280
}

core/Cargo.toml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,17 @@
11
[package]
2-
name = "sculk-core"
3-
version = "0.1.0"
4-
edition = "2024"
2+
name = "sculk"
3+
categories = ["network-programming", "game-development"]
4+
description = "P2P tunnel core library for Minecraft multiplayer"
5+
documentation = "https://docs.rs/sculk"
6+
include = ["/src/**", "/Cargo.toml", "/README.md"]
7+
keywords = ["minecraft", "p2p", "tunnel", "quic", "iroh"]
8+
readme = "README.md"
9+
authors.workspace = true
10+
edition.workspace = true
11+
license.workspace = true
12+
repository.workspace = true
13+
rust-version.workspace = true
14+
version.workspace = true
515

616
[features]
717
default = []

0 commit comments

Comments
 (0)