composerize-drupal icon indicating copy to clipboard operation
composerize-drupal copied to clipboard

Acquia packages & External Library are not supported in composerize process

Open rahulgupta-acquia opened this issue 3 years ago • 8 comments

@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 avatar Jun 02 '22 04:06 rahulgupta-acquia

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

rahulgupta-acquia avatar Jun 02 '22 04:06 rahulgupta-acquia

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

grasmash avatar Jun 02 '22 14:06 grasmash

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.

grasmash avatar Jun 02 '22 14:06 grasmash

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

rahulgupta-acquia avatar Jun 02 '22 15:06 rahulgupta-acquia

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";
      }

grasmash avatar Jun 02 '22 15:06 grasmash

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. 👍

rahulgupta-acquia avatar Jun 02 '22 15:06 rahulgupta-acquia

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

rahulsonar-acquia avatar Jun 02 '22 15:06 rahulsonar-acquia

I don't think so.

grasmash avatar Jun 02 '22 16:06 grasmash