Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Problem/Motivation
I've added a composer.json
file to a theme:
http://cgit.drupalcode.org/sailor/tree/composer.json
however, the dependencies in that file are ignored by Drupal Packagist.
$ composer info drupal/sailor
name : drupal/sailor
descrip. :
keywords :
versions : * 1.0.0-rc2
type : drupal-theme
license : GPL-2.0+
source : [git] https://git.drupal.org/project/sailor 8.x-1.0-rc2
dist : [zip] https://ftp.drupal.org/files/projects/sailor-8.x-1.0-rc2.zip 8.x-1.0-rc2
names : drupal/sailor
support
source : http://cgit.drupalcode.org/sailor
requires
drupal/core ~8.0
Proposed resolution
Merge a theme's `composer.json` file with what is generated (just like modules).
Remaining tasks
- Write Patch
User interface changes
None.
API changes
Theme's composer.json
will be respected.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#3 | project_dependency-theme_composer-2922785.patch | 959 bytes | davidwbarratt |
Comments
Comment #2
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedWe are not parsing theme's dependencies:
We should parse theme's dependencies and put them into the database. It's either that, or Drupal.org Composer should ignore the dependency database and parse the dependencies directly.
Comment #3
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedI'm not sure what kind of errors this will throw, but maybe the tests will throw them for us. :)
Comment #4
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedComment #5
trobey CreditAttribution: trobey as a volunteer commentedEver since I started maintaining Project Dependency a number of years ago I have been told that themes should be ignored for dependencies. Of course things are quite different now with Composer being used. I have no problem with including themes but I also do not know if there will be unintended consequences. I will try to get to this in the next day or so.
Comment #6
davidwbarratt CreditAttribution: davidwbarratt commentedYeah I mean it's still going to be ignored by Drupal, but it will be used by Drupal Packagist and Composer.
Comment #8
trobey CreditAttribution: trobey as a volunteer commentedI tested this out. Before the patch
After the patch
The releases are processed when they are released so only releases after this change is deployed to Drupal.org will be picked up without manual fixes. I will try to contact someone early next week to get this deployed.
Comment #9
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedHas this been deployed?
Comment #10
trobey CreditAttribution: trobey as a volunteer commentedThanks for the reminder. I just pinged drumm but I may need to ping him again in the morning.
Comment #11
MixologicWe probably need a follow up issue in project_composer, because it, too, is not likely processing themes.
Comment #12
drummDeployed, and dependencies are being calculated for all 1,461 themes with releases.
I skimmed project_composer and didn't spot anything specific which prevented themes from working well.
Comment #13
davidwbarratt CreditAttribution: davidwbarratt for Sail Venice commentedYAY! Thank you so much! Dreams do come true!
Comment #14
drummParsing the dependencies is about half done, so that should complete in the next hour. For Composer, we’ll at least need to run the scripts which regenerate json for Drupal.org's Composer endpoint.