-
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 JSON Schema for .wp-env.json
files
#36276
Conversation
I came across this PR while checking past PRs. I also strongly agree with adding this schema 👍 Is it possible to move forward with this PR? |
@t-hamano where I failed / left off this PR was in my lack of understanding for how the recursive / nested structure of the |
Great idea, let's bring it to the finish line.
@ajlende, are you able to share any insights that would unblock it? |
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 not really familiar with wp-env at all—I don't use it myself—but I tried taking a look and guessing at what the intention was.
Hopefully I've made the correct assumptions and my explanations make sense.
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Co-authored-by: Alex Lende <alex+github.com@lende.xyz>
Co-authored-by: Alex Lende <alex+github.com@lende.xyz>
Co-authored-by: Alex Lende <alex+github.com@lende.xyz>
Co-authored-by: Alex Lende <alex+github.com@lende.xyz>
Co-authored-by: Alex Lende <alex+github.com@lende.xyz>
e236788
to
ddb79bc
Compare
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org> Co-authored-by: ajlende <ajlende@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: PerryRylance <perryrylance@git.wordpress.org>
If the
It should allow that property, or possibly even better use the schema to parse configuration. I created #62619 to track this. |
Warning: Type of PR label mismatch To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.
Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task. |
I added the I'm wondering if this schema should be versioned along with WordPress releases, though? Would it make more sense to add redirects for Gutenberg releases ( One thing of note with both of those is that they're just tags, so we can't backport missing schema changes like we can with the WordPress releases. We'd have to have some way of finding the latest patch version to redirect if we don't want folks to have to update their |
This makes sense to me. |
I just cherry-picked this PR to the wp/6.6-rc-1 branch to get it included in the next release: 990f23a |
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org> Co-authored-by: ajlende <ajlende@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: PerryRylance <perryrylance@git.wordpress.org>
Co-authored-by: fabiankaegy <fabiankaegy@git.wordpress.org> Co-authored-by: ajlende <ajlende@git.wordpress.org> Co-authored-by: t-hamano <wildworks@git.wordpress.org> Co-authored-by: gziolo <gziolo@git.wordpress.org> Co-authored-by: PerryRylance <perryrylance@git.wordpress.org>
FWIW this schema is missing things like |
Thank you for noticing. I compared the env specification and schema again, and as far as I can tell, the following fields are not defined:
|
Note: The JSON schema itself is not included in WordPress releases, it exists in the GitHub repository and is simply referenced from the JSON files. Therefore, if additional fixes can’t be made in time for the WP6.6 release, they can be committed to the |
@t-hamano I can't find any reference that shows the actual URL of the schema for users to start using it - and I don't see any documentation for it in the package reference. If there's a preferred URL to the hosted schema I'm happy to add a PR to get this in the package docs: https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/#wp-env-json |
Thanks for pointing that out! I definitely think references are necessary. The README for the schema itself will also need to be updated. |
Description
This PR adds a JSON Schema for
.wp-env.json
files.Closes #36275