peachsim 0.1.1654 → 0.1.1655

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.
Files changed (82) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +1 -1
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +1 -1
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +1 -1
  13. package/dist-lib/bundle-channel.cjs +237 -196
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +1 -1
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +1 -1
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +1 -1
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +1 -1
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +1 -1
  24. package/dist-lib/detox/index.cjs +2 -2
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/expo-swift-bundle.cjs +237 -196
  27. package/dist-lib/expo-swift-metadata.cjs +1 -1
  28. package/dist-lib/expo-swift-metadata.mjs +1 -1
  29. package/dist-lib/home-paths.cjs +1 -1
  30. package/dist-lib/host/bridge-host.cjs +264 -208
  31. package/dist-lib/host/fetch-proxy-handler.cjs +28 -13
  32. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  33. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  34. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  35. package/dist-lib/host/websocket-proxy.cjs +1 -1
  36. package/dist-lib/index.cjs +2 -2
  37. package/dist-lib/jump-to-source-babel.cjs +1 -1
  38. package/dist-lib/jump-to-source-native.cjs +1 -1
  39. package/dist-lib/kotlin-host.cjs +1 -1
  40. package/dist-lib/menu.cjs +1 -1
  41. package/dist-lib/menu.mjs +1 -1
  42. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  43. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  44. package/dist-lib/metro-production-bundle.cjs +1 -1
  45. package/dist-lib/metro-production-bundle.mjs +1 -1
  46. package/dist-lib/metro.cjs +1 -1
  47. package/dist-lib/native-app-identity-project.cjs +1 -1
  48. package/dist-lib/native-app-identity-project.mjs +1 -1
  49. package/dist-lib/native-app-identity.cjs +1 -1
  50. package/dist-lib/native-app-identity.mjs +1 -1
  51. package/dist-lib/native-firebase-metadata.cjs +1 -1
  52. package/dist-lib/native-firebase-metadata.mjs +1 -1
  53. package/dist-lib/plist.cjs +1 -1
  54. package/dist-lib/plist.mjs +1 -1
  55. package/dist-lib/profiles.cjs +1 -1
  56. package/dist-lib/public-brand.cjs +1 -1
  57. package/dist-lib/public-origins-lib-esm.json +23 -23
  58. package/dist-lib/public-origins-lib.json +51 -51
  59. package/dist-lib/react-native-host-modules.cjs +1 -1
  60. package/dist-lib/react-native-host-modules.mjs +1 -1
  61. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  62. package/dist-lib/sdk.cjs +1 -1
  63. package/dist-lib/sdk.mjs +1 -1
  64. package/dist-lib/skills.cjs +265 -209
  65. package/dist-lib/swift-compile.cjs +237 -196
  66. package/dist-lib/swift-compile.mjs +237 -196
  67. package/dist-lib/swift-package.cjs +1 -1
  68. package/dist-lib/swift-package.mjs +1 -1
  69. package/dist-lib/swift-submit.cjs +1 -1
  70. package/dist-lib/swift-submit.mjs +1 -1
  71. package/dist-lib/swift-toolchain.cjs +1 -1
  72. package/dist-lib/swift.cjs +1 -1
  73. package/dist-lib/vite-swift.cjs +237 -196
  74. package/dist-lib/vite.cjs +2 -2
  75. package/dist-lib/worklet-executable.cjs +1 -1
  76. package/dist-lib/worklet-executable.mjs +1 -1
  77. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +4 -0
  78. package/package.json +1 -1
  79. package/runtime-companion.json +1 -1
  80. package/src/host/fetch-proxy-handler.ts +27 -10
  81. package/src/swift-compile.ts +286 -237
  82. package/src/swiftContract.ts +2 -0
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -27951,7 +27951,7 @@ var EXECUTABLE_LINK_FLAGS = ` "-Xclang-linker", "-O0",
27951
27951
  `;
27952
27952
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
27953
27953
  var MULTI_MANIFEST_VERSION = 39;
