Skip to content
A local Altis development environment designed for learning Gutenberg, the new WordPress Block Editor!
PHP JavaScript CSS Shell
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.config Implement basic editor & frontend bundles Jul 14, 2019
content Add a JS-side block editor plugin autoloader Jul 15, 2019
.babelrc.js Add missing babelrc that permits JSX to be used Jul 15, 2019
.build-script composer create-project altis/skeleton Jul 13, 2019
.editorconfig Add WP Core's editorconfig Jul 14, 2019
.gitignore
README.md Restructure VM commands section Jul 14, 2019
composer.json Use twentynineteen as default theme (as it is block editor-compatible) Jul 14, 2019
composer.lock Update composer.lock Jul 14, 2019
package.json Add an "npm run tail-logs:php" command to tail the Chassis PHP logs Jul 15, 2019

README.md

Block Development Playground

This project gives you an Altis-powered environment to use for block editor experiments. All script loading should be handled by the plugins, so you're free to focus on block development!

Custom blocks should be created within the custom-blocks mu-plugin.

Installation

git clone git@github.com:humanmade/block-playground.git
cd block-playground
composer install
npm install
composer chassis init

You will now be able to load the site at altis.local, and sign in with the username admin and password password.

Local Development

Frontend development commands

  • npm start: Run the hot-reloading development server.
  • npm run build: Generate production-ready frontend asset bundles.
  • npm run phpcs: Run the PHP CodeSniffer linting tool against your project code.

Virtual Machine commands

npm run vagrant

Run any vagrant command against the virtual machine (providing that the local Chassis development environment has been initialized). You may use this script to easily run most vagrant commands, wherever you are in the project. For example:

  • npm run vagrant up: Start the virtual machine.
  • npm run vagrant halt: Stop the virtual machine.
  • npm run vagrant ssh: SSH into the virtual machine.

Note: Because of how npm run scripts work, you wish to pass arguments to a vagrant command (for example vagrant ssh -c "wp plugin list") then you will need to put an additional -- double-dash between the npm script command and the command's arguments. Examples:

  • npm run vagrant ssh -- -c "wp plugin list"
    • List out installed plugins. Any WP-CLI command should work if invoked in this manner.
  • npm run vagrant ssh -- -c "mysqldump -uwordpress -pvagrantpassword wordpress > /chassis/database-backup.sql"
    • Dump the wordpress database within the VM to a file database-backup.sql in your project root.
  • npm run vagrant destroy -- -f
    • Destroy the virtual machine.
You can’t perform that action at this time.