diff --git a/Gruntfile.js b/Gruntfile.js index 9a58b436..12258219 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,5 +1,6 @@ /* eslint-env node,es6 */ +const fs = require( 'fs' ); const ignoreParse = require( 'parse-gitignore' ); module.exports = function( grunt ) { @@ -45,4 +46,12 @@ module.exports = function( grunt ) { 'copy', ] ); + + grunt.registerTask( + 'blueprint-url', + function() { + const blueprintJson = JSON.parse( fs.readFileSync( 'assets/blueprints/blueprint.json', 'utf8' ) ); + grunt.log.write( `Blueprint URL: https://playground.wordpress.net/#${ encodeURI( JSON.stringify( blueprintJson ) ) }` ); + } + ); }; diff --git a/assets/blueprints/blueprint.json b/assets/blueprints/blueprint.json new file mode 100644 index 00000000..3221e499 --- /dev/null +++ b/assets/blueprints/blueprint.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://playground.wordpress.net/blueprint-schema.json", + "landingPage": "\/wp-admin\/profile.php", + "preferredVersions": { + "php": "7.4", + "wp": "latest" + }, + "steps": [ + { + "step": "login", + "username": "admin", + "password": "password" + }, + { + "step": "installPlugin", + "pluginZipFile": { + "resource": "wordpress.org\/plugins", + "slug": "two-factor" + }, + "options": { + "activate": true + } + } + ] +} diff --git a/package.json b/package.json index 894e834d..d96386ce 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "test": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor vendor/bin/phpunit --", "test:watch": "npm run composer test:watch", "composer": "wp-env run tests-cli --env-cwd=wp-content/plugins/two-factor composer --", - "preinstall": "composer install" + "preinstall": "composer install", + "blueprint": "grunt blueprint-url" }, "repository": { "type": "git",