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! Commented Apr 7, 2021 at 20:22

1 Answer 1

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" } }, 

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.