From de0c4028c782da97583719fe850668e816038cf8 Mon Sep 17 00:00:00 2001 From: bernhard-reiter Date: Tue, 23 Jan 2024 13:05:08 +0000 Subject: [PATCH] General: Add $schema property to block and theme JSON files. Additionally, this changeset fixes some of the `block.json` and `theme.json` files in PHPUnit tests by adding missing `title` properties to satisfy the schema. Those changes have no impact on the runtime whatsoever and do not change the result of unit tests. Note that some block and theme JSON files still aren't valid according to the schema. Fixing is underway; the required changes will be merged subsequently. Props jonsurrell, dmsnell, gziolo. Fixes #60255. git-svn-id: https://develop.svn.wordpress.org/trunk@57336 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-content/themes/twentytwentytwo/theme.json | 1 + src/wp-includes/theme.json | 1 + tests/phpunit/data/blocks/hooked-block-error/block.json | 1 + tests/phpunit/data/blocks/notice/block.json | 1 + .../data/themedir1/block-theme-child-deprecated-path/theme.json | 1 + .../themedir1/block-theme-child-with-fluid-layout/theme.json | 1 + .../block-theme-child-with-fluid-typography-config/theme.json | 1 + .../block-theme-child-with-fluid-typography/theme.json | 1 + .../themedir1/block-theme-child/blocks/example-block/block.json | 1 + tests/phpunit/data/themedir1/block-theme-child/theme.json | 1 + .../data/themedir1/block-theme-deprecated-path/theme.json | 1 + tests/phpunit/data/themedir1/block-theme-non-latin/theme.json | 1 + .../data/themedir1/block-theme-post-content-default/theme.json | 1 + .../blocks/hooked-after/block.json | 2 ++ .../blocks/hooked-before/block.json | 2 ++ .../blocks/hooked-first-child/block.json | 2 ++ .../blocks/hooked-last-child/block.json | 2 ++ .../data/themedir1/block-theme/blocks/example-block/block.json | 1 + tests/phpunit/data/themedir1/block-theme/theme.json | 1 + tests/phpunit/data/themedir1/block_theme-[0.4.0]/theme.json | 1 + tests/phpunit/data/themedir1/empty-fontface-theme/theme.json | 1 + tests/phpunit/data/themedir1/fonts-block-theme/theme.json | 1 + .../data/themedir1/subdir/block_theme-[1.0.0]/theme.json | 1 + 23 files changed, 27 insertions(+) diff --git a/src/wp-content/themes/twentytwentytwo/theme.json b/src/wp-content/themes/twentytwentytwo/theme.json index 41ffb72d98..ec9ff8644e 100644 --- a/src/wp-content/themes/twentytwentytwo/theme.json +++ b/src/wp-content/themes/twentytwentytwo/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "customTemplates": [ { diff --git a/src/wp-includes/theme.json b/src/wp-includes/theme.json index f2690bd44d..d9ed47816c 100644 --- a/src/wp-includes/theme.json +++ b/src/wp-includes/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "appearanceTools": false, diff --git a/tests/phpunit/data/blocks/hooked-block-error/block.json b/tests/phpunit/data/blocks/hooked-block-error/block.json index 346c43b5b3..fdbafa980d 100644 --- a/tests/phpunit/data/blocks/hooked-block-error/block.json +++ b/tests/phpunit/data/blocks/hooked-block-error/block.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", "name": "tests/hooked-block-error", "description": "A block that throws an error because it tries to hook a block to itself.", "blockHooks": { diff --git a/tests/phpunit/data/blocks/notice/block.json b/tests/phpunit/data/blocks/notice/block.json index 909137252a..c72c25c6df 100644 --- a/tests/phpunit/data/blocks/notice/block.json +++ b/tests/phpunit/data/blocks/notice/block.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "name": "tests/notice", "title": "Notice", diff --git a/tests/phpunit/data/themedir1/block-theme-child-deprecated-path/theme.json b/tests/phpunit/data/themedir1/block-theme-child-deprecated-path/theme.json index 38fcb1d9dd..1be2ba0116 100644 --- a/tests/phpunit/data/themedir1/block-theme-child-deprecated-path/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-child-deprecated-path/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": { diff --git a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json index 6985da16c6..710ec336df 100644 --- a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-layout/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "appearanceTools": true, diff --git a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json index 65ed480f20..dcd3745f16 100644 --- a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography-config/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "appearanceTools": true, diff --git a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json index 93234766ed..7b34524270 100644 --- a/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-child-with-fluid-typography/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "appearanceTools": true, diff --git a/tests/phpunit/data/themedir1/block-theme-child/blocks/example-block/block.json b/tests/phpunit/data/themedir1/block-theme-child/blocks/example-block/block.json index 419a332b58..3eb86f3f77 100644 --- a/tests/phpunit/data/themedir1/block-theme-child/blocks/example-block/block.json +++ b/tests/phpunit/data/themedir1/block-theme-child/blocks/example-block/block.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "title": "Example Theme Block", "name": "block-theme/example-block", diff --git a/tests/phpunit/data/themedir1/block-theme-child/theme.json b/tests/phpunit/data/themedir1/block-theme-child/theme.json index 90fe35e758..6a13dbd43a 100644 --- a/tests/phpunit/data/themedir1/block-theme-child/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-child/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": { diff --git a/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json b/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json index 38fcb1d9dd..1be2ba0116 100644 --- a/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-deprecated-path/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": { diff --git a/tests/phpunit/data/themedir1/block-theme-non-latin/theme.json b/tests/phpunit/data/themedir1/block-theme-non-latin/theme.json index f0c59a63ab..855a48a8cc 100644 --- a/tests/phpunit/data/themedir1/block-theme-non-latin/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-non-latin/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": { diff --git a/tests/phpunit/data/themedir1/block-theme-post-content-default/theme.json b/tests/phpunit/data/themedir1/block-theme-post-content-default/theme.json index 781d5ed669..2a9533972f 100644 --- a/tests/phpunit/data/themedir1/block-theme-post-content-default/theme.json +++ b/tests/phpunit/data/themedir1/block-theme-post-content-default/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "title": "Block theme", "settings": { diff --git a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-after/block.json b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-after/block.json index c9c49a5296..2e66adecc4 100644 --- a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-after/block.json +++ b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-after/block.json @@ -1,4 +1,6 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", + "title": "Hooked Block (after)", "name": "tests/hooked-after", "blockHooks": { "core/post-content": "after" diff --git a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-before/block.json b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-before/block.json index 5fbe3e43c4..800a005cce 100644 --- a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-before/block.json +++ b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-before/block.json @@ -1,4 +1,6 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", + "title": "Hooked Block (before)", "name": "tests/hooked-before", "blockHooks": { "core/navigation": "before" diff --git a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-first-child/block.json b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-first-child/block.json index b45c292b79..ae044d21ed 100644 --- a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-first-child/block.json +++ b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-first-child/block.json @@ -1,4 +1,6 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", + "title": "Hooked Block (first child)", "name": "tests/hooked-first-child", "blockHooks": { "core/comments": "firstChild" diff --git a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-last-child/block.json b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-last-child/block.json index 188c173db0..8e602902af 100644 --- a/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-last-child/block.json +++ b/tests/phpunit/data/themedir1/block-theme-with-hooked-blocks/blocks/hooked-last-child/block.json @@ -1,4 +1,6 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", + "title": "Hooked Block (last child)", "name": "tests/hooked-last-child", "blockHooks": { "core/comment-template": "lastChild" diff --git a/tests/phpunit/data/themedir1/block-theme/blocks/example-block/block.json b/tests/phpunit/data/themedir1/block-theme/blocks/example-block/block.json index 419a332b58..3eb86f3f77 100644 --- a/tests/phpunit/data/themedir1/block-theme/blocks/example-block/block.json +++ b/tests/phpunit/data/themedir1/block-theme/blocks/example-block/block.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/block.json", "apiVersion": 2, "title": "Example Theme Block", "name": "block-theme/example-block", diff --git a/tests/phpunit/data/themedir1/block-theme/theme.json b/tests/phpunit/data/themedir1/block-theme/theme.json index 982ad8ca39..06d1c44c13 100644 --- a/tests/phpunit/data/themedir1/block-theme/theme.json +++ b/tests/phpunit/data/themedir1/block-theme/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "title": "Block theme", "settings": { diff --git a/tests/phpunit/data/themedir1/block_theme-[0.4.0]/theme.json b/tests/phpunit/data/themedir1/block_theme-[0.4.0]/theme.json index 38fcb1d9dd..1be2ba0116 100644 --- a/tests/phpunit/data/themedir1/block_theme-[0.4.0]/theme.json +++ b/tests/phpunit/data/themedir1/block_theme-[0.4.0]/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": { diff --git a/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json b/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json index a9f1cb5080..92b1663112 100644 --- a/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json +++ b/tests/phpunit/data/themedir1/empty-fontface-theme/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "customTemplates": [ { diff --git a/tests/phpunit/data/themedir1/fonts-block-theme/theme.json b/tests/phpunit/data/themedir1/fonts-block-theme/theme.json index a8212b79e1..a5d40da2b5 100644 --- a/tests/phpunit/data/themedir1/fonts-block-theme/theme.json +++ b/tests/phpunit/data/themedir1/fonts-block-theme/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 2, "settings": { "appearanceTools": true, diff --git a/tests/phpunit/data/themedir1/subdir/block_theme-[1.0.0]/theme.json b/tests/phpunit/data/themedir1/subdir/block_theme-[1.0.0]/theme.json index 38fcb1d9dd..1be2ba0116 100644 --- a/tests/phpunit/data/themedir1/subdir/block_theme-[1.0.0]/theme.json +++ b/tests/phpunit/data/themedir1/subdir/block_theme-[1.0.0]/theme.json @@ -1,4 +1,5 @@ { + "$schema": "https://schemas.wp.org/trunk/theme.json", "version": 1, "settings": { "color": {