Skip to content

Commit

Permalink
Language + fix export + Workspace lints & nightly docs
Browse files Browse the repository at this point in the history
closes #169, closes #256 and closes #245
  • Loading branch information
oscartbeaumont committed Jul 9, 2024
1 parent c41c53c commit 35846df
Show file tree
Hide file tree
Showing 43 changed files with 1,110 additions and 758 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:
statuses: write

env:
RUSTDOCFLAGS: --cfg docsrs2
RUSTDOCFLAGS: --cfg docsrs

jobs:
deploy-docs:
Expand Down
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[workspace]
members = ["specta", "specta-*", "tests"]
resolver = "2"

[workspace.lints.rust]
unsafe_code = { level = "forbid", priority = -1 }
# missing_docs = { level = "warn", priority = -1 } # TODO: Enable this

[workspace.lints.clippy]
all = { level = "warn", priority = -1 }
cargo = { level = "warn", priority = -1 }
unwrap_used = { level = "warn", priority = -1 }
panic = { level = "warn", priority = -1 }
todo = { level = "warn", priority = -1 }
panic_in_result_fn = { level = "warn", priority = -1 }
3 changes: 3 additions & 0 deletions specta-datatype-from/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ categories = ["web-programming", "asynchronous"]
[lib]
proc-macro = true

[lints]
workspace = true

[dependencies]
proc-macro2 = "1.0.86"
quote = "1.0.36"
Expand Down
4 changes: 4 additions & 0 deletions specta-datatype-from/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@
//! let named_export = ts::export_named_datatype(&Default::default(), &named, &Default::default()).unwrap();
//! assert_eq!(named_export, "export type MyObject = { a: \"A\" | \"B\" }");
//! ```
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

mod data_type_from;
mod utils;
Expand Down
8 changes: 8 additions & 0 deletions specta-go/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "go", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
thiserror = "1.0.61"
7 changes: 7 additions & 0 deletions specta-go/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//! TODO

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-go/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use specta::{DataType, Generics, Type, TypeMap};

/// TODO
Expand Down
8 changes: 8 additions & 0 deletions specta-kotlin/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "kotlin", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
7 changes: 7 additions & 0 deletions specta-kotlin/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
//! TODO

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-kotlin/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use specta::{DataType, Generics, PrimitiveType, Type, TypeMap};

/// TODO
Expand Down
10 changes: 7 additions & 3 deletions specta-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ categories = ["web-programming", "asynchronous"]
proc-macro = true

[features]
serde = []
function = []
export = []
default = []
# These will be enabled by `specta` or `specta-util` automatically as required. They depend on certain exports of it so enabling them manually is not useful.
DO_NOT_USE_export = []
DO_NOT_USE_function = []

[lints]
workspace = true

[dependencies]
proc-macro2 = "1.0.86"
Expand Down
8 changes: 4 additions & 4 deletions specta-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

#[cfg(feature = "function")]
#[cfg(feature = "DO_NOT_USE_function")]
mod internal_fn_datatype;
#[cfg(feature = "function")]
#[cfg(feature = "DO_NOT_USE_function")]
mod specta;
mod r#type;
mod utils;
Expand All @@ -21,7 +21,7 @@ pub fn derive_type(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
}

