Adrià Vilanova Martínez | 2d03555 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 1 | // Run legacy Javascript entry point |
| 2 | import '../../../contentScripts/communityConsole/start'; |
| 3 | |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 4 | import DependenciesProviderSingleton, { |
| 5 | AutoRefreshDependency, |
Adrià Vilanova Martínez | cb12c59 | 2024-11-09 20:46:03 +0100 | [diff] [blame] | 6 | ExtraInfoDependency, |
Adrià Vilanova Martínez | 3913f4d | 2024-10-26 21:16:38 +0200 | [diff] [blame] | 7 | OptionsProviderDependency, |
| 8 | StartupDataStorageDependency, |
Adrià Vilanova Martínez | ed1aba3 | 2024-10-26 21:23:12 +0200 | [diff] [blame] | 9 | WorkflowsImportDependency, |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 10 | } from '../../../common/architecture/dependenciesProvider/DependenciesProvider'; |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 11 | import AutoRefreshSetUpScript from '../../../features/autoRefresh/presentation/scripts/setUp.script'; |
Adrià Vilanova Martínez | fe69478 | 2024-11-09 20:40:43 +0100 | [diff] [blame] | 12 | import CCDarkThemeInjectAutoDarkTheme from '../../../features/ccDarkTheme/presentation/scripts/injectAutoDarkTheme.script'; |
| 13 | import CCDarkThemeInjectForcedDarkTheme from '../../../features/ccDarkTheme/presentation/scripts/injectForcedDarkTheme.script'; |
Adrià Vilanova Martínez | 2d03555 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 14 | import InteropThreadPageSetupScript from '../../../features/interopThreadPage/presentation/scripts/setup.script'; |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 15 | import ScriptRunner from '../../../infrastructure/presentation/scripts/ScriptRunner'; |
| 16 | import ScriptSorterAdapter from '../../../infrastructure/presentation/scripts/ScriptSorter.adapter'; |
| 17 | import { SortedScriptsProviderAdapter } from '../../../infrastructure/presentation/scripts/SortedScriptsProvider.adapter'; |
Adrià Vilanova Martínez | 3913f4d | 2024-10-26 21:16:38 +0200 | [diff] [blame] | 18 | import LoadDraftsSetupScript from '../../../features/loadDrafts/presentation/scripts/setup.script'; |
Adrià Vilanova Martínez | ed1aba3 | 2024-10-26 21:23:12 +0200 | [diff] [blame] | 19 | import WorkflowsImportSetUpScript from '../../../features/workflows/presentation/scripts/importSetUp.script'; |
Adrià Vilanova Martínez | cb12c59 | 2024-11-09 20:46:03 +0100 | [diff] [blame] | 20 | import CCExtraInfoSetUpScript from '../../../features/extraInfo/presentation/scripts/ccExtraInfoSetUp.script'; |
Adrià Vilanova Martínez | 33a009c | 2024-11-09 22:41:56 +0100 | [diff] [blame] | 21 | import MWI18nServerScript from '../../../presentation/standaloneScripts/mainWorldServers/MWI18nServerScript.script'; |
| 22 | import MWOptionsWatcherServerScript from '../../../presentation/standaloneScripts/mainWorldServers/MWOptionsWatcherServerScript.script'; |
| 23 | import ApplyStartupDataModificationsOnStartScript from '../../../presentation/standaloneScripts/startupDataStorage/applyStartupDataModificationsOnStart.script'; |
| 24 | import XHRInterceptorScript from '../../../presentation/standaloneScripts/xhrInterceptor/xhrInterceptor.script'; |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 25 | |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 26 | const scriptRunner = createScriptRunner(); |
| 27 | scriptRunner.run(); |
| 28 | |
| 29 | function createScriptRunner() { |
| 30 | const dependenciesProvider = DependenciesProviderSingleton.getInstance(); |
| 31 | const autoRefresh = dependenciesProvider.getDependency(AutoRefreshDependency); |
Adrià Vilanova Martínez | cb12c59 | 2024-11-09 20:46:03 +0100 | [diff] [blame] | 32 | const extraInfo = dependenciesProvider.getDependency(ExtraInfoDependency); |
Adrià Vilanova Martínez | 3913f4d | 2024-10-26 21:16:38 +0200 | [diff] [blame] | 33 | const optionsProvider = dependenciesProvider.getDependency( |
| 34 | OptionsProviderDependency, |
| 35 | ); |
| 36 | const startupDataStorage = dependenciesProvider.getDependency( |
| 37 | StartupDataStorageDependency, |
| 38 | ); |
Adrià Vilanova Martínez | ed1aba3 | 2024-10-26 21:23:12 +0200 | [diff] [blame] | 39 | const workflowsImport = dependenciesProvider.getDependency( |
| 40 | WorkflowsImportDependency, |
| 41 | ); |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 42 | |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 43 | return new ScriptRunner( |
| 44 | new SortedScriptsProviderAdapter( |
| 45 | [ |
| 46 | // Individual feature scripts |
| 47 | new AutoRefreshSetUpScript(autoRefresh), |
Adrià Vilanova Martínez | 6ecaa0d | 2024-10-26 17:04:32 +0200 | [diff] [blame] | 48 | new CCDarkThemeInjectAutoDarkTheme(), |
| 49 | new CCDarkThemeInjectForcedDarkTheme(), |
Adrià Vilanova Martínez | cb12c59 | 2024-11-09 20:46:03 +0100 | [diff] [blame] | 50 | new CCExtraInfoSetUpScript(extraInfo), |
Adrià Vilanova Martínez | 2d03555 | 2024-10-26 20:23:34 +0200 | [diff] [blame] | 51 | new InteropThreadPageSetupScript(), |
Adrià Vilanova Martínez | 3913f4d | 2024-10-26 21:16:38 +0200 | [diff] [blame] | 52 | new LoadDraftsSetupScript(optionsProvider, startupDataStorage), |
Adrià Vilanova Martínez | ed1aba3 | 2024-10-26 21:23:12 +0200 | [diff] [blame] | 53 | new WorkflowsImportSetUpScript(workflowsImport), |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 54 | |
Adrià Vilanova Martínez | 33a009c | 2024-11-09 22:41:56 +0100 | [diff] [blame] | 55 | // Standalone scripts |
| 56 | new ApplyStartupDataModificationsOnStartScript(startupDataStorage), |
| 57 | new MWI18nServerScript(), |
| 58 | new MWOptionsWatcherServerScript(), |
| 59 | new XHRInterceptorScript(), |
Adrià Vilanova Martínez | f92172f | 2024-10-19 15:55:15 +0200 | [diff] [blame] | 60 | ], |
| 61 | new ScriptSorterAdapter(), |
| 62 | ).getScripts(), |
| 63 | ); |
| 64 | } |