diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7410994..48eb9f9 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: # the vX.Y.Z tag — and the tag triggers the GoReleaser workflow. - uses: changesets/action@v1 with: - version: npx changeset version + version: npm run version # changeset version + sync rust/Cargo.toml (lockstep) publish: npm run release env: # A PAT (contents:write + pull-requests:write on this repo) lets the diff --git a/rust/src/lib.rs b/rust/src/lib.rs index da97063..515d079 100644 --- a/rust/src/lib.rs +++ b/rust/src/lib.rs @@ -139,6 +139,16 @@ pub mod prelude { #[macro_export] macro_rules! shellcade_game { ($game:expr) => { + // Native builds (cargo test) have no exports, so the registration is + // surfaced as a doc-hidden pub fn instead: it type-checks the Game + // impl, roots the whole game for dead-code analysis, and hands tests + // a constructor. + #[cfg(not(target_arch = "wasm32"))] + #[doc(hidden)] + pub fn __shellcade_game() -> impl $crate::Game { + $game + } + #[cfg(target_arch = "wasm32")] const _: () = { ::std::thread_local! {