public static function writeComposerManifest(string $manifestPath, string $packageKey, array $composerManifestData = []): array
    {
        $manifest = [
            'description' => ''
        ];

        if ($composerManifestData !== null) {
            $manifest = array_merge($manifest, $composerManifestData);
        }
        if (!isset($manifest['name']) || empty($manifest['name'])) {
            $manifest['name'] = static::getComposerPackageNameFromPackageKey($packageKey);
        }

        if (!isset($manifest['require']) || empty($manifest['require'])) {
            $manifest['require'] = ['neos/flow' => '*'];
        }

        if (!isset($manifest['autoload'])) {
            $namespace = str_replace('.', '\\', $packageKey) . '\\';
            $manifest['autoload'] = ['psr-4' => [$namespace => FlowPackageInterface::DIRECTORY_CLASSES]];
        }

        $manifest['extra']['neos']['package-key'] = $packageKey;

        if (defined('JSON_PRETTY_PRINT')) {
            file_put_contents(Files::concatenatePaths([$manifestPath, 'composer.json']), json_encode($manifest, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
        } else {
            file_put_contents(Files::concatenatePaths([$manifestPath, 'composer.json']), json_encode($manifest));
        }

        return $manifest;
    }