chore(workspace): bootstrap Cargo workspace + toolchain pin

This commit is contained in:
Kayshen-X 2026-05-03 21:55:00 +08:00
parent 9819f913d9
commit 064e03e554
5 changed files with 64 additions and 0 deletions

8
.cargo/config.toml Normal file
View file

@ -0,0 +1,8 @@
[build]
# wasm32 target enabled via rust-toolchain.toml; no override here
[net]
git-fetch-with-cli = true
[term]
verbose = false

7
.gitignore vendored
View file

@ -29,3 +29,10 @@ dist-electron/
.omx
.worktrees/
.omx/
# Rust
/target
**/*.rs.bk
Cargo.lock.merge-conflict
/crates/*/target
/vendor/agent/target

36
Cargo.toml Normal file
View file

@ -0,0 +1,36 @@
[workspace]
resolver = "2"
members = [
"crates/openpencil-app",
"crates/openpencil-shell-core",
"crates/openpencil-shell-web",
"crates/openpencil-shell-native",
"crates/pen-types",
"crates/pen-core",
"crates/pen-engine",
"crates/pen-codegen",
"crates/pen-figma",
]
exclude = [
"vendor/agent",
"node_modules",
]
[workspace.package]
version = "0.1.0"
edition = "2021"
rust-version = "1.80"
license = "MIT"
authors = ["ZSeven-W <fini.yang@gmail.com>"]
repository = "https://github.com/ZSeven-W/openpencil"
[workspace.dependencies]
serde = { version = "1", features = ["derive"] }
serde_json = "1"
thiserror = "1"
anyhow = "1"
tracing = "0.1"
# WASM 边界相关per kickoff §1.2 黑名单 = 不出现在这里)
# 故意不在 workspace.dependencies 暴露 tokio / reqwest / agent / pen-agent-cli /
# pen-server / native-tls —— 这些只在 native-only crate 内部用 dev-deps 或 target-specific deps。

5
rust-toolchain.toml Normal file
View file

@ -0,0 +1,5 @@
[toolchain]
channel = "1.80"
components = ["rustfmt", "clippy", "rust-src"]
targets = ["wasm32-unknown-unknown"]
profile = "default"

8
rustfmt.toml Normal file
View file

@ -0,0 +1,8 @@
edition = "2021"
max_width = 100
tab_spaces = 4
hard_tabs = false
imports_granularity = "Crate"
group_imports = "StdExternalCrate"
reorder_imports = true
newline_style = "Unix"