Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add local dev notes to aid when doing work on schemas #41968

Merged
merged 1 commit into from
Jun 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions schemas/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,30 @@ For a specific version of the schema, replace `trunk` with `wp/X.X`:

Visual Studio Code and PhpStorm are two popular editors that work out of the box. However, some editors require a plugin installed, and not all editors recognize the `$schema` property. Check your editor's documentation for details. Additionally, [SchemaStore.org](https://www.schemastore.org/) and [JSON Schema](https://json-schema.org/implementations.html#editors) have lists of editors known to have support if your current editor is unsupported.

## Local Development

You may wish to update one of the schemas to conform to a new change in the structure. In order to do this you'll want to be able to see how your changes impact how your IDE displays schema information.

To allow this you will need to:

- update your theme's `theme.json` to reference the _local_ version of the schema file:

```json
{
"$schema": "file://{{FULL_FILE_PATH}}/schemas/json/theme.json"
}
```

- update your block's `block.json` to include:

```json
{
"$schema": "file://{{FULL_FILE_PATH}}/schemas/json/block.json"
}
```

Be sure to replace `{{FULL_FILE_PATH}}` with the full local path to your Gutenberg repo.

With this in place you should now be able to edit either `schemas/json/theme .json` or `schemas/json/block.json` in order to see changes reflected in `theme.json` or `block.json` in your IDE.

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>