xwp / block-scaffolding-wp

WordPress plugin template for extending Gutenberg
https://join.xwp.co
18 stars 17 forks source link

Support Composer 2 #89

Closed kienstra closed 3 years ago

kienstra commented 3 years ago
\W $composer install        
The "dealerdirect/phpcodesniffer-composer-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "composer/installers" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - composer/installers is locked to version v1.7.0 and an update of this package was not requested.
    - composer/installers v1.7.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - dealerdirect/phpcodesniffer-composer-installer is locked to version v0.6.2 and an update of this package was not requested.
    - dealerdirect/phpcodesniffer-composer-installer v0.6.2 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.
\W $b

Testing Steps

  1. composer self-update --2
  2. This will ensure Composer is version 2
  3. composer install
  4. Expected: there's no error
  5. composer test
  6. Expected: tests pas
  7. composer lint
  8. Expected: linting passes
kienstra commented 3 years ago

Hi @derekherman and @kasparsd, What do you think about this PR?

Even though this repo will be archived, this PR could prevent applicants from having to downgrade Composer with composer self-update --1

Thanks!

kasparsd commented 3 years ago

@kienstra Sounds good!

Do you have ideas what is causing this issue during Travis runs:

Fatal error: Uncaught SebastianBergmann\CodeCoverage\RuntimeException: XDEBUG_MODE=coverage or xdebug.mode=coverage has to be set in /home/travis/build/xwp/block-scaffolding-wp/vendor/phpunit/php-code-coverage/src/Driver/Xdebug.php on line 50

https://travis-ci.com/github/xwp/block-scaffolding-wp/builds/225499204

Could that be a major version upgrade for one of the dev dependencies?

kienstra commented 3 years ago

Hi @kasparsd, Ah, good point.

Here's a PR to make Travis pass: https://github.com/xwp/block-scaffolding-wp/pull/91