Problem
The wasm backend supports hand-written Rust modules in the binding crate (custom_rust_modules emits their pub mod declarations into the generated lib.rs), but the generated Cargo.toml has no way to carry [dev-dependencies]. Hand-written test files therefore cannot compile: an in-crate #[wasm_bindgen_test] suite needs wasm-bindgen-test as a dev-dependency, and the only routes today are hand-editing a DO-NOT-EDIT manifest (reverted on the next alef generate) or abusing extra_dependencies, which ships test-only crates as real dependencies of the published package.
Concretely in kreuzberg: xberg-io/xberg#1259 adds hand-written bridge/engine modules to crates/xberg-wasm through custom_rust_modules. The wasm-bindgen-test suites contributed for that code by @jamon8888 could not be carried into the crate and had to be ported to the JS e2e harness instead, because the generated manifest cannot declare the test harness.
Solution
Add extra_dev_dependencies to [crates.wasm], mirroring the existing per-language extra_dependencies (a name to toml value table). The wasm Cargo.toml generator emits a [dev-dependencies] section between [dependencies] and the target-specific block when the table is non-empty: sorted, string values quoted, structured values passed through. An empty table emits nothing, so existing projects regenerate byte-identically.
Problem
The wasm backend supports hand-written Rust modules in the binding crate (
custom_rust_modulesemits theirpub moddeclarations into the generated lib.rs), but the generated Cargo.toml has no way to carry[dev-dependencies]. Hand-written test files therefore cannot compile: an in-crate#[wasm_bindgen_test]suite needswasm-bindgen-testas a dev-dependency, and the only routes today are hand-editing a DO-NOT-EDIT manifest (reverted on the nextalef generate) or abusingextra_dependencies, which ships test-only crates as real dependencies of the published package.Concretely in kreuzberg: xberg-io/xberg#1259 adds hand-written
bridge/enginemodules tocrates/xberg-wasmthroughcustom_rust_modules. Thewasm-bindgen-testsuites contributed for that code by @jamon8888 could not be carried into the crate and had to be ported to the JS e2e harness instead, because the generated manifest cannot declare the test harness.Solution
Add
extra_dev_dependenciesto[crates.wasm], mirroring the existing per-languageextra_dependencies(a name to toml value table). The wasm Cargo.toml generator emits a[dev-dependencies]section between[dependencies]and the target-specific block when the table is non-empty: sorted, string values quoted, structured values passed through. An empty table emits nothing, so existing projects regenerate byte-identically.