src/Update/Updates.php
public function update_8009003() {
    $composer_json = $this->updater->getComposerJson();

    $composer_json['extra']['installer-types'][] = 'bower-asset';
    $composer_json['extra']['installer-types'][] = 'npm-asset';
    $composer_json['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:bower-asset';
    $composer_json['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:npm-asset';

    // Add the Asset Packagist repository if it does not already exist.
    if (isset($composer_json['repositories'])) {
      $repository_key = NULL;
      foreach ($composer_json['repositories'] as $key => $repository) {
        if ($repository['type'] == 'composer' && strpos($repository['url'], 'https://asset-packagist.org') === 0) {
          $repository_key = $key;
          break;
        }
      }
      if (is_null($repository_key)) {
        $composer_json['repositories']['asset-packagist'] = [
          'type' => 'composer',
          'url' => 'https://asset-packagist.org',
        ];
      }
    }

    $projectAcsfHooks = $this->updater->getRepoRoot() . '/factory-hooks';
    $acsf_inited = file_exists($projectAcsfHooks);
    if ($acsf_inited) {
      $composer_json['config']['platform']['php'] = '5.6';
    }

    $this->updater->writeComposerJson($composer_json);

    $messages = [
      "Your composer.json file has been modified to be compatible with Lightning 2.1.8+.",
      "You must execute `composer update` to update your lock file.",
    ];
    $formattedBlock = $this->updater->getFormatter()->formatBlock($messages, 'ice');
    $this->updater->getOutput()->writeln("");
    $this->updater->getOutput()->writeln($formattedBlock);
    $this->updater->getOutput()->writeln("");
  }
public function update_8009003() {
    $composer_json = $this->updater->getComposerJson();

    $composer_json['extra']['installer-types'][] = 'bower-asset';
    $composer_json['extra']['installer-types'][] = 'npm-asset';
    $composer_json['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:bower-asset';
    $composer_json['extra']['installer-paths']['docroot/libraries/{$name}'][] = 'type:npm-asset';

    // Add the Asset Packagist repository if it does not already exist.
    if (isset($composer_json['repositories'])) {
      $repository_key = NULL;
      foreach ($composer_json['repositories'] as $key => $repository) {
        if ($repository['type'] == 'composer' && strpos($repository['url'], 'https://asset-packagist.org') === 0) {
          $repository_key = $key;
          break;
        }
      }
      if (is_null($repository_key)) {
        $composer_json['repositories']['asset-packagist'] = [
          'type' => 'composer',
          'url' => 'https://asset-packagist.org',
        ];
      }
    }

    $projectAcsfHooks = $this->updater->getRepoRoot() . '/factory-hooks';
    $acsf_inited = file_exists($projectAcsfHooks);
    if ($acsf_inited) {
      $composer_json['config']['platform']['php'] = '5.6';
    }

    $this->updater->writeComposerJson($composer_json);

    $messages = [
      "Your composer.json file has been modified to be compatible with Lightning 2.1.8+.",
      "You must execute `composer update` to update your lock file.",
    ];
    $formattedBlock = $this->updater->getFormatter()->formatBlock($messages, 'ice');
    $this->updater->getOutput()->writeln("");
    $this->updater->getOutput()->writeln($formattedBlock);
    $this->updater->getOutput()->writeln("");
  }
public function update_8009003 ( ) { $ composer_json = $ this -> updater -> getComposerJson ( ) ; $ composer_json [ 'extra' ] [ 'installer-types' ] [ ] = 'bower-asset' ; $ composer_json [ 'extra' ] [ 'installer-types' ] [ ] = 'npm-asset' ; $ composer_json [ 'extra' ] [ 'installer-paths' ] [ 'docroot/libraries/{$name}' ] [ ] = 'type:bower-asset' ; $ composer_json [ 'extra' ] [ 'installer-paths' ] [ 'docroot/libraries/{$name}' ] [ ] = 'type:npm-asset' ; // Add the Asset Packagist repository if it does not already exist. if ( isset ( $ composer_json [ 'repositories' ] ) ) { $ repository_key = NULL ; foreach ( $ composer_json [ 'repositories' ] as $ key => $ repository ) { if ( $ repository [ 'type' ] == 'composer' && strpos ( $ repository [ 'url' ] , 'https://asset-packagist.org' ) === 0 ) { $ repository_key = $ key ; break ; } } if ( is_null ( $ repository_key ) ) { $ composer_json [ 'repositories' ] [ 'asset-packagist' ] = [ 'type' => 'composer' , 'url' => 'https://asset-packagist.org' , ] ; } } $ projectAcsfHooks = $ this -> updater -> getRepoRoot ( ) . '/factory-hooks' ; $ acsf_inited = file_exists ( $ projectAcsfHooks ) ; if ( $ acsf_inited ) { $ composer_json [ 'config' ] [ 'platform' ] [ 'php' ] = '5.6' ; } $ this -> updater -> writeComposerJson ( $ composer_json ) ; $ messages = [ "Your composer.json file has been modified to be compatible with Lightning 2.1.8+." , "You must execute `composer update` to update your lock file." , ] ; $ formattedBlock = $ this -> updater -> getFormatter ( ) -> formatBlock ( $ messages , 'ice' ) ; $ this -> updater -> getOutput ( ) -> writeln ( "" ) ; $ this -> updater -> getOutput ( ) -> writeln ( $ formattedBlock ) ; $ this -> updater -> getOutput ( ) -> writeln ( "" ) ; }
8.9.3.

@Update(
version = "8009003",
description = "Adding support for Asset Packagist."
)
8 . 9 . 3 .