Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed May 11, 2020
1 parent c66b1f2 commit 09aa5eb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 16 deletions.
4 changes: 4 additions & 0 deletions packages/env/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### New Feature

- The `.wp-env.json` coniguration file now accepts "mu-plugins" sources.

## 1.1.0 (2020-04-01)

### New Feature
Expand Down
34 changes: 18 additions & 16 deletions packages/env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ Positionals:
[string] [choices: "all", "development", "tests"] [default: "tests"]
```
### `wp-env run [container] [command]`
### `wp-env run [container] [command]`
```sh
wp-env run <container> [command..]
Expand All @@ -236,10 +236,10 @@ ID user_login display_name user_email user_registered roles
✔ Ran `wp user list` in 'cli'. (in 2s 374ms)
```
### `docker logs -f [container_id] >/dev/null`
### `docker logs -f [container_id] >/dev/null`
```sh
docker logs -f <container_id> >/dev/null
docker logs -f <container_id> >/dev/null

Shows the error logs of the specified container in the terminal. The container_id is the one that is visible with `docker ps -a`
```
Expand All @@ -250,23 +250,24 @@ You can customize the WordPress installation, plugins and themes that the develo
`.wp-env.json` supports five fields:
| Field | Type | Default | Description |
| ------------- | ------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| `"core"` | `string\|null` | `null` | The WordPress installation to use. If `null` is specified, `wp-env` will use the latest production release of WordPress. |
| `"plugins"` | `string[]` | `[]` | A list of plugins to install and activate in the environment. |
| `"themes"` | `string[]` | `[]` | A list of themes to install in the environment. The first theme in the list will be activated. |
| `"port"` | `integer` | `8888` | The primary port number to use for the insallation. You'll access the instance through the port: 'http://localhost:8888'. |
| `"testsPort"` | `integer` | `8889` | The port number to use for the tests instance. |
| `"config"` | `Object` | `"{ WP_DEBUG: true, SCRIPT_DEBUG: true }"` | Mapping of wp-config.php constants to their desired values. |
| Field | Type | Default | Description |
| -------------- | -------------- | ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------- |
| `"core"` | `string\|null` | `null` | The WordPress installation to use. If `null` is specified, `wp-env` will use the latest production release of WordPress. |
| `"plugins"` | `string[]` | `[]` | A list of plugins to install and activate in the environment. |
| `"themes"` | `string[]` | `[]` | A list of themes to install in the environment. The first theme in the list will be activated. |
| `"mu-plugins"` | `string[]` | `[]` | A list of mu-plugins to install in the environment. |
| `"port"` | `integer` | `8888` | The primary port number to use for the insallation. You'll access the instance through the port: 'http://localhost:8888'. |
| `"testsPort"` | `integer` | `8889` | The port number to use for the tests instance. |
| `"config"` | `Object` | `"{ WP_DEBUG: true, SCRIPT_DEBUG: true }"` | Mapping of wp-config.php constants to their desired values. |
_Note: the port number environment variables (`WP_ENV_PORT` and `WP_ENV_TESTS_PORT`) take precedent over the .wp-env.json values._
Several types of strings can be passed into the `core`, `plugins`, and `themes` fields:
Several types of strings can be passed into the `core`, `plugins`, `themes`, and `mu-plugins` fields:
| Type | Format | Example(s) |
| ----------------- | ----------------------------- | -------------------------------------------------------- |
| Relative path | `.<path>\|~<path>` | `"./a/directory"`, `"../a/directory"`, `"~/a/directory"` |
| Absolute path | `/<path>\|<letter>:\<path>` | `"/a/directory"`, `"C:\\a\\directory"` |
| Relative path | `.<path>\|~<path>` | `"./a/directory"`, `"../a/directory"`, `"~/a/directory"` |
| Absolute path | `/<path>\|<letter>:\<path>` | `"/a/directory"`, `"C:\\a\\directory"` |
| GitHub repository | `<owner>/<repo>[#<ref>]` | `"WordPress/WordPress"`, `"WordPress/gutenberg#master"` |
| ZIP File | `http[s]://<host>/<path>.zip` | `"https://wordpress.org/wordpress-5.4-beta2.zip"` |
Expand Down Expand Up @@ -323,15 +324,16 @@ This is useful for integration testing: that is, testing how old versions of Wor
}
```
#### Custom Port Numbers
#### Custom port numbers and custom mu-plugins
You can tell `wp-env` to use a custom port number so that your instance does not conflict with other `wp-env` instances.
```json
{
"plugins": [ "." ],
"port": 4013,
"testsPort": 4012
"testsPort": 4012,
"mu-plugins": [ "./path/to/a/mu-plugin" ]
}
```
Expand Down

0 comments on commit 09aa5eb

Please sign in to comment.