Skip to content

01 Getting Started

Nick Diego edited this page May 10, 2024 · 7 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.

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 .nvmrc file 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.

Quick Start Guide with the repo

After cloning this repo and entering into this project'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 build

At this point you are now ready to begin developing and testing the examples.

See the examples in action

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 .zip from the 📦 icon of the example you're interested in the List of examples table below).
  • Run npm run env:start from the root folder to use wp-env to get a local development environment with ALL the examples (each example can be located by their ID)
  • Run pnpm -- wp-env start from any plugin folder to use wp-env to get a local development environment with that example
  • Run npx @wp-now/wp-now start from any plugin folder to use wp-now to quickly launch a WordPress installation with that specific plugin installed.
  • Copy the plugins folders for the examples you're interested in under the plugins folder of your own WordPress installation.

Note

Check out the Development Guide for a more comprehensive look at working in this repository.