Change or remove sub packages from drupal/operations

Created on 3 July 2023, about 1 year ago
Updated 2 August 2023, about 1 year ago

Problem/Motivation

I am building a module suite that contains a few independent components in one main repo: Operations ( https://www.drupal.org/project/operations/ β†’ )

The submodules are designed to be installed independently so I created secondary projects for them:

I wasn't aware that pushing submodules would create pseudo-packages on drupal packagist.

When I made the first release in the main project (Operations), and created releases in the secondary project, I learned that Drupal Packagist will create new drupal/* packages from all the drupal modules finds in your project and that if another project comes along with the same namespace, it will avoid collisions by doubling up the name.

Drupal packagist scanned my main "operations" repo and created subpackages based on the composer.json.

  • drupal/site
  • drupal/site_manager

This poses a problem because I want users to be able to require site and site_manager without the entire operations module code. When you require drupal/site, drupal/operations is included. Drupal Packagist assumed the submodules Site and Site Manager are dependent on on main Operations package when they are not. (My guess is this is so that when you require submodule, since it's code lives in the parent, it says it requires the parent so that code is downloaded?)

Steps to reproduce

# Current result:

$ composer info drupal/site -a
homepage : https://www.drupal.org/project/operations

$ composer info drupal/site-site -a
homepage : https://www.drupal.org/project/site

$ composer info drupal/site_manager -a
homepage : https://www.drupal.org/project/operations

$ composer info drupal/site_manager-site_manager -a
homepage : https://www.drupal.org/project/site

# Desired result:

$ composer info drupal/site -a
homepage : https://www.drupal.org/project/site

$ composer info drupal/site_manager -a
homepage : https://www.drupal.org/project/site_manager

Another strange side effect is there seems to be two drupal/operations packages, with two different descriptions:

❯ composer search operations
Info from https://repo.packagist.org: #StandWithUkraine
drupal/operations                                Tools for operating Drupal sites.
sebastian/resource-operations                    Provides a list of PHP built-in functions that operate on resources
drupal/operations                                Provides tools for operating Drupal sites.

Proposed resolution

Can we change the package names so they point to the drupal projects?

Thanks!

πŸ“Œ Task
Status

Fixed

Version

1.0

Component

Miscellaneous

Created by

πŸ‡ΊπŸ‡ΈUnited States Jon Pugh Newburgh, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024