Skip to content

Commit

Permalink
Merge pull request #18 from mglaman/without-lock-file
Browse files Browse the repository at this point in the history
Add support when lock file is being generated
  • Loading branch information
mglaman committed Jun 30, 2023
2 parents 7f33d17 + 21c89f7 commit 5a0e67f
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,48 @@ jobs:
run: |
cd ~/drupal
composer show drupal/purge
without_lock_file:
runs-on: "ubuntu-latest"
name: "without lock file"
steps:
- name: "Checkout"
uses: "actions/checkout@v2"
- name: "Install PHP"
uses: "shivammathur/setup-php@v2"
with:
coverage: none
php-version: 8.1
tools: composer:v2
extensions: dom, curl, libxml, mbstring, zip, pdo, mysql, pdo_mysql, bcmath, gd, exif, iconv
- name: Setup Drupal
uses: bluehorndigital/[email protected]
with:
version: "^10"
path: ~/drupal
allow_plugins: |
drupal/core-composer-scaffold
drupal/core-project-message
mglaman/composer-drupal-lenient
- name: Require self
run: |
cd ~/drupal
composer require mglaman/composer-drupal-lenient *@dev
- name: Configure allowed list
run: |
cd ~/drupal
composer config --merge --json extra.drupal-lenient.allowed-list '["drupal/token"]'
- name: Remove lock file
run: |
cd ~/drupal
rm composer.lock
rm -rf vendor
- name: Require self globally
run: |
cd ~/drupal
composer global config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
composer global require mglaman/composer-drupal-lenient *@dev
- name: Add non-compatible module release
run: |
cd ~/drupal
composer require drupal/token:1.10.0 -W
composer show drupal/token
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ composer require drupal/token:1.10.0
```

🥳 Now you can use [cweagans/composer-patches](https://github.com/cweagans/composer-patches) to patch the module for Drupal 10 compatibility!

## Support when `composer.lock` removed

This plugin must be installed globally if your project's `composer.lock` file is removed.

```shell
composer global config --no-plugins allow-plugins.mglaman/composer-drupal-lenient true
composer global require mglaman/composer-drupal-lenient
```

**Warning**: this means the plugin will run on all Composer commands. This is not recommended, but it is the only way
the plugin can work when `composer.lock` is removed.

0 comments on commit 5a0e67f

Please sign in to comment.