peachsim 0.1.2624 → 0.1.2626
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/diagnose-native.ts +717 -0
- package/cli/commands/perf-native.ts +120 -51
- 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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +424 -339
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-DH6VFUJ3.mjs → acorn-JXJYSAIN.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-YOD53JTM.mjs → chunk-26TN2VTX.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-T7C6Z5UH.mjs → chunk-2NVWTTQ4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LT533AHJ.mjs → chunk-2R77YMAI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-XONCLAVA.mjs → chunk-4KZSU4Q6.mjs} +21 -13
- package/dist-lib/esm-chunks/{chunk-IMI2NE4A.mjs → chunk-5STOTQGG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HKPKCJI5.mjs → chunk-5TQNPFPN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OLAYY7SG.mjs → chunk-5UEXET5Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LMWSFXYN.mjs → chunk-62JXISPM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-A2WMBGJO.mjs → chunk-7ASIV44B.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-JHMD4G4V.mjs → chunk-AETFJFSQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UJORQHAE.mjs → chunk-AVFNDICR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AV7G5PTE.mjs → chunk-BFQUJ4RC.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-265THLTP.mjs → chunk-BSNIUHSI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CM2NU5MS.mjs → chunk-F6KLM535.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-LOQBWIPM.mjs → chunk-HESCA2JF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-N4ZJZUCO.mjs → chunk-IYJG62ST.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QNXV766K.mjs → chunk-LBDHHUER.mjs} +81 -15
- package/dist-lib/esm-chunks/{chunk-EFQFJ7M6.mjs → chunk-LWOZ3LUO.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3XA5HYI5.mjs → chunk-T4ZKKV6P.mjs} +9 -8
- package/dist-lib/esm-chunks/{chunk-2YHIYKY2.mjs → chunk-UD7ON4ZV.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-LCO2EXKF.mjs → chunk-V4CRDOYA.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-LD7Z3NDO.mjs → chunk-WC43FELF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-QZ5HTMWV.mjs → chunk-XCUDQYYK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VH4BJS5V.mjs → chunk-YPBNNV6N.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-MDVTDJ65.mjs → metro-layout-parser-E34XATI4.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-ZN7I4FYC.mjs → swift-package-prebuilt-73BSTPFQ.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-DUVE2OXH.mjs → swift-sdk-app-module-L7AT6SCB.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-YSWQBCYV.mjs → swift-sdk-image-5NH574IM.mjs} +16 -18
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-MZ235WSK.mjs → swift-sdk-image-producer-YVZHH2LX.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +325 -240
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +428 -343
- package/dist-lib/host/fetch-proxy-handler.cjs +76 -8
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +4 -3
- package/dist-lib/native-app-identity-project.mjs +15 -15
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +87 -86
- package/dist-lib/public-origins-lib.json +69 -64
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +465 -380
- package/dist-lib/swift-compile.cjs +142 -62
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/src/react-native-core-build.ts +12 -12
- package/src/react-native-core.ts +3 -7
- package/src/swift-compiler-digest.ts +37 -10
- package/src/swift-distribution-contract.ts +6 -1
- package/src/swift-distribution.lock.json +4 -2
- package/src/swift-sdk-image-recipe.ts +20 -0
- package/src/swift-sdk-image.ts +2 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { execFileSync } from 'node:child_process'
|
|
1
|
+
import { execFileSync, spawnSync } from 'node:child_process'
|
|
2
2
|
import { randomUUID } from 'node:crypto'
|
|
3
3
|
import {
|
|
4
4
|
copyFileSync,
|
|
@@ -33,7 +33,7 @@ type NativeProfileComponent = {
|
|
|
33
33
|
maxMs: number
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
type NativeProfileReport = {
|
|
36
|
+
export type NativeProfileReport = {
|
|
37
37
|
schema: number
|
|
38
38
|
bundleId: string
|
|
39
39
|
build: string
|
|
@@ -63,6 +63,7 @@ type NativeProfileReport = {
|
|
|
63
63
|
worstStall: Record<string, unknown> | null
|
|
64
64
|
slowBridgeCalls: Record<string, unknown>[]
|
|
65
65
|
slowBridgeTotal: number
|
|
66
|
+
budget: Record<string, unknown> | null
|
|
66
67
|
spans: Record<string, unknown>[]
|
|
67
68
|
files: {
|
|
68
69
|
cpuprofile: string
|
|
@@ -497,10 +498,20 @@ class AppImageSymbols {
|
|
|
497
498
|
private readonly dwarf: string | undefined,
|
|
498
499
|
) {}
|
|
499
500
|
|
|
501
|
+
get hasDsym(): boolean {
|
|
502
|
+
return this.dwarf !== undefined
|
|
503
|
+
}
|
|
504
|
+
|
|
500
505
|
// the executable is the image that owns main, so its compiled javascript resolves without a dSYM.
|
|
501
|
-
static load(
|
|
502
|
-
|
|
503
|
-
|
|
506
|
+
static load(
|
|
507
|
+
bundle: SourceMapBundle,
|
|
508
|
+
uuid: string,
|
|
509
|
+
frames: string[],
|
|
510
|
+
directories: string[],
|
|
511
|
+
warn: boolean,
|
|
512
|
+
): AppImageSymbols {
|
|
513
|
+
const dwarf = findDsymBinary([bundle.directory, ...directories], uuid)
|
|
514
|
+
if (!dwarf && warn)
|
|
504
515
|
console.error(`no dSYM found for ${uuid}; native app frames keep their offsets`)
|
|
505
516
|
const image = dwarf
|
|
506
517
|
? basename(dwarf)
|
|
@@ -576,23 +587,30 @@ class AppImageSymbols {
|
|
|
576
587
|
|
|
577
588
|
// the build keeps OneNativeSymbols-<uuid>.dSYM beside its source map; spotlight finds a dSYM
|
|
578
589
|
// that was moved or archived anywhere else.
|
|
579
|
-
function findDsymBinary(
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
590
|
+
function findDsymBinary(directories: string[], uuid: string): string | undefined {
|
|
591
|
+
if (process.platform !== 'darwin' || !profileUUID.test(uuid)) return
|
|
592
|
+
const bundles = (function* () {
|
|
593
|
+
for (const dir of new Set(directories.filter(Boolean))) {
|
|
594
|
+
yield join(dir, `OneNativeSymbols-${uuid}.dSYM`)
|
|
595
|
+
const archives = join(dir, 'dSYMs')
|
|
596
|
+
if (existsSync(archives))
|
|
597
|
+
for (const bundle of readdirSync(archives))
|
|
598
|
+
if (bundle.endsWith('.dSYM')) yield join(archives, bundle)
|
|
599
|
+
}
|
|
600
|
+
const indexed = spawnSync('mdfind', [`com_apple_xcode_dsym_uuids == '${uuid}'`], {
|
|
601
|
+
encoding: 'utf8',
|
|
602
|
+
})
|
|
603
|
+
yield* indexed.stdout?.split('\n').filter(Boolean) ?? []
|
|
604
|
+
})()
|
|
587
605
|
for (const bundle of bundles) {
|
|
588
606
|
const dwarfDirectory = join(bundle, 'Contents/Resources/DWARF')
|
|
589
607
|
if (!bundle || !existsSync(dwarfDirectory)) continue
|
|
590
608
|
for (const name of readdirSync(dwarfDirectory)) {
|
|
591
609
|
const binary = join(dwarfDirectory, name)
|
|
592
|
-
const uuids =
|
|
610
|
+
const uuids = spawnSync('xcrun', ['dwarfdump', '--uuid', binary], {
|
|
593
611
|
encoding: 'utf8',
|
|
594
|
-
})
|
|
595
|
-
if (uuids
|
|
612
|
+
}).stdout
|
|
613
|
+
if (uuids?.toUpperCase().includes(`UUID: ${uuid.toUpperCase()} (ARM64)`))
|
|
596
614
|
return binary
|
|
597
615
|
}
|
|
598
616
|
}
|
|
@@ -632,6 +650,7 @@ function nativeFrameLists(report: Record<string, unknown>) {
|
|
|
632
650
|
.join(' > ')
|
|
633
651
|
}
|
|
634
652
|
for (const row of stacks) {
|
|
653
|
+
if (!Array.isArray(row.nativeStack)) continue
|
|
635
654
|
row.stack = framesOf(row)
|
|
636
655
|
.reverse()
|
|
637
656
|
.map((frame) => {
|
|
@@ -648,16 +667,37 @@ function symbolicateNativeFrames(
|
|
|
648
667
|
reports: Record<string, unknown>[],
|
|
649
668
|
bundle: SourceMapBundle,
|
|
650
669
|
uuid: string,
|
|
670
|
+
directories: string[] = [],
|
|
671
|
+
warn = true,
|
|
651
672
|
) {
|
|
652
673
|
const lists = reports.map(nativeFrameLists)
|
|
653
674
|
const symbols = AppImageSymbols.load(
|
|
654
675
|
bundle,
|
|
655
676
|
uuid,
|
|
656
677
|
lists.flatMap((list) => list.frames),
|
|
678
|
+
directories,
|
|
679
|
+
warn,
|
|
657
680
|
)
|
|
658
681
|
for (const list of lists) for (const frame of list.frames) symbols.want(frame)
|
|
659
682
|
symbols.resolve()
|
|
660
683
|
for (const list of lists) list.rename(symbols)
|
|
684
|
+
return symbols.hasDsym
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
export const profileUUID = /^[a-f0-9]{8}(?:-[a-f0-9]{4}){3}-[a-f0-9]{12}$/i
|
|
688
|
+
|
|
689
|
+
export function symbolicateDiagnosticReports(
|
|
690
|
+
reports: NativeProfileReport[],
|
|
691
|
+
uuid: string,
|
|
692
|
+
sourceMaps: string | undefined,
|
|
693
|
+
directories: string[],
|
|
694
|
+
) {
|
|
695
|
+
const maps = loadSourceMapsBundle(sourceMaps, uuid)
|
|
696
|
+
const stacks = reports.map(({ worstStall, slowBridgeCalls }) => ({
|
|
697
|
+
worstStall,
|
|
698
|
+
slowBridgeCalls,
|
|
699
|
+
}))
|
|
700
|
+
return symbolicateNativeFrames(stacks, maps, uuid, directories, false)
|
|
661
701
|
}
|
|
662
702
|
|
|
663
703
|
function symbolicateTelemetry(input: string, mapsPath: string): string {
|
|
@@ -676,7 +716,7 @@ function symbolicateTelemetry(input: string, mapsPath: string): string {
|
|
|
676
716
|
const { executableUUID, topJsFunctions, topReactComponents } = snapshot
|
|
677
717
|
if (
|
|
678
718
|
typeof executableUUID !== 'string' ||
|
|
679
|
-
|
|
719
|
+
!profileUUID.test(executableUUID) ||
|
|
680
720
|
!Array.isArray(topJsFunctions) ||
|
|
681
721
|
!Array.isArray(topReactComponents)
|
|
682
722
|
)
|
|
@@ -718,6 +758,19 @@ function symbolicateTelemetry(input: string, mapsPath: string): string {
|
|
|
718
758
|
}
|
|
719
759
|
|
|
720
760
|
function detectSimulatorBundleId(udid: string): string {
|
|
761
|
+
const running = runningSimulatorApps(udid)
|
|
762
|
+
if (running.length === 1) return running[0]!
|
|
763
|
+
if (running.length > 1) {
|
|
764
|
+
throw new Error(
|
|
765
|
+
`Multiple user apps are running on simulator ${udid}: ${running.join(', ')}. Pass --bundle-id <id>.`,
|
|
766
|
+
)
|
|
767
|
+
}
|
|
768
|
+
throw new Error(
|
|
769
|
+
`No running user app found on simulator ${udid}. Launch your app or pass --bundle-id <id>.`,
|
|
770
|
+
)
|
|
771
|
+
}
|
|
772
|
+
|
|
773
|
+
export function runningSimulatorApps(udid: string): string[] {
|
|
721
774
|
const list = execFileSync('xcrun', ['simctl', 'spawn', udid, 'launchctl', 'list'], {
|
|
722
775
|
encoding: 'utf8',
|
|
723
776
|
})
|
|
@@ -728,15 +781,7 @@ function detectSimulatorBundleId(udid: string): string {
|
|
|
728
781
|
const id = match[2]!.trim()
|
|
729
782
|
if (!id.startsWith('com.apple.')) running.push(id)
|
|
730
783
|
}
|
|
731
|
-
|
|
732
|
-
if (running.length > 1) {
|
|
733
|
-
throw new Error(
|
|
734
|
-
`Multiple user apps are running on simulator ${udid}: ${running.join(', ')}. Pass --bundle-id <id>.`,
|
|
735
|
-
)
|
|
736
|
-
}
|
|
737
|
-
throw new Error(
|
|
738
|
-
`No running user app found on simulator ${udid}. Launch your app or pass --bundle-id <id>.`,
|
|
739
|
-
)
|
|
784
|
+
return running
|
|
740
785
|
}
|
|
741
786
|
|
|
742
787
|
function simContainer(udid: string, bundleId: string): string {
|
|
@@ -757,6 +802,32 @@ async function waitForFile(path: string, timeoutMs: number): Promise<string> {
|
|
|
757
802
|
throw new Error(`Timed out after ${timeoutMs}ms waiting for profiler result at ${path}`)
|
|
758
803
|
}
|
|
759
804
|
|
|
805
|
+
export async function requestSimulatorProfile(
|
|
806
|
+
udid: string,
|
|
807
|
+
bundleId: string,
|
|
808
|
+
payload: { id: string; action: string } & Record<string, unknown>,
|
|
809
|
+
timeoutMs: number,
|
|
810
|
+
): Promise<string> {
|
|
811
|
+
const profilerDir = join(
|
|
812
|
+
simContainer(udid, bundleId),
|
|
813
|
+
'Library/Application Support/OneProfiler',
|
|
814
|
+
)
|
|
815
|
+
mkdirSync(profilerDir, { recursive: true })
|
|
816
|
+
const resultFile = join(profilerDir, `result-${payload.id}.json`)
|
|
817
|
+
writeFileSync(join(profilerDir, 'command.json'), JSON.stringify(payload))
|
|
818
|
+
try {
|
|
819
|
+
execFileSync('xcrun', [
|
|
820
|
+
'simctl',
|
|
821
|
+
'notify_post',
|
|
822
|
+
udid,
|
|
823
|
+
`dev.one.profiler.command.${bundleId}`,
|
|
824
|
+
])
|
|
825
|
+
return await waitForFile(resultFile, timeoutMs)
|
|
826
|
+
} finally {
|
|
827
|
+
rmSync(resultFile, { force: true })
|
|
828
|
+
}
|
|
829
|
+
}
|
|
830
|
+
|
|
760
831
|
function formatLocation(url: string, line: number): string {
|
|
761
832
|
if (!url) return ''
|
|
762
833
|
const parts = url.split('/')
|
|
@@ -851,6 +922,17 @@ function printSummary(
|
|
|
851
922
|
for (const line of leafFrames(call)) console.log(line)
|
|
852
923
|
}
|
|
853
924
|
}
|
|
925
|
+
if (report.budget) {
|
|
926
|
+
const state = (name: string, value: unknown) => {
|
|
927
|
+
const row = isRecord(value) ? value : {}
|
|
928
|
+
return ` ${name} ${asNum(row.seconds).toFixed(1)} s: ${asNum(row.busyMsPerSec).toFixed(1)} ms/s busy, ${asNum(row.droppedFrames)} dropped, ${asNum(row.commitsPerSec).toFixed(1)} commits/s`
|
|
929
|
+
}
|
|
930
|
+
console.log('\nIdle vs interaction:')
|
|
931
|
+
console.log(state('Idle', report.budget.idle))
|
|
932
|
+
console.log(state('Interaction', report.budget.interaction))
|
|
933
|
+
for (const alarm of records(report.budget.alarms))
|
|
934
|
+
console.log(` ${asStr(alarm.title)}: ${asStr(alarm.detail)}`)
|
|
935
|
+
}
|
|
854
936
|
|
|
855
937
|
printSpanGroups(groupSpans(report.spans, filter))
|
|
856
938
|
|
|
@@ -970,23 +1052,23 @@ options:
|
|
|
970
1052
|
`)
|
|
971
1053
|
}
|
|
972
1054
|
|
|
973
|
-
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
1055
|
+
export function isRecord(value: unknown): value is Record<string, unknown> {
|
|
974
1056
|
return Boolean(value) && typeof value === 'object' && !Array.isArray(value)
|
|
975
1057
|
}
|
|
976
1058
|
|
|
977
|
-
function asNum(value: unknown): number {
|
|
1059
|
+
export function asNum(value: unknown): number {
|
|
978
1060
|
return typeof value === 'number' && Number.isFinite(value) ? value : 0
|
|
979
1061
|
}
|
|
980
1062
|
|
|
981
|
-
function asStr(value: unknown): string {
|
|
1063
|
+
export function asStr(value: unknown): string {
|
|
982
1064
|
return typeof value === 'string' ? value : ''
|
|
983
1065
|
}
|
|
984
1066
|
|
|
985
|
-
function records(value: unknown): Record<string, unknown>[] {
|
|
1067
|
+
export function records(value: unknown): Record<string, unknown>[] {
|
|
986
1068
|
return Array.isArray(value) ? value.filter(isRecord) : []
|
|
987
1069
|
}
|
|
988
1070
|
|
|
989
|
-
function parseNativeReport(value: unknown): NativeProfileReport | undefined {
|
|
1071
|
+
export function parseNativeReport(value: unknown): NativeProfileReport | undefined {
|
|
990
1072
|
if (!isRecord(value)) return undefined
|
|
991
1073
|
const phasesRaw = isRecord(value.phases) ? value.phases : {}
|
|
992
1074
|
const phases: Record<string, number> = {}
|
|
@@ -1049,6 +1131,7 @@ function parseNativeReport(value: unknown): NativeProfileReport | undefined {
|
|
|
1049
1131
|
worstStall: isRecord(value.worstStall) ? value.worstStall : null,
|
|
1050
1132
|
slowBridgeCalls: records(value.slowBridgeCalls),
|
|
1051
1133
|
slowBridgeTotal: asNum(value.slowBridgeTotal),
|
|
1134
|
+
budget: isRecord(value.budget) ? value.budget : null,
|
|
1052
1135
|
spans: records(value.spans),
|
|
1053
1136
|
files: {
|
|
1054
1137
|
cpuprofile: asStr(files.cpuprofile),
|
|
@@ -1058,7 +1141,7 @@ function parseNativeReport(value: unknown): NativeProfileReport | undefined {
|
|
|
1058
1141
|
}
|
|
1059
1142
|
}
|
|
1060
1143
|
|
|
1061
|
-
function parseReportEnvelope(raw: string): {
|
|
1144
|
+
export function parseReportEnvelope(raw: string): {
|
|
1062
1145
|
ok: boolean
|
|
1063
1146
|
error?: string
|
|
1064
1147
|
report?: NativeProfileReport
|
|
@@ -1236,14 +1319,6 @@ export async function runPerfNative(args: string[]): Promise<number> {
|
|
|
1236
1319
|
|
|
1237
1320
|
const udid = values.udid
|
|
1238
1321
|
const bundleId = values['bundle-id'] ?? detectSimulatorBundleId(udid)
|
|
1239
|
-
const container = simContainer(udid, bundleId)
|
|
1240
|
-
const profilerDir = join(container, 'Library/Application Support/OneProfiler')
|
|
1241
|
-
mkdirSync(profilerDir, { recursive: true })
|
|
1242
|
-
|
|
1243
|
-
const commandFile = join(profilerDir, 'command.json')
|
|
1244
|
-
const resultFile = join(profilerDir, `result-${commandId}.json`)
|
|
1245
|
-
rmSync(resultFile, { force: true })
|
|
1246
|
-
|
|
1247
1322
|
const action = values.overlay
|
|
1248
1323
|
? 'overlay'
|
|
1249
1324
|
: values.start
|
|
@@ -1251,7 +1326,10 @@ export async function runPerfNative(args: string[]): Promise<number> {
|
|
|
1251
1326
|
: values.stop
|
|
1252
1327
|
? 'stop'
|
|
1253
1328
|
: 'capture'
|
|
1254
|
-
const payload: Record<string, unknown> = {
|
|
1329
|
+
const payload: { id: string; action: string } & Record<string, unknown> = {
|
|
1330
|
+
id: commandId,
|
|
1331
|
+
action,
|
|
1332
|
+
}
|
|
1255
1333
|
if (action === 'overlay') {
|
|
1256
1334
|
if (values.overlay === 'on' || values.overlay === '1' || values.overlay === 'true') {
|
|
1257
1335
|
payload.visible = true
|
|
@@ -1273,18 +1351,9 @@ export async function runPerfNative(args: string[]): Promise<number> {
|
|
|
1273
1351
|
if (values.interactions && (action === 'capture' || action === 'start'))
|
|
1274
1352
|
payload.interactions = values.interactions
|
|
1275
1353
|
|
|
1276
|
-
writeFileSync(commandFile, JSON.stringify(payload))
|
|
1277
|
-
execFileSync('xcrun', [
|
|
1278
|
-
'simctl',
|
|
1279
|
-
'notify_post',
|
|
1280
|
-
udid,
|
|
1281
|
-
`dev.one.profiler.command.${bundleId}`,
|
|
1282
|
-
])
|
|
1283
|
-
|
|
1284
1354
|
const timeoutMs =
|
|
1285
1355
|
action === 'capture' ? Math.round(durationSec * 1000) + 15_000 : 10_000
|
|
1286
|
-
const rawResult = await
|
|
1287
|
-
rmSync(resultFile, { force: true })
|
|
1356
|
+
const rawResult = await requestSimulatorProfile(udid, bundleId, payload, timeoutMs)
|
|
1288
1357
|
|
|
1289
1358
|
if (action === 'overlay' || action === 'start') {
|
|
1290
1359
|
if (values.json) console.log(rawResult)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
package/dist-lib/beta.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
2
|
-
import "./esm-chunks/chunk-
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
|
+
import "./esm-chunks/chunk-WC43FELF.mjs";
|
|
3
3
|
|
|
4
4
|
// src/beta.ts
|
|
5
5
|
var IS_BETA = true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
BridgeInputError,
|
|
4
4
|
SEMANTIC_WAIT_MAX_TIMEOUT_MS,
|
|
@@ -17,10 +17,10 @@ import {
|
|
|
17
17
|
parseSemanticWaitOptions,
|
|
18
18
|
parseStateOptions,
|
|
19
19
|
parseTapTarget
|
|
20
|
-
} from "./esm-chunks/chunk-
|
|
21
|
-
import "./esm-chunks/chunk-
|
|
22
|
-
import "./esm-chunks/chunk-
|
|
23
|
-
import "./esm-chunks/chunk-
|
|
20
|
+
} from "./esm-chunks/chunk-7ASIV44B.mjs";
|
|
21
|
+
import "./esm-chunks/chunk-YPBNNV6N.mjs";
|
|
22
|
+
import "./esm-chunks/chunk-BFQUJ4RC.mjs";
|
|
23
|
+
import "./esm-chunks/chunk-WC43FELF.mjs";
|
|
24
24
|
export {
|
|
25
25
|
BridgeInputError,
|
|
26
26
|
SEMANTIC_WAIT_MAX_TIMEOUT_MS,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2626 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
HEADLESS_TENANT_FETCH_HUNG_MARKER,
|
|
4
4
|
REFUSED_PERFORM_STEP_TYPES,
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
readyProbeHasContent,
|
|
14
14
|
readyProbeIsReady,
|
|
15
15
|
refusedPerformStepReason
|
|
16
|
-
} from "./esm-chunks/chunk-
|
|
17
|
-
import "./esm-chunks/chunk-
|
|
16
|
+
} from "./esm-chunks/chunk-YPBNNV6N.mjs";
|
|
17
|
+
import "./esm-chunks/chunk-WC43FELF.mjs";
|
|
18
18
|
export {
|
|
19
19
|
HEADLESS_TENANT_FETCH_HUNG_MARKER,
|
|
20
20
|
REFUSED_PERFORM_STEP_TYPES,
|