Skip to content

refactor: deduplicate config defaults into CONFIG_DEFAULTS constant#1708

Merged
trek-e merged 1 commit intomainfrom
refactor/deduplicate-config-defaults
Apr 4, 2026
Merged

refactor: deduplicate config defaults into CONFIG_DEFAULTS constant#1708
trek-e merged 1 commit intomainfrom
refactor/deduplicate-config-defaults

Conversation

@jeremymcs
Copy link
Copy Markdown
Collaborator

Summary

  • Extracts config defaults from loadConfig() into an exported CONFIG_DEFAULTS constant in core.cjs
  • config.cjs buildNewProjectConfig() now references CONFIG_DEFAULTS for shared scalar values
  • verify.cjs cmdHealthCheck() config repair now references CONFIG_DEFAULTS
  • Prevents silent divergence if a default value is changed in one location but not others

Fixes #1707

Test plan

  • All 2156 tests pass
  • Verify gsd-tools.cjs config-new-project produces same config as before
  • Verify gsd-tools.cjs health --fix config repair produces same config as before

Fixes #1707

Extracts config defaults from loadConfig() into an exported
CONFIG_DEFAULTS constant in core.cjs. config.cjs and verify.cjs
now reference CONFIG_DEFAULTS instead of duplicating values,
preventing future divergence.
@jeremymcs jeremymcs requested a review from glittercowboy as a code owner April 4, 2026 20:06
Copy link
Copy Markdown
Collaborator

@trek-e trek-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clean DRY refactoring. CONFIG_DEFAULTS in core.cjs as the single source of truth is the right approach. Verified that config.cjs and verify.cjs now reference it instead of duplicating values. All CI green. LGTM.

@trek-e trek-e merged commit 7712595 into main Apr 4, 2026
5 checks passed
@trek-e trek-e deleted the refactor/deduplicate-config-defaults branch April 4, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor: deduplicate config defaults across core.cjs, config.cjs, and verify.cjs

2 participants