fix(cli): read module-path from config when no generate entries exist#4482
Open
sehawq wants to merge 4 commits intoclockworklabs:masterfrom
Open
fix(cli): read module-path from config when no generate entries exist#4482sehawq wants to merge 4 commits intoclockworklabs:masterfrom
sehawq wants to merge 4 commits intoclockworklabs:masterfrom
Conversation
bfops
reviewed
Feb 27, 2026
bfops
requested changes
Feb 27, 2026
Collaborator
bfops
left a comment
There was a problem hiding this comment.
Thank you for opening a PR for this! Unfortunately I'm getting a different error in this case now.
When spacetime.json has module-path at the root level but no generate block, spacetime generate ignored it and defaulted to spacetimedb/. The fallback path in exec_ex() created a CommandConfig with an empty HashMap, discarding entity-level fields from the config. Fix by passing the root config's additional_fields instead. Closes clockworklabs#4475
ed71ce1 to
1a8bbf0
Compare
Author
|
@bfops Can you check again? |
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.
When spacetime.json has module-path at the root level but no generate block, spacetime generate ignores it and defaults to spacetimedb/.
The fallback path in exec_ex() created a CommandConfig with an empty HashMap, discarding entity-level fields from the config. Fix by passing the root config's additional_fields instead.
Closes #4475
Description of Changes
When spacetime.json contains module-path at the root level but no generate block, spacetime generate ignores the configured path and defaults to spacetimedb/. The root cause is in exec_ex(): when get_filtered_generate_configs() returns empty (no generate entries), the fallback CommandConfig was created from an empty HashMap, discarding module-path from the root entity's additional_fields. Fixed by passing loaded.config.additional_fields.clone() instead of HashMap::new().
API and ABI breaking changes
None. This is a bug fix that makes the existing module-path config option work as documented.
Expected complexity level and risk
1 - Trivial. Single line change from HashMap::new() to loaded.config.additional_fields.clone() in the fallback path. The existing code paths for configs with generate entries are unaffected.
Testing
Added regression test test_root_module_path_without_generate_entries_is_forwarded that validates module-path from root config without generate entries is properly forwarded. Existing tests remain unmodified and should continue to pass.