wp-cli / scaffold-package-command

Scaffolds WP-CLI commands with functional tests, full README.md, and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't create scaffold

stampirl opened this issue · comments

Hi. I'm trying to create new package with this command wp scaffold package 'moriacat/octo_importer' --skip-tests --skip-github --skip-readme but I keep getting error with dependencies. Output below.

Success: Created package files in /home/moriacat/.wp-cli/packages/local/moriacat/octo_importer
Installing package moriacat/octo_importer (dev-master)
Updating /home/moriacat/.wp-cli/packages/composer.json to require the package...
Registering /home/moriacat/.wp-cli/packages/local/moriacat/octo_importer as a path repository...
Updating package index repository url...
Using Composer to install the package...
---
Loading composer repositories with package information
Updating dependencies
Resolving dependencies through SAT

Dependency resolution completed in 0.121 seconds
Your requirements could not be resolved to an installable set of packages.
Problem 1
    - Installation request for moriacat/octo_importer dev-master -> satisfiable by moriacat/octo_importer[dev-master].
    - Conclusion: remove wp-cli/wp-cli 2.0.1
    - moriacat/octo_importer dev-master requires wp-cli/wp-cli ^1.1.0 -> satisfiable by wp-cli/wp-cli[v1.1.0, v1.2.0, v1.2.1, v1.3.0, v1.4.0, v1.4.1, v1.5.0, v1.5.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.1.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.2.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.2.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.3.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.4.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.4.1].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.5.0].
    - Can only install one of: wp-cli/wp-cli[v2.0.1, v1.5.1].
    - Installation request for wp-cli/wp-cli 2.0.1 -> satisfiable by wp-cli/wp-cli[2.0.1].
Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems.
---
Error: Package installation failed (Composer return code 2).
Reverted composer.json.

This is on Fedora 28 with PHP 7.2 and latest wp-cli 2.0.1.

The wp-cli/scaffold-package-command has not been completely moved over to v2 yet: #180

I've been working on that and I am almost through. I want to have it completed for v2.1.0 which is due first week of November.

If you need scaffolding functionality earlier, you can briefly rollback to an older version just for the scaffold for now.

Thanks for help 😁 I'll rollback.

@schlessera @Geek-Daddy as workaround for this, you can set the flag --require_wp_cli pointing to your current WP-CLI version.

e.g.:
wp scaffold package your-package-name --require_wp_cli=2.1.0

I think this problem is related to the default value set for this flag: ^1.1.0
This version constraint doesn't match 2.x versions.

https://github.com/wp-cli/scaffold-package-command/blob/master/src/ScaffoldPackageCommand.php#L47

This should be working as expected again now.