Skip to content

Commit aff662a

Browse files
committed
Improve local development documentation
1 parent d7f4e8d commit aff662a

File tree

3 files changed

+42
-7
lines changed

3 files changed

+42
-7
lines changed

CONTRIBUTING.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@
44

55
- As with all WordPress projects, we want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [Code of Conduct](https://make.wordpress.org/handbook/community-code-of-conduct/).
66

7-
- Contributors should review the WordPress [PHP coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/), [JavaScript coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/) and [accessibility coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/). Accessibility in particular should be top of mind and thoroughly tested.
7+
- Contributors should review the WordPress [PHP coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/), [JavaScript coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/), and [accessibility coding standards](https://developer.wordpress.org/coding-standards/wordpress-coding-standards/accessibility/). Accessibility in particular should be top of mind and thoroughly tested.
88

9-
- You maintain copyright over any contribution you make. By submitting a pull request you agree to release that code under [Remote Data Blocks' license](LICENSE).
9+
- You maintain copyright over any contribution you make. By submitting a pull request, you agree to release that code under [our license](LICENSE).
1010

1111
- When contributing to this repository, please first discuss the change you wish to make via an issue or discussion.
1212

1313
## Reporting security issues
1414

1515
Please see [SECURITY.md](SECURITY.md).
16+
17+
## Development environment
18+
19+
Please see our guide to setting up a [local development environment](docs/local-development.md).

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ A [persistent object cache](https://developer.wordpress.org/reference/classes/wp
2020
## Next steps
2121

2222
> [!WARNING]
23-
> This plugin is still under heavy active development and breaking changes may land without warning. If you are interested in evaluating or testing this plugin, please [open an issue](https://github.com/Automattic/remote-data-blocks/issues/new/choose) and we'll be in touch!
23+
> This plugin is under heavy active development and breaking changes may land without warning. If you are interested in evaluating or testing this plugin, please [open an issue](https://github.com/Automattic/remote-data-blocks/issues/new/choose) and we'll be in touch!
2424
2525
- Learn about the [core concepts](docs/concepts/index.md) behind Remote Data Blocks.
2626
- Follow along with [example workflows](docs/workflows/index.md) to see Remote Data Blocks in action.

docs/local-development.md

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Local Development
22

3-
This repository includes tools for starting a development environment based on [`@wordpress/env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/), which requires Docker.
3+
This repository includes tools for starting a local development environment using [`@wordpress/env`](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-env/), which requires Docker and Docker Compose.
44

55
## Set up
66

@@ -14,13 +14,44 @@ composer install
1414
To start a development environment with Xdebug enabled:
1515

1616
```sh
17-
npm run start:monolith:xdebug
17+
npm run start:monolith-xdebug
1818
```
1919

2020
This will spin up a WordPress environment and a Valkey (Redis) instance for object cache. It will also build the block editor scripts, watch for changes, and open a Node.js debugging port. The WordPress environment will be available at `http://localhost:8888` (admin user: `admin`, password: `password`).
2121

22-
To start a decoupled / headless development environment, make sure the [wp-components repo](https://github.com/Automattic/wp-components) is at a peer level in your file system and then run from root:
22+
Stop the development environment with `Ctrl+C` and resume it by running the same command. You can also manually stop the environment with `npm run stop`. Stopping the environment stops the WordPress containers but preserves their state.
23+
24+
### Logs
25+
26+
Watch logs from the WordPress container:
27+
28+
```sh
29+
npx wp-env logs
30+
```
31+
32+
### WP-CLI
33+
34+
Run WP-CLI commands:
35+
36+
```sh
37+
npm run wp-cli option get siteurl
38+
```
39+
40+
### Destroy
41+
42+
Destroy your local environment and irreversibly delete all content, configuration, and data:
2343

2444
```sh
25-
npm run start:decoupled
45+
npm run destroy
2646
```
47+
48+
## Local playground
49+
50+
While not a suitable for local developement, it can sometimes be useful to quickly spin up a local WordPress playground using `@wp-now/wp-now`:
51+
52+
```sh
53+
npm run build # or `npm run start` in a separate terminal
54+
npm run start:playground
55+
```
56+
57+
Playgrounds do not closely mirror production environments and are missing persistent object cache, debugging tools, and other important features. Use `npm run start:monolith-xdebug` for local development.

0 commit comments

Comments
 (0)