Skip to content

Commit

Permalink
Add JSON Schema for .wp-env.json files (WordPress#36276)
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
6 people authored and patil-vipul committed Jun 17, 2024
1 parent 480e363 commit c34cdfe
Showing 1 changed file with 107 additions and 0 deletions.
107 changes: 107 additions & 0 deletions schemas/json/.wp-env.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
{
"title": "JSON schema for WordPress wp-env configuration files",
"$schema": "http://json-schema.org/draft-04/schema#",
"definitions": {
"//": {
"reference": "https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/"
},
"wpEnvProperties": {
"properties": {
"core": {
"description": "The WordPress installation to use. If null is specified, wp-env will use the latest production release of WordPress.",
"default": null,
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"phpVersion": {
"description": "The PHP version to use. If null is specified, wp-env will use the default version used with production release of WordPress.",
"default": null,
"oneOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"plugins": {
"description": "A list of plugins to install and activate in the environment.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"themes": {
"description": "A list of themes to install in the environment.",
"default": [],
"type": "array",
"items": {
"type": "string"
}
},
"port": {
"description": "The primary port number to use for the installation. You'll access the instance through the port: 'http://localhost:8888'.",
"default": 8888,
"type": "integer"
},
"config": {
"description": "Mapping of wp-config.php constants to their desired values.",
"default": {},
"type": "object"
},
"mappings": {
"description": "Mapping of WordPress directories to local directories to be mounted in the WordPress instance.",
"default": {},
"type": "object"
}
}
}
},
"type": "object",
"allOf": [
{
"$ref": "#/definitions/wpEnvProperties"
},
{
"properties": {
"$schema": {
"type": "string"
},
"env": {
"description": "The key env is available to override any of the above options on an individual-environment basis.",
"type": "object",
"default": {},
"patternProperties": {
"[a-zA-Z]": {
"type": "object",
"$ref": "#/definitions/wpEnvProperties",
"additionalProperties": false
}
}
}
}
},
{
"properties": {
"$schema": {},
"core": {},
"phpVersion": {},
"plugins": {},
"themes": {},
"port": {},
"config": {},
"mappings": {},
"env": {}
},
"additionalProperties": false
}
]
}

0 comments on commit c34cdfe

Please sign in to comment.