From 1619d9fddb8b0cb19618de4bf24472f00150a924 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 20 Nov 2019 12:06:20 -0800 Subject: [PATCH 1/2] Add documentation for wp-env.json config file --- packages/env/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/env/README.md b/packages/env/README.md index 738394281ca0e4..4f59428c3603aa 100644 --- a/packages/env/README.md +++ b/packages/env/README.md @@ -68,3 +68,28 @@ Positionals: ```

Code is Poetry.

+ +## The Configuration File + +You may also specify a configuration file for `wp-env`. This can be useful for loading other themes and plugins that you are developing simultaneously. The script will attach the specified theme and plugin directories as volumes on the docker container so that changes you make to them exist in the WordPress instance. + +### Example: +The config file is plain JSON with the name `wp-env.json`. The format of the file looks like this: + +`wp-env.json` +```json +{ + "themes": [ + "../path/to/theme/dir" + ], + "plugins": [ + "../path/to/plugin/dir" + ] +} +``` + +### Specifc Usage: + +This file should be located in the same directory from which you run `wp-env` commands for a project. So if you are running `wp-env` in the root directory of a plugin, `wp-env.json` should also be located there. + +Each item in the `themes` or `plugins` array should be an absolute or relative path to the root of a different theme or plugin directory. Relative paths will be resolved from the current working directory of the script, which means they are resolved from the location of the `wp-env.json` file. \ No newline at end of file From d1265c764c8e65ccbb1382cec0a1af99f0283823 Mon Sep 17 00:00:00 2001 From: Noah Allen Date: Wed, 20 Nov 2019 12:58:17 -0800 Subject: [PATCH 2/2] Clarify documentation Co-Authored-By: Enrique Piqueras --- packages/env/README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/packages/env/README.md b/packages/env/README.md index 4f59428c3603aa..681f788c671bd6 100644 --- a/packages/env/README.md +++ b/packages/env/README.md @@ -69,12 +69,11 @@ Positionals:

Code is Poetry.

-## The Configuration File +## Additional Configuration and Running with Multiple Plugins/Themes -You may also specify a configuration file for `wp-env`. This can be useful for loading other themes and plugins that you are developing simultaneously. The script will attach the specified theme and plugin directories as volumes on the docker container so that changes you make to them exist in the WordPress instance. +`wp-env` also supports a configuration file. At the moment, this is only used for loading extra themes and plugins that you may be developing together with your main one. The script will attach the specified theme and plugin directories as volumes on the docker containers so that changes you make to them exist in the WordPress instance. ### Example: -The config file is plain JSON with the name `wp-env.json`. The format of the file looks like this: `wp-env.json` ```json @@ -88,8 +87,8 @@ The config file is plain JSON with the name `wp-env.json`. The format of the fil } ``` -### Specifc Usage: +### Caveats: -This file should be located in the same directory from which you run `wp-env` commands for a project. So if you are running `wp-env` in the root directory of a plugin, `wp-env.json` should also be located there. +The file should be located in the same directory from which you run `wp-env` commands for a project. So if you are running `wp-env` in the root directory of a plugin, `wp-env.json` should also be located there. -Each item in the `themes` or `plugins` array should be an absolute or relative path to the root of a different theme or plugin directory. Relative paths will be resolved from the current working directory of the script, which means they are resolved from the location of the `wp-env.json` file. \ No newline at end of file +Each item in the `themes` or `plugins` array should be an absolute or relative path to the root of a different theme or plugin directory. Relative paths will be resolved from the current working directory, which means they will be resolved from the location of the `wp-env.json` file.