services:
  _defaults:
    autowire: true
    autoconfigure: true
    public: false

  Praetorius\ViteAssetCollector\:
    resource: '../Classes/*'
    exclude: '../Classes/Domain/Model/*'

  cache.viteassetcollector_manifest:
    class: TYPO3\CMS\Core\Cache\Frontend\FrontendInterface
    factory: ['@TYPO3\CMS\Core\Cache\CacheManager', 'getCache']
    arguments: ['viteassetcollector_manifest']

  Praetorius\ViteAssetCollector\Service\ViteService:
    arguments:
      $cache: '@cache.viteassetcollector_manifest'

  Praetorius\ViteAssetCollector\Command\ViteConfigCommand:
    tags:
      - name: console.command
        command: 'vite:config'
        description: 'Generates a boilerplate vite config file'

  Praetorius\ViteAssetCollector\Configuration\VitePlaceholderProcessor:
    public: true

  Praetorius\ViteAssetCollector\IconProvider\SvgIconProvider:
    public: true

  Praetorius\ViteAssetCollector\EventListener\MutateContentSecurityPolicy:
    tags:
      - name: event.listener
        identifier: 'praetorius/vite-asset-collector-csp'
        event: TYPO3\CMS\Core\Security\ContentSecurityPolicy\Event\PolicyMutatedEvent

  # Register class aliases for deprecated ViewHelper names
  Praetorius\ViteAssetCollector\ViewHelpers\Asset\ViteViewHelper:
    class: Praetorius\ViteAssetCollector\ViewHelpers\AssetViewHelper
  Praetorius\ViteAssetCollector\ViewHelpers\Resource\ViteViewHelper:
    class: Praetorius\ViteAssetCollector\ViewHelpers\UriViewHelper
