Getting started

Prerequisites

Please make sure that the following components are installed on your local computer:

circle-exclamation

Installation

create-wp-react-apparrow-up-right allows you to create workspaces, plugins and packages with a single command. Let's install the CLI:

$ yarn global add create-wp-react-app

Run this command to install create-wp-react-app globally on your system. Afterwards you can then create your first workspace (in this context, the workspace means the folder where your multipackage repository is stored).

Create workspace

Use this command to create the workspace for your WordPress plugin development. This command also executes the create-wp-react-app create-plugin command to create your first plugin. You will be asked to fill in the necessary information about your workspace and the first plugin. Once you have completed the prompts, the command runs the setup and prepares the repository.

circle-check
circle-exclamation

You can find out how to create additional plugins or packages in further articles:

Create packagechevron-rightCreate Add-Onchevron-right

Remote development

If you are developing on a remote system and using VSCode already, you need to use the Remote SSH extensionarrow-up-right. Simply connect to your server and install all required VSCode extensions. Navigate to your workspace folder and create a new .env file with the following content:

Instead of <your-ip> and your-port use your remote development IP and defined WordPress port. Afterwards you can yarn docker:start and use the boilerplate as usual.

Open WordPress

Open a new terminal in the newly created workspace. Run yarn docker:start and Docker will start the complete WordPress environment with your plugin activated on localhost:{your-port}. Open a web browser, navigate to localhost:{your-port}/wp-admin and enter the following credentials:

Username: wordpress Password: wordpress

Initial commit

If you do an initial commit to your Git repository make sure to use git commit [...] --no-verify to skip hooks. This is needed because the boilerplate has some non-verifiable files in common/create-wp-react-app.

Last updated

Was this helpful?