27954
- var compilerSourceDigest = true ? "bcd59db8ba588a1eb76c6f08e64f5b5b6acda2e913adef5edd85345fef2c0cc7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
27954
+ var compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
27955
27955
  function swiftArtifactHash(input, release, moduleRoot) {
27956
27956
  const hash2 = (0, import_node_crypto7.createHash)("sha256");
27957
27957
  hash2.update(`swift-compile
@@ -32118,6 +32118,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
32118
32118
  ] : compileTargets(input);
32119
32119
  const files2 = /* @__PURE__ */ new Map();
32120
32120
  const native = /* @__PURE__ */ new Map();
32121
+ const targetFailures = [];
32121
32122
  const bySourcePath = [...targets].sort(
32122
32123
  (left, right) => right.path.length - left.path.length
32123
32124
  );
@@ -32168,188 +32169,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
32168
32169
  if (units.length === 0) continue;
32169
32170
  const settings = input.nativeTargets?.find((value) => value.name === target.name);
32170
32171
  if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
32171
- if (!settings)
32172
- throw new Error(
32173
- `mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
32172
+ const swift = entries.some(([file]) => file.endsWith(".swift"));
32173
+ try {
32174
+ if (!settings)
32175
+ throw new Error(
32176
+ `mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
32177
+ );
32178
+ const headers = settings.headers;
32179
+ const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
32180
+ for (const file of headers) {
32181
+ const destination = import_node_path7.default.join(layout.root, file);
32182
+ (0, import_node_fs6.mkdirSync)(import_node_path7.default.dirname(destination), { recursive: true });
32183
+ (0, import_node_fs6.writeFileSync)(destination, input.files[file]);
32184
+ }
32185
+ const search = [
32186
+ .../* @__PURE__ */ new Set([
32187
+ ...settings?.headerSearchPaths ?? [],
32188
+ ...headers.map((file) => import_node_path7.default.posix.dirname(file))
32189
+ ])
32190
+ ].flatMap((dir) => ["-I", import_node_path7.default.join(layout.root, dir)]);
32191
+ const pin = distribution ?? JSON.parse((0, import_node_fs6.readFileSync)(import_node_path7.default.join(moduleRoot, "toolchain.json"), "utf8"));
32192
+ const release = pin.release;
32193
+ const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
32194
+ const sdkHeaders = materializeObjcSdk(
32195
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk")
32174
32196
  );
32175
- const headers = settings.headers;
32176
- const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
32177
- if (!roots2.length)
32178
- throw new Error(`mixed target ${target.name} has no original declaration headers`);
32179
- for (const file of headers) {
32180
- const destination = import_node_path7.default.join(layout.root, file);
32181
- (0, import_node_fs6.mkdirSync)(import_node_path7.default.dirname(destination), { recursive: true });
32182
- (0, import_node_fs6.writeFileSync)(destination, input.files[file]);
32183
- }
32184
- const search = [
32185
- .../* @__PURE__ */ new Set([
32186
- ...settings?.headerSearchPaths ?? [],
32187
- ...headers.map((file) => import_node_path7.default.posix.dirname(file))
32188
- ])
32189
- ].flatMap((dir) => ["-I", import_node_path7.default.join(layout.root, dir)]);
32190
- const pin = distribution ?? JSON.parse((0, import_node_fs6.readFileSync)(import_node_path7.default.join(moduleRoot, "toolchain.json"), "utf8"));
32191
- const release = pin.release;
32192
- const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
32193
- const sdkHeaders = materializeObjcSdk(
32194
- import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk")
32195
- );
32196
- const stageFlags = (flags2, sdkInclude) => flags2.map(
32197
- (flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
32198
- );
32199
- const originalFlags = [
32200
- ...settings?.flags ?? [],
32201
- ...search,
32202
- ...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
32203
- "-F",
32204
- import_node_path7.default.join(layout.root, dir)
32205
- ]),
32206
- "-I",
32207
- headerDirectory
32208
- ];
32209
- const flags = stageFlags(
32210
- originalFlags,
32211
- import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
32212
- );
32213
- const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path7.default.join(layout.root, settings.prefixHeader)] : [];
32214
- const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
32215
- target: target.name,
32216
- path: target.path,
32217
- resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
32218
- usesBundleMacro: entries.some(
32219
- ([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
32220
- ),
32221
- bundles: input.resourceBundles
32222
- });
32223
- const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
32224
- const accessorHeader = import_node_path7.default.join(
32225
- layout.root,
32226
- target.path,
32227
- OBJC_RESOURCE_ACCESSOR_HEADER
32228
- );
32229
- const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
32230
- if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
32231
- throw new Error(`target ${target.name} already contains its resource accessor`);
32232
- const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
32233
- const accessorFlags = accessor ? ["-include", accessorHeader] : [];
32234
- if (accessor) {
32235
- files2.set(accessorHeader, accessor.header);
32236
- files2.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
32237
- }
32238
- const sourceHeaders = import_node_path7.default.join(
32239
- layout.root,
32240
- ".build",
32241
- "peach-objc-originals",
32242
- target.name
32243
- );
32244
- (0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
32245
- const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
32246
- (0, import_node_fs6.writeFileSync)(
32247
- modulemap,
32248
- `module ${swiftTargetModuleName(target.name)} {
32197
+ const stageFlags = (flags2, sdkInclude) => flags2.map(
32198
+ (flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
32199
+ );
32200
+ const originalFlags = [
32201
+ ...settings?.flags ?? [],
32202
+ ...search,
32203
+ ...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
32204
+ "-F",
32205
+ import_node_path7.default.join(layout.root, dir)
32206
+ ]),
32207
+ "-I",
32208
+ headerDirectory
32209
+ ];
32210
+ const flags = stageFlags(
32211
+ originalFlags,
32212
+ import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
32213
+ );
32214
+ const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path7.default.join(layout.root, settings.prefixHeader)] : [];
32215
+ const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
32216
+ target: target.name,
32217
+ path: target.path,
32218
+ resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
32219
+ usesBundleMacro: entries.some(
32220
+ ([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
32221
+ ),
32222
+ bundles: input.resourceBundles
32223
+ });
32224
+ const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
32225
+ const accessorHeader = import_node_path7.default.join(
32226
+ layout.root,
32227
+ target.path,
32228
+ OBJC_RESOURCE_ACCESSOR_HEADER
32229
+ );
32230
+ const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
32231
+ if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
32232
+ throw new Error(`target ${target.name} already contains its resource accessor`);
32233
+ const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
32234
+ const accessorFlags = accessor ? ["-include", accessorHeader] : [];
32235
+ if (accessor) {
32236
+ files2.set(accessorHeader, accessor.header);
32237
+ files2.set(import_node_path7.default.join(layout.root, accessorUnit), accessor.body);
32238
+ }
32239
+ if (roots2.length) {
32240
+ const sourceHeaders = import_node_path7.default.join(
32241
+ layout.root,
32242
+ ".build",
32243
+ "peach-objc-originals",
32244
+ target.name
32245
+ );
32246
+ (0, import_node_fs6.mkdirSync)(sourceHeaders, { recursive: true });
32247
+ const modulemap = import_node_path7.default.join(sourceHeaders, "module.modulemap");
32248
+ (0, import_node_fs6.writeFileSync)(
32249
+ modulemap,
32250
+ `module ${swiftTargetModuleName(target.name)} {
32249
32251
  ${roots2.map((file) => `header ${JSON.stringify(import_node_path7.default.join(layout.root, file))}`).join("\n")}
32250
32252
  export *
32251
32253
  }
32252
32254
  `
32253
- );
32254
- const view = objcView(
32255
- { module: swiftTargetModuleName(target.name), headers: sourceHeaders, modulemap },
32256
- toolchainBin,
32257
- import_node_path7.default.join(moduleRoot, "ios-simulator-stdlib"),
32258
- import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk"),
32259
- import_node_path7.default.join(layout.root, ".build", "peach-objc-imports", target.name),
32260
- {
32261
- flags: stageFlags(originalFlags, import_node_path7.default.join(sdkHeaders, "usr/include")),
32262
- target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
32263
- }
32264
- );
32265
- const defined = /* @__PURE__ */ new Set();
32266
- const declarations = (node) => {
32267
- if (!node || typeof node !== "object") return;
32268
- const name3 = Reflect.get(node, "name");
32269
- if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name3 === "string")
32270
- defined.add(name3);
32271
- const children = Reflect.get(node, "inner");
32272
- if (Array.isArray(children)) for (const child of children) declarations(child);
32273
- };
32274
- declarations(view.clangAST);
32275
- const foreignTypes = /* @__PURE__ */ new Map();
32276
- for (const graph of view.graphs)
32277
- for (const symbol of graph.symbols) {
32278
- const nativeName = /^c:objc\(cs\)(\w+)$/.exec(symbol.identifier.precise)?.[1];
32279
- if (nativeName && defined.has(nativeName))
32280
- foreignTypes.set(symbol.pathComponents[0], nativeName);
32255
+ );
32256
+ const view = objcView(
32257
+ {
32258
+ module: swiftTargetModuleName(target.name),
32259
+ headers: sourceHeaders,
32260
+ modulemap
32261
+ },
32262
+ toolchainBin,
32263
+ import_node_path7.default.join(moduleRoot, "ios-simulator-stdlib"),
32264
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-sdk"),
32265
+ import_node_path7.default.join(layout.root, ".build", "peach-objc-imports", target.name),
32266
+ {
32267
+ flags: stageFlags(originalFlags, import_node_path7.default.join(sdkHeaders, "usr/include")),
32268
+ target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
32269
+ }
32270
+ );
32271
+ const defined = /* @__PURE__ */ new Set();
32272
+ const declarations = (node) => {
32273
+ if (!node || typeof node !== "object") return;
32274
+ const name3 = Reflect.get(node, "name");
32275
+ if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name3 === "string")
32276
+ defined.add(name3);
32277
+ const children = Reflect.get(node, "inner");
32278
+ if (Array.isArray(children)) for (const child of children) declarations(child);
32279
+ };
32280
+ declarations(view.clangAST);
32281
+ const foreignTypes = /* @__PURE__ */ new Map();
32282
+ for (const graph of view.graphs)
32283
+ for (const symbol of graph.symbols) {
32284
+ const nativeName = /^c:objc\(cs\)(\w+)$/.exec(
32285
+ symbol.identifier.precise
32286
+ )?.[1];
32287
+ if (nativeName && defined.has(nativeName))
32288
+ foreignTypes.set(symbol.pathComponents[0], nativeName);
32289
+ }
32290
+ imports.set(target.name, {
32291
+ view,
32292
+ classes: [...foreignTypes.values()],
32293
+ headers: roots2.map((file) => import_node_path7.default.join(layout.root, file)),
32294
+ foreignTypes
32295
+ });
32281
32296
  }
32282
- imports.set(target.name, {
32283
- view,
32284
- classes: [...foreignTypes.values()],
32285
- headers: roots2.map((file) => import_node_path7.default.join(layout.root, file)),
32286
- foreignTypes
32287
- });
32288
- const thunk = "PeachObjCImports.generated.m";
32289
- const groups = /* @__PURE__ */ new Map();
32290
- for (const [file] of nativeUnits) {
32291
- const origin = settings?.sourceDirectories[file];
32292
- if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
32293
- const perFile = [
32294
- ...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
32295
- ...stageFlags(
32296
- settings?.fileFlags[file] ?? [],
32297
- import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
32298
- )
32299
- ];
32300
- const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
32301
- const identity = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
32302
- const group = groups.get(identity) ?? {
32303
- name: `${target.name}SwiftImplementation_${identity}`,
32304
- sources: [],
32305
- flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
32306
- cxxFlags: [
32307
- ...flags,
32308
- ...prefixHeader,
32309
- ...accessorFlags,
32297
+ const thunks = roots2.length ? ["PeachObjCImports.generated.m"] : [];
32298
+ const groups = /* @__PURE__ */ new Map();
32299
+ for (const [file] of nativeUnits) {
32300
+ const origin = settings?.sourceDirectories[file];
32301
+ if (origin) (0, import_node_fs6.mkdirSync)(import_node_path7.default.join(layout.root, origin), { recursive: true });
32302
+ const perFile = [
32303
+ ...origin ? ["-iquote", import_node_path7.default.join(layout.root, origin)] : [],
32310
32304
  ...stageFlags(
32311
- cxx ? settings.cxxFlags : [],
32305
+ settings?.fileFlags[file] ?? [],
32312
32306
  import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
32313
- ),
32314
- ...perFile
32315
- ]
32316
- };
32317
- group.sources.push(file.slice(prefix.length));
32318
- groups.set(identity, group);
32319
- }
32320
- groups.set("imports", {
32321
- name: `${target.name}ObjCImports`,
32322
- sources: [thunk],
32323
- flags: [...flags, "-fobjc-arc"],
32324
- cxxFlags: [...flags, "-fobjc-arc"]
32325
- });
32326
- const include2 = import_node_path7.default.join(layout.root, target.path, "include");
32327
- files2.set(
32328
- import_node_path7.default.join(include2, "module.modulemap"),
32329
- `module ${target.name}ImplementationDeclarations { export * }
32330
- `
32331
- );
32332
- native.set(target.name, {
32333
- mixed: true,
32334
- path: target.path,
32335
- includeDirectory: include2,
32336
- sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
32337
- lateSources: [...nativeUnits.map(([file]) => file.slice(prefix.length)), thunk],
32338
- exclude: [
32339
- ...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
32340
- ...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
32341
- thunk,
32342
- "include"
32343
- ],
32344
- groups: [...groups.values()],
32345
- late: {
32346
- name: `${target.name}SwiftImplementation`,
32347
- producers: [
32348
- target.name,
32349
- ...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
32350
- ]
32307
+ )
32308
+ ];
32309
+ const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
32310
+ const identity = (0, import_node_crypto7.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
32311
+ const group = groups.get(identity) ?? {
32312
+ name: `${target.name}SwiftImplementation_${identity}`,
32313
+ sources: [],
32314
+ flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
32315
+ cxxFlags: [
32316
+ ...flags,
32317
+ ...prefixHeader,
32318
+ ...accessorFlags,
32319
+ ...stageFlags(
32320
+ cxx ? settings.cxxFlags : [],
32321
+ import_node_path7.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
32322
+ ),
32323
+ ...perFile
32324
+ ]
32325
+ };
32326
+ group.sources.push(file.slice(prefix.length));
32327
+ groups.set(identity, group);
32351
32328
  }
32352
- });
32329
+ if (thunks.length)
32330
+ groups.set("imports", {
32331
+ name: `${target.name}ObjCImports`,
32332
+ sources: thunks,
32333
+ flags: [...flags, "-fobjc-arc"],
32334
+ cxxFlags: [...flags, "-fobjc-arc"]
32335
+ });
32336
+ const include2 = import_node_path7.default.join(layout.root, target.path, "include");
32337
+ files2.set(
32338
+ import_node_path7.default.join(include2, "module.modulemap"),
32339
+ `module ${target.name}ImplementationDeclarations { export * }
32340
+ `
32341
+ );
32342
+ native.set(target.name, {
32343
+ mixed: true,
32344
+ path: target.path,
32345
+ includeDirectory: include2,
32346
+ sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
32347
+ lateSources: [
32348
+ ...nativeUnits.map(([file]) => file.slice(prefix.length)),
32349
+ ...thunks
32350
+ ],
32351
+ exclude: [
32352
+ ...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
32353
+ ...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
32354
+ ...thunks,
32355
+ "include"
32356
+ ],
32357
+ groups: [...groups.values()],
32358
+ late: {
32359
+ name: `${target.name}SwiftImplementation`,
32360
+ producers: [
32361
+ target.name,
32362
+ ...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
32363
+ ]
32364
+ }
32365
+ });
32366
+ } catch (error) {
32367
+ if (!swift || !(error instanceof Error)) throw error;
32368
+ targetFailures.push(`${target.name}: ${error.message}`);
32369
+ native.set(target.name, {
32370
+ mixed: true,
32371
+ path: target.path,
32372
+ includeDirectory: import_node_path7.default.join(layout.root, target.path, "include"),
32373
+ sources: [],
32374
+ lateSources: [],
32375
+ exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
32376
+ });
32377
+ }
32353
32378
  continue;
32354
32379
  }
