refactor(components): reference the shared heading-level arguments - #2122
Conversation
heading-level and heading-class shipped in v3.19.0 as full inline definitions. They are common arguments, so they now live once in mod-utils _arguments.yml; reduce these to release-only overrides, the same shape 98 other arguments across these structures already use. Requires a mod-utils release carrying the two definitions, plus a module bump here. Until then the argument schema has no type for either key and tests/templates fails. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for gethinode-demo ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Carries the shared heading-level and heading-class definitions that section-title.yml now references. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Unblocked — gethinode/mod-utils#361 merged and released as v6.9.0, which contains only that commit, so the module bump here isolates exactly this refactor. Now green against the released module:
The example-site build is byte-for-byte identical to One caveat worth recording for anyone reproducing that comparison: |
|
🎉 This PR is included in version 3.19.3 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
What
Reduces
heading-levelandheading-classindata/structures/section-title.ymlfrom full inline definitions to release-only overrides:Why
Both shipped in v3.19.0 as complete inline definitions. They are common arguments, and common arguments are defined once in mod-utils
_arguments.yml—use-title, the booleanheading-levelreplaces, has always been a single entry there.ArgsSchema.htmlmerges the global definition with local overrides, so a key that only pinsrelease:inherits type, optionality and comment. That is the prevailing shape: 98 arguments across these structure files already use it,card-group.ymlalone accounting for twelve.Keeping the definitions inline also duplicates them into every consumer — gethinode/mod-blocks#193 currently repeats the same six-line block fourteen times, which is the immediate motivation for fixing the source.
Sequencing
Against the currently vendored mod-utils v6.8.5 the schema has no type for either key, so
assets/section-title.htmlreportsInvalid argumentsand thesection-titleassertions fail. That is the expected pre-release state, and it is exactly what the template tests added in #2116 are there to catch.Verification
Rendered against a local mod-utils carrying the two definitions, through a workspace
use. All six argument shapes are byte-identical to shipped v3.19.0:<div id="a" class="display-4 text-body pt-1">use-title: true<h1 id="b" class="display-4 text-body pt-1">heading-level: 2<h2 id="c" class="display-4 text-body pt-1 mt-0 mb-0">heading-level: 0<div id="d" class="display-4 text-body pt-1">heading-level: 1,heading-class: ""<h1 id="e" class="display-4 text-body pt-1">heading-level: 9<div id="f" class="display-4 text-body pt-1">The unset row is the one that matters most:
_arguments.ymldeliberately sets nodefault:, so an omitted level stays nil and the legacyuse-titlefallback keeps working.🤖 Generated with Claude Code