peachsim 0.1.2300 → 0.1.2301
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/control.ts +1 -0
- package/cli/commands/shell-url.ts +5 -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 +307 -68
- 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 +2 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +306 -67
- 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 +2523 -71
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -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 +13 -8
- 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 +12 -8
- package/dist-lib/native-app-identity-project.cjs +9 -5
- package/dist-lib/native-app-identity-project.mjs +9 -5
- 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 +56 -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 +2 -1
- package/dist-lib/sdk.mjs +2 -1
- package/dist-lib/skills.cjs +368 -78
- package/dist-lib/swift-compile.cjs +15 -7
- package/dist-lib/swift-compile.mjs +15 -7
- 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 +23 -11
- package/dist-lib/vite.cjs +5 -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/font-config.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/scene-table.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/activitykit-activityContract.d.ts +17 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-protocol.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +3 -1
- package/package.json +1 -1
- package/src/expo-discovery-cache.ts +6 -6
- package/src/expo-swift-host.ts +19 -4
- package/src/host/bridge-host.ts +9 -0
- package/src/launchMetadataContract.ts +1 -0
- package/src/swift-guest-compile.ts +19 -3
- package/src/swift-guest-source-plan.ts +7 -2
- package/src/swiftContract.ts +3 -0
- package/src/turbo-compile.ts +60 -4
- package/src/turbo-source.ts +239 -35
- package/src/widget-extension-bundle.ts +48 -0
- package/src/xcode-project.ts +22 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2301 | (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;
|
|
@@ -5129,7 +5129,7 @@ var swiftCoverageProvenance;
|
|
|
5129
5129
|
var init_provenance = __esm({
|
|
5130
5130
|
"src/swift-coverage/provenance.ts"() {
|
|
5131
5131
|
"use strict";
|
|
5132
|
-
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b","swift-package.ts":"338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb","swift-source-file.ts":"93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94","swift-toolchain.ts":"b60efa4eb7516378344cb7c48216aea5fa36590ace91a698655b48cfd0db96fe","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1","xcode-project.ts":"
|
|
5132
|
+
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"bfde06f157f52d3dd76577b3c6059c95c0393180b054ced773624ea89558992b","swift-package.ts":"338cfef9a34a930206ac2e1a8a90b85c8d61f776d9a41e6445dc18e0c5385cdb","swift-source-file.ts":"93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94","swift-toolchain.ts":"b60efa4eb7516378344cb7c48216aea5fa36590ace91a698655b48cfd0db96fe","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1","xcode-project.ts":"f0e86caccf203fa58395cbac9fed64577bb98a061efdf24f85a289c4e5996db9","xcode-target-members.ts":"2f25aaf5a3aa34395983c75935491c06bd68554c47ff1cb06b49c79499c03db0","xcode-json-project.ts":"41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6","openstep-plist.ts":"74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3"}') : swiftCoverageSourceDigests((0, import_node_path.join)(__sootsim_import_meta_dirname, ".."));
|
|
5133
5133
|
}
|
|
5134
5134
|
});
|
|
5135
5135
|
|
|
@@ -16477,8 +16477,8 @@ function swiftPackageLinkage(target) {
|
|
|
16477
16477
|
function guestSourceImages(graph) {
|
|
16478
16478
|
const targets = new Map(graph.targets.map((target) => [target.id, target]));
|
|
16479
16479
|
const entry = targets.get(graph.entry);
|
|
16480
|
-
if (!entry || entry.productType !== "com.apple.product-type.application")
|
|
16481
|
-
throw new Error("source graph has no application entry");
|
|
16480
|
+
if (!entry || entry.productType !== "com.apple.product-type.application" && entry.productType !== "com.apple.product-type.app-extension")
|
|
16481
|
+
throw new Error("source graph has no application or app extension entry");
|
|
16482
16482
|
const images = [
|
|
16483
16483
|
{ id: 0, owner: entry.id, members: [] }
|
|
16484
16484
|
];
|
|
@@ -18991,6 +18991,12 @@ async function compileGuestLink(options) {
|
|
|
18991
18991
|
(target) => target.productName.endsWith(".framework") ? [target.productName.slice(0, -10)] : []
|
|
18992
18992
|
)
|
|
18993
18993
|
);
|
|
18994
|
+
const sourceLibraries = new Set(
|
|
18995
|
+
options.graph.targets.flatMap((target) => {
|
|
18996
|
+
const library = /^lib(.+)\.(?:a|dylib)$/.exec(target.productName);
|
|
18997
|
+
return library ? [library[1]] : [];
|
|
18998
|
+
})
|
|
18999
|
+
);
|
|
18994
19000
|
const entry = targets.get(options.graph.entry);
|
|
18995
19001
|
if (!entry) throw new Error("guest source graph has no entry");
|
|
18996
19002
|
const imageBuildVersion = (value) => {
|
|
@@ -19160,10 +19166,12 @@ async function compileGuestLink(options) {
|
|
|
19160
19166
|
images: sourceImages.map((image) => ({
|
|
19161
19167
|
id: image.id,
|
|
19162
19168
|
objects: selectedSource.filter((artifact) => artifact.image === image.id).map((artifact) => artifact.path),
|
|
19163
|
-
// a `-framework Name` for a
|
|
19164
|
-
// that
|
|
19169
|
+
// a `-framework Name` or `-lname` for a product the source graph
|
|
19170
|
+
// builds links that product's own target, which the plan already holds
|
|
19165
19171
|
linkerFlags: image.members.flatMap((id) => targets.get(id).linkerFlags).filter(
|
|
19166
|
-
(flag, index, flags) => !sourceFrameworks.has(flags[index - 1] === "-framework" ? flag : "") && !(flag === "-framework" && sourceFrameworks.has(flags[index + 1] ?? ""))
|
|
19172
|
+
(flag, index, flags) => !sourceFrameworks.has(flags[index - 1] === "-framework" ? flag : "") && !(flag === "-framework" && sourceFrameworks.has(flags[index + 1] ?? "")) && !sourceLibraries.has(
|
|
19173
|
+
flag.startsWith("-l") && flag.length > 2 ? flag.slice(2) : flags[index - 1] === "-l" ? flag : ""
|
|
19174
|
+
) && !(flag === "-l" && sourceLibraries.has(flags[index + 1] ?? ""))
|
|
19167
19175
|
),
|
|
19168
19176
|
clangLinkOptions: selectedSource.filter((artifact) => artifact.image === image.id).map((artifact) => ({
|
|
19169
19177
|
object: import_node_path38.default.resolve(rewritten.get(artifact.path) ?? artifact.path),
|
|
@@ -25262,7 +25270,7 @@ int EXUpdatesApplyBSDiffPatch(const char * _Nonnull oldFilePath,
|
|
|
25262
25270
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
25263
25271
|
MULTI_MANIFEST_VERSION = 68;
|
|
25264
25272
|
SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
25265
|
-
compilerSourceDigest = true ? "
|
|
25273
|
+
compilerSourceDigest = true ? "ad311d7f868d4920f32f2ed00502f49f84fb83ae19817180a70ef5f799334169" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
25266
25274
|
nativeCxxCompilerFlags = ["-fno-cxx-modules"];
|
|
25267
25275
|
cFlagArray = (flags) => JSON.stringify(withoutGlogModuleMap(flags));
|
|
25268
25276
|
cxxFlagArray = (flags) => JSON.stringify([...nativeCxxCompilerFlags, ...withoutGlogModuleMap(flags)]);
|
|
@@ -28202,7 +28210,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
28202
28210
|
options.installedPods
|
|
28203
28211
|
);
|
|
28204
28212
|
const allTargets = projects2.flatMap(projectTargets);
|
|
28205
|
-
const appTargets = allTargets.filter(
|
|
28213
|
+
const appTargets = allTargets.filter(
|
|
28214
|
+
(ref) => isIosAppTarget(ref, options) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
|
|
28215
|
+
);
|
|
28206
28216
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
28207
28217
|
const container = import_node_path50.default.basename(xcodeprojOrWorkspace);
|
|
28208
28218
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
@@ -28266,7 +28276,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
28266
28276
|
const words2 = settingList(flags);
|
|
28267
28277
|
const linked = new Set(linkedTargets(ref).map((link) => link.target));
|
|
28268
28278
|
return words2.flatMap((word, index) => {
|
|
28269
|
-
const
|
|
28279
|
+
const library = word.startsWith("-l") && word.length > 2 ? word.slice(2) : words2[index - 1] === "-l" ? word : void 0;
|
|
28280
|
+
const target = words2[index - 1] === "-framework" ? byProduct.get(`${word}.framework`) : library ? byProduct.get(`lib${library}.a`) ?? byProduct.get(`lib${library}.dylib`) : void 0;
|
|
28270
28281
|
if (!target || target === ref || linked.has(target)) return [];
|
|
28271
28282
|
linked.add(target);
|
|
28272
28283
|
return [{ target, attributes: [] }];
|
|
@@ -29268,7 +29279,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
29268
29279
|
cocoapods
|
|
29269
29280
|
};
|
|
29270
29281
|
}
|
|
29271
|
-
var import_node_child_process30, import_node_crypto22, import_node_fs52, import_node_path50, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, developerDir, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
|
|
29282
|
+
var import_node_child_process30, import_node_crypto22, import_node_fs52, import_node_path50, import_plist2, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory, loaded, developerDir, preparedSourcePhases, isPodsProject, targetRefs, workspaceResolvedFile, SwiftPackageResolutionRequired;
|
|
29272
29283
|
var init_xcode_project = __esm({
|
|
29273
29284
|
"src/xcode-project.ts"() {
|
|
29274
29285
|
"use strict";
|
|
@@ -29307,6 +29318,7 @@ var init_xcode_project = __esm({
|
|
|
29307
29318
|
"compiler-default"
|
|
29308
29319
|
]);
|
|
29309
29320
|
APPLICATION = "com.apple.product-type.application";
|
|
29321
|
+
APP_EXTENSION = "com.apple.product-type.app-extension";
|
|
29310
29322
|
RESOURCE_BUNDLE = "com.apple.product-type.bundle";
|
|
29311
29323
|
PRODUCT_MACH_O_TYPES = {
|
|
29312
29324
|
"com.apple.product-type.application": "mh_execute",
|
|
@@ -29459,7 +29471,7 @@ var init_swift_standin_digest = __esm({
|
|
|
29459
29471
|
STANDIN_DIGEST_ENTRYPOINTS = ["swift-standins.ts", "swift-objc-compile.ts"];
|
|
29460
29472
|
SPECIFIER = /from\s*['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
29461
29473
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
29462
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
29474
|
+
STANDIN_SOURCE_DIGEST = true ? "7dd2fef3ceef6be07d22cfa2f397bda7721d34bc2ef8764f78e05b9637849f09" : standinSourceDigest();
|
|
29463
29475
|
}
|
|
29464
29476
|
});
|
|
29465
29477
|
|
|
@@ -42981,7 +42993,8 @@ async function collectTurboSources(options) {
|
|
|
42981
42993
|
reactNative,
|
|
42982
42994
|
sources: [],
|
|
42983
42995
|
externalPodSources: [],
|
|
42984
|
-
rendererSwiftTargets: []
|
|
42996
|
+
rendererSwiftTargets: [],
|
|
42997
|
+
fabricComponents: []
|
|
42985
42998
|
};
|
|
42986
42999
|
const sharedLibrary = [...options.installedPods?.values() ?? []].find(
|
|
42987
43000
|
(pod) => pod.sharedLibrary
|
|
@@ -43428,6 +43441,9 @@ async function collectTurboSources(options) {
|
|
|
43428
43441
|
};
|
|
43429
43442
|
let objc = Boolean(options.reactNativeProvider);
|
|
43430
43443
|
let fabric = Boolean(options.reactNativeProvider);
|
|
43444
|
+
const fabricPackages = /* @__PURE__ */ new Set();
|
|
43445
|
+
const fabricViews = [];
|
|
43446
|
+
let fabricTarget = null;
|
|
43431
43447
|
let legacyBridge = false;
|
|
43432
43448
|
let hermesHeaders = null;
|
|
43433
43449
|
const objcClasses = /* @__PURE__ */ new Set();
|
|
@@ -43451,7 +43467,11 @@ async function collectTurboSources(options) {
|
|
|
43451
43467
|
{ tool: "cxx", flags: pod.installed.preprocessorFlags.cxx }
|
|
43452
43468
|
];
|
|
43453
43469
|
const root = pod.root;
|
|
43454
|
-
|
|
43470
|
+
if (fabricComponents(provider.root)) {
|
|
43471
|
+
fabric = true;
|
|
43472
|
+
fabricPackages.add(provider.name);
|
|
43473
|
+
fabricTarget ??= { targetName, label, root: provider.root };
|
|
43474
|
+
}
|
|
43455
43475
|
if (pod.installed?.library) {
|
|
43456
43476
|
result.libraries ??= {};
|
|
43457
43477
|
result.libraries[targetName] = import_node_fs84.default.readFileSync(pod.installed.library).toString("base64");
|
|
@@ -43724,6 +43744,17 @@ async function collectTurboSources(options) {
|
|
|
43724
43744
|
const owned = /* @__PURE__ */ new Set();
|
|
43725
43745
|
walkFiles2(generated, "", owned);
|
|
43726
43746
|
const spec = codegenConfig.name;
|
|
43747
|
+
let definedComponentNames;
|
|
43748
|
+
const getDefinedComponentNames = () => {
|
|
43749
|
+
if (definedComponentNames) return definedComponentNames;
|
|
43750
|
+
definedComponentNames = /* @__PURE__ */ new Set();
|
|
43751
|
+
const pattern = /\b(?:const\s+char|char\s+const)\s+(\w+ComponentName)\s*\[\s*\]\s*=/g;
|
|
43752
|
+
for (const sourceFile of sources) {
|
|
43753
|
+
const text6 = readPackageFile(root, import_node_path81.default.join(root, sourceFile), Infinity).toString("utf8").replace(/\/\/[^\n]*/g, "");
|
|
43754
|
+
for (const match of text6.matchAll(pattern)) definedComponentNames.add(match[1]);
|
|
43755
|
+
}
|
|
43756
|
+
return definedComponentNames;
|
|
43757
|
+
};
|
|
43727
43758
|
for (const file of [...owned].sort()) {
|
|
43728
43759
|
const base = import_node_path81.default.posix.basename(file);
|
|
43729
43760
|
const objcSpec = providerObjC && file.startsWith(`${spec}/`);
|
|
@@ -43745,7 +43776,32 @@ async function collectTurboSources(options) {
|
|
|
43745
43776
|
relative: file
|
|
43746
43777
|
}
|
|
43747
43778
|
);
|
|
43748
|
-
else
|
|
43779
|
+
else {
|
|
43780
|
+
if (component && base === "ShadowNodes.cpp") {
|
|
43781
|
+
const defined = getDefinedComponentNames();
|
|
43782
|
+
if (defined.size) {
|
|
43783
|
+
const source = readPackageFile(
|
|
43784
|
+
generated,
|
|
43785
|
+
import_node_path81.default.join(generated, file),
|
|
43786
|
+
Infinity
|
|
43787
|
+
).toString("utf8");
|
|
43788
|
+
const filtered = source.replace(
|
|
43789
|
+
/^[ \t]*(?:extern[ \t]+)?(?:const[ \t]+char|char[ \t]+const)[ \t]+(\w+ComponentName)[ \t]*\[[ \t]*\][ \t]*=[^;]*;[ \t]*\r?\n?/gm,
|
|
43790
|
+
(line, name3) => defined.has(name3) ? "" : line
|
|
43791
|
+
);
|
|
43792
|
+
if (filtered !== source) {
|
|
43793
|
+
if (!/\b(?:const\s+char|char\s+const)\s+\w+ComponentName\s*\[\s*\]\s*=/.test(
|
|
43794
|
+
filtered
|
|
43795
|
+
))
|
|
43796
|
+
continue;
|
|
43797
|
+
const key2 = original(targetName, "ReactCodegen", generated, file);
|
|
43798
|
+
result.files[key2] = filtered;
|
|
43799
|
+
continue;
|
|
43800
|
+
}
|
|
43801
|
+
}
|
|
43802
|
+
}
|
|
43803
|
+
original(targetName, "ReactCodegen", generated, file);
|
|
43804
|
+
}
|
|
43749
43805
|
}
|
|
43750
43806
|
}
|
|
43751
43807
|
for (const file of sources) original(targetName, label, root, file);
|
|
@@ -43806,7 +43862,7 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
|
|
|
43806
43862
|
add(`${core}/include/PeachJsiRuntime.hpp`, TURBO_RUNTIME_HEADER);
|
|
43807
43863
|
add(
|
|
43808
43864
|
`${core}/${TURBO_CORE_PUBLIC_HEADERS}/${TURBO_ENTRY_HEADER}`,
|
|
43809
|
-
'#pragma once\nextern "C" void peachTurboInitialize();\n'
|
|
43865
|
+
'#pragma once\nextern "C" void peachTurboInitialize();\n// the +1 Fabric component view a root of the process shows, in an app with one\nextern "C" void *peach_fabric_view_content(int tag);\n'
|
|
43810
43866
|
);
|
|
43811
43867
|
add(
|
|
43812
43868
|
`${core}/${TURBO_CORE_PUBLIC_HEADERS}/module.modulemap`,
|
|
@@ -43932,6 +43988,21 @@ ${declared.map((symbol2) => `extern "C" void ${symbol2}();
|
|
|
43932
43988
|
original(TURBO_CORE_TARGET, "ReactCodegen", generated, "RCTModuleProviders.h")
|
|
43933
43989
|
);
|
|
43934
43990
|
}
|
|
43991
|
+
const thirdParty = import_node_path81.default.join(generated, "RCTThirdPartyComponentsProvider.mm");
|
|
43992
|
+
if (fabricPackages.size > 0 && import_node_fs84.default.existsSync(thirdParty)) {
|
|
43993
|
+
for (const [, name3, className2, owner] of import_node_fs84.default.readFileSync(thirdParty, "utf8").matchAll(/@"([^"]+)": NSClassFromString\(@"([^"]+)"\), \/\/ (\S+)/g))
|
|
43994
|
+
if (fabricPackages.has(owner))
|
|
43995
|
+
fabricViews.push({ name: name3, className: className2 });
|
|
43996
|
+
}
|
|
43997
|
+
if (fabricViews.length > 0 && fabricTarget) {
|
|
43998
|
+
result.fabricComponents = fabricViews.map(({ name: name3 }) => name3);
|
|
43999
|
+
const unit2 = `${targetPath(fabricTarget.targetName)}/PeachFabricHost.mm`;
|
|
44000
|
+
add(unit2, fabricHostSource(fabricViews));
|
|
44001
|
+
scanText(
|
|
44002
|
+
{ key: unit2, ...fabricTarget, relative: "PeachFabricHost.mm" },
|
|
44003
|
+
result.files[unit2]
|
|
44004
|
+
);
|
|
44005
|
+
}
|
|
43935
44006
|
}
|
|
43936
44007
|
if (fabric || legacyBridge) {
|
|
43937
44008
|
if (legacyBridge) {
|
|
@@ -44275,38 +44346,6 @@ void dispatchToJSThread(dispatch_block_t block) {
|
|
|
44275
44346
|
}
|
|
44276
44347
|
} // namespace
|
|
44277
44348
|
|
|
44278
|
-
static CGFloat peachScreenBrightness = 0.5;
|
|
44279
|
-
|
|
44280
|
-
@implementation UIScreen (PeachTurboRuntime)
|
|
44281
|
-
+ (UIScreen *)mainScreen {
|
|
44282
|
-
static UIScreen *screen = nil;
|
|
44283
|
-
if (!screen) screen = [[UIScreen alloc] init];
|
|
44284
|
-
return screen;
|
|
44285
|
-
}
|
|
44286
|
-
- (CGFloat)brightness {
|
|
44287
|
-
return peachScreenBrightness;
|
|
44288
|
-
}
|
|
44289
|
-
- (void)setBrightness:(CGFloat)value {
|
|
44290
|
-
peachScreenBrightness = value;
|
|
44291
|
-
}
|
|
44292
|
-
@end
|
|
44293
|
-
|
|
44294
|
-
static BOOL peachIdleTimerDisabled = NO;
|
|
44295
|
-
|
|
44296
|
-
@implementation UIApplication (PeachTurboRuntime)
|
|
44297
|
-
+ (UIApplication *)sharedApplication {
|
|
44298
|
-
static UIApplication *app = nil;
|
|
44299
|
-
if (!app) app = [[UIApplication alloc] init];
|
|
44300
|
-
return app;
|
|
44301
|
-
}
|
|
44302
|
-
- (BOOL)isIdleTimerDisabled {
|
|
44303
|
-
return peachIdleTimerDisabled;
|
|
44304
|
-
}
|
|
44305
|
-
- (void)setIdleTimerDisabled:(BOOL)disabled {
|
|
44306
|
-
peachIdleTimerDisabled = disabled;
|
|
44307
|
-
}
|
|
44308
|
-
@end
|
|
44309
|
-
|
|
44310
44349
|
// React Native's own modules register before any provider's, and RCTBridge.mm
|
|
44311
44350
|
// creates the registry's queue in the first RCTRegisterModule. the engine
|
|
44312
44351
|
// supplies those modules, so a process whose providers register none (codegen
|
|
@@ -44423,6 +44462,12 @@ ${moduleProviders ? `- (id<RCTModuleProvider>)getModuleProvider:(const char *)na
|
|
|
44423
44462
|
|
|
44424
44463
|
@end
|
|
44425
44464
|
|
|
44465
|
+
// an app's Fabric component views, which its own Fabric host defines
|
|
44466
|
+
extern "C" void peachInstallFabricViews(facebook::jsi::Runtime &runtime) __attribute__((weak));
|
|
44467
|
+
|
|
44468
|
+
// UIKitCore: the key window and root view controller an app delegate makes at launch
|
|
44469
|
+
extern "C" void PeachLaunchReactNativeWindow(void);
|
|
44470
|
+
|
|
44426
44471
|
extern "C" void peachTurboInitialize() {
|
|
44427
44472
|
objc_create_block_classes_as_subclasses_of([NSObject class]);
|
|
44428
44473
|
if (Class blockClass = NSClassFromString(@"_NSBlock")) {
|
|
@@ -44436,6 +44481,7 @@ extern "C" void peachTurboInitialize() {
|
|
|
44436
44481
|
static_cast<uint32_t *>((__bridge void *)mainQueueClass)[4] &= ~2048u;
|
|
44437
44482
|
*reinterpret_cast<void **>(&_dispatch_main_q) = (__bridge void *)mainQueueClass;
|
|
44438
44483
|
}
|
|
44484
|
+
PeachLaunchReactNativeWindow();
|
|
44439
44485
|
auto& runtime = peach::jsi_runtime::create(
|
|
44440
44486
|
[] { invoker->drain(); },
|
|
44441
44487
|
[] {
|
|
@@ -44496,6 +44542,7 @@ ${bridgeProxy ? ` // as RCTInstance does: the proxy modules reach as their brid
|
|
|
44496
44542
|
}];
|
|
44497
44543
|
[decorator.moduleRegistry setTurboModuleRegistry:manager];
|
|
44498
44544
|
[manager installJSBindings:runtime];
|
|
44545
|
+
if (peachInstallFabricViews) peachInstallFabricViews(runtime);
|
|
44499
44546
|
}
|
|
44500
44547
|
|
|
44501
44548
|
// the screenshot the device took, as UIKit posts it to every observer in the
|
|
@@ -44541,7 +44588,129 @@ ${moduleProviders ? " [found addObjectsFromArray:RCTModuleProviders.moduleProvi
|
|
|
44541
44588
|
}
|
|
44542
44589
|
`;
|
|
44543
44590
|
}
|
|
44544
|
-
|
|
44591
|
+
function fabricHostSource(views) {
|
|
44592
|
+
const entries = views.map(
|
|
44593
|
+
({ name: name3, className: className2 }) => `@${JSON.stringify(name3)}: NSClassFromString(@${JSON.stringify(className2)})`
|
|
44594
|
+
).join(", ");
|
|
44595
|
+
return `${FABRIC_HOST_INCLUDES}
|
|
44596
|
+
@interface PeachFabricComponents : NSObject <RCTComponentViewFactoryComponentProvider>
|
|
44597
|
+
@end
|
|
44598
|
+
|
|
44599
|
+
@implementation PeachFabricComponents
|
|
44600
|
+
- (NSDictionary<NSString *, Class<RCTComponentViewProtocol>> *)thirdPartyFabricComponents
|
|
44601
|
+
{
|
|
44602
|
+
return @{${entries}};
|
|
44603
|
+
}
|
|
44604
|
+
@end
|
|
44605
|
+
|
|
44606
|
+
namespace {
|
|
44607
|
+
struct PeachFabricView {
|
|
44608
|
+
react::ComponentHandle handle;
|
|
44609
|
+
const react::ComponentDescriptor *descriptor;
|
|
44610
|
+
react::Props::Shared props;
|
|
44611
|
+
react::LayoutMetrics layoutMetrics;
|
|
44612
|
+
};
|
|
44613
|
+
PeachFabricComponents *fabricComponents;
|
|
44614
|
+
RCTComponentViewRegistry *fabricRegistry;
|
|
44615
|
+
std::shared_ptr<const react::ContextContainer> fabricContext;
|
|
44616
|
+
react::ComponentDescriptorRegistry::Shared fabricDescriptors;
|
|
44617
|
+
std::unordered_map<int, PeachFabricView> fabricViews;
|
|
44618
|
+
int nextFabricView = 1;
|
|
44619
|
+
std::string fabricNames = ${JSON.stringify(views.map(({ name: name3 }) => name3).join("\n"))};
|
|
44620
|
+
|
|
44621
|
+
PeachFabricView &fabricView(int tag) {
|
|
44622
|
+
auto found = fabricViews.find(tag);
|
|
44623
|
+
if (found == fabricViews.end()) {
|
|
44624
|
+
std::fprintf(stderr, "no mounted Fabric view %d\\n", tag);
|
|
44625
|
+
std::abort();
|
|
44626
|
+
}
|
|
44627
|
+
return found->second;
|
|
44628
|
+
}
|
|
44629
|
+
|
|
44630
|
+
react::Props::Shared fabricCloneProps(jsi::Runtime &rt, const PeachFabricView &view, const jsi::Value &props) {
|
|
44631
|
+
react::PropsParserContext context{-1, *fabricContext};
|
|
44632
|
+
return view.descriptor->cloneProps(context, view.props, react::RawProps(rt, props));
|
|
44633
|
+
}
|
|
44634
|
+
|
|
44635
|
+
} // namespace
|
|
44636
|
+
|
|
44637
|
+
extern "C" void peachInstallFabricViews(jsi::Runtime &rt) {
|
|
44638
|
+
fabricComponents = [PeachFabricComponents new];
|
|
44639
|
+
RCTComponentViewFactory *factory = [RCTComponentViewFactory currentComponentViewFactory];
|
|
44640
|
+
factory.thirdPartyFabricComponentsProvider = fabricComponents;
|
|
44641
|
+
fabricRegistry = [RCTComponentViewRegistry new];
|
|
44642
|
+
fabricContext = std::make_shared<const react::ContextContainer>();
|
|
44643
|
+
react::ComponentDescriptorParameters parameters{{}, fabricContext, nullptr};
|
|
44644
|
+
fabricDescriptors = [factory createComponentDescriptorRegistryWithParameters:parameters];
|
|
44645
|
+
auto views = jsi::Object(rt);
|
|
44646
|
+
auto method = [&](const char *name, unsigned count, jsi::HostFunctionType body) {
|
|
44647
|
+
views.setProperty(rt, name, jsi::Function::createFromHostFunction(rt, jsi::PropNameID::forAscii(rt, name), count, std::move(body)));
|
|
44648
|
+
};
|
|
44649
|
+
// Create then Insert: the first props, no event emitter or state, and the
|
|
44650
|
+
// layout the view has before the engine measures it
|
|
44651
|
+
method("create", 2, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
44652
|
+
const auto &descriptor = fabricDescriptors->at(args[0].asString(rt).utf8(rt));
|
|
44653
|
+
int tag = nextFabricView++;
|
|
44654
|
+
auto &view = fabricViews.emplace(tag, PeachFabricView{descriptor.getComponentHandle(), &descriptor, nullptr, {}}).first->second;
|
|
44655
|
+
view.props = fabricCloneProps(rt, view, args[1]);
|
|
44656
|
+
UIView<RCTComponentViewProtocol> *componentView =
|
|
44657
|
+
[fabricRegistry dequeueComponentViewWithComponentHandle:view.handle tag:tag].view;
|
|
44658
|
+
[componentView updateProps:view.props oldProps:nullptr];
|
|
44659
|
+
[componentView updateEventEmitter:nullptr];
|
|
44660
|
+
[componentView updateState:nullptr oldState:nullptr];
|
|
44661
|
+
[componentView updateLayoutMetrics:view.layoutMetrics oldLayoutMetrics:react::EmptyLayoutMetrics];
|
|
44662
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMaskAll];
|
|
44663
|
+
return jsi::Value(tag);
|
|
44664
|
+
});
|
|
44665
|
+
// Update with the props React changed since the last commit
|
|
44666
|
+
method("update", 2, [](jsi::Runtime &rt, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
44667
|
+
int tag = static_cast<int>(args[0].asNumber());
|
|
44668
|
+
auto &view = fabricView(tag);
|
|
44669
|
+
auto oldProps = view.props;
|
|
44670
|
+
view.props = fabricCloneProps(rt, view, args[1]);
|
|
44671
|
+
UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
|
|
44672
|
+
[componentView updateProps:view.props oldProps:oldProps];
|
|
44673
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMaskProps];
|
|
44674
|
+
return jsi::Value::undefined();
|
|
44675
|
+
});
|
|
44676
|
+
// Update with the size and scale the engine laid the view out at
|
|
44677
|
+
method("layout", 4, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
44678
|
+
int tag = static_cast<int>(args[0].asNumber());
|
|
44679
|
+
auto &view = fabricView(tag);
|
|
44680
|
+
auto metrics = view.layoutMetrics;
|
|
44681
|
+
metrics.frame = react::Rect{{0, 0}, {static_cast<react::Float>(args[1].asNumber()), static_cast<react::Float>(args[2].asNumber())}};
|
|
44682
|
+
metrics.pointScaleFactor = static_cast<react::Float>(args[3].asNumber());
|
|
44683
|
+
if (metrics == view.layoutMetrics) return jsi::Value::undefined();
|
|
44684
|
+
UIView<RCTComponentViewProtocol> *componentView = [fabricRegistry componentViewDescriptorWithTag:tag].view;
|
|
44685
|
+
[componentView updateLayoutMetrics:metrics oldLayoutMetrics:view.layoutMetrics];
|
|
44686
|
+
view.layoutMetrics = metrics;
|
|
44687
|
+
[componentView finalizeUpdates:RNComponentViewUpdateMaskLayoutMetrics];
|
|
44688
|
+
return jsi::Value::undefined();
|
|
44689
|
+
});
|
|
44690
|
+
// Remove then Delete: the registry recycles the view
|
|
44691
|
+
method("drop", 1, [](jsi::Runtime &, const jsi::Value &, const jsi::Value *args, size_t) -> jsi::Value {
|
|
44692
|
+
int tag = static_cast<int>(args[0].asNumber());
|
|
44693
|
+
auto &view = fabricView(tag);
|
|
44694
|
+
RCTComponentViewDescriptor descriptor = [fabricRegistry componentViewDescriptorWithTag:tag];
|
|
44695
|
+
[descriptor.view removeFromSuperview];
|
|
44696
|
+
[fabricRegistry enqueueComponentViewWithComponentHandle:view.handle tag:tag componentViewDescriptor:descriptor];
|
|
44697
|
+
fabricViews.erase(tag);
|
|
44698
|
+
return jsi::Value::undefined();
|
|
44699
|
+
});
|
|
44700
|
+
rt.global().setProperty(rt, "peachFabricViews", std::move(views));
|
|
44701
|
+
}
|
|
44702
|
+
|
|
44703
|
+
extern "C" void *peach_fabric_view_content(int tag) {
|
|
44704
|
+
return (__bridge_retained void *)[fabricRegistry componentViewDescriptorWithTag:tag].view;
|
|
44705
|
+
}
|
|
44706
|
+
|
|
44707
|
+
// the component names the host registers as views, newline separated
|
|
44708
|
+
extern "C" __attribute__((export_name("peach_fabric_component_names"))) const char *peachFabricComponentNames() {
|
|
44709
|
+
return fabricNames.c_str();
|
|
44710
|
+
}
|
|
44711
|
+
`;
|
|
44712
|
+
}
|
|
44713
|
+
var import_node_child_process45, import_node_crypto43, import_node_fs84, import_node_path81, import_node_util15, execFileAsync3, TURBO_CORE_TARGET, TURBO_FMT_TARGET, TURBO_ENTRY_HEADER, TURBO_CORE_PUBLIC_HEADERS, REGISTRATION, CODEGEN_OBJC, UNIT, HEADER3, OBJC2, OBJC_TURBO, OBJC_BRIDGE, OBJC_REGISTERED, REACT_NATIVE_UNITS, REACT_NATIVE_INCLUDE_ROOTS, REACT_NATIVE_OBJC_UNITS, REACT_NATIVE_OBJC_VERSIONED_UNITS, REACT_NATIVE_HEADER_DIRS, REACT_NATIVE_BARE_HEADER_DIRS, sha2564, versionParts, iosOf, JS_CALL_INVOKER, FABRIC_HOST_INCLUDES;
|
|
44545
44714
|
var init_turbo_source = __esm({
|
|
44546
44715
|
"src/turbo-source.ts"() {
|
|
44547
44716
|
"use strict";
|
|
@@ -44702,6 +44871,22 @@ class JsCallInvoker final : public react::CallInvoker {
|
|
|
44702
44871
|
std::deque<react::CallFunc> pending;
|
|
44703
44872
|
};
|
|
44704
44873
|
|
|
44874
|
+
`;
|
|
44875
|
+
FABRIC_HOST_INCLUDES = `#import <Foundation/Foundation.h>
|
|
44876
|
+
#import <React/RCTComponentViewFactory.h>
|
|
44877
|
+
#import <React/RCTComponentViewProtocol.h>
|
|
44878
|
+
#import <React/RCTComponentViewRegistry.h>
|
|
44879
|
+
#include <react/renderer/componentregistry/ComponentDescriptorRegistry.h>
|
|
44880
|
+
#include <react/renderer/core/LayoutMetrics.h>
|
|
44881
|
+
#include <react/renderer/core/PropsParserContext.h>
|
|
44882
|
+
#include <react/renderer/core/RawProps.h>
|
|
44883
|
+
#include <react/utils/ContextContainer.h>
|
|
44884
|
+
#include <cstdio>
|
|
44885
|
+
#include <cstdlib>
|
|
44886
|
+
#include <unordered_map>
|
|
44887
|
+
#include <jsi/jsi.h>
|
|
44888
|
+
|
|
44889
|
+
using namespace facebook;
|
|
44705
44890
|
`;
|
|
44706
44891
|
}
|
|
44707
44892
|
});
|
|
@@ -44757,7 +44942,7 @@ function collectTurboCompileInput(collection, runtime, iosDeploymentTarget, depe
|
|
|
44757
44942
|
dependencyTargets = dependencyTargets.filter(
|
|
44758
44943
|
(_, index) => !providerNames.has(parsedTargets[index].name)
|
|
44759
44944
|
);
|
|
44760
|
-
const swift = Object.keys(files2).some((file) => file.endsWith(".swift"));
|
|
44945
|
+
const swift = collection.coreMode === "turbo" || Object.keys(files2).some((file) => file.endsWith(".swift"));
|
|
44761
44946
|
const entry = `Sources/PeachTurboApp/main.${swift ? "swift" : "cpp"}`;
|
|
44762
44947
|
const targetNames = targets.map(({ name: name3 }) => name3);
|
|
44763
44948
|
const loadTargetNames = new Set(collection.loads.map(({ target }) => target));
|
|
@@ -44766,10 +44951,56 @@ function collectTurboCompileInput(collection, runtime, iosDeploymentTarget, depe
|
|
|
44766
44951
|
(file) => file.startsWith(`${target.path}/`) && file.endsWith(".swift")
|
|
44767
44952
|
)
|
|
44768
44953
|
).map(({ name: name3 }) => name3);
|
|
44769
|
-
|
|
44770
|
-
|
|
44771
|
-
|
|
44772
|
-
|
|
44954
|
+
const initialize = [
|
|
44955
|
+
"_PeachReactNativeWindow.launch()",
|
|
44956
|
+
...collection.loads.map(({ symbol: symbol2 }) => `${symbol2}()`),
|
|
44957
|
+
...runtime ? ["peachTurboInitialize()"] : []
|
|
44958
|
+
];
|
|
44959
|
+
const fabric = collection.fabricComponents.length > 0;
|
|
44960
|
+
files2[entry] = swift ? [
|
|
44961
|
+
"import SwiftUI",
|
|
44962
|
+
"import UIKit",
|
|
44963
|
+
"import PeachJSON",
|
|
44964
|
+
...swiftImportedTargetNames.map((target) => `import ${target}`),
|
|
44965
|
+
"",
|
|
44966
|
+
"@main struct PeachTurboApp: PeachPackage {",
|
|
44967
|
+
` init() { ${initialize.join("; ")} }`,
|
|
44968
|
+
...fabric ? [
|
|
44969
|
+
" func view(props: JSON) -> PeachTurboRoot { PeachTurboRoot(props: props) }",
|
|
44970
|
+
"}",
|
|
44971
|
+
"",
|
|
44972
|
+
"struct PeachTurboRoot: View {",
|
|
44973
|
+
" let fabric: Int32?",
|
|
44974
|
+
"",
|
|
44975
|
+
" init(props: JSON) {",
|
|
44976
|
+
' guard case .object(let fields) = props, let field = fields.first(where: { $0.0 == "fabric" }), case .number(let tag) = field.1 else {',
|
|
44977
|
+
" fabric = nil",
|
|
44978
|
+
" return",
|
|
44979
|
+
" }",
|
|
44980
|
+
" fabric = Int32(tag)",
|
|
44981
|
+
" }",
|
|
44982
|
+
"",
|
|
44983
|
+
" var body: some View {",
|
|
44984
|
+
" if let fabric { PeachFabricComponent(tag: fabric) } else { _PeachReactNativeWindow() }",
|
|
44985
|
+
" }",
|
|
44986
|
+
"}",
|
|
44987
|
+
"",
|
|
44988
|
+
"struct PeachFabricComponent: UIViewRepresentable {",
|
|
44989
|
+
" let tag: Int32",
|
|
44990
|
+
"",
|
|
44991
|
+
" func makeUIView(context: Context) -> UIView {",
|
|
44992
|
+
' guard let view = peach_fabric_view_content(tag) else { fatalError("Fabric view \\(tag) is not mounted") }',
|
|
44993
|
+
" return Unmanaged<UIView>.fromOpaque(view).takeRetainedValue()",
|
|
44994
|
+
" }",
|
|
44995
|
+
"",
|
|
44996
|
+
" func updateUIView(_ view: UIView, context: Context) {}",
|
|
44997
|
+
"}"
|
|
44998
|
+
] : [
|
|
44999
|
+
" func view(props: JSON) -> _PeachReactNativeWindow { _PeachReactNativeWindow() }",
|
|
45000
|
+
"}"
|
|
45001
|
+
],
|
|
45002
|
+
""
|
|
45003
|
+
].join("\n") : [
|
|
44773
45004
|
'extern "C" void peachTurboInitialize();',
|
|
44774
45005
|
...collection.loads.map(({ symbol: symbol2 }) => `extern "C" void ${symbol2}();`),
|
|
44775
45006
|
"int main(int argc, char **argv) {",
|
|
@@ -45135,7 +45366,7 @@ var init_react_native_core = __esm({
|
|
|
45135
45366
|
init_swift_distribution();
|
|
45136
45367
|
init_swift_package();
|
|
45137
45368
|
init_swiftContract();
|
|
45138
|
-
recipe = true ? "
|
|
45369
|
+
recipe = true ? "96416de7238919b274266f095ef4213211a2a26c133d0df7ab5e0459ded52ef1" : reactNativeCoreDigest2(__sootsim_import_meta_dirname);
|
|
45139
45370
|
strings4 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
45140
45371
|
building = /* @__PURE__ */ new Map();
|
|
45141
45372
|
}
|
|
@@ -50111,7 +50342,7 @@ async function expoDiscoveryKey(options) {
|
|
|
50111
50342
|
const key2 = (0, import_node_crypto28.createHash)("sha256").update(`${peachPin()}\0${hash}\0`).update(`${stable2(JSON.parse(options.searchText))}\0`).update(`${stable2(options.configuration)}\0`).update(stable2(JSON.parse(options.resolveText))).digest("hex");
|
|
50112
50343
|
return { key: key2, root };
|
|
50113
50344
|
}
|
|
50114
|
-
function
|
|
50345
|
+
function expoDiscoveryCacheDir() {
|
|
50115
50346
|
return import_node_path58.default.join(sharedCacheDir(import_node_path58.default.join(ambientHomeDir(), "cache")), "expo-discovery");
|
|
50116
50347
|
}
|
|
50117
50348
|
var EXPIRY_MS = 7 * 24 * 36e5;
|
|
@@ -50154,7 +50385,7 @@ function isStoredUnit(value) {
|
|
|
50154
50385
|
}
|
|
50155
50386
|
function readExpoDiscovery(key2) {
|
|
50156
50387
|
let parsed;
|
|
50157
|
-
const record2 = import_node_path58.default.join(
|
|
50388
|
+
const record2 = import_node_path58.default.join(expoDiscoveryCacheDir(), `${key2}.json`);
|
|
50158
50389
|
try {
|
|
50159
50390
|
parsed = JSON.parse(import_node_fs60.default.readFileSync(record2, "utf8"));
|
|
50160
50391
|
} catch {
|
|
@@ -50183,7 +50414,7 @@ function readExpoDiscovery(key2) {
|
|
|
50183
50414
|
const read = (digest3) => {
|
|
50184
50415
|
const known = blobs.get(digest3);
|
|
50185
50416
|
if (known !== void 0) return known;
|
|
50186
|
-
const blob = import_node_path58.default.join(
|
|
50417
|
+
const blob = import_node_path58.default.join(expoDiscoveryCacheDir(), "blobs", digest3);
|
|
50187
50418
|
const body = import_node_fs60.default.readFileSync(blob, "utf8");
|
|
50188
50419
|
if ((0, import_node_crypto28.createHash)("sha256").update(body).digest("hex") !== digest3)
|
|
50189
50420
|
throw new Error("discovery blob differs from its digest");
|
|
@@ -50231,7 +50462,7 @@ var fileHashes = /* @__PURE__ */ new Map();
|
|
|
50231
50462
|
var fileHashesLoaded = false;
|
|
50232
50463
|
var fileHashesChanged = false;
|
|
50233
50464
|
function fileHashesPath() {
|
|
50234
|
-
return import_node_path58.default.join(
|
|
50465
|
+
return import_node_path58.default.join(expoDiscoveryCacheDir(), "framework-file-hashes.json");
|
|
50235
50466
|
}
|
|
50236
50467
|
function stampedFileHash(file) {
|
|
50237
50468
|
if (!fileHashesLoaded) {
|
|
@@ -50410,7 +50641,7 @@ function rewritePreparedPaths(options) {
|
|
|
50410
50641
|
frameworkDependencies[sourceDir] = sourceDigest;
|
|
50411
50642
|
let portableDir = sourceDir;
|
|
50412
50643
|
if (preparedDigest !== sourceDigest) {
|
|
50413
|
-
const parent = import_node_path58.default.join(
|
|
50644
|
+
const parent = import_node_path58.default.join(expoDiscoveryCacheDir(), "frameworks", preparedDigest);
|
|
50414
50645
|
portableDir = import_node_path58.default.join(parent, import_node_path58.default.basename(dir));
|
|
50415
50646
|
if (!import_node_fs60.default.existsSync(portableDir)) {
|
|
50416
50647
|
import_node_fs60.default.mkdirSync(parent, { recursive: true });
|
|
@@ -50441,7 +50672,7 @@ function rewritePreparedPaths(options) {
|
|
|
50441
50672
|
}
|
|
50442
50673
|
function writeExpoDiscovery(options) {
|
|
50443
50674
|
try {
|
|
50444
|
-
const dir =
|
|
50675
|
+
const dir = expoDiscoveryCacheDir();
|
|
50445
50676
|
import_node_fs60.default.mkdirSync(dir, { recursive: true });
|
|
50446
50677
|
const tmp = import_node_path58.default.join(dir, `.${options.key}.${process.pid}.${(0, import_node_crypto28.randomUUID)()}.tmp`);
|
|
50447
50678
|
if (options.units === null) {
|
|
@@ -50615,7 +50846,7 @@ init_swift_native_pin();
|
|
|
50615
50846
|
init_xcode_project();
|
|
50616
50847
|
var EXPO_NATIVE_ENTRY_NAME = "ios";
|
|
50617
50848
|
function expoNativeCompilerDigestValue() {
|
|
50618
|
-
return true ? "
|
|
50849
|
+
return true ? "064dc6aa590b7937e7499edee9ff07b0ef387a59a35ed48a2d820ab27209917a" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
50619
50850
|
}
|
|
50620
50851
|
var IDENTITY_SOURCE_SKIPS = 1 | 4 | 8 | 16 | 32 | 64 | 128 | 4096;
|
|
50621
50852
|
function readSources(value) {
|
|
@@ -51563,7 +51794,9 @@ function installSwiftInputTrace() {
|
|
|
51563
51794
|
import_node_path85.default.join(swiftCacheDir(), "swift-builds"),
|
|
51564
51795
|
import_node_path85.default.join(swiftCacheDir(), "swift-sdk-views"),
|
|
51565
51796
|
swiftRootLocksDir(),
|
|
51566
|
-
import_node_path85.default.join(cacheDir(), "swift-tmp")
|
|
51797
|
+
import_node_path85.default.join(cacheDir(), "swift-tmp"),
|
|
51798
|
+
// content-addressed records whose reads renew their timestamps for expiry.
|
|
51799
|
+
expoDiscoveryCacheDir()
|
|
51567
51800
|
].filter((prefix, index, all) => all.indexOf(prefix) === index);
|
|
51568
51801
|
ignoredRoots = prefixes.flatMap((root) => {
|
|
51569
51802
|
try {
|
|
@@ -51669,11 +51902,13 @@ async function witnessMatches(witness) {
|
|
|
51669
51902
|
return true;
|
|
51670
51903
|
}
|
|
51671
51904
|
async function discoveryKey(root, installedWorkspace, prepareNative, iosTarget, moduleRoot) {
|
|
51672
|
-
const
|
|
51905
|
+
const preparesWorkspace = prepareNative && !installedWorkspace && nativeWorkspaceAvailable();
|
|
51906
|
+
const [config, expoConfig, workspace] = await Promise.all([
|
|
51673
51907
|
loadRNXAppConfig(resolveAppProject(root)),
|
|
51674
|
-
readExpoConfigAsync(root)
|
|
51908
|
+
readExpoConfigAsync(root),
|
|
51909
|
+
preparesWorkspace ? traceStore.exit(() => hashExpoWorkspace(root)) : null
|
|
51675
51910
|
]);
|
|
51676
|
-
return `${import_node_fs87.default.realpathSync(root)}\0${installedWorkspace ?? ""}\0${iosTarget ?? ""}\0${moduleRoot ?? ""}\0${prepareNative ? "1" : "0"}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}`;
|
|
51911
|
+
return `${import_node_fs87.default.realpathSync(root)}\0${installedWorkspace ?? ""}\0${iosTarget ?? ""}\0${moduleRoot ?? ""}\0${prepareNative ? "1" : "0"}\0${JSON.stringify(config)}\0${JSON.stringify(expoConfig)}\0${workspace?.hash ?? ""}`;
|
|
51677
51912
|
}
|
|
51678
51913
|
function cloneNativeTarget(target) {
|
|
51679
51914
|
return {
|
|
@@ -52956,7 +53191,11 @@ function expoEntry(units, oneSDK = false) {
|
|
|
52956
53191
|
(unit2) => Object.keys(unit2.files).some((file) => file.startsWith(`Sources/${namespace}/`))
|
|
52957
53192
|
)
|
|
52958
53193
|
);
|
|
52959
|
-
const bridgeModules = units.flatMap(
|
|
53194
|
+
const bridgeModules = units.flatMap(
|
|
53195
|
+
(unit2) => unit2.bridgeModules.map(
|
|
53196
|
+
(registration) => registration === `${unit2.namespace}.__peachReactModule_${unit2.namespace}()` ? registration.slice(unit2.namespace.length + 1) : registration
|
|
53197
|
+
)
|
|
53198
|
+
);
|
|
52960
53199
|
const subscribers = units.flatMap((unit2) => unit2.appDelegateSubscribers);
|
|
52961
53200
|
const handlers = units.flatMap((unit2) => unit2.reactDelegateHandlers);
|
|
52962
53201
|
const delegates = subscribers.length + handlers.length > 0 ? `; PeachExpoRuntime.registerDelegates(subscribers: [${subscribers.join(", ")}], handlers: [${handlers.join(", ")}])` : "";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2301 | (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/home-paths.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2301 | (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;
|