A block-based child theme for WordPress.org Showcase, plus local environment.
This is as-yet incomplete, a starting point.
- Docker
- Node/npm
- Composer
-
Set up repo dependencies.
npm install composer install npm run setup:tools
-
Start the local environment.
npx wp-env start
-
Run the setup script.
npm run setup:wp
-
(optional) There may be times when you want to make changes to the Parent theme and test them with the Main them. To do that:
- Clone the Parent repo and follow the setup instructions in its
readme.mdfile. - Create a
.wp-env.override.jsonfile in this repo - Copy the
themessection from.wp-env.jsonand paste it into the override file. You must copy the entire section for it to work, because it won't be merged with.wp-env.json. - Update the path to the Parent theme to the Parent theme folder inside the Parent repository you cloned above.
{ "themes": [ "./source/wp-content/themes/wporg-showcase", "./source/wp-content/themes/wporg-showcase-2022", "../wporg-parent-2021/source/wp-content/themes/wporg-parent-2021" ] } - Clone the Parent repo and follow the setup instructions in its
-
Visit site at localhost:8888.
-
Log in with username
adminand passwordpassword.
These must be run in the project's root folder, not in theme/plugin subfolders.
-
Stop the environment.
npx wp-env stop
-
Restart the environment.
npx wp-env start
-
Build the theme's JavaScript
npm run build:theme
or, automatically build on changes:
npm run start:theme
-
Reset WordPress to a clean install, and reconfigure. This will nuke all local WordPress content!
npx wp-env clean all npm run setup:wp
-
SSH into docker container.
npx wp-env run wordpress bash
-
Run wp-cli commands. Pass the command and its flags unquoted; wp-env 8+ treats a quoted string as a single executable name.
npx wp-env run cli wp post list --post_status=publish
-
Update composer dependencies and sync any
repo-toolschanges.npm run update:tools
-
Run a lighthouse test.
npm run lighthouse