peachsim 0.1.1673 → 0.1.1684
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/commands/control.ts +13 -1
- package/cli/commands/coverage-swift.ts +83 -27
- package/cli/commands/coverage.ts +219 -20
- package/cli/commands/detect.ts +10 -6
- package/cli/commands/inspect/core.ts +2 -0
- package/cli/commands/inspect/settling.ts +37 -4
- package/cli/commands/inspect/wait-ready.ts +7 -0
- package/cli/outbound-endpoints.ts +12 -0
- package/detox/index.ts +11 -1
- package/detox/jest-environment.cjs +14 -0
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +3299 -1665
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +43 -8
- package/dist-lib/detox/jest-environment.cjs +14 -0
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +2432 -1128
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +2908 -1601
- package/dist-lib/host/fetch-proxy-handler.cjs +22 -6
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1941 -742
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +6215 -4283
- package/dist-lib/native-app-identity-project.cjs +31 -6
- package/dist-lib/native-app-identity-project.mjs +31 -6
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -23
- package/dist-lib/public-origins-lib-static.json +1 -1
- package/dist-lib/public-origins-lib.json +134 -78
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +2 -2
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +39 -5
- package/dist-lib/sdk.mjs +39 -5
- package/dist-lib/skills.cjs +3637 -2168
- package/dist-lib/swift-compile.cjs +496 -352
- package/dist-lib/swift-compile.mjs +494 -350
- package/dist-lib/swift-package.cjs +58 -9
- package/dist-lib/swift-package.mjs +57 -9
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +26 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2443 -1134
- package/dist-lib/vite.cjs +1907 -763
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +9 -1
- package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
- package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +2 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +69 -2
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +44 -4
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
- package/sdk/ios/usr/include/_ctype.h +388 -0
- package/sdk/ios/usr/include/_inttypes.h +296 -0
- package/sdk/ios/usr/include/_locale.h +83 -0
- package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
- package/sdk/ios/usr/include/_time.h +207 -0
- package/sdk/ios/usr/include/arm/param.h +151 -0
- package/sdk/ios/usr/include/ctype.h +70 -0
- package/sdk/ios/usr/include/dispatch/dispatch.h +72 -6
- package/sdk/ios/usr/include/dlfcn.h +1 -2
- package/sdk/ios/usr/include/inttypes.h +35 -0
- package/sdk/ios/usr/include/locale.h +59 -0
- package/sdk/ios/usr/include/machine/param.h +42 -0
- package/sdk/ios/usr/include/net/if.h +1 -2
- package/sdk/ios/usr/include/peach/pthread.h +4 -4
- package/sdk/ios/usr/include/pthread/qos.h +304 -0
- package/sdk/ios/usr/include/runetype.h +118 -0
- package/sdk/ios/usr/include/setjmp.h +99 -0
- package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
- package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
- package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
- package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
- package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/param.h +235 -0
- package/sdk/ios/usr/include/sys/proc.h +1 -0
- package/sdk/ios/usr/include/sys/qos.h +151 -12
- package/sdk/ios/usr/include/time.h +67 -2
- package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
- package/sdk/ios/wasm/include/fcntl.h +11 -0
- package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
- package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
- package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
- package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
- package/sdk/ios/wasm/include/machine/_types.h +153 -0
- package/sdk/ios/wasm/include/machine/endian.h +2 -0
- package/sdk/ios/wasm/include/machine/limits.h +2 -0
- package/sdk/ios/wasm/include/machine/types.h +30 -0
- package/sdk/ios/wasm/include/poll.h +8 -0
- package/sdk/ios/wasm/include/pthread.h +50 -0
- package/sdk/ios/wasm/include/signal.h +72 -0
- package/sdk/ios/wasm/include/stdlib.h +3 -0
- package/sdk/ios/wasm/include/string.h +10 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
- package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
- package/sdk/ios/wasm/include/sys/mman.h +122 -0
- package/sdk/ios/wasm/include/sys/select.h +37 -0
- package/sdk/ios/wasm/include/sys/signal.h +259 -0
- package/sdk/ios/wasm/include/sys/socket.h +8 -0
- package/sdk/ios/wasm/include/sys/types.h +14 -0
- package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
- package/sdk/ios/wasm/include/sys/uio.h +11 -0
- package/sdk/ios/wasm/include/sys/wait.h +89 -0
- package/sdk/ios/wasm/include/time.h +8 -0
- package/sdk/ios/wasm/include/unistd.h +17 -0
- package/src/bridge-contract.ts +2 -0
- package/src/chromium-admission.ts +10 -5
- package/src/device-catalog.ts +4 -4
- package/src/host/fetch-proxy-handler.ts +20 -0
- package/src/host/rolldown-bundle-forward.ts +4 -1
- package/src/metro-plugin.ts +5 -2
- package/src/nitro-adapter.lock.json +6 -6
- package/src/nitro-compile.ts +63 -2
- package/src/numbered-lock.ts +72 -0
- package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
- package/src/react-native-coverage/capability-source-references.ts +50 -13
- package/src/react-native-coverage/native-source-credit.ts +126 -0
- package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
- package/src/react-native-coverage/native-surface.ts +49 -0
- package/src/react-native-coverage/verified-reach.ts +22 -2
- package/src/runtime-assets.ts +17 -0
- package/src/swift-compile.ts +84 -47
- package/src/swift-coverage/indexing.ts +17 -1
- package/src/swift-coverage/sdk.ts +71 -0
- package/src/swift-coverage/source.ts +74 -2
- package/src/swift-coverage/types.ts +6 -0
- package/src/swift-distribution.lock.json +12 -12
- package/src/swift-host.ts +133 -14
- package/src/swift-objc-compile.ts +11 -22
- package/src/swift-objc-metadata.ts +2 -8
- package/src/swift-objc-platform.ts +53 -0
- package/src/swift-objc-standin.ts +49 -0
- package/src/swift-package-manifest.ts +48 -3
- package/src/swift-package.ts +85 -12
- package/src/swift-packages.ts +157 -44
- package/src/swift-source-pods.ts +288 -0
- package/src/swift-standins.ts +4 -1
- package/src/swift-toolchain.ts +32 -10
- package/src/vite-plugin-one.ts +5 -4
- package/src/worker-system-chunks.ts +7 -1
- package/src/xcode-project.ts +40 -11
package/cli/commands/control.ts
CHANGED
|
@@ -1829,8 +1829,10 @@ export function printOpenedSim(
|
|
|
1829
1829
|
if (json) process.stdout.write(`${payload}\n`)
|
|
1830
1830
|
return
|
|
1831
1831
|
}
|
|
1832
|
+
// the launch query carries kilobytes of app identity and fonts; the JSON
|
|
1833
|
+
// below keeps the full url, so the human line names only where it opened.
|
|
1832
1834
|
console.log(
|
|
1833
|
-
` ${mode === 'current sim' ? 'loaded' : 'opened'}: ${printableOpenUrl} [${mode}]`,
|
|
1835
|
+
` ${mode === 'current sim' ? 'loaded' : 'opened'}: ${urlWithoutQuery(printableOpenUrl)} [${mode}]`,
|
|
1834
1836
|
)
|
|
1835
1837
|
// agents pipe around the JSON to grab the id; humans just want to know
|
|
1836
1838
|
// the current sim got updated without scanning the JSON blob.
|
|
@@ -1840,6 +1842,16 @@ export function printOpenedSim(
|
|
|
1840
1842
|
else console.log(payload)
|
|
1841
1843
|
}
|
|
1842
1844
|
|
|
1845
|
+
function urlWithoutQuery(value: string | undefined): string | undefined {
|
|
1846
|
+
if (!value) return value
|
|
1847
|
+
try {
|
|
1848
|
+
const parsed = new URL(value)
|
|
1849
|
+
return `${parsed.origin}${parsed.pathname}`
|
|
1850
|
+
} catch {
|
|
1851
|
+
return value
|
|
1852
|
+
}
|
|
1853
|
+
}
|
|
1854
|
+
|
|
1843
1855
|
function printAgentHints(quiet: boolean): void {
|
|
1844
1856
|
if (quiet) return
|
|
1845
1857
|
console.log(' inspect messages: run `peach agent listen` when you finish your turn')
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { execFileSync } from 'node:child_process'
|
|
2
|
+
import { createHash } from 'node:crypto'
|
|
2
3
|
import { existsSync, mkdtempSync, readdirSync, realpathSync, rmSync } from 'node:fs'
|
|
3
4
|
import { tmpdir } from 'node:os'
|
|
4
5
|
import { dirname, join, relative, resolve, sep } from 'node:path'
|
|
6
|
+
import { VERIFIED_SURFACES } from '@peach/compat/verified-map'
|
|
7
|
+
import { loadSwiftSdkInventoryFragment } from '../../../peach-compat/src/capability-inventory'
|
|
8
|
+
import { swiftSdkIdentity } from '../../src/swift-coverage/indexing'
|
|
5
9
|
import { indexSwiftPackage } from '../../src/swift-coverage/package'
|
|
6
10
|
import { buildSwiftIndexReader } from '../../src/swift-coverage/reader'
|
|
11
|
+
import { readSwiftSdkSymbolCache } from '../../src/swift-coverage/sdk'
|
|
12
|
+
import { resolveSwiftFrontDoors } from '../../src/swift-coverage/source'
|
|
7
13
|
import { indexSwiftXcodeApp, xcodeMetadataFiles } from '../../src/swift-coverage/xcode'
|
|
8
14
|
import { localPackageModules } from '../../src/swift-coverage/xcode-packages'
|
|
9
15
|
import lock from '../../src/swift-distribution.lock.json' with { type: 'json' }
|
|
@@ -15,6 +21,7 @@ import { readPackageFile } from '../../src/swift-source-file'
|
|
|
15
21
|
import { swiftCompilerInstallSteps, swiftToolchainBin } from '../../src/swift-toolchain'
|
|
16
22
|
import { findXcodeProject, readXcodeAppTarget } from '../../src/xcode-project'
|
|
17
23
|
import type { CoverageGraphRequest } from './coverage'
|
|
24
|
+
import type { VerifiedFeature } from '@peach/compat/verified-map-types'
|
|
18
25
|
|
|
19
26
|
// the existing build owners supply membership; requested roots select primaries,
|
|
20
27
|
// while every original target source remains available to the compiler.
|
|
@@ -123,6 +130,7 @@ export async function createSwiftCoverageReport(
|
|
|
123
130
|
},
|
|
124
131
|
})
|
|
125
132
|
if (result.status === 'unknown') return unknown(result.reasons.join('\n'))
|
|
133
|
+
const reach = await swiftSdkReach(result.index, tools)
|
|
126
134
|
return {
|
|
127
135
|
schemaVersion: 1,
|
|
128
136
|
input: {
|
|
@@ -131,16 +139,13 @@ export async function createSwiftCoverageReport(
|
|
|
131
139
|
requestedSources: requestedSources.length ? requestedSources : ['.'],
|
|
132
140
|
},
|
|
133
141
|
status: 'indexed' as const,
|
|
134
|
-
summary:
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
mapped: null,
|
|
138
|
-
verified: null,
|
|
139
|
-
},
|
|
142
|
+
summary: reach.summary,
|
|
143
|
+
sdk: reach.sdk,
|
|
144
|
+
possibleFeatures: reach.possibleFeatures,
|
|
140
145
|
project: result.project,
|
|
141
146
|
reader: tools.reader,
|
|
142
|
-
index:
|
|
143
|
-
unknowns: result.unknowns,
|
|
147
|
+
index: reach.index,
|
|
148
|
+
unknowns: [...result.unknowns, ...reach.unknowns],
|
|
144
149
|
}
|
|
145
150
|
}
|
|
146
151
|
const manifest = swiftPackageManifest(app)
|
|
@@ -193,7 +198,8 @@ export async function createSwiftCoverageReport(
|
|
|
193
198
|
)
|
|
194
199
|
if (!primaries.length)
|
|
195
200
|
return unknown('Requested source roots contain no SwiftPM target sources.')
|
|
196
|
-
const
|
|
201
|
+
const tools = swiftCoverageTools(work)
|
|
202
|
+
const { swiftc, sdk, nativeTarget, indexdump } = tools
|
|
197
203
|
const result = await indexSwiftPackage({
|
|
198
204
|
root: app,
|
|
199
205
|
target: target.name,
|
|
@@ -202,16 +208,12 @@ export async function createSwiftCoverageReport(
|
|
|
202
208
|
indexdump,
|
|
203
209
|
native: {
|
|
204
210
|
swiftc,
|
|
205
|
-
flags: [
|
|
206
|
-
'-target',
|
|
207
|
-
`${process.arch === 'arm64' ? 'arm64' : 'x86_64'}-apple-ios${version}-simulator`,
|
|
208
|
-
'-sdk',
|
|
209
|
-
sdk,
|
|
210
|
-
],
|
|
211
|
+
flags: ['-target', nativeTarget, '-sdk', sdk],
|
|
211
212
|
},
|
|
212
213
|
primaries,
|
|
213
214
|
})
|
|
214
215
|
if (result.status === 'unknown') return unknown(result.reasons.join('\n'))
|
|
216
|
+
const reach = await swiftSdkReach(result.index, tools)
|
|
215
217
|
return {
|
|
216
218
|
schemaVersion: 1,
|
|
217
219
|
input: {
|
|
@@ -220,16 +222,13 @@ export async function createSwiftCoverageReport(
|
|
|
220
222
|
requestedSources: requestedSources.length ? requestedSources : ['.'],
|
|
221
223
|
},
|
|
222
224
|
status: 'indexed' as const,
|
|
223
|
-
summary:
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
mapped: null,
|
|
227
|
-
verified: null,
|
|
228
|
-
},
|
|
225
|
+
summary: reach.summary,
|
|
226
|
+
sdk: reach.sdk,
|
|
227
|
+
possibleFeatures: reach.possibleFeatures,
|
|
229
228
|
package: result.package,
|
|
230
|
-
reader,
|
|
231
|
-
index:
|
|
232
|
-
unknowns: result.unknowns,
|
|
229
|
+
reader: tools.reader,
|
|
230
|
+
index: reach.index,
|
|
231
|
+
unknowns: [...result.unknowns, ...reach.unknowns],
|
|
233
232
|
}
|
|
234
233
|
} catch (error) {
|
|
235
234
|
return unknown(error instanceof Error ? error.message : String(error))
|
|
@@ -248,13 +247,68 @@ function swiftCoverageTools(work: string) {
|
|
|
248
247
|
['--sdk', 'iphonesimulator', '--show-sdk-version'],
|
|
249
248
|
{ encoding: 'utf8' },
|
|
250
249
|
).trim()
|
|
250
|
+
const nativeTarget = `${process.arch === 'arm64' ? 'arm64' : 'x86_64'}-apple-ios${version}-simulator`
|
|
251
|
+
const sdkIdentity = swiftSdkIdentity(swiftc, sdk, nativeTarget)
|
|
252
|
+
const sdkFingerprint = createHash('sha256')
|
|
253
|
+
.update(JSON.stringify(sdkIdentity))
|
|
254
|
+
.digest('hex')
|
|
251
255
|
const indexdump = join(work, 'indexdump')
|
|
252
256
|
const reader = buildSwiftIndexReader(
|
|
253
257
|
join(swiftToolchainBin(lock.release), 'swiftc'),
|
|
254
258
|
indexdump,
|
|
255
259
|
() => swiftCompilerInstallSteps(lock.release),
|
|
256
260
|
)
|
|
257
|
-
return {
|
|
261
|
+
return {
|
|
262
|
+
swiftc,
|
|
263
|
+
sdk,
|
|
264
|
+
version,
|
|
265
|
+
nativeTarget,
|
|
266
|
+
sdkIdentity,
|
|
267
|
+
sdkFingerprint,
|
|
268
|
+
sdkSymbols: readSwiftSdkSymbolCache(sdkFingerprint),
|
|
269
|
+
indexdump,
|
|
270
|
+
reader,
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// the SDK front doors each indexed reference reaches; mapped and verified shares stay unknown
|
|
275
|
+
async function swiftSdkReach(
|
|
276
|
+
index: Parameters<typeof resolveSwiftFrontDoors>[0],
|
|
277
|
+
tools: ReturnType<typeof swiftCoverageTools>,
|
|
278
|
+
) {
|
|
279
|
+
const inventory = await loadSwiftSdkInventoryFragment()
|
|
280
|
+
const reach = resolveSwiftFrontDoors(
|
|
281
|
+
index,
|
|
282
|
+
inventory.rows,
|
|
283
|
+
tools.sdkFingerprint,
|
|
284
|
+
VERIFIED_SURFACES.flatMap<VerifiedFeature>((surface) => surface.features),
|
|
285
|
+
tools.sdkSymbols,
|
|
286
|
+
)
|
|
287
|
+
return {
|
|
288
|
+
summary: {
|
|
289
|
+
symbolicReferences: index.sites.length,
|
|
290
|
+
frontDoorReferences: reach.sites.filter((site) => site.frontDoorIds.length).length,
|
|
291
|
+
frontDoors: new Set(reach.sites.flatMap((site) => site.frontDoorIds)).size,
|
|
292
|
+
mappedFrontDoors: new Set(reach.sites.flatMap((site) => site.capabilityIds)).size,
|
|
293
|
+
unmappedReferences: reach.sites.filter((site) => site.mapping === 'unmapped')
|
|
294
|
+
.length,
|
|
295
|
+
possibleFeatures: reach.features.length,
|
|
296
|
+
mapped: null,
|
|
297
|
+
verified: null,
|
|
298
|
+
},
|
|
299
|
+
sdk: {
|
|
300
|
+
...tools.sdkIdentity,
|
|
301
|
+
fingerprint: tools.sdkFingerprint,
|
|
302
|
+
inventoryMatched: reach.sdkMatched,
|
|
303
|
+
},
|
|
304
|
+
possibleFeatures: reach.features,
|
|
305
|
+
index: { ...index, sites: reach.sites },
|
|
306
|
+
unknowns: reach.sdkMatched
|
|
307
|
+
? []
|
|
308
|
+
: [
|
|
309
|
+
'The installed SDK build and compiler do not match the retained Swift SDK inventory; all front doors remain unknown.',
|
|
310
|
+
],
|
|
311
|
+
}
|
|
258
312
|
}
|
|
259
313
|
|
|
260
314
|
export async function runSwiftCoverage(
|
|
@@ -273,7 +327,9 @@ export async function runSwiftCoverage(
|
|
|
273
327
|
console.log(
|
|
274
328
|
`Indexed ${report.index.input.sources.length} Swift module files: ${report.index.sites.length} explicit symbolic references.`,
|
|
275
329
|
)
|
|
276
|
-
console.log(
|
|
330
|
+
console.log(
|
|
331
|
+
`SDK front doors: ${report.summary.frontDoors}; possible features: ${report.summary.possibleFeatures}. Mapped and verified shares: unknown.`,
|
|
332
|
+
)
|
|
277
333
|
for (const command of report.index.native.commands.filter(
|
|
278
334
|
(command) => command.code !== 0,
|
|
279
335
|
))
|
|
@@ -282,7 +338,7 @@ export async function runSwiftCoverage(
|
|
|
282
338
|
)
|
|
283
339
|
for (const site of report.index.sites)
|
|
284
340
|
console.log(
|
|
285
|
-
` ${site.file}:${site.line}:${site.col} ${site.name} (${site.usr}):
|
|
341
|
+
` ${site.file}:${site.line}:${site.col} ${site.name} (${site.usr}): ${site.frontDoorIds.join(', ') || 'SDK origin unknown'}; ${site.mapping}; native proof unknown`,
|
|
286
342
|
)
|
|
287
343
|
for (const limitation of [...report.unknowns, ...report.index.unknowns])
|
|
288
344
|
console.log(` ${limitation}`)
|
package/cli/commands/coverage.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto'
|
|
2
2
|
import { existsSync, lstatSync, readFileSync, readdirSync } from 'node:fs'
|
|
3
3
|
import { dirname, extname, isAbsolute, join, relative, resolve, sep } from 'node:path'
|
|
4
|
-
import { VERIFIED_SURFACES } from '@peach/compat/verified-map'
|
|
4
|
+
import { NATIVE_SOURCE_PACKAGES, VERIFIED_SURFACES } from '@peach/compat/verified-map'
|
|
5
5
|
import {
|
|
6
6
|
VERIFIED_AXES,
|
|
7
7
|
VERIFIED_SOURCE_API_ROOTS,
|
|
@@ -18,6 +18,18 @@ import {
|
|
|
18
18
|
type CapabilityReferenceCandidate,
|
|
19
19
|
type StaticValue,
|
|
20
20
|
} from '../../src/react-native-coverage/capability-source-references'
|
|
21
|
+
import {
|
|
22
|
+
creditFeature,
|
|
23
|
+
creditingReleases,
|
|
24
|
+
legacyArchitectureReason,
|
|
25
|
+
type ArchitectureSetting,
|
|
26
|
+
type FeatureCredit,
|
|
27
|
+
type ReactNativeHost,
|
|
28
|
+
} from '../../src/react-native-coverage/native-source-credit'
|
|
29
|
+
import {
|
|
30
|
+
installedNativeSurface,
|
|
31
|
+
type NativeSurface,
|
|
32
|
+
} from '../../src/react-native-coverage/native-surface'
|
|
21
33
|
import { withTypeScriptSourceParser } from '../../src/react-native-coverage/native-typescript-parser'
|
|
22
34
|
import { createProjectModuleResolver } from '../../src/react-native-coverage/project-aliases'
|
|
23
35
|
import {
|
|
@@ -25,7 +37,12 @@ import {
|
|
|
25
37
|
referenceFeatures,
|
|
26
38
|
} from '../../src/react-native-coverage/verified-reach'
|
|
27
39
|
import { coverageParserPath } from './coverage-parser'
|
|
28
|
-
import {
|
|
40
|
+
import {
|
|
41
|
+
readNativeProjectRenderer,
|
|
42
|
+
readProjectManifest,
|
|
43
|
+
resolveManifestVersions,
|
|
44
|
+
} from './detect'
|
|
45
|
+
import type { NativeSourcePackage } from '../../../peach-compat/src/native-source-ranges-types'
|
|
29
46
|
import type { ProjectManifest } from './projectReportContract'
|
|
30
47
|
|
|
31
48
|
const SOURCE_EXTENSIONS = new Set([
|
|
@@ -80,6 +97,13 @@ const inventorySchema = z.object({
|
|
|
80
97
|
),
|
|
81
98
|
})
|
|
82
99
|
|
|
100
|
+
interface VersionUnknownFeature {
|
|
101
|
+
feature: string
|
|
102
|
+
reason: string
|
|
103
|
+
// the native files that differ from the closest verified release, per group
|
|
104
|
+
differs: readonly { group: string; verifiedRelease: string; files: readonly string[] }[]
|
|
105
|
+
}
|
|
106
|
+
|
|
83
107
|
export interface CoverageGraphRequest {
|
|
84
108
|
entry?: string
|
|
85
109
|
platform: 'ios' | 'android'
|
|
@@ -339,11 +363,83 @@ export async function createCoverageReport(
|
|
|
339
363
|
Object.entries({
|
|
340
364
|
...ownerManifest.dependencies,
|
|
341
365
|
...ownerManifest.devDependencies,
|
|
342
|
-
}).filter(([name]) => names.has(name)),
|
|
366
|
+
}).filter(([name]) => names.has(name) || name === 'react-native'),
|
|
343
367
|
)
|
|
344
368
|
versionOwners.set(owner, resolveManifestVersions(owner, { dependencies }, lockfiles))
|
|
345
369
|
}
|
|
346
370
|
const definitions = new Map(inventory.rows.map((row) => [row.id, row]))
|
|
371
|
+
const nativeSources = new Map<string, NativeSourcePackage>(
|
|
372
|
+
Object.entries(NATIVE_SOURCE_PACKAGES).filter(([name]) => name !== 'react-native'),
|
|
373
|
+
)
|
|
374
|
+
const architectures = new Map<string, ArchitectureSetting>()
|
|
375
|
+
const architectureOf = (owner: string): ArchitectureSetting => {
|
|
376
|
+
const known = architectures.get(owner)
|
|
377
|
+
if (known) return known
|
|
378
|
+
let setting: ArchitectureSetting
|
|
379
|
+
try {
|
|
380
|
+
const dynamic = ['ts', 'js', 'cjs', 'mjs'].some((extension) =>
|
|
381
|
+
existsSync(join(owner, `app.config.${extension}`)),
|
|
382
|
+
)
|
|
383
|
+
// an app.config function can override app.json, so with one present only
|
|
384
|
+
// the ios project settles the renderer
|
|
385
|
+
const renderer = readNativeProjectRenderer(owner, 'ios', undefined, {
|
|
386
|
+
appJson: !dynamic,
|
|
387
|
+
})
|
|
388
|
+
setting =
|
|
389
|
+
renderer === undefined && dynamic
|
|
390
|
+
? {
|
|
391
|
+
unreadable:
|
|
392
|
+
'the iOS architecture is set by app.config code and no ios project declares it',
|
|
393
|
+
}
|
|
394
|
+
: { renderer }
|
|
395
|
+
} catch (error) {
|
|
396
|
+
setting = { unreadable: error instanceof Error ? error.message : String(error) }
|
|
397
|
+
}
|
|
398
|
+
architectures.set(owner, setting)
|
|
399
|
+
return setting
|
|
400
|
+
}
|
|
401
|
+
const nativeSurfaces = new Map<string, NativeSurface>()
|
|
402
|
+
const surfaceOf = (owner: string, packageName: string) => {
|
|
403
|
+
const key = `${owner}\0${packageName}`
|
|
404
|
+
const known = nativeSurfaces.get(key)
|
|
405
|
+
if (known) return known
|
|
406
|
+
const surface = installedNativeSurface(owner, packageName)
|
|
407
|
+
nativeSurfaces.set(key, surface)
|
|
408
|
+
return surface
|
|
409
|
+
}
|
|
410
|
+
const hostOf = (owner: string): ReactNativeHost => {
|
|
411
|
+
const reactNative = NATIVE_SOURCE_PACKAGES['react-native']
|
|
412
|
+
if (!reactNative) throw new Error('no native source ranges for react-native')
|
|
413
|
+
const installed = versionOwners.get(owner)?.['react-native']
|
|
414
|
+
return {
|
|
415
|
+
config: reactNative,
|
|
416
|
+
version:
|
|
417
|
+
installed && installed.source !== 'declared' ? installed.version : undefined,
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const credits = new Map<string, FeatureCredit>()
|
|
421
|
+
const creditOf = (
|
|
422
|
+
config: NativeSourcePackage | undefined,
|
|
423
|
+
featureId: string,
|
|
424
|
+
version: string,
|
|
425
|
+
owner: string,
|
|
426
|
+
) => {
|
|
427
|
+
const key = `${config?.packageName ?? 'react-native'}\0${version}\0${featureId}\0${owner}`
|
|
428
|
+
const known = credits.get(key)
|
|
429
|
+
if (known) return known
|
|
430
|
+
// react native core credits every release the app builds on the new
|
|
431
|
+
// architecture; a library also needs identical native source
|
|
432
|
+
const legacy = config
|
|
433
|
+
? undefined
|
|
434
|
+
: legacyArchitectureReason(architectureOf(owner), hostOf(owner))
|
|
435
|
+
const credit: FeatureCredit = config
|
|
436
|
+
? creditFeature(config, featureId, version, architectureOf(owner), hostOf(owner))
|
|
437
|
+
: legacy
|
|
438
|
+
? { status: 'unknown', reason: legacy, differs: [] }
|
|
439
|
+
: { status: 'credited', verifiedRelease: hostOf(owner).config.reference }
|
|
440
|
+
credits.set(key, credit)
|
|
441
|
+
return credit
|
|
442
|
+
}
|
|
347
443
|
const allFeatures = surfaces.flatMap((surface) => surface.features)
|
|
348
444
|
const doorReferences = resolveCapabilityReferences(
|
|
349
445
|
inventory.rows,
|
|
@@ -376,14 +472,22 @@ export async function createCoverageReport(
|
|
|
376
472
|
dependency.source === 'declared' ||
|
|
377
473
|
!/^\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?$/.test(dependency.version)
|
|
378
474
|
? 'unknown'
|
|
379
|
-
:
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
:
|
|
475
|
+
: (row && reference.packageName === 'react-native') ||
|
|
476
|
+
((row || sourceApi) && nativeSources.has(reference.packageName))
|
|
477
|
+
? 'per-feature'
|
|
478
|
+
: sourceApi
|
|
479
|
+
? dependency.version === sourceApi.sourceApiVersion
|
|
480
|
+
? 'matched'
|
|
481
|
+
: 'mismatched'
|
|
482
|
+
: row
|
|
483
|
+
? resolveCompatVersionRange([row.supportedVersionRange], dependency.version)
|
|
484
|
+
.status
|
|
485
|
+
: 'unknown'
|
|
486
|
+
// a package outside the inventory is read from its installed files
|
|
487
|
+
const nativeSurface =
|
|
488
|
+
reference.state === 'attributed' || reference.state === 'excluded' || !owner
|
|
489
|
+
? null
|
|
490
|
+
: surfaceOf(owner, reference.packageName)
|
|
387
491
|
const features =
|
|
388
492
|
reference.state === 'attributed'
|
|
389
493
|
? referenceFeatures(allFeatures, reference.capabilityId, reference.value ?? null)
|
|
@@ -410,12 +514,15 @@ export async function createCoverageReport(
|
|
|
410
514
|
sourceApiIdentity: sourceApi?.sourceIdentity ?? null,
|
|
411
515
|
platformApplicable: sourceApi ? true : (row?.platforms.includes('ios') ?? null),
|
|
412
516
|
features,
|
|
517
|
+
nativeSurface,
|
|
413
518
|
mapping:
|
|
414
519
|
reference.state === 'excluded'
|
|
415
520
|
? 'excluded'
|
|
416
521
|
: reference.state !== 'attributed'
|
|
417
|
-
? '
|
|
418
|
-
|
|
522
|
+
? nativeSurface?.kind === 'none'
|
|
523
|
+
? 'no-native-surface'
|
|
524
|
+
: 'unknown-api'
|
|
525
|
+
: versionStatus !== 'matched' && versionStatus !== 'per-feature'
|
|
419
526
|
? 'unknown-version'
|
|
420
527
|
: !(sourceApi || row?.platforms.includes('ios'))
|
|
421
528
|
? 'other-platform'
|
|
@@ -437,16 +544,46 @@ export async function createCoverageReport(
|
|
|
437
544
|
])
|
|
438
545
|
const featureReach = new Map(allFeatures.map((feature) => [feature.id, feature]))
|
|
439
546
|
const references = doorReferences.map((reference) => {
|
|
440
|
-
if (reference.mapping !== 'mapped')
|
|
547
|
+
if (reference.mapping !== 'mapped')
|
|
548
|
+
return { ...reference, versionUnknownFeatures: [] }
|
|
441
549
|
const peers = mappedByPath.get(reference.path) ?? []
|
|
442
|
-
const
|
|
550
|
+
const reachable = reference.features.filter((id) => {
|
|
443
551
|
const feature = featureReach.get(id)
|
|
444
552
|
return feature !== undefined && fileReachesFeature(feature, peers)
|
|
445
553
|
})
|
|
554
|
+
const config = nativeSources.get(reference.packageName)
|
|
555
|
+
const owner = sourceOwners.get(reference.path)
|
|
556
|
+
// react native core and libraries with native source ranges are credited
|
|
557
|
+
// feature by feature: the app must build the new architecture, and a
|
|
558
|
+
// library release must share every executed native file with a verified one
|
|
559
|
+
if (reference.versionStatus !== 'per-feature' || !owner || !reference.packageVersion)
|
|
560
|
+
return {
|
|
561
|
+
...reference,
|
|
562
|
+
features: reachable,
|
|
563
|
+
versionUnknownFeatures: [],
|
|
564
|
+
mapping: reachable.length ? 'mapped' : 'unmapped-feature',
|
|
565
|
+
}
|
|
566
|
+
const features: string[] = []
|
|
567
|
+
const versionUnknownFeatures: VersionUnknownFeature[] = []
|
|
568
|
+
for (const id of reachable) {
|
|
569
|
+
const credit = creditOf(config, id, reference.packageVersion.version, owner)
|
|
570
|
+
if (credit.status === 'credited') features.push(id)
|
|
571
|
+
else
|
|
572
|
+
versionUnknownFeatures.push({
|
|
573
|
+
feature: id,
|
|
574
|
+
reason: credit.reason,
|
|
575
|
+
differs: credit.differs,
|
|
576
|
+
})
|
|
577
|
+
}
|
|
446
578
|
return {
|
|
447
579
|
...reference,
|
|
448
580
|
features,
|
|
449
|
-
|
|
581
|
+
versionUnknownFeatures,
|
|
582
|
+
mapping: features.length
|
|
583
|
+
? 'mapped'
|
|
584
|
+
: versionUnknownFeatures.length
|
|
585
|
+
? 'unknown-version'
|
|
586
|
+
: 'unmapped-feature',
|
|
450
587
|
}
|
|
451
588
|
})
|
|
452
589
|
const reached = new Set(
|
|
@@ -480,6 +617,43 @@ export async function createCoverageReport(
|
|
|
480
617
|
reason: 'source references do not select device, OS, settings or interaction cells',
|
|
481
618
|
proofUrl: 'https://peachsim.com/conformance',
|
|
482
619
|
}))
|
|
620
|
+
// one entry per package release and feature the scan could not credit
|
|
621
|
+
const versionUnknown = [
|
|
622
|
+
...Map.groupBy(
|
|
623
|
+
references.flatMap((reference) =>
|
|
624
|
+
reference.versionUnknownFeatures.map((entry) => ({
|
|
625
|
+
packageName: reference.packageName,
|
|
626
|
+
version: reference.packageVersion?.version ?? '',
|
|
627
|
+
...entry,
|
|
628
|
+
})),
|
|
629
|
+
),
|
|
630
|
+
(entry) => `${entry.packageName}\0${entry.version}\0${entry.feature}`,
|
|
631
|
+
).values(),
|
|
632
|
+
].map((group) => ({ ...group[0], references: group.length }))
|
|
633
|
+
// what a cell captured on one more release would credit, so the cheapest
|
|
634
|
+
// second release to capture on can be read from the apps scanned
|
|
635
|
+
const captureCandidates = [
|
|
636
|
+
...Map.groupBy(
|
|
637
|
+
versionUnknown.flatMap((entry) => {
|
|
638
|
+
const config = nativeSources.get(entry.packageName)
|
|
639
|
+
if (!config || !entry.differs.length) return []
|
|
640
|
+
return creditingReleases(config, entry.feature, entry.version).map((release) => ({
|
|
641
|
+
packageName: entry.packageName,
|
|
642
|
+
release,
|
|
643
|
+
feature: entry.feature,
|
|
644
|
+
references: entry.references,
|
|
645
|
+
}))
|
|
646
|
+
}),
|
|
647
|
+
(entry) => `${entry.packageName}\0${entry.release}`,
|
|
648
|
+
).values(),
|
|
649
|
+
]
|
|
650
|
+
.map((group) => ({
|
|
651
|
+
packageName: group[0]?.packageName ?? '',
|
|
652
|
+
release: group[0]?.release ?? '',
|
|
653
|
+
features: [...new Set(group.map((entry) => entry.feature))].sort(),
|
|
654
|
+
references: group.reduce((total, entry) => total + entry.references, 0),
|
|
655
|
+
}))
|
|
656
|
+
.sort((a, b) => b.references - a.references || b.release.localeCompare(a.release))
|
|
483
657
|
const packages = new Map<
|
|
484
658
|
string,
|
|
485
659
|
{
|
|
@@ -541,9 +715,14 @@ export async function createCoverageReport(
|
|
|
541
715
|
reference.mapping === 'unknown-version' ||
|
|
542
716
|
reference.mapping === 'unmapped-feature',
|
|
543
717
|
).length,
|
|
544
|
-
|
|
718
|
+
versionUnknownReferences: references.filter(
|
|
545
719
|
(reference) =>
|
|
546
|
-
reference.state === 'attributed' &&
|
|
720
|
+
reference.state === 'attributed' &&
|
|
721
|
+
(reference.versionStatus === 'unmatched' ||
|
|
722
|
+
reference.versionUnknownFeatures.length > 0),
|
|
723
|
+
).length,
|
|
724
|
+
noNativeSurfaceReferences: references.filter(
|
|
725
|
+
(reference) => reference.mapping === 'no-native-surface',
|
|
547
726
|
).length,
|
|
548
727
|
projectModuleReferences,
|
|
549
728
|
possibleFeatures: features.length,
|
|
@@ -570,6 +749,8 @@ export async function createCoverageReport(
|
|
|
570
749
|
})),
|
|
571
750
|
references,
|
|
572
751
|
features,
|
|
752
|
+
versionUnknown,
|
|
753
|
+
captureCandidates: captureCandidates.slice(0, 5),
|
|
573
754
|
unknowns,
|
|
574
755
|
limitations: [
|
|
575
756
|
...(graphRequest
|
|
@@ -580,9 +761,11 @@ export async function createCoverageReport(
|
|
|
580
761
|
: []),
|
|
581
762
|
'Application source is scanned conservatively, without compiling or executing the app. Source roots do not establish entrypoint reachability.',
|
|
582
763
|
'Transitive library source, computed loading, cross-file aliases and runtime values are not resolved. Their feature and scenario reach remains unknown.',
|
|
583
|
-
'Declared dependency ranges alone are not exact package versions. The installed or unambiguous lockfile version
|
|
764
|
+
'Declared dependency ranges alone are not exact package versions. The installed or unambiguous lockfile version is required.',
|
|
765
|
+
'React Native core features credit every resolved React Native release the app builds on the new iOS architecture. Libraries with native source ranges also require identical native and native-facing JavaScript source. A legacy or unreadable architecture and source differences remain version unknown.',
|
|
584
766
|
'This CLI inventory snapshot is not pinned to a selected runtime. Native fidelity and scenario verification remain unknown; no aggregate percentage is established.',
|
|
585
767
|
"Imports through the app's own tsconfig or jsconfig paths, baseUrl or package.json imports are application source, not packages, and are not counted as references. App-owned native modules behind such an alias are listed and stay unknown.",
|
|
768
|
+
'A package that ships no native code reads as no native surface. The scan does not follow it into its own source, so the React Native components it renders are not attributed. A package that is not installed is unread.',
|
|
586
769
|
'Swift source indexing is not included in this React Native source scan.',
|
|
587
770
|
],
|
|
588
771
|
}
|
|
@@ -657,7 +840,7 @@ export async function runCoverage(args: string[]): Promise<number> {
|
|
|
657
840
|
`Scanned ${report.input.files} source files: ${summary.references} package references (${summary.projectModuleReferences} imports of the app's own modules not counted).`,
|
|
658
841
|
)
|
|
659
842
|
console.log(
|
|
660
|
-
` mapped to a feature: ${summary.mappedReferences};
|
|
843
|
+
` mapped to a feature: ${summary.mappedReferences}; package ships no native code: ${summary.noNativeSurfaceReferences}; version unknown: ${summary.versionUnknownReferences}; other unknown or unmapped: ${Math.max(0, summary.unknownReferences - summary.versionUnknownReferences)}`,
|
|
661
844
|
)
|
|
662
845
|
console.log(
|
|
663
846
|
`Possible features: ${summary.possibleFeatures}. Mapped share: unknown. Verified share: unknown.`,
|
|
@@ -682,6 +865,22 @@ export async function runCoverage(args: string[]): Promise<number> {
|
|
|
682
865
|
)
|
|
683
866
|
if (report.packages.length > PACKAGE_LINES)
|
|
684
867
|
console.log(` ${report.packages.length - PACKAGE_LINES} more packages; use --json`)
|
|
868
|
+
const VERSION_LINES = 12
|
|
869
|
+
if (report.versionUnknown.length) {
|
|
870
|
+
console.log(
|
|
871
|
+
'Version unknown (native source not shown unchanged since a verified release):',
|
|
872
|
+
)
|
|
873
|
+
for (const entry of report.versionUnknown.slice(0, VERSION_LINES))
|
|
874
|
+
console.log(
|
|
875
|
+
` ${entry.packageName} ${entry.version} ${entry.feature}: ${entry.reason}`,
|
|
876
|
+
)
|
|
877
|
+
if (report.versionUnknown.length > VERSION_LINES)
|
|
878
|
+
console.log(` ${report.versionUnknown.length - VERSION_LINES} more; use --json`)
|
|
879
|
+
}
|
|
880
|
+
for (const candidate of report.captureCandidates)
|
|
881
|
+
console.log(
|
|
882
|
+
` a cell captured on ${candidate.packageName} ${candidate.release} would credit ${candidate.features.length} features (${candidate.references} references)`,
|
|
883
|
+
)
|
|
685
884
|
for (const module of report.localNativeModules)
|
|
686
885
|
console.log(
|
|
687
886
|
` app-owned native module ${module.module} (${module.path}): ${module.references} references, unknown`,
|
package/cli/commands/detect.ts
CHANGED
|
@@ -482,10 +482,12 @@ export function installedManifest(
|
|
|
482
482
|
}
|
|
483
483
|
|
|
484
484
|
// read only explicit static native build settings for the selected platform.
|
|
485
|
+
// `appJson: false` leaves out app.json, which a dynamic app config can override.
|
|
485
486
|
export function readNativeProjectRenderer(
|
|
486
487
|
dir: string,
|
|
487
488
|
platform: 'ios' | 'android',
|
|
488
489
|
files: RepoFileReader = nodeRepoFileReader,
|
|
490
|
+
{ appJson = true }: { appJson?: boolean } = {},
|
|
489
491
|
): NativeRenderer | undefined {
|
|
490
492
|
const declarations: Array<{ source: string; enabled: boolean }> = []
|
|
491
493
|
const add = (value: unknown, source: string, strings = false) => {
|
|
@@ -508,12 +510,14 @@ export function readNativeProjectRenderer(
|
|
|
508
510
|
throw new Error(`${path}: malformed native metadata`)
|
|
509
511
|
}
|
|
510
512
|
}
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
513
|
+
if (appJson) {
|
|
514
|
+
const expo = metadataValue(json('app.json'), 'expo')
|
|
515
|
+
add(metadataValue(expo, 'newArchEnabled'), 'app.json expo.newArchEnabled')
|
|
516
|
+
add(
|
|
517
|
+
metadataValue(metadataValue(expo, platform), 'newArchEnabled'),
|
|
518
|
+
`app.json expo.${platform}.newArchEnabled`,
|
|
519
|
+
)
|
|
520
|
+
}
|
|
517
521
|
if (platform === 'ios') {
|
|
518
522
|
add(
|
|
519
523
|
metadataValue(json('ios/Podfile.properties.json'), 'newArchEnabled'),
|
|
@@ -1156,6 +1156,7 @@ function shellEscape(value: string): string {
|
|
|
1156
1156
|
// ─── wait ───
|
|
1157
1157
|
|
|
1158
1158
|
export interface WaitReadyStatus {
|
|
1159
|
+
startup?: string
|
|
1159
1160
|
ready: boolean
|
|
1160
1161
|
elapsedMs: number
|
|
1161
1162
|
nodes: number
|
|
@@ -1423,6 +1424,7 @@ function waitReadyStatus(result: SemanticWaitResult, ready: boolean): WaitReadyS
|
|
|
1423
1424
|
externalError: probe?.externalError ?? '',
|
|
1424
1425
|
suppressedEntryError: probe?.suppressedEntryError ?? '',
|
|
1425
1426
|
errors: probe?.errors ?? 0,
|
|
1427
|
+
startup: probe?.startup,
|
|
1426
1428
|
bridgeError: result.error ?? '',
|
|
1427
1429
|
paintedAppContent: probe?.paintedAppContent ?? false,
|
|
1428
1430
|
treeQuietMs: probe?.treeQuietMs ?? 0,
|