Allows installing Drupal extensions event if not compatible with installed drupal/core package

Overview

mglaman/composer-drupal-lenient

Lenient with it, Drupal 10 with it.

Why?

The Drupal community introduced a lenient Composer facade that modified the drupal/core constraint for packages. This was done to remove a barrier with getting extensions installed via Composer to work on making modules Drupal 9 ready.

We hit the same problem, again. At DrupalCon Portland we sat down and decided a Composer plugin is the best approach.

See Add a composer plugin that supports 'composer require-lenient' to support major version transitions

How

This subscribes to PluginEvents::PRE_POOL_CREATE and filters packages. This is inspired by symfony/flex, but it does not filter out packages. It rewrites the drupal/core constraint on any package with a type of drupal-*, excluding drupal-core.

Try it

Setup a fresh Drupal 10 site with this plugin (remember to press y for the new allow-plugins prompt.)

composer create-project drupal/recommended-project:^10@alpha d10
cd d10
composer config minimum-stability dev
composer config repositories.lenient-plugin vcs https://github.com/mglaman/composer-drupal-lenient.git
composer require mglaman/composer-drupal-lenient

Now, add a module that does not have a D10 compatible release!

composer require drupal/token:1.10.0

🥳 Now you can use cweagans/composer-patches to patch the module for Drupal 10 compatibility!

Next

  • TESTS
  • Don't use MatchAllConstraint but set <= to current drupal/core locked constraint
  • Don't run on all Drupal extensions, only ones in an allowed list in root package's extra
You might also like...
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

MySQL parser for free-id/core package

MySQL parser Installation You can install the package via composer: composer require free-id/mysql Usage use FreeId\Mysql\Parser; $parser = new Parse

A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.
A Laravel artisan based package to create the AWS (SES + SNS) infrastructure to receive email event notifications with Http/Https endpoint.

Laravel SES Tracking Setup the AWS infrastructure to handle email events using SES/SNS and http/s endpoints with a single Laravel artisan command. Thi

Serialize closures. Not maintained. Consider using opis/closure.

PHP SuperClosure A PHP Library for serializing closures and anonymous functions. No Longer Maintained This software is no longer maintained. Consider

This is an experiment to export all RFCs from the PHP wiki into Git, including the change history for each RFC (along with the date and author of each change). This is not meant to replace the wiki.

PHP Requests for Comments (RFCs) About This repository is an experiment to export all RFCs from the PHP wiki into Git, including the change history fo

This is a plugin for pocketmine-mp, when locking a player's items helps players not to lose items or throw things around causing server lag.

[] LockedItem| v1.0.0 Player's item lock Features Player's item lock Players aren't afraid of losing items For Devolopers You can access to LockedItem

Magento 2 Module Experius Page Not Found 404. This module saves all 404 url to a database table

Magento 2 Module Experius Page Not Found 404 This module saves all 404 urls to a database table. Adds an admin grid with 404s It includes a count so y

Magento commands to find translations that are present in one CSV file but not in another, and to translate CSV dicts with DeepL
Magento commands to find translations that are present in one CSV file but not in another, and to translate CSV dicts with DeepL

Hyvä Themes - Magento translation CSV comparison command hyva-themes/magento2-i18n-csv-diff This module adds the bin/magento i18n:diff-csv and i18n:tr

