Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove grunt from plugin scaffolding #337

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -670,8 +670,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": "./vendor/bin/wp i18n make-pot ."
ernilambar marked this conversation as resolved.
Show resolved Hide resolved
}
}
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.

Loading