refactor(ui-spacing): migrate to the new DI architecture
With this migration we also get for free that this option is now
dynamic, so changing it will automatically update the applied styles.
Bug: twpowertools:176, twpowertools:61
Change-Id: Icac4f829745a06c95439931955be6c52c7303482
diff --git a/src/entryPoints/twBasic/thread/start.ts b/src/entryPoints/twBasic/thread/start.ts
new file mode 100644
index 0000000..d3fa2ea
--- /dev/null
+++ b/src/entryPoints/twBasic/thread/start.ts
@@ -0,0 +1,24 @@
+// Run legacy Javascript entry point
+import '../../../contentScripts/publicThreadStart';
+
+import UiSpacingSharedStylesScript from '../../../features/uiSpacing/presentation/scripts/sharedStyles.script';
+import UiSpacingTwBasicStylesScript from '../../../features/uiSpacing/presentation/scripts/twBasicStyles.script';
+import ScriptRunner from '../../../infrastructure/presentation/scripts/ScriptRunner';
+import ScriptSorterAdapter from '../../../infrastructure/presentation/scripts/ScriptSorter.adapter';
+import { SortedScriptsProviderAdapter } from '../../../infrastructure/presentation/scripts/SortedScriptsProvider.adapter';
+
+const scriptRunner = createScriptRunner();
+scriptRunner.run();
+
+function createScriptRunner() {
+ return new ScriptRunner(
+ new SortedScriptsProviderAdapter(
+ [
+ // Individual feature scripts
+ new UiSpacingSharedStylesScript(),
+ new UiSpacingTwBasicStylesScript(),
+ ],
+ new ScriptSorterAdapter(),
+ ).getScripts(),
+ );
+}