2727use craft \utilities \ClearCaches ;
2828use craft \web \twig \variables \CraftVariable ;
2929use craft \web \UrlManager ;
30- use nystudio107 \pluginvite \services \VitePluginService ;
31- use nystudio107 \transcoder \assetbundles \transcoder \TranscoderAsset ;
3230use nystudio107 \transcoder \models \Settings ;
33- use nystudio107 \transcoder \services \Transcode ;
31+ use nystudio107 \transcoder \services \ServicesTrait ;
3432use nystudio107 \transcoder \variables \TranscoderVariable ;
3533use yii \base \ErrorException ;
3634use yii \base \Event ;
4139 * @author nystudio107
4240 * @package Transcode
4341 * @since 1.0.0
44- *
45- * @property Transcode $transcode
46- * @property Settings $settings
47- * @property VitePluginService $vite
48- * @method Settings getSettings()
4942 */
5043class Transcoder extends Plugin
5144{
45+ // Traits
46+ // =========================================================================
47+
48+ use ServicesTrait;
49+
5250 // Static Properties
5351 // =========================================================================
5452
@@ -62,46 +60,23 @@ class Transcoder extends Plugin
6260 */
6361 public static ?Settings $ settings ;
6462
65- // Static Methods
66- // =========================================================================
67- /**
68- * @var string
69- */
70- public string $ schemaVersion = '1.0.0 ' ;
71-
7263 // Public Properties
7364 // =========================================================================
65+
7466 /**
7567 * @var bool
7668 */
7769 public bool $ hasCpSection = false ;
70+
7871 /**
7972 * @var bool
8073 */
8174 public bool $ hasCpSettings = false ;
8275
8376 /**
84- * @inheritdoc
77+ * @var string
8578 */
86- public function __construct ($ id , $ parent = null , array $ config = [])
87- {
88- $ config ['components ' ] = [
89- 'transcode ' => Transcode::class,
90- // Register the vite service
91- 'vite ' => [
92- 'class ' => VitePluginService::class,
93- 'assetClass ' => TranscoderAsset::class,
94- 'useDevServer ' => true ,
95- 'devServerPublic ' => 'http://localhost:3001 ' ,
96- 'serverPublic ' => 'http://localhost:8000 ' ,
97- 'errorEntry ' => 'src/js/app.ts ' ,
98- 'devServerInternal ' => 'http://craft-transcoder-buildchain:3001 ' ,
99- 'checkDevServer ' => true ,
100- ],
101- ];
102-
103- parent ::__construct ($ id , $ parent , $ config );
104- }
79+ public string $ schemaVersion = '1.0.0 ' ;
10580
10681 // Public Methods
10782 // =========================================================================
0 commit comments