Skip to content

Commit d15ee64

Browse files
committed
Remove legacy template parser source
1 parent d0e3f70 commit d15ee64

File tree

19 files changed

+1801
-406
lines changed

19 files changed

+1801
-406
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
66
### Added
77
- `masterror::error::template` module providing a parsed representation of
88
`#[error("...")]` strings and a formatter hook for future custom derives.
9+
- Internal `masterror-derive` crate powering the native `masterror::Error`
10+
derive macro.
11+
12+
### Changed
13+
- `masterror::Error` now uses the in-tree derive, removing the dependency on
14+
`thiserror` while keeping the same runtime behaviour and diagnostics.
915

1016
## [0.5.0] - 2025-09-23
1117

Cargo.lock

Lines changed: 16 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ build = "build.rs"
1212
categories = ["rust-patterns", "web-programming"]
1313
keywords = ["error", "api", "framework"]
1414

15+
[workspace]
16+
members = [
17+
"masterror-derive",
18+
"masterror-template"
19+
]
20+
1521

1622
[features]
1723
default = []
@@ -33,7 +39,8 @@ turnkey = []
3339
openapi = ["dep:utoipa"]
3440

3541
[dependencies]
36-
thiserror = "2"
42+
masterror-derive = { path = "masterror-derive" }
43+
masterror-template = { path = "masterror-template" }
3744
tracing = "0.1"
3845

3946
serde = { version = "1", features = ["derive"] }

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ masterror = { version = "0.5.0", default-features = false }
5252
- **Clean wire contract.** `ErrorResponse { status, code, message, details?, retry?, www_authenticate? }`.
5353
- **One log at boundary.** Log once with `tracing`.
5454
- **Less boilerplate.** Built-in conversions, compact prelude, and the
55-
`masterror::Error` re-export of `thiserror::Error` with `#[from]` /
56-
`#[error(transparent)]` support.
55+
native `masterror::Error` derive with `#[from]` / `#[error(transparent)]`
56+
support.
5757
- **Consistent workspace.** Same error surface across crates.
5858

5959
</details>
@@ -142,7 +142,7 @@ let wrapped = WrappedDomainError::from(err);
142142
assert_eq!(wrapped.to_string(), "I/O failed: disk offline");
143143
~~~
144144

145-
- `use masterror::Error;` re-exports `thiserror::Error`.
145+
- `use masterror::Error;` brings the crate's derive macro into scope.
146146
- `#[from]` automatically implements `From<...>` while ensuring wrapper shapes are
147147
valid.
148148
- `#[error(transparent)]` enforces single-field wrappers that forward

README.template.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ masterror = { version = "{{CRATE_VERSION}}", default-features = false }
4949
- **Clean wire contract.** `ErrorResponse { status, code, message, details?, retry?, www_authenticate? }`.
5050
- **One log at boundary.** Log once with `tracing`.
5151
- **Less boilerplate.** Built-in conversions, compact prelude, and the
52-
`masterror::Error` re-export of `thiserror::Error` with `#[from]` /
53-
`#[error(transparent)]` support.
52+
native `masterror::Error` derive with `#[from]` / `#[error(transparent)]`
53+
support.
5454
- **Consistent workspace.** Same error surface across crates.
5555

5656
</details>
@@ -136,7 +136,7 @@ let wrapped = WrappedDomainError::from(err);
136136
assert_eq!(wrapped.to_string(), "I/O failed: disk offline");
137137
~~~
138138

139-
- `use masterror::Error;` re-exports `thiserror::Error`.
139+
- `use masterror::Error;` brings the crate's derive macro into scope.
140140
- `#[from]` automatically implements `From<...>` while ensuring wrapper shapes are
141141
valid.
142142
- `#[error(transparent)]` enforces single-field wrappers that forward

masterror-derive/Cargo.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[package]
2+
name = "masterror-derive"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[lib]
7+
proc-macro = true
8+
9+
[dependencies]
10+
proc-macro2 = "1"
11+
quote = "1"
12+
syn = { version = "2", features = ["full", "extra-traits"] }
13+
masterror-template = { path = "../masterror-template" }

0 commit comments

Comments
 (0)