feat(openpencil-shell-core): skeleton crate (kickoff §1.2 three-crate split)

This commit is contained in:
Kayshen-X 2026-05-03 22:10:00 +08:00
parent fcaf791b18
commit 1a6b28698d
2 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,23 @@
[package]
name = "openpencil-shell-core"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
description = "OpenPencil shell — retained-mode widget tree, RenderBackend trait, parley + taffy (kickoff spec §1.2)"
[lib]
name = "openpencil_shell_core"
path = "src/lib.rs"
[dependencies]
serde = { workspace = true, optional = true }
# Pinned per Task 0.4 wasm32 feature matrix verdict
# (notes/2026-05-02-parley-wasm-feature-matrix.md "## 结论" 段)
parley = { version = "0.2", default-features = false, features = ["std"] }
taffy = { version = "0.6", default-features = false, features = ["std", "taffy_tree", "flexbox", "grid", "block_layout", "content_size"] }
[features]
default = []
serde = ["dep:serde"]

View file

@ -0,0 +1,20 @@
//! OpenPencil shell core — platform-agnostic widget tree + render-backend trait.
//!
//! Per kickoff spec §1.2 (FROZEN 2026-05-02): this crate must compile on
//! wasm32-unknown-unknown. winit / accesskit_winit / skia-safe live in
//! `openpencil-shell-native`; wasm-bindgen / web-sys / CanvasKit live in
//! `openpencil-shell-web`.
pub fn placeholder() -> &'static str {
"openpencil-shell-core skeleton"
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn skeleton_returns_string() {
assert_eq!(placeholder(), "openpencil-shell-core skeleton");
}
}