-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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 block.json schema to generated file #35843
Conversation
This adds the schema defintinon to the top of the generated block.json file: "$schema": "https://json.schemastore.org/block.json", This makes it easier to work with the `block.json` file in devleopment, with supported editors it offers tooltips, autocomplete, and schema validation.
Size Change: 0 B Total Size: 1.07 MB ℹ️ View Unchanged
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me (y)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little hesitant to add a URL that isn't a wordpress.org URL as the default in a generator, but maybe I'm just being overly sensitive about it. The schema can be really helpful and this will help folks find it easier, so 👍 from me.
@ajlende I think it is ok since it is "purely sugar" no functionality will break if the URL disappears, and I can't imagine a security scenario if the URL came under malicious control. |
Out of curiosity, how much work it would be to keep the schema in Gutenberg repository, possibly inside I love the idea of having a schema that could be used for validation and I'd be in favor in tighter integration into the existing tooling. One immediate idea for a follow-up for this PR would be to run https://github.com/WordPress/gutenberg/blob/trunk/bin/test-create-block.sh |
Description
This adds the schema defintinon to the top of the generated block.json
file:
This makes it easier to work with the
block.json
file in devleopment,with supported editors it offers tooltips, autocomplete, and schema
validation.
How has this been tested?
To test:
Types of changes
Updates the create-block script to add the $schema definition.
No functional change, an improvement for development.