From 2bec119c088616f5b225b162ed92dbce448ed8b1 Mon Sep 17 00:00:00 2001 From: Wes Moberly Date: Sun, 10 Apr 2016 15:50:49 -0400 Subject: [PATCH 1/2] Update `plugin.mustache` and `plugin-packages.mustache` Currently if you scaffold a child theme and a plugin, the plugin headers are formatted differently than the child theme headers. The plugin also uses a different version number `0.1-alpha`), which is itself different than the version used in the plugin's `package.json` (`0.0.0`). This commit normalizes the header formatting and updates the version numbers. --- templates/plugin-packages.mustache | 2 +- templates/plugin.mustache | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/templates/plugin-packages.mustache b/templates/plugin-packages.mustache index fe7f057452..84a60ca66a 100644 --- a/templates/plugin-packages.mustache +++ b/templates/plugin-packages.mustache @@ -1,7 +1,7 @@ { "name": "{{plugin_slug}}", - "version": "0.0.0", + "version": "0.1.0", "main": "Gruntfile.js", "author": "{{plugin_author}}", "devDependencies": { diff --git a/templates/plugin.mustache b/templates/plugin.mustache index c96eb303db..fc502b67a8 100644 --- a/templates/plugin.mustache +++ b/templates/plugin.mustache @@ -1,12 +1,13 @@ Date: Sun, 10 Apr 2016 18:27:28 -0400 Subject: [PATCH 2/2] Update functional tests --- features/plugin.feature | 6 +++--- features/scaffold.feature | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/features/plugin.feature b/features/plugin.feature index 65da74df61..063155a6c4 100644 --- a/features/plugin.feature +++ b/features/plugin.feature @@ -42,7 +42,7 @@ Feature: Manage WordPress plugins Plugin Zombieland details: Name: Zombieland Status: Inactive - Version: 0.1-alpha + Version: 0.1.0 Author: YOUR NAME HERE Description: PLUGIN DESCRIPTION HERE """ @@ -61,8 +61,8 @@ Feature: Manage WordPress plugins When I run `wp plugin list` Then STDOUT should be a table containing rows: - | name | status | update | version | - | Zombieland | active | none | 0.1-alpha | + | name | status | update | version | + | Zombieland | active | none | 0.1.0 | When I try `wp plugin uninstall Zombieland` Then STDERR should contain: diff --git a/features/scaffold.feature b/features/scaffold.feature index e7fd1fd23f..54c6100394 100644 --- a/features/scaffold.feature +++ b/features/scaffold.feature @@ -125,11 +125,15 @@ Feature: WordPress code scaffolding """ And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain: """ - * Plugin Name: Hello World + * Plugin Name: Hello World """ And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain: """ - * @package Hello_World + * Version: 0.1.0 + """ + And the {PLUGIN_DIR}/hello-world/hello-world.php file should contain: + """ + * @package Hello_World """ When I run `cat {PLUGIN_DIR}/hello-world/package.json` @@ -137,6 +141,10 @@ Feature: WordPress code scaffolding """ {"author":"Hello World Author"} """ + And STDOUT should be JSON containing: + """ + {"version":"0.1.0"} + """ Scenario: Scaffold a plugin by prompting Given a WP install