block-experiments
block-experiments copied to clipboard
Improve support for block directory
A block.json
file is needed for the wordpress.org block directory. This should be added, either manually for each plugin, or as part of the bundling process.
For example: https://jhalabi.com/blog/gutenberg-block-json
https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md https://make.wordpress.org/plugins/2020/07/11/you-can-now-add-your-own-plugins-to-the-block-directory/ https://make.wordpress.org/core/2021/06/23/block-api-enhancements-in-wordpress-5-8/
For reference, this is the direct link to the validator.
https://wordpress.org/plugins/developers/block-plugin-validator/
These are some notes from my experience publishing the Sketch block:
This block already had the block.json
file present when first published...
- Adding the tag
block
to the readme.txt file made the plugin show in this listing https://wordpress.org/plugins/browse/block - I "think" what ended up making it finally show in the inserter was the addition of the keys
style
,editorStyle
, andeditorScript
to the block.json file. Though I'm not quite sure if this was the last thing needed, as it seemed there was some caching on the inserter search. I kept typingsketch
on the inserter but the block still didn't appear after doing all of the above... Eventually I typeddrawing
which was one of the tags the plugin readme shows... It seems like at that point, the cache missed, and then the block started showing. After that, searching forsketch
again started working as expected by showing the block
Took the liberty to take action on the Waves, Starscape and Bauhaus plugins by doing the following
- Adding
block
andblocks
tags to their readme files. - Adding
editorScript
,editorStyle
andstyle
keys to their block.json
@ajlende I also took the liberty of bumping those plugins versions (hotfix number) so they'd be ready for a release on the plugin directory.
- Bauhaus Centenary to 1.0.3 #219
- Waves to 1.0.2 #220
- Starscape to 1.0.3 #221
Please excuse if I did wrong here. Feel free to roll back (or I can do it) if these PRs were undesired. On the other hand I'd be glad to handle the publishing of these releases if you provide me with commit access to those plugins on the .org directory
@oskosk I added you as a committer to them all. Thanks so much for fixing them all up!
Bauhaus, Waves and Starscape now show on the inserter too 🥳