Problem/Motivation

When developing custom modules there are several scenarios that require the developer to add a composer.json file to their module. Some of these scenarios depend upon whether the custom module is intended to be contributed back to the community as a project on drupal.org. Here are some reasons for creating a composer.json file

https://www.drupal.org/docs/develop/using-composer/add-a-composerjson-file

Steps to reproduce

Proposed resolution

Add a composer.json file

Remaining tasks

Approve and merge

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

trackleft2 created an issue. See original summary.

trackleft2’s picture

Issue summary: View changes
trackleft2’s picture

Status: Active » Needs review
trackleft2’s picture

Category: Feature request » Bug report

baikho’s picture

Status: Needs review » Postponed
trackleft2’s picture

See the Merge Request on #3343993: Not compatible with search_current_language module with a PHPUnit test that depends on another drupal module via the composer.json.

Additionally, we don't have to set the version constraint in composer.json, we can leave that off if necessary.

trackleft2’s picture

Actually, I might be wrong about this, because I saw this on a different issue.:

With this removal of any Composer constraint on Drupal core, this will mean that Composer will happily allow installing this version regardless of the Composer requirement for Drupal core. (If this module didn't have a composer.json file at all, then drupal.org packaging would use the info.yml file to generate Composer constraints, but since there is a composer.json file, this doesn't happen).