-
Notifications
You must be signed in to change notification settings - Fork 45
Getting Started
JuanMa Garrido edited this page Jan 7, 2025
·
3 revisions
This block-development-examples repo is a monorepo multipackage because it contains several packages (examples) 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. This 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 project's folder (cd 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) 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). - Run
npm run env:startfrom the root folder to usewp-envto get a local development environment with the examples set in.wp-env.json - 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 plugins 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.