Skip to content

Create a Schemas Package #35927

Closed
Closed

Description

What problem does this address?

Recently schema definitions for theme.json and block.json were uploaded to the SchemaStore.org (theme.json, and block.json).

Using JSON schemas makes it easier for development. Supported editors can show tooltips, autocomplete, and validation issues. Documenation on using schemas were added in: #35835 #35739

The SchemaStore.org is a global open collection of JSON schemas, plus includes good documentation on using schemas. So it is still worthwhile to list our schemas there, as developers may look there to use them as it gets popular.

@gziolo brought up in #35902 (comment) and #35843 (comment) that we should have a definitive source in the Gutenberg repo, which could also be used for validation during the build processs.

What is your proposed solution?

We should create a "schemas" package at "@wordpress/schemas" to hold the definitive schemas definitions, these can by copied to the SchemaStore to keep in-sync. Another benefit of having the schemas in the Gutenberg repo is they would also get versioned with tags/branches related to the releases, for example the WP 5.8 could be:
https://github.com/WordPress/gutenberg/tree/wp/5.8/packages/schemas/block.json

Questions

The schema store has three directories, js, ,css, and json and the schemas are nested there.

@gziolo mentions in #35902 (comment) that there are i18n configs that could find a home in the schemas package.

So what directory structure should we use in the package?

My suggestion for flexibility to create: a json/ directory to start and store them there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

Developer ExperienceIdeas about improving block and theme developer experienceGood First IssueAn issue that's suitable for someone looking to contribute for the first time[Feature] Block APIAPI that allows to express the block paradigm.[Status] In ProgressTracking issues with work in progress[Type] Code QualityIssues or PRs that relate to code quality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions