Skip to content

feat: extend config merge with non-plugin field semantics#254

Merged
indaco merged 4 commits intomainfrom
feat/per-module-full-config-merge
Apr 2, 2026
Merged

feat: extend config merge with non-plugin field semantics#254
indaco merged 4 commits intomainfrom
feat/per-module-full-config-merge

Conversation

@indaco
Copy link
Copy Markdown
Owner

@indaco indaco commented Apr 2, 2026

Description

MergePluginConfig previously only merged plugin pointer fields, copying all non-plugin fields (Theme, Extensions, PreReleaseHooks) directly from root. This PR renames it to MergeConfig and adds field-by-field merge semantics:

Field Strategy
Path Always root
Workspace Always root
Theme Module wins if non-empty, else root
Extensions Additive merge, deduplicated by Name (module wins on conflict)
PreReleaseHooks Additive merge (root hooks first, then module hooks appended)

Related Issue

  • None

Notes for Reviewers

  • All slice fields are deep-copied to prevent mutation of the root config. A deprecated MergePluginConfig alias is preserved for backward compatibility. Both existing call sites (helpers.go, tagcmd.go) updated to use MergeConfig.

indaco added 4 commits April 2, 2026 14:35
…ions, hooks)

Rename MergePluginConfig to MergeConfig (deprecated alias preserved).
Theme: module wins if set. Extensions: additive merge deduplicated by name.
PreReleaseHooks: additive merge (root first, then module). All slice fields
are deep-copied to prevent mutation of root config.
Add TestMergeConfig_Theme, TestMergeConfig_Extensions_Additive,
TestMergeConfig_PreReleaseHooks_Additive, TestMergeConfig_DeepCopy,
TestMergeConfig_PathAlwaysRoot, TestMergeConfig_WorkspaceAlwaysRoot.
@indaco indaco added the enhancement New feature or request label Apr 2, 2026
@indaco indaco merged commit ae92886 into main Apr 2, 2026
7 checks passed
@indaco indaco deleted the feat/per-module-full-config-merge branch April 2, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant