Skip to content

theme.json v1 schema and validator #5

@tayebmokni

Description

@tayebmokni

Summary

Define the canonical theme.json v1 JSON Schema and ship a validator used at install time, in CI, and in the admin theme installer. The schema must cover settings (color, typography, spacing, layout, border, shadow, blocks), styles, supports, patterns, customTemplates, and templateParts. Output is published at https://gonext.dev/schemas/theme.json/v1.

Design reference

  • docs/03-theme-system.md §3 (theme.json Specification)
  • docs/03-theme-system.md §3.3 (Differences from WordPress's theme.json)

Acceptance criteria

  • JSON Schema document published at the v1 URL, also vendored in-repo
  • Covers every key in the §3.1 example
  • Validator function exposed as a Go package and a TS module (shared fixtures)
  • Rejects unknown top-level keys
  • Validates spacing.spacingScale (operator, increment, steps, mediumStep, unit)
  • Validates fluid font sizes (fontSizes[].fluid.min/max)
  • Test suite of valid and invalid fixtures (≥20 cases)
  • CLI: gonext theme validate ./my-theme/theme.json returns non-zero on failure with readable diagnostics

Dependencies

none

Complexity

M

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions