Skip to content

akirk/playground-step-library

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

543 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

WordPress Playground Step Library

In this Github repository we collect custom blueprint steps for WordPress Playground.

Web UI

You can then use those custom steps in our Step Builder to create more complex WordPress Playground setups more easily.

NPM Package

You can also use the steps in your own projects by using the npm package.

πŸ“š Documentation

Comprehensive documentation for all steps is available:

What does it mean?

You can tell WordPress Playground what to do before it loads using a Blueprint JSON file. There are a number of builtin steps provided that in combination can make it do powerful things.

Now, this tool collects custom steps that make it easier to specify more complex tasks. The steps get transformed into builtin steps to form a valid, final blueprint that can be executed by WordPress Playground.

How does it work?

In the Step Library UI you can select the steps you want to use by clicking or dragging. On each step you can modify the variables if any. You can also reorder the steps when necessary.

The final blueprint is immediately updated so that you can click the "Launch in Playground" to see if it achieves what you try to do.

Sharing & Import/Export

To make it easy to share what you are building, the URL of the page is updated with the blueprint. You can copy the URL and share it with others.

You can also share the Playground URL which contains the final blueprint.

Import blueprints:

  • Drag & drop any .json blueprint file to import it
  • Paste Playground URLs - Both hash format and Query API URLs
  • Native Playground blueprints are automatically decompiled into custom steps

See Blueprint Import for details.

Screenshot

step-library

Try it now from scratch or with a preloaded example.

Contributing

We welcome contributions! See our Contributing Guide for details on:

  • Setting up your development environment
  • Creating new steps
  • Testing your changes
  • Submitting pull requests

Using as NPM Package

The npm package provides a compiler to transform WordPress Playground blueprints with custom steps into blueprints with native steps. It's available as an npm package.

npm install playground-step-library
import PlaygroundStepLibrary from 'playground-step-library';

const compiler = new PlaygroundStepLibrary();

const blueprint = {
    steps: [
        { step: 'setSiteName', vars: { sitename: 'My Site', tagline: 'A WordPress site' } }
    ]
};

const v1 = compiler.compile(blueprint);    // V1: imperative, with steps array
const v2 = compiler.compileV2(blueprint);  // V2: declarative, with schema properties

// Transpile native V1 blueprints to V2 (limited support - see docs)
const result = compiler.transpile(nativeV1Blueprint);

See the Programmatic API Documentation for full details on CLI usage, methods, and examples.

Custom Steps

This library provides 73 total steps (8 built-in enhanced steps + 65 custom steps):

Built-in Enhanced Steps

  • defineWpConfigConst - Define a wp-config PHP constant.
  • enableMultisite - Enable WordPress Multisite functionality.
  • importWxr - Import a WXR from a URL.
  • installPlugin - Install a plugin via WordPress.org or Git (GitHub, GitLab, Bitbucket, Codeberg, etc.).
  • installTheme - Install a theme via WordPress.org or Git (GitHub, GitLab, Bitbucket, Codeberg, etc.).
  • login - Login to the site.
  • runPHP - Run code in the context of WordPress.
  • setSiteOption - Set a site option.

Custom Steps

About

Custom Steps for WordPress Playground

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors