-
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 schemas package #35998
Add schemas package #35998
Conversation
Creates a new package to hold the block.json and theme.json files that can then be synced to the SchemaStore. We want a package within Gutenberg so we can use the schemas internally to validate package files such as blocks in the block-library as well as generate documentation. Closes #35927
I think you still need to run I had only one comment about the URL to use when referencing schemas. |
Size Change: 0 B Total Size: 1.08 MB ℹ️ View Unchanged
|
Yep, the post-commit hook did it for me. Committed here: f7107d9 |
@oandregal Andre might want to take a look at this PR as well. |
I had this thought yesterday. Do we really need an npm package for those schemas? Could we just create a |
@gziolo Good question, I only did NPM because it seems like everything is NPM. There's no JavaScript or reason it needs to be a full package. We just need a full public URL, and I think we can do a redirect that would be even better. Microsoft uses a redirect for their terminal schema: https://aka.ms/terminal-profiles-schema It'd be nice if can do something similar like: |
The trick that Microsft does with the redirect is excellent. I love the idea. We only need to decide whether to introduce an npm package for the schemas or it's enough to put it in the top-level folder of the Gutenberg repository. |
How do we see managing versions of the schema files? There is an interesting conversation happing in SchemaStore/schemastore#1907 about having distinct versions for theme.json files. They may need to be managed differently than block.json when adding or deprecating items. |
Versioning is also something I planned to look at for the docs. I'm unsure how to do it given the limited options we have in the handbook but was thinking of perhaps adding different sections and/or try to use the |
Ok, I've moved the schemas out to a top-level folder. I'm not sure how to manage for documentation but for the schemas themself we can always use the repository tags for the release if people need specific versions. |
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.
Nice, it should be great for start. As discussed, ideally we cold have some shorter public URL to use in the documentation and for block and theme authors.
As discussed in #35998 (comment) the category field is no longer mandatory. The documentation wasn't fully updated even though there was already the following sentence included at the time it became optional: > An implementation should expect and tolerate unknown categories, providing some reasonable fallback behavior (e.g. a "text" category).
I opened PR against the SchemaStore to propagate the changes for the |
Description
Creates a new package to hold the block.json and theme.json files that can then be synced to the SchemaStore.
We want a package within Gutenberg so we can use the schemas internally to validate package files such as blocks in the block-library as well as generate documentation.
Closes #35927
How has this been tested?
I followed the package creation instructions. I think this might be my first one being created, so double checking would be 👍
There are no source files in the sense of anything being built, they are files for reference or config, so I used the package.json
files: []
to list them.Types of changes