Repository navigation
refactor(web-gen): extract web-gen-core (crate split step 1, #8960) - #12876
Merged
Merged
Conversation
Convert pkgs/web-gen to a Cargo workspace (root package + crates/ web-gen-core; shared rand/futures versions pinned in [workspace.dependencies]) — step 0 (#8959) closed with the baseline recorded but the conversion unlanded, so it lands here as the mechanical prerequisite for a member crate. Move the six pure helpers verbatim from src/main.rs into web-gen-core (leaf: rand + futures only, no Leptos/wasm deps). Components call them through the web_gen_core:: path; the moved code exists solely in the new crate. Add the project's first tests: 10 unit tests for the helpers, each naming its oracle (from_str semantics, the 0..101 draw range and scaling bounds, the n..m subject walk, error pass-through). Behavior-preserving: no functional changes, no dependency version bumps, no renames beyond the crate-path move. Verified: cargo test --workspace --offline green (10 passed), cargo check --locked --offline green on stable via fleet-build-lock, cargo fmt -- --check clean.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 14 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
This was referenced Nov 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Step 1 of the pkgs/web-gen crate split (#8958): extract
web-gen-core.What
pkgs/web-genbecomes a Cargo workspace (root package +crates/web-gen-core); sharedrand/futuresversions pinned in[workspace.dependencies]. Step 0 (pkgs/web-gen crate split — step 0: workspace conversion + baselines (no code motion) #8959) closed with the baseline recorded but the conversion unlanded — the project did not build at the time — so the conversion lands here as the mechanical prerequisite for a member crate. No other step's extraction is bundled.generate_random_number,generate_divisible_i_from_n_up_to_m,generate_random_number_and_multiply,parse_input,generate_random_number_and_multiply_result,generate_random_number_and_multiply_str_future) move verbatim fromsrc/main.rsintoweb-gen-core(leaf:rand+futuresonly, no Leptos/wasm deps). The moved code now exists solely in the new crate.main.rscall the helpers through theweb_gen_core::path; imports and directrand/futuresdependencies that only the helpers used leave the binary crate.web-gen-core(the project's first tests; they were previously untested). Each test names its oracle:i32::from_strsemantics forparse_input, the0..101draw range and its scaling bounds for the random helpers, then..msubject walk with integer division for the divisible table, and error pass-through/stringification for the result/future variants.Behavior
Behavior-preserving: no functional changes, no dependency version bumps (identical versions, re-declared via the workspace), no renames beyond the crate-path move.
Verification
cargo test -p web-gen-core --offline: 10 passed, 0 failed.cargo check --locked --offline(via~/tools/fleet-build-lock, stable): passes.cargo test --workspace --offline: passes.cargo fmt -- --check: clean.Prerequisite #12274 (stable Leptos build restore) is closed via #12369, so this step's extraction is unblocked.
Closes #8960.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.