Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Other
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jun 2015 at 12:51 UTC
Updated:
23 Aug 2015 at 17:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
timmillwoodComment #3
mile23I say yay Composer! But I also wonder why we need this.
What specifically does it support?
Comment #4
timmillwoodThe example module doesn't need it, but all modules should have it, so it's setting an example.
The reasoning for all modules having a composer.json is mainly to set a "type" and therefore get the module to go into the modules directory when installed via composer.
Comment #5
mile23Cool. :-)
Aside from the broken HEAD problem making this fail.... :-)
The patch adds a whitespace line to the end of composer.json.
Also it doesn't pass when you say
composer validate, needing a license section. Everything on D.O is GPL 2.0+I'd also suggest we add a
"_readme"section explaining why the file is there, saying essentially what you said above: Drupal 8 doesn't quite support Composer but it's possible to install modules where they belong with composer-installer and other techniques, and a link to documentation about how to do that.Comment #6
timmillwoodAdded license to composer.json and a basic paragraph to README.
Comment #7
pp commentedI checked the file with
composer validateand I got the following error message:The right licence id is "GPL-2.0+". I corrected it only, and rerolled the patch.
Comment #8
timmillwoodAwesome!
Comment #9
mile23So we have a root-level examples module, but we also have all the other modules. Do they need composer.json as well? This is one of the questions that hasn't been answered in the many Composer-related core issues.
Also, let's not dictate that contrib *should* have a composer.json file. Let's say that you *can* have one, and link to a documentation page about it, why it's a good idea, etc.
Comment #10
sethfischer commentedWe should retain the wording "... all contrib modules *should* ship with one."
Using the word "must" would dictate that a composer.json is a mandatory requirement. The word "should" indicates that it is a good practice to include a composer.json - but it is not mandatory.
"Can" is the wrong word to use in this context. A module author can include any file they like in their module. Hence we don't need to give the authors permission to include a composer.json.
Developers are already using a composer based workflow for Drupal 8. We want modules to start shipping with a composer.json now to accommodate this.
Comment #11
timmillwood"should" is the exact wording needed. Eventually we want to automate the listing of all D.o modules on packagist, without a composer.json then will not get listed.
Comment #13
mile23OK, committed. Thanks, folks. :-)