-
Notifications
You must be signed in to change notification settings - Fork 47
Getting Started
JuanMa edited this page Nov 3, 2023
·
3 revisions
This wp-block-development-examples repo is a monorepo multipackage because it contains several packages (plugins) and is prepared to manage them collectively. To get up and running with it, you will need to make sure that you have installed the prerequisites.
-
NVM - While you can always install Node through other means, we recommend using NVM to ensure you're aligned with the version used by our development teams. Our repository contains an
.nvmrcfile which helps ensure you are using the correct version of Node. -
PNPM - This monorepo utilizes PNPM to manage project dependencies and run various scripts involved in building and testing projects. You can easily install it with
npm i -g pnpm.
After cloning this repo and entering into this projects's folder (cd wp-block-development-examples), do the following from the root of the project:
# Set your Node version to the right one for this project (as defined on .nvmrc)
nvm use
# Install the dependencies for all of the plugins
pnpm install
# Launch a build process for all of the plugins in the monorepo
pnpm run buildAt this point you are now ready to begin developing and testing the examples.
To see the examples in action you have the following options:
- Click on the Live Demo icon
(from the List of examples table below) to see a playground-powered live demo of the example.
- Use your own WordPress installation to install the plugin (that can be downloaded as a
.zipfrom the 📦 icon of the example you're interested in the List of examples table below). - Run
npm run env:startfrom the root folder to usewp-envto get a local development environment with ALL the examples (each example can be located by their ID) - Run
pnpm -- wp-env startfrom any plugin folder to usewp-envto get a local development environment with that example - Run
npx @wp-now/wp-now startfrom any plugin folder to usewp-nowto quickly launch a WordPress installation with that specific plugin installed. - Copy the plugins folders for the examples you're interested in under the
pluginsfolder of your own WordPress installation.
Note Check out the Development Guide for a more comprehensive look at working in this repository.