GithubHelp home page GithubHelp logo

wp-env's Introduction

WP-ENV

This is simple bash version of the wp-env nodejs package for gutenberg https://github.com/WordPress/gutenberg/tree/master/packages/env

Install script globally

git clone https://github.com/endriu84/wp-env.git
chmod +x wp-env/wp-env.sh
cp wp-env.sh /usr/local/bin/wp-env
cp .wp-env.sh /usr/local/bin/

How to use

Inside Your plugin folder, You have to create wp-env.json file ( same file as in @wordpress/env package - spec below )

Next run

wp-env start
wp-env stop
wp-env clean

.wp-env.json

[ from https://github.com/WordPress/gutenberg/tree/master/packages/env ]

You can customize the WordPress installation, plugins and themes that the development environment will use by specifying a .wp-env.json file in the directory that you run wp-env from.

.wp-env.json supports five fields:

Field Type Default Description
"core" string|null null The WordPress installation to use. If null is specified, wp-env will use the latest production release of WordPress.
"plugins" string[] [] A list of plugins to install and activate in the environment.
"themes" string[] [] A list of themes to install in the environment. The first theme in the list will be activated.
"port" integer 8888 The primary port number to use for the insallation. You'll access the instance through the port: 'http://localhost:8888'.
"config" Object "{ WP_DEBUG: true, SCRIPT_DEBUG: true }" Mapping of wp-config.php constants to their desired values.

Note: the port number environment variables (WP_ENV_PORT and WP_ENV_TESTS_PORT) take precedent over the .wp-env.json values.

Several types of strings can be passed into the core, plugins, and themes fields:

Type Format Example(s)
Relative path .<path>|~<path> "./a/directory", "../a/directory", "~/a/directory"
Absolute path /<path>|<letter>:\<path> "/a/directory", "C:\\a\\directory"
GitHub repository <owner>/<repo>[#<ref>] "WordPress/WordPress", "WordPress/gutenberg#master"
ZIP File http[s]://<host>/<path>.zip "https://wordpress.org/wordpress-5.4-beta2.zip"

Remote sources will be downloaded into a temporary directory located in ~/wp-env.

Avalilable commands

usage: wp-env [COMMAND]

commands:
  start     - start the wordpress Docker enviroment
  stop      - enter the testing shell
  clean     - update these Docker scripts
  --help    - show this help

wp-env's People

Contributors

endriu84 avatar

Watchers

 avatar

Forkers

szepeviktor

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.