Move Rust examples into their crates so cargo publish picks them up
The previous `[[example]] path = "../../examples/rust/..."` entries pointed at files outside the crate root. cargo only packages files inside the crate directory, so the examples would have been silently dropped on publish. Moving them to crates/wickra/examples/ and crates/wickra-data/examples/ keeps them as part of the published package and lets cargo discover them automatically (no [[example]] override needed). README and project-layout section updated.
This commit is contained in:
@@ -109,7 +109,7 @@ inherit it automatically.
|
|||||||
| Python (PyO3) | `pip install wickra` | `examples/python/backtest.py` |
|
| Python (PyO3) | `pip install wickra` | `examples/python/backtest.py` |
|
||||||
| Node.js (napi-rs) | `npm install wickra` | `bindings/node/__tests__/smoke.test.js` |
|
| Node.js (napi-rs) | `npm install wickra` | `bindings/node/__tests__/smoke.test.js` |
|
||||||
| Browser / WASM | `npm install wickra-wasm` | `bindings/wasm/examples/index.html` |
|
| Browser / WASM | `npm install wickra-wasm` | `bindings/wasm/examples/index.html` |
|
||||||
| Rust | `cargo add wickra` | `examples/rust/backtest.rs` |
|
| Rust | `cargo add wickra` | `crates/wickra/examples/backtest.rs` |
|
||||||
|
|
||||||
The wickra-core crate is `unsafe`-forbidden, so every binding inherits a
|
The wickra-core crate is `unsafe`-forbidden, so every binding inherits a
|
||||||
memory-safe implementation.
|
memory-safe implementation.
|
||||||
@@ -175,8 +175,8 @@ wickra/
|
|||||||
│ ├── node/ napi-rs (publishes on npm)
|
│ ├── node/ napi-rs (publishes on npm)
|
||||||
│ └── wasm/ wasm-bindgen (browsers, bundlers, Node)
|
│ └── wasm/ wasm-bindgen (browsers, bundlers, Node)
|
||||||
├── examples/
|
├── examples/
|
||||||
│ ├── python/ backtest, live trading, parallel assets, multi-tf
|
│ └── python/ backtest, live trading, parallel assets, multi-tf
|
||||||
│ └── rust/ backtest, live Binance
|
│ (Rust examples live inside their crate at crates/<name>/examples/)
|
||||||
├── benches/ cargo bench targets
|
├── benches/ cargo bench targets
|
||||||
└── .github/workflows/ CI and release pipelines
|
└── .github/workflows/ CI and release pipelines
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -41,5 +41,4 @@ tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
|||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "live_binance"
|
name = "live_binance"
|
||||||
path = "../../examples/rust/live_binance.rs"
|
|
||||||
required-features = ["live-binance"]
|
required-features = ["live-binance"]
|
||||||
|
|||||||
@@ -31,8 +31,3 @@ wickra-data = { path = "../wickra-data" }
|
|||||||
[[bench]]
|
[[bench]]
|
||||||
name = "indicators"
|
name = "indicators"
|
||||||
harness = false
|
harness = false
|
||||||
|
|
||||||
[[example]]
|
|
||||||
name = "backtest"
|
|
||||||
path = "../../examples/rust/backtest.rs"
|
|
||||||
required-features = []
|
|
||||||
|
|||||||
Reference in New Issue
Block a user