#[proc_macro_attribute]
#[cfg(feature = "function")]
#[cfg(feature = "DO_NOT_USE_function")]
pub fn specta(
_: proc_macro::TokenStream,
item: proc_macro::TokenStream,
Expand All @@ -31,7 +31,7 @@ pub fn specta(

#[proc_macro]
#[doc(hidden)]
#[cfg(feature = "function")]
#[cfg(feature = "DO_NOT_USE_function")]
pub fn internal_fn_datatype(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
use syn::parse_macro_input;

Expand Down
1 change: 0 additions & 1 deletion specta-macros/src/type/attr/container.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl ContainerAttr {
let mut result = Self::default();
result.common = CommonAttr::from_attrs(attrs)?;

Check warning on line 54 in specta-macros/src/type/attr/container.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/container.rs:54:9 | 54 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::container::ContainerAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/container.rs:53:9 | 53 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default = note: `-W clippy::field-reassign-with-default` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::field_reassign_with_default)]`

Check warning on line 54 in specta-macros/src/type/attr/container.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/container.rs:54:9 | 54 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::container::ContainerAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/container.rs:53:9 | 53 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default = note: `-W clippy::field-reassign-with-default` implied by `-W clippy::all` = help: to override `-W clippy::all` add `#[allow(clippy::field_reassign_with_default)]`
Self::try_from_attrs("specta", attrs, &mut result)?;
#[cfg(feature = "serde")]
Self::try_from_attrs("serde", attrs, &mut result)?;
Self::try_from_attrs("repr", attrs, &mut result)?; // To handle `#[repr(transparent)]`
Ok(result)
Expand Down
1 change: 0 additions & 1 deletion specta-macros/src/type/attr/enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ impl EnumAttr {
};

Self::try_from_attrs("specta", attrs, &mut result)?;
#[cfg(feature = "serde")]
Self::try_from_attrs("serde", attrs, &mut result)?;
Ok(result)
}
Expand Down
1 change: 0 additions & 1 deletion specta-macros/src/type/attr/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ impl FieldAttr {
let mut result = Self::default();
result.common = CommonAttr::from_attrs(attrs)?;

Check warning on line 54 in specta-macros/src/type/attr/field.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/field.rs:54:9 | 54 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::field::FieldAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/field.rs:53:9 | 53 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 54 in specta-macros/src/type/attr/field.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/field.rs:54:9 | 54 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::field::FieldAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/field.rs:53:9 | 53 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
Self::try_from_attrs("specta", attrs, &mut result)?;
#[cfg(feature = "serde")]
Self::try_from_attrs("serde", attrs, &mut result)?;
Ok(result)
}
Expand Down
1 change: 0 additions & 1 deletion specta-macros/src/type/attr/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ impl VariantAttr {
let mut result = Self::default();
result.common = CommonAttr::from_attrs(attrs)?;

Check warning on line 32 in specta-macros/src/type/attr/variant.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/variant.rs:32:9 | 32 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::variant::VariantAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/variant.rs:31:9 | 31 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default

Check warning on line 32 in specta-macros/src/type/attr/variant.rs

View workflow job for this annotation

GitHub Actions / clippy

field assignment outside of initializer for an instance created with Default::default()

warning: field assignment outside of initializer for an instance created with Default::default() --> specta-macros/src/type/attr/variant.rs:32:9 | 32 | result.common = CommonAttr::from_attrs(attrs)?; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | note: consider initializing the variable with `r#type::attr::variant::VariantAttr { common: CommonAttr::from_attrs(attrs)?, ..Default::default() }` and removing relevant reassignments --> specta-macros/src/type/attr/variant.rs:31:9 | 31 | let mut result = Self::default(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#field_reassign_with_default
Self::try_from_attrs("specta", attrs, &mut result)?;
#[cfg(feature = "serde")]
Self::try_from_attrs("serde", attrs, &mut result)?;
Ok(result)
}
Expand Down
40 changes: 20 additions & 20 deletions specta-macros/src/type/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,24 +107,24 @@ pub fn derive(input: proc_macro::TokenStream) -> syn::Result<proc_macro::TokenSt

let type_impl_heading = impl_heading(quote!(#crate_ref::Type), &ident, generics);

let export = (cfg!(feature = "export") && container_attrs.export.unwrap_or(true)).then(|| {
let export_fn_name = format_ident!("__push_specta_type_{}", raw_ident);

let generic_params = generics
.params
.iter()
.filter(|param| matches!(param, syn::GenericParam::Type(_)))
.map(|_| quote! { () });

quote! {
// TODO: Bring this back
// #[allow(non_snake_case)]
// #[#internal_crate_ref::internal::ctor::ctor]
// fn #export_fn_name() {
// #crate_ref::export::register_ty::<#ident<#(#generic_params),*>>();
// }
}
});
let export = (cfg!(feature = "DO_NOT_USE_export") && container_attrs.export.unwrap_or(true))
.then(|| {
let export_fn_name = format_ident!("__push_specta_type_{}", raw_ident);

let generic_params = generics
.params
.iter()
.filter(|param| matches!(param, syn::GenericParam::Type(_)))
.map(|_| quote! { () });

quote! {
#[allow(non_snake_case)]
#[#internal_crate_ref::export::internal::ctor]
fn #export_fn_name() {
#internal_crate_ref::export::internal::register::<#ident<#(#generic_params),*>>();
}
}
});

let comments = &container_attrs.common.doc;
let deprecated = container_attrs.common.deprecated_as_tokens(&crate_ref);
Expand Down Expand Up @@ -163,7 +163,7 @@ pub fn derive(input: proc_macro::TokenStream) -> syn::Result<proc_macro::TokenSt
#name.into(),
#comments.into(),
#deprecated,
#sid,
Self::sid(),
IMPL_LOCATION,
<Self as #crate_ref::Type>::inline(type_map, #crate_ref::Generics::Provided(generics))
)
Expand All @@ -174,7 +174,7 @@ pub fn derive(input: proc_macro::TokenStream) -> syn::Result<proc_macro::TokenSt
#name.into(),
#comments.into(),
#deprecated,
#sid,
Self::sid(),
IMPL_LOCATION,
<Self as #crate_ref::Type>::inline(type_map, #crate_ref::Generics::Definition)
)
Expand Down
2 changes: 1 addition & 1 deletion specta-macros/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ impl Inflection {
}
}

