diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 2d6528d9..9ca5883f 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -28,9 +28,13 @@ jobs: - id: dependencies run: pnpm run quality:install - run: pnpm run typecheck - - name: Check Expo SDK compatibility + - name: Check pinned Expo SDK compatibility if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }} run: pnpm run doctor:expo + - name: Report latest Expo upgrade recommendations (advisory) + if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }} + continue-on-error: true + run: pnpm run doctor:expo:latest - name: Score the full source and audit every lockfile id: scores if: ${{ !cancelled() && steps.dependencies.outcome == 'success' }} diff --git a/docs/dependency-patches.md b/docs/dependency-patches.md index 6b559bd9..b2e92efc 100644 --- a/docs/dependency-patches.md +++ b/docs/dependency-patches.md @@ -11,6 +11,23 @@ The SDK 58 age exceptions admit reviewed Expo releases and their required platform tooling. Publisher-trust checks and the install-script allowlist remain enforced. +## Expo compatibility and upgrade recommendations + +`pnpm run doctor:expo` checks installed direct dependencies (including development +packages) against `expo/bundledNativeModules.json` from the exact pinned Expo +release, then runs the remaining Expo Doctor checks online. Missing packages, +incompatible versions and other Doctor failures still block CI. The wrapper uses +the pinned Expo CLI's SemVer implementation and replaces only Doctor's moving +remote version recommendation check; it does not use package exclusions. + +`pnpm run doctor:expo:latest` reports Expo's current remote recommendations. +CI displays this as an advisory step, so a newly published patch cannot invalidate +an otherwise compatible frozen build. Review these recommendations during +upgrades, after the seven-day waiting period (or an explicit reviewed exception). +Security audits remain blocking regardless of release age. The pinned map proves +compatibility with that SDK release, not that the release is the newest or free +of vulnerabilities. Updating Expo also updates the compatibility baseline. + ## Active package patches | Package | Change and boundary | Owning checks | diff --git a/docs/development.md b/docs/development.md index 0f7d19e7..369c0772 100644 --- a/docs/development.md +++ b/docs/development.md @@ -97,7 +97,7 @@ pnpm run export:android pnpm run export:ios ``` -`check` runs TypeScript, Expo Doctor, React Doctor, aislop and dependency audits +`check` runs TypeScript, pinned-SDK compatibility and Expo Doctor, React Doctor, aislop and dependency audits for the root, runtime and quality-tool lockfiles. High/critical audit findings block the gate. A successful export is a JavaScript bundle, not an installable native build. Report each result and any blocked or skipped stage separately. diff --git a/modules/napplet-host/android/src/main/assets/notices/manifest.json b/modules/napplet-host/android/src/main/assets/notices/manifest.json index ad981220..89a3c534 100644 --- a/modules/napplet-host/android/src/main/assets/notices/manifest.json +++ b/modules/napplet-host/android/src/main/assets/notices/manifest.json @@ -1227,13 +1227,13 @@ ], "mainJavaScriptProfile": { "platform": "android", - "reviewedMetroBundleSha256": "acdb49ef24e52336cd6979940684197729aa0cb9f2722d9217b9c243ef94472e", - "sourceMapSha256": "9ad6017a90de4a516fdc19d52491b15704d519c6bcb0af687c53724f77c9cf07", + "reviewedMetroBundleSha256": "5114c8398756bb5eb45f92dc57df5ccb4fc356ed604c5f5ee8cb06be3fe9ddc3", + "sourceMapSha256": "a7ec2ac7b5ff7c0834777d80a33b5d49563a33b34ba59ee2ea4530fa5c4432f2", "packageIdentityCount": 58, "suppliedOriginalFileCount": 55, "sharedOriginalPackageCount": 4, "dependencyInputs": { - "package.json": "2753ee15120edfbd724967bb75d3ffa66ff22f9d098a0f23a48197596ff571d3", + "package.json": "4b3b3fbcc90577e69e4ee99776517a5dbd405c4c77f8e719f3eb47d4db458966", "pnpm-lock.yaml": "85fbc48ad55786262c490044e826b6282e45dadd459ca692bb6ca4db3a283b6c", "node_modules/.pnpm/@expo+cli@58.1.20_@expo+dom-webview@58.0.2_expo-constants@58.0.16_expo@58.0.24_react-na_9e33ccae367f67a78635be2cb8b90a55/node_modules/@expo/cli/package.json": "98f35dbe2ac27fd7ee90905352ab6215fc157f80094f6e7c2bce87ebd1e85c39", "node_modules/.pnpm/@react-native+js-polyfills@0.88.1/node_modules/@react-native/js-polyfills/package.json": "4b540e4c8ea9920faeefdaa16a7da7dd49ff5521fd168153ef52aa5e975f837b", diff --git a/modules/napplet-host/ios/Resources/notices/manifest.json b/modules/napplet-host/ios/Resources/notices/manifest.json index f41a20a8..0377b47d 100644 --- a/modules/napplet-host/ios/Resources/notices/manifest.json +++ b/modules/napplet-host/ios/Resources/notices/manifest.json @@ -1371,13 +1371,13 @@ ], "mainJavaScriptProfile": { "platform": "ios", - "reviewedMetroBundleSha256": "2a7d2fdee0be19b8dc1ba588e3a09c43e6aba9fc746c34a5f379dedd5b59d02e", - "sourceMapSha256": "a18748605a592f16e48701b1e5b33fac8206ea55f3d8705a5419f19df036359c", + "reviewedMetroBundleSha256": "271894e37a2b9fb3d5ec2d67123b1211e4b6eba4d1595c70da072134ef5464f0", + "sourceMapSha256": "988096e39a789188e565d573855c2c31d4d10bed799476238a422a0a9abc216e", "packageIdentityCount": 58, "suppliedOriginalFileCount": 55, "sharedOriginalPackageCount": 4, "dependencyInputs": { - "package.json": "2753ee15120edfbd724967bb75d3ffa66ff22f9d098a0f23a48197596ff571d3", + "package.json": "4b3b3fbcc90577e69e4ee99776517a5dbd405c4c77f8e719f3eb47d4db458966", "pnpm-lock.yaml": "85fbc48ad55786262c490044e826b6282e45dadd459ca692bb6ca4db3a283b6c", "node_modules/.pnpm/@expo+cli@58.1.20_@expo+dom-webview@58.0.2_expo-constants@58.0.16_expo@58.0.24_react-na_9e33ccae367f67a78635be2cb8b90a55/node_modules/@expo/cli/package.json": "98f35dbe2ac27fd7ee90905352ab6215fc157f80094f6e7c2bce87ebd1e85c39", "node_modules/.pnpm/@react-native+js-polyfills@0.88.1/node_modules/@react-native/js-polyfills/package.json": "4b540e4c8ea9920faeefdaa16a7da7dd49ff5521fd168153ef52aa5e975f837b", diff --git a/package.json b/package.json index 652e60fe..54cd02d7 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "prebuild:android": "pnpm run runtime:build && expo prebuild --platform android --no-install --template ./node_modules/expo/template.tgz", "export:android": "pnpm run runtime:build && expo export --platform android", "typecheck": "tsc --noEmit && tsc --noEmit -p tsconfig.tests.json", - "doctor:expo": "expo-doctor", + "doctor:expo": "node scripts/check-expo.mjs", "doctor:react": "react-doctor . --no-telemetry --no-supply-chain --yes --blocking warning", "doctor:slop": "node tools/quality/node_modules/aislop/dist/cli.js ci", "quality:install": "pnpm --dir tools/quality install --frozen-lockfile", @@ -54,7 +54,8 @@ "test:signer:native": "python3 tests/native/signer-core/run.py", "build:release": "node scripts/android-release.mjs build", "sign:release": "node scripts/android-release.mjs sign", - "test:release": "node --test tests/release/*.test.mjs" + "test:release": "node --test tests/release/*.test.mjs", + "doctor:expo:latest": "expo install --check" }, "dependencies": { "@expo/dom-webview": "58.0.2", diff --git a/scripts/check-expo.mjs b/scripts/check-expo.mjs new file mode 100644 index 00000000..4789f5fb --- /dev/null +++ b/scripts/check-expo.mjs @@ -0,0 +1,66 @@ +import { spawnSync } from "node:child_process"; +import { readFileSync } from "node:fs"; +import { createRequire } from "node:module"; +import { resolve } from "node:path"; +import { pathToFileURL } from "node:url"; + +const root = createRequire(new URL("../package.json", import.meta.url)); +const expo = createRequire(root.resolve("expo/package.json")); +// Use the pinned Expo CLI's own SemVer implementation. +const cli = createRequire(expo.resolve("@expo/cli/package.json")); +const { valid, validRange, satisfies } = cli("semver"); + +export function checkVersions(manifest, bundled, installed) { + const dependencies = { ...manifest.devDependencies, ...manifest.dependencies }; + const pinnedExpo = dependencies.expo; + if (!valid(pinnedExpo) || installed("expo") !== pinnedExpo) { + throw new Error("Expo must be installed at the exact version pinned in package.json."); + } + for (const required of ["react", "react-native"]) { + if (!bundled[required] || !dependencies[required]) { + throw new Error(`Missing SDK compatibility baseline for ${required}.`); + } + } + const failures = []; + let checked = 0; + for (const name of Object.keys(dependencies)) { + if (!Object.hasOwn(bundled, name)) continue; + const expected = bundled[name]; + if (!validRange(expected)) throw new Error(`Invalid SDK range for ${name}.`); + const actual = installed(name); + if (!satisfies(actual, expected)) { + failures.push(`${name}: installed ${actual}, SDK requires ${expected}`); + } + checked += 1; + } + if (failures.length) throw new Error(failures.join("\n")); + return checked; +} + +export function checkProject(projectRoot) { + const project = createRequire(resolve(projectRoot, "package.json")); + const manifest = JSON.parse(readFileSync(resolve(projectRoot, "package.json"), "utf8")); + const bundled = project("expo/bundledNativeModules.json"); + const checked = checkVersions(manifest, bundled, (name) => project(`${name}/package.json`).version); + return `Expo ${manifest.dependencies.expo}: ${checked} dependencies match the pinned SDK compatibility map.`; +} + +export function runDoctor(projectRoot, run = spawnSync) { + console.log(checkProject(projectRoot)); + console.log("The remaining Expo Doctor checks run online; latest upgrade recommendations are separate."); + const result = run(process.execPath, [root.resolve("expo-doctor/build/index.js"), projectRoot], { + stdio: "inherit", + env: { ...process.env, EXPO_DOCTOR_SKIP_DEPENDENCY_VERSION_CHECK: "1" }, + }); + if (result.error) throw result.error; + return result.status ?? 1; +} + +if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) { + try { + process.exitCode = runDoctor(process.cwd()); + } catch (error) { + console.error(error.message); + process.exitCode = 1; + } +} diff --git a/src/shell/Overview.tsx b/src/shell/Overview.tsx index 6633f638..450828f5 100644 --- a/src/shell/Overview.tsx +++ b/src/shell/Overview.tsx @@ -4,13 +4,13 @@ import { ShellPressable as Pressable } from './ShellPressable'; import { Gesture, GestureDetector } from 'react-native-gesture-handler'; import Animated, { useAnimatedScrollHandler, useAnimatedStyle, type SharedValue } from 'react-native-reanimated'; import { OverviewCard } from './OverviewCard'; +import { createOverviewScrollRestorer, overviewScrollOffset } from './overview-scroll'; import type { OverviewGeometry, CardMeasurement, Size } from './motion'; import type { NappletDescriptor } from './workspace'; import { useShellStyles, type ShellPalette, type ShellFonts } from './theme'; export interface OverviewHandle { focusCard: (id: string | null) => void; revealCard: (id: string | null) => void } interface Props { - hidden?: boolean; sessions: readonly NappletDescriptor[]; geometry: OverviewGeometry; size: Size; @@ -36,28 +36,27 @@ function focusView(view: ViewInstance | TextInstance | null | undefined) { const sessionKey = (session: NappletDescriptor): string => session.id; /** Only transparent controls virtualize; the live native views stay in WorkspaceStage. */ -export const Overview = forwardRef(function Overview({ hidden = false, sessions, geometry, size, visible, busy, focusedId, progress, scrollY, swipeId, swipeY, pending, onFocus, onClose, onOpen, onDragEnd, onMeasure }, ref) { +export const Overview = forwardRef(function Overview({ sessions, geometry, size, visible, busy, focusedId, progress, scrollY, swipeId, swipeY, pending, onFocus, onClose, onOpen, onDragEnd, onMeasure }, ref) { const { styles } = useShellStyles(createStyles); const scroll = useRef>(null); const heading = useRef(null); const cardRefs = useRef(new Map()); - const scrollGesture = useMemo(() => Gesture.Native(), []); + const inactive = busy || !visible; + const scrollGesture = useMemo(() => Gesture.Native().enabled(!inactive), [inactive]); const setCardRef = useCallback((id: string, view: ViewInstance | null) => { if (view) cardRefs.current.set(id, view); else cardRefs.current.delete(id); }, []); + const restoreScroll = useMemo(() => createOverviewScrollRestorer(), []); + const revealCard = useCallback((id: string | null) => { + const index = sessions.findIndex(session => session.id === id); + const next = overviewScrollOffset(geometry, index, scrollY.get(), size.height); + scroll.current?.scrollToOffset({ offset: next, animated: false }); + scrollY.set(next); + }, [geometry, scrollY, sessions, size.height]); useImperativeHandle(ref, () => ({ focusCard: id => focusView(id ? cardRefs.current.get(id) ?? heading.current : heading.current), - revealCard: id => { - const index = sessions.findIndex(session => session.id === id); - const rect = geometry.cards[index]; - if (!rect) return; - const top = scrollY.get(); - const bottom = rect.y + rect.height + geometry.captionHeight; - const next = rect.y < top ? Math.max(0, rect.y - 12) : bottom > top + size.height ? bottom - size.height + 12 : top; - scroll.current?.scrollToOffset({ offset: next, animated: false }); - scrollY.set(next); - }, - }), [geometry, scrollY, sessions, size.height]); + revealCard, + }), [revealCard]); const opacity = useAnimatedStyle(() => ({ opacity: progress.get() })); const onScroll = useAnimatedScrollHandler(event => { scrollY.set(event.contentOffset.y); }); const headerHeight = geometry.cards[0]?.y ?? 72; @@ -65,13 +64,15 @@ export const Overview = forwardRef(function Overview({ hi const stride = cardHeight + geometry.captionHeight + 20; const renderCard = useCallback(({ item, index }: { item: NappletDescriptor; index: number }) => ( - ), [busy, focusedId, geometry, onClose, onDragEnd, onFocus, onMeasure, pending, scrollGesture, setCardRef, swipeId, swipeY]); - return