- Issue created by @finn lewis
- 🇬🇧United Kingdom finn lewis Oxford
Just stumbled on this issue: https://www.drupal.org/project/rwprofile/issues/3332288#comment-14890644 📌 RW profile - module project Active
That answers some of our questions.
General projects that contain a composer.json file are published to Packagist.org, not packages.drupal.org. This allows distributions to be installed with composer create-project, without first setting up composer to know what packages.drupal.org is.
This means the .info.yml Drupal dependency translation that packages.drupal.org does is not done. composer.json needs a complete set of PHP & Drupal dependencies that Composer should get on install.
So I think we do want to release the localgov_project and localgov projects to "General Projects"
- 🇬🇧United Kingdom ikit-claw
1. Drupal.org is Drupal-specific; Packagist is for all PHP packages. Drupal.org enforces strict licensing and compatibility; Packagist is more flexible.
2. In Drupal, the .info.yml file defines metadata and Drupal-specific dependencies (e.g., modules, core) for a module or theme, enforcing them at runtime to ensure proper enabling, while the composer.json file manages both Drupal and external PHP dependencies via Composer for installation. Synchronizing Drupal-specific dependencies between both files is crucial to prevent errors, such as installation failures or runtime issues, and aligns with best practices for module development, ensuring consistency for developers. External libraries are only declared in composer.json, not .info.yml, and optional dependencies may differ but should be documented clearly to avoid confusion or issues during deployment.
3. Drupal's infrastructure used to be very limited so for a time a lot of destructions were developed away from drupal.org now drupal.org uses GitLab under the hood this is not an issue. Drupal.org stopped creating packages for installation profiles in November 2022, as the Drush Make-based distribution packaging was outdated and resource-intensive, shifting to Composer-based workflows where profiles are embedded in distributions or projects like Sector, which is listed as a “General project” rather than a “Distribution” to enable straightforward composer require drupal/sector installation, reflecting its modern, flexible approach. Profiles lack standalone packages on packages.drupal.org due to their complexity and are instead managed as part of larger Composer packages, such as distributions or Drupal core, which includes profiles like standard in web/profiles via the drupal/recommended-project scaffold, ensuring dependencies are resolved without separate packaging.
4. Mapping the localgovdrupal/ namespace to Drupal.org is difficult due to Drupal.org’s fixed drupal/ namespace and lack of support for external namespaces in its repository specification, necessitating either direct project contributions to Drupal.org or a custom Composer repository to avoid forking, while maintaining releases on both Packagist and Drupal.org is achievable by using a unified composer.json with provide or replace directives to alias localgovdrupal/ and drupal/ packages, mirroring repositories across GitHub and Drupal.org, and automating synchronized versioning to ensure consistency.
The cleanest option here would be to setup some kind of go between mirroring or run a script that automatically updates the specific entries so it can be easily tagged and deployed on both. I would also advise making sure the modules fall under the security release coverage to give people greater peace of mind and encourage adoption.
If you have more questions I am happy to try and assist.
- 🇬🇧United Kingdom finn lewis Oxford
Hi @ikit-claw,
Thanks so much for your time and considered response, very useful information.
I think at this point we would like to move https://www.drupal.org/project/localgov → from "Distributions" to "General projects" to support straightforward composer require. Is that something you can help with on this issue, or should I create a separate issue?
Many thanks,
Finn
- 🇺🇸United States drumm NY, US
I think at this point we would like to move https://www.drupal.org/project/localgov → from "Distributions" to "General projects" to support straightforward composer require.
That’s now done and https://packagist.org/packages/drupal/localgov is now available.
2. Is it important to make the .info file and composer.json to have the same dependencies? (It seems that drupal.org packaging adds things it finds in the .info file).
Yes, it is very important that dependencies are in
composer.json
. That is the only source of dependency management for general projects. Those are published straight to Packagist.org, which has no idea what an info file might be. It is a good idea to keep them in sync for modules & themes too.I think that might have everything in this issue answered
- 🇬🇧United Kingdom finn lewis Oxford
Hi @drumm,
Thanks ever so much, I think that does indeed answer all our questions on this one for now.
Looking forward to using Gitlab issue queues as soon as they are available too!
Many thanks,
Finn
Automatically closed - issue fixed for 2 weeks with no activity.