Turns a Noizu.Tessera.FromLit.Extractor shape descriptor into a tessera
component stub: the spec module (attr/prop/event/slot/cy DSL), a colocated
Lit-based .mjs element template, and the WTR test skeleton.
Pure functions of their arguments (the Mix task only parses args and writes
files), mirroring Noizu.Tessera.Scaffold. File layout and the WTR skeleton
are reused from Scaffold.generate/3 so a converted component is
indistinguishable from a scaffolded one.
Everything the contract grammar cannot represent is adapted LOUDLY (a warning + a comment in the generated file), never silently:
- single-word / camelCase Lit event names are kebab-cased, and hyphen-less
names are prefixed with the tag (
close→<tag>-close); - Lit
@statefields become commented-outstatedeclarations (the element DSL is all-or-nothing: state + actions + template); - custom Lit
attribute:names that differ from the snake→kebab wire name are flagged; complex (list/map) properties always ship asjson: trueprops through tsr-props; - names that fail the snake_case grammar or the snake↔camel round-trip are skipped with a warning.
Summary
Functions
Builds the stub files for shape under host project root. Returns
{files, warnings} where files is a list of {absolute_path, content}
(the caller writes them). Raises CompileError when the tag violates the
contract grammar.
Functions
@spec generate(Noizu.Tessera.FromLit.Extractor.shape(), String.t(), String.t()) :: {[{String.t(), String.t()}], [String.t()]}
Builds the stub files for shape under host project root. Returns
{files, warnings} where files is a list of {absolute_path, content}
(the caller writes them). Raises CompileError when the tag violates the
contract grammar.