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 schemas package #35998

Merged
merged 10 commits into from
Nov 1, 2021
Merged
Show file tree
Hide file tree
Changes from 4 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
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1775,6 +1775,12 @@
"markdown_source": "../packages/rich-text/README.md",
"parent": "packages"
},
{
"title": "@wordpress/schemas",
"slug": "packages-schemas",
"markdown_source": "../packages/schemas/README.md",
"parent": "packages"
},
{
"title": "@wordpress/scripts",
"slug": "packages-scripts",
Expand Down
1 change: 1 addition & 0 deletions packages/schemas/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
5 changes: 5 additions & 0 deletions packages/schemas/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## Unreleased

Initial release.
34 changes: 34 additions & 0 deletions packages/schemas/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Schemas

The collection of schemas used in WordPress, including the `theme.json` schema, and `block.json` schemas.

## Installation

Install the module

```shell
$ npm install @wordpress/schemas --save-dev
```

## Usage

JSON schemas are used by code editors to offer tooltips, autocomplete, and validation. To use in your JSON file, add the `$schema` property to the top of the file with the value of the schema URL.

For example, in your `block.json` file you would add:

```json
{
"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/trunk/packages/schemas/json/block.json"
mkaz marked this conversation as resolved.
Show resolved Hide resolved
}
```

## SchemaStore.org

[SchemaStore.org](https://schemastore.org) is an open collection of schemas, including the WordPress `theme.json` and `block.json` schemas. Any changes to schemas in this package should be mirror there.

To update on SchemaStore, create a PR at their repository [SchemaStore/schemastore](https://github.com/SchemaStore/schemastore/). The files can be found in their reposiory at:

- block.json: `src/schemas/json/block.json`
- theme.json: `src/schemas/json/theme-v1.json`

<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
390 changes: 390 additions & 0 deletions packages/schemas/json/block.json

Large diffs are not rendered by default.

Loading