peachsim 0.1.2035 → 0.1.2037
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/cloud-test-tunnel.ts +43 -6
- package/cli/commands/inspect/get-node.ts +1 -1
- package/cli/outbound-endpoints.ts +4 -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 +4626 -4189
- 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 +15 -7
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +8741 -4085
- package/dist-lib/expo-swift-metadata.cjs +2 -2
- package/dist-lib/expo-swift-metadata.mjs +2 -2
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +4639 -4468
- package/dist-lib/host/fetch-proxy-handler.cjs +5119 -274
- 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 +17104 -16999
- 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 +12730 -12621
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- 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/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.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 -24
- package/dist-lib/public-origins-lib.json +615 -211
- 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 +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +5291 -5096
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +1 -1
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2 -2
- package/dist-lib/vite.cjs +5159 -342
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/app-catalog-wire.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/bundle-channel.mjs +35 -1
- package/src/expo-autolinking.ts +36 -13
- package/src/expo-discovery-cache.ts +1 -0
- package/src/expo-native-workspace.ts +10 -9
- package/src/expo-pod-prebuilt.ts +122 -0
- package/src/expo-swift-host.ts +267 -121
- package/src/expo-swift-ready.ts +11 -5
- package/src/expoSwiftContract.ts +3 -1
- package/src/host/dev-server-package-versions.ts +20 -4
- package/src/native-failure-output.ts +34 -0
- package/src/native-firebase-config.ts +28 -10
- package/src/native-prebuilt.ts +3 -3
- package/src/nitro-adapter.lock.json +261 -261
- package/src/nitro-superset.lock.json +4 -4
- package/src/swift-distribution.lock.json +8 -8
- package/src/turbo-compile.ts +3 -3
- package/src/turbo-runtime.lock.json +17 -17
- package/src/turbo-source.ts +45 -32
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import fs from 'node:fs'
|
|
2
|
+
import path from 'node:path'
|
|
3
|
+
import { cacheDir } from './home-paths'
|
|
4
|
+
|
|
5
|
+
// callers show only the tail of a failure message, and a bundler's own
|
|
6
|
+
// diagnostic sits before the stack that ends the output, so the whole output is
|
|
7
|
+
// kept in a file the message names on its last line. a save that fails must not
|
|
8
|
+
// replace the command's own failure, so the line then names why it was not kept.
|
|
9
|
+
export const FAILED_OUTPUT_MARKER = '[peach] full output of the failed command: '
|
|
10
|
+
const FAILED_OUTPUT_KEPT_MS = 7 * 24 * 3_600_000
|
|
11
|
+
|
|
12
|
+
function saveFailedOutput(command: string, cwd: string, output: Buffer) {
|
|
13
|
+
const directory = path.join(cacheDir(), 'native-prepare-failures')
|
|
14
|
+
fs.mkdirSync(directory, { recursive: true })
|
|
15
|
+
for (const name of fs.readdirSync(directory)) {
|
|
16
|
+
const old = path.join(directory, name)
|
|
17
|
+
if (Date.now() - fs.statSync(old).mtimeMs > FAILED_OUTPUT_KEPT_MS)
|
|
18
|
+
fs.rmSync(old, { force: true })
|
|
19
|
+
}
|
|
20
|
+
const file = path.join(
|
|
21
|
+
directory,
|
|
22
|
+
`${new Date().toISOString().replaceAll(/[:.]/g, '-')}-${process.pid}-${path.basename(command)}.log`,
|
|
23
|
+
)
|
|
24
|
+
fs.writeFileSync(file, `cwd: ${cwd}\n${output.toString('utf8')}`)
|
|
25
|
+
return file
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function failedOutputLine(command: string, cwd: string, output: Buffer) {
|
|
29
|
+
try {
|
|
30
|
+
return `${FAILED_OUTPUT_MARKER}${saveFailedOutput(command, cwd, output)}`
|
|
31
|
+
} catch (error) {
|
|
32
|
+
return `${FAILED_OUTPUT_MARKER}(not saved: ${error instanceof Error ? error.message : String(error)})`
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -71,9 +71,25 @@ function expoConfigArgs(projectRoot: string, resultPath: string) {
|
|
|
71
71
|
]
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
const EXPO_CONFIG_TIMEOUT_MS = 30_000
|
|
75
|
+
|
|
76
|
+
function readExpoConfigResult(
|
|
77
|
+
resultPath: string,
|
|
78
|
+
status: number | null,
|
|
79
|
+
signal: NodeJS.Signals | null,
|
|
80
|
+
stderr: string,
|
|
81
|
+
) {
|
|
82
|
+
if (signal === 'SIGTERM')
|
|
83
|
+
throw new Error(
|
|
84
|
+
`Expo native configuration evaluation did not finish within ${EXPO_CONFIG_TIMEOUT_MS / 1000}s.`,
|
|
85
|
+
)
|
|
75
86
|
if (status !== 0)
|
|
76
|
-
throw new Error(
|
|
87
|
+
throw new Error(
|
|
88
|
+
stderr ||
|
|
89
|
+
(signal
|
|
90
|
+
? `Expo native configuration evaluation was killed by ${signal}.`
|
|
91
|
+
: 'Expo native configuration evaluation failed.'),
|
|
92
|
+
)
|
|
77
93
|
const resolved: unknown = JSON.parse(fs.readFileSync(resultPath, 'utf8'))
|
|
78
94
|
if (!isRecord(resolved)) throw new Error('Expo native configuration is unavailable.')
|
|
79
95
|
return resolved
|
|
@@ -90,11 +106,11 @@ function readExpoConfig(projectRoot: string): Record<string, unknown> {
|
|
|
90
106
|
cwd: projectRoot,
|
|
91
107
|
encoding: 'utf8',
|
|
92
108
|
stdio: ['ignore', 'ignore', 'pipe'],
|
|
93
|
-
timeout:
|
|
109
|
+
timeout: EXPO_CONFIG_TIMEOUT_MS,
|
|
94
110
|
maxBuffer: 1024 * 1024,
|
|
95
111
|
})
|
|
96
112
|
if (child.error) throw child.error
|
|
97
|
-
return readExpoConfigResult(resultPath, child.status, child.stderr)
|
|
113
|
+
return readExpoConfigResult(resultPath, child.status, child.signal, child.stderr)
|
|
98
114
|
} finally {
|
|
99
115
|
fs.rmSync(directory, { recursive: true, force: true })
|
|
100
116
|
}
|
|
@@ -112,18 +128,20 @@ export async function readExpoConfigAsync(
|
|
|
112
128
|
const child = spawn('node', expoConfigArgs(projectRoot, resultPath), {
|
|
113
129
|
cwd: projectRoot,
|
|
114
130
|
stdio: ['ignore', 'ignore', 'pipe'],
|
|
115
|
-
timeout:
|
|
131
|
+
timeout: EXPO_CONFIG_TIMEOUT_MS,
|
|
116
132
|
})
|
|
117
133
|
let stderr = ''
|
|
118
134
|
child.stderr.setEncoding('utf8')
|
|
119
135
|
child.stderr.on('data', (chunk: string) => {
|
|
120
136
|
stderr += chunk
|
|
121
137
|
})
|
|
122
|
-
const status = await new Promise<number | null
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
138
|
+
const [status, signal] = await new Promise<[number | null, NodeJS.Signals | null]>(
|
|
139
|
+
(resolve, reject) => {
|
|
140
|
+
child.once('error', reject)
|
|
141
|
+
child.once('close', (code, closeSignal) => resolve([code, closeSignal]))
|
|
142
|
+
},
|
|
143
|
+
)
|
|
144
|
+
return readExpoConfigResult(resultPath, status, signal, stderr)
|
|
127
145
|
} finally {
|
|
128
146
|
fs.rmSync(directory, { recursive: true, force: true })
|
|
129
147
|
}
|
package/src/native-prebuilt.ts
CHANGED
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
//
|
|
8
8
|
// <kind> is `rust` for the build cache, `slice` for a hand-ported library's
|
|
9
9
|
// wasm slice, `turbo` for an app's compiled C++ TurboModule executable, `nitro`
|
|
10
|
-
// for the shared Nitro executable
|
|
11
|
-
// build; <key> is a digest of everything the bytes depend on, so an entry can
|
|
10
|
+
// for the shared Nitro executable, `expo` for a standard Expo app's native
|
|
11
|
+
// build and `expo-pod` for one installed Expo module package's compiled Swift; <key> is a digest of everything the bytes depend on, so an entry can
|
|
12
12
|
// never serve different inputs. only CI publishers hold the bucket credentials
|
|
13
13
|
// (scripts/ops/native-prebuilt-publish.ts, nitro-superset.ts,
|
|
14
14
|
// expo-native-prebuilt.ts); a host only reads.
|
|
@@ -21,7 +21,7 @@ import { isRecord } from './is-record'
|
|
|
21
21
|
|
|
22
22
|
export const NATIVE_PREBUILT_ORIGIN = 'https://r2.rnxsim.com'
|
|
23
23
|
|
|
24
|
-
export type NativeEntryKind = 'expo' | 'nitro' | 'rust' | 'slice' | 'turbo'
|
|
24
|
+
export type NativeEntryKind = 'expo' | 'expo-pod' | 'nitro' | 'rust' | 'slice' | 'turbo'
|
|
25
25
|
|
|
26
26
|
export interface NativeEntryFile {
|
|
27
27
|
path: string
|