fix: make registry blocks pass lint errors#564
Conversation
f567637 to
d7c6b77
Compare
d7c6b77 to
c92a074
Compare
jrusso1020
left a comment
There was a problem hiding this comment.
LGTM — addresses both issue #559 (flowchart template-literal selectors) and the registry-block false-positive concern I flagged on #523.
Two-pronged exclusion strategy for composition_file_too_large / timeline_track_too_dense:
- Path-based skip when
filePathmatchesregistry/blocks/<name>/<name>.html— for hyperframes-oss source files - Magic-comment marker
<!-- hyperframes-registry-item: <name> -->injected by the installer when fetching block composition files; lint rule scans first 512 bytes for this marker
This is the right shape — durable across moves, explicit, and survives copy-paste of installed blocks. Test coverage in composition.test.ts exercises both paths (source skip, installed skip, normal file warn) and add.test.ts verifies the marker is actually injected during install.
Issue #559 fix: flowchart.html and 18 sibling registry blocks updated to add data-start="0" on roots, class="clip" on timed elements, and most importantly the flowchart block swaps `${S} #node-X` template literals for S + " #node-X" string concatenation. Net: registry blocks are now lint-clean out of the box.
Tests: @hyperframes/core 563/563 + @hyperframes/cli 180/180 pass.
— Review by Rames Jusso
Problem
Closes #559.
The catalog
flowchartblock emitted HyperFrames' owntemplate_literal_selectorlint error out of the box afterhyperframes add flowchart. After the registry cleanup pass, the installed block also still carried thecomposition_file_too_largewarning, so the issue repro was not fully lint-clean for users.What this fixes
flowchartselector construction from template interpolation to explicit string concatenation.data-start="0"to registry block roots that were missing it.class="clip"to invisible driver elements that already carry timing attributes.window.__timelinesbeforeui-3d-revealregisters its timeline.Root cause
flowchartused a hardcoded selector constant but then interpolated it through template literals, which still tripstemplate_literal_selector. Separately, registry catalog files are curated distribution artifacts; treating those source or installed third-party blocks exactly like user-authored compositions made the 300-line authoring advisory show up for content users did not write.Verification
Local checks
lintHyperframeHtml(..., { isSubComposition: true })->files=39 composition_file_too_large=0 errors=0/tmp/hf-flowchart-installed-qaproject using a local registry server, thenhyperframes add flowchartandhyperframes lint->0 errors, 0 warningscompositions/flowchart.htmlstarts with<!-- hyperframes-registry-item: flowchart -->bun run --filter @hyperframes/core test src/lint/rules/composition.test.ts-> 36 passedbun run --filter @hyperframes/cli test src/commands/add.test.ts-> 11 passedbun run lintbun run --filter @hyperframes/core typecheckbun run --filter @hyperframes/cli typecheckbun run build:hyperframes-runtimebunx oxfmt --checkon changed filesgit diff --checkBrowser verification
/tmp/hf-flowchart-qaembedding the patchedflowchart.html.http://localhost:5194withagent-browser.qa-artifacts/issue-559/flowchart-2s.pngqa-artifacts/issue-559/flowchart-playback.webmNotes
The large-file advisory still applies to plain user-authored compositions over 300 lines. The exemption is limited to registry source files shaped like
registry/blocks/<block>/<block>.htmland installed block files carrying the registry provenance marker.