peachsim 0.1.1814 → 0.1.1817

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 (115) hide show
  1. package/cli/commands/control.ts +5 -2
  2. package/cli/commands/inspect.ts +43 -385
  3. package/cli/commands/package.ts +88 -32
  4. package/cli/commands/runtime.ts +2 -2
  5. package/cli/outbound-endpoints.ts +2 -2
  6. package/cli/packaged-app-launcher.ts +6 -1
  7. package/dist-lib/agent-daemon-client.cjs +1 -1
  8. package/dist-lib/agent-events.cjs +1 -1
  9. package/dist-lib/attached-projects.cjs +1 -1
  10. package/dist-lib/auth/shared-session.cjs +1 -1
  11. package/dist-lib/backend-origin.cjs +1 -1
  12. package/dist-lib/beta.cjs +1 -1
  13. package/dist-lib/beta.mjs +1 -1
  14. package/dist-lib/bridge-constants.cjs +1 -1
  15. package/dist-lib/bridge-contract-input.cjs +1 -1
  16. package/dist-lib/bridge-contract-input.mjs +1 -1
  17. package/dist-lib/bridge-contract.cjs +1 -1
  18. package/dist-lib/bridge-contract.mjs +1 -1
  19. package/dist-lib/bundle-channel.cjs +5186 -5881
  20. package/dist-lib/capture-contract.cjs +1 -1
  21. package/dist-lib/capture-contract.mjs +1 -1
  22. package/dist-lib/cloud-contract.cjs +1 -1
  23. package/dist-lib/cloud-contract.mjs +1 -1
  24. package/dist-lib/cloud-test-args.cjs +1 -1
  25. package/dist-lib/cloud-test-args.mjs +1 -1
  26. package/dist-lib/cloud.cjs +1 -1
  27. package/dist-lib/cloud.mjs +1 -1
  28. package/dist-lib/config.cjs +1 -1
  29. package/dist-lib/config.mjs +1 -1
  30. package/dist-lib/detox/index.cjs +100 -16
  31. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  32. package/dist-lib/expo-swift-bundle.cjs +3949 -4535
  33. package/dist-lib/expo-swift-metadata.cjs +1 -1
  34. package/dist-lib/expo-swift-metadata.mjs +1 -1
  35. package/dist-lib/home-paths.cjs +1 -1
  36. package/dist-lib/host/bridge-host.cjs +3724 -4482
  37. package/dist-lib/host/fetch-proxy-handler.cjs +25 -14
  38. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  39. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  40. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  41. package/dist-lib/host/websocket-proxy.cjs +1 -1
  42. package/dist-lib/index.cjs +26 -36
  43. package/dist-lib/jump-to-source-babel.cjs +1 -1
  44. package/dist-lib/jump-to-source-native.cjs +1 -1
  45. package/dist-lib/kotlin-host.cjs +1 -1
  46. package/dist-lib/menu.cjs +1 -1
  47. package/dist-lib/menu.mjs +1 -1
  48. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  49. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  50. package/dist-lib/metro-production-bundle.cjs +1 -1
  51. package/dist-lib/metro-production-bundle.mjs +1 -1
  52. package/dist-lib/metro.cjs +26 -36
  53. package/dist-lib/native-app-identity-project.cjs +4 -23
  54. package/dist-lib/native-app-identity-project.mjs +4 -23
  55. package/dist-lib/native-app-identity.cjs +1 -1
  56. package/dist-lib/native-app-identity.mjs +1 -1
  57. package/dist-lib/native-firebase-metadata.cjs +1 -1
  58. package/dist-lib/native-firebase-metadata.mjs +1 -1
  59. package/dist-lib/pdfium-raster.cjs +1 -1
  60. package/dist-lib/pdfium-raster.mjs +1 -1
  61. package/dist-lib/plist.cjs +1 -1
  62. package/dist-lib/plist.mjs +1 -1
  63. package/dist-lib/profiles.cjs +1 -1
  64. package/dist-lib/public-brand.cjs +1 -1
  65. package/dist-lib/public-origins-lib-esm.json +24 -24
  66. package/dist-lib/public-origins-lib.json +87 -76
  67. package/dist-lib/react-native-host-modules.cjs +1 -1
  68. package/dist-lib/react-native-host-modules.mjs +1 -1
  69. package/dist-lib/reap-browser.cjs +1 -1
  70. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  71. package/dist-lib/sdk.cjs +1 -1
  72. package/dist-lib/sdk.mjs +1 -1
  73. package/dist-lib/skills.cjs +4265 -4982
  74. package/dist-lib/swift-compile.cjs +218 -243
  75. package/dist-lib/swift-compile.mjs +218 -243
  76. package/dist-lib/swift-package.cjs +1 -1
  77. package/dist-lib/swift-package.mjs +1 -1
  78. package/dist-lib/swift-submit.cjs +1 -1
  79. package/dist-lib/swift-submit.mjs +1 -1
  80. package/dist-lib/swift-toolchain.cjs +1 -1
  81. package/dist-lib/swift.cjs +1 -1
  82. package/dist-lib/vite-swift.cjs +274 -251
  83. package/dist-lib/vite.cjs +25 -14
  84. package/dist-lib/worklet-executable.cjs +1 -1
  85. package/dist-lib/worklet-executable.mjs +1 -1
  86. package/dist-types/packages/peach-engine/src/engine/nativeReplayContract.d.ts +2 -0
  87. package/package.json +1 -1
  88. package/runtime-companion.json +1 -1
  89. package/src/answeredNativePackages.ts +41 -0
  90. package/src/cli-runtime.ts +34 -13
  91. package/src/expo-discovery-cache.ts +2 -0
  92. package/src/expo-kotlin-host.ts +11 -9
  93. package/src/expo-swift-host.ts +10 -6
  94. package/src/expo-swift-ready.ts +16 -2
  95. package/src/installed-native-libraries.ts +79 -18
  96. package/src/nitro-adapter.lock.json +240 -240
  97. package/src/nitro-bundle.ts +8 -6
  98. package/src/nitro-compile.ts +6 -3
  99. package/src/nitro-compiler-digest.ts +2 -4
  100. package/src/nitro-dependencies.ts +8 -2
  101. package/src/nitro-source.ts +34 -3
  102. package/src/nitro-superset.lock.json +21 -253
  103. package/src/nitro-superset.ts +59 -63
  104. package/src/nitroContract.ts +26 -3
  105. package/src/react-native-bridge-modules.ts +2 -4
  106. package/src/runtime-delivery.ts +2 -2
  107. package/src/swift-compile.ts +260 -255
  108. package/src/swift-distribution.lock.json +9 -8
  109. package/src/swift-installed-targets.ts +13 -0
  110. package/src/swift-objc-standin.ts +10 -6
  111. package/src/swift-standins.ts +44 -14
  112. package/src/turbo-bundle.ts +20 -1
  113. package/src/turbo-compile.ts +6 -12
  114. package/src/turbo-runtime.lock.json +19 -19
  115. package/src/turbo-source.ts +18 -3
