Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): introduce wren-core-base module to collect the common structs and utilities #1003

Merged
merged 7 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions wren-core-base/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Cargo.lock
target/
manifest-macro/Cargo.lock
manifest-macro/target/
19 changes: 19 additions & 0 deletions wren-core-base/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "wren-core-base"
version = "0.1.0"
edition = "2021"

[features]
python-binding = ["dep:pyo3"]
default = []

[dependencies]
pyo3 = { version = "0.23.3", features = ["extension-module"], optional = true }
serde = { version = "1.0.201", features = ["derive", "rc"] }
wren-manifest-macro = { path = "manifest-macro" }
serde_json = { version = "1.0.117" }
serde_with = { version = "3.11.0" }

[lib]
name = "wren_core_base"
path = "src/lib.rs"
5 changes: 5 additions & 0 deletions wren-core-base/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Wren Core Base Module
This module is the base module for Wren Core. It contains the common utilities, the base traits and structs for the Wren Core.

## Crate Features
- `python-binding`: Enable the Python binding to access the Manifest struct in Python. This feature is disabled by default.
17 changes: 17 additions & 0 deletions wren-core-base/manifest-macro/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "wren-manifest-macro"
version = "0.1.0"
edition = "2021"

[dependencies]
syn = { version = "2.0", default-features = false, features = [
"printing",
"parsing",
"proc-macro",
] }
quote = "1.0"

[lib]
proc-macro = true
name = "manifest_macro"
path = "src/lib.rs"
14 changes: 14 additions & 0 deletions wren-core-base/manifest-macro/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Wren Core Manifest Macro
This is module to collect the generating macros for the manifest struct of Wren MDL.
They are used to generate the manifest struct for different bindings.
Currently, we have the following bindings:
- Python
- Rust

## Example
```rust
use wren_core_manifest_macro::manifest;

manifest!(true); // Generate the manifest struct for Python binding
manifest!(false); // Generate the manifest struct for Rust binding
```
Loading
Loading