refactor: create reusable EntrypointScriptRunner class

Change-Id: I88e0fbc4118a28cafe1c9548583c4049036dfaa9
diff --git a/src/common/architecture/entrypoint/Context.ts b/src/common/architecture/entrypoint/Context.ts
new file mode 100644
index 0000000..0ebe29f
--- /dev/null
+++ b/src/common/architecture/entrypoint/Context.ts
@@ -0,0 +1,11 @@
+import {
+  ScriptEnvironment,
+  ScriptPage,
+  ScriptRunPhase,
+} from '../scripts/Script';
+
+export interface Context {
+  page: ScriptPage;
+  environment: ScriptEnvironment;
+  runPhase: ScriptRunPhase;
+}
diff --git a/src/common/architecture/entrypoint/EntrypointScriptRunner.ts b/src/common/architecture/entrypoint/EntrypointScriptRunner.ts
new file mode 100644
index 0000000..d47e947
--- /dev/null
+++ b/src/common/architecture/entrypoint/EntrypointScriptRunner.ts
@@ -0,0 +1,19 @@
+import Features from '../../../features/Features';
+import ScriptRunner from '../scripts/ScriptRunner';
+import { Context } from './Context';
+
+export default class EntrypointScriptRunner {
+  private features: Features;
+  private scriptRunner: ScriptRunner;
+
+  constructor(public context: Context) {
+    this.features = new Features();
+    this.scriptRunner = new ScriptRunner();
+  }
+
+  run() {
+    const scripts = this.features.getScripts(this.context);
+    this.scriptRunner.add(...scripts);
+    this.scriptRunner.run();
+  }
+}