@@ -1,4 +1,4 @@
1
- /*! peach v0.1.1814 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
1
+ /*! peach v0.1.1817 | (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;
@@ -3796,26 +3796,6 @@ var NATIVE_GRAPH_INPUTS = {
3796
3796
  target: IOS_SDK_TARGET
3797
3797
  };
3798
3798
  var NATIVE_GRAPH_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
3799
- function stripExternalSourceMarks(text2) {
3800
- return text2.split("\n").map(
3801
- (line) => line.startsWith("#define PEACH_SWIFT_CLASS(") ? line : line.replace(/PEACH_SWIFT_CLASS\(\w+\)\s*/g, "")
3802
- ).join("\n");
3803
- }
3804
- function iosSdkEntries() {
3805
- const overlays = Object.entries(IOS_SDK_OVERLAYS).map(
3806
- ([module2, text2]) => [
3807
- `usr/lib/swift/${module2}.swiftmodule/arm64-apple-ios-simulator.swiftinterface`,
3808
- `// swift-interface-format-version: 1.0
3809
- // swift-module-flags: -target ${IOS_SDK_TARGET} -enable-objc-interop -enable-library-evolution -module-name ${module2}
3810
- ${text2}`
3811
- ]
3812
- );
3813
- const headers = Object.entries(IOS_SDK_HEADERS).map(
3814
- ([file, text2]) => [file, stripExternalSourceMarks(text2)]
3815
- );
3816
- return [...headers, ...overlays].sort(([a], [b]) => a < b ? -1 : 1);
3817
- }
3818
- var IOS_SDK_ID = (0, import_node_crypto3.createHash)("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
3819
3799
  function objcSdkIntakeFlags(headers, toolchainBin, minimum) {
3820
3800
  return [
3821
3801
  ...swiftObjCPlatformFlags(toolchainBin, minimum),
@@ -7500,7 +7480,8 @@ var OPTIONAL_FRAMEWORK_DEPENDENCIES = {
7500
7480
  TOCropViewController: [],
7501
7481
  RiveRuntime: ["MetalKit"],
7502
7482
  MetalKit: ["ModelIO"],
7503
- DatadogCore: [],
7483
+ DatadogInternal: [],
7484
+ DatadogCore: ["DatadogInternal"],
7504
7485
  DatadogLogs: ["DatadogCore"],
7505
7486
  DatadogRUM: ["DatadogCore"],
7506
7487
  DatadogTrace: ["DatadogCore"],
@@ -7852,7 +7833,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
7852
7833
  var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
7853
7834
  var MULTI_MANIFEST_VERSION = 65;
7854
7835
  var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
7855
- var compilerSourceDigest = true ? "d62fae69578799a35cdf0157f54acf3e1a0c1688de92c4c991c69287b9e562bb" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
7836
+ var compilerSourceDigest = true ? "1519f1f37c446535792f7bb0c9ba9c5e59b0b0f87d7b5c849346abe684325aa7" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
7856
7837
  function swiftArtifactHash(input, release, moduleRoot) {
7857
7838
  const hash = (0, import_node_crypto8.createHash)("sha256");
7858
7839
  hash.update(`swift-compile
@@ -11667,245 +11648,239 @@ function compileSwiftProjectUnit(input, options) {
11667
11648
  `swift-compile: no swift.org toolchain at ${options.toolchainBin}; install ${options.release} and its matching wasm sdk`
11668
11649
  );
11669
11650
  }
11670
- return withSwiftRootLock(
11671
- swiftFrameworkScratch(frameworkKey),
11672
- async (frameworkLease) => {
11673
- const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
11674
- report("preparing compiler plugins");
11675
- const macroPlugins = await ensureMacroPlugins(
11676
- frameworkRoot,
11677
- options.toolchainBin,
11678
- options.release,
11679
- options.signal,
11680
- frameworkLease
11681
- );
11682
- const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId;
11683
- const icu = swiftIcuAsset(options.toolchainBin, sdk);
11684
- const buildOptions = {
11685
- env: {
11686
- ...options.project?.env ?? process.env,
11687
- // shipped host plugins resolve against the selected compiler's runtime.
11688
- ...process.platform === "linux" ? {
11689
- LD_LIBRARY_PATH: [
11690
- import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/linux"),
11691
- import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/host"),
11692
- process.env.LD_LIBRARY_PATH
11693
- ].filter(Boolean).join(":")
11694
- } : {},
11695
- ...input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: "1" } : {}
11696
- },
11697
- maxBuffer: 64 * 1024 * 1024,
11698
- timeout: options.timeoutMs,
11699
- signal: options.signal,
11700
- lease,
11701
- frameworkLease
11702
- };
11703
- let prebuilt;
11704
- if (!swiftDistributionAt(moduleRoot)) {
11705
- report("compiling framework products");
11706
- prebuilt = await compileFrameworkProducts({
11707
- moduleRoot: frameworkRoot,
11708
- frameworkKey,
11709
- input,
11710
- swift,
11711
- sdk,
11712
- toolchainBin: options.toolchainBin,
11713
- plugins: macroPlugins,
11714
- buildOptions
11715
- });
11716
- await pruneFrameworkScratches(frameworkKey);
11717
- }
11718
- if (options.project) removeProjectLinks(root);
11719
- if (retireStaleSwiftLink(
11720
- root,
11721
- swiftLinkStamp({
11722
- frameworkKey,
11723
- prebuilt
11724
- })
11725
- ))
11726
- report("framework revision changed; rebuilding the app link");
11727
- const preparation = writeSwiftProject(
11728
- layout,
11651
+ const frameworkScratch = swiftFrameworkScratch(frameworkKey);
11652
+ const withFrameworkLock = (work) => distribution ? work() : withSwiftRootLock(frameworkScratch, work, options.signal);
11653
+ return withFrameworkLock(async (frameworkLease) => {
11654
+ const frameworkRoot = stageFrameworkSource(moduleRoot, frameworkKey);
11655
+ report("preparing compiler plugins");
11656
+ const pluginsFor = (pluginLease) => ensureMacroPlugins(
11657
+ frameworkRoot,
11658
+ options.toolchainBin,
11659
+ options.release,
11660
+ options.signal,
11661
+ pluginLease
11662
+ );
11663
+ const macroPlugins = distribution ? await withSwiftRootLock(frameworkScratch, pluginsFor, options.signal) : await pluginsFor(frameworkLease);
11664
+ const sdk = swiftModuleSdk(frameworkRoot).wasmSdkId;
11665
+ const icu = swiftIcuAsset(options.toolchainBin, sdk);
11666
+ const buildOptions = {
11667
+ env: {
11668
+ ...options.project?.env ?? process.env,
11669
+ // shipped host plugins resolve against the selected compiler's runtime.
11670
+ ...process.platform === "linux" ? {
11671
+ LD_LIBRARY_PATH: [
11672
+ import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/linux"),
11673
+ import_node_path19.default.resolve(options.toolchainBin, "../lib/swift/host"),
11674
+ process.env.LD_LIBRARY_PATH
11675
+ ].filter(Boolean).join(":")
11676
+ } : {},
11677
+ ...input.lazyDistribution ? { PEACH_DEFER_WASM_LINK: "1" } : {}
11678
+ },
11679
+ maxBuffer: 64 * 1024 * 1024,
11680
+ timeout: options.timeoutMs,
11681
+ signal: options.signal,
11682
+ lease,
11683
+ frameworkLease
11684
+ };
11685
+ let prebuilt;
11686
+ if (!distribution) {
11687
+ report("compiling framework products");
11688
+ prebuilt = await compileFrameworkProducts({
11689
+ moduleRoot: frameworkRoot,
11690
+ frameworkKey,
11729
11691
  input,
11730
- frameworkRoot,
11692
+ swift,
11693
+ sdk,
11694
+ toolchainBin: options.toolchainBin,
11695
+ plugins: macroPlugins,
11696
+ buildOptions
11697
+ });
11698
+ await pruneFrameworkScratches(frameworkKey);
11699
+ }
11700
+ if (options.project) removeProjectLinks(root);
11701
+ if (retireStaleSwiftLink(
11702
+ root,
11703
+ swiftLinkStamp({
11704
+ frameworkKey,
11731
11705
  prebuilt
11706
+ })
11707
+ ))
11708
+ report("framework revision changed; rebuilding the app link");
11709
+ const preparation = writeSwiftProject(layout, input, frameworkRoot, prebuilt);
11710
+ writeSwiftAutolinkLinker(root, options.toolchainBin);
11711
+ const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
11712
+ const appOptions = projectProcess ? {
11713
+ ...buildOptions,
11714
+ uid: projectProcess.uid,
11715
+ gid: projectProcess.gid,
11716
+ confined: projectProcess.env
11717
+ } : buildOptions;
11718
+ const unprepared = preparation.targetFailures.map(
11719
+ (failure) => `error: target ${failure}`
11720
+ );
11721
+ const forwarders = /* @__PURE__ */ new Map();
11722
+ for (const [file, text2] of Object.entries(input.files)) {
11723
+ const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text2)?.[1];
11724
+ if (!parents) continue;
11725
+ const directory = import_node_path19.default.posix.dirname(file);
11726
+ forwarders.set(
11727
+ `${import_node_path19.default.join(root, directory)}/${parents.slice(0, -1)}`,
11728
+ import_node_path19.default.posix.join("build", directory, parents).replace(/\/$/, "")
11732
11729
  );
11733
- writeSwiftAutolinkLinker(root, options.toolchainBin);
11734
- const projectProcess = options.project ? prepareSwiftProjectProcess(root, options.project) : void 0;
11735
- const appOptions = projectProcess ? {
11736
- ...buildOptions,
11737
- uid: projectProcess.uid,
11738
- gid: projectProcess.gid,
11739
- confined: projectProcess.env
11740
- } : buildOptions;
11741
- const unprepared = preparation.targetFailures.map(
11742
- (failure) => `error: target ${failure}`
11743
- );
11744
- const forwarders = /* @__PURE__ */ new Map();
11745
- for (const [file, text2] of Object.entries(input.files)) {
11746
- const parents = /^#include "((?:\.\.\/)+)[^"\n]+"\n$/.exec(text2)?.[1];
11747
- if (!parents) continue;
11748
- const directory = import_node_path19.default.posix.dirname(file);
11749
- forwarders.set(
11750
- `${import_node_path19.default.join(root, directory)}/${parents.slice(0, -1)}`,
11751
- import_node_path19.default.posix.join("build", directory, parents).replace(/\/$/, "")
11730
+ }
11731
+ const buildArgs = [
11732
+ "build",
11733
+ ...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
11734
+ "--build-system",
11735
+ "native",
11736
+ "-j",
11737
+ BUILD_JOBS,
11738
+ "--package-path",
11739
+ root,
11740
+ ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
11741
+ "--swift-sdk",
11742
+ sdk,
11743
+ ...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
11744
+ "-c",
11745
+ "release",
11746
+ "-Xswiftc",
11747
+ "-num-threads",
11748
+ "-Xswiftc",
11749
+ BUILD_JOBS,
11750
+ ...swiftReproducibleBuildFlags([
11751
+ [import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
11752
+ [frameworkRoot, "framework"],
11753
+ [root, "build"],
11754
+ ...forwarders
11755
+ ]),
11756
+ ...macroPlugins.libraries.flatMap((plugin) => [
11757
+ "-Xswiftc",
11758
+ "-load-plugin-library",
11759
+ "-Xswiftc",
11760
+ plugin
11761
+ ]),
11762
+ ...macroPlugins.executables.flatMap((plugin) => [
11763
+ "-Xswiftc",
11764
+ "-load-plugin-executable",
11765
+ "-Xswiftc",
11766
+ `${plugin}#ExpoModulesMacros`
11767
+ ])
11768
+ ];
11769
+ const linked = builtArtifact(layout);
11770
+ if (input.lazyDistribution) {
11771
+ (0, import_node_fs17.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
11772
+ if ((0, import_node_fs17.existsSync)(linked) && (0, import_node_fs17.statSync)(linked).size <= 8)
11773
+ (0, import_node_fs17.rmSync)(linked, { force: true });
11774
+ }
11775
+ report("compiling and linking Swift modules");
11776
+ try {
11777
+ const headerBuilds = preparation.headerProductTarget ? [
11778
+ ...Object.keys(preparation.nativeHeaderDeclarations),
11779
+ preparation.headerProductTarget
11780
+ ] : preparation.headerProducers;
11781
+ for (const build of headerBuilds) {
11782
+ await runCompiler(
11783
+ swift,
11784
+ [...buildArgs, "--target", build],
11785
+ appOptions,
11786
+ SWIFTPM_PROGRESS,
11787
+ SWIFTPM_NOISE
11752
11788
  );
11789
+ for (const producer of build === preparation.headerProductTarget ? preparation.headerProducers : [build]) {
11790
+ const emitted = import_node_path19.default.join(
11791
+ root,
11792
+ ".build",
11793
+ "peach-cxx-headers",
11794
+ `${producer}-Swift.h`
11795
+ );
11796
+ const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
11797
+ if ((0, import_node_fs17.existsSync)(original))
11798
+ writeBuildFile(
11799
+ emitted,
11800
+ withoutSwiftDeclarations(
11801
+ clangInterfaceHeader((0, import_node_fs17.readFileSync)(original, "utf8")),
11802
+ new Set(preparation.nativeHeaderDeclarations[producer]),
11803
+ `#import <${producer}/${producer}.h>`
11804
+ )
11805
+ );
11806
+ }
11753
11807
  }
11754
- const buildArgs = [
11755
- "build",
11756
- ...projectProcess?.cacheOptions ?? swiftPackageCacheOptions(),
11757
- "--build-system",
11758
- "native",
11759
- "-j",
11760
- BUILD_JOBS,
11761
- "--package-path",
11808
+ await runCompiler(
11809
+ swift,
11810
+ buildArgs,
11811
+ appOptions,
11812
+ SWIFTPM_PROGRESS,
11813
+ SWIFTPM_NOISE
11814
+ );
11815
+ } catch (error) {
11816
+ const output2 = outputOf(error);
11817
+ const moduleCache = import_node_path19.default.join(
11762
11818
  root,
11763
- ...swiftCompileSdkOptions(frameworkRoot, options.toolchainBin),
11764
- "--swift-sdk",
11765
- sdk,
11766
- ...input.packageFiles || prebuilt ? ["--toolset", import_node_path19.default.join(root, ".peach-target-toolset.json")] : [],
11767
- "-c",
11819
+ ".build",
11820
+ WASM_TRIPLE,
11768
11821
  "release",
11769
- "-Xswiftc",
11770
- "-num-threads",
11771
- "-Xswiftc",
11772
- BUILD_JOBS,
11773
- ...swiftReproducibleBuildFlags([
11774
- [import_node_path19.default.dirname(options.toolchainBin), "toolchain"],
11775
- [frameworkRoot, "framework"],
11776
- [root, "build"],
11777
- ...forwarders
11778
- ]),
11779
- ...macroPlugins.libraries.flatMap((plugin) => [
11780
- "-Xswiftc",
11781
- "-load-plugin-library",
11782
- "-Xswiftc",
11783
- plugin
11784
- ]),
11785
- ...macroPlugins.executables.flatMap((plugin) => [
11786
- "-Xswiftc",
11787
- "-load-plugin-executable",
11788
- "-Xswiftc",
11789
- `${plugin}#ExpoModulesMacros`
11790
- ])
11791
- ];
11792
- const linked = builtArtifact(layout);
11793
- if (input.lazyDistribution) {
11794
- (0, import_node_fs17.rmSync)(import_node_path19.default.join(root, ".peach-link.rsp"), { force: true });
11795
- if ((0, import_node_fs17.existsSync)(linked) && (0, import_node_fs17.statSync)(linked).size <= 8)
11796
- (0, import_node_fs17.rmSync)(linked, { force: true });
11797
- }
11798
- report("compiling and linking Swift modules");
11799
- try {
11800
- const headerBuilds = preparation.headerProductTarget ? [
11801
- ...Object.keys(preparation.nativeHeaderDeclarations),
11802
- preparation.headerProductTarget
11803
- ] : preparation.headerProducers;
11804
- for (const build of headerBuilds) {
11822
+ "ModuleCache"
11823
+ );
11824
+ if (output2.includes("was compiled with module cache path") && (0, import_node_fs17.existsSync)(moduleCache)) {
11825
+ (0, import_node_fs17.rmSync)(moduleCache, { recursive: true, force: true });
11826
+ try {
11805
11827
  await runCompiler(
11806
11828
  swift,
11807
- [...buildArgs, "--target", build],
11829
+ buildArgs,
11808
11830
  appOptions,
11809
11831
  SWIFTPM_PROGRESS,
11810
11832
  SWIFTPM_NOISE
11811
11833
  );
11812
- for (const producer of build === preparation.headerProductTarget ? preparation.headerProducers : [build]) {
11813
- const emitted = import_node_path19.default.join(
11814
- root,
11815
- ".build",
11816
- "peach-cxx-headers",
11817
- `${producer}-Swift.h`
11818
- );
11819
- const original = preparation.nativeHeaderDeclarations[producer] ? emitted.replace(/-Swift\.h$/, "-Swift.original.h") : emitted;
11820
- if ((0, import_node_fs17.existsSync)(original))
11821
- writeBuildFile(
11822
- emitted,
11823
- withoutSwiftDeclarations(
11824
- clangInterfaceHeader((0, import_node_fs17.readFileSync)(original, "utf8")),
11825
- new Set(preparation.nativeHeaderDeclarations[producer]),
11826
- `#import <${producer}/${producer}.h>`
11827
- )
11828
- );
11829
- }
11830
- }
11831
- await runCompiler(
11832
- swift,
11833
- buildArgs,
11834
- appOptions,
11835
- SWIFTPM_PROGRESS,
11836
- SWIFTPM_NOISE
11837
- );
11838
- } catch (error) {
11839
- const output2 = outputOf(error);
11840
- const moduleCache = import_node_path19.default.join(
11841
- root,
11842
- ".build",
11843
- WASM_TRIPLE,
11844
- "release",
11845
- "ModuleCache"
11846
- );
11847
- if (output2.includes("was compiled with module cache path") && (0, import_node_fs17.existsSync)(moduleCache)) {
11848
- (0, import_node_fs17.rmSync)(moduleCache, { recursive: true, force: true });
11849
- try {
11850
- await runCompiler(
11851
- swift,
11852
- buildArgs,
11853
- appOptions,
11854
- SWIFTPM_PROGRESS,
11855
- SWIFTPM_NOISE
11856
- );
11857
- } catch (retryError) {
11858
- throw new Error(
11859
- [
11860
- ...unprepared,
11861
- projectDiagnostic(outputOf(retryError), layout, input.files)
11862
- ].join("\n"),
11863
- { cause: retryError }
11864
- );
11865
- }
11866
- } else {
11834
+ } catch (retryError) {
11867
11835
  throw new Error(
11868
- [...unprepared, projectDiagnostic(output2, layout, input.files)].join(
11869
- "\n"
11870
- ),
11871
- { cause: error }
11836
+ [
11837
+ ...unprepared,
11838
+ projectDiagnostic(outputOf(retryError), layout, input.files)
11839
+ ].join("\n"),
11840
+ { cause: retryError }
11872
11841
  );
11873
11842
  }
11874
- } finally {
11875
- if (options.project) endSwiftProjectProcesses(options.project);
11876
- }
11877
- if (unprepared.length) throw new Error(unprepared.join("\n"));
11878
- if (!(0, import_node_fs17.existsSync)(linked)) {
11879
- const binDir = import_node_path19.default.dirname(linked);
11880
- const found = (0, import_node_fs17.existsSync)(binDir) ? (0, import_node_fs17.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
11843
+ } else {
11881
11844
  throw new Error(
11882
- `swift-compile: the build produced no ${import_node_path19.default.basename(linked)} (found: ${found.join(", ") || "none"})`
11883
- );
11884
- }
11885
- if (options.project) removeProjectLinks(root);
11886
- const output = options.project ? projectOutputFile(root, linked, options.project) : linked;
11887
- const optimized = `${output}.optimized`;
11888
- if (input.lazyDistribution) {
11889
- pruneSwiftWasmLink(
11890
- root,
11891
- options.toolchainBin,
11892
- frameworkRoot,
11893
- input.staticClangTargets
11845
+ [...unprepared, projectDiagnostic(output2, layout, input.files)].join(
11846
+ "\n"
11847
+ ),
11848
+ { cause: error }
11894
11849
  );
11895
- await optimizeWasm(output, optimized);
11896
11850
  }
11897
- const artifact = {
11898
- hash,
11899
- bytes: (0, import_node_fs17.readFileSync)(input.lazyDistribution ? optimized : output),
11900
- icu: await icu
11901
- };
11902
- if (!options.project) saveCompiledArtifact(root, artifact);
11903
- saveSharedArtifact(sharedRoot, artifact);
11904
- report("compiled artifact verified");
11905
- return retain(root, artifact);
11906
- },
11907
- options.signal
11908
- );
11851
+ } finally {
11852
+ if (options.project) endSwiftProjectProcesses(options.project);
11853
+ }
11854
+ if (unprepared.length) throw new Error(unprepared.join("\n"));
11855
+ if (!(0, import_node_fs17.existsSync)(linked)) {
11856
+ const binDir = import_node_path19.default.dirname(linked);
11857
+ const found = (0, import_node_fs17.existsSync)(binDir) ? (0, import_node_fs17.readdirSync)(binDir).filter((name2) => name2.endsWith(".wasm")).sort() : [];
11858
+ throw new Error(
11859
+ `swift-compile: the build produced no ${import_node_path19.default.basename(linked)} (found: ${found.join(", ") || "none"})`
11860
+ );
11861
+ }
11862
+ if (options.project) removeProjectLinks(root);
11863
+ const output = options.project ? projectOutputFile(root, linked, options.project) : linked;
11864
+ const optimized = `${output}.optimized`;
11865
+ if (input.lazyDistribution) {
11866
+ pruneSwiftWasmLink(
11867
+ root,
11868
+ options.toolchainBin,
11869
+ frameworkRoot,
11870
+ input.staticClangTargets
11871
+ );
11872
+ await optimizeWasm(output, optimized);
11873
+ }
11874
+ const artifact = {
11875
+ hash,
11876
+ bytes: (0, import_node_fs17.readFileSync)(input.lazyDistribution ? optimized : output),
11877
+ icu: await icu
11878
+ };
11879
+ if (!options.project) saveCompiledArtifact(root, artifact);
11880
+ saveSharedArtifact(sharedRoot, artifact);
11881
+ report("compiled artifact verified");
11882
+ return retain(root, artifact);
11883
+ });
11909
11884
  },
11910
11885
  options.signal
11911
11886
  );