peachsim 0.1.1815 → 0.1.1818
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/agent-indicator-mode.ts +2 -1
- package/cli/commands/coverage-swift.ts +4 -3
- package/cli/commands/flow.ts +7 -0
- package/cli/commands/inspect/core.ts +1 -1
- package/cli/commands/maestro-compare.ts +7 -0
- package/cli/commands/package.ts +87 -31
- package/cli/commands/screenshot-mode.ts +2 -1
- package/cli/commands/shell-boolean-mode.ts +7 -3
- package/cli/commands/shell-url.ts +4 -0
- package/cli/commands/show-touches-mode.ts +2 -1
- package/cli/commands/test.ts +3 -2
- package/cli/commands/three-mode.ts +2 -1
- package/cli/outbound-endpoints.ts +1 -1
- package/cli/packaged-app-launcher.ts +6 -1
- 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 +5728 -7551
- 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 +13 -4
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +5234 -5704
- 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 +4913 -6811
- package/dist-lib/host/fetch-proxy-handler.cjs +13 -4
- 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 +40 -30
- 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 +39 -29
- package/dist-lib/native-app-identity-project.cjs +31 -26
- package/dist-lib/native-app-identity-project.mjs +295 -279
- 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 +29 -24
- package/dist-lib/public-origins-lib.json +121 -93
- 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 +2 -2
- package/dist-lib/sdk.mjs +2 -2
- package/dist-lib/skills.cjs +64622 -66476
- package/dist-lib/swift-compile.cjs +328 -265
- package/dist-lib/swift-compile.mjs +335 -270
- 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 +52 -6
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +2405 -2262
- package/dist-lib/vite.cjs +13 -4
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/map-command-channel.d.ts +41 -0
- package/dist-types/packages/peach-engine/src/render-worker/mapServicesContract.d.ts +45 -0
- package/package.json +2 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.apinotes +1 -1
- package/sdk/ios/usr/include/module.modulemap +3 -0
- package/sdk/ios/usr/include/notify.modulemap +9 -0
- package/sdk/ios/usr/lib/swift/Darwin.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/usr/lib/swift/Dispatch.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +7 -1
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +1 -0
- package/sdk/ios/usr/lib/swift/SwiftUI.swiftmodule/arm64-apple-ios-simulator.swiftinterface +21 -0
- package/sdk/ios/usr/lib/swift/SwiftUICore.swiftmodule/arm64-apple-ios-simulator.swiftinterface +6 -1
- package/sdk/ios/wasm/include/__header_time.h +4 -0
- package/sdk/ios/wasm/include/pthread.h +2 -0
- package/sdk/ios/wasm/include/sys/mman.h +1 -1
- package/sdk/ios/wasm/include/sys/resource.h +31 -0
- package/sdk/ios/wasm/include/unistd.h +4 -0
- package/src/answeredNativePackages.ts +43 -0
- package/src/cli-runtime.ts +2 -9
- package/src/expo-discovery-cache.ts +71 -52
- package/src/expo-kotlin-host.ts +11 -9
- package/src/expo-swift-host.ts +55 -13
- package/src/installed-native-libraries.ts +103 -20
- package/src/native-static-libraries.ts +69 -33
- package/src/nitro-adapter.ts +0 -9
- package/src/nitro-bundle.ts +8 -6
- package/src/nitro-compile.ts +45 -16
- package/src/nitro-compiler-digest.ts +2 -4
- package/src/nitro-superset.lock.json +19 -251
- package/src/nitro-superset.ts +63 -68
- package/src/plist-bytes.ts +9 -0
- package/src/portable-expo-workspace.ts +4 -3
- package/src/react-native-bridge-modules.ts +13 -19
- package/src/swift-compile.ts +379 -269
- package/src/swift-cxx-reachable.ts +13 -0
- package/src/swift-distribution.ts +3 -4
- package/src/swift-host.ts +5 -3
- package/src/swift-installed-targets.ts +32 -14
- package/src/swift-native-pin.ts +45 -0
- package/src/swift-objc-compile.ts +23 -1
- package/src/swift-objc-standin.ts +14 -7
- package/src/swift-package-manifest.ts +2 -2
- package/src/swift-root-lock.ts +4 -3
- package/src/swift-standins.ts +41 -38
- package/src/swift-toolchain.ts +69 -12
- package/src/swift-wasm-prune.ts +1 -0
- package/src/swift-xcframework.ts +23 -12
- package/src/swiftContract.ts +2 -0
- package/src/swiftNativePinContract.ts +68 -0
- package/src/turbo-bundle.ts +14 -6
- package/src/turbo-compile.ts +76 -11
- package/src/turbo-source.ts +93 -18
package/src/nitro-superset.ts
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
// the shared Nitro executable (plans/peach/native-prebuild-registry.md). every
|
|
2
2
|
// compiled Nitro provider links one Swift, Foundation and UIKit closure that is
|
|
3
3
|
// most of an executable's bytes, so building each app's own copy ships the same
|
|
4
|
-
// closure per app. one executable of every provider in the
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
4
|
+
// closure per app. one executable of every provider in the capsule is published
|
|
5
|
+
// on the prebuilt registry under a key of its committed inputs and the compiler
|
|
6
|
+
// sources, and an app whose providers are byte-identical to the ones it was
|
|
7
|
+
// built from points its metadata at that key: the browser downloads it once for
|
|
8
|
+
// every app, port and deployment. an app with a provider outside the lock, a
|
|
9
|
+
// different provider build, or a HybridObject or view its config answers
|
|
10
|
+
// compiles its own executable.
|
|
10
11
|
import { createHash } from 'node:crypto'
|
|
11
12
|
import { readdirSync, readFileSync } from 'node:fs'
|
|
12
13
|
import { createRequire } from 'node:module'
|
|
13
14
|
import { dirname, join } from 'node:path'
|
|
14
15
|
import { isRecord } from './is-record'
|
|
15
|
-
import {
|
|
16
|
-
|
|
16
|
+
import {
|
|
17
|
+
NATIVE_PREBUILT_ORIGIN,
|
|
18
|
+
nativeEntryKey,
|
|
19
|
+
nativeEntryPrefix,
|
|
20
|
+
} from './native-prebuilt'
|
|
17
21
|
import { nitroCompilerSourceDigest } from './nitro-compiler-digest'
|
|
18
22
|
import supersetLockJson from './nitro-superset.lock.json' with { type: 'json' }
|
|
19
23
|
import {
|
|
@@ -21,8 +25,7 @@ import {
|
|
|
21
25
|
type NitroBuildConfiguration,
|
|
22
26
|
type NitroCompiledModule,
|
|
23
27
|
} from './nitroContract'
|
|
24
|
-
import {
|
|
25
|
-
import swiftLockJson from './swift-distribution.lock.json' with { type: 'json' }
|
|
28
|
+
import { swiftNativePin } from './swift-native-pin'
|
|
26
29
|
import { STANDIN_SOURCE_DIGEST } from './swift-standin-digest'
|
|
27
30
|
|
|
28
31
|
export const NITRO_SUPERSET_ENTRY_NAME = 'superset'
|
|
@@ -49,10 +52,10 @@ const packageVersion = (root: string): string =>
|
|
|
49
52
|
|
|
50
53
|
/**
|
|
51
54
|
* what one executable of these providers depends on, apart from the sources
|
|
52
|
-
* that compile it
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
55
|
+
* that compile it, which NITRO_COMPILER_DIGEST adds to the key: the toolchain
|
|
56
|
+
* and runtime identities, the build configuration, the iOS deployment target
|
|
57
|
+
* its project compiles for, and each provider's version and source tree, Nitro
|
|
58
|
+
* Modules' included.
|
|
56
59
|
*/
|
|
57
60
|
export function nitroSupersetInputs(options: {
|
|
58
61
|
appRoot: string
|
|
@@ -61,12 +64,13 @@ export function nitroSupersetInputs(options: {
|
|
|
61
64
|
providers: readonly { name: string; root: string }[]
|
|
62
65
|
}): Record<string, string> {
|
|
63
66
|
const resolve = createRequire(join(options.appRoot, 'package.json')).resolve
|
|
67
|
+
const pin = swiftNativePin()
|
|
64
68
|
const inputs: Record<string, string> = {
|
|
65
69
|
configuration: options.configuration,
|
|
66
70
|
'ios-deployment-target': options.iosDeploymentTarget,
|
|
67
71
|
'react-native': packageVersion(dirname(resolve('react-native/package.json'))),
|
|
68
|
-
'swift-distribution':
|
|
69
|
-
'nitro-runtime': JSON.stringify(
|
|
72
|
+
'swift-distribution': pin.distribution.id,
|
|
73
|
+
'nitro-runtime': JSON.stringify(pin.adapters.nitro),
|
|
70
74
|
}
|
|
71
75
|
const nitroModules = dirname(resolve('react-native-nitro-modules/package.json'))
|
|
72
76
|
for (const { name, root } of [
|
|
@@ -77,64 +81,56 @@ export function nitroSupersetInputs(options: {
|
|
|
77
81
|
return inputs
|
|
78
82
|
}
|
|
79
83
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
84
|
+
// build-cli replaces this in every bundle with the digest of the sources it
|
|
85
|
+
// bundles; source runs read the files once at load, like STANDIN_SOURCE_DIGEST.
|
|
86
|
+
declare const __NITRO_COMPILER_DIGEST__: string | undefined
|
|
87
|
+
export const NITRO_COMPILER_DIGEST =
|
|
88
|
+
typeof __NITRO_COMPILER_DIGEST__ === 'string'
|
|
89
|
+
? __NITRO_COMPILER_DIGEST__
|
|
90
|
+
: nitroCompilerSourceDigest(import.meta.dirname, STANDIN_SOURCE_DIGEST)
|
|
83
91
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
inputs: Record<string, string>
|
|
87
|
-
/** every provider the executable registers; urls are absolute. */
|
|
88
|
-
metadata: NitroCompiledModule
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
/** the Release executable at the top level, where the lander reads its
|
|
92
|
-
* compiler digest, and the Debug build of the same providers beside it. */
|
|
93
|
-
export interface NitroSupersetLock extends NitroSupersetEntry {
|
|
94
|
-
debug: NitroSupersetEntry
|
|
95
|
-
}
|
|
92
|
+
/** each configuration's compiler-independent inputs, as `nitro-superset.ts inputs` wrote them. */
|
|
93
|
+
export type NitroSupersetLock = Record<NitroBuildConfiguration, Record<string, string>>
|
|
96
94
|
|
|
97
|
-
function
|
|
98
|
-
if (!isRecord(value)
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
)
|
|
106
|
-
return { key: value.key, inputs, metadata }
|
|
95
|
+
function readInputs(value: unknown): Record<string, string> | null {
|
|
96
|
+
if (!isRecord(value)) return null
|
|
97
|
+
const inputs: Record<string, string> = {}
|
|
98
|
+
for (const [name, entry] of Object.entries(value)) {
|
|
99
|
+
if (typeof entry !== 'string') return null
|
|
100
|
+
inputs[name] = entry
|
|
101
|
+
}
|
|
102
|
+
return inputs
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
function parseLock(value: unknown): NitroSupersetLock | null {
|
|
110
|
-
|
|
111
|
-
const
|
|
112
|
-
|
|
106
|
+
if (!isRecord(value)) return null
|
|
107
|
+
const release = readInputs(value.Release)
|
|
108
|
+
const debug = readInputs(value.Debug)
|
|
109
|
+
return release && debug ? { Release: release, Debug: debug } : null
|
|
113
110
|
}
|
|
114
111
|
|
|
115
112
|
export const nitroSupersetLock = parseLock(supersetLockJson)
|
|
116
113
|
|
|
117
|
-
/** the
|
|
118
|
-
export const
|
|
119
|
-
|
|
120
|
-
configuration: NitroBuildConfiguration,
|
|
121
|
-
): NitroSupersetEntry => (configuration === 'Debug' ? lock.debug : lock)
|
|
114
|
+
/** the registry key of an executable: its inputs and the compiler that builds it. */
|
|
115
|
+
export const nitroSupersetKey = (inputs: Record<string, string>): string =>
|
|
116
|
+
nativeEntryKey({ ...inputs, compiler: NITRO_COMPILER_DIGEST })
|
|
122
117
|
|
|
123
118
|
/** the registry prefix and file urls of an executable built for a key. */
|
|
124
119
|
export function nitroSupersetUrl(key: string, file: string): string {
|
|
125
120
|
return `${NATIVE_PREBUILT_ORIGIN}/${nativeEntryPrefix('nitro', NITRO_SUPERSET_ENTRY_NAME, key)}/${file}`
|
|
126
121
|
}
|
|
127
122
|
|
|
128
|
-
//
|
|
129
|
-
//
|
|
130
|
-
const published = new Map<string, Promise<
|
|
131
|
-
const
|
|
123
|
+
// the publish workflow fills a key after main moves its compiler, so each key's
|
|
124
|
+
// metadata is asked for once per process and a miss compiles the app's own.
|
|
125
|
+
const published = new Map<string, Promise<NitroCompiledModule | null>>()
|
|
126
|
+
const publishedMetadata = (url: string) => {
|
|
132
127
|
let pending = published.get(url)
|
|
133
128
|
if (!pending) {
|
|
134
|
-
pending = fetch(url
|
|
135
|
-
(response) =>
|
|
136
|
-
|
|
137
|
-
|
|
129
|
+
pending = fetch(url)
|
|
130
|
+
.then(async (response) =>
|
|
131
|
+
response.ok ? readNitroMetadata(await response.json()) : null,
|
|
132
|
+
)
|
|
133
|
+
.catch(() => null)
|
|
138
134
|
published.set(url, pending)
|
|
139
135
|
}
|
|
140
136
|
return pending
|
|
@@ -143,8 +139,8 @@ const isPublished = (url: string) => {
|
|
|
143
139
|
/**
|
|
144
140
|
* the shared executable's metadata for an app's providers, or null when the app
|
|
145
141
|
* needs its own: its inputs differ from the lock's anywhere, it holds a
|
|
146
|
-
* provider the lock lacks,
|
|
147
|
-
* would register.
|
|
142
|
+
* provider the lock lacks, its config answers a name or view the executable
|
|
143
|
+
* would register, or this compiler's executable is not published yet.
|
|
148
144
|
*/
|
|
149
145
|
export async function sharedNitroModule(options: {
|
|
150
146
|
appRoot: string
|
|
@@ -153,17 +149,16 @@ export async function sharedNitroModule(options: {
|
|
|
153
149
|
providers: readonly { name: string; root: string }[]
|
|
154
150
|
answers: { hybridObjects: ReadonlySet<string>; views: ReadonlySet<string> }
|
|
155
151
|
}): Promise<NitroCompiledModule | null> {
|
|
156
|
-
const
|
|
157
|
-
|
|
158
|
-
if (!lock || options.answers.hybridObjects.size > 0 || options.answers.views.size > 0)
|
|
152
|
+
const locked = nitroSupersetLock?.[options.configuration]
|
|
153
|
+
if (!locked || options.answers.hybridObjects.size > 0 || options.answers.views.size > 0)
|
|
159
154
|
return null
|
|
160
155
|
const inputs = nitroSupersetInputs(options)
|
|
161
156
|
for (const [name, value] of Object.entries(inputs))
|
|
162
|
-
if (
|
|
157
|
+
if (locked[name] !== value) return null
|
|
158
|
+
const metadata = await publishedMetadata(
|
|
159
|
+
nitroSupersetUrl(nitroSupersetKey(locked), 'metadata.json'),
|
|
160
|
+
)
|
|
161
|
+
if (!metadata) return null
|
|
163
162
|
const own = new Set(options.providers.map(({ name }) => name))
|
|
164
|
-
|
|
165
|
-
return {
|
|
166
|
-
...lock.metadata,
|
|
167
|
-
packages: lock.metadata.packages.filter(({ name }) => own.has(name)),
|
|
168
|
-
}
|
|
163
|
+
return { ...metadata, packages: metadata.packages.filter(({ name }) => own.has(name)) }
|
|
169
164
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import binaryPlist from 'bplist-parser'
|
|
2
|
+
import { parsePlistSource } from './plist'
|
|
3
|
+
|
|
4
|
+
export function parsePlistBytes(source: Uint8Array): unknown {
|
|
5
|
+
const bytes = Buffer.from(source)
|
|
6
|
+
return bytes.subarray(0, 8).toString('ascii') === 'bplist00'
|
|
7
|
+
? binaryPlist.parseBuffer<unknown>(bytes)[0]
|
|
8
|
+
: parsePlistSource(bytes.toString('utf8'))
|
|
9
|
+
}
|
|
@@ -6,7 +6,7 @@ import { readExpoConfigAsync } from './native-firebase-config'
|
|
|
6
6
|
import { portableInterfaceHash, readPortableExpoManifest } from './portable-expo-contract'
|
|
7
7
|
import { preparedNativeInventory } from './prepared-native-inventory'
|
|
8
8
|
import { registerPreparedXcodePhases } from './prepared-xcode-phases'
|
|
9
|
-
import
|
|
9
|
+
import { swiftNativePin } from './swift-native-pin'
|
|
10
10
|
|
|
11
11
|
function stable(value: unknown, app: string): string {
|
|
12
12
|
if (typeof value === 'string') return JSON.stringify(value.split(app).join('$APP'))
|
|
@@ -61,9 +61,10 @@ export async function portableExpoWorkspace(
|
|
|
61
61
|
)
|
|
62
62
|
continue
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
const { id } = swiftNativePin().distribution
|
|
65
|
+
if (value.swiftDistribution !== id) {
|
|
65
66
|
mismatches.push(
|
|
66
|
-
`${name}: Swift distribution ${
|
|
67
|
+
`${name}: Swift distribution ${id} differs from ${value.swiftDistribution}`,
|
|
67
68
|
)
|
|
68
69
|
continue
|
|
69
70
|
}
|
|
@@ -6,9 +6,7 @@
|
|
|
6
6
|
import fs from 'node:fs'
|
|
7
7
|
import { createRequire } from 'node:module'
|
|
8
8
|
import path from 'node:path'
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
const answeredPackages: ReadonlySet<string> = new Set(PEACH_ANSWERED_NATIVE_PACKAGE_NAMES)
|
|
9
|
+
import { peachAnsweredNativePackages } from './answeredNativePackages'
|
|
12
10
|
import { swiftCodeMask, swiftSourceClosure } from './swift-compile'
|
|
13
11
|
import { xcodeNativeFlags, xcodeObjCInputs } from './swift-objc-compile'
|
|
14
12
|
import { SWIFT_NATIVE_INPUT_ROOT, SWIFT_NATIVE_SDK_INCLUDE } from './swiftContract'
|
|
@@ -478,15 +476,17 @@ export function collectBridgeModuleSources(
|
|
|
478
476
|
if (bridgingHeader && target.objc && app) {
|
|
479
477
|
nativeInputs ??= xcodeObjCInputs(app, [], null, undefined, projectRoot)
|
|
480
478
|
const native = target.objc
|
|
479
|
+
// an installed package a monorepo hoists above the project keeps its
|
|
480
|
+
// absolute path under one reserved prefix.
|
|
481
481
|
const key = (file: string) => {
|
|
482
482
|
const relative = path.relative(projectRoot, file)
|
|
483
|
-
|
|
483
|
+
const outside =
|
|
484
484
|
relative === '..' ||
|
|
485
485
|
relative.startsWith(`..${path.sep}`) ||
|
|
486
486
|
path.isAbsolute(relative)
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
487
|
+
return outside
|
|
488
|
+
? path.posix.join('__peach_xcode/__outside', file.split(path.sep).join('/'))
|
|
489
|
+
: path.posix.join('__peach_xcode', relative.split(path.sep).join('/'))
|
|
490
490
|
}
|
|
491
491
|
const headerFiles = [...nativeInputs.sources].filter(([file]) =>
|
|
492
492
|
/\.(?:h|hh|hpp|hxx|pch|inc|inl|modulemap)$/.test(file),
|
|
@@ -495,17 +495,11 @@ export function collectBridgeModuleSources(
|
|
|
495
495
|
headerFiles.map(([file, bytes]) => [key(file), bytes.toString('utf8')]),
|
|
496
496
|
)
|
|
497
497
|
const directories = (files: string[]) =>
|
|
498
|
-
files.flatMap((file) =>
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
!path.isAbsolute(relative)
|
|
504
|
-
)
|
|
505
|
-
return [key(file)]
|
|
506
|
-
if (!fs.existsSync(file)) return []
|
|
507
|
-
throw new Error(`Xcode native search path outside ${projectRoot}: ${file}`)
|
|
508
|
-
})
|
|
498
|
+
files.flatMap((file) =>
|
|
499
|
+
key(file).startsWith('__peach_xcode/__outside/') && !fs.existsSync(file)
|
|
500
|
+
? []
|
|
501
|
+
: [key(file)],
|
|
502
|
+
)
|
|
509
503
|
const nativePath = (file: string) => {
|
|
510
504
|
const absolute = path.resolve(app.rootDir, file)
|
|
511
505
|
return absolute === '/usr/include' || absolute.startsWith('/usr/include/')
|
|
@@ -617,7 +611,7 @@ function collectInstalledSwiftBridgeUnits(
|
|
|
617
611
|
const namespacesSeen = new Set(units.map((unit) => unit.namespace))
|
|
618
612
|
for (const packageName of Object.keys(dependencies).sort()) {
|
|
619
613
|
signal?.throwIfAborted()
|
|
620
|
-
if (
|
|
614
|
+
if (peachAnsweredNativePackages().has(packageName)) continue
|
|
621
615
|
let pkgRoot: string | null = null
|
|
622
616
|
try {
|
|
623
617
|
pkgRoot = fs.realpathSync(
|