-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add JSON Schema for
.wp-env.json
files (#36276)
Co-authored-by: fabiankaegy <[email protected]> Co-authored-by: ajlende <[email protected]> Co-authored-by: t-hamano <[email protected]> Co-authored-by: gziolo <[email protected]> Co-authored-by: PerryRylance <[email protected]>
- Loading branch information
Showing
1 changed file
with
107 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
] | ||
} |