private function addToComponentManifest($version, array $component)
    {
        $manifest = $this->getManifest($this->manifest());
        $index = $this->getManifestComponentModuleIndex($manifest, $component['id']);

        array_unshift($manifest['modules'][$index]['versions'], 'v'. $version);

        $content = json_encode($manifest, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) ."\n";
        $result = file_put_contents($this->manifest(), $content);
        $this->setManifest($manifest);

        if (!$result) {
            throw new \RuntimeException('File write failed');
        }
    }