Repository navigation
wp-env: Update JSON Schema with missing properties and add README docs #76115
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
Changes from 3 commits
0c80e5b
02cf17b
38fdeab
a256c5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -24,7 +24,8 @@ | |
| "description": "The PHP version to use. If null is specified, wp-env will use the default version used with production release of WordPress.", | ||
| "oneOf": [ | ||
| { | ||
| "type": "string" | ||
| "type": "string", | ||
| "pattern": "^[0-9]+\\.[0-9]+$" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also wondering if this should match the runtime validator regex in checkVersion This is a bit stricter, allowing I'm looking at version_compare for examples. What do you think?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the thorough review! All three items addressed:
|
||
| }, | ||
| { | ||
| "type": "null" | ||
|
|
@@ -51,16 +52,37 @@ | |
| "port": { | ||
| "description": "The primary port number to use for the installation. You'll access the instance through the port: http://localhost:8888", | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 65535, | ||
| "default": 8888 | ||
| }, | ||
| "mysqlPort": { | ||
| "description": "The port number for the MySQL database. If null, the port is not exposed.", | ||
| "oneOf": [ | ||
| { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 65535 | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "config": { | ||
| "description": "Mapping of wp-config.php constants to their desired values.", | ||
| "type": "object", | ||
| "additionalProperties": { | ||
| "type": [ "string", "number", "boolean" ] | ||
|
kraftbj marked this conversation as resolved.
Resolved
|
||
| }, | ||
| "default": {} | ||
| }, | ||
| "mappings": { | ||
| "description": "Mapping of WordPress directories to local directories to be mounted in the WordPress instance.", | ||
| "type": "object", | ||
| "additionalProperties": { | ||
| "type": "string" | ||
| }, | ||
| "default": {} | ||
| }, | ||
| "phpmyadmin": { | ||
|
|
@@ -70,7 +92,16 @@ | |
| }, | ||
| "phpmyadminPort": { | ||
| "description": "The port number to access phpMyAdmin. Setting this also enables phpMyAdmin.", | ||
| "type": "integer" | ||
| "oneOf": [ | ||
| { | ||
| "type": "integer", | ||
| "minimum": 1, | ||
|
kraftbj marked this conversation as resolved.
Resolved
|
||
| "maximum": 65535 | ||
| }, | ||
| { | ||
| "type": "null" | ||
| } | ||
| ] | ||
| }, | ||
| "multisite": { | ||
| "description": "Whether to set up a multisite installation.", | ||
|
|
@@ -85,6 +116,7 @@ | |
| "plugins", | ||
| "themes", | ||
| "port", | ||
| "mysqlPort", | ||
| "config", | ||
| "mappings", | ||
| "phpmyadmin", | ||
|
|
@@ -124,13 +156,20 @@ | |
| "testsPort": { | ||
| "description": "The port number for the test site. You'll access the instance through the port: http://localhost:8889", | ||
| "type": "integer", | ||
| "minimum": 1, | ||
| "maximum": 65535, | ||
| "default": 8889 | ||
| }, | ||
| "testsEnvironment": { | ||
| "description": "Whether to create the tests environment. Set to false to skip creating test containers, saving resources.", | ||
| "type": "boolean", | ||
| "default": true | ||
| }, | ||
| "autoPort": { | ||
| "description": "Whether to automatically find available HTTP ports when configured ports are busy.", | ||
| "type": "boolean", | ||
| "default": false | ||
| }, | ||
| "lifecycleScripts": { | ||
| "description": "Mapping of commands that should be executed at certain points in the lifecycle.", | ||
| "type": "object", | ||
|
|
@@ -144,6 +183,14 @@ | |
| "description": "Runs after wp-env clean has finished cleaning the environment.", | ||
| "type": "string" | ||
| }, | ||
| "afterReset": { | ||
| "description": "Runs after wp-env reset has finished resetting the environment.", | ||
| "type": "string" | ||
| }, | ||
| "afterCleanup": { | ||
| "description": "Runs after wp-env cleanup has finished cleaning up the environment.", | ||
| "type": "string" | ||
| }, | ||
| "afterDestroy": { | ||
| "description": "Runs after wp-env destroy has destroyed the environment.", | ||
| "type": "string" | ||
|
|
@@ -165,6 +212,7 @@ | |
| "env", | ||
| "testsPort", | ||
| "testsEnvironment", | ||
| "autoPort", | ||
| "lifecycleScripts" | ||
| ] | ||
| } | ||
|
|
||
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 think this is a good to have regardless of whether we have a new schema doc or keep on using
https://schemas.wp.org/trunk/wp-env.json👍🏻