refactor(mobile): group platform-seam analysis tools (#31845)

This commit is contained in:
Neil
2026-10-21 23:15:21 -07:00
committed by GitHub
parent 57ecdc2ca2
commit 42da9f430f
23 changed files with 24 additions and 20 deletions
@@ -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
@@ -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,
@@ -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
@@ -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
@@ -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.
@@ -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
@@ -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
@@ -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
@@ -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-'))
@@ -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 = {
@@ -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([
@@ -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')
+1
View File
@@ -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',
@@ -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',
@@ -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'
]
@@ -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) {
+1 -1
View File
@@ -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<Record<BridgeHapticsKind, () => void>> = {
mediumImpact: triggerMediumImpact,
@@ -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', () => {