/ proof-of-concept / numbl-web-ide
Sign in
proof-of-concept / numbl-web-ide
numbl-web-ide / src / ide.ts
33 lines · 1.1 KBCodeBlameHistory
684a53bBuild on minwebide's project-app shellJeremy Magland 1import { createWorkbench, type AppWorkbench, type WorkbenchTheme, type WorkspaceFileSystem } from 'minwebide';
caef63amip integration: system store in IndexedDB, shared across projectsJeremy Magland 2import { createMipSystem } from './numbl/mipSystem';
ecdc868numbl web IDE: run .m files in the browser with numblJeremy Magland 3import { createNumblRunner } from './numbl/runner';
684a53bBuild on minwebide's project-app shellJeremy Magland 6 * Assembles the numbl workbench (mip system + runner) on a file system. Used
7 * by the project-app shell for both project IDEs and GitHub repo IDEs; does
8 * not own `fs` — the caller disposes it.
684a53bBuild on minwebide's project-app shellJeremy Magland 10export async function openNumblWorkbench(container: HTMLElement, fs: WorkspaceFileSystem, workspaceName: string, theme: WorkbenchTheme): Promise<AppWorkbench> {
caef63amip integration: system store in IndexedDB, shared across projectsJeremy Magland 11 const mip = await createMipSystem();
12 // fetch/refresh mip core in the background; runs await it (and say so
13 // in the output channel if they actually have to wait)
14 void mip.ensureCore().catch(() => { /* retried on the next run */ });
16 const workbench = createWorkbench(container, {
17 fileSystem: fs,
18 theme,
af97089Open GitHub repos as workspaces via #/github/<spec>Jeremy Magland 19 workspaceName,
caef63amip integration: system store in IndexedDB, shared across projectsJeremy Magland 22 const numbl = createNumblRunner(fs, workbench, mip);
ecdc868numbl web IDE: run .m files in the browser with numblJeremy Magland 23 workbench.registerRunner(numbl.runner);
26 workbench,
27 dispose() {
28 numbl.dispose();
29 workbench.dispose();
30 mip.dispose();
31 },
32 };
↑↓ move↵openescclose