Skip to content

Commit

Permalink
Upgrade deps, replace unmaintained proc-macro-error with proc-macro-e…
Browse files Browse the repository at this point in the history
…rror2 (fixes #34)
  • Loading branch information
dbeckwith committed Sep 7, 2024
1 parent 6331202 commit 8885f08
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## NEXT

* Export `Blob` newtype wrapper around `Vec<u8>` which has the Typescript type [`Blob`](https://developer.mozilla.org/en-US/docs/Web/API/Blob).
* Replace unmaintained `proc-macro-error` dependency with `proc-macro-error2` ([#34](https://github.com/dbeckwith/rust-typescript-type-def/issues/34)).

## v0.5.10

Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ json_value = ["serde_json"]

[dependencies]
typescript-type-def-derive = { version = "=0.5.11", path = "./derive" }
serde_json = { version = "1.0.64", optional = true }
serde_json = { version = "1.0.128", optional = true }

[dev-dependencies]
difference = "2.0.0"
serde = { version = "1.0.126", features = ["derive"] }
serde_json = "1.0.64"
uuid = { version = "0.8.2", features = ["serde"] }
serde = { version = "1.0.210", features = ["derive"] }
serde_json = "1.0.128"
uuid = { version = "1.10.0", features = ["serde"] }
10 changes: 5 additions & 5 deletions derive/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ include = [
proc-macro = true

[dependencies]
darling = "0.13.0"
darling = "0.20.10"
ident_case = "1.0.1"
proc-macro-error = "1.0.4"
proc-macro2 = "1.0.27"
quote = "1.0.9"
syn = { version = "1.0.73", default-features = false, features = ["visit-mut"] }
proc-macro-error2 = "2.0.1"
proc-macro2 = "1.0.86"
quote = "1.0.37"
syn = { version = "2.0.77", default-features = false, features = ["visit-mut"] }
25 changes: 16 additions & 9 deletions derive/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use darling::{
FromDeriveInput, FromField, FromMeta, FromVariant,
};
use proc_macro2::Span;
use proc_macro_error::{abort, proc_macro_error};
use proc_macro_error2::{abort, proc_macro_error};
use quote::{format_ident, quote};
use std::{ops::Deref, str::FromStr};
use syn::{
Expand All @@ -21,7 +21,7 @@ use syn::{
parse_quote, parse_str,
punctuated::Punctuated,
visit_mut::{self, VisitMut},
AngleBracketedGenericArguments, Attribute, DeriveInput, Expr,
AngleBracketedGenericArguments, Attribute, DeriveInput, Expr, ExprLit,
GenericArgument, GenericParam, Generics, Ident, Item, ItemImpl, ItemStruct,
Lifetime, Lit, LitStr, Meta, MetaNameValue, Path, PathArguments,
PathSegment, PredicateLifetime, PredicateType, Token, TraitBound,
Expand Down Expand Up @@ -846,16 +846,23 @@ fn extract_type_docs(attrs: &[Attribute]) -> Option<Expr> {
let mut lines = attrs
.iter()
.filter_map(|attr| {
if let Ok(Meta::NameValue(MetaNameValue {
if let Meta::NameValue(MetaNameValue {
path,
lit: Lit::Str(lit_str),
..
})) = attr.parse_meta()
eq_token: _,
value,
}) = &attr.meta
{
path.is_ident("doc").then(|| lit_str.value())
} else {
None
if path.is_ident("doc") {
if let Expr::Lit(ExprLit {
attrs: _,
lit: Lit::Str(lit_str),
}) = value
{
return Some(lit_str.value());
}
}
}
None
})
.collect::<Vec<_>>();
let min_indent = lines
Expand Down

0 comments on commit 8885f08

Please sign in to comment.