Adding a composer.json file will allow this module to be searchable (and managable) using composer.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Eyal Shalev created an issue. See original summary.

Eyal Shalev’s picture

Status: Needs work » Needs review
FileSize
0 bytes
e0ipso’s picture

Status: Needs review » Needs work

Patch is empty :-)

Eyal Shalev’s picture

FileSize
4.1 KB

I've re-uploaded the patch.

Eyal Shalev’s picture

Status: Needs work » Needs review
Dane Powell’s picture

Status: Needs review » Reviewed & tested by the community
ericduran’s picture

Status: Reviewed & tested by the community » Needs work

Adding a composer.json file will allow this module to be searchable (and managable) using composer.

^^ That statement is not true. I'm using this module now via composer. If we add this composer.json it'll break things.

The drupal dependency should also be removed from that file.

  1. +++ b/composer.json
    @@ -0,0 +1,158 @@
    +    "drupal/core": "8.0.*"
    

    This line should be removed

  2. +++ b/composer.json
    @@ -0,0 +1,158 @@
    +  "minimum-stability": "dev"
    

    This line should also be removed.

naveenvalecha’s picture

Component: Miscellaneous » Code

composer.json is not mandatory https://www.drupal.org/docs/creating-custom-modules/add-a-composerjson-f...
Quoting from the above documentation page.

It is better not to provide a drupal/core version requirement in composer.json because Drupal's composer facade will generate the appropriate metadata based on the info.yml file.

Suresh Prabhu Parkala’s picture

Status: Needs work » Needs review
FileSize
4.11 KB

Removed "drupal/core" and "minimum-stability" statements and added description in the composer file. Please review the patch.

Lal_’s picture

Status: Needs review » Needs work
+++ b/composer.json
@@ -0,0 +1,156 @@
+  "require": {},

I think we need to add the dependencies here, the module is depended to color module

Lal_’s picture

Status: Needs work » Needs review

my bad color module is in core.

Lal_’s picture

FileSize
5.12 KB
9.11 KB

Adding more details on the patch...

naveenvalecha’s picture

Status: Needs review » Closed (won't fix)

per #8 closing this.

tyler36’s picture

While a `composer.json` is _not_ required for Drupal 9 compatibility, I think it's better to include it.

- Drupal 8+ has moved towards "composer" to manage dependencies and modules.
- It allows easier "path" respository symlink via composer for local development.
- It appears to be "unoffical best practise"; most popular modules include a "composer.json" file.