Skip to content

Commit b96dd07

Browse files
domenkozarclaude
andcommitted
refactor: move derive example to dedicated package
- Extract derive example from secretspec/Cargo.toml to examples/derive/Cargo.toml - Update workspace members to include examples/derive - Fix relative path in derive.rs for new location - Add necessary dependencies (serde, url) to example package 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 26bb8b6 commit b96dd07

File tree

6 files changed

+28
-6
lines changed

6 files changed

+28
-6
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,6 @@ jobs:
300300
- uses: actions/checkout@v4
301301
- uses: rust-lang/crates-io-auth-action@v1
302302
id: auth
303-
- run: cargo publish
303+
- run: cargo publish --workspace -Z package-workspace
304304
env:
305305
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
members = [
33
"secretspec",
44
"secretspec-derive",
5+
"examples/derive",
56
]
67
resolver = "2"
78

examples/derive/Cargo.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[package]
2+
name = "secretspec-derive-example"
3+
version = "0.1.0"
4+
edition = "2021"
5+
publish = false
6+
7+
[[bin]]
8+
name = "derive"
9+
path = "derive.rs"
10+
11+
[dependencies]
12+
secretspec = { path = "../../secretspec" }
13+
secretspec-derive = { path = "../../secretspec-derive" }
14+
serde = { workspace = true }
15+
url = { workspace = true }

examples/derive/derive.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Use the proc macro to generate typed structs from secretspec.toml
22
// This generates: SecretSpec, SecretSpecProfile, Profile, and Provider types
3-
secretspec_derive::declare_secrets!("../examples/derive/secretspec.toml");
3+
secretspec_derive::declare_secrets!("secretspec.toml");
44

55
fn main() -> Result<(), Box<dyn std::error::Error>> {
66
println!("SecretSpec Code Generation Example\n");

secretspec/Cargo.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,5 @@ linkme.workspace = true
3939
default = ["cli"]
4040
cli = []
4141

42-
[[example]]
43-
name = "derive"
44-
path = "../examples/derive/derive.rs"
45-
4642
[dev-dependencies]
4743
secretspec-derive.workspace = true

0 commit comments

Comments
 (0)