Skip to content

Commit

Permalink
Merge pull request #337 from ernilambar/140-remove-grunt
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Jan 29, 2025
2 parents 036c515 + 6ae983a commit e706981
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 84 deletions.
14 changes: 5 additions & 9 deletions features/scaffold.feature
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,7 @@ Feature: WordPress code scaffolding
And the {PLUGIN_DIR}/hello-world/.editorconfig file should exist
And the {PLUGIN_DIR}/hello-world/hello-world.php file should exist
And the {PLUGIN_DIR}/hello-world/readme.txt file should exist
And the {PLUGIN_DIR}/hello-world/package.json file should exist
And the {PLUGIN_DIR}/hello-world/Gruntfile.js file should exist
And the {PLUGIN_DIR}/hello-world/composer.json file should exist
And the {PLUGIN_DIR}/hello-world/.gitignore file should contain:
"""
.DS_Store
Expand All @@ -219,6 +218,7 @@ Feature: WordPress code scaffolding
Thumbs.db
wp-cli.local.yml
node_modules/
vendor/
"""
And the {PLUGIN_DIR}/hello-world/.distignore file should contain:
"""
Expand Down Expand Up @@ -254,14 +254,10 @@ Feature: WordPress code scaffolding
Tested up to: {WP_VERSION}
"""

When I run `cat {PLUGIN_DIR}/hello-world/package.json`
Then STDOUT should be JSON containing:
"""
{"author":"Hello World Author"}
"""
And STDOUT should be JSON containing:
When I run `cat {PLUGIN_DIR}/hello-world/composer.json`
Then STDOUT should contain:
"""
{"version":"0.1.0"}
wp-cli/i18n-command
"""

Scenario: Scaffold a plugin by prompting
Expand Down
3 changes: 1 addition & 2 deletions src/Scaffold_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,7 @@ public function plugin( $args, $assoc_args ) {
$files_to_create = [
$plugin_path => self::mustache_render( 'plugin.mustache', $data ),
$plugin_readme_path => self::mustache_render( 'plugin-readme.mustache', $data ),
"{$plugin_dir}/package.json" => self::mustache_render( 'plugin-packages.mustache', $data ),
"{$plugin_dir}/Gruntfile.js" => self::mustache_render( 'plugin-gruntfile.mustache', $data ),
"{$plugin_dir}/composer.json" => self::mustache_render( 'plugin-composer.mustache', $data ),
"{$plugin_dir}/.gitignore" => self::mustache_render( 'plugin-gitignore.mustache', $data ),
"{$plugin_dir}/.distignore" => self::mustache_render( 'plugin-distignore.mustache', $data ),
"{$plugin_dir}/.editorconfig" => file_get_contents( self::get_template_path( '.editorconfig' ) ),
Expand Down
8 changes: 8 additions & 0 deletions templates/plugin-composer.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"require-dev": {
"wp-cli/i18n-command": "^2"
},
"scripts": {
"makepot": "wp i18n make-pot ."
}
}
1 change: 1 addition & 0 deletions templates/plugin-gitignore.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ phpunit.xml
Thumbs.db
wp-cli.local.yml
node_modules/
vendor/
*.sql
*.tar.gz
*.zip
56 changes: 0 additions & 56 deletions templates/plugin-gruntfile.mustache

This file was deleted.

17 changes: 0 additions & 17 deletions templates/plugin-packages.mustache

This file was deleted.

0 comments on commit e706981

Please sign in to comment.