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