0

I'm using Webform with the composer-merge plugin to bring in its libraries:

Relevant parts of my composer.json file:

    "extra": {
         "installer-paths": {
             "public_html/core": ["type:drupal-core"],
             "public_html/libraries/{$name}": ["type:drupal-library"],
             "public_html/modules/contrib/{$name}": ["type:drupal-module"]
         },
         "merge-plugin": {
             "include": [
                 "public_html/modules/contrib/webform/composer.libraries.json"
             ]
         }
     }

I can define my own version of the same library successfully, by using the same code as Webform's composer.libraries.json does but changing the version— successful in that it is recognized:

    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "jquery.inputmask": {
            "type": "package",
            "package": {
                "name": "jquery/inputmask",
                "version": "5.0.6-beta.45",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.inputmask"
                },
                "dist": {
                    "url": "https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.5.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        }
    },

But unsuccessful in that it does not have priority over the one defined in webform:

  • Root composer.json requires jquery/inputmask 5.0.6-beta.45, it is satisfiable by jquery/inputmask[5.0.6-beta.45] from package repo (defining 1 package) but jquery/inputmask[5.0.5] from package repo (defining 1 package) has higher repository priority. The packages with higher priority do not match your constraint and are therefore not installable. See https://getcomposer.org/repoprio for details and assistance.

But i don't know how to take priority.

1
  • Just realizing i could at least try doing my thing in a composer.libraries.json file myself brought in with merge plugin? But not sure it'll help. Worth trying if no one else knows the answer though!
    – mlncn
    Apr 7 at 20:22
0

But unsuccessful in that it does not have priority over the one defined in webform:

There is a way, just define custom repository before Drupal packages repository .

Change your composer.json to

   "repositories": {
        "jquery.inputmask": {
            "type": "package",
            "package": {
                "name": "jquery/inputmask",
                "version": "5.0.6-beta.45",
                "type": "drupal-library",
                "extra": {
                    "installer-name": "jquery.inputmask"
                },
                "dist": {
                    "url": "https://github.com/RobinHerbots/jquery.inputmask/archive/5.0.5.zip",
                    "type": "zip"
                },
                "require": {
                    "composer/installers": "~1.0"
                }
            }
        },
       "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        }
    },
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.