Simplify composer.json

Created on 15 October 2024, 6 months ago

Problem/Motivation

Since we recently updated the d.o-Project-node's summary field for the project browser initiative , we should update the description field in composer.json too.

For the sake of maintaining fewer lines of code, we can also remove some fields from composer.json, because the Drupal.org Composer Service (façade) a.k.a. project_composer rewrites the following fields which are currently defined in sitemap's composer.json...

  1. type: it will be set to drupal-module because the d.o-Project-node type is project_module
  2. homepage: it will be set to the d.o-Project-node URL
  3. authors: it will be set to the Project's maintainers
  4. support/source: it will be set to the URL of the project on git.drupalcode.org
  5. license: it will be set to GPL-2.0-or-later, because all projects hosted on d.o must have this license
  6. require: it will be set to match the dependencies in the .info.yml file because all current dependencies are Drupal projects

For more information, see the following project_composer code: _project_composer_build_component_metadata(), project_composer_get_component_json(), and _project_composer_release_metadata().

Note that project_composer also rewrites the name, but it is one of the few required fields in composer.json, so if someone happens to clone the module, it is nice to have it set, so that Composer doesn't get upset.

I think we can also delete the minimum-stability field, as we don't depend on anything with dev stability.

Proposed resolution

  1. Update the description field in composer.json
  2. Remove the type, homepage, authors, support/source, license, require, and minimum-stability fields in composer.json

Remaining tasks

  1. Write a patch
  2. Review and feedback
  3. RTBC and feedback
  4. Commit

User interface changes

None.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇨🇦Canada mparker17 UTC-4

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

Comments & Activities

  • Issue created by @mparker17
  • 🇨🇦Canada mparker17 UTC-4

    mparker17 changed the visibility of the branch 3480934-simplify-composer-json to hidden.

  • 🇨🇦Canada mparker17 UTC-4

    I meant to do a merge request for this, but forgot to switch branches, committed to 2.0.x, and pushed, meaning that to undo this change, I would have to git revert, i.e.: undo the changes - and then re-redo them later. I've had good success with this on other projects, and tests are passing, so I'm just going to close this ticket. I apologize for the confusion!

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024