peachsim 0.1.2701 → 0.1.2702
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/package.ts +5 -5
- package/cli/package-duo-device.ts +24 -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 +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 +105 -8
- 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-XYDEAJWX.mjs → acorn-I3ZAV2HM.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-KXQ6YPZJ.mjs → chunk-3TVOPWQ4.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JAQLYGVS.mjs → chunk-4W62JNLV.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-43X64A24.mjs → chunk-55UUHJIF.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NFVR346F.mjs → chunk-6Z2YJFQH.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-CMBYCFEF.mjs → chunk-74IQS3IW.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5FIKQ7F4.mjs → chunk-7CNNZXLN.mjs} +116 -16
- package/dist-lib/esm-chunks/{chunk-JYSDQDL2.mjs → chunk-7ZXSFDJI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KGCR7O7F.mjs → chunk-AASQZJJD.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OGJEDE5E.mjs → chunk-B2AJ3NG3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BGLOJMLA.mjs → chunk-C4ANQZOL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2GFDQ2RY.mjs → chunk-CTMG6TJS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-DDGDFU4G.mjs → chunk-DUBZMBNO.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-DLRANZB6.mjs → chunk-GY7TSHXT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-OPTGHXWZ.mjs → chunk-K6PYAFA7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-A5WFZ2XX.mjs → chunk-OOGBJF7A.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-LGFEIKDM.mjs → chunk-OS4FVQQU.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-EBM3VDWK.mjs → chunk-P5TRIEZT.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SSR5S6R3.mjs → chunk-PNFDFXED.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-WWK6GMXB.mjs → chunk-PYE2SXBC.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-FW52XLFO.mjs → chunk-RRRO6O3P.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YLVJRH27.mjs → chunk-SR5CKA77.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-STBRFFEL.mjs → chunk-W336OLQN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-Q5DBRTKN.mjs → chunk-ZSMI2FCL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-W6TXFCRI.mjs → chunk-ZYLZ676Y.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-NP3MSVX4.mjs → metro-layout-parser-FRE6D3WN.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-SVIMOFLA.mjs → swift-package-prebuilt-ZO6ZIEND.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-A6YJ4KNJ.mjs → swift-sdk-app-module-2CJZ7QH4.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-UYJ3VFF6.mjs → swift-sdk-image-RDVAVED4.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-7EWPBKNW.mjs → swift-sdk-image-producer-HDUM3MGT.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +105 -8
- 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 +105 -8
- package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
- 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 +1 -1
- 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 +85 -85
- package/dist-lib/public-origins-lib.json +64 -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 +105 -8
- package/dist-lib/swift-compile.cjs +99 -2
- 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/package.json +1 -1
- package/src/swift-compile.ts +129 -5
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2702 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
parse
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-PNFDFXED.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__privateAdd,
|
|
7
7
|
__privateGet,
|
|
8
8
|
__publicField
|
|
9
|
-
} from "./esm-chunks/chunk-
|
|
9
|
+
} from "./esm-chunks/chunk-P5TRIEZT.mjs";
|
|
10
10
|
|
|
11
11
|
// src/worklet-kernel.ts
|
|
12
12
|
var Unsupported = class extends Error {
|
package/package.json
CHANGED
package/src/swift-compile.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
spawn,
|
|
3
|
+
spawnSync,
|
|
4
|
+
type ExecFileOptions,
|
|
5
|
+
type SpawnOptions,
|
|
6
|
+
} from 'node:child_process'
|
|
2
7
|
import { createHash, randomUUID } from 'node:crypto'
|
|
3
8
|
import {
|
|
4
9
|
chmodSync,
|
|
@@ -6373,6 +6378,109 @@ function readFrameworkProductsReceipt(
|
|
|
6373
6378
|
}
|
|
6374
6379
|
}
|
|
6375
6380
|
|
|
6381
|
+
function resolveBunBinary(): string | null {
|
|
6382
|
+
if (path.basename(process.execPath).startsWith('bun')) return process.execPath
|
|
6383
|
+
for (const candidate of [
|
|
6384
|
+
path.join(os.homedir(), 'builders/bun/bin/bun'),
|
|
6385
|
+
path.join(os.homedir(), '.bun/bin/bun'),
|
|
6386
|
+
'/opt/homebrew/bin/bun',
|
|
6387
|
+
'/usr/local/bin/bun',
|
|
6388
|
+
'bun',
|
|
6389
|
+
]) {
|
|
6390
|
+
const probe = spawnSync(candidate, ['--version'], { stdio: 'ignore' })
|
|
6391
|
+
if (probe.status === 0) return candidate
|
|
6392
|
+
}
|
|
6393
|
+
return null
|
|
6394
|
+
}
|
|
6395
|
+
|
|
6396
|
+
function frameworkHeaderContext(moduleRoot: string, products: readonly string[]): string {
|
|
6397
|
+
const sources = path.join(moduleRoot, 'Sources')
|
|
6398
|
+
const files: string[] = []
|
|
6399
|
+
if (existsSync(sources)) {
|
|
6400
|
+
for (const entry of readdirSync(sources, { recursive: true, withFileTypes: true })) {
|
|
6401
|
+
if (!entry.isFile()) continue
|
|
6402
|
+
const rel = path.relative(sources, path.join(entry.parentPath, entry.name))
|
|
6403
|
+
if (/\.(?:h|hh|hpp|hxx|inc|def|modulemap|apinotes)$/.test(rel)) files.push(rel)
|
|
6404
|
+
}
|
|
6405
|
+
}
|
|
6406
|
+
return createHash('sha256')
|
|
6407
|
+
.update(JSON.stringify([[...products].sort(), files.sort()]))
|
|
6408
|
+
.digest('hex')
|
|
6409
|
+
}
|
|
6410
|
+
|
|
6411
|
+
function shellQuote(value: string): string {
|
|
6412
|
+
return `'${value.replaceAll("'", "'\\''")}'`
|
|
6413
|
+
}
|
|
6414
|
+
|
|
6415
|
+
function prepareFrameworkCompileCache(
|
|
6416
|
+
scratch: string,
|
|
6417
|
+
moduleRoot: string,
|
|
6418
|
+
toolchainBin: string,
|
|
6419
|
+
sdkOptions: string[],
|
|
6420
|
+
products: readonly string[],
|
|
6421
|
+
): { wrapper: string; statsFile: string } | null {
|
|
6422
|
+
const launcher = path.join(moduleRoot, 'scripts/build-cache-launcher.ts')
|
|
6423
|
+
if (!existsSync(launcher)) return null
|
|
6424
|
+
const bunBin = resolveBunBinary()
|
|
6425
|
+
if (!bunBin) return null
|
|
6426
|
+
const cacheRoot = path.join(swiftCacheDir(), 'swift-distribution-compile-cache')
|
|
6427
|
+
mkdirSync(cacheRoot, { recursive: true })
|
|
6428
|
+
const wrapperDir = path.join(scratch, 'launch')
|
|
6429
|
+
mkdirSync(wrapperDir, { recursive: true })
|
|
6430
|
+
const wrapper = path.join(wrapperDir, 'swift-frontend')
|
|
6431
|
+
const statsFile = path.join(scratch, `compile-cache-stats-${process.pid}.jsonl`)
|
|
6432
|
+
rmSync(statsFile, { force: true })
|
|
6433
|
+
const sdkFlagIndex = sdkOptions.indexOf('--swift-sdks-path')
|
|
6434
|
+
const sdkViewDir =
|
|
6435
|
+
sdkFlagIndex >= 0 && sdkFlagIndex + 1 < sdkOptions.length
|
|
6436
|
+
? sdkOptions[sdkFlagIndex + 1]
|
|
6437
|
+
: undefined
|
|
6438
|
+
const pathMapEntries: [string, string][] = [['$SLOT_ROOT', scratch]]
|
|
6439
|
+
if (sdkViewDir) pathMapEntries.push(['$SDK_VIEW', sdkViewDir])
|
|
6440
|
+
const pathMap = JSON.stringify(pathMapEntries)
|
|
6441
|
+
const context = frameworkHeaderContext(moduleRoot, products)
|
|
6442
|
+
const script = [
|
|
6443
|
+
'#!/bin/sh',
|
|
6444
|
+
`export SWIFT_SDK_COMPILE_CACHE=${shellQuote(cacheRoot)}`,
|
|
6445
|
+
'export SWIFT_SDK_COMPILE_CACHE_REUSE=1',
|
|
6446
|
+
`export SWIFT_SDK_COMPILE_CACHE_PATH_MAP=${shellQuote(pathMap)}`,
|
|
6447
|
+
`export SWIFT_SDK_COMPILE_CACHE_CONTEXT=${shellQuote(context)}`,
|
|
6448
|
+
`export SWIFT_SDK_COMPILE_CACHE_STATS=${shellQuote(statsFile)}`,
|
|
6449
|
+
`exec ${shellQuote(bunBin)} ${shellQuote(launcher)} ${shellQuote(path.join(toolchainBin, 'swift-frontend'))} "$@"`,
|
|
6450
|
+
'',
|
|
6451
|
+
].join('\n')
|
|
6452
|
+
const partial = `${wrapper}.${process.pid}.${randomUUID()}.partial`
|
|
6453
|
+
writeFileSync(partial, script, { mode: 0o755 })
|
|
6454
|
+
chmodSync(partial, 0o755)
|
|
6455
|
+
renameSync(partial, wrapper)
|
|
6456
|
+
return { wrapper, statsFile }
|
|
6457
|
+
}
|
|
6458
|
+
|
|
6459
|
+
function reportFrameworkCompileCacheStats(scratch: string, statsFile: string): void {
|
|
6460
|
+
if (!existsSync(statsFile)) return
|
|
6461
|
+
let hits = 0
|
|
6462
|
+
let misses = 0
|
|
6463
|
+
let savedMs = 0
|
|
6464
|
+
try {
|
|
6465
|
+
for (const line of readFileSync(statsFile, 'utf8').split('\n').filter(Boolean)) {
|
|
6466
|
+
const entry: { hits?: number; misses?: number; savedMs?: number } = JSON.parse(line)
|
|
6467
|
+
hits += entry.hits ?? 0
|
|
6468
|
+
misses += entry.misses ?? 0
|
|
6469
|
+
savedMs += entry.savedMs ?? 0
|
|
6470
|
+
}
|
|
6471
|
+
} catch (error) {
|
|
6472
|
+
if (error instanceof SyntaxError) return
|
|
6473
|
+
throw error
|
|
6474
|
+
} finally {
|
|
6475
|
+
rmSync(statsFile, { force: true })
|
|
6476
|
+
}
|
|
6477
|
+
if (hits > 0 || misses > 0) {
|
|
6478
|
+
console.error(
|
|
6479
|
+
`[swift-framework-compile-cache] ${path.basename(scratch)} hits=${hits} misses=${misses} saved=${(savedMs / 1000).toFixed(1)}s`,
|
|
6480
|
+
)
|
|
6481
|
+
}
|
|
6482
|
+
}
|
|
6483
|
+
|
|
6376
6484
|
async function buildFrameworkProducts(
|
|
6377
6485
|
scratch: string,
|
|
6378
6486
|
args: FrameworkBuildArgs,
|
|
@@ -6411,6 +6519,15 @@ async function buildFrameworkProducts(
|
|
|
6411
6519
|
// keep cores available for the batch frontends inside large framework targets.
|
|
6412
6520
|
const targetJobs = jobs >= 4 ? 2 : 1
|
|
6413
6521
|
const driverJobs = Math.max(1, Math.floor(jobs / targetJobs))
|
|
6522
|
+
const cache = unoptimized
|
|
6523
|
+
? null
|
|
6524
|
+
: prepareFrameworkCompileCache(
|
|
6525
|
+
scratch,
|
|
6526
|
+
args.moduleRoot,
|
|
6527
|
+
args.toolchainBin,
|
|
6528
|
+
sdkOptions,
|
|
6529
|
+
linkedTargets.products,
|
|
6530
|
+
)
|
|
6414
6531
|
await runCompiler(
|
|
6415
6532
|
args.swift,
|
|
6416
6533
|
[
|
|
@@ -6432,6 +6549,9 @@ async function buildFrameworkProducts(
|
|
|
6432
6549
|
args.sdk,
|
|
6433
6550
|
'-c',
|
|
6434
6551
|
'release',
|
|
6552
|
+
...(cache
|
|
6553
|
+
? ['-Xswiftc', '-driver-use-frontend-path', '-Xswiftc', cache.wrapper]
|
|
6554
|
+
: []),
|
|
6435
6555
|
'-Xswiftc',
|
|
6436
6556
|
unoptimized ? '-Onone' : '-Osize',
|
|
6437
6557
|
'-Xswiftc',
|
|
@@ -6485,10 +6605,14 @@ async function buildFrameworkProducts(
|
|
|
6485
6605
|
},
|
|
6486
6606
|
SWIFTPM_PROGRESS,
|
|
6487
6607
|
SWIFTPM_NOISE,
|
|
6488
|
-
)
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6608
|
+
)
|
|
6609
|
+
.catch((error: unknown) => {
|
|
6610
|
+
// the compiler's diagnostics ride on the error's streams, not its message
|
|
6611
|
+
throw new Error(outputOf(error), { cause: error })
|
|
6612
|
+
})
|
|
6613
|
+
.finally(() => {
|
|
6614
|
+
if (cache) reportFrameworkCompileCacheStats(scratch, cache.statsFile)
|
|
6615
|
+
})
|
|
6492
6616
|
const release = path.join(scratch, WASM_TRIPLE, 'release')
|
|
6493
6617
|
const linked = frameworkLinkClosure(scratch, linkedTargets.targets)
|
|
6494
6618
|
const objects = linked.objects
|