mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
refactor: colocate mobile web route and bundle tooling (#32008)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { readFile } from 'node:fs/promises'
|
||||
import { readRouteSnapshot } from './mobile-web-app-route-snapshot.mjs'
|
||||
import { readRouteSnapshot } from './mobile-web-app/mobile-web-app-route-snapshot.mjs'
|
||||
import { realpathSync } from 'node:fs'
|
||||
import { basename, extname, join, resolve } from 'node:path'
|
||||
import { createRequire } from 'node:module'
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
collectMobileWebAppRoutes,
|
||||
renderMobileWebAppRouteManifest,
|
||||
routePathnameFromKey
|
||||
} from './mobile-web-app-route-manifest.mjs'
|
||||
} from './mobile-web-app/mobile-web-app-route-manifest.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
readAppBundle,
|
||||
readWrittenBundle,
|
||||
copyWrittenBundle
|
||||
} from './mobile-web-app-bundle-test-fixture.mjs'
|
||||
} from './mobile-web-app/mobile-web-app-bundle-test-fixture.mjs'
|
||||
import {
|
||||
MOBILE_WEB_APP_NATIVE_PARITY_STYLE,
|
||||
MOBILE_WEB_APP_ROOT_RESET,
|
||||
@@ -20,7 +20,7 @@ import {
|
||||
import {
|
||||
MOBILE_WEB_APP_ROUTE_ROOT,
|
||||
collectMobileWebAppRouteKeys
|
||||
} from './mobile-web-app-route-manifest.mjs'
|
||||
} from './mobile-web-app/mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
MOBILE_WEB_APP_BUNDLE_MAX_ENTRY_BYTES,
|
||||
MOBILE_WEB_APP_BUNDLE_MAX_TOTAL_BYTES,
|
||||
@@ -50,7 +50,7 @@ import {
|
||||
MOBILE_WEB_BUNDLE_MAX_ASSET_BYTES,
|
||||
MOBILE_WEB_BUNDLE_MAX_ASSETS
|
||||
} from '../../src/shared/mobile-web-bundle/manifest-contract.js'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app/mobile-web-app-bundle-dependencies.mjs'
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const appDir = join(projectDir, 'mobile', 'app')
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
readBridgePagePainted,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The agent-history page route in a real browser.
|
||||
+3
-3
@@ -20,7 +20,7 @@ import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
@@ -31,9 +31,9 @@ import {
|
||||
readBridgeWindowCaps,
|
||||
readBrowserFrameQuality,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
|
||||
const HOST_ID = 'render-check-host'
|
||||
const ROUTE = { pathname: '/h' }
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { existsSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
|
||||
/**
|
||||
* Set by the one CI job that installs mobile dependencies, so a broken install there fails the
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { dirname, join } from 'node:path'
|
||||
import { deserialize, serialize } from 'node:v8'
|
||||
import { bundleMobileWebApp, buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { bundleMobileWebApp, buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
|
||||
export async function withScratch(run) {
|
||||
const scratch = await mkdtemp(join(tmpdir(), 'orca-mobile-web-app-test-'))
|
||||
+2
-2
@@ -21,9 +21,9 @@ import {
|
||||
createBundleServer,
|
||||
readClipboardImageUploadChunkBase64Chars,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
|
||||
/**
|
||||
* The budget the run is held to: the chunk the upload path already sends, in base64 characters,
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium, webkit } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const HOST_ROUTE = '/h/render-check-host'
|
||||
const SHELL_HOST = {
|
||||
+3
-3
@@ -21,15 +21,15 @@ import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
PAGE_ROUTE_MODULES,
|
||||
pageRouteModulesCoverTheManifest
|
||||
} from './mobile-web-app-page-route-modules.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
/** The seam as the web build resolves it, and the native sibling the page must never reach. */
|
||||
+4
-4
@@ -14,15 +14,15 @@
|
||||
*/
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
import {
|
||||
EXTERNAL_LINK_SEAM as SEAM,
|
||||
externalLinkOffenders
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const EXPLORER = 'app/h/[hostId]/files/[worktreeId].tsx'
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The file preview's unsaved-draft prompt, in a real browser.
|
||||
+7
-7
@@ -24,7 +24,7 @@
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium, type Browser, type CDPSession, type Page } from 'playwright-core'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import type { BrowserScreencastFrame } from '../../mobile/src/transport/browser-screencast-protocol'
|
||||
import type { BrowserScreencastFrame } from '../../../mobile/src/transport/browser-screencast-protocol'
|
||||
|
||||
/**
|
||||
* The mobile modules load lazily, after the dependency check, never at the top of the file: vite
|
||||
@@ -34,12 +34,12 @@ import type { BrowserScreencastFrame } from '../../mobile/src/transport/browser-
|
||||
*/
|
||||
async function loadSweepModules() {
|
||||
const [request, parameters, caps, fakes, harnessModule, protocol] = await Promise.all([
|
||||
import('../../mobile/src/browser/browser-screencast-request.web'),
|
||||
import('../../mobile/src/browser/browser-screencast-request-parameters'),
|
||||
import('../../mobile/src/mobile-web-shell/bridge/bridge-caps'),
|
||||
import('../../mobile/src/mobile-web-shell/bridge-host-test-fakes'),
|
||||
import('../../mobile/src/mobile-web-shell/bridge-host-test-harness'),
|
||||
import('../../mobile/src/transport/browser-screencast-protocol')
|
||||
import('../../../mobile/src/browser/browser-screencast-request.web.ts'),
|
||||
import('../../../mobile/src/browser/browser-screencast-request-parameters'),
|
||||
import('../../../mobile/src/mobile-web-shell/bridge/bridge-caps'),
|
||||
import('../../../mobile/src/mobile-web-shell/bridge-host-test-fakes'),
|
||||
import('../../../mobile/src/mobile-web-shell/bridge-host-test-harness'),
|
||||
import('../../../mobile/src/transport/browser-screencast-protocol')
|
||||
])
|
||||
return {
|
||||
budgetedMobileViewDeviceScaleFactor: request.budgetedMobileViewDeviceScaleFactor,
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The in-page hop the sidebar makes, in a browser, under the grants the session actually has.
|
||||
+4
-4
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
BROWSER_VIEWPORT_ID,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
browserPaneProbeRouteSource,
|
||||
commandDockProbeRouteSource,
|
||||
holdDictationProbeRouteSource
|
||||
} from './mobile-web-app/preview/mobile-web-app-held-press-probe-routes.mjs'
|
||||
} from './preview/mobile-web-app-held-press-probe-routes.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -23,8 +23,8 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './mobile-web-app/preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
|
||||
/**
|
||||
* Held presses on the page. Held ~500 ms, Android WebView turns a touch into a long-press: it fires
|
||||
+2
-2
@@ -28,9 +28,9 @@ import {
|
||||
installCspViolationRecorder,
|
||||
installListenerRecorder,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
const diagramDir = join(mobileDir, 'src/components/pr-sidebar')
|
||||
|
||||
/** The design's own fixture, so the byte counts in the docstring above name this diagram. */
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { mkdtemp, mkdir, rm, writeFile } from 'node:fs/promises'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { expect, it } from 'vitest'
|
||||
import { mobileWebAppModuleClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppModuleClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
|
||||
it('resolves local entry paths against the requested tree and selects browser siblings', async () => {
|
||||
const root = await mkdtemp(join(tmpdir(), 'orca-route-entrypoints-'))
|
||||
+4
-3
@@ -11,7 +11,7 @@ import { createServer } from 'node:http'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium, webkit } from 'playwright-core'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { readShellCsp } from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
import { readShellCsp } from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const bundles = mobileWebAppDependenciesPresent()
|
||||
const describeEngines = bundles ? describe : describe.skip
|
||||
@@ -40,9 +40,10 @@ beforeAll(async () => {
|
||||
}
|
||||
// Imported behind the gate: transforming a mobile/ module reads mobile/tsconfig.json, which
|
||||
// extends a package the root-only unit shards do not install (see the session-dictation check).
|
||||
;({ buildNativeChatVisualDocument } = await import('../../src/shared/native-chat-visual-shell'))
|
||||
;({ buildNativeChatVisualDocument } =
|
||||
await import('../../../src/shared/native-chat-visual-shell'))
|
||||
;({ buildMobileNativeChatVisualHostDocument } =
|
||||
await import('../../mobile/src/session/mobile-native-chat-visual-host-document'))
|
||||
await import('../../../mobile/src/session/mobile-native-chat-visual-host-document'))
|
||||
const header = await readShellCsp()
|
||||
const sealed = buildNativeChatVisualDocument({ html: VISUAL, channel: 'sealed', theme: THEME })
|
||||
// The web shell's page, under the header the shell ships, holding the visual as the web sibling does.
|
||||
+3
-6
@@ -13,14 +13,11 @@ import {
|
||||
MOBILE_WEB_APP_NATIVE_PARITY_STYLE,
|
||||
MOBILE_WEB_APP_ROOT_RESET,
|
||||
mobileWebAppBuildOptions
|
||||
} from './build-mobile-web-app-bundle.mjs'
|
||||
} from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
import { createBundleServer, readShellCsp } from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
|
||||
// The emulator the audit measured on is 480 dpi, which a WebView reports as 3. Chromium by launch
|
||||
// flag, not Playwright's emulated scale, under which it floors borders to CSS px as no phone does.
|
||||
+2
-2
@@ -12,13 +12,13 @@ import { describe, expect, it } from 'vitest'
|
||||
import {
|
||||
mobileWebAppModuleClosure,
|
||||
mobileWebAppRouteClosure
|
||||
} from './build-mobile-web-app-bundle.mjs'
|
||||
} from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { pageClosureFamilies, pinnedFamilyNames } from './mobile-web-app-page-closure-families.mjs'
|
||||
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
const read = (path) =>
|
||||
readFileSync(fileURLToPath(new URL(`../../${path}`, import.meta.url)), 'utf8')
|
||||
readFileSync(fileURLToPath(new URL(`../../../${path}`, import.meta.url)), 'utf8')
|
||||
|
||||
const C1_TABLE = 'mobile/src/test-support/bridged-parity/c1-page-closure.ts'
|
||||
|
||||
+3
-3
@@ -11,13 +11,13 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
PAGE_ROUTE_MODULES,
|
||||
pageRouteModulesCoverTheManifest
|
||||
} from './mobile-web-app-page-route-modules.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
import {
|
||||
PAGE_GRANT_CALL_SITES,
|
||||
createGrantCallSiteReader,
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
moduleReachesGrantRow
|
||||
} from './mobile-web-app-page-grant-call-sites.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const SESSION = '/h/[hostId]/session/[worktreeId]'
|
||||
+2
-2
@@ -2,7 +2,7 @@ import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import * as esbuild from 'esbuild'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppBuildOptions } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppBuildOptions } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { collectMobileWebAppRoutes } from './mobile-web-app-route-manifest.mjs'
|
||||
|
||||
@@ -43,7 +43,7 @@ import { collectMobileWebAppRoutes } from './mobile-web-app-route-manifest.mjs'
|
||||
* presence as its precondition would now be asserting the fence had a hole.
|
||||
*/
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const appDir = join(projectDir, 'mobile', 'app')
|
||||
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
readBridgePagePainted,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
// Why a real browser: the route tree is handed to expo-router's own ExpoRoot through a synthesized
|
||||
// RequireContext. Nothing short of mounting it proves that object is the shape ExpoRoot reads.
|
||||
+4
-4
@@ -24,18 +24,18 @@ import {
|
||||
MOBILE_WEB_APP_NATIVE_PARITY_STYLE,
|
||||
MOBILE_WEB_APP_ROOT_RESET,
|
||||
lucideBarrelPlugin
|
||||
} from './build-mobile-web-app-bundle.mjs'
|
||||
} from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { textInputFontSizeFloor } from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
import { textInputFontSizeFloor } from './platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
installCspViolationRecorder,
|
||||
installListenerRecorder,
|
||||
installSchedulerRecorder,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
const componentDir = join(mobileDir, 'src/components')
|
||||
|
||||
/**
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
import { basename, join, resolve } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import * as esbuild from 'esbuild'
|
||||
import { entryStaticClosure, mobileWebAppBuildOptions } from './build-mobile-web-app-bundle.mjs'
|
||||
import { entryStaticClosure, mobileWebAppBuildOptions } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { collectMobileWebAppRoutes } from './mobile-web-app-route-manifest.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile', import.meta.url))
|
||||
|
||||
/**
|
||||
* The file the build actually put in a chunk for this route, which is not always the one named.
|
||||
+1
-1
@@ -14,7 +14,7 @@ import {
|
||||
} from './mobile-web-app-route-manifest.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const appDir = join(projectDir, 'mobile', 'app')
|
||||
|
||||
// The sharded `test` job does not install mobile dependencies, so anything that runs esbuild over
|
||||
+1
-1
@@ -5,7 +5,7 @@ import {
|
||||
prepareRouteSnapshot,
|
||||
withPreparedRouteSnapshot,
|
||||
withRouteSnapshot
|
||||
} from './run-mobile-web-app-checks.mjs'
|
||||
} from '../run-mobile-web-app-checks.mjs'
|
||||
import { PAGE_ROUTE_MODULES } from './mobile-web-app-page-route-modules.mjs'
|
||||
|
||||
const collect = async (entries) => ({
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
// The page lays out edge-to-edge under the shell's system bars and pads through its own
|
||||
// SafeAreaViews, and its root for the sides, by the insets `init` carries. Measured in a real browser because what is under
|
||||
+3
-3
@@ -16,15 +16,15 @@ import { readFileSync } from 'node:fs'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
PAGE_ROUTE_MODULES,
|
||||
pageRouteModulesCoverTheManifest
|
||||
} from './mobile-web-app-page-route-modules.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
/** The seam as the web build resolves it, and the native sibling the page must never reach. */
|
||||
+6
-6
@@ -28,10 +28,10 @@
|
||||
import { createRequire } from 'node:module'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MobileWebBundleRouteSchema } from '../../src/shared/mobile-web-bundle/manifest-contract.ts'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
import { MobileWebBundleRouteSchema } from '../../../src/shared/mobile-web-bundle/manifest-contract.ts'
|
||||
|
||||
/** The mobile install: the closure builds need it, and so does anything that imports a mobile
|
||||
* module, because transforming one resolves `mobile/tsconfig.json` and its Expo base. */
|
||||
@@ -75,7 +75,7 @@ function closureOf(routeModule) {
|
||||
/** Resolved from `mobile/`, which is the tree the bundler resolves the closure out of: this suite
|
||||
* runs at the repo root, where neither package is installed. */
|
||||
function resolveFromMobile(specifier) {
|
||||
return createRequire(new URL('../../mobile/package.json', import.meta.url)).resolve(specifier)
|
||||
return createRequire(new URL('../../../mobile/package.json', import.meta.url)).resolve(specifier)
|
||||
}
|
||||
|
||||
/** The route module a registered pathname is served from, the way expo-router files are named. */
|
||||
@@ -219,7 +219,7 @@ describe('the census rule itself', () => {
|
||||
// The failure this guards is the rule agreeing with itself: a list of four names the census
|
||||
// holds routes to, none of which the shell has a row for.
|
||||
const { BRIDGE_NATIVE_VERB_NAMES } =
|
||||
await import('../../mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts')
|
||||
await import('../../../mobile/src/mobile-web-shell/bridge/bridge-native-verbs.ts')
|
||||
expect(new Set(DICTATION_GRANTS).size).toBe(3)
|
||||
for (const grant of DICTATION_GRANTS) {
|
||||
expect(BRIDGE_NATIVE_VERB_NAMES, grant).toContain(grant)
|
||||
@@ -233,4 +233,4 @@ describe('the census rule itself', () => {
|
||||
})
|
||||
|
||||
/** Kept so a reader can find the tree this ran against without a machine path in the file. */
|
||||
export const MOBILE_DIR = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
export const MOBILE_DIR = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
*/
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
EXTERNAL_LINK_SEAM as SEAM,
|
||||
externalLinkOffenders
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const SESSION = 'app/h/[hostId]/session/[worktreeId].tsx'
|
||||
+3
-3
@@ -16,15 +16,15 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
MEDIA_PICKER_SEAM as SEAM,
|
||||
mediaPickerOffenders,
|
||||
mediaPickerSites
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-media-picker-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-media-picker-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const SESSION = 'app/h/[hostId]/session/[worktreeId].tsx'
|
||||
+3
-3
@@ -3,9 +3,9 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
installShellDouble,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp,
|
||||
waitForRecordedRequests
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The session route in a real browser, on the bundle the shell would serve, under its own header.
|
||||
+4
-4
@@ -1,18 +1,18 @@
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { beforeAll, describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { mobileWebAppRouteChunkClosure } from './mobile-web-app-route-chunk-closure.mjs'
|
||||
import {
|
||||
editableHostFontSizeOffenders,
|
||||
editableHostsIn,
|
||||
unresolvedEditableHostStyles
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.mjs'
|
||||
} from './platform-seams/mobile-web-app-editable-host-font-size.mjs'
|
||||
import {
|
||||
textInputFontSizeOffenders,
|
||||
unresolvedTextInputStyles
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
|
||||
/**
|
||||
* What putting the terminal on the page costs the session route's closure.
|
||||
@@ -122,7 +122,7 @@ import {
|
||||
* than argued with.
|
||||
*/
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const mobileDir = join(projectDir, 'mobile')
|
||||
|
||||
const SESSION_ROUTE = 'app/h/[hostId]/session/[worktreeId].tsx'
|
||||
+3
-3
@@ -3,9 +3,9 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../mobile-web-page-routes.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
installShellDouble,
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
readBridgePageClientIdentity,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The session route's terminal, driven from a shell double that answers the streams a host does.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** Session routes resolve the named components to their web implementations. */
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
+3
-3
@@ -16,14 +16,14 @@
|
||||
*/
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
EXTERNAL_LINK_SEAM as SEAM,
|
||||
externalLinkOffenders
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const HUB = 'app/h/[hostId]/source-control/[worktreeId].tsx'
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/** Source-control and review routes include the web keyboard seam. */
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
+3
-3
@@ -4,7 +4,7 @@ import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The two C4 page routes in a real browser, in the shape of the tasks and files checks.
|
||||
@@ -42,7 +42,7 @@ import {
|
||||
* What this file deliberately does not claim is at the bottom.
|
||||
*/
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const HOST_ROUTE = '/h/render-check-host'
|
||||
const WORKTREE = 'wt-1'
|
||||
const HUB_ROUTE = `${HOST_ROUTE}/source-control/${WORKTREE}`
|
||||
+3
-3
@@ -16,16 +16,16 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
TEXT_INPUT_FONT_SIZE_SEAM,
|
||||
textInputFontSizeFloor,
|
||||
textInputFontSizeOffenders,
|
||||
unresolvedTextInputStyles
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
const HUB = 'app/h/[hostId]/source-control/[worktreeId].tsx'
|
||||
+3
-3
@@ -4,7 +4,7 @@ import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium, webkit } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
@@ -14,7 +14,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The host stack's push and pop on the page, sampled every animation frame in a real browser.
|
||||
@@ -98,7 +98,7 @@ beforeAll(async () => {
|
||||
if (!bundles) {
|
||||
return
|
||||
}
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const cspHeader = await readShellCsp()
|
||||
bridgeVersion = await readBridgeProtocolVersion()
|
||||
faultGrant = await readBridgeFaultGrant()
|
||||
+3
-3
@@ -13,14 +13,14 @@
|
||||
*/
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppRouteClosure } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
EXTERNAL_LINK_SEAM as SEAM,
|
||||
externalLinkOffenders
|
||||
} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
} from './platform-seams/mobile-web-app-external-link-seam.mjs'
|
||||
|
||||
const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url))
|
||||
const mobileDir = fileURLToPath(new URL('../../../mobile/', import.meta.url))
|
||||
const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip
|
||||
|
||||
describeClosure(
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The tasks page route in a real browser: its own file, as C1.10 split the harness for.
|
||||
+5
-5
@@ -4,13 +4,13 @@ import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
BUFFERED_FIELD_ID,
|
||||
LIVE_INPUT_FIELD_ID,
|
||||
liveInputProbeRouteSource
|
||||
} from './mobile-web-app/preview/mobile-web-app-live-input-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-live-input-probe-route.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
@@ -18,8 +18,8 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './mobile-web-app/preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
|
||||
/**
|
||||
* The terminal's live input, in a real browser, on the bundle the shell would serve.
|
||||
@@ -67,7 +67,7 @@ beforeAll(async () => {
|
||||
if (!bundles) {
|
||||
return
|
||||
}
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const terminalDir = join(projectDir, 'mobile', 'src', 'terminal')
|
||||
const cspHeader = await readShellCsp()
|
||||
bridgeVersion = await readBridgeProtocolVersion()
|
||||
+4
-4
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
COLS,
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
LAYOUT_SOURCE,
|
||||
probeRouteSource,
|
||||
ROWS
|
||||
} from './mobile-web-app/preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
installCspViolationRecorder,
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The scratch bundle the terminal render check runs against, and the two ways to open a page on it.
|
||||
@@ -32,7 +32,7 @@ import {
|
||||
* built in the closures it hands back, so two of them could not read each other's browser.
|
||||
*/
|
||||
|
||||
const projectDir = fileURLToPath(new URL('../..', import.meta.url))
|
||||
const projectDir = fileURLToPath(new URL('../../..', import.meta.url))
|
||||
const mobileDir = join(projectDir, 'mobile')
|
||||
|
||||
export const PROBE_ROUTE = '/h/terminal-probe'
|
||||
+2
-2
@@ -5,7 +5,7 @@ import {
|
||||
FIRST_MARKER,
|
||||
LAST_MARKER,
|
||||
MIN_STREAM_BYTES
|
||||
} from './mobile-web-app/preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
import {
|
||||
CONTROL_ROUTE,
|
||||
openProbeTerminal,
|
||||
@@ -15,7 +15,7 @@ import {
|
||||
import {
|
||||
readRootComputedStyles,
|
||||
terminalStyleReach
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
|
||||
/**
|
||||
* The page's terminal, in a real browser, under the policy the shell sends.
|
||||
+1
-1
@@ -2,7 +2,7 @@ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
||||
import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { expect, it } from 'vitest'
|
||||
import { modulesDeclaringTextInput } from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
import { modulesDeclaringTextInput } from './platform-seams/mobile-web-app-text-input-font-size-seam.mjs'
|
||||
|
||||
it('discovers input modules and ignores tests and non-JSX mentions', () => {
|
||||
const scratch = mkdtempSync(join(tmpdir(), 'orca-text-input-discovery-'))
|
||||
+3
-3
@@ -3,7 +3,7 @@ import { tmpdir } from 'node:os'
|
||||
import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from './build-mobile-web-app-bundle.mjs'
|
||||
import { buildMobileWebAppBundle } from '../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs'
|
||||
import { MOBILE_WEB_APP_ROUTE_ROOT } from './mobile-web-app-route-manifest.mjs'
|
||||
import {
|
||||
@@ -13,8 +13,8 @@ import {
|
||||
readBridgeFaultGrant,
|
||||
readBridgeProtocolVersion,
|
||||
readShellCsp
|
||||
} from './mobile-web-app/preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './mobile-web-app/preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
} from './preview/mobile-web-app-render-harness.mjs'
|
||||
import { LAYOUT_SOURCE } from './preview/mobile-web-app-terminal-probe-route.mjs'
|
||||
|
||||
/**
|
||||
* The working rings keep turning on the page. Each is a one-second rotation loop; a loop that
|
||||
@@ -14,11 +14,11 @@ import { fileURLToPath } from 'node:url'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { mobileWebAppRouteClosure } from '../../build-mobile-web-app-bundle.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from '../../mobile-web-page-routes.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../../mobile-web-app-bundle-dependencies.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
PAGE_ROUTE_MODULES,
|
||||
pageRouteModulesCoverTheManifest
|
||||
} from '../../mobile-web-app-page-route-modules.mjs'
|
||||
} from '../mobile-web-app-page-route-modules.mjs'
|
||||
import {
|
||||
HAPTICS_KINDS_MODULE,
|
||||
HAPTICS_NATIVE,
|
||||
|
||||
@@ -24,7 +24,7 @@ import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest'
|
||||
import * as esbuild from 'esbuild'
|
||||
import { chromium, webkit } from 'playwright-core'
|
||||
import { lucideBarrelPlugin } from '../../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../../mobile-web-app-bundle-dependencies.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
readShellCsp,
|
||||
|
||||
@@ -4,7 +4,7 @@ import { join } from 'node:path'
|
||||
import { afterAll, beforeAll, describe, expect, it } from 'vitest'
|
||||
import { chromium } from 'playwright-core'
|
||||
import { buildMobileWebAppBundle } from '../../build-mobile-web-app-bundle.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../../mobile-web-app-bundle-dependencies.mjs'
|
||||
import { mobileWebAppDependenciesPresent } from '../mobile-web-app-bundle-dependencies.mjs'
|
||||
import {
|
||||
createBundleServer,
|
||||
installShellDouble,
|
||||
|
||||
@@ -5,7 +5,7 @@ import {
|
||||
} from '../../src/shared/mobile-web-bundle/manifest-contract.ts'
|
||||
import { resolveMobileWebPageRoutes } from './build-mobile-web-app-bundle.mjs'
|
||||
import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs'
|
||||
import { routePathnameFromKey } from './mobile-web-app-route-manifest.mjs'
|
||||
import { routePathnameFromKey } from './mobile-web-app/mobile-web-app-route-manifest.mjs'
|
||||
|
||||
/**
|
||||
* Which screens this desktop declares as page routes, and whether the bundle can render each.
|
||||
|
||||
@@ -4,7 +4,7 @@ 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'
|
||||
import { mobileWebAppDependenciesPresent } from './mobile-web-app/mobile-web-app-bundle-dependencies.mjs'
|
||||
|
||||
/**
|
||||
* The 612 KiB xterm engine string, and where the page must never meet it.
|
||||
|
||||
@@ -504,7 +504,7 @@ describe('the actual Bun build and profile-test dependency graph', () => {
|
||||
|
||||
it.each([
|
||||
'config/scripts/ci-shard-timings.json',
|
||||
'config/scripts/mobile-web-app-terminal-render.test.mjs',
|
||||
'config/scripts/mobile-web-app/mobile-web-app-terminal-render.test.mjs',
|
||||
'src/renderer/src/components/terminal/pty-running-work-probe.ts',
|
||||
'src/renderer/src/runtime/runtime-terminal-inspection.ts',
|
||||
'src/main/ssh/ssh-relay-upload-stage-commands.test.ts',
|
||||
|
||||
@@ -339,7 +339,7 @@ describe('per-job path classification', () => {
|
||||
'config/scripts/build-mobile-web-app-bundle.mjs',
|
||||
'config/scripts/run-mobile-web-app-checks.mjs',
|
||||
'src/packages/process-host/src/run-process.ts',
|
||||
'config/scripts/mobile-web-app-route-manifest.mjs',
|
||||
'config/scripts/mobile-web-app/mobile-web-app-route-manifest.mjs',
|
||||
'config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.mjs',
|
||||
'config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs',
|
||||
'mobile/web-entry/index.tsx',
|
||||
|
||||
@@ -4,8 +4,8 @@ import { dirname, join } from 'node:path'
|
||||
import { pathToFileURL } from 'node:url'
|
||||
import { createRequire } from 'node:module'
|
||||
import { mobileWebAppModuleClosure } from './build-mobile-web-app-bundle.mjs'
|
||||
import { readRouteSnapshot } from './mobile-web-app-route-snapshot.mjs'
|
||||
import { PAGE_ROUTE_MODULES } from './mobile-web-app-page-route-modules.mjs'
|
||||
import { readRouteSnapshot } from './mobile-web-app/mobile-web-app-route-snapshot.mjs'
|
||||
import { PAGE_ROUTE_MODULES } from './mobile-web-app/mobile-web-app-page-route-modules.mjs'
|
||||
import { spawnProcess } from '@orca/process-host'
|
||||
|
||||
const require = createRequire(import.meta.url)
|
||||
|
||||
@@ -156,7 +156,7 @@ describe('the envelope bound against a real posted frame', () => {
|
||||
* itself produced — so they cannot falsify the constant, only the expansion and the drop rule
|
||||
* around it. Said plainly because the earlier version of this block read as if it validated the
|
||||
* worst case: it did not, and the constant it agreed with was wrong by enough to post a phone's
|
||||
* frame over the cap. `config/scripts/mobile-web-app-frame-budget-sweep.test.ts` is what encodes
|
||||
* frame over the cap. `config/scripts/mobile-web-app/mobile-web-app-frame-budget-sweep.test.ts` is what encodes
|
||||
* real Chromium JPEGs across the viewport range and holds the constant to them.
|
||||
*/
|
||||
describe('a frame at exactly the budgeted area', () => {
|
||||
|
||||
@@ -16,7 +16,7 @@ export type MermaidDiagramProps = {
|
||||
* process to sandbox in. The fence is mermaid's own `securityLevel: 'strict'`, which runs the
|
||||
* serialized SVG through DOMPurify before handing it back — a `<script>`, an `on*` attribute or a
|
||||
* `javascript:` href in a diagram label reaches this document as nothing at all. That is measured
|
||||
* in `config/scripts/mobile-web-app-mermaid-render.test.mjs`, in both engines, against a hostile
|
||||
* in `config/scripts/mobile-web-app/mobile-web-app-mermaid-render.test.mjs`, in both engines, against a hostile
|
||||
* fixture. The source is a JS string argument, not text spliced into an inline `<script>`, so it
|
||||
* needs no escaping.
|
||||
*
|
||||
|
||||
@@ -12,7 +12,7 @@ import type { PRComment } from '../../../../src/shared/github/comment-types'
|
||||
* empty-avatar `View` directly on web instead of letting the policy refuse the fetch.
|
||||
*
|
||||
* Asserted on the element tree rather than on the document, because the negative — no request to
|
||||
* the avatar host — is what `config/scripts/mobile-web-app-source-control-render.test.mjs` reads in
|
||||
* the avatar host — is what `config/scripts/mobile-web-app/mobile-web-app-source-control-render.test.mjs` reads in
|
||||
* a real browser, and a check that only had the negative would also pass against a card that never
|
||||
* rendered at all.
|
||||
*/
|
||||
|
||||
@@ -17,7 +17,7 @@ import type { MobileRichMarkdownEditorMessage } from '../mobile-rich-markdown-ed
|
||||
* reporting into a host that has gone.
|
||||
*
|
||||
* What a browser makes of the sheet is not a question this environment can answer and is measured
|
||||
* in `config/scripts/mobile-web-app-rich-markdown-render.test.mjs` instead.
|
||||
* in `config/scripts/mobile-web-app/mobile-web-app-rich-markdown-render.test.mjs` instead.
|
||||
*/
|
||||
const mounted: RichMarkdownWebDocument[] = []
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
},
|
||||
{
|
||||
"file": "src/components/AuthFailedBannerActions.web.tsx",
|
||||
"reason": "The auth-failed banner offers Retry, Re-pair and Remove, and on the page only Re-pair works. /pair-scan sits outside the page's route root of app/h (config/scripts/mobile-web-app-route-manifest.mjs:6), so route-handoff.web.ts:207 hands the push to the shell, which opens the native scan screen and returns to the same page document on Back. Retry and Remove are inert here: forceReconnect is null (client-context.web.tsx:45, read through host-client-hooks.ts:88) and removal refuses (page-host-removal-refusal.ts). The banner is reachable on the page because the shell forwards the native client's state (mobile-web-shell/bridge-host.ts:301) and auth-failed is in the wire enum (bridge/bridge-envelope.ts:44). So this one renders Re-pair as native does and one line naming the app for reconnect and removal."
|
||||
"reason": "The auth-failed banner offers Retry, Re-pair and Remove, and on the page only Re-pair works. /pair-scan sits outside the page's route root of app/h (config/scripts/mobile-web-app/mobile-web-app-route-manifest.mjs:6), so route-handoff.web.ts:207 hands the push to the shell, which opens the native scan screen and returns to the same page document on Back. Retry and Remove are inert here: forceReconnect is null (client-context.web.tsx:45, read through host-client-hooks.ts:88) and removal refuses (page-host-removal-refusal.ts). The banner is reachable on the page because the shell forwards the native client's state (mobile-web-shell/bridge-host.ts:301) and auth-failed is in the wire enum (bridge/bridge-envelope.ts:44). So this one renders Re-pair as native does and one line naming the app for reconnect and removal."
|
||||
},
|
||||
{
|
||||
"file": "src/components/use-html-preview-link-grant.web.ts",
|
||||
|
||||
Reference in New Issue
Block a user