32355
32380
  const includes = `${prefix}include/`;
@@ -32512,20 +32537,27 @@ export *
32512
32537
  for (const name3 of objcProducers) {
32513
32538
  const target = targets.find((value) => value.name === name3);
32514
32539
  const prefix = target.path === "." ? "" : `${target.path}/`;
32515
- const exported = swiftObjCExports({
32516
- module: swiftTargetModuleName(name3),
32517
- sources: Object.entries(input.files).filter(
32518
- ([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
32519
- (candidate) => candidate.name !== name3 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
32520
- ) && !target.exclude?.some(
32521
- (excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
32522
- )
32523
- ),
32524
- mask: swiftCodeMask,
32525
- declarationStart,
32526
- selector: objcSelectorName,
32527
- foreignTypes: imports.get(name3)?.foreignTypes
32528
- });
32540
+ let exported;
32541
+ try {
32542
+ exported = swiftObjCExports({
32543
+ module: swiftTargetModuleName(name3),
32544
+ sources: Object.entries(input.files).filter(
32545
+ ([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
32546
+ (candidate) => candidate.name !== name3 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
32547
+ ) && !target.exclude?.some(
32548
+ (excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
32549
+ )
32550
+ ),
32551
+ mask: swiftCodeMask,
32552
+ declarationStart,
32553
+ selector: objcSelectorName,
32554
+ foreignTypes: imports.get(name3)?.foreignTypes
32555
+ });
32556
+ } catch (error) {
32557
+ if (!(error instanceof Error)) throw error;
32558
+ targetFailures.push(`${name3}: ${error.message}`);
32559
+ continue;
32560
+ }
32529
32561
  const original = imports.get(name3);
32530
32562
  if (!exported && !original) continue;
32531
32563
  objcModules.add(name3);
@@ -32797,6 +32829,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
32797
32829
  for (const dependency of dependencies.get(producer) ?? []) include(dependency);
32798
32830
  return {
32799
32831
  headerProducers: producers.filter((name3) => !included.has(name3)),
32832
+ targetFailures,
32800
32833
  ...rootOwner && objcExports ? {
32801
32834
  objcImplementations: {
32802
32835
  owner: import_node_path7.default.join(layout.root, rootOwner),
@@ -33019,6 +33052,9 @@ function compileSwiftProjectUnit(input, options) {
33019
33052
  return retain(root, built2);
33020
33053
  }
33021
33054
  const preparation = writeSwiftProject(layout, input, moduleRoot);
33055
+ const unprepared = preparation.targetFailures.map(
33056
+ (failure2) => `error: target ${failure2}`
33057
+ );
33022
33058
  const swift = import_node_path7.default.join(options.toolchainBin, "swift");
33023
33059
  if (!(0, import_node_fs6.existsSync)(swift)) {
33024
33060
  throw new Error(
@@ -33168,18 +33204,23 @@ function compileSwiftProjectUnit(input, options) {
33168
33204
  );
33169
33205
  } catch (retryError) {
33170
33206
  throw new Error(
33171
- projectDiagnostic(outputOf(retryError), layout, input.files),
33172
- {
33173
- cause: retryError
33174
- }
33207
+ [
33208
+ ...unprepared,
33209
+ projectDiagnostic(outputOf(retryError), layout, input.files)
33210
+ ].join("\n"),
33211
+ { cause: retryError }
33175
33212
  );
33176
33213
  }
33177
33214
  } else {
33178
- throw new Error(projectDiagnostic(output, layout, input.files), {
33179
- cause: error
33180
- });
33215
+ throw new Error(
33216
+ [...unprepared, projectDiagnostic(output, layout, input.files)].join(
33217
+ "\n"
33218
+ ),
33219
+ { cause: error }
33220
+ );
33181
33221
  }
33182
33222
  }
33223
+ if (unprepared.length) throw new Error(unprepared.join("\n"));
33183
33224
  const artifact = {
33184
33225
  hash: hash2,
33185
33226
  bytes: (0, import_node_fs6.readFileSync)(builtArtifact(layout)),
package/dist-lib/vite.cjs CHANGED
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __create = Object.create;
@@ -36,7 +36,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
36
36
  var runtime_companion_default;
37
37
  var init_runtime_companion = __esm({
38
38
  "runtime-companion.json"() {
39
- runtime_companion_default = { abi: 1, sha256: "a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623", file: "node/cli-a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623.cjs" };
39
+ runtime_companion_default = { abi: 1, sha256: "6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce", file: "node/cli-6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce.cjs" };
40
40
  }
41
41
  });
42
42
 
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
  let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
3
3
  "use strict";
4
4
  var __defProp = Object.defineProperty;
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1654 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
2
2
 
3
3
  // src/worklet-executable.ts
4
4
  import { parse } from "acorn";
@@ -84,6 +84,10 @@ export declare function stripRolldownBundleInventoryFooter(source: string): stri
84
84
  export declare function hasRolldownInventoryMarkers(source: string): boolean;
85
85
  export declare function buildRolldownBundleInventory(source: string): Promise<RolldownBundleInventory>;
86
86
  export declare function attachRolldownBundleInventory(source: string): Promise<string>;
87
+ export declare function releasableMultipartPrefix(payload: string, contentType: string): {
88
+ length: number;
89
+ bundleStarted: boolean;
90
+ };
87
91
  export declare function attachRolldownBundleHttpPayload(payload: string, contentType: string | undefined): Promise<string>;
88
92
  export declare function readRolldownBundleInventory(source: string): Promise<RolldownBundleInventory>;
89
93
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peachsim",
3
- "version": "0.1.1654",
3
+ "version": "0.1.1655",
4
4
  "description": "Vite and Metro plugins, testing drivers, and SDK exports for peach.",
5
5
  "author": "Tamagui LLC",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -1 +1 @@
1
- {"abi":1,"sha256":"a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623","file":"node/cli-a1b49c57129dd06888a9cdfbb05051be3626e8233980236705a3efd52b651623.cjs"}
1
+ {"abi":1,"sha256":"6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce","file":"node/cli-6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce.cjs"}
@@ -27,6 +27,7 @@
27
27
  import http, { type IncomingMessage, type ServerResponse } from 'http'
28
28
  import https from 'https'
29
29
  import { Http2ServerRequest, type Http2ServerResponse } from 'node:http2'
30
+ import { Readable } from 'stream'
30
31
  import { finished, pipeline } from 'stream/promises'
31
32
  import {
32
33
  isLoopbackHost,
@@ -513,22 +514,38 @@ async function proxyUpstream(
513
514
  targetUrl.pathname.endsWith('.bundle') &&
514
515
  proxyRes.headers['x-peach-rolldown-inventory'] !== '1'
515
516
  ) {
516
- const chunks: Buffer[] = []
517
- for await (const chunk of proxyRes) {
518
- chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk))
519
- }
520
- const payload = Buffer.concat(chunks).toString('utf8')
521
517
  const contentType =
522
518
  typeof proxyRes.headers['content-type'] === 'string'
523
519
  ? proxyRes.headers['content-type']
524
- : undefined
525
- const annotated =
526
- await getCliRuntime().rolldown_bundle_inventory.attachRolldownBundleHttpPayload(
520
+ : ''
521
+ const inventory = getCliRuntime().rolldown_bundle_inventory
522
+ res.removeHeader('content-length')
523
+ // metro's multipart build progress has to reach the client while the
524
+ // build runs, so everything before the bundle part's body streams through
525
+ // as it arrives and only the bundle itself waits for its inventory
526
+ const annotate = async function* () {
527
+ const decoder = new TextDecoder()
528
+ let payload = ''
529
+ let sent = 0
530
+ let bundleStarted = false
531
+ for await (const chunk of proxyRes) {
532
+ payload += decoder.decode(chunk, { stream: true })
533
+ if (bundleStarted) continue
534
+ const releasable = inventory.releasableMultipartPrefix(payload, contentType)
535
+ bundleStarted = releasable.bundleStarted
536
+ if (releasable.length > sent) {
537
+ yield Buffer.from(payload.slice(sent, releasable.length), 'utf8')
538
+ sent = releasable.length
539
+ }
540
+ }
541
+ payload += decoder.decode()
542
+ const annotated = await inventory.attachRolldownBundleHttpPayload(
527
543
  payload,
528
544
  contentType,
529
545
  )
530
- res.removeHeader('content-length')
531
- res.end(Buffer.from(annotated, 'utf8'))
546
+ yield Buffer.from(annotated.slice(sent), 'utf8')
547
+ }
548
+ await pipeline(Readable.from(annotate(), { objectMode: false }), res)
532
549
  return
533
550
  }
534
551
  await pipeline(proxyRes, res)