peachsim 0.1.2390 → 0.1.2392
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/canvas.ts +92 -22
- 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 +47 -31
- 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 +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +46 -30
- 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 +47 -31
- package/dist-lib/host/fetch-proxy-handler.cjs +7 -5
- 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 +10 -7
- 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 +10 -7
- package/dist-lib/native-app-identity-project.cjs +5 -4
- package/dist-lib/native-app-identity-project.mjs +5 -4
- 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 +53 -53
- 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 +52 -31
- 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 +44 -28
- package/dist-lib/vite.cjs +7 -5
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/metalDirectContract.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +15 -6
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +1 -6
- package/kotlin/sdk.tar.gz +0 -0
- package/node-runtime.json +1 -1
- package/package.json +1 -1
- package/src/swift-host.ts +5 -5
- package/src/swift-shipped-binaries.ts +17 -6
- package/src/swift-standins.ts +39 -23
- package/src/xcode-project.ts +4 -2
package/package.json
CHANGED
package/src/swift-host.ts
CHANGED
|
@@ -97,7 +97,7 @@ import { readSwiftStandinBehavior } from './swift-standin-config'
|
|
|
97
97
|
import {
|
|
98
98
|
standinGenerationInputs,
|
|
99
99
|
standinLibrary,
|
|
100
|
-
|
|
100
|
+
standinDependencies,
|
|
101
101
|
swiftStandins,
|
|
102
102
|
type SwiftStandin,
|
|
103
103
|
type SwiftStandins,
|
|
@@ -681,6 +681,7 @@ async function swiftPackages(
|
|
|
681
681
|
binary.publicHeaders === undefined || binary.unloweredSources !== undefined
|
|
682
682
|
const artifacts = reached.filter(standinArtifact)
|
|
683
683
|
if (entry.moduleRoot && entry.provided && artifacts.length > 0) {
|
|
684
|
+
const { provided } = entry
|
|
684
685
|
const resolved = swiftModuleToolchain(entry.moduleRoot)
|
|
685
686
|
const toolchain = {
|
|
686
687
|
moduleRoot: entry.moduleRoot,
|
|
@@ -705,10 +706,9 @@ async function swiftPackages(
|
|
|
705
706
|
const cxxArtifacts = reached.filter(
|
|
706
707
|
(binary) => standinArtifact(binary) && !portableAssembly.has(binary.target),
|
|
707
708
|
)
|
|
708
|
-
// a source module an artifact imports builds with its stand-ins and never stands in
|
|
709
709
|
const standinInputs = [
|
|
710
710
|
...cxxArtifacts,
|
|
711
|
-
...
|
|
711
|
+
...standinDependencies(cxxArtifacts, cached.packages, provided),
|
|
712
712
|
]
|
|
713
713
|
const generation = standinGenerationInputs(standinInputs, toolchain, entry.behavior)
|
|
714
714
|
if (cached.standinKey !== generation) {
|
|
@@ -721,7 +721,7 @@ async function swiftPackages(
|
|
|
721
721
|
const built = await swiftStandins(
|
|
722
722
|
standinInputs,
|
|
723
723
|
toolchain,
|
|
724
|
-
new Set([...
|
|
724
|
+
new Set([...provided].filter((name) => !replaced.has(name))),
|
|
725
725
|
entry.behavior,
|
|
726
726
|
)
|
|
727
727
|
cached.packages = await resolveSwiftPackagesAsync({
|
|
@@ -732,7 +732,7 @@ async function swiftPackages(
|
|
|
732
732
|
// an artifact with neither a stand-in nor a gap ships only modules
|
|
733
733
|
// peach provides, so a wrapper target that groups it still compiles
|
|
734
734
|
provided: new Set([
|
|
735
|
-
...
|
|
735
|
+
...provided,
|
|
736
736
|
...cxxArtifacts
|
|
737
737
|
.map((binary) => binary.target)
|
|
738
738
|
.filter((target) => !built.gaps.has(target)),
|
|
@@ -4,13 +4,24 @@ import archives from './swift-shipped-archives.json' with { type: 'json' }
|
|
|
4
4
|
// (scripts/debug/swift-binary-standin-generate.ts writes the table). a package pinning a
|
|
5
5
|
// different archive gets its own stand-in, since the shipped module declares another version's API.
|
|
6
6
|
const SHIPPED_ARCHIVES = new Map<string, string>(Object.entries(archives))
|
|
7
|
-
const
|
|
7
|
+
const SHIPPED_MODULES = new Map(
|
|
8
|
+
[...SHIPPED_ARCHIVES].map(([module, checksum]) => [checksum, module]),
|
|
9
|
+
)
|
|
10
|
+
|
|
11
|
+
export function shippedBinaryModule(
|
|
12
|
+
target: string,
|
|
13
|
+
checksum: string | null,
|
|
14
|
+
): string | undefined {
|
|
15
|
+
if (checksum === null) return undefined
|
|
16
|
+
const namedArchive = SHIPPED_ARCHIVES.get(target)
|
|
17
|
+
return namedArchive === undefined
|
|
18
|
+
? SHIPPED_MODULES.get(checksum)
|
|
19
|
+
: namedArchive === checksum
|
|
20
|
+
? target
|
|
21
|
+
: undefined
|
|
22
|
+
}
|
|
8
23
|
|
|
9
24
|
/** compare the archive even when a package target aliases its module name. */
|
|
10
25
|
export function shippedBinaryDiffers(target: string, checksum: string | null): boolean {
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
checksum !== null &&
|
|
14
|
-
(shipped !== undefined ? checksum !== shipped : !SHIPPED_CHECKSUMS.has(checksum))
|
|
15
|
-
)
|
|
26
|
+
return checksum !== null && shippedBinaryModule(target, checksum) === undefined
|
|
16
27
|
}
|
package/src/swift-standins.ts
CHANGED
|
@@ -60,9 +60,13 @@ import {
|
|
|
60
60
|
swiftManifestDeclarations,
|
|
61
61
|
swiftTargetModuleName,
|
|
62
62
|
} from './swift-package'
|
|
63
|
-
import {
|
|
63
|
+
import {
|
|
64
|
+
swiftBinaryOnDisk,
|
|
65
|
+
type SwiftPackageBinary,
|
|
66
|
+
type SwiftPackages,
|
|
67
|
+
} from './swift-packages'
|
|
64
68
|
import { swiftSharedSdkRoot } from './swift-shared-sdk'
|
|
65
|
-
import { shippedBinaryDiffers } from './swift-shipped-binaries'
|
|
69
|
+
import { shippedBinaryDiffers, shippedBinaryModule } from './swift-shipped-binaries'
|
|
66
70
|
import { withBuiltinStandinBehavior } from './swift-standin-builtin-behavior'
|
|
67
71
|
import { STANDIN_SOURCE_DIGEST, standinSourceDigest } from './swift-standin-digest'
|
|
68
72
|
import {
|
|
@@ -3276,21 +3280,33 @@ async function binaryStandins(
|
|
|
3276
3280
|
return settle(result)
|
|
3277
3281
|
}
|
|
3278
3282
|
|
|
3279
|
-
/** the source targets
|
|
3280
|
-
|
|
3281
|
-
export function standinModuleSources(
|
|
3283
|
+
/** the source targets and provided archives that binary declarations import. */
|
|
3284
|
+
export function standinDependencies(
|
|
3282
3285
|
binaries: readonly SwiftPackageBinary[],
|
|
3283
|
-
|
|
3286
|
+
packages: Pick<SwiftPackages, 'binaries' | 'moduleSources'>,
|
|
3287
|
+
provided: ReadonlySet<string>,
|
|
3284
3288
|
): SwiftPackageBinary[] {
|
|
3285
|
-
const byModule = new Map(
|
|
3286
|
-
|
|
3287
|
-
|
|
3289
|
+
const byModule = new Map<string, SwiftPackageBinary>()
|
|
3290
|
+
for (const candidate of packages.binaries) {
|
|
3291
|
+
if (candidate.reached) continue
|
|
3292
|
+
const module = shippedBinaryModule(candidate.target, candidate.checksum)
|
|
3293
|
+
if (module !== undefined && provided.has(module)) byModule.set(module, candidate)
|
|
3294
|
+
}
|
|
3295
|
+
for (const candidate of packages.moduleSources)
|
|
3296
|
+
byModule.set(swiftTargetModuleName(candidate.target), candidate)
|
|
3288
3297
|
const shipped = new Set<string>()
|
|
3289
3298
|
const pending: string[] = []
|
|
3290
3299
|
const read = (dir: string, sources: readonly string[]) =>
|
|
3291
3300
|
sources.flatMap((source) =>
|
|
3292
3301
|
swiftImportNames(fs.readFileSync(path.join(dir, source), 'utf8')),
|
|
3293
3302
|
)
|
|
3303
|
+
const binarySurfaces = (binary: SwiftPackageBinary) => {
|
|
3304
|
+
try {
|
|
3305
|
+
return surfaces(swiftBinaryFramework(binary).dir, binary.target)
|
|
3306
|
+
} catch {
|
|
3307
|
+
return []
|
|
3308
|
+
}
|
|
3309
|
+
}
|
|
3294
3310
|
for (const binary of binaries) {
|
|
3295
3311
|
if (binary.placeholder !== undefined) {
|
|
3296
3312
|
shipped.add(swiftTargetModuleName(binary.target))
|
|
@@ -3298,13 +3314,7 @@ export function standinModuleSources(
|
|
|
3298
3314
|
continue
|
|
3299
3315
|
}
|
|
3300
3316
|
if (binary.publicHeaders !== undefined) continue
|
|
3301
|
-
|
|
3302
|
-
try {
|
|
3303
|
-
found = surfaces(swiftBinaryFramework(binary).dir, binary.target)
|
|
3304
|
-
} catch {
|
|
3305
|
-
continue
|
|
3306
|
-
}
|
|
3307
|
-
for (const surface of found) {
|
|
3317
|
+
for (const surface of binarySurfaces(binary)) {
|
|
3308
3318
|
shipped.add(surface.module)
|
|
3309
3319
|
pending.push(...surfaceImports(surface))
|
|
3310
3320
|
}
|
|
@@ -3314,7 +3324,11 @@ export function standinModuleSources(
|
|
|
3314
3324
|
const candidate = byModule.get(module)
|
|
3315
3325
|
if (!candidate || shipped.has(module) || selected.has(module)) continue
|
|
3316
3326
|
selected.set(module, candidate)
|
|
3317
|
-
pending.push(
|
|
3327
|
+
pending.push(
|
|
3328
|
+
...(candidate.moduleSources
|
|
3329
|
+
? read(candidate.dir, candidate.moduleSources.sources)
|
|
3330
|
+
: binarySurfaces(candidate).flatMap(surfaceImports)),
|
|
3331
|
+
)
|
|
3318
3332
|
}
|
|
3319
3333
|
return [...selected.values()]
|
|
3320
3334
|
}
|
|
@@ -3390,12 +3404,14 @@ async function buildStandins(
|
|
|
3390
3404
|
provided: ReadonlySet<string>,
|
|
3391
3405
|
behavior: SwiftStandinBehaviors,
|
|
3392
3406
|
): Promise<SwiftStandins> {
|
|
3393
|
-
|
|
3394
|
-
(
|
|
3395
|
-
|
|
3396
|
-
|
|
3407
|
+
if (
|
|
3408
|
+
binaries.every(
|
|
3409
|
+
(binary) =>
|
|
3410
|
+
provided.has(binary.target) &&
|
|
3411
|
+
!shippedBinaryDiffers(binary.target, binary.checksum),
|
|
3412
|
+
)
|
|
3397
3413
|
)
|
|
3398
|
-
|
|
3414
|
+
return { standins: [], gaps: new Map() }
|
|
3399
3415
|
if (
|
|
3400
3416
|
process.platform === 'darwin' &&
|
|
3401
3417
|
process.env.TM_EXEC_BUILD_PLATFORM !== 'mac' &&
|
|
@@ -3404,7 +3420,7 @@ async function buildStandins(
|
|
|
3404
3420
|
toolchain.moduleRoot === sourceSwiftCheckout() &&
|
|
3405
3421
|
!swiftDistributionAt(toolchain.moduleRoot)
|
|
3406
3422
|
)
|
|
3407
|
-
return sourceStandins(
|
|
3423
|
+
return sourceStandins(binaries, toolchain, provided, behavior)
|
|
3408
3424
|
const standins: SwiftStandin[] = []
|
|
3409
3425
|
const gaps = new Map<string, string>()
|
|
3410
3426
|
fs.mkdirSync(cacheDir, { recursive: true })
|
package/src/xcode-project.ts
CHANGED
|
@@ -1440,7 +1440,9 @@ function targetMembers(
|
|
|
1440
1440
|
'IntentDefinitionCompiled',
|
|
1441
1441
|
definition.split(path.sep).findLast((part) => part.endsWith('.lproj')) ?? '',
|
|
1442
1442
|
)
|
|
1443
|
-
|
|
1443
|
+
// definitions in one localization share this directory
|
|
1444
|
+
const compiledDefinition = path.join(compiled, path.basename(definition))
|
|
1445
|
+
fs.rmSync(compiledDefinition, { force: true })
|
|
1444
1446
|
fs.mkdirSync(compiled, { recursive: true })
|
|
1445
1447
|
// runner-toolchain-platform: darwin
|
|
1446
1448
|
execFileSync(
|
|
@@ -1461,7 +1463,7 @@ function targetMembers(
|
|
|
1461
1463
|
timeout: runScriptTimeoutMs,
|
|
1462
1464
|
},
|
|
1463
1465
|
)
|
|
1464
|
-
resources.add(
|
|
1466
|
+
resources.add(compiledDefinition)
|
|
1465
1467
|
projectInputs.add(definition)
|
|
1466
1468
|
for (const file of walkFiles(output)) {
|
|
1467
1469
|
allSources.add(file)
|