peachsim 0.1.2935 → 0.1.2937
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/LICENSE +6 -8
- package/cli/account-gate.ts +20 -3
- package/cli/app-bundle-resources.ts +66 -19
- package/cli/catalog/meta.ts +2 -106
- package/cli/command-agent.ts +7 -0
- package/cli/command-registry.ts +0 -1
- package/cli/commands/control.ts +13 -5
- package/cli/commands/daemon.ts +4 -2
- package/cli/commands/device.ts +78 -8
- package/cli/commands/do-chain.ts +11 -8
- package/cli/commands/inspect/core.ts +4 -9
- package/cli/commands/inspect/settling.ts +1 -0
- package/cli/commands/logout.ts +6 -1
- package/cli/commands/map.ts +2 -6
- package/cli/commands/package.ts +112 -57
- package/cli/commands/shell-url.ts +0 -1
- package/cli/download-auth.ts +2 -0
- package/cli/drivers/playwright-provisioning.ts +10 -38
- package/cli/github-workflow-identity.ts +8 -0
- package/cli/internal-child-contract.ts +1 -0
- package/cli/internal-child.ts +5 -0
- package/cli/main.ts +2 -10
- package/cli/outbound-endpoints.ts +26 -0
- package/detox/index.ts +227 -131
- 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 +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +47 -3
- package/dist-lib/bridge-contract-input.mjs +6 -6
- package/dist-lib/bridge-contract.cjs +10 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +12779 -9515
- package/dist-lib/capture-contract.cjs +39 -17
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +8 -8
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +6 -6
- package/dist-lib/detox/index.cjs +200 -132
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-Q5TRRYSO.mjs → acorn-IIBLEO25.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UDWBTBVG.mjs → chunk-4FTPQKPT.mjs} +10 -1
- package/dist-lib/esm-chunks/chunk-4WIDTRBB.mjs +10232 -0
- package/dist-lib/esm-chunks/{chunk-LCMFYMT7.mjs → chunk-5QZOQ3NZ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BJ2OGUX7.mjs → chunk-CIY67HNL.mjs} +39 -17
- package/dist-lib/esm-chunks/{chunk-SKQTNQYE.mjs → chunk-CQFEMJ64.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-AXWVXRHX.mjs → chunk-CWVMCW23.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MTALOHQR.mjs → chunk-F6DZ4DS2.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I4R7IZRD.mjs → chunk-HJMF6O7L.mjs} +74 -46
- package/dist-lib/esm-chunks/chunk-I6T4PXJF.mjs +154 -0
- package/dist-lib/esm-chunks/{chunk-XWAUZKIA.mjs → chunk-IJU3JMWM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-CXWUIOCH.mjs → chunk-KODEPXQC.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-WJE5QHSD.mjs → chunk-LD4K2VBL.mjs} +155 -36
- package/dist-lib/esm-chunks/{chunk-2TSM64HI.mjs → chunk-LTE7YMEG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-3GGOXUJA.mjs → chunk-M3CSKAJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-7G5UETIG.mjs → chunk-NA6DJPB6.mjs} +43 -1
- package/dist-lib/esm-chunks/{chunk-MSUHMNAI.mjs → chunk-NNAX24FS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VDJA4LP4.mjs → chunk-PZPJJBAS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UEEEJVQA.mjs → chunk-QXSTHMWN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-S2RJB5I7.mjs → chunk-RBPVK5YI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-VRAXNGYT.mjs → chunk-SCT5OFDV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-T3M73LGP.mjs → chunk-U3CJGYSP.mjs} +50 -6
- package/dist-lib/esm-chunks/{chunk-SLUGTGQQ.mjs → chunk-VXTOQ522.mjs} +12 -6
- package/dist-lib/esm-chunks/{chunk-EL44SZMV.mjs → chunk-WMSVGYTH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-FEDEPSEV.mjs → chunk-WRWINRWK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BNO52N2S.mjs → chunk-YZF2USRD.mjs} +1905 -8760
- package/dist-lib/esm-chunks/{chunk-TQLKYMVP.mjs → chunk-ZNHR6C3L.mjs} +1 -1
- package/dist-lib/esm-chunks/{download-auth-registry-G75MIT55.mjs → download-auth-registry-AHS5MSIB.mjs} +4 -4
- package/dist-lib/esm-chunks/{metro-layout-parser-FXLUDTYT.mjs → metro-layout-parser-24ZYK5UP.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-524D4MA2.mjs → swift-package-prebuilt-L4YNXQRD.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-app-module-EX544YJY.mjs → swift-sdk-app-module-RM652JSW.mjs} +87 -71
- package/dist-lib/esm-chunks/{swift-sdk-image-LOTMWVM7.mjs → swift-sdk-image-5PQ44UJT.mjs} +15 -15
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-UO6B3M4U.mjs → swift-sdk-image-producer-GD3SM6YI.mjs} +5 -5
- package/dist-lib/esm-chunks/swift-sdk-later-data-62QYJ2KH.mjs +590 -0
- package/dist-lib/expo-swift-bundle.cjs +21037 -17896
- package/dist-lib/expo-swift-metadata.cjs +8 -2
- package/dist-lib/expo-swift-metadata.mjs +9 -8
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +22481 -18741
- package/dist-lib/host/fetch-proxy-handler.cjs +21079 -17980
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +68 -38
- package/dist-lib/kotlin-host.cjs +97 -21
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +23 -1
- package/dist-lib/metro-production-bundle.mjs +24 -4
- package/dist-lib/native-app-identity-project.cjs +3582 -571
- package/dist-lib/native-app-identity-project.mjs +1024 -398
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +132 -116
- package/dist-lib/public-origins-lib.json +215 -173
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +17 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +6 -7
- package/dist-lib/sdk.mjs +13 -14
- package/dist-lib/skills.cjs +23216 -19650
- package/dist-lib/swift-compile.cjs +4337 -2905
- package/dist-lib/swift-compile.mjs +15 -13
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +19 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +94 -32
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +8 -5
- package/dist-lib/worklet-executable.mjs +9 -6
- package/dist-types/packages/peach-engine/src/canvaskit-artifact-urls.d.ts +2 -1
- package/dist-types/packages/peach-engine/src/capture/compositor-presentation-recording.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/generated/canvaskit-artifact-hashes.d.ts +26 -0
- package/dist-types/packages/peach-engine/src/engine/guest-scene-inspect.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/engine/inspect-info.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/metalTypes.d.ts +32 -2
- package/dist-types/packages/peach-engine/src/engine/portalContract.d.ts +24 -0
- package/dist-types/packages/peach-engine/src/engine/remote-display-protocol.d.ts +12 -2
- package/dist-types/packages/peach-engine/src/guest/http-cookie-storage.d.ts +73 -0
- package/dist-types/packages/peach-engine/src/guest/native-evaluation-lease.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/guest/nitro-jsi-host.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/ios/apps/canvas-map-data.d.ts +225 -9
- package/dist-types/packages/peach-engine/src/ios/chrome-metrics.d.ts +4 -1
- package/dist-types/packages/peach-engine/src/ios/duo-vertical-bar-geometry.d.ts +0 -1
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-compositor.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/remote-stream/canvas-display-contract.d.ts +44 -10
- package/dist-types/packages/peach-engine/src/remote-stream/cloud-display.d.ts +4 -3
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +2 -4
- package/dist-types/packages/peach-engine/src/render-worker/metro-bundle-metadata.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-widgetContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +15 -27
- package/dist-types/packages/peach-engine/src/render-worker/reanimated-readiness.d.ts +2 -6
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +11 -3
- package/dist-types/packages/peach-engine/src/settings/devices.d.ts +3 -1
- package/dist-types/packages/peach-engine/src/settings/duo-fold.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/app-bundle-resources.d.ts +10 -0
- package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/hostStorageBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +2 -2
- package/dist-types/packages/peach-globals/src/lockstepCaptureBridgeContract.d.ts +9 -6
- package/dist-types/packages/peach-globals/src/nodeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/oneWidgetContract.d.ts +28 -0
- package/package.json +2 -2
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreHaptics.framework/Headers/CoreHaptics.h +251 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INImage.h +14 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntent.h +18 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentIdentifiers.h +30 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INIntentResponse.h +12 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INInteraction.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectCollection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INObjectSection.h +0 -7
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INOutgoingMessageType.h +7 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPerson.h +36 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INPersonHandle.h +22 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent+UserNotifications.h +6 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSendMessageIntent.h +33 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/INSpeakableString.h +24 -0
- package/sdk/ios/System/Library/Frameworks/Intents.framework/Headers/Intents.h +11 -7
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +0 -8
- package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +8 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/SLServiceTypes.h +9 -0
- package/sdk/ios/System/Library/Frameworks/Social.framework/Headers/Social.h +1 -0
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotification.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAction.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationAttachment.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationCategory.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationContent.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationRequest.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationResponse.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationSound.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UserNotifications.framework/Headers/UNNotificationTrigger.h +5 -5
- package/sdk/ios/usr/lib/swift/UIKit.swiftmodule/arm64-apple-ios-simulator.swiftinterface +4 -0
- package/sdk/ios/wasm/include/unistd.h +1 -0
- package/src/acorn-program.ts +3 -0
- package/src/audio-codec-archives.ts +141 -0
- package/src/bridge-contract-input.ts +61 -1
- package/src/bridge-contract.ts +45 -4
- package/src/bundle-channel.mjs +44 -30
- package/src/capture-contract.ts +57 -39
- package/src/conformance-comparison-contract.ts +2 -0
- package/src/expo-discovery-cache.ts +0 -2
- package/src/expo-macro-host.ts +8 -3
- package/src/expo-native-compiler-digest.ts +0 -1
- package/src/expo-native-prebuilt.ts +1 -1
- package/src/expo-native-workspace.ts +83 -45
- package/src/expo-pod-prebuilt.ts +1 -0
- package/src/expo-swift-host.ts +158 -77
- package/src/expo-swift-legacy-runtime-source.ts +12 -1
- package/src/expo-swift-view-source.ts +51 -20
- package/src/expo-workspace-exclusion.ts +7 -1
- package/src/expoSwiftContract.ts +10 -1
- package/src/ffmpeg-source-build.ts +123 -59
- package/src/genrule-archives.ts +7 -2
- package/src/genrule-library-builds.ts +101 -18
- package/src/host/bridge-host.ts +10 -1
- package/src/installed-native-libraries.ts +147 -23
- package/src/installed-package-versions.ts +30 -0
- package/src/ios-rn-bundle-request.ts +3 -1
- package/src/ios-rn-bundle.ts +38 -27
- package/src/ios-rn-compile.ts +23 -6
- package/src/ios-rn-startup.ts +2 -1
- package/src/java-module-abi.ts +4 -3
- package/src/kotlin-host.ts +4 -4
- package/src/kotlin-library-sources.ts +8 -5
- package/src/metro-production-bundle.ts +24 -0
- package/src/native-firebase-config.ts +2 -0
- package/src/native-framework-compiler.ts +5 -0
- package/src/native-package-slice-build.ts +3 -0
- package/src/native-package-slice.ts +15 -10
- package/src/native-preparation.ts +4 -1
- package/src/native-static-libraries.ts +107 -33
- package/src/nativeRuntimePackageIndex.ts +1 -4
- package/src/nitro-adapter.lock.json +286 -286
- package/src/nitro-app-providers.ts +20 -8
- package/src/nitro-compile.ts +131 -37
- package/src/nitro-dependencies.ts +42 -8
- package/src/nitro-source.ts +40 -36
- package/src/nitro-superset.lock.json +4 -4
- package/src/nitroAdapterContract.ts +32 -7
- package/src/nitroContract.ts +21 -37
- package/src/one-direct-host-source.ts +247 -140
- package/src/one-fabric.ts +129 -0
- package/src/one-native-controls-package.ts +95 -21
- package/src/one-native-controls-release.ts +147 -14
- package/src/one-native-source.ts +4 -1
- package/src/one-nitro-inputs.ts +1 -1
- package/src/one-nitro-source.ts +45 -1
- package/src/one-sdk/source.ts +10 -41
- package/src/one-widget-metadata.ts +2 -2
- package/src/one-widget-package.ts +1 -1
- package/src/oneSdkContract.ts +3 -0
- package/src/playwright-browser-paths.ts +30 -0
- package/src/pods-install.ts +6 -2
- package/src/pods-post-install.ts +2 -2
- package/src/pods-project.ts +10 -0
- package/src/podspec-ruby-stdlib.ts +73 -0
- package/src/podspec-ruby.ts +1 -1
- package/src/podspec-sources.ts +31 -13
- package/src/process-group.ts +135 -5
- package/src/published-swift-sdk.ts +25 -1
- package/src/react-native-bridge-modules.ts +35 -3
- package/src/react-native-core-build.ts +14 -2
- package/src/react-native-core.ts +12 -2
- package/src/rive-runtime-dependencies.ts +178 -40
- package/src/serverDiscoveryContract.ts +1 -1
- package/src/storageSnapshotContract.ts +1 -1
- package/src/swift-app-data-store.ts +35 -0
- package/src/swift-compile.ts +403 -121
- package/src/swift-compiler-digest.ts +4 -0
- package/src/swift-darwin-records.ts +6 -0
- package/src/swift-distribution-mirror.ts +10 -1
- package/src/swift-distribution.lock.json +19 -18
- package/src/swift-distribution.ts +17 -1
- package/src/swift-entry-module.ts +1 -0
- package/src/swift-guest-compile.ts +8 -1
- package/src/swift-host.ts +79 -23
- package/src/swift-installed-targets.ts +51 -20
- package/src/swift-objc-standin.ts +60 -8
- package/src/swift-packages.ts +104 -24
- package/src/swift-project-user.ts +2 -1
- package/src/swift-reproducible.ts +99 -1
- package/src/swift-root-lock.ts +52 -46
- package/src/swift-sdk-app-module.ts +65 -13
- package/src/swift-sdk-image-producer.ts +2 -1
- package/src/swift-sdk-image.ts +23 -8
- package/src/swift-sdk-later-data.ts +294 -44
- package/src/swift-sdk-surface.ts +233 -55
- package/src/swift-shared-sdk.ts +7 -0
- package/src/swift-standin-builtin-behavior.ts +18 -0
- package/src/swift-standin-emit.ts +242 -54
- package/src/swift-standins.ts +184 -38
- package/src/swift-startup-split.ts +19 -9
- package/src/swift-toolchain.ts +18 -0
- package/src/swift-wasm-prune.ts +179 -9
- package/src/swift-xcframework.ts +16 -0
- package/src/swiftContract.ts +4 -1
- package/src/swiftSdkLinkContract.ts +2 -0
- package/src/swiftTargetContract.ts +1 -0
- package/src/turbo-bundle.ts +6 -3
- package/src/turbo-codegen-intake.ts +106 -16
- package/src/turbo-compile.ts +89 -68
- package/src/turbo-fabric-app.ts +287 -23
- package/src/turbo-provider-host.ts +122 -31
- package/src/turbo-runtime.lock.json +26 -26
- package/src/turbo-source.ts +374 -157
- package/src/vite-plugin.ts +48 -112
- package/src/wasm-binary-sections.ts +40 -0
- package/src/wasm-code-immediates.ts +35 -5
- package/src/widget-extension-bundle.ts +15 -1
- package/src/worklet-executable.ts +2 -1
- package/src/worklet-kernel.ts +5 -3
- package/src/worklets-babel.ts +2 -1
- package/src/xcode-project.ts +151 -53
- package/src/xcode-scheme-actions.ts +104 -0
- package/cli/commands/canvas.ts +0 -1204
- package/dist-lib/esm-chunks/chunk-B5QD2KEV.mjs +0 -2787
- package/dist-lib/vendor/magic-string.cjs +0 -1693
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +0 -127
- package/src/appBundleResourcesContract.ts +0 -51
- package/src/canvas-groups.ts +0 -28
- package/src/canvas-map-layout.ts +0 -161
- package/src/oneWidgetContract.ts +0 -134
package/src/xcode-project.ts
CHANGED
|
@@ -38,8 +38,10 @@ import {
|
|
|
38
38
|
swiftToolchainBin,
|
|
39
39
|
} from './swift-toolchain'
|
|
40
40
|
import { simulatorNativeLibrary } from './swift-xcframework'
|
|
41
|
+
import { findWorkspaceRoot } from './workspace-root'
|
|
41
42
|
import { preparePortableIntent } from './xcode-intents'
|
|
42
43
|
import { readXcodeJsonProject } from './xcode-json-project'
|
|
44
|
+
import { decodeXml, schemeBuildPreActions } from './xcode-scheme-actions'
|
|
43
45
|
import { swiftFeatureFlags } from './xcode-swift-features'
|
|
44
46
|
import {
|
|
45
47
|
xcodeBuildFileBuildsForIos,
|
|
@@ -390,15 +392,6 @@ function applyOperator(value: string, operator: string): string {
|
|
|
390
392
|
throw new Error(`unsupported build setting operator :${operator}`)
|
|
391
393
|
}
|
|
392
394
|
|
|
393
|
-
function decodeXml(text: string): string {
|
|
394
|
-
return text
|
|
395
|
-
.replaceAll('"', '"')
|
|
396
|
-
.replaceAll(''', "'")
|
|
397
|
-
.replaceAll('<', '<')
|
|
398
|
-
.replaceAll('>', '>')
|
|
399
|
-
.replaceAll('&', '&')
|
|
400
|
-
}
|
|
401
|
-
|
|
402
395
|
// what a workspace lists, resolved through its nested groups: projects and folders.
|
|
403
396
|
function workspaceReferences(workspace: string): string[] {
|
|
404
397
|
const data = path.join(workspace, 'contents.xcworkspacedata')
|
|
@@ -734,6 +727,24 @@ function defaultConfiguration(project: LoadedProject): string {
|
|
|
734
727
|
: (str(configList?.defaultConfigurationName) ?? names[0] ?? 'Debug')
|
|
735
728
|
}
|
|
736
729
|
|
|
730
|
+
/** The project-level compiler flags written by the pod install hooks. */
|
|
731
|
+
export function installedPodsProjectCxxFlags(
|
|
732
|
+
app: string,
|
|
733
|
+
configuration: string,
|
|
734
|
+
): string[] | undefined {
|
|
735
|
+
const pods = path.join(app, 'ios', 'Pods', 'Pods.xcodeproj')
|
|
736
|
+
if (!xcodeProjectFile(pods)) return undefined
|
|
737
|
+
const { object, project } = loadProject(pods)
|
|
738
|
+
const configList = object(str(project.buildConfigurationList))
|
|
739
|
+
const configs = list(configList?.buildConfigurations).map(object)
|
|
740
|
+
const config =
|
|
741
|
+
configs.find((entry) => entry?.name === configuration) ??
|
|
742
|
+
configs.find((entry) => entry?.name === configList?.defaultConfigurationName)
|
|
743
|
+
const settings = config?.buildSettings
|
|
744
|
+
const flags = isDict(settings) ? settings.OTHER_CPLUSPLUSFLAGS : undefined
|
|
745
|
+
return settingList(str(flags) ?? list(flags).join(' '))
|
|
746
|
+
}
|
|
747
|
+
|
|
737
748
|
// the build settings of one target in `configuration`, evaluated as xcode
|
|
738
749
|
// does: project then target level, each an xcconfig under its own settings;
|
|
739
750
|
// `$(inherited)` reads the level below and an undefined setting is empty. a
|
|
@@ -967,6 +978,30 @@ function hostMacroPluginFlags(flags: string[]): string[] {
|
|
|
967
978
|
})
|
|
968
979
|
}
|
|
969
980
|
|
|
981
|
+
// a prepared workspace links its packages to the app's install (hard links on
|
|
982
|
+
// linux, symlinked packages anywhere). a script that writes into a package it
|
|
983
|
+
// names gets the workspace's own copy first, so the app's tree stays untouched.
|
|
984
|
+
function ownNamedPackages(script: string, from: string) {
|
|
985
|
+
const root = findWorkspaceRoot(from)
|
|
986
|
+
for (const [, name] of script.matchAll(/node_modules\/((?:@[\w.-]+\/)?[\w.-]+)/g))
|
|
987
|
+
for (let dir = from; relativeInside(root, dir) !== null; dir = path.dirname(dir)) {
|
|
988
|
+
const pkg = path.join(dir, 'node_modules', name!)
|
|
989
|
+
const stat = fs.lstatSync(pkg, { throwIfNoEntry: false })
|
|
990
|
+
if (!stat) continue
|
|
991
|
+
if (
|
|
992
|
+
stat.isSymbolicLink() ||
|
|
993
|
+
walkFiles(pkg).some((file) => fs.statSync(file).nlink > 1)
|
|
994
|
+
) {
|
|
995
|
+
const own = `${pkg}.peach-own`
|
|
996
|
+
fs.rmSync(own, { recursive: true, force: true })
|
|
997
|
+
fs.cpSync(fs.realpathSync(pkg), own, { recursive: true, verbatimSymlinks: true })
|
|
998
|
+
fs.rmSync(pkg, { recursive: true, force: true })
|
|
999
|
+
fs.renameSync(own, pkg)
|
|
1000
|
+
}
|
|
1001
|
+
break
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
|
|
970
1005
|
function scriptCommand(shell: string, script: string): [string, ...string[]] {
|
|
971
1006
|
const [executable, ...args] = settingList(shell)
|
|
972
1007
|
if (!executable) throw new Error('Xcode Run Script shellPath is empty')
|
|
@@ -1262,10 +1297,15 @@ function fileListEntries(file: string, absolute: (raw: string) => string): strin
|
|
|
1262
1297
|
function targetMembers(
|
|
1263
1298
|
ref: TargetRef,
|
|
1264
1299
|
settings: (key: string) => string,
|
|
1265
|
-
options: {
|
|
1300
|
+
options: {
|
|
1301
|
+
requireSources?: boolean
|
|
1302
|
+
prepareGeneratedSources?: boolean
|
|
1303
|
+
compileInterfaceResources?: boolean
|
|
1304
|
+
},
|
|
1266
1305
|
settingKeys: Set<string>,
|
|
1267
1306
|
projectInputs: Set<string>,
|
|
1268
1307
|
preparePodSources?: 'installed' | 'prepared',
|
|
1308
|
+
prepareSchemeActions?: 'installed' | 'prepared',
|
|
1269
1309
|
): {
|
|
1270
1310
|
sources: string[]
|
|
1271
1311
|
resources: string[]
|
|
@@ -1310,20 +1350,47 @@ function targetMembers(
|
|
|
1310
1350
|
},
|
|
1311
1351
|
)
|
|
1312
1352
|
let beforeSources = true
|
|
1313
|
-
|
|
1314
|
-
|
|
1353
|
+
const preActions = prepareSchemeActions
|
|
1354
|
+
? schemeBuildPreActions(project.xcodeproj, targetName).map((action) => ({
|
|
1355
|
+
...action,
|
|
1356
|
+
environment: action.environmentTarget === targetId,
|
|
1357
|
+
}))
|
|
1358
|
+
: []
|
|
1359
|
+
const phases: {
|
|
1360
|
+
phaseId: string
|
|
1361
|
+
preAction?: (typeof preActions)[number]
|
|
1362
|
+
phase: PlistDict | undefined
|
|
1363
|
+
}[] = [
|
|
1364
|
+
...preActions.map((action) => ({
|
|
1365
|
+
phaseId: action.id,
|
|
1366
|
+
preAction: action,
|
|
1367
|
+
phase: {
|
|
1368
|
+
isa: 'PBXShellScriptBuildPhase',
|
|
1369
|
+
name: action.name,
|
|
1370
|
+
shellPath: action.shell,
|
|
1371
|
+
shellScript: action.script,
|
|
1372
|
+
},
|
|
1373
|
+
})),
|
|
1374
|
+
...list(target.buildPhases).map((phaseId) => ({
|
|
1375
|
+
phaseId,
|
|
1376
|
+
phase: project.object(phaseId),
|
|
1377
|
+
})),
|
|
1378
|
+
]
|
|
1379
|
+
for (const { phaseId, preAction, phase } of phases) {
|
|
1315
1380
|
if (phase?.isa === 'PBXSourcesBuildPhase') beforeSources = false
|
|
1316
1381
|
if (phase?.isa !== 'PBXShellScriptBuildPhase') continue
|
|
1317
1382
|
const script = str(phase.name) ?? phaseId
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1383
|
+
if (!preAction) {
|
|
1384
|
+
for (const catalog of shellAssetCatalogs(
|
|
1385
|
+
str(phase.shellScript) ?? '',
|
|
1386
|
+
settings,
|
|
1387
|
+
project.projectDir,
|
|
1388
|
+
))
|
|
1389
|
+
for (const file of walkFiles(catalog)) resources.add(file)
|
|
1390
|
+
copiedFiles.push(
|
|
1391
|
+
...shellCopies(str(phase.shellScript) ?? '', settings, project.projectDir),
|
|
1392
|
+
)
|
|
1393
|
+
}
|
|
1327
1394
|
const absolute = (raw: string) =>
|
|
1328
1395
|
path.resolve(project.projectDir, expand(raw, settings))
|
|
1329
1396
|
const inputs = list(phase.inputPaths).map(absolute)
|
|
@@ -1361,15 +1428,18 @@ function targetMembers(
|
|
|
1361
1428
|
beforeSources &&
|
|
1362
1429
|
allOutputs.length === 0 &&
|
|
1363
1430
|
str(phase.runOnlyForDeploymentPostprocessing) !== '1'
|
|
1364
|
-
const
|
|
1365
|
-
|
|
1366
|
-
beforeSources &&
|
|
1367
|
-
|
|
1368
|
-
|
|
1431
|
+
const sourcePhaseMode = preAction
|
|
1432
|
+
? prepareSchemeActions
|
|
1433
|
+
: beforeSources &&
|
|
1434
|
+
script.startsWith('[CP-User] ') &&
|
|
1435
|
+
str(phase.runOnlyForDeploymentPostprocessing) !== '1'
|
|
1436
|
+
? preparePodSources
|
|
1437
|
+
: undefined
|
|
1438
|
+
const sourcePhase = sourcePhaseMode !== undefined
|
|
1369
1439
|
if (
|
|
1370
1440
|
(options.prepareGeneratedSources === true &&
|
|
1371
1441
|
(allOutputs.some(isPreparedOutput) || undeclaredGenerator)) ||
|
|
1372
|
-
|
|
1442
|
+
sourcePhase
|
|
1373
1443
|
) {
|
|
1374
1444
|
const phaseDir = path.join(settings('TARGET_TEMP_DIR'), `Script-${phaseId}`)
|
|
1375
1445
|
for (const lists of fileLists.values())
|
|
@@ -1381,7 +1451,7 @@ function targetMembers(
|
|
|
1381
1451
|
const env = {
|
|
1382
1452
|
...process.env,
|
|
1383
1453
|
...Object.fromEntries(
|
|
1384
|
-
[...settingKeys]
|
|
1454
|
+
[...(preAction && !preAction.environment ? [] : settingKeys)]
|
|
1385
1455
|
.filter((key) => /^[A-Za-z_][A-Za-z0-9_]*$/.test(key))
|
|
1386
1456
|
.map((key) => [key, settings(key)]),
|
|
1387
1457
|
),
|
|
@@ -1420,9 +1490,7 @@ function targetMembers(
|
|
|
1420
1490
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings('CONFIGURATION')}`
|
|
1421
1491
|
// the prepared workspace is content-addressed, including its installed dependencies.
|
|
1422
1492
|
const receipt =
|
|
1423
|
-
|
|
1424
|
-
? path.join(phaseDir, 'source-phase.sha256')
|
|
1425
|
-
: null
|
|
1493
|
+
sourcePhaseMode === 'prepared' ? path.join(phaseDir, 'source-phase.sha256') : null
|
|
1426
1494
|
if (
|
|
1427
1495
|
(preparedSourcePhases.get(key) === stamp ||
|
|
1428
1496
|
(receipt &&
|
|
@@ -1484,6 +1552,7 @@ function targetMembers(
|
|
|
1484
1552
|
.filter(Boolean)
|
|
1485
1553
|
.join(' ')
|
|
1486
1554
|
}
|
|
1555
|
+
if (sourcePhaseMode === 'prepared') ownNamedPackages(rawScript, project.projectDir)
|
|
1487
1556
|
try {
|
|
1488
1557
|
const [shell, ...args] = scriptCommand(
|
|
1489
1558
|
str(phase.shellPath) ?? '/bin/sh',
|
|
@@ -1550,7 +1619,10 @@ function targetMembers(
|
|
|
1550
1619
|
if (file.endsWith('.swift')) sources.add(file)
|
|
1551
1620
|
},
|
|
1552
1621
|
)
|
|
1553
|
-
if (
|
|
1622
|
+
if (
|
|
1623
|
+
options.prepareGeneratedSources &&
|
|
1624
|
+
(options.requireSources !== false || options.compileInterfaceResources)
|
|
1625
|
+
) {
|
|
1554
1626
|
const interfaceFiles = [...resources].filter(
|
|
1555
1627
|
(file) =>
|
|
1556
1628
|
/\.(storyboard|xib)$/.test(file) &&
|
|
@@ -1611,7 +1683,9 @@ function targetMembers(
|
|
|
1611
1683
|
(process.platform === 'darwin' && cached[1] !== developer)
|
|
1612
1684
|
) {
|
|
1613
1685
|
if (process.platform !== 'darwin') {
|
|
1614
|
-
|
|
1686
|
+
// a metadata read takes what this host can compile.
|
|
1687
|
+
if ((isStoryboard && name === launchName) || options.requireSources === false)
|
|
1688
|
+
continue
|
|
1615
1689
|
throw new Error(
|
|
1616
1690
|
`${targetName}: Interface Builder compilation requires macOS and Xcode`,
|
|
1617
1691
|
)
|
|
@@ -2185,12 +2259,14 @@ export function readXcodeAppTarget(
|
|
|
2185
2259
|
options: {
|
|
2186
2260
|
requireSources?: boolean
|
|
2187
2261
|
prepareGeneratedSources?: boolean
|
|
2262
|
+
/** compile storyboards and xibs into the resources, as Xcode copies them, without requiring sources. */
|
|
2263
|
+
compileInterfaceResources?: boolean
|
|
2188
2264
|
environment?: Record<string, string>
|
|
2189
2265
|
/** execute the selected podspecs’ pre-compile phases before snapshotting their sources. */
|
|
2190
2266
|
prepareNativeSources?: 'installed' | 'prepared'
|
|
2191
2267
|
/** build the CocoaPods project `pod install` generated, as Xcode does. */
|
|
2192
2268
|
installedPods?: boolean
|
|
2193
|
-
/** snapshot only these native modules, without the application's resources. */
|
|
2269
|
+
/** snapshot only these native modules, without the application's resources or its bundle phases. */
|
|
2194
2270
|
nativeModules?: readonly string[]
|
|
2195
2271
|
/** select the original framework target that builds a package's archive. */
|
|
2196
2272
|
frameworkMachOType?: 'staticlib' | 'mh_dylib'
|
|
@@ -2265,6 +2341,12 @@ export function readXcodeAppTarget(
|
|
|
2265
2341
|
appConfigNames.find((name) =>
|
|
2266
2342
|
name.toLowerCase().includes(configurationName.toLowerCase()),
|
|
2267
2343
|
) ??
|
|
2344
|
+
// a release build of an app without a Release configuration (Eigen
|
|
2345
|
+
// has Debug and QA) takes one cocoapods classifies as release: any
|
|
2346
|
+
// configuration not named Debug, as pods-install maps them
|
|
2347
|
+
(configurationName === 'Release'
|
|
2348
|
+
? appConfigNames.find((name) => name !== 'Debug')
|
|
2349
|
+
: undefined) ??
|
|
2268
2350
|
str(appConfigs?.defaultConfigurationName) ??
|
|
2269
2351
|
configurationName)
|
|
2270
2352
|
|
|
@@ -2629,6 +2711,7 @@ export function readXcodeAppTarget(
|
|
|
2629
2711
|
keys,
|
|
2630
2712
|
xcconfigs,
|
|
2631
2713
|
options.nativeModules?.includes(name) ? options.prepareNativeSources : undefined,
|
|
2714
|
+
ref === app ? options.prepareNativeSources : undefined,
|
|
2632
2715
|
)
|
|
2633
2716
|
const searchRules = recursiveSearchRules(settings)
|
|
2634
2717
|
const absolute = (file: string) => path.resolve(ref.project.projectDir, file)
|
|
@@ -2971,6 +3054,7 @@ export function readXcodeAppTarget(
|
|
|
2971
3054
|
),
|
|
2972
3055
|
],
|
|
2973
3056
|
cxxFlags: [
|
|
3057
|
+
...(settings('GCC_ENABLE_CPP_RTTI') === 'NO' ? ['-fno-rtti'] : []),
|
|
2974
3058
|
...(cxxStandard && cxxStandard !== 'compiler-default'
|
|
2975
3059
|
? [`-std=${CXX_STANDARD_ALIASES[cxxStandard] ?? cxxStandard}`]
|
|
2976
3060
|
: []),
|
|
@@ -3122,18 +3206,31 @@ export function readXcodeAppTarget(
|
|
|
3122
3206
|
objc.userHeaderSearchPaths = objc.userHeaderSearchPaths.flatMap(copiedSearchPath)
|
|
3123
3207
|
objc.frameworkSearchPaths = objc.frameworkSearchPaths.flatMap(copiedSearchPath)
|
|
3124
3208
|
}
|
|
3125
|
-
// xcode's implicit dependencies include the targets a linker flag names
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3209
|
+
// xcode's implicit dependencies include the targets a linker flag names.
|
|
3210
|
+
const targetModules = new Map(builtTargets.map(({ ref, module }) => [ref, module]))
|
|
3211
|
+
const targetDependencies = new Map(
|
|
3212
|
+
builtTargets.map(({ ref, settings }) => [
|
|
3213
|
+
ref,
|
|
3214
|
+
[
|
|
3130
3215
|
...dependenciesOf(ref),
|
|
3131
3216
|
...frameworkFlagLinks(ref, settings('OTHER_LDFLAGS')).map((link) => link.target),
|
|
3132
|
-
]
|
|
3133
|
-
]
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3217
|
+
],
|
|
3218
|
+
]),
|
|
3219
|
+
)
|
|
3220
|
+
for (const { ref, module } of builtTargets) {
|
|
3221
|
+
const dependencies = new Set(targetDependencies.get(ref))
|
|
3222
|
+
for (const dependency of dependencies) {
|
|
3223
|
+
// aggregate targets have no module, but their products are still dependencies.
|
|
3224
|
+
if (dependency.target.isa === 'PBXAggregateTarget') {
|
|
3225
|
+
for (const nested of targetDependencies.get(dependency) ?? [])
|
|
3226
|
+
dependencies.add(nested)
|
|
3227
|
+
} else {
|
|
3228
|
+
const target = targetModules.get(dependency)
|
|
3229
|
+
if (target && dependency !== ref)
|
|
3230
|
+
module.targetDependencies.push(target.targetIdentity)
|
|
3231
|
+
}
|
|
3232
|
+
}
|
|
3233
|
+
}
|
|
3137
3234
|
const { settings, productSettings, keys: settingKeys, module } = builtTargets.at(-1)!
|
|
3138
3235
|
const selectedTargets = options.nativeModules
|
|
3139
3236
|
? builtTargets.filter((target) => nativeTargets.has(target.ref))
|
|
@@ -3734,15 +3831,6 @@ export function readXcodeAppTarget(
|
|
|
3734
3831
|
: []
|
|
3735
3832
|
}),
|
|
3736
3833
|
),
|
|
3737
|
-
...(options.nativeModules
|
|
3738
|
-
? {
|
|
3739
|
-
sources: [],
|
|
3740
|
-
allSources: [],
|
|
3741
|
-
resources: [],
|
|
3742
|
-
objc: undefined,
|
|
3743
|
-
swift: undefined,
|
|
3744
|
-
}
|
|
3745
|
-
: {}),
|
|
3746
3834
|
rootDir: commonAncestor(
|
|
3747
3835
|
[
|
|
3748
3836
|
workspace ? path.dirname(workspace) : app.project.projectDir,
|
|
@@ -3802,5 +3890,15 @@ export function readXcodeAppTarget(
|
|
|
3802
3890
|
configuration,
|
|
3803
3891
|
settings,
|
|
3804
3892
|
cocoapods,
|
|
3893
|
+
...(options.nativeModules
|
|
3894
|
+
? {
|
|
3895
|
+
sources: [],
|
|
3896
|
+
allSources: [],
|
|
3897
|
+
resources: [],
|
|
3898
|
+
objc: undefined,
|
|
3899
|
+
swift: undefined,
|
|
3900
|
+
postBundleScripts: [],
|
|
3901
|
+
}
|
|
3902
|
+
: {}),
|
|
3805
3903
|
}
|
|
3806
3904
|
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
// a scheme's build pre-actions run before xcode builds anything, in the
|
|
2
|
+
// developer's own tree. a script action whose environment buildable names a
|
|
3
|
+
// target runs with that target's build settings.
|
|
4
|
+
import fs from 'node:fs'
|
|
5
|
+
import path from 'node:path'
|
|
6
|
+
|
|
7
|
+
export function decodeXml(text: string): string {
|
|
8
|
+
return text
|
|
9
|
+
.replaceAll('"', '"')
|
|
10
|
+
.replaceAll(''', "'")
|
|
11
|
+
.replaceAll('<', '<')
|
|
12
|
+
.replaceAll('>', '>')
|
|
13
|
+
.replace(/&#(x[0-9a-f]+|[0-9]+);/gi, (_, code: string) =>
|
|
14
|
+
String.fromCodePoint(
|
|
15
|
+
code[0] === 'x' || code[0] === 'X'
|
|
16
|
+
? Number.parseInt(code.slice(1), 16)
|
|
17
|
+
: Number(code),
|
|
18
|
+
),
|
|
19
|
+
)
|
|
20
|
+
.replaceAll('&', '&')
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const attribute = (text: string, key: string) => {
|
|
24
|
+
const value = new RegExp(`\\b${key}\\s*=\\s*"([^"]*)"`).exec(text)?.[1]
|
|
25
|
+
return value === undefined ? undefined : decodeXml(value)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function schemeFiles(xcodeproj: string): string[] {
|
|
29
|
+
const users = path.join(xcodeproj, 'xcuserdata')
|
|
30
|
+
return [
|
|
31
|
+
path.join(xcodeproj, 'xcshareddata'),
|
|
32
|
+
...(fs.statSync(users, { throwIfNoEntry: false })?.isDirectory()
|
|
33
|
+
? fs
|
|
34
|
+
.readdirSync(users)
|
|
35
|
+
.sort()
|
|
36
|
+
.map((user) => path.join(users, user))
|
|
37
|
+
: []),
|
|
38
|
+
].flatMap((data) => {
|
|
39
|
+
const directory = path.join(data, 'xcschemes')
|
|
40
|
+
return fs.existsSync(directory)
|
|
41
|
+
? fs
|
|
42
|
+
.readdirSync(directory)
|
|
43
|
+
.filter((name) => name.endsWith('.xcscheme'))
|
|
44
|
+
.sort()
|
|
45
|
+
.map((name) => path.join(directory, name))
|
|
46
|
+
: []
|
|
47
|
+
})
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function preActions(file: string) {
|
|
51
|
+
const build = /<BuildAction\b[^>]*>([\s\S]*?)<\/BuildAction>/.exec(
|
|
52
|
+
fs.readFileSync(file, 'utf8'),
|
|
53
|
+
)?.[1]
|
|
54
|
+
const pre = build && /<PreActions>([\s\S]*?)<\/PreActions>/.exec(build)?.[1]
|
|
55
|
+
if (!pre) return []
|
|
56
|
+
return [...pre.matchAll(/<ExecutionAction\b([^>]*)>([\s\S]*?)<\/ExecutionAction>/g)]
|
|
57
|
+
.filter(([, head]) => attribute(head!, 'ActionType')?.endsWith('ShellScriptAction'))
|
|
58
|
+
.map(([, , body], index) => {
|
|
59
|
+
const content = /<ActionContent\b([^>]*)>/.exec(body!)?.[1] ?? ''
|
|
60
|
+
const buildable =
|
|
61
|
+
/<EnvironmentBuildable>[\s\S]*?<BuildableReference\b([^>]*)>/.exec(body!)?.[1]
|
|
62
|
+
return {
|
|
63
|
+
id: `SchemePreAction-${index}`,
|
|
64
|
+
name: attribute(content, 'title') ?? 'Run Script',
|
|
65
|
+
script: attribute(content, 'scriptText') ?? '',
|
|
66
|
+
shell: attribute(content, 'shellToInvoke') ?? '/bin/sh',
|
|
67
|
+
environmentTarget: buildable && attribute(buildable, 'BlueprintIdentifier'),
|
|
68
|
+
}
|
|
69
|
+
})
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** the pre-actions of the scheme named for a target, as xcode builds it by default. */
|
|
73
|
+
export function schemeBuildPreActions(xcodeproj: string, scheme: string) {
|
|
74
|
+
const file = schemeFiles(xcodeproj).find(
|
|
75
|
+
(candidate) => path.basename(candidate) === `${scheme}.xcscheme`,
|
|
76
|
+
)
|
|
77
|
+
return file ? preActions(file) : []
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** files under the app a project's scheme pre-action names, which xcode reads from the developer's tree. */
|
|
81
|
+
export function schemePreActionFiles(app: string): string[] {
|
|
82
|
+
const ios = path.join(app, 'ios')
|
|
83
|
+
if (!fs.existsSync(ios)) return []
|
|
84
|
+
const scripts = fs
|
|
85
|
+
.readdirSync(ios)
|
|
86
|
+
.filter((name) => name.endsWith('.xcodeproj'))
|
|
87
|
+
.flatMap((name) => schemeFiles(path.join(ios, name)))
|
|
88
|
+
.flatMap((file) => preActions(file).map((action) => action.script))
|
|
89
|
+
const files = new Set<string>()
|
|
90
|
+
for (const script of scripts)
|
|
91
|
+
for (const [token] of script.matchAll(/[\w.-]+(?:\/[\w.-]+)*\.[\w-]+/g))
|
|
92
|
+
for (const base of [app, ios]) {
|
|
93
|
+
const file = path.resolve(base, token)
|
|
94
|
+
const relative = path.relative(app, file)
|
|
95
|
+
if (
|
|
96
|
+
relative.startsWith('..') ||
|
|
97
|
+
relative.split(path.sep).includes('node_modules') ||
|
|
98
|
+
!fs.statSync(file, { throwIfNoEntry: false })?.isFile()
|
|
99
|
+
)
|
|
100
|
+
continue
|
|
101
|
+
files.add(file)
|
|
102
|
+
}
|
|
103
|
+
return [...files].sort()
|
|
104
|
+
}
|