#[cfg(feature = "function")]
#[cfg(feature = "DO_NOT_USE_function")]
pub fn format_fn_wrapper(function: &Ident) -> Ident {
quote::format_ident!("__specta__fn__{}", function)
}
Expand Down
8 changes: 8 additions & 0 deletions specta-openapi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "openapi", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
openapiv3 = { version = "2.0.0", default-features = false, features = [] }
5 changes: 5 additions & 0 deletions specta-openapi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! [OpenAPI](https://www.openapis.org) language exporter.

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-openapi/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use openapiv3::{
ArrayType, BooleanType, NumberType, ReferenceOr, Schema, SchemaData, SchemaKind, StringType,
Expand Down
8 changes: 8 additions & 0 deletions specta-rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "rust", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
5 changes: 5 additions & 0 deletions specta-rust/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! [Rust](https://www.rust-lang.org) language exporter.

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-rust/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use specta::{DataType, Generics, Type, TypeMap};

Expand Down
8 changes: 8 additions & 0 deletions specta-serde/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "typescript", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
thiserror = "1.0.61"
5 changes: 5 additions & 0 deletions specta-serde/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
//! Serde support for Specta

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-serde/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use std::collections::HashSet;

Expand Down
8 changes: 8 additions & 0 deletions specta-swift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "swift", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
7 changes: 6 additions & 1 deletion specta-swift/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
//! [Swift](https://www.swift.org) language exporter.

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-zod` is missing `package.readme` metadata

warning: package `specta-zod` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.readme` metadata

warning: package `specta-util` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-util` is missing `package.description` metadata

warning: package `specta-util` is missing `package.description` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-typescript` is missing `package.readme` metadata

warning: package `specta-typescript` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-swift` is missing `package.readme` metadata

warning: package `specta-swift` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-serde` is missing `package.readme` metadata

warning: package `specta-serde` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-rust` is missing `package.readme` metadata

warning: package `specta-rust` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-openapi` is missing `package.readme` metadata

warning: package `specta-openapi` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-kotlin` is missing `package.readme` metadata

warning: package `specta-kotlin` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-go` is missing `package.readme` metadata

warning: package `specta-go` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta-datatype-from` is missing `package.readme` metadata

warning: package `specta-datatype-from` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata

Check warning on line 1 in specta-swift/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

package `specta` is missing `package.readme` metadata

warning: package `specta` is missing `package.readme` metadata | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cargo_common_metadata = note: `-W clippy::cargo-common-metadata` implied by `-W clippy::cargo` = help: to override `-W clippy::cargo` add `#[allow(clippy::cargo_common_metadata)]`
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc(
html_logo_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png",
html_favicon_url = "https://github.com/oscartbeaumont/specta/raw/main/.github/logo-128.png"
)]

use specta::{reference, DataType, Generics, PrimitiveType, Type, TypeMap};
use specta::{DataType, Generics, PrimitiveType, Type, TypeMap};

/// TODO
pub fn export<T: Type>() -> Result<String, String> {
Expand Down
8 changes: 8 additions & 0 deletions specta-typescript/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,20 @@ documentation = "https://docs.rs/specta-zod/latest/specta-zod"
keywords = ["async", "specta", "rspc", "typescript", "typesafe"]
categories = ["web-programming", "asynchronous"]

# /bin/sh RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --all-features
[package.metadata."docs.rs"]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[features]
default = []

# TODO: Remove this?
function = ["specta/function"]

[lints]
workspace = true

[dependencies]
specta = { path = "../specta" }
# TODO: Don't depend on serde
Expand Down
Loading

0 comments on commit 35846df

Please sign in to comment.