Skip to content

Conversation

@darrell-roberts
Copy link
Member

@darrell-roberts darrell-roberts commented Oct 23, 2025

Using typeshared types may be behind a feature and as such the annotation would be something like #[cfg_attr(feature = "typeshare-support", typeshare)].

This PR adds support for generating typeshare types using a cfg_attr condition.

I'll be adding this to #274 then porting it back into typeshare2

Other changes:

  • Update and add snapshot testing back to CI
  • Update and add deterministic testing back to CI
  • Fix all clippy errors
  • Add back logger and info statements

@darrell-roberts darrell-roberts changed the base branch from main to typeshare2 October 23, 2025 21:49
@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch from 57eaecf to e27fbec Compare October 23, 2025 21:49
@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch 3 times, most recently from 610c8a4 to 727040e Compare October 25, 2025 17:24
@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch from 727040e to 2b5e06a Compare October 25, 2025 17:28
@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch from b39c251 to a59412b Compare October 25, 2025 20:35
Copy link
Contributor

@Progdrasil Progdrasil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works perfectly for 1Password/passkey-rs#68

@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch 3 times, most recently from 8141de6 to 0b44d4a Compare October 28, 2025 15:00
@darrell-roberts darrell-roberts force-pushed the darrell/allow-cfg-attr-typeshare branch from 0b44d4a to 60087a4 Compare October 28, 2025 15:08
@darrell-roberts darrell-roberts changed the title allow cfg attr typeshare allow cfg attr typeshare -> typeshare2 Oct 28, 2025
Copy link
Collaborator

@smcgovern-proj smcgovern-proj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and works locally (with the caveat that I'm not the most familiar with syn as a lib/syn-related idioms.) Thanks a bunch for making the QOL improvements like doc comments + logger.

@darrell-roberts darrell-roberts merged commit 99401f1 into typeshare2 Oct 31, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants