From 42da9f430f023c9b265369954cd6533cdfe75c4c Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Wed, 21 Oct 2026 23:15:21 -0700 Subject: [PATCH] refactor(mobile): group platform-seam analysis tools (#31845) --- .../mobile-web-app-files-external-links.test.mjs | 2 +- .../mobile-web-app-rich-markdown-render.test.mjs | 2 +- .../mobile-web-app-session-external-links.test.mjs | 2 +- .../mobile-web-app-session-media-picker.test.mjs | 2 +- .../mobile-web-app-session-terminal-closure.test.mjs | 4 ++-- ...bile-web-app-source-control-external-links.test.mjs | 2 +- .../mobile-web-app-source-control-text-inputs.test.mjs | 2 +- .../mobile-web-app-tasks-external-links.test.mjs | 2 +- .../mobile-web-app-text-input-discovery.test.mjs | 2 +- .../mobile-web-app-editable-host-font-size.mjs | 0 .../mobile-web-app-editable-host-font-size.test.mjs | 2 +- .../mobile-web-app-external-link-seam.mjs | 0 .../mobile-web-app-external-link-seam.test.mjs | 2 +- .../platform-seams}/mobile-web-app-haptics-seam.mjs | 0 .../mobile-web-app-haptics-seam.test.mjs | 10 +++++----- .../mobile-web-app-media-picker-seam.mjs | 0 .../mobile-web-app-text-input-font-size-seam.mjs | 0 config/scripts/pr-code-change-scope.mjs | 1 + config/scripts/pr-code-change-scope.test.mjs | 2 ++ config/scripts/run-mobile-web-app-checks.mjs | 1 + mobile/src/mobile-web-shell/page-haptics.test.ts | 2 +- mobile/src/mobile-web-shell/page-haptics.ts | 2 +- mobile/src/mobile-web-shell/page-route-policy.test.ts | 2 +- 23 files changed, 24 insertions(+), 20 deletions(-) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-editable-host-font-size.mjs (100%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-editable-host-font-size.test.mjs (99%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-external-link-seam.mjs (100%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-external-link-seam.test.mjs (99%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-haptics-seam.mjs (100%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-haptics-seam.test.mjs (96%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-media-picker-seam.mjs (100%) rename config/scripts/{ => mobile-web-app/platform-seams}/mobile-web-app-text-input-font-size-seam.mjs (100%) diff --git a/config/scripts/mobile-web-app-files-external-links.test.mjs b/config/scripts/mobile-web-app-files-external-links.test.mjs index 3eade3dc8a9..d3443727b91 100644 --- a/config/scripts/mobile-web-app-files-external-links.test.mjs +++ b/config/scripts/mobile-web-app-files-external-links.test.mjs @@ -20,7 +20,7 @@ import { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs' import { EXTERNAL_LINK_SEAM as SEAM, externalLinkOffenders -} from './mobile-web-app-external-link-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-rich-markdown-render.test.mjs b/config/scripts/mobile-web-app-rich-markdown-render.test.mjs index 45b37eeba7c..360ce3cc76f 100644 --- a/config/scripts/mobile-web-app-rich-markdown-render.test.mjs +++ b/config/scripts/mobile-web-app-rich-markdown-render.test.mjs @@ -26,7 +26,7 @@ import { lucideBarrelPlugin } from './build-mobile-web-app-bundle.mjs' import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs' -import { textInputFontSizeFloor } from './mobile-web-app-text-input-font-size-seam.mjs' +import { textInputFontSizeFloor } from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs' import { createBundleServer, installCspViolationRecorder, diff --git a/config/scripts/mobile-web-app-session-external-links.test.mjs b/config/scripts/mobile-web-app-session-external-links.test.mjs index 2a1a742c67c..51988d03162 100644 --- a/config/scripts/mobile-web-app-session-external-links.test.mjs +++ b/config/scripts/mobile-web-app-session-external-links.test.mjs @@ -21,7 +21,7 @@ import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-depende import { EXTERNAL_LINK_SEAM as SEAM, externalLinkOffenders -} from './mobile-web-app-external-link-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-session-media-picker.test.mjs b/config/scripts/mobile-web-app-session-media-picker.test.mjs index 415cdbca956..28d5dade79a 100644 --- a/config/scripts/mobile-web-app-session-media-picker.test.mjs +++ b/config/scripts/mobile-web-app-session-media-picker.test.mjs @@ -22,7 +22,7 @@ import { MEDIA_PICKER_SEAM as SEAM, mediaPickerOffenders, mediaPickerSites -} from './mobile-web-app-media-picker-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-media-picker-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-session-terminal-closure.test.mjs b/config/scripts/mobile-web-app-session-terminal-closure.test.mjs index c6ff5223013..2f620075c1b 100644 --- a/config/scripts/mobile-web-app-session-terminal-closure.test.mjs +++ b/config/scripts/mobile-web-app-session-terminal-closure.test.mjs @@ -8,11 +8,11 @@ import { editableHostFontSizeOffenders, editableHostsIn, unresolvedEditableHostStyles -} from './mobile-web-app-editable-host-font-size.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.mjs' import { textInputFontSizeOffenders, unresolvedTextInputStyles -} from './mobile-web-app-text-input-font-size-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs' /** * What putting the terminal on the page costs the session route's closure. diff --git a/config/scripts/mobile-web-app-source-control-external-links.test.mjs b/config/scripts/mobile-web-app-source-control-external-links.test.mjs index da3e85f6789..73f0e9decd1 100644 --- a/config/scripts/mobile-web-app-source-control-external-links.test.mjs +++ b/config/scripts/mobile-web-app-source-control-external-links.test.mjs @@ -21,7 +21,7 @@ import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-depende import { EXTERNAL_LINK_SEAM as SEAM, externalLinkOffenders -} from './mobile-web-app-external-link-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-source-control-text-inputs.test.mjs b/config/scripts/mobile-web-app-source-control-text-inputs.test.mjs index b4da8e7ee67..253cb1e6148 100644 --- a/config/scripts/mobile-web-app-source-control-text-inputs.test.mjs +++ b/config/scripts/mobile-web-app-source-control-text-inputs.test.mjs @@ -23,7 +23,7 @@ import { textInputFontSizeFloor, textInputFontSizeOffenders, unresolvedTextInputStyles -} from './mobile-web-app-text-input-font-size-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-tasks-external-links.test.mjs b/config/scripts/mobile-web-app-tasks-external-links.test.mjs index 7c1af6f2105..958cefeda16 100644 --- a/config/scripts/mobile-web-app-tasks-external-links.test.mjs +++ b/config/scripts/mobile-web-app-tasks-external-links.test.mjs @@ -18,7 +18,7 @@ import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-depende import { EXTERNAL_LINK_SEAM as SEAM, externalLinkOffenders -} from './mobile-web-app-external-link-seam.mjs' +} from './mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs' const mobileDir = fileURLToPath(new URL('../../mobile/', import.meta.url)) const describeClosure = mobileWebAppDependenciesPresent() ? describe : describe.skip diff --git a/config/scripts/mobile-web-app-text-input-discovery.test.mjs b/config/scripts/mobile-web-app-text-input-discovery.test.mjs index 6dc9241a898..0c449395515 100644 --- a/config/scripts/mobile-web-app-text-input-discovery.test.mjs +++ b/config/scripts/mobile-web-app-text-input-discovery.test.mjs @@ -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-text-input-font-size-seam.mjs' +import { modulesDeclaringTextInput } from './mobile-web-app/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-')) diff --git a/config/scripts/mobile-web-app-editable-host-font-size.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.mjs similarity index 100% rename from config/scripts/mobile-web-app-editable-host-font-size.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.mjs diff --git a/config/scripts/mobile-web-app-editable-host-font-size.test.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.test.mjs similarity index 99% rename from config/scripts/mobile-web-app-editable-host-font-size.test.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.test.mjs index 21d7ff09b17..67f0be3fecf 100644 --- a/config/scripts/mobile-web-app-editable-host-font-size.test.mjs +++ b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-editable-host-font-size.test.mjs @@ -18,7 +18,7 @@ import { unresolvedEditableHostStyles } from './mobile-web-app-editable-host-font-size.mjs' -const mobileDir = fileURLToPath(new URL('../../mobile', import.meta.url)) +const mobileDir = fileURLToPath(new URL('../../../../mobile', import.meta.url)) /** The editor's own two modules, as a closure naming nothing else. */ const EDITOR_CLOSURE = { diff --git a/config/scripts/mobile-web-app-external-link-seam.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs similarity index 100% rename from config/scripts/mobile-web-app-external-link-seam.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-external-link-seam.mjs diff --git a/config/scripts/mobile-web-app-external-link-seam.test.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-external-link-seam.test.mjs similarity index 99% rename from config/scripts/mobile-web-app-external-link-seam.test.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-external-link-seam.test.mjs index 9e43078ba4f..ab58097bd66 100644 --- a/config/scripts/mobile-web-app-external-link-seam.test.mjs +++ b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-external-link-seam.test.mjs @@ -9,7 +9,7 @@ import { reactNativeLinkingSites } from './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)) describe('the seam predicate', () => { it.each([ diff --git a/config/scripts/mobile-web-app-haptics-seam.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.mjs similarity index 100% rename from config/scripts/mobile-web-app-haptics-seam.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.mjs diff --git a/config/scripts/mobile-web-app-haptics-seam.test.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs similarity index 96% rename from config/scripts/mobile-web-app-haptics-seam.test.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs index 559a968820f..b3ab709eed5 100644 --- a/config/scripts/mobile-web-app-haptics-seam.test.mjs +++ b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs @@ -12,13 +12,13 @@ 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 { MOBILE_WEB_PAGE_ROUTES } from './mobile-web-page-routes.mjs' -import { mobileWebAppDependenciesPresent } from './mobile-web-app-bundle-dependencies.mjs' +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 { 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, @@ -30,7 +30,7 @@ import { hapticsTriggerSites } from './mobile-web-app-haptics-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 read = (file) => readFileSync(join(mobileDir, file), 'utf8') diff --git a/config/scripts/mobile-web-app-media-picker-seam.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-media-picker-seam.mjs similarity index 100% rename from config/scripts/mobile-web-app-media-picker-seam.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-media-picker-seam.mjs diff --git a/config/scripts/mobile-web-app-text-input-font-size-seam.mjs b/config/scripts/mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs similarity index 100% rename from config/scripts/mobile-web-app-text-input-font-size-seam.mjs rename to config/scripts/mobile-web-app/platform-seams/mobile-web-app-text-input-font-size-seam.mjs diff --git a/config/scripts/pr-code-change-scope.mjs b/config/scripts/pr-code-change-scope.mjs index 7d11f07be5c..cd074c72a65 100644 --- a/config/scripts/pr-code-change-scope.mjs +++ b/config/scripts/pr-code-change-scope.mjs @@ -178,6 +178,7 @@ const MOBILE_WEB_APP_PREFIXES = [ 'src/packages/process-host/', 'config/scripts/verify-mobile-web-app-bundle', 'config/scripts/mobile-web-app-', + 'config/scripts/mobile-web-app/', 'config/scripts/mobile-web-bundle-', 'config/scripts/verify-packaged-mobile-web-bundle', 'config/scripts/mobile-web-source-line-endings', diff --git a/config/scripts/pr-code-change-scope.test.mjs b/config/scripts/pr-code-change-scope.test.mjs index bf6dc901f1f..d76493d6efc 100644 --- a/config/scripts/pr-code-change-scope.test.mjs +++ b/config/scripts/pr-code-change-scope.test.mjs @@ -340,6 +340,8 @@ describe('per-job path classification', () => { '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/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', 'mobile/app/h/[hostId]/index.tsx', 'mobile/src/transport/client-context.web.tsx', diff --git a/config/scripts/run-mobile-web-app-checks.mjs b/config/scripts/run-mobile-web-app-checks.mjs index f2813f5ac01..b876fc57af6 100644 --- a/config/scripts/run-mobile-web-app-checks.mjs +++ b/config/scripts/run-mobile-web-app-checks.mjs @@ -14,6 +14,7 @@ const mobileWebCheckArgs = [ '--config', 'config/vitest.config.ts', 'config/scripts/mobile-web-app-', + 'config/scripts/mobile-web-app/', 'config/scripts/build-mobile-web-app-bundle.test.mjs' ] diff --git a/mobile/src/mobile-web-shell/page-haptics.test.ts b/mobile/src/mobile-web-shell/page-haptics.test.ts index a4abec869a3..01cb7b81c4a 100644 --- a/mobile/src/mobile-web-shell/page-haptics.test.ts +++ b/mobile/src/mobile-web-shell/page-haptics.test.ts @@ -99,7 +99,7 @@ describe('the kinds and the functions behind them', () => { * A table mapping two kinds to one function would pass every case above — each still plays * something — and would mean a Save that felt like a failure. The third direction, a haptic * `haptics.ts` grows with no kind of its own, is the census's: - * `config/scripts/mobile-web-app-haptics-seam.test.mjs` reads both files' names. + * `config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs` reads both files' names. */ it('plays a different device call for every kind, so no two share a row', () => { for (const kind of BRIDGE_HAPTICS_KINDS) { diff --git a/mobile/src/mobile-web-shell/page-haptics.ts b/mobile/src/mobile-web-shell/page-haptics.ts index 6e168be6574..80a654bc1ec 100644 --- a/mobile/src/mobile-web-shell/page-haptics.ts +++ b/mobile/src/mobile-web-shell/page-haptics.ts @@ -19,7 +19,7 @@ import type { BridgeHapticsKind } from './bridge/bridge-haptics-notify' * not compile; named as imports rather than reached through a namespace, a row naming a function * `haptics.ts` does not export does not compile either. The third direction — a haptic that file * grows with no kind of its own, which the page could never ask for — is the census's, in - * `config/scripts/mobile-web-app-haptics-seam.test.mjs`, which reads both files' names. + * `config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs`, which reads both files' names. */ const HAPTIC_BY_KIND: Readonly void>> = { mediumImpact: triggerMediumImpact, diff --git a/mobile/src/mobile-web-shell/page-route-policy.test.ts b/mobile/src/mobile-web-shell/page-route-policy.test.ts index 9e6e1dec16f..c472902b06c 100644 --- a/mobile/src/mobile-web-shell/page-route-policy.test.ts +++ b/mobile/src/mobile-web-shell/page-route-policy.test.ts @@ -411,7 +411,7 @@ describe('a grant name this build has never heard of', () => { * The route filter behind this view is `grants.every(implementsGrant)`, so one grant this build lacks * takes the whole route native rather than degrading the feature that needed it. `haptics` is * declared by all five page routes, which makes the whole set conditional on a shell carrying the - * token; the route list itself is pinned in `config/scripts/mobile-web-app-haptics-seam.test.mjs`, + * token; the route list itself is pinned in `config/scripts/mobile-web-app/platform-seams/mobile-web-app-haptics-seam.test.mjs`, * and this is the mechanism behind it. */ describe('a page route that needs the haptics token', () => {