import type { ComponentType } from "react"; import { installLocaleSync } from "./features/app/locale"; import { githubCloneSource } from "./features/github/clone/source"; import { startCloneSourcePlugins } from "./features/plugins/cloneSource"; import { trackRuntimeSettings } from "./features/settings/runtime"; import { activateCloneLaunches, CloneWindow } from "./features/vcs/cloneWindow"; import { provideEmbeddedTerminal, registerCloneSource } from "./workbench/contributions"; import { activateDialogWindow } from "./workbench/dialogWindow"; import { activateList } from "./windowBoot"; /** The embedded terminal of the GitHub Sign In dialog, loaded on first use. */ function embeddedTerminal(): () => void { provideEmbeddedTerminal(async (host, options) => (await import("./features/terminal/loader")) .loadTerminalRuntime() .then((rt) => rt.createEmbeddedTerminal(host, options)), ); return () => provideEmbeddedTerminal(undefined); } /** Get from VCS window of project window `parent`: the clone dialog and its sources, no workbench. */ export function bootCloneWindow(parent: string): ComponentType { activateList("clone window", [ ["locale", installLocaleSync], ["settings", trackRuntimeSettings], ["terminal", embeddedTerminal], ["github", () => registerCloneSource(githubCloneSource)], ["plugin clone sources", startCloneSourcePlugins], ["dialog", () => activateDialogWindow(parent)], ["launch", activateCloneLaunches], ]); return CloneWindow; }