Skip to content

feat(schema): Collapsing Wrapped Primitives — processing.collapsePrimitiveWrapper (ADR-058)#166

Open
nathanacurtis wants to merge 9 commits into
release/schema-0.26.0-cli-0.22.0from
058-wrapper-collapse
Open

feat(schema): Collapsing Wrapped Primitives — processing.collapsePrimitiveWrapper (ADR-058)#166
nathanacurtis wants to merge 9 commits into
release/schema-0.26.0-cli-0.22.0from
058-wrapper-collapse

Conversation

@nathanacurtis

Copy link
Copy Markdown
Member

Summary

  • Adds Config.processing.collapsePrimitiveWrapper?: boolean (default false) — when true, a component whose root is a plain container wrapping a single text or glyph child (no meaningful container styles, no slot bindings) is collapsed: the wrapper is stripped and the leaf becomes the spec root
  • All-or-nothing across variants: if any variant fails eligibility, no collapse occurs
  • Matching ResolvedConfig.processing.collapsePrimitiveWrapper: boolean and DEFAULT_CONFIG entry
  • workspace.schema.json updated with corresponding boolean property
  • CLI specs init template and ConfigLoader validation wired up
  • Docs site: new config/collapse-primitive-wrapper.md page + nav + schema/config.md reference table

Closes ADR-058. All three validation gates pass (tsc, schema validation, test-d.ts compilation).

Test plan

  • tsc -p tsconfig.build.json --noEmit passes
  • validate-schema.sh --schema-dir packages/schema/schema passes (5/5)
  • tsc --noEmit --strict tests/*.test-d.ts passes
  • CLI tests pass (npm test in packages/cli)
  • specs init output contains collapsePrimitiveWrapper comment block

🤖 Generated with Claude Code

nathanacurtis and others added 9 commits June 16, 2026 09:23
…apse

Adds ADR 058 proposing a new boolean field `Config.processing.wrapperCollapse`
(optional, default false) that enables stripping plain container wrappers
around a single text/glyph child and promoting the leaf to spec root.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…gibility detail

- Add bulleted real-world cases (Heading, Paragraph, Body, Icon) to context
- Rename field from wrapperCollapse to collapsePrimitiveWrapper — verb-noun
  form consistent with inferNumberProps; update all options rationale
- Add explicit collapse eligibility and blocking rules to context section

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds optional boolean field to Config.processing (default false) that
enables stripping plain container wrappers around a single text/glyph child
and promoting the leaf to spec root. All-or-nothing across variants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g loader

Adds collapsePrimitiveWrapper to the specs init YAML template (commented out,
matching the inferNumberProps pattern) and to ConfigLoader validation so
non-boolean values fall back to false.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

1 participant