Sidr library using composer

Created on 17 December 2023, 6 months ago
Updated 18 May 2024, about 1 month ago

Problem/Motivation

As part of an upgrade from d9 - d10. Upgrading to 5.0, followed README instructions to add library using composer.

When running composer update drupal/sidr:^5.0@RC' both jquery and sidr libraries are deleted from the web/library folder.

When I try just adding the library manually it does not seem to be found.

Installer path seems correct in composer:

      "web/libraries/{$name}": [
        "type:drupal-library",
        "type:npm-asset"
      ],

What am I missing?

💬 Support request
Status

Closed: works as designed

Version

5.0

Component

Code

Created by

🇺🇸United States galactus86

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

Comments & Activities

  • Issue created by @galactus86
  • 🇺🇸United States galactus86
  • 🇨🇦Canada jigarius Montréal

    Hey! I'm sorry for the late reply. I've been very sick and busy. I'll get back to you as soon as possible.

  • 🇺🇸United States galactus86

    I had some time to do some additional testing on my end. I was able to get the library to load by doing the following:

    What seems to be missing is the dependency on wikimedia/composer-merge-plugin in the module's composer.json

    This is my first crack at a patch to address issue.

  • 🇺🇸United States galactus86

    Any follow-up on this? I can't complete a D10 upgrade without this working.

    Thanks!

  • Status changed to Postponed: needs info 4 months ago
  • 🇨🇦Canada jigarius Montréal

    The Composer-based library inclusion mechanism was included in Sidr inspired by the Webform module. I see that they don't force users to rely on wikimedia/composer-merge-plugin, so I think I'll not include it in Sidr's composer.json for now.

    That said, are you able to install the Sidr libraries correctly if you require wikimedia/composer-merge-plugin into your composer.json file? If not, can you please share the entire composer.json file so that I can take a look? Please refer to this video guide if need be.

    If you can't share the file publicly, please contact me using jigarius.com/contact and we'll communicate over Email.

  • Status changed to Closed: works as designed about 1 month ago
  • 🇨🇦Canada jigarius Montréal

    I tested it to be working today. You must've missed a step somewhere. Basically,

    1. Install and configure the Composer Merge plugin
    2. Run composer update --lock or composer require drupal/sidr -W

    I am attaching a working composer.json file so that you can compare it with yours. If you're still face the problem, feel free to reopen this issue.

    {
        "name": "jigarius/drupal-sidr",
        "description": "A Drupal site to develop and test the Sidr module.",
        "type": "project",
        "license": "GPL-2.0-or-later",
        "homepage": "https://www.drupal.org/project/drupal",
        "support": {
            "docs": "https://www.drupal.org/docs/user_guide/en/index.html",
            "chat": "https://www.drupal.org/node/314178"
        },
        "repositories": [
            {
                "type": "composer",
                "url": "https://packages.drupal.org/8"
            }
        ],
        "require": {
            "composer/installers": "^1.9",
            "drupal/core-composer-scaffold": "*",
            "drupal/core-recommended": "^10",
            "drupal/core-vendor-hardening": "*",
            "drupal/sidr": "5.x-dev",
            "drupal/upgrade_status": "^4.3",
            "drush/drush": "^11.6",
            "wikimedia/composer-merge-plugin": "master-dev"
        },
        "conflict": {
            "drupal/drupal": "*"
        },
        "minimum-stability": "stable",
        "prefer-stable": true,
        "config": {
            "sort-packages": true,
            "allow-plugins": {
                "composer/installers": true,
                "drupal/core-composer-scaffold": true,
                "drupal/core-vendor-hardening": true,
                "wikimedia/composer-merge-plugin": true
            }
        },
        "extra": {
            "drupal-scaffold": {
                "locations": {
                    "project-root": "./",
                    "web-root": "web/"
                },
                "allowed-packages": [
                    "drupal/core"
                ]
            },
            "installer-paths": {
                "web/core": [
                    "type:drupal-core"
                ],
                "web/libraries/{$name}": [
                    "type:drupal-library"
                ],
                "web/modules/contrib/{$name}": [
                    "type:drupal-module"
                ],
                "web/profiles/contrib/{$name}": [
                    "type:drupal-profile"
                ],
                "web/themes/contrib/{$name}": [
                    "type:drupal-theme"
                ],
                "drush/Commands/contrib/{$name}": [
                    "type:drupal-drush"
                ],
                "web/modules/custom/{$name}": [
                    "type:drupal-custom-module"
                ],
                "web/profiles/custom/{$name}": [
                    "type:drupal-custom-profile"
                ],
                "web/themes/custom/{$name}": [
                    "type:drupal-custom-theme"
                ]
            },
            "merge-plugin": {
                "include": [
                    "web/modules/contrib/sidr/composer.libraries.json"
                ]
            }
        }
    }
    
Production build 0.69.0 2024