Exclude module `require-dev` and `autoload-dev` from the generated `composer.json`

Open Beginner friendly
#29 0 comments 0 reactions 0 assignees View on GitHub

@keiserjb is already working on this.

Since Nov 19, 2026.

  • #30 by @keiserjb — open

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
78/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Find the code that rebuilds the generated root composer.json and inspect how it merges module composer.json fields. Start by checking the existing tests for generated Composer configuration; add coverage for a module declaring require-dev and autoload-dev while preserving require and autoload. Done when the generated file omits the development fields and retains the regular entries.

Written by the indexing model from the issue text.

Description

Composer Manager merges require-dev and autoload-dev from enabled modules into the generated root composer.json. Composer treats both fields as root-only. Once merged, a module’s development dependencies and autoload rules become part of the site’s Composer configuration. For example, a module that uses PHP_CodeSniffer for development can cause Composer to install it for the site.

Steps to reproduce

  1. Enable a module whose composer.json declares require-dev and autoload-dev.
  2. Rebuild the generated composer.json.
  3. Inspect the generated file for the module’s development dependencies and autoload rules.

Expected behavior

The generated composer.json omits the module’s require-dev and autoload-dev entries and continues to merge its require and autoload entries.

Dominant language
PHP
Stars
1
Forks
4
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from backdrop-contrib/composer_manager

All issues in backdrop-contrib/composer_manager

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.