grasmash / composerize-drupal

Convert a non-Composer-managed Drupal application (e.g., one created via tarball) to a Composer-managed Drupal application.
MIT License
125 stars 20 forks source link

Acquia packages & External Library are not supported in composerize process #46

Open rahulgupta-acquia opened 2 years ago

rahulgupta-acquia commented 2 years ago

@grasmash

As per analysis & investigation, we identified in Drupal composerize process is not supported for acquia packages & External Library.

For this reason some of the docroot not able to composerize by ra-up process.

FYR - https://github.com/grasmash/composerize-drupal/pull/45/files

rahulgupta-acquia commented 2 years ago

@shaysmith @rahulsonar-acquia @shriacquia @pratikpp @mohammadzo viz

grasmash commented 2 years ago

That's because drupal/acquia_cms isn't a real project, right?

grasmash commented 2 years ago

You just need to create an exception for acquia packages here: https://github.com/grasmash/composerize-drupal/blob/master/src/Composer/ComposerizeDrupalCommand.php#L176

If it's one of cohesion, cohesion_theme, acquia_cms, lightning, etc., then use an acquia prefix rather than a drupal prefix.

rahulgupta-acquia commented 2 years ago

@grasmash we have one more case, when other library for ex-

grasmash commented 2 years ago

Same fix either way.

Something like:

<?php
$exceptions = [
  'acquia_cms' => 'acquia/acquia_cms',
  'idfive' => 'idfive/idfive',
];
foreach ($projects as $project_name => $project) {
      if (array_key_exists($project, $exceptions)) {
        $package_name = $exceptions[$project];
      }
      else {
        $package_name = "drupal/$project_name";
      }
rahulgupta-acquia commented 2 years ago

ok, I need to figure out how many docroots that are failed with external library and need to create PR for this. Thanks @grasmash for your quick suggestion. 👍

rahulsonar-acquia commented 2 years ago

Is there a way to determine vendor names from drupal config files?

grasmash commented 2 years ago

I don't think so.