composer: modify typed-data version?

Created on 9 March 2023, over 1 year ago

On a new D9 install, this command

composer require -W 'drupal/rules:^3.0@alpha'

fails:

- drupal/rules[3.0.0-alpha2, ..., 3.0.0-alpha5] require drupal/typed_data * -> found drupal/typed_data[dev-1.x, dev-2.0.x, 1.0.0-alpha1, ..., 1.x-dev (alias of dev-1.x), 2.0.x-dev (alias of dev-2.0.x)] but it does not match your minimum-stability.
- drupal/rules 3.0.0-alpha6 requires drupal/typed_data 1.x-dev -> found drupal/typed_data[dev-1.x, 1.x-dev (alias of dev-1.x)] but it does not match your minimum-stability.
- drupal/rules 3.0.0-alpha7 requires drupal/typed_data ^1.0 -> found drupal/typed_data[dev-1.x, 1.0.0-alpha1, ..., 1.x-dev (alias of dev-1.x)] but it does not match your minimum-stability.

However, if you first install typed-data with its current composer install:

composer require 'drupal/typed_data:^1.0@beta'

and THEN run

composer require -W 'drupal/rules:^3.0@alpha'

it works fine.

Are there small changes you can make to the requirements to allow the rules composer command to work without having to manually run the typed-data install first?

Thank you for this great module!

πŸ’¬ Support request
Status

Fixed

Component

Rules Core

Created by

πŸ‡ΊπŸ‡ΈUnited States kristi wachter

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @kristi wachter
  • Status changed to Fixed over 1 year ago
  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    The key is:

    does not match your minimum-stability

    This tells me the install is being rejected by the stability set in your site composer.json. There is nothing we can do about that from this end. An alternative is to install both rules and typed_data in the same composer command.

    This is a problem you will face with many modules if you try to use an alpha, beta, rc, or dev release. The only real way to avoid encountering this is to never label anything alpha, beta, rc, or dev. And many modules take that approach and make everything a fixed-point release. But that sort of defeats the purpose and makes the "stable" designation worthless.

  • πŸ‡ΊπŸ‡ΈUnited States kristi wachter

    Hi TR,

    Thanks for the reply!

    I was mostly thinking an adjustment to the Rules composer requirements might be helpful for folks who are new to Drupal. I know I could adjust my minimum-stability settings, but out of the box, starting up Drupal with the recommended

    composer create-project drupal/recommended-project projectname

    gets you relatively strict minimum-stability.

    So, for newer users, trying to do

    composer create-project drupal/recommended-project projectname
    and then
    composer require -W 'drupal/rules:^3.0@alpha'

    throws an error that may just make them give up - whereas, if typed-data beta is an acceptable requirement for rules, I wondered whether adjusting the composer requirements for Rules (to reflect that beta version of typed-data) might allow the commands to run seamlessly for new users.

    If it doesn't make sense to make any changes, I understand and thank you for at least reading this, and maybe the existence of this issue will at least help newer users find a quick solution to the error message:

    they can either use composer to install typed-data before installing rules, or they can, as you say, install both rules and typed-data in the same composer command.

    Thanks!

  • πŸ‡ΊπŸ‡ΈUnited States tr Cascadia

    I wondered whether adjusting the composer requirements for Rules (to reflect that beta version of typed-data) might allow the commands to run seamlessly for new users.

    If that's possible to do, I haven't found a way to do it. And I have tried in the past to do exactly that. But IIRC correctly the minimum stability declared in the site composer.json always took precedence regardless of how I declared the dependencies in rules/composer.json.

    If you know a way to fix this then I'd be happy to commit it, but I'm not going to be working on that because I see the best solution as getting typed_data 2.0 released and would rather put my efforts towards that.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024