Pre-process and store namespaces
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #2725437. -->
Reported by: [Mixologic](https://www.drupal.org/user/391689)
>>>
<p>In order to keep a good developer experience, we want to keep the package namespace simple, yet be able to handle the module namespace collisions. For example, we want drupal/entity to represent the entity module in the entity project, and not the short lived entity module from drupal core. </p>
<p>Right now we have seeded the projects by running the core project first, then all modules and themes in descending order according to update stats.<br>
When there is a conflict between module namespaces, the less used project gets the package namespace of <code>drupal/<project>_<modulename></code>, and the most used project gets to keep the <code>drupal/<modulename></code> namespace.</p>
<p>Additionally, we should namespace core modules since they will always end up being metapackages. Core modules should get the namespace of <code>drupal/core_<modulename></code></p>
<p>So, we need to :</p>
<ol>
<li>Add a drush command to process all of the projects and themes, and add an additional database table that keeps a mapping of projectname, modulename, and packagename. Add the core module detection to this db table.</li>
<li>Update the versioncontrol hooks to look for new projects/modules to add to the namespace mapping table</li>
<li>Update the package json data to get the package namespace.</li>
<li>Update the package json data to reflect core_module dependencies</li>
</ol>
issue