wp-cli / scaffold-package-command

Scaffolds WP-CLI commands with functional tests, full README.md, and more.
MIT License
68 stars 19 forks source link

The package generation generates hello-world and ignores my package name. #216

Closed lordspace closed 1 year ago

lordspace commented 1 year ago

Bug Report

The package generation generates hello-world and ignores my package name. wp scaffold package company/orb-imp-exp-pkg --dir=/my/orb-imp-exp/data/pkg-src/orb-imp-exp-pkg

danielbachhuber commented 1 year ago

Hey @lordspace !

I tried to reproduce this locally:

$ wp scaffold package company/orb-imp-exp-pkg
Success: Created package files in /Users/danielbachhuber/wp-cli/packages/local/company/orb-imp-exp-pkg
Success: Created package test files.
Success: Created package readme.
Success: Created package GitHub configuration.
Installing package company/orb-imp-exp-pkg (dev-main || dev-master || dev-trunk)
Updating /Users/danielbachhuber/wp-cli/packages/composer.json to require the package...
Registering /Users/danielbachhuber/wp-cli/packages/local/company/orb-imp-exp-pkg as a path repository...
Using Composer to install the package...
---
Loading composer repositories with package information
Found 107 package versions referenced in your dependency graph. 3 (3%) were optimized away.
Updating dependencies
Generating rules
Resolving dependencies through SAT
Looking at all rules.

Dependency resolution completed in 0.000 seconds
Analyzed 104 packages to resolve dependencies
Analyzed 109 rules to resolve dependencies
Lock file operations: 1 install, 0 updates, 0 removals
Installs: company/orb-imp-exp-pkg:dev-main
- Locking company/orb-imp-exp-pkg (dev-main)
Writing lock file
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
Installs: company/orb-imp-exp-pkg:dev-main
 - Installing <info>company/orb-imp-exp-pkg</info> (<comment>dev-main</comment>)
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
---
Success: Package installed.

When I open the directory, I see the composer.json name as expected:

image

The scaffolded command itself is always generated as hello-world

https://github.com/wp-cli/scaffold-package-command/blob/9c209caf8c6d84a561ee92de268d4452adefaee2/templates/hello-world-command.mustache#L13-L17

Hope this helps clarify.

lordspace commented 1 year ago

thanks @danielbachhuber for testing this. I tried to customize the class and it would not recognize the module or couldn't uninstall it. had to delete the wp-cli local cache