public static function convertComposerJson($composer_json) {
    // Update version constraints in require.
    foreach ($composer_json['require'] as $package_name => $version_constraint) {
      if ($package_name == 'drupal/core') {
        continue;
      }
      if (strstr($package_name, 'drupal/')) {
        $composer_json['require'][$package_name] = self::convertVersionConstraint($version_constraint);
      }
    }

    // Change drupal/lightning to acquia/lightning.
    $composer_json['require']['acquia/lightning'] = '^2';
    unset($composer_json['require']['drupal/lightning']);

    // Update version constraints in require-dev.
    foreach ($composer_json['require-dev'] as $package_name => $version_constraint) {
      if (strstr($package_name, 'drupal/')) {
        $composer_json['require-dev'][$package_name] = self::convertVersionConstraint($version_constraint);
      }
    }

    // Remove https://packagist.drupal-composer.org.
    foreach ($composer_json['repositories'] as $key => $repository) {
      if ($repository['url'] == 'https://packagist.drupal-composer.org') {
        unset($composer_json['repositories'][$key]);
      }
    }

    // Add https://packages.drupal.org/8.
    $composer_json['repositories']['drupal'] = [
      'type' => 'composer',
      'url' => 'https://packages.drupal.org/8',
    ];

    return $composer_json;
  }