Comments
  • Using with patch fails

    Using with patch fails

    So I'm trying to patch the file that's in D9 for a D10 site, for deprecations. But I get this error

    In RemoteFilesystem.php line 108:

    [TypeError]
    Composer\Util\RemoteFilesystem::copy(): Argument #1 ($originUrl) must be of type string, null given, called in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code on
    line 383

    Exception trace: at phar:///usr/local/bin/composer/src/Composer/Util/RemoteFilesystem.php:108 Composer\Util\RemoteFilesystem->copy() at phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code:383 cweagans\Composer\Patches_composer_tmp3->getAndApplyPatch() at phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code:319 cweagans\Composer\Patches_composer_tmp3->postInstall() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:200 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:142 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:410 Composer\Installer\InstallationManager::Composer\Installer{closure}() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:425 Composer\Installer\InstallationManager->executeBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:334 Composer\Installer\InstallationManager->downloadAndExecuteBatch() at phar:///usr/local/bin/composer/src/Composer/Installer/InstallationManager.php:242 Composer\Installer\InstallationManager->execute() at phar:///usr/local/bin/composer/src/Composer/Installer.php:786 Composer\Installer->doInstall() at phar:///usr/local/bin/composer/src/Composer/Installer.php:616 Composer\Installer->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Installer.php:281 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:477 Composer\Command\RequireCommand->doUpdate() at phar:///usr/local/bin/composer/src/Composer/Command/RequireCommand.php:331 Composer\Command\RequireCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:298 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:1028 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:299 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:374 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:171 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:138 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:88 require() at /usr/local/bin/composer:29

    opened by smustgrave 1
  • Allow overriding requirements on type metapackage

    Allow overriding requirements on type metapackage

    It is possible to add dependencies on internal subsections/modules of a module these then get a composer type of metapackage but also get the drupal core dependencies added. Example: drupal/calendar (https://www.drupal.org/project/calendar) has a dependency on drupal/calendar_datetime

    Could be added to readme but restriction probably unnecessary.

    opened by NickDickinsonWilde 0
Releases(1.0.2)
  • 1.0.2(Jun 24, 2022)

    What's Changed

    • test upgrading d9 to d10 by @mglaman in https://github.com/mglaman/composer-drupal-lenient/pull/6

    Full Changelog: https://github.com/mglaman/composer-drupal-lenient/compare/1.0.1...1.0.2

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Jun 24, 2022)

    What's Changed

    • Fix broken drupal/core constraint with --update-with-all-dependencies by @mglaman in https://github.com/mglaman/composer-drupal-lenient/pull/5

    Full Changelog: https://github.com/mglaman/composer-drupal-lenient/compare/1.0.0...1.0.1

    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Jun 24, 2022)

Owner
Matt Glaman
Principal Software Engineer at @acquia
Matt Glaman
A Magento 2 dashboard to display installed extensions. Read the blog post on some of the thinking behind it:

Extension Dashboard for Magento 2 This module adds a dashboard to review all installed extensions in the Magento admin (Magento 2.3.0+ for now only).

ExtDN 36 Dec 24, 2022
This library uses GD and EXIF (optional) PHP extensions so make sure you have them installed.

simple and fast image processing class that can downscale, compress and convert images using php-gd native functions

Leon 8 Jul 15, 2022
🎮 A simple command line tool for installing and interacting with your leaf apps

Leaf CLI 2 A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting wit

Leaf Framework 7 Aug 24, 2022
WARNING! This software is currently non-functional. - A system which makes installing Jexactyl far, far easier.

Jexactyl Assistant A system which makes installing Jexactyl far, far easier. WARNING ?? This software is currently in heavy alpha testing and WILL NOT

Jexactyl 7 Nov 14, 2022
Perform static analysis of Drupal PHP code with phpstan-drupal.

Perform static analysis of Drupal PHP code with PHPStan and PHPStan-Drupal on Drupal using PHP 8. For example: docker run --rm \ -v $(pwd)/example01

Dcycle 0 Dec 10, 2021
Laravel Blog Package. Easiest way to add a blog to your Laravel website. A package which adds wordpress functionality to your website and is compatible with laravel 8.

Laravel Blog Have you worked with Wordpress? Developers call this package wordpress-like laravel blog. Give our package a Star to support us ⭐ ?? Inst

Binshops 279 Dec 28, 2022
Docker-magento2 - 🐳 Docker containers with all required Magento 2 dependencies installed available as FPM through Nginx and CLI

Magento 2 Docker A collection of Docker images for running Magento 2 through nginx and on the command line. Quick Start cp composer.env.sample compose

Meanbee 454 Dec 27, 2022
Installed composer packages info

PackageInfo This package was highly inspired from ocramius/package-versions I needed some methods to read data from the composer.lock file fast...this

Martin Keckeis 7 Jun 2, 2022
Composer addon to efficiently get installed packages' version numbers

Package Versions composer/package-versions-deprecated is a fully-compatible fork of ocramius/package-versions which provides compatibility with Compos

Composer 1.4k Dec 27, 2022