Skip to content

feat(args): accept snake_case and kebab-case keys in bookshop validation#293

Merged
markdumay merged 2 commits intomainfrom
develop
Mar 13, 2026
Merged

feat(args): accept snake_case and kebab-case keys in bookshop validation#293
markdumay merged 2 commits intomainfrom
develop

Conversation

@markdumay
Copy link
Collaborator

For bookshop content blocks, normalize argument keys bidirectionally so that both snake_case and kebab-case pass validation without errors:

  • snake_case key not found → try kebab-case lookup (v5 InitTypes stores kebab keys); silently accepted since snake_case is the preferred style
  • kebab-case key not found → try snake_case lookup (v4 InitTypes stores snake keys); accepted with a warn-level message
  • kebab-case key found directly → accepted with a warn-level message

The guard if and $bookshop (ne $key "_default") limits the normalization to content blocks only; partials and shortcodes (using $structure) are unaffected.

markdumay and others added 2 commits March 13, 2026 08:25
For bookshop content blocks, normalize argument keys bidirectionally so
that both snake_case and kebab-case pass validation without errors:

- snake_case key not found → try kebab-case lookup (v5 InitTypes stores
  kebab keys); silently accepted since snake_case is the preferred style
- kebab-case key not found → try snake_case lookup (v4 InitTypes stores
  snake keys); accepted with a warn-level message
- kebab-case key found directly → accepted with a warn-level message

The guard `if and $bookshop (ne $key "_default")` limits the
normalization to content blocks only; partials and shortcodes
(using $structure) are unaffected.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@markdumay markdumay enabled auto-merge March 13, 2026 07:26
@markdumay markdumay merged commit d4ea134 into main Mar 13, 2026
11 checks passed
@markdumay
Copy link
Collaborator Author

🎉 This PR is included in version 5.18.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant