playground-tools icon indicating copy to clipboard operation
playground-tools copied to clipboard

wp-now: support yml for blueprints

Open lgersman opened this issue 1 year ago • 0 comments

Providing (additional) yml support for blueprint definition would greatly improve the usability of blueprints.

yml supports:

  • comments for explaining why a blueprint step is required (or what it does) and what it does

  • multiline values (for writeFile)

{
  "step": "writeFile",
  "path": "/wordpress/wp-content/mu-plugins/rewrite.php",
  "data": "<?php /* Use pretty permalinks */ add_action( 'after_setup_theme', function() { global $wp_rewrite; $wp_rewrite->set_permalink_structure('/%postname%/'); $wp_rewrite->flush_rules(); } 
  );"
}

This multiline data could be written in yml in true multiline fashion which is much more readable

  • references (see example here : https://x.com/LarsGersmann/status/1684156867440771075) can also improve readability

  • the blueprint jsonschema can be even applied to yaml for validation/autocompletion (at least vscode supports this)

lgersman avatar Jun 15 '24 08:06 lgersman