import { mkdir, mkdtemp, readdir, rm, writeFile } from 'node:fs/promises' import { tmpdir } from 'node:os' import { join } from 'node:path' import { fileURLToPath } from 'node:url' import { describe, expect, it } from 'vitest' import { mobileWebAppModuleClosure } from './build-mobile-web-app-bundle.mjs' import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs' /** * The 612 KiB xterm engine string, and where the page must never meet it. * * `terminal-webview-engine.generated.ts` is one minified IIFE of xterm plus two addons, built to * be injected into the WebView's HTML document as text. On the page the same engine arrives as an * import, so the string is 610 KiB of dead weight — the largest single module in the session * route's closure, and unusable there besides, because the shell's CSP has `script-src 'self'` * and no nested frame to load a document into. * * Nothing stops it entering: the module the document's `