peachsim 0.1.1808 → 0.1.1811
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/README.md +4 -2
- package/cli/app-bundle-resources.ts +15 -2
- package/cli/cloud-box-artifact.ts +115 -0
- package/cli/cloud-client.ts +95 -53
- package/cli/cloud-dispatch.ts +4 -4
- package/cli/cloud-session.ts +60 -22
- package/cli/commands/box.ts +8 -2
- package/cli/commands/compat.ts +7 -4
- package/cli/commands/control.ts +60 -3
- package/cli/commands/coverage.ts +14 -4
- package/cli/commands/daemon.ts +41 -0
- package/cli/commands/no-bridge-hint.ts +9 -0
- package/cli/commands/package.ts +31 -56
- package/cli/commands/platform.ts +70 -52
- package/cli/commands/preview.ts +73 -24
- package/cli/commands/record.ts +10 -2
- package/cli/commands/screenshot.ts +17 -60
- package/cli/commands/setup.ts +3 -1
- package/cli/commands/three-mode.ts +22 -12
- package/cli/commands/upload.ts +2 -1
- package/cli/desktop-companion.ts +6 -1
- package/cli/drivers/desktop.ts +4 -1
- package/cli/main.ts +12 -2
- package/cli/metro-bundle-assets.ts +14 -4
- package/cli/outbound-endpoints.ts +7 -3
- package/cli/output-redaction.ts +38 -0
- package/cli/privacy.ts +2 -2
- package/cli/recording-access.ts +5 -0
- package/cli/remote-project-bundle.ts +83 -0
- package/cli/shell-init.ts +7 -11
- package/cli/telemetry.ts +41 -4
- package/cli/usage-error.ts +3 -0
- package/cli/ws-bridge.ts +42 -6
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +42783 -40717
- package/dist-lib/capture-contract.cjs +7 -8
- package/dist-lib/capture-contract.mjs +7 -8
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +13 -7
- package/dist-lib/dev-bundle-resolution.cjs +10 -4
- package/dist-lib/expo-swift-bundle.cjs +15819 -15559
- package/dist-lib/expo-swift-metadata.cjs +2 -1
- package/dist-lib/expo-swift-metadata.mjs +2 -1
- package/dist-lib/home-paths.cjs +2 -33
- package/dist-lib/host/bridge-host.cjs +20857 -18756
- package/dist-lib/host/fetch-proxy-handler.cjs +10 -10
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +588 -544
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +25 -19
- package/dist-lib/native-app-identity-project.cjs +15 -6
- package/dist-lib/native-app-identity-project.mjs +23 -12
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +27 -26
- package/dist-lib/public-origins-lib.json +104 -81
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +30496 -24309
- package/dist-lib/swift-compile.cjs +292 -213
- package/dist-lib/swift-compile.mjs +334 -254
- package/dist-lib/swift-package.cjs +8 -4
- package/dist-lib/swift-package.mjs +8 -4
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +32 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +19172 -18941
- package/dist-lib/vite.cjs +11 -11
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/engine/animated.d.ts +4 -0
- package/dist-types/packages/peach-engine/src/engine/animation-graph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/expo-manifest.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +8 -1
- package/dist-types/packages/peach-globals/src/electronBridgeContract.d.ts +2 -1
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCall.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCallCenter.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTCarrier.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriber.h +1 -1
- package/sdk/ios/System/Library/Frameworks/CoreTelephony.framework/Headers/CTSubscriberInfo.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSDictionary.h +1 -1
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/NSExtensionItem.h +1 -1
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVFoundation+MPNowPlayingInfoLanguageOptionAdditions.h +39 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/AVPlayerItem+MediaPlayerAdditions.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPContentItem.h +67 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPError.h +33 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaEntity.h +53 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItem.h +346 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaItemCollection.h +42 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaLibrary.h +76 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPickerController.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlayback.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaPlaylist.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuery.h +120 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMediaQuerySection.h +26 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerController.h +444 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMoviePlayerViewController.h +43 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerApplicationController.h +47 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerController.h +147 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPMusicPlayerQueueDescriptor.h +75 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoCenter.h +197 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingInfoLanguageOption.h +107 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPNowPlayingSession.h +89 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDataSource.h +59 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentDelegate.h +64 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManager.h +46 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPPlayableContentManagerContext.h +32 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommand.h +143 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandCenter.h +66 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteCommandEvent.h +128 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPRemoteControlTypes.h +27 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeSettings.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MPVolumeView.h +82 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.apinotes +74 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayer.h +40 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/MediaPlayerDefines.h +84 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Headers/NSUserActivity+MediaPlayerAdditions.h +20 -0
- package/sdk/ios/System/Library/Frameworks/MediaPlayer.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAccessibilityCustomRotor.h +2 -2
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIAction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIBackgroundConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIButtonConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuConfiguration.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIContextMenuInteraction.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIDeferredMenuElement.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIMenu.h +1 -1
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIPointerStyle.h +5 -5
- package/sdk/ios/usr/include/dispatch.modulemap +22 -0
- package/sdk/ios/usr/include/net/if.h +24 -0
- package/sdk/ios/usr/include/sys/time.h +1 -1
- package/sdk/ios/usr/lib/swift/Foundation.swiftmodule/arm64-apple-ios-simulator.swiftinterface +265 -0
- package/sdk/ios/usr/lib/swift/ObjectiveC.swiftmodule/arm64-apple-ios-simulator.swiftinterface +2 -0
- package/sdk/ios/wasm/include/fcntl.h +2 -0
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/stdlib.h +2 -0
- package/sdk/ios/wasm/include/unistd.h +2 -2
- package/skills/contrast/SKILL.md +2 -2
- package/src/bundle-channel.mjs +9 -72
- package/src/capture-contract.ts +12 -9
- package/src/desktop-host-delivery.ts +16 -2
- package/src/dev-bundle-resolution.ts +12 -3
- package/src/expo-native-workspace.ts +57 -19
- package/src/expo-swift-host.ts +17 -12
- package/src/expo-swift-ready.ts +4 -1
- package/src/expoSwiftContract.ts +1 -0
- package/src/home-paths.ts +4 -48
- package/src/host/bridge-host.ts +1 -0
- package/src/installed-native-libraries.ts +2 -8
- package/src/metro-project-root.ts +2 -1
- package/src/native-bundles.ts +122 -0
- package/src/native-static-libraries.ts +65 -8
- package/src/nitro-adapter.lock.json +278 -278
- package/src/nitro-bundle.ts +2 -2
- package/src/nitro-compile.ts +68 -28
- package/src/nitro-source.ts +24 -6
- package/src/nitro-superset.lock.json +94 -34
- package/src/nitroContract.ts +2 -0
- package/src/podspec-sources.ts +1966 -0
- package/src/storageSnapshotContract.ts +40 -0
- package/src/swift-compile.ts +57 -20
- package/src/swift-design-time.ts +18 -1
- package/src/swift-distribution.lock.json +11 -11
- package/src/swift-distribution.ts +9 -6
- package/src/swift-host.ts +1 -2
- package/src/swift-objc-standin.ts +316 -112
- package/src/swift-package-manifest.ts +4 -3
- package/src/swift-package.ts +10 -3
- package/src/swift-root-lock.ts +11 -0
- package/src/swift-shared-sdk.ts +10 -9
- package/src/swift-source-pods.ts +2 -2
- package/src/swift-standins.ts +40 -143
- package/src/swift-toolchain.ts +42 -0
- package/src/swift-wasm-prune.ts +53 -21
- package/src/turbo-bundle.ts +2 -2
- package/src/turbo-codegen-intake.ts +111 -108
- package/src/turbo-compile.ts +63 -33
- package/src/turbo-runtime.lock.json +21 -21
- package/src/turbo-source.ts +171 -76
- package/src/wasm-optimize.ts +31 -2
- package/src/xcode-project.ts +36 -3
package/dist-lib/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1811 | (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;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "08583ee03b92e00f3f331e52fb480ef81c9fd7e668d796a5afcfa07978bcaf03", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "5bdd15dce967553923b0437502e56f70165424d2f22cdde0e2d7aacd618e27cc", "swift-package.ts": "2194c5ae36b78b186968ea96076c3ef30d4d04774df0d7c11cd30decf7f07c15", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "06aa435a4d7a23d6c3316f9e8553da5fe7af976c0d52b90113fcff1dcc08e666", "home-paths.ts": "744d0e29fcc4baae6748161da45dd75e357348703331dad685c74ec813abcc83", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "19a9b7d8cf3cf4f702fb169baf6f56875b07969dc4073b316f8250280497da59", "xcode-target-members.ts": "75a23a5fc54cc6f5e952d545f2f0f86241ff36525ab4e568c172e83c3bfb9da4", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -150,7 +150,7 @@ function readDaemonLockfile() {
|
|
|
150
150
|
const bytesRead = import_node_fs.default.readSync(fd, buf, 0, DAEMON_LOCKFILE_MAX_BYTES, 0);
|
|
151
151
|
const raw = buf.subarray(0, bytesRead).toString("utf8");
|
|
152
152
|
const parsed = JSON.parse(raw);
|
|
153
|
-
if (parsed && parsed.schema === 1 && typeof parsed.pid === "number" && typeof parsed.bridgePort === "number" && typeof parsed.runtimePort === "number" && typeof parsed.startedAt === "number" && typeof parsed.heartbeatAt === "number" && (parsed.servedRuntimes === void 0 || Array.isArray(parsed.servedRuntimes) && parsed.servedRuntimes.every((version) => typeof version === "string"))) {
|
|
153
|
+
if (parsed && parsed.schema === 1 && typeof parsed.pid === "number" && typeof parsed.bridgePort === "number" && typeof parsed.runtimePort === "number" && typeof parsed.startedAt === "number" && typeof parsed.heartbeatAt === "number" && (parsed.cliVersion === void 0 || typeof parsed.cliVersion === "string") && (parsed.servedRuntimes === void 0 || Array.isArray(parsed.servedRuntimes) && parsed.servedRuntimes.every((version) => typeof version === "string"))) {
|
|
154
154
|
return parsed;
|
|
155
155
|
}
|
|
156
156
|
return null;
|
|
@@ -4388,25 +4388,25 @@ var init_browser = __esm({
|
|
|
4388
4388
|
});
|
|
4389
4389
|
|
|
4390
4390
|
// cli/commands/nodeRepoFileReader.ts
|
|
4391
|
-
var
|
|
4391
|
+
var import_node_fs5, nodeRepoFileReader;
|
|
4392
4392
|
var init_nodeRepoFileReader = __esm({
|
|
4393
4393
|
"cli/commands/nodeRepoFileReader.ts"() {
|
|
4394
4394
|
"use strict";
|
|
4395
4395
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4396
|
-
|
|
4396
|
+
import_node_fs5 = require("node:fs");
|
|
4397
4397
|
nodeRepoFileReader = {
|
|
4398
|
-
exists:
|
|
4399
|
-
readText: (filePath) => (0,
|
|
4400
|
-
entries: (directory) => (0,
|
|
4398
|
+
exists: import_node_fs5.existsSync,
|
|
4399
|
+
readText: (filePath) => (0, import_node_fs5.readFileSync)(filePath, "utf8"),
|
|
4400
|
+
entries: (directory) => (0, import_node_fs5.readdirSync)(directory, { withFileTypes: true }).map((entry) => ({
|
|
4401
4401
|
name: entry.name,
|
|
4402
4402
|
directory: entry.isDirectory()
|
|
4403
4403
|
})),
|
|
4404
|
-
isDirectory: (filePath) => (0,
|
|
4404
|
+
isDirectory: (filePath) => (0, import_node_fs5.statSync)(filePath).isDirectory(),
|
|
4405
4405
|
readMetadata(filePath) {
|
|
4406
4406
|
try {
|
|
4407
|
-
const info = (0,
|
|
4407
|
+
const info = (0, import_node_fs5.lstatSync)(filePath);
|
|
4408
4408
|
if (!info.isFile() || info.size > 4 * 1024 * 1024) return null;
|
|
4409
|
-
return (0,
|
|
4409
|
+
return (0, import_node_fs5.readFileSync)(filePath, "utf8");
|
|
4410
4410
|
} catch {
|
|
4411
4411
|
return null;
|
|
4412
4412
|
}
|
|
@@ -4429,7 +4429,7 @@ function scanRepository(root) {
|
|
|
4429
4429
|
directories.push(next.dir);
|
|
4430
4430
|
let handle;
|
|
4431
4431
|
try {
|
|
4432
|
-
handle = (0,
|
|
4432
|
+
handle = (0, import_node_fs6.opendirSync)(next.dir);
|
|
4433
4433
|
} catch {
|
|
4434
4434
|
unreadable++;
|
|
4435
4435
|
continue;
|
|
@@ -4444,7 +4444,7 @@ function scanRepository(root) {
|
|
|
4444
4444
|
truncated = true;
|
|
4445
4445
|
continue;
|
|
4446
4446
|
}
|
|
4447
|
-
pending.push({ dir: (0,
|
|
4447
|
+
pending.push({ dir: (0, import_node_path5.join)(next.dir, entry.name), depth: next.depth + 1 });
|
|
4448
4448
|
}
|
|
4449
4449
|
} finally {
|
|
4450
4450
|
handle.closeSync();
|
|
@@ -4474,7 +4474,7 @@ function readProjectJson(path30, files = nodeRepoFileReader) {
|
|
|
4474
4474
|
}
|
|
4475
4475
|
}
|
|
4476
4476
|
function readProjectManifest(dir, files = nodeRepoFileReader) {
|
|
4477
|
-
const parsed = readProjectJson((0,
|
|
4477
|
+
const parsed = readProjectJson((0, import_node_path5.join)(dir, "package.json"), files);
|
|
4478
4478
|
if (!parsed || typeof parsed !== "object") return null;
|
|
4479
4479
|
const record = (value) => {
|
|
4480
4480
|
if (!value || typeof value !== "object") return {};
|
|
@@ -4491,13 +4491,13 @@ function readProjectManifest(dir, files = nodeRepoFileReader) {
|
|
|
4491
4491
|
devDependencies: record(metadataValue(parsed, "devDependencies"))
|
|
4492
4492
|
};
|
|
4493
4493
|
}
|
|
4494
|
-
var
|
|
4494
|
+
var import_node_fs6, import_node_path5, import_json5, REPORT_SKIP_DIRS, PODFILE_NEW_ARCH_MARK, PODFILE_NEW_ARCH_RUBY;
|
|
4495
4495
|
var init_detect = __esm({
|
|
4496
4496
|
"cli/commands/detect.ts"() {
|
|
4497
4497
|
"use strict";
|
|
4498
4498
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
4499
|
-
|
|
4500
|
-
|
|
4499
|
+
import_node_fs6 = require("node:fs");
|
|
4500
|
+
import_node_path5 = require("node:path");
|
|
4501
4501
|
import_json5 = __toESM(require_lib(), 1);
|
|
4502
4502
|
init_browser();
|
|
4503
4503
|
init_nodeRepoFileReader();
|
|
@@ -5116,7 +5116,7 @@ function normalize(p) {
|
|
|
5116
5116
|
if (trailingSlash) joined += "/";
|
|
5117
5117
|
return absolute ? "/" + joined : joined;
|
|
5118
5118
|
}
|
|
5119
|
-
function
|
|
5119
|
+
function join6(...parts) {
|
|
5120
5120
|
const present = parts.filter((part) => part.length > 0);
|
|
5121
5121
|
if (present.length === 0) return ".";
|
|
5122
5122
|
return normalize(present.join("/"));
|
|
@@ -5137,7 +5137,7 @@ function resolve3(...parts) {
|
|
|
5137
5137
|
const normalized = normalizeSegments(resolved.split("/"), false).join("/");
|
|
5138
5138
|
return normalized.length > 0 ? "/" + normalized : "/";
|
|
5139
5139
|
}
|
|
5140
|
-
function
|
|
5140
|
+
function dirname5(p) {
|
|
5141
5141
|
const idx = p.lastIndexOf("/");
|
|
5142
5142
|
if (idx < 0) return ".";
|
|
5143
5143
|
if (idx === 0) return "/";
|
|
@@ -5180,9 +5180,9 @@ var init_posixPath = __esm({
|
|
|
5180
5180
|
delimiter,
|
|
5181
5181
|
isAbsolute: isAbsolute2,
|
|
5182
5182
|
normalize,
|
|
5183
|
-
join:
|
|
5183
|
+
join: join6,
|
|
5184
5184
|
resolve: resolve3,
|
|
5185
|
-
dirname:
|
|
5185
|
+
dirname: dirname5,
|
|
5186
5186
|
basename: basename3,
|
|
5187
5187
|
extname,
|
|
5188
5188
|
relative
|
|
@@ -5423,16 +5423,16 @@ function sendJavaScript(req, res, source) {
|
|
|
5423
5423
|
res.end(req.method === "HEAD" ? void 0 : source);
|
|
5424
5424
|
}
|
|
5425
5425
|
function resolveReplacementModuleFile(fromFile, specifier) {
|
|
5426
|
-
const base =
|
|
5426
|
+
const base = import_node_path12.default.resolve(import_node_path12.default.dirname(fromFile), specifier);
|
|
5427
5427
|
const candidates = [
|
|
5428
5428
|
...REPLACEMENT_MODULE_EXTENSIONS.some(
|
|
5429
|
-
(ext) => ext ===
|
|
5429
|
+
(ext) => ext === import_node_path12.default.extname(base).toLowerCase()
|
|
5430
5430
|
) ? [base] : [],
|
|
5431
5431
|
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => base + ext),
|
|
5432
|
-
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) =>
|
|
5432
|
+
...REPLACEMENT_MODULE_EXTENSIONS.map((ext) => import_node_path12.default.join(base, `index${ext}`))
|
|
5433
5433
|
];
|
|
5434
5434
|
const found = candidates.find(
|
|
5435
|
-
(candidate) => (0,
|
|
5435
|
+
(candidate) => (0, import_node_fs12.statSync)(candidate, { throwIfNoEntry: false })?.isFile()
|
|
5436
5436
|
);
|
|
5437
5437
|
if (!found) {
|
|
5438
5438
|
throw new Error(
|
|
@@ -5443,8 +5443,8 @@ function resolveReplacementModuleFile(fromFile, specifier) {
|
|
|
5443
5443
|
}
|
|
5444
5444
|
function isInsideAny(roots, file) {
|
|
5445
5445
|
return roots.some((root) => {
|
|
5446
|
-
const relative3 =
|
|
5447
|
-
return !relative3.startsWith("..") && !
|
|
5446
|
+
const relative3 = import_node_path12.default.relative(root, file);
|
|
5447
|
+
return !relative3.startsWith("..") && !import_node_path12.default.isAbsolute(relative3);
|
|
5448
5448
|
});
|
|
5449
5449
|
}
|
|
5450
5450
|
function isReplacementModuleRequestUrl(rawUrl) {
|
|
@@ -5493,19 +5493,19 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5493
5493
|
res.end("missing path param");
|
|
5494
5494
|
return true;
|
|
5495
5495
|
}
|
|
5496
|
-
const extension =
|
|
5496
|
+
const extension = import_node_path12.default.extname(targetPath).toLowerCase();
|
|
5497
5497
|
if (!REPLACEMENT_MODULE_EXTENSIONS.some((allowed) => allowed === extension)) {
|
|
5498
5498
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5499
5499
|
res.end(`replacement files must be ${REPLACEMENT_MODULE_EXTENSIONS.join(", ")}`);
|
|
5500
5500
|
return true;
|
|
5501
5501
|
}
|
|
5502
|
-
if (!
|
|
5502
|
+
if (!import_node_path12.default.isAbsolute(targetPath)) {
|
|
5503
5503
|
res.writeHead(400, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5504
5504
|
res.end("replacement file path must be absolute");
|
|
5505
5505
|
return true;
|
|
5506
5506
|
}
|
|
5507
5507
|
const runtimePackages = new Set(url.searchParams.getAll("runtimePackage"));
|
|
5508
|
-
const servedRoots = options.servedRoots?.map((root) =>
|
|
5508
|
+
const servedRoots = options.servedRoots?.map((root) => import_node_path12.default.resolve(root));
|
|
5509
5509
|
if (servedRoots && !isInsideAny(servedRoots, targetPath)) {
|
|
5510
5510
|
res.writeHead(403, { "Content-Type": "text/plain; charset=utf-8" });
|
|
5511
5511
|
res.end("replacement file must be inside a folder the bundler serves");
|
|
@@ -5557,14 +5557,14 @@ async function handleReplacementModuleRequest(req, res, options = {}) {
|
|
|
5557
5557
|
}
|
|
5558
5558
|
return true;
|
|
5559
5559
|
}
|
|
5560
|
-
var
|
|
5560
|
+
var import_node_fs12, import_promises5, import_node_path12, REPLACEMENT_MODULE_ROUTE;
|
|
5561
5561
|
var init_replacement_module_handler = __esm({
|
|
5562
5562
|
"src/host/replacement-module-handler.ts"() {
|
|
5563
5563
|
"use strict";
|
|
5564
5564
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5565
|
-
|
|
5565
|
+
import_node_fs12 = require("node:fs");
|
|
5566
5566
|
import_promises5 = __toESM(require("node:fs/promises"), 1);
|
|
5567
|
-
|
|
5567
|
+
import_node_path12 = __toESM(require("node:path"), 1);
|
|
5568
5568
|
init_replacementModule();
|
|
5569
5569
|
init_backend_origin();
|
|
5570
5570
|
REPLACEMENT_MODULE_ROUTE = "/__sootsim-replacement-module";
|
|
@@ -5583,22 +5583,22 @@ var init_forked_script_contract = __esm({
|
|
|
5583
5583
|
|
|
5584
5584
|
// src/swift-source-file.ts
|
|
5585
5585
|
function relativeInside(root, file) {
|
|
5586
|
-
const relative3 =
|
|
5587
|
-
return relative3 === ".." || relative3.startsWith(`..${
|
|
5586
|
+
const relative3 = import_node_path13.default.relative(root, file);
|
|
5587
|
+
return relative3 === ".." || relative3.startsWith(`..${import_node_path13.default.sep}`) || import_node_path13.default.isAbsolute(relative3) ? null : relative3;
|
|
5588
5588
|
}
|
|
5589
5589
|
function packageInputPath(canonicalRoot, file) {
|
|
5590
|
-
const canonicalFile =
|
|
5590
|
+
const canonicalFile = import_node_fs13.default.realpathSync(file);
|
|
5591
5591
|
if (relativeInside(canonicalRoot, canonicalFile) === null) {
|
|
5592
5592
|
throw new Error(`swift input escapes the selected package: ${file}`);
|
|
5593
5593
|
}
|
|
5594
5594
|
return canonicalFile;
|
|
5595
5595
|
}
|
|
5596
5596
|
function readPackageFile(root, file, maxBytes) {
|
|
5597
|
-
const canonicalFile = packageInputPath(
|
|
5598
|
-
const expected =
|
|
5599
|
-
const fd =
|
|
5597
|
+
const canonicalFile = packageInputPath(import_node_fs13.default.realpathSync(root), file);
|
|
5598
|
+
const expected = import_node_fs13.default.statSync(canonicalFile);
|
|
5599
|
+
const fd = import_node_fs13.default.openSync(canonicalFile, import_node_fs13.default.constants.O_RDONLY | import_node_fs13.default.constants.O_NOFOLLOW);
|
|
5600
5600
|
try {
|
|
5601
|
-
const stat =
|
|
5601
|
+
const stat = import_node_fs13.default.fstatSync(fd);
|
|
5602
5602
|
if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
|
|
5603
5603
|
throw new Error(`swift input changed while opening: ${file}`);
|
|
5604
5604
|
}
|
|
@@ -5608,25 +5608,25 @@ function readPackageFile(root, file, maxBytes) {
|
|
|
5608
5608
|
const bytes = Buffer.alloc(stat.size + 1);
|
|
5609
5609
|
let offset = 0;
|
|
5610
5610
|
while (offset < bytes.length) {
|
|
5611
|
-
const count =
|
|
5611
|
+
const count = import_node_fs13.default.readSync(fd, bytes, offset, bytes.length - offset, null);
|
|
5612
5612
|
if (count === 0) break;
|
|
5613
5613
|
offset += count;
|
|
5614
5614
|
}
|
|
5615
|
-
if (offset !== stat.size ||
|
|
5615
|
+
if (offset !== stat.size || import_node_fs13.default.fstatSync(fd).size !== stat.size) {
|
|
5616
5616
|
throw new Error(`swift input changed while reading: ${file}`);
|
|
5617
5617
|
}
|
|
5618
5618
|
return bytes.subarray(0, offset);
|
|
5619
5619
|
} finally {
|
|
5620
|
-
|
|
5620
|
+
import_node_fs13.default.closeSync(fd);
|
|
5621
5621
|
}
|
|
5622
5622
|
}
|
|
5623
|
-
var
|
|
5623
|
+
var import_node_fs13, import_node_path13;
|
|
5624
5624
|
var init_swift_source_file = __esm({
|
|
5625
5625
|
"src/swift-source-file.ts"() {
|
|
5626
5626
|
"use strict";
|
|
5627
5627
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5628
|
-
|
|
5629
|
-
|
|
5628
|
+
import_node_fs13 = __toESM(require("node:fs"), 1);
|
|
5629
|
+
import_node_path13 = __toESM(require("node:path"), 1);
|
|
5630
5630
|
}
|
|
5631
5631
|
});
|
|
5632
5632
|
|
|
@@ -5672,9 +5672,9 @@ var init_swift_submit = __esm({
|
|
|
5672
5672
|
// cli/app-project.ts
|
|
5673
5673
|
function firstNamedFile(dir, names) {
|
|
5674
5674
|
for (const name2 of names) {
|
|
5675
|
-
const candidate =
|
|
5675
|
+
const candidate = import_node_path15.default.join(dir, name2);
|
|
5676
5676
|
try {
|
|
5677
|
-
if (
|
|
5677
|
+
if (import_node_fs15.default.statSync(candidate).isFile()) return candidate;
|
|
5678
5678
|
} catch {
|
|
5679
5679
|
}
|
|
5680
5680
|
}
|
|
@@ -5687,25 +5687,25 @@ function findRNXAppConfig(dir) {
|
|
|
5687
5687
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
5688
5688
|
}
|
|
5689
5689
|
function resolveAppProject(projectRoot) {
|
|
5690
|
-
const appDir =
|
|
5690
|
+
const appDir = import_node_path15.default.resolve(projectRoot);
|
|
5691
5691
|
try {
|
|
5692
|
-
if (!
|
|
5692
|
+
if (!import_node_fs15.default.statSync(appDir).isDirectory()) return null;
|
|
5693
5693
|
} catch {
|
|
5694
5694
|
return null;
|
|
5695
5695
|
}
|
|
5696
5696
|
const configPath = findRNXAppConfig(appDir);
|
|
5697
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
5697
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs15.default.existsSync(import_node_path15.default.join(appDir, "package.json"))) {
|
|
5698
5698
|
return null;
|
|
5699
5699
|
}
|
|
5700
5700
|
return { appDir, configPath };
|
|
5701
5701
|
}
|
|
5702
|
-
var
|
|
5702
|
+
var import_node_fs15, import_node_path15, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
5703
5703
|
var init_app_project = __esm({
|
|
5704
5704
|
"cli/app-project.ts"() {
|
|
5705
5705
|
"use strict";
|
|
5706
5706
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5707
|
-
|
|
5708
|
-
|
|
5707
|
+
import_node_fs15 = __toESM(require("node:fs"), 1);
|
|
5708
|
+
import_node_path15 = __toESM(require("node:path"), 1);
|
|
5709
5709
|
EXPO_APP_CONFIG_NAMES = [
|
|
5710
5710
|
"app.config.js",
|
|
5711
5711
|
"app.config.ts",
|
|
@@ -5827,19 +5827,19 @@ function readJson(root, relative3) {
|
|
|
5827
5827
|
return JSON.parse(
|
|
5828
5828
|
readPackageFile(
|
|
5829
5829
|
root,
|
|
5830
|
-
|
|
5830
|
+
import_node_path29.default.join(root, relative3),
|
|
5831
5831
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
5832
5832
|
).toString("utf8")
|
|
5833
5833
|
);
|
|
5834
5834
|
}
|
|
5835
5835
|
function registrations(root) {
|
|
5836
|
-
const directory =
|
|
5837
|
-
const initializers =
|
|
5836
|
+
const directory = import_node_path29.default.join(root, "nitrogen/generated/ios");
|
|
5837
|
+
const initializers = import_node_fs26.default.readdirSync(directory).filter((file) => file.endsWith("Autolinking.mm"));
|
|
5838
5838
|
if (initializers.length !== 1)
|
|
5839
5839
|
throw new Error(`${root}: expected one generated Nitro iOS initializer`);
|
|
5840
5840
|
const source = readPackageFile(
|
|
5841
5841
|
root,
|
|
5842
|
-
|
|
5842
|
+
import_node_path29.default.join(directory, initializers[0]),
|
|
5843
5843
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
5844
5844
|
).toString("utf8");
|
|
5845
5845
|
const namespaces = [
|
|
@@ -5902,18 +5902,18 @@ function registrations(root) {
|
|
|
5902
5902
|
if (new Set(classes.map(({ name: name2 }) => name2)).size !== classes.length)
|
|
5903
5903
|
throw new Error(`${root}: duplicate generated Nitro iOS registration`);
|
|
5904
5904
|
classes.sort((a, b) => a.name.localeCompare(b.name));
|
|
5905
|
-
const ios =
|
|
5906
|
-
if (swiftModule === null &&
|
|
5905
|
+
const ios = import_node_path29.default.join(root, "ios");
|
|
5906
|
+
if (swiftModule === null && import_node_fs26.default.existsSync(ios) && import_node_fs26.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
|
|
5907
5907
|
swiftModule = initializers[0].slice(0, -"Autolinking.mm".length);
|
|
5908
5908
|
return { namespace, swiftModule, classes, views: viewNames(root, classes) };
|
|
5909
5909
|
}
|
|
5910
5910
|
function viewNames(root, classes) {
|
|
5911
|
-
const directory =
|
|
5912
|
-
if (!
|
|
5911
|
+
const directory = import_node_path29.default.join(root, "nitrogen/generated/shared/json");
|
|
5912
|
+
if (!import_node_fs26.default.existsSync(directory)) return /* @__PURE__ */ new Set();
|
|
5913
5913
|
const views = /* @__PURE__ */ new Set();
|
|
5914
|
-
for (const file of
|
|
5914
|
+
for (const file of import_node_fs26.default.readdirSync(directory)) {
|
|
5915
5915
|
if (!file.endsWith("Config.json")) continue;
|
|
5916
|
-
const config = readJson(root,
|
|
5916
|
+
const config = readJson(root, import_node_path29.default.join("nitrogen/generated/shared/json", file));
|
|
5917
5917
|
const name2 = object(config) ? config.uiViewClassName : void 0;
|
|
5918
5918
|
if (typeof name2 === "string" && classes.some((entry) => entry.name === name2))
|
|
5919
5919
|
views.add(name2);
|
|
@@ -5921,22 +5921,22 @@ function viewNames(root, classes) {
|
|
|
5921
5921
|
return views;
|
|
5922
5922
|
}
|
|
5923
5923
|
function hasNitroIosInitializer(root) {
|
|
5924
|
-
const generated =
|
|
5925
|
-
return
|
|
5924
|
+
const generated = import_node_path29.default.join(root, "nitrogen/generated/ios");
|
|
5925
|
+
return import_node_fs26.default.existsSync(generated) && import_node_fs26.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
|
|
5926
5926
|
}
|
|
5927
5927
|
function nitroRegisteredNames(root) {
|
|
5928
5928
|
if (!hasNitroIosInitializer(root)) return null;
|
|
5929
5929
|
const { classes, views } = registrations(root);
|
|
5930
5930
|
return { names: classes.map(({ name: name2 }) => name2), views: [...views].sort() };
|
|
5931
5931
|
}
|
|
5932
|
-
var import_node_child_process11,
|
|
5932
|
+
var import_node_child_process11, import_node_fs26, import_node_path29, import_node_util7, run6;
|
|
5933
5933
|
var init_nitro_source = __esm({
|
|
5934
5934
|
"src/nitro-source.ts"() {
|
|
5935
5935
|
"use strict";
|
|
5936
5936
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
5937
5937
|
import_node_child_process11 = require("node:child_process");
|
|
5938
|
-
|
|
5939
|
-
|
|
5938
|
+
import_node_fs26 = __toESM(require("node:fs"), 1);
|
|
5939
|
+
import_node_path29 = __toESM(require("node:path"), 1);
|
|
5940
5940
|
import_node_util7 = require("node:util");
|
|
5941
5941
|
init_forked_script_contract();
|
|
5942
5942
|
init_nitro_dependencies();
|
|
@@ -6062,7 +6062,7 @@ function resolveAppStubs(appDir, config, configDir) {
|
|
|
6062
6062
|
const { modules, views, hybridObjects } = expandStubs(appDir, source);
|
|
6063
6063
|
assertRegisteredHybridObjects(appDir, source, hybridObjects);
|
|
6064
6064
|
for (const [name2, answer] of Object.entries(hybridObjects))
|
|
6065
|
-
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0,
|
|
6065
|
+
nativeHybridObjects[name2] = answer === "unsupported" ? answer : { file: (0, import_node_path30.resolve)(source.baseDir, answer) };
|
|
6066
6066
|
for (const [name2, stub] of Object.entries(modules))
|
|
6067
6067
|
nativeModules[name2] = lowerStub(stub, source.baseDir);
|
|
6068
6068
|
for (const [name2, stub] of Object.entries(views))
|
|
@@ -6127,10 +6127,10 @@ function assertRegisteredHybridObjects(appDir, source, hybridObjects) {
|
|
|
6127
6127
|
);
|
|
6128
6128
|
}
|
|
6129
6129
|
function lowerStub(stub, baseDir) {
|
|
6130
|
-
return stub === "noop" ? stub : { file: (0,
|
|
6130
|
+
return stub === "noop" ? stub : { file: (0, import_node_path30.resolve)(baseDir, stub) };
|
|
6131
6131
|
}
|
|
6132
6132
|
function readPackageJson(dir) {
|
|
6133
|
-
const text2 = readSmallFile((0,
|
|
6133
|
+
const text2 = readSmallFile((0, import_node_path30.join)(dir, "package.json"));
|
|
6134
6134
|
if (!text2) return null;
|
|
6135
6135
|
try {
|
|
6136
6136
|
const parsed = JSON.parse(text2);
|
|
@@ -6142,9 +6142,9 @@ function readPackageJson(dir) {
|
|
|
6142
6142
|
function installedPackageDir(appDir, name2) {
|
|
6143
6143
|
let current = appDir;
|
|
6144
6144
|
while (true) {
|
|
6145
|
-
const dir = (0,
|
|
6146
|
-
if ((0,
|
|
6147
|
-
const parent = (0,
|
|
6145
|
+
const dir = (0, import_node_path30.join)(current, "node_modules", name2);
|
|
6146
|
+
if ((0, import_node_fs27.existsSync)((0, import_node_path30.join)(dir, "package.json"))) return (0, import_node_fs27.realpathSync)(dir);
|
|
6147
|
+
const parent = (0, import_node_path30.dirname)(current);
|
|
6148
6148
|
if (parent === current) return null;
|
|
6149
6149
|
current = parent;
|
|
6150
6150
|
}
|
|
@@ -6248,7 +6248,7 @@ function mergeRequests(previous, next) {
|
|
|
6248
6248
|
function packageNativeRequests(dir) {
|
|
6249
6249
|
const found = /* @__PURE__ */ new Map();
|
|
6250
6250
|
const directories = scanRepository(dir).directories.filter((sub) => {
|
|
6251
|
-
const segments = (0,
|
|
6251
|
+
const segments = (0, import_node_path30.relative)(dir, sub).split("/");
|
|
6252
6252
|
return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment) => PACKAGE_SKIP_DIRS.has(segment));
|
|
6253
6253
|
});
|
|
6254
6254
|
let files = 0;
|
|
@@ -6256,7 +6256,7 @@ function packageNativeRequests(dir) {
|
|
|
6256
6256
|
for (const name2 of listDir(sub)) {
|
|
6257
6257
|
if (!SOURCE_FILE.test(name2) || name2.endsWith(".d.ts") || files >= 2e3) continue;
|
|
6258
6258
|
files++;
|
|
6259
|
-
const file = (0,
|
|
6259
|
+
const file = (0, import_node_path30.join)(sub, name2);
|
|
6260
6260
|
const text2 = readSmallFile(file);
|
|
6261
6261
|
if (!text2) continue;
|
|
6262
6262
|
for (const { line: _line, ...request } of sourceNativeRequests(file, text2, true)) {
|
|
@@ -6374,27 +6374,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
|
|
|
6374
6374
|
}
|
|
6375
6375
|
function listDir(dir) {
|
|
6376
6376
|
try {
|
|
6377
|
-
return (0,
|
|
6377
|
+
return (0, import_node_fs27.readdirSync)(dir);
|
|
6378
6378
|
} catch {
|
|
6379
6379
|
return [];
|
|
6380
6380
|
}
|
|
6381
6381
|
}
|
|
6382
6382
|
function readSmallFile(file) {
|
|
6383
6383
|
try {
|
|
6384
|
-
return (0,
|
|
6384
|
+
return (0, import_node_fs27.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs27.readFileSync)(file, "utf8") : null;
|
|
6385
6385
|
} catch {
|
|
6386
6386
|
return null;
|
|
6387
6387
|
}
|
|
6388
6388
|
}
|
|
6389
6389
|
function hasNativeCode(dir, platform) {
|
|
6390
|
-
const expoConfig = (0,
|
|
6390
|
+
const expoConfig = (0, import_node_path30.join)(dir, "expo-module.config.json");
|
|
6391
6391
|
const platforms = metadataValue(readProjectJson(expoConfig), "platforms");
|
|
6392
6392
|
if (Array.isArray(platforms))
|
|
6393
6393
|
return platforms.includes(platform) || platform === "ios" && platforms.includes("apple");
|
|
6394
|
-
if ([platform, "expo-module.config.json"].some((entry) => (0,
|
|
6394
|
+
if ([platform, "expo-module.config.json"].some((entry) => (0, import_node_fs27.existsSync)((0, import_node_path30.join)(dir, entry))))
|
|
6395
6395
|
return true;
|
|
6396
6396
|
if (listDir(dir).some((name2) => name2.endsWith(".podspec"))) return true;
|
|
6397
|
-
const manifest = readSmallFile((0,
|
|
6397
|
+
const manifest = readSmallFile((0, import_node_path30.join)(dir, "package.json"));
|
|
6398
6398
|
return manifest !== null && manifest.includes('"codegenConfig"');
|
|
6399
6399
|
}
|
|
6400
6400
|
function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
|
|
@@ -6407,7 +6407,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6407
6407
|
(excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
|
|
6408
6408
|
))
|
|
6409
6409
|
continue;
|
|
6410
|
-
if ((0,
|
|
6410
|
+
if ((0, import_node_fs27.existsSync)((0, import_node_path30.join)(dir, "expo-module.config.json"))) {
|
|
6411
6411
|
if (platform && !hasNativeCode(dir, platform)) {
|
|
6412
6412
|
excludedModuleDirs.push(dir);
|
|
6413
6413
|
continue;
|
|
@@ -6416,7 +6416,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6416
6416
|
}
|
|
6417
6417
|
for (const name2 of listDir(dir)) {
|
|
6418
6418
|
if (SOURCE_FILE.test(name2) && !name2.endsWith(".d.ts"))
|
|
6419
|
-
sourceFiles.push((0,
|
|
6419
|
+
sourceFiles.push((0, import_node_path30.join)(dir, name2));
|
|
6420
6420
|
}
|
|
6421
6421
|
}
|
|
6422
6422
|
}
|
|
@@ -6426,7 +6426,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6426
6426
|
scanRepository(dir).directories.flatMap(
|
|
6427
6427
|
(sub) => listDir(sub).filter(
|
|
6428
6428
|
(name2) => NATIVE_SOURCE_FILE.test(name2) && (!platform || (platform === "ios" ? name2.endsWith(".swift") : name2.endsWith(".kt")))
|
|
6429
|
-
).map((name2) => (0,
|
|
6429
|
+
).map((name2) => (0, import_node_path30.join)(sub, name2))
|
|
6430
6430
|
)
|
|
6431
6431
|
])
|
|
6432
6432
|
);
|
|
@@ -6435,7 +6435,7 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6435
6435
|
const known = owners.get(dir);
|
|
6436
6436
|
if (known) return known;
|
|
6437
6437
|
const name2 = readPackageJson(dir)?.name;
|
|
6438
|
-
const parent = (0,
|
|
6438
|
+
const parent = (0, import_node_path30.dirname)(dir);
|
|
6439
6439
|
const result = typeof name2 === "string" ? name2 : parent === dir ? pkg.name ?? "app" : owner(parent);
|
|
6440
6440
|
owners.set(dir, result);
|
|
6441
6441
|
return result;
|
|
@@ -6449,22 +6449,22 @@ function scanLocalNative(appDir, pkg, answered, platform, knownPackages = /* @__
|
|
|
6449
6449
|
else {
|
|
6450
6450
|
const moduleDir2 = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`));
|
|
6451
6451
|
if (moduleDir2 && (file.endsWith(".swift") || !known.expoModule)) {
|
|
6452
|
-
known.expoModule = (0,
|
|
6452
|
+
known.expoModule = (0, import_node_path30.relative)(appDir, moduleDir2) || ".";
|
|
6453
6453
|
known.swift = file.endsWith(".swift");
|
|
6454
6454
|
}
|
|
6455
6455
|
}
|
|
6456
6456
|
return;
|
|
6457
6457
|
}
|
|
6458
6458
|
providers ??= dependencyNativeOwners(appDir, pkg);
|
|
6459
|
-
const packageName = providers.get(key) ?? owner((0,
|
|
6459
|
+
const packageName = providers.get(key) ?? owner((0, import_node_path30.dirname)(file));
|
|
6460
6460
|
if (knownPackages.has(packageName)) return;
|
|
6461
6461
|
const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
|
|
6462
6462
|
found.set(key, {
|
|
6463
6463
|
kind,
|
|
6464
6464
|
name: name2,
|
|
6465
6465
|
package: packageName,
|
|
6466
|
-
path: `${(0,
|
|
6467
|
-
expoModule: moduleDir ? (0,
|
|
6466
|
+
path: `${(0, import_node_path30.relative)(appDir, file)}:${line}`,
|
|
6467
|
+
expoModule: moduleDir ? (0, import_node_path30.relative)(appDir, moduleDir) || "." : null,
|
|
6468
6468
|
optional,
|
|
6469
6469
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
6470
6470
|
(path30) => path30.endsWith(".swift") && [...(readSmallFile(path30) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
@@ -6515,30 +6515,30 @@ function workspacePackageDirs(appDir, pkg) {
|
|
|
6515
6515
|
for (const name2 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
|
|
6516
6516
|
let current = appDir;
|
|
6517
6517
|
while (true) {
|
|
6518
|
-
const link = (0,
|
|
6519
|
-
if ((0,
|
|
6520
|
-
if ((0,
|
|
6521
|
-
const target = (0,
|
|
6518
|
+
const link = (0, import_node_path30.join)(current, "node_modules", name2);
|
|
6519
|
+
if ((0, import_node_fs27.existsSync)(link)) {
|
|
6520
|
+
if ((0, import_node_fs27.lstatSync)(link).isSymbolicLink()) {
|
|
6521
|
+
const target = (0, import_node_fs27.realpathSync)(link);
|
|
6522
6522
|
if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
|
|
6523
6523
|
dirs.add(target);
|
|
6524
6524
|
}
|
|
6525
6525
|
}
|
|
6526
6526
|
break;
|
|
6527
6527
|
}
|
|
6528
|
-
const parent = (0,
|
|
6528
|
+
const parent = (0, import_node_path30.dirname)(current);
|
|
6529
6529
|
if (parent === current) break;
|
|
6530
6530
|
current = parent;
|
|
6531
6531
|
}
|
|
6532
6532
|
}
|
|
6533
6533
|
return [...dirs];
|
|
6534
6534
|
}
|
|
6535
|
-
var
|
|
6535
|
+
var import_node_fs27, import_node_path30, import_oxc_parser2, import_sucrase, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE;
|
|
6536
6536
|
var init_app_stubs = __esm({
|
|
6537
6537
|
"cli/app-stubs.ts"() {
|
|
6538
6538
|
"use strict";
|
|
6539
6539
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6540
|
-
|
|
6541
|
-
|
|
6540
|
+
import_node_fs27 = require("node:fs");
|
|
6541
|
+
import_node_path30 = require("node:path");
|
|
6542
6542
|
init_version_range();
|
|
6543
6543
|
import_oxc_parser2 = require("oxc-parser");
|
|
6544
6544
|
import_sucrase = require("sucrase");
|
|
@@ -6574,12 +6574,12 @@ function resolveFileEntries(entries, configDir) {
|
|
|
6574
6574
|
return Object.fromEntries(
|
|
6575
6575
|
Object.entries(entries).map(([name2, resolution]) => [
|
|
6576
6576
|
name2,
|
|
6577
|
-
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file:
|
|
6577
|
+
resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string" ? { ...resolution, file: import_node_path31.default.resolve(configDir, resolution.file) } : resolution
|
|
6578
6578
|
])
|
|
6579
6579
|
);
|
|
6580
6580
|
}
|
|
6581
6581
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
6582
|
-
const configDir =
|
|
6582
|
+
const configDir = import_node_path31.default.dirname(configPath);
|
|
6583
6583
|
return {
|
|
6584
6584
|
...config,
|
|
6585
6585
|
modules: resolveFileEntries(config.modules, configDir)
|
|
@@ -6595,7 +6595,7 @@ async function loadRNXAppStubs(project) {
|
|
|
6595
6595
|
return resolveAppStubs(
|
|
6596
6596
|
project.appDir,
|
|
6597
6597
|
config,
|
|
6598
|
-
project.configPath ?
|
|
6598
|
+
project.configPath ? import_node_path31.default.dirname(project.configPath) : project.appDir
|
|
6599
6599
|
);
|
|
6600
6600
|
} catch (error) {
|
|
6601
6601
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -6614,7 +6614,7 @@ async function loadConfigFile(project) {
|
|
|
6614
6614
|
[`${rnxPublicBrand.packageName}/config`]: config_exports
|
|
6615
6615
|
}
|
|
6616
6616
|
});
|
|
6617
|
-
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0,
|
|
6617
|
+
const loaded3 = project.configPath.endsWith(".json") ? JSON.parse((0, import_node_fs28.readFileSync)(project.configPath, "utf8")) : await jiti.import(project.configPath, { default: true });
|
|
6618
6618
|
if (!isPeachConfig(loaded3)) {
|
|
6619
6619
|
throw new Error("the default export must be a peach config object");
|
|
6620
6620
|
}
|
|
@@ -6650,13 +6650,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
6650
6650
|
const project = resolveAppProject(startDir);
|
|
6651
6651
|
return { project, ...await loadRNXAppStubs(project) };
|
|
6652
6652
|
}
|
|
6653
|
-
var
|
|
6653
|
+
var import_node_fs28, import_node_path31, import_jiti, WIRE_SLOTS;
|
|
6654
6654
|
var init_app_config = __esm({
|
|
6655
6655
|
"cli/app-config.ts"() {
|
|
6656
6656
|
"use strict";
|
|
6657
6657
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6658
|
-
|
|
6659
|
-
|
|
6658
|
+
import_node_fs28 = require("node:fs");
|
|
6659
|
+
import_node_path31 = __toESM(require("node:path"), 1);
|
|
6660
6660
|
import_jiti = require("jiti");
|
|
6661
6661
|
init_config();
|
|
6662
6662
|
init_config();
|
|
@@ -6756,14 +6756,14 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6756
6756
|
const neededPackages = /* @__PURE__ */ new Set();
|
|
6757
6757
|
const factories = [];
|
|
6758
6758
|
const visit3 = (filePath) => {
|
|
6759
|
-
const real =
|
|
6759
|
+
const real = import_node_fs29.default.realpathSync(filePath);
|
|
6760
6760
|
const previous = files.get(real);
|
|
6761
6761
|
if (previous !== void 0) return previous;
|
|
6762
6762
|
const id = "peach-config-file:" + files.size;
|
|
6763
6763
|
files.set(real, id);
|
|
6764
6764
|
const compiled = compileReplacementModule({
|
|
6765
6765
|
filePath: real,
|
|
6766
|
-
source:
|
|
6766
|
+
source: import_node_fs29.default.readFileSync(real, "utf8"),
|
|
6767
6767
|
runtimePackages,
|
|
6768
6768
|
localModuleUrl: (specifier) => visit3(resolveReplacementModuleFile(real, specifier))
|
|
6769
6769
|
});
|
|
@@ -6787,7 +6787,7 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6787
6787
|
if (!entries || typeof entries !== "object") continue;
|
|
6788
6788
|
for (const resolution of Object.values(entries)) {
|
|
6789
6789
|
if (resolution && typeof resolution === "object" && "file" in resolution && typeof resolution.file === "string") {
|
|
6790
|
-
resolution.file = visit3(
|
|
6790
|
+
resolution.file = visit3(import_node_path32.default.resolve(resolution.file));
|
|
6791
6791
|
}
|
|
6792
6792
|
}
|
|
6793
6793
|
}
|
|
@@ -6811,13 +6811,13 @@ async function produceConfiguredBundle(source, config, runtimePackages) {
|
|
|
6811
6811
|
const identityStart = findBundleFooter(source, "globalThis.__sootsimModulePaths=");
|
|
6812
6812
|
return prefix2 + (identityStart < 0 ? source + footer : source.slice(0, identityStart) + footer + source.slice(identityStart));
|
|
6813
6813
|
}
|
|
6814
|
-
var
|
|
6814
|
+
var import_node_fs29, import_node_path32, import_sucrase2, import_terser, PREFIX_START, PREFIX_END;
|
|
6815
6815
|
var init_configured_bundle_producer = __esm({
|
|
6816
6816
|
"src/configured-bundle-producer.ts"() {
|
|
6817
6817
|
"use strict";
|
|
6818
6818
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6819
|
-
|
|
6820
|
-
|
|
6819
|
+
import_node_fs29 = __toESM(require("node:fs"), 1);
|
|
6820
|
+
import_node_path32 = __toESM(require("node:path"), 1);
|
|
6821
6821
|
import_sucrase2 = require("sucrase");
|
|
6822
6822
|
import_terser = require("terser");
|
|
6823
6823
|
init_dependencies();
|
|
@@ -6865,7 +6865,7 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
6865
6865
|
|
|
6866
6866
|
// cli/cloud-client.ts
|
|
6867
6867
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
6868
|
-
var
|
|
6868
|
+
var import_node_crypto4 = require("node:crypto");
|
|
6869
6869
|
|
|
6870
6870
|
// src/androidAutolinkingContract.ts
|
|
6871
6871
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -6901,7 +6901,7 @@ var import_node_module = require("node:module");
|
|
|
6901
6901
|
var import_node_path2 = require("node:path");
|
|
6902
6902
|
|
|
6903
6903
|
// runtime-companion.json
|
|
6904
|
-
var runtime_companion_default = { abi: 1, sha256: "
|
|
6904
|
+
var runtime_companion_default = { abi: 1, sha256: "77c8e261af4f0a75c45389b7605abcb681d900495f128191f81464492ffadda7", file: "node/cli-77c8e261af4f0a75c45389b7605abcb681d900495f128191f81464492ffadda7.cjs" };
|
|
6905
6905
|
|
|
6906
6906
|
// src/runtime-assets.ts
|
|
6907
6907
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -7366,7 +7366,11 @@ var CHOOSE_ACCOUNT_HINT = "this sign-in belongs to several accounts; run `peach
|
|
|
7366
7366
|
|
|
7367
7367
|
// cli/cloud-session.ts
|
|
7368
7368
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
7369
|
+
var import_node_crypto3 = require("node:crypto");
|
|
7370
|
+
var import_node_fs4 = require("node:fs");
|
|
7371
|
+
var import_node_path4 = require("node:path");
|
|
7369
7372
|
init_backend_origin();
|
|
7373
|
+
init_home_paths();
|
|
7370
7374
|
init_is_record();
|
|
7371
7375
|
var CLOUD_SESSION_VERSION = 3;
|
|
7372
7376
|
var MAX_ENCODED_SESSION_BYTES = 32 * 1024;
|
|
@@ -7500,9 +7504,37 @@ function parseCloudSession(encoded) {
|
|
|
7500
7504
|
throw new Error(`${PEACH_CLOUD_SESSION_ENV} is invalid`);
|
|
7501
7505
|
}
|
|
7502
7506
|
}
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7507
|
+
var PROJECT_MARKERS = [
|
|
7508
|
+
"package.json",
|
|
7509
|
+
"Package.swift",
|
|
7510
|
+
"settings.gradle",
|
|
7511
|
+
"settings.gradle.kts",
|
|
7512
|
+
".git"
|
|
7513
|
+
];
|
|
7514
|
+
function projectSessionFile() {
|
|
7515
|
+
const cwd = (0, import_node_fs4.realpathSync)(process.cwd());
|
|
7516
|
+
let dir = cwd;
|
|
7517
|
+
while (!PROJECT_MARKERS.some((marker) => (0, import_node_fs4.existsSync)((0, import_node_path4.join)(dir, marker)))) {
|
|
7518
|
+
const parent = (0, import_node_path4.dirname)(dir);
|
|
7519
|
+
if (parent === dir) {
|
|
7520
|
+
dir = cwd;
|
|
7521
|
+
break;
|
|
7522
|
+
}
|
|
7523
|
+
dir = parent;
|
|
7524
|
+
}
|
|
7525
|
+
const key = (0, import_node_crypto3.createHash)("sha256").update(dir).digest("hex").slice(0, 32);
|
|
7526
|
+
return (0, import_node_path4.join)(rnxHomeDir(), "remote-sessions", `${key}.json`);
|
|
7527
|
+
}
|
|
7528
|
+
function readCloudSession() {
|
|
7529
|
+
const encoded = process.env[PEACH_CLOUD_SESSION_ENV];
|
|
7530
|
+
if (encoded?.trim()) return parseCloudSession(encoded);
|
|
7531
|
+
const file = projectSessionFile();
|
|
7532
|
+
if (!(0, import_node_fs4.existsSync)(file)) return null;
|
|
7533
|
+
const saved = JSON.parse((0, import_node_fs4.readFileSync)(file, "utf8"));
|
|
7534
|
+
if (!isRecord(saved) || typeof saved.session !== "string") {
|
|
7535
|
+
throw new Error(`the saved remote simulator in ${file} is invalid`);
|
|
7536
|
+
}
|
|
7537
|
+
return parseCloudSession(saved.session);
|
|
7506
7538
|
}
|
|
7507
7539
|
|
|
7508
7540
|
// cli/cloud-client.ts
|
|
@@ -7531,8 +7563,9 @@ var ACCOUNT_CHOICE_REFUSALS = /* @__PURE__ */ new Set([
|
|
|
7531
7563
|
function responseError(status, text2) {
|
|
7532
7564
|
const parsed = text2 ? failureSentence(text2) : null;
|
|
7533
7565
|
const sentence = parsed && ACCOUNT_CHOICE_REFUSALS.has(parsed) ? CHOOSE_ACCOUNT_HINT : parsed;
|
|
7566
|
+
const hint = parsed?.endsWith(" requires the debug scope") ? "; this command needs debug access, which a remote simulator does not grant, so run it against a local sim" : "";
|
|
7534
7567
|
return new Error(
|
|
7535
|
-
`remote simulator request failed (${status})${sentence ? `: ${sentence}` : text2.trim() ? `: ${text2.trim()}` : ""}`
|
|
7568
|
+
`remote simulator request failed (${status})${sentence ? `: ${sentence}${hint}` : text2.trim() ? `: ${text2.trim()}` : ""}`
|
|
7536
7569
|
);
|
|
7537
7570
|
}
|
|
7538
7571
|
function resolveCloudSessionForParsed(parsed) {
|
|
@@ -7579,7 +7612,7 @@ var CloudBridge = class {
|
|
|
7579
7612
|
async send(command, options) {
|
|
7580
7613
|
const timeoutMs = options?.timeoutMs ?? this.explicitTimeoutMs ?? options?.defaultTimeoutMs;
|
|
7581
7614
|
const body = {
|
|
7582
|
-
id: (0,
|
|
7615
|
+
id: (0, import_node_crypto4.randomUUID)(),
|
|
7583
7616
|
claimId: this.session.claimId,
|
|
7584
7617
|
command: cloudCommand(command)
|
|
7585
7618
|
};
|
|
@@ -7651,7 +7684,7 @@ var CloudBoxBridge = class {
|
|
|
7651
7684
|
plane = "cloud";
|
|
7652
7685
|
async send(command, options) {
|
|
7653
7686
|
const timeoutMs = options?.timeoutMs ?? this.explicitTimeoutMs ?? options?.defaultTimeoutMs;
|
|
7654
|
-
const id = (0,
|
|
7687
|
+
const id = (0, import_node_crypto4.randomUUID)();
|
|
7655
7688
|
const payload = {};
|
|
7656
7689
|
for (const [key, value] of Object.entries(command)) {
|
|
7657
7690
|
if (key !== "id" && key !== "simId") payload[key] = value;
|
|
@@ -8113,8 +8146,8 @@ function isOpenPending() {
|
|
|
8113
8146
|
|
|
8114
8147
|
// cli/ws-bridge.ts
|
|
8115
8148
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8116
|
-
var
|
|
8117
|
-
var
|
|
8149
|
+
var import_node_fs8 = __toESM(require("node:fs"), 1);
|
|
8150
|
+
var import_node_path7 = __toESM(require("node:path"), 1);
|
|
8118
8151
|
var import_ws = require("ws");
|
|
8119
8152
|
|
|
8120
8153
|
// src/bridge-constants.ts
|
|
@@ -8196,11 +8229,11 @@ init_home_paths();
|
|
|
8196
8229
|
// cli/pause-aware-timeout.ts
|
|
8197
8230
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
8198
8231
|
var import_node_child_process = require("node:child_process");
|
|
8199
|
-
var
|
|
8232
|
+
var import_node_fs7 = require("node:fs");
|
|
8200
8233
|
var import_node_os2 = __toESM(require("node:os"), 1);
|
|
8201
|
-
var
|
|
8202
|
-
var LEDGER_PATH =
|
|
8203
|
-
process.env.TM_HOME ||
|
|
8234
|
+
var import_node_path6 = __toESM(require("node:path"), 1);
|
|
8235
|
+
var LEDGER_PATH = import_node_path6.default.join(
|
|
8236
|
+
process.env.TM_HOME || import_node_path6.default.join(import_node_os2.default.homedir(), ".team-machine"),
|
|
8204
8237
|
"governor-pauses.json"
|
|
8205
8238
|
);
|
|
8206
8239
|
var TICK_MS = 500;
|
|
@@ -8210,7 +8243,7 @@ var pollDueAt = 0;
|
|
|
8210
8243
|
function pausedPids() {
|
|
8211
8244
|
try {
|
|
8212
8245
|
const ledger = JSON.parse(
|
|
8213
|
-
(0,
|
|
8246
|
+
(0, import_node_fs7.readFileSync)(LEDGER_PATH, "utf8")
|
|
8214
8247
|
);
|
|
8215
8248
|
return Object.values(ledger).flatMap((procs) => procs.map((proc) => proc.pid));
|
|
8216
8249
|
} catch {
|
|
@@ -8291,17 +8324,17 @@ function liveDevBridgeLockfiles() {
|
|
|
8291
8324
|
return readDevBridgeLockfiles().filter((lockfile) => isDevBridgeLockfileFresh(lockfile));
|
|
8292
8325
|
}
|
|
8293
8326
|
function checkoutRoot(cwd) {
|
|
8294
|
-
let current =
|
|
8327
|
+
let current = import_node_path7.default.resolve(cwd);
|
|
8295
8328
|
while (true) {
|
|
8296
|
-
if (
|
|
8297
|
-
const parent =
|
|
8329
|
+
if (import_node_fs8.default.existsSync(import_node_path7.default.join(current, ".git"))) return current;
|
|
8330
|
+
const parent = import_node_path7.default.dirname(current);
|
|
8298
8331
|
if (parent === current) return null;
|
|
8299
8332
|
current = parent;
|
|
8300
8333
|
}
|
|
8301
8334
|
}
|
|
8302
8335
|
function pathContains(parent, child) {
|
|
8303
|
-
const relative3 =
|
|
8304
|
-
return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${
|
|
8336
|
+
const relative3 = import_node_path7.default.relative(parent, child);
|
|
8337
|
+
return relative3 === "" || relative3 !== ".." && !relative3.startsWith(`..${import_node_path7.default.sep}`) && !import_node_path7.default.isAbsolute(relative3);
|
|
8305
8338
|
}
|
|
8306
8339
|
function resolveDefaultDevBridgeLockfile() {
|
|
8307
8340
|
const lockfiles = liveDevBridgeLockfiles();
|
|
@@ -8426,6 +8459,12 @@ var BridgeSimLockedError = class extends Error {
|
|
|
8426
8459
|
this.lock = lock;
|
|
8427
8460
|
}
|
|
8428
8461
|
};
|
|
8462
|
+
var BridgeHandshakeTimeoutError = class extends Error {
|
|
8463
|
+
constructor(message) {
|
|
8464
|
+
super(message);
|
|
8465
|
+
this.name = "BridgeHandshakeTimeoutError";
|
|
8466
|
+
}
|
|
8467
|
+
};
|
|
8429
8468
|
function describeSimIdSource(source) {
|
|
8430
8469
|
if (source === "flag") return "via --sim";
|
|
8431
8470
|
if (source === "saved") return "saved via `peach use`";
|
|
@@ -8499,7 +8538,7 @@ function createBridge(wsPort, opts = {}) {
|
|
|
8499
8538
|
const ready = new Promise((resolve5, reject) => {
|
|
8500
8539
|
const handshakeTimer = setTimeout(() => {
|
|
8501
8540
|
reject(
|
|
8502
|
-
new
|
|
8541
|
+
new BridgeHandshakeTimeoutError(
|
|
8503
8542
|
`${bridgeWsUrl(wsPort)} accepted the connection but did not complete the websocket handshake within ${commandTimeoutMs / 1e3}s; is it a peach bridge?`
|
|
8504
8543
|
)
|
|
8505
8544
|
);
|
|
@@ -11535,8 +11574,7 @@ function rasterLayerFrame(node) {
|
|
|
11535
11574
|
height: node.layout.height
|
|
11536
11575
|
};
|
|
11537
11576
|
}
|
|
11538
|
-
|
|
11539
|
-
function selectRnxRasterNodeIds(tree2) {
|
|
11577
|
+
function selectRnxRasterNodeIds(tree2, pixelRatio) {
|
|
11540
11578
|
const nodesById = new Map(tree2.nodes.map((node) => [node.nodeId, node]));
|
|
11541
11579
|
const maxLayerArea = tree2.width * tree2.height * 0.25;
|
|
11542
11580
|
const eligible = /* @__PURE__ */ new Map();
|
|
@@ -11589,10 +11627,10 @@ function selectRnxRasterNodeIds(tree2) {
|
|
|
11589
11627
|
while (picked.length > 0) {
|
|
11590
11628
|
const fits = fitRnxCaptureRegions(
|
|
11591
11629
|
rnxRasterRegionRequests(tree2, selection),
|
|
11592
|
-
|
|
11630
|
+
pixelRatio,
|
|
11593
11631
|
{
|
|
11594
|
-
pixelWidth: Math.round(tree2.width *
|
|
11595
|
-
pixelHeight: Math.round(tree2.height *
|
|
11632
|
+
pixelWidth: Math.round(tree2.width * pixelRatio),
|
|
11633
|
+
pixelHeight: Math.round(tree2.height * pixelRatio)
|
|
11596
11634
|
}
|
|
11597
11635
|
);
|
|
11598
11636
|
if (fits) break;
|
|
@@ -11663,7 +11701,7 @@ function liquidGlassPaintOutset(glass, frame) {
|
|
|
11663
11701
|
}
|
|
11664
11702
|
return outset;
|
|
11665
11703
|
}
|
|
11666
|
-
function rnxCaptureRasterRegions(capture) {
|
|
11704
|
+
function rnxCaptureRasterRegions(capture, pixelRatio) {
|
|
11667
11705
|
const tree2 = {
|
|
11668
11706
|
width: capture.tree.viewport.width,
|
|
11669
11707
|
height: capture.tree.viewport.height,
|
|
@@ -11680,7 +11718,7 @@ function rnxCaptureRasterRegions(capture) {
|
|
|
11680
11718
|
visibleFrame: node.layout.visibleFrame
|
|
11681
11719
|
}))
|
|
11682
11720
|
};
|
|
11683
|
-
const selection = selectRnxRasterNodeIds(tree2);
|
|
11721
|
+
const selection = selectRnxRasterNodeIds(tree2, pixelRatio);
|
|
11684
11722
|
return rnxRasterRegionRequests(tree2, selection);
|
|
11685
11723
|
}
|
|
11686
11724
|
function rnxRasterRegionRequests(tree2, selection) {
|
|
@@ -11873,7 +11911,7 @@ function isRnxCaptureRegionAtlas(value) {
|
|
|
11873
11911
|
// src/vite-plugin-one.ts
|
|
11874
11912
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
11875
11913
|
var import_fs6 = __toESM(require("fs"), 1);
|
|
11876
|
-
var
|
|
11914
|
+
var import_node_crypto7 = require("node:crypto");
|
|
11877
11915
|
var import_node_http3 = __toESM(require("node:http"), 1);
|
|
11878
11916
|
var import_node_https2 = __toESM(require("node:https"), 1);
|
|
11879
11917
|
var import_node_url2 = require("node:url");
|
|
@@ -11884,9 +11922,9 @@ var import_ws2 = require("ws");
|
|
|
11884
11922
|
// src/dev-server-open.ts
|
|
11885
11923
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
11886
11924
|
var import_node_child_process2 = require("node:child_process");
|
|
11887
|
-
var
|
|
11888
|
-
var
|
|
11889
|
-
var
|
|
11925
|
+
var import_node_crypto5 = require("node:crypto");
|
|
11926
|
+
var import_node_fs9 = __toESM(require("node:fs"), 1);
|
|
11927
|
+
var import_node_path8 = __toESM(require("node:path"), 1);
|
|
11890
11928
|
function resolveRnxDesktopAppName(open, projectRoot) {
|
|
11891
11929
|
if (!open) return null;
|
|
11892
11930
|
if (typeof open === "object") {
|
|
@@ -11894,8 +11932,8 @@ function resolveRnxDesktopAppName(open, projectRoot) {
|
|
|
11894
11932
|
if (!appName) throw new Error("peach: open.appName must not be empty");
|
|
11895
11933
|
return appName;
|
|
11896
11934
|
}
|
|
11897
|
-
const packageJsonPath =
|
|
11898
|
-
const packageJson = JSON.parse(
|
|
11935
|
+
const packageJsonPath = import_node_path8.default.join(projectRoot, "package.json");
|
|
11936
|
+
const packageJson = JSON.parse(import_node_fs9.default.readFileSync(packageJsonPath, "utf8"));
|
|
11899
11937
|
const packageName = packageJson && typeof packageJson === "object" ? Reflect.get(packageJson, "name") : void 0;
|
|
11900
11938
|
if (typeof packageName !== "string" || !packageName.trim()) {
|
|
11901
11939
|
throw new Error(`peach: ${packageJsonPath} must declare a package name`);
|
|
@@ -11909,7 +11947,7 @@ function tagRnxBundleForPlugin(bundleUrl, replacementOrigin, replacementToken, p
|
|
|
11909
11947
|
url.searchParams.set("rnxAppName", appName);
|
|
11910
11948
|
url.searchParams.set(
|
|
11911
11949
|
"rnxProjectId",
|
|
11912
|
-
(0,
|
|
11950
|
+
(0, import_node_crypto5.createHash)("sha256").update(import_node_fs9.default.realpathSync(projectRoot)).digest("hex").slice(0, 32)
|
|
11913
11951
|
);
|
|
11914
11952
|
}
|
|
11915
11953
|
url.searchParams.set("rnxReplacementOrigin", replacementOrigin);
|
|
@@ -12037,7 +12075,6 @@ var LAZY_STUB_PATTERNS = [
|
|
|
12037
12075
|
"clevertap-react-native",
|
|
12038
12076
|
"expo-dynamic-app-icon",
|
|
12039
12077
|
"expo-health-connect",
|
|
12040
|
-
"expo-in-app-updates",
|
|
12041
12078
|
"expo-mesh-gradient",
|
|
12042
12079
|
"expo-modules-core",
|
|
12043
12080
|
"expo-superwall",
|
|
@@ -12742,6 +12779,7 @@ var LIGHT_NATIVE_PACKAGE_NAMES = [
|
|
|
12742
12779
|
"react-native-installed-app-checker",
|
|
12743
12780
|
"react-native-is-detox",
|
|
12744
12781
|
"react-native-is-keyboard-connected",
|
|
12782
|
+
"react-native-is-maestro",
|
|
12745
12783
|
"react-native-keyboard-input",
|
|
12746
12784
|
"react-native-khipu",
|
|
12747
12785
|
"react-native-klarna-inapp-sdk",
|
|
@@ -14787,12 +14825,6 @@ var COMPAT_STUBS = {
|
|
|
14787
14825
|
runtimeTier: "none",
|
|
14788
14826
|
buildResolvers: ["vite"]
|
|
14789
14827
|
},
|
|
14790
|
-
expoInAppUpdates: {
|
|
14791
|
-
specifier: "expo-in-app-updates",
|
|
14792
|
-
stubFile: "noop-sdks-extra/expo-in-app-updates.ts",
|
|
14793
|
-
runtimeTier: "none",
|
|
14794
|
-
buildResolvers: ["vite"]
|
|
14795
|
-
},
|
|
14796
14828
|
expoSuperwall: {
|
|
14797
14829
|
specifier: "expo-superwall",
|
|
14798
14830
|
stubFile: "noop-sdks-extra/expo-superwall.ts",
|
|
@@ -14815,8 +14847,8 @@ var COMPAT_STUBS = {
|
|
|
14815
14847
|
|
|
14816
14848
|
// src/installed-native-build-options.ts
|
|
14817
14849
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
14818
|
-
var
|
|
14819
|
-
var
|
|
14850
|
+
var import_node_fs10 = __toESM(require("node:fs"), 1);
|
|
14851
|
+
var import_node_path9 = __toESM(require("node:path"), 1);
|
|
14820
14852
|
init_version_range();
|
|
14821
14853
|
var RIVE_PACKAGE = "@rive-app/react-native";
|
|
14822
14854
|
var RIVE_05 = [">=0.5.0 <0.6.0"];
|
|
@@ -14825,10 +14857,10 @@ function missing(error) {
|
|
|
14825
14857
|
}
|
|
14826
14858
|
function answerSync(step) {
|
|
14827
14859
|
try {
|
|
14828
|
-
if (step.type === "realpath") return
|
|
14829
|
-
if (step.type === "read") return
|
|
14830
|
-
if (step.type === "isDirectory") return
|
|
14831
|
-
return
|
|
14860
|
+
if (step.type === "realpath") return import_node_fs10.default.realpathSync(step.path);
|
|
14861
|
+
if (step.type === "read") return import_node_fs10.default.readFileSync(step.path, "utf8");
|
|
14862
|
+
if (step.type === "isDirectory") return import_node_fs10.default.statSync(step.path).isDirectory();
|
|
14863
|
+
return import_node_fs10.default.readdirSync(step.path, { withFileTypes: true }).map((entry) => ({
|
|
14832
14864
|
name: entry.name,
|
|
14833
14865
|
directory: entry.isDirectory(),
|
|
14834
14866
|
symbolicLink: entry.isSymbolicLink()
|
|
@@ -14840,11 +14872,11 @@ function answerSync(step) {
|
|
|
14840
14872
|
}
|
|
14841
14873
|
async function answerAsync(step) {
|
|
14842
14874
|
try {
|
|
14843
|
-
if (step.type === "realpath") return await
|
|
14844
|
-
if (step.type === "read") return await
|
|
14875
|
+
if (step.type === "realpath") return await import_node_fs10.default.promises.realpath(step.path);
|
|
14876
|
+
if (step.type === "read") return await import_node_fs10.default.promises.readFile(step.path, "utf8");
|
|
14845
14877
|
if (step.type === "isDirectory")
|
|
14846
|
-
return (await
|
|
14847
|
-
return (await
|
|
14878
|
+
return (await import_node_fs10.default.promises.stat(step.path)).isDirectory();
|
|
14879
|
+
return (await import_node_fs10.default.promises.readdir(step.path, { withFileTypes: true })).map(
|
|
14848
14880
|
(entry) => ({
|
|
14849
14881
|
name: entry.name,
|
|
14850
14882
|
directory: entry.isDirectory(),
|
|
@@ -14877,7 +14909,7 @@ function* rubyFiles(directory, seen, iosRoot = false) {
|
|
|
14877
14909
|
const files = [];
|
|
14878
14910
|
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
14879
14911
|
if (iosRoot && (entry.name === "Pods" || entry.name === "build")) continue;
|
|
14880
|
-
const target =
|
|
14912
|
+
const target = import_node_path9.default.join(directory, entry.name);
|
|
14881
14913
|
let isDirectory2 = entry.directory;
|
|
14882
14914
|
if (entry.symbolicLink)
|
|
14883
14915
|
isDirectory2 = (yield { type: "isDirectory", path: target }) === true;
|
|
@@ -14890,8 +14922,8 @@ function* nativeBuildOptionsWalk(projectRoot, versions, environment) {
|
|
|
14890
14922
|
if (!needsRiveOptions(versions)) return {};
|
|
14891
14923
|
if (environment.USE_RIVE_LEGACY === "1" || environment.USE_RIVE_LEGACY === "true")
|
|
14892
14924
|
return { [RIVE_PACKAGE]: { USE_RIVE_LEGACY: true } };
|
|
14893
|
-
const ios =
|
|
14894
|
-
const podfile =
|
|
14925
|
+
const ios = import_node_path9.default.join(projectRoot, "ios");
|
|
14926
|
+
const podfile = import_node_path9.default.join(ios, "Podfile");
|
|
14895
14927
|
const files = [podfile, ...yield* rubyFiles(ios, /* @__PURE__ */ new Set(), true)];
|
|
14896
14928
|
let value = false;
|
|
14897
14929
|
let assigned = false;
|
|
@@ -15163,9 +15195,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
15163
15195
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15164
15196
|
var import_child_process2 = require("child_process");
|
|
15165
15197
|
var import_promises = require("fs/promises");
|
|
15166
|
-
var
|
|
15198
|
+
var import_node_fs11 = require("node:fs");
|
|
15167
15199
|
var import_node_os3 = require("node:os");
|
|
15168
|
-
var
|
|
15200
|
+
var import_node_path10 = require("node:path");
|
|
15169
15201
|
init_backend_origin();
|
|
15170
15202
|
init_config();
|
|
15171
15203
|
|
|
@@ -15281,6 +15313,12 @@ async function fetchDevManifest(baseUrl, pageOrigin, options = {}) {
|
|
|
15281
15313
|
}
|
|
15282
15314
|
}
|
|
15283
15315
|
}
|
|
15316
|
+
async function metroRequestFailure(request, url, response) {
|
|
15317
|
+
const detail = (await response.text()).trim().slice(0, 2e3);
|
|
15318
|
+
return new Error(
|
|
15319
|
+
`Metro ${request} request failed: HTTP ${response.status} at ${url}/${detail ? `: ${detail}` : ""}`
|
|
15320
|
+
);
|
|
15321
|
+
}
|
|
15284
15322
|
|
|
15285
15323
|
// src/kotlinDiscoveryContract.ts
|
|
15286
15324
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -15315,8 +15353,8 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
15315
15353
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15316
15354
|
|
|
15317
15355
|
// scripts/dev-server-scanner.ts
|
|
15318
|
-
var LISTENER_LOCK_PATH = (0,
|
|
15319
|
-
var LISTENER_RESULT_PATH = (0,
|
|
15356
|
+
var LISTENER_LOCK_PATH = (0, import_node_path10.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.lock");
|
|
15357
|
+
var LISTENER_RESULT_PATH = (0, import_node_path10.join)((0, import_node_os3.tmpdir)(), "peach-listener-scan.result");
|
|
15320
15358
|
var LISTENER_LOCK_STALE_MS = 25e3;
|
|
15321
15359
|
var LISTENER_LOCK_WAIT_MS = 8e3;
|
|
15322
15360
|
function sleep2(ms) {
|
|
@@ -15334,8 +15372,8 @@ function pidIsAlive(pid) {
|
|
|
15334
15372
|
}
|
|
15335
15373
|
function readLockOwner() {
|
|
15336
15374
|
try {
|
|
15337
|
-
const raw = (0,
|
|
15338
|
-
const mtimeMs = (0,
|
|
15375
|
+
const raw = (0, import_node_fs11.readFileSync)(LISTENER_LOCK_PATH, "utf8");
|
|
15376
|
+
const mtimeMs = (0, import_node_fs11.statSync)(LISTENER_LOCK_PATH).mtimeMs;
|
|
15339
15377
|
const pid = Number(raw.split("-")[0]);
|
|
15340
15378
|
return { raw, pid: Number.isInteger(pid) ? pid : -1, mtimeMs };
|
|
15341
15379
|
} catch {
|
|
@@ -15348,15 +15386,15 @@ function lockIsAbandoned(owner) {
|
|
|
15348
15386
|
}
|
|
15349
15387
|
function clearLock(raw) {
|
|
15350
15388
|
try {
|
|
15351
|
-
if ((0,
|
|
15352
|
-
(0,
|
|
15389
|
+
if ((0, import_node_fs11.readFileSync)(LISTENER_LOCK_PATH, "utf8") !== raw) return;
|
|
15390
|
+
(0, import_node_fs11.unlinkSync)(LISTENER_LOCK_PATH);
|
|
15353
15391
|
} catch {
|
|
15354
15392
|
}
|
|
15355
15393
|
}
|
|
15356
15394
|
function readResult() {
|
|
15357
15395
|
try {
|
|
15358
15396
|
const parsed = JSON.parse(
|
|
15359
|
-
(0,
|
|
15397
|
+
(0, import_node_fs11.readFileSync)(LISTENER_RESULT_PATH, "utf8")
|
|
15360
15398
|
);
|
|
15361
15399
|
if (!parsed || typeof parsed.token !== "string" || typeof parsed.key !== "string")
|
|
15362
15400
|
return null;
|
|
@@ -15367,8 +15405,8 @@ function readResult() {
|
|
|
15367
15405
|
}
|
|
15368
15406
|
function publishResult(payload) {
|
|
15369
15407
|
const tmp = `${LISTENER_RESULT_PATH}.${process.pid}.tmp`;
|
|
15370
|
-
(0,
|
|
15371
|
-
(0,
|
|
15408
|
+
(0, import_node_fs11.writeFileSync)(tmp, JSON.stringify(payload));
|
|
15409
|
+
(0, import_node_fs11.renameSync)(tmp, LISTENER_RESULT_PATH);
|
|
15372
15410
|
}
|
|
15373
15411
|
function throwPublished(payload) {
|
|
15374
15412
|
throw Object.assign(new Error(payload.message || "listener scan failed"), {
|
|
@@ -15411,7 +15449,7 @@ async function withListenerLock(key, body) {
|
|
|
15411
15449
|
for (; ; ) {
|
|
15412
15450
|
let fd = null;
|
|
15413
15451
|
try {
|
|
15414
|
-
fd = (0,
|
|
15452
|
+
fd = (0, import_node_fs11.openSync)(LISTENER_LOCK_PATH, "wx");
|
|
15415
15453
|
} catch (error) {
|
|
15416
15454
|
const code = error instanceof Error && "code" in error ? error.code : "";
|
|
15417
15455
|
if (code !== "EEXIST") throw error;
|
|
@@ -15420,7 +15458,7 @@ async function withListenerLock(key, body) {
|
|
|
15420
15458
|
if (owner) clearLock(owner.raw);
|
|
15421
15459
|
else {
|
|
15422
15460
|
try {
|
|
15423
|
-
(0,
|
|
15461
|
+
(0, import_node_fs11.unlinkSync)(LISTENER_LOCK_PATH);
|
|
15424
15462
|
} catch {
|
|
15425
15463
|
}
|
|
15426
15464
|
}
|
|
@@ -15436,7 +15474,7 @@ async function withListenerLock(key, body) {
|
|
|
15436
15474
|
}
|
|
15437
15475
|
if (fd === null) continue;
|
|
15438
15476
|
try {
|
|
15439
|
-
(0,
|
|
15477
|
+
(0, import_node_fs11.writeSync)(fd, token);
|
|
15440
15478
|
try {
|
|
15441
15479
|
const value = await body();
|
|
15442
15480
|
publishResult({ token, key, ok: true, value });
|
|
@@ -15453,7 +15491,7 @@ async function withListenerLock(key, body) {
|
|
|
15453
15491
|
}
|
|
15454
15492
|
} finally {
|
|
15455
15493
|
try {
|
|
15456
|
-
(0,
|
|
15494
|
+
(0, import_node_fs11.closeSync)(fd);
|
|
15457
15495
|
} catch {
|
|
15458
15496
|
}
|
|
15459
15497
|
clearLock(token);
|
|
@@ -15787,7 +15825,7 @@ async function resolveMetroProjectRoot(bundleUrl, manifestProjectRoot, options =
|
|
|
15787
15825
|
}
|
|
15788
15826
|
if (typeof root === "string" && root.length > 0) return root;
|
|
15789
15827
|
} else if (res.status !== 404 && res.status !== 405) {
|
|
15790
|
-
throw
|
|
15828
|
+
throw await metroRequestFailure("project root", origin, res);
|
|
15791
15829
|
}
|
|
15792
15830
|
if (servedManifest || !metroRunning) return null;
|
|
15793
15831
|
const port = Number(new URL(origin).port);
|
|
@@ -15934,7 +15972,7 @@ var import_promises2 = require("node:dns/promises");
|
|
|
15934
15972
|
|
|
15935
15973
|
// src/host/network-policy.ts
|
|
15936
15974
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
15937
|
-
var
|
|
15975
|
+
var import_node_path11 = require("node:path");
|
|
15938
15976
|
var import_node_url = require("node:url");
|
|
15939
15977
|
var NETWORK_POLICY_TIMEOUT_MS = 1e4;
|
|
15940
15978
|
var NetworkPolicyDeniedError = class extends Error {
|
|
@@ -15987,7 +16025,7 @@ function createNetworkAuthorizer(policy) {
|
|
|
15987
16025
|
};
|
|
15988
16026
|
}
|
|
15989
16027
|
async function loadNetworkPolicy(file) {
|
|
15990
|
-
if (!(0,
|
|
16028
|
+
if (!(0, import_node_path11.isAbsolute)(file)) {
|
|
15991
16029
|
throw new Error(`PEACH_NETWORK_POLICY must be an absolute path: ${file}`);
|
|
15992
16030
|
}
|
|
15993
16031
|
const loaded3 = await import(
|
|
@@ -16523,10 +16561,10 @@ function readOneNativeAppAccent(entryConfig) {
|
|
|
16523
16561
|
// src/one-widget-metadata.ts
|
|
16524
16562
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
16525
16563
|
var import_node_child_process3 = require("node:child_process");
|
|
16526
|
-
var
|
|
16527
|
-
var
|
|
16564
|
+
var import_node_crypto6 = require("node:crypto");
|
|
16565
|
+
var import_node_fs14 = __toESM(require("node:fs"), 1);
|
|
16528
16566
|
var import_node_module2 = require("node:module");
|
|
16529
|
-
var
|
|
16567
|
+
var import_node_path14 = __toESM(require("node:path"), 1);
|
|
16530
16568
|
var import_node_util = require("node:util");
|
|
16531
16569
|
init_forked_script_contract();
|
|
16532
16570
|
init_is_record();
|
|
@@ -16552,8 +16590,8 @@ fs.writeFileSync(process.argv[2], JSON.stringify({
|
|
|
16552
16590
|
function configStamp(files) {
|
|
16553
16591
|
return JSON.stringify(
|
|
16554
16592
|
files.map((file) => {
|
|
16555
|
-
if (!
|
|
16556
|
-
const stat =
|
|
16593
|
+
if (!import_node_fs14.default.existsSync(file)) return [file, null];
|
|
16594
|
+
const stat = import_node_fs14.default.statSync(file);
|
|
16557
16595
|
return [file, stat.mtimeMs, stat.ctimeMs, stat.size];
|
|
16558
16596
|
})
|
|
16559
16597
|
);
|
|
@@ -16564,13 +16602,13 @@ async function readConfig(root) {
|
|
|
16564
16602
|
const reading = reads.get(root);
|
|
16565
16603
|
if (reading) return reading;
|
|
16566
16604
|
const promise = (async () => {
|
|
16567
|
-
(0, import_node_module2.createRequire)(
|
|
16568
|
-
const cache =
|
|
16569
|
-
|
|
16570
|
-
const directory =
|
|
16571
|
-
const script =
|
|
16572
|
-
const result =
|
|
16573
|
-
|
|
16605
|
+
(0, import_node_module2.createRequire)(import_node_path14.default.join(root, "package.json")).resolve("one/vite");
|
|
16606
|
+
const cache = import_node_path14.default.join(root, "node_modules/.cache/peach-widget-config");
|
|
16607
|
+
import_node_fs14.default.mkdirSync(cache, { recursive: true });
|
|
16608
|
+
const directory = import_node_fs14.default.mkdtempSync(import_node_path14.default.join(cache, "read-"));
|
|
16609
|
+
const script = import_node_path14.default.join(directory, "read.mjs");
|
|
16610
|
+
const result = import_node_path14.default.join(directory, "result.json");
|
|
16611
|
+
import_node_fs14.default.writeFileSync(script, CONFIG_CHILD);
|
|
16574
16612
|
try {
|
|
16575
16613
|
await run(process.execPath, [script, result], {
|
|
16576
16614
|
cwd: root,
|
|
@@ -16578,7 +16616,7 @@ async function readConfig(root) {
|
|
|
16578
16616
|
timeout: 3e4,
|
|
16579
16617
|
maxBuffer: 1024 * 1024
|
|
16580
16618
|
});
|
|
16581
|
-
const value = JSON.parse(
|
|
16619
|
+
const value = JSON.parse(import_node_fs14.default.readFileSync(result, "utf8"));
|
|
16582
16620
|
if (!isRecord(value) || !Array.isArray(value.watched) || !value.watched.every((file) => typeof file === "string"))
|
|
16583
16621
|
throw new Error("One config loader returned invalid dependencies");
|
|
16584
16622
|
if (!Array.isArray(value.urlSchemes) || !value.urlSchemes.every(
|
|
@@ -16601,8 +16639,8 @@ async function readConfig(root) {
|
|
|
16601
16639
|
}
|
|
16602
16640
|
const watched = [
|
|
16603
16641
|
.../* @__PURE__ */ new Set([
|
|
16604
|
-
|
|
16605
|
-
...value.watched.map((file) =>
|
|
16642
|
+
import_node_path14.default.join(root, "package.json"),
|
|
16643
|
+
...value.watched.map((file) => import_node_path14.default.resolve(root, file))
|
|
16606
16644
|
])
|
|
16607
16645
|
];
|
|
16608
16646
|
const loaded3 = {
|
|
@@ -16614,7 +16652,7 @@ async function readConfig(root) {
|
|
|
16614
16652
|
configs.set(root, loaded3);
|
|
16615
16653
|
return loaded3;
|
|
16616
16654
|
} finally {
|
|
16617
|
-
|
|
16655
|
+
import_node_fs14.default.rmSync(directory, { recursive: true, force: true });
|
|
16618
16656
|
}
|
|
16619
16657
|
})();
|
|
16620
16658
|
reads.set(root, promise);
|
|
@@ -16635,13 +16673,13 @@ function declaredFamilies(source) {
|
|
|
16635
16673
|
return home;
|
|
16636
16674
|
}
|
|
16637
16675
|
async function readOneWidgetSources(appRoot) {
|
|
16638
|
-
const root =
|
|
16676
|
+
const root = import_node_fs14.default.realpathSync(appRoot);
|
|
16639
16677
|
const config = await readConfig(root);
|
|
16640
16678
|
if (!config.widget) return null;
|
|
16641
16679
|
const widget = config.widget;
|
|
16642
16680
|
const sourceFiles = {
|
|
16643
|
-
"OneWidget.swift":
|
|
16644
|
-
"OneWidgetContract.swift":
|
|
16681
|
+
"OneWidget.swift": import_node_path14.default.join(root, "ios/OneWidgets/OneWidget.swift"),
|
|
16682
|
+
"OneWidgetContract.swift": import_node_path14.default.join(
|
|
16645
16683
|
root,
|
|
16646
16684
|
"ios",
|
|
16647
16685
|
widget.appName,
|
|
@@ -16651,14 +16689,14 @@ async function readOneWidgetSources(appRoot) {
|
|
|
16651
16689
|
const files = /* @__PURE__ */ new Map();
|
|
16652
16690
|
const sources = {};
|
|
16653
16691
|
for (const [name2, file] of Object.entries(sourceFiles)) {
|
|
16654
|
-
if (!
|
|
16692
|
+
if (!import_node_fs14.default.existsSync(file))
|
|
16655
16693
|
throw new Error(`missing One widget prebuild source ${file}; run one prebuild`);
|
|
16656
16694
|
const bytes = readPackageFile(root, file, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
16657
16695
|
const text2 = bytes.toString("utf8");
|
|
16658
16696
|
if (!Buffer.from(text2).equals(bytes))
|
|
16659
16697
|
throw new Error(`One widget prebuild source is not UTF-8: ${file}`);
|
|
16660
16698
|
files.set(name2, text2);
|
|
16661
|
-
sources[
|
|
16699
|
+
sources[import_node_path14.default.relative(root, file).split(import_node_path14.default.sep).join("/")] = (0, import_node_crypto6.createHash)("sha256").update(bytes).digest("hex");
|
|
16662
16700
|
}
|
|
16663
16701
|
const contract = files.get("OneWidgetContract.swift") ?? "";
|
|
16664
16702
|
const source = files.get("OneWidget.swift") ?? "";
|
|
@@ -16682,7 +16720,7 @@ async function configuredOneWidget(appRoot, bundleUrl) {
|
|
|
16682
16720
|
return {
|
|
16683
16721
|
metadata: source.widget,
|
|
16684
16722
|
projectRoot: source.root,
|
|
16685
|
-
appIdentity: (0,
|
|
16723
|
+
appIdentity: (0, import_node_crypto6.createHash)("sha256").update(JSON.stringify([source.root, source.widget.bundleId])).digest("hex"),
|
|
16686
16724
|
bundleUrl,
|
|
16687
16725
|
packageUrl: new URL(`${SWIFT_PACKAGE_PATH}OneWidgets`, bundleUrl).href,
|
|
16688
16726
|
urlSchemes: source.urlSchemes
|
|
@@ -17055,7 +17093,7 @@ function peachPlugin(options = {}) {
|
|
|
17055
17093
|
});
|
|
17056
17094
|
const bundleUrl = options.bundleUrl || "/node_modules/one/metro-entry.bundle?platform=ios&dev=true&minify=false";
|
|
17057
17095
|
const appName = resolveRnxDesktopAppName(options.open, server.config.root);
|
|
17058
|
-
const replacementToken = (0,
|
|
17096
|
+
const replacementToken = (0, import_node_crypto7.randomUUID)();
|
|
17059
17097
|
const bundleForOrigin = (origin) => {
|
|
17060
17098
|
const fullBundleUrl = new URL(bundleUrl, `${origin}/`).toString();
|
|
17061
17099
|
return tagRnxBundleForPlugin(
|
|
@@ -17202,23 +17240,23 @@ function peachPlugin(options = {}) {
|
|
|
17202
17240
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17203
17241
|
var import_fs7 = __toESM(require("fs"), 1);
|
|
17204
17242
|
var import_module2 = require("module");
|
|
17205
|
-
var
|
|
17243
|
+
var import_node_crypto12 = require("node:crypto");
|
|
17206
17244
|
var import_path6 = __toESM(require("path"), 1);
|
|
17207
17245
|
init_app_project();
|
|
17208
17246
|
|
|
17209
17247
|
// src/android-autolinking.ts
|
|
17210
17248
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17211
17249
|
var import_node_child_process4 = require("node:child_process");
|
|
17212
|
-
var
|
|
17250
|
+
var import_node_fs16 = __toESM(require("node:fs"), 1);
|
|
17213
17251
|
var import_node_module3 = require("node:module");
|
|
17214
|
-
var
|
|
17252
|
+
var import_node_path16 = __toESM(require("node:path"), 1);
|
|
17215
17253
|
var import_node_util2 = require("node:util");
|
|
17216
17254
|
init_forked_script_contract();
|
|
17217
17255
|
init_is_record();
|
|
17218
17256
|
var run2 = (0, import_node_util2.promisify)(import_node_child_process4.execFile);
|
|
17219
17257
|
var resolving = /* @__PURE__ */ new Map();
|
|
17220
17258
|
async function resolveExpoAndroidAutolinking(appRoot) {
|
|
17221
|
-
const root =
|
|
17259
|
+
const root = import_node_fs16.default.realpathSync(appRoot);
|
|
17222
17260
|
const existing = resolving.get(root);
|
|
17223
17261
|
if (existing) return existing;
|
|
17224
17262
|
const pending = resolveAndroidModules(root);
|
|
@@ -17232,7 +17270,7 @@ async function resolveExpoAndroidAutolinking(appRoot) {
|
|
|
17232
17270
|
async function resolveAndroidModules(appRoot) {
|
|
17233
17271
|
let autolinker;
|
|
17234
17272
|
try {
|
|
17235
|
-
autolinker = (0, import_node_module3.createRequire)(
|
|
17273
|
+
autolinker = (0, import_node_module3.createRequire)(import_node_path16.default.join(appRoot, "package.json")).resolve(
|
|
17236
17274
|
"expo-modules-autolinking/package.json"
|
|
17237
17275
|
);
|
|
17238
17276
|
} catch (error) {
|
|
@@ -17242,7 +17280,7 @@ async function resolveAndroidModules(appRoot) {
|
|
|
17242
17280
|
const { stdout } = await run2(
|
|
17243
17281
|
process.execPath,
|
|
17244
17282
|
[
|
|
17245
|
-
|
|
17283
|
+
import_node_path16.default.join(import_node_path16.default.dirname(autolinker), "bin/expo-modules-autolinking.js"),
|
|
17246
17284
|
"resolve",
|
|
17247
17285
|
"--platform",
|
|
17248
17286
|
"android",
|
|
@@ -17271,8 +17309,8 @@ async function collectAndroidAutolinkedPackages(appRoot) {
|
|
|
17271
17309
|
|
|
17272
17310
|
// src/android-root-module.ts
|
|
17273
17311
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17274
|
-
var
|
|
17275
|
-
var
|
|
17312
|
+
var import_node_fs17 = __toESM(require("node:fs"), 1);
|
|
17313
|
+
var import_node_path17 = __toESM(require("node:path"), 1);
|
|
17276
17314
|
|
|
17277
17315
|
// src/android-xml.ts
|
|
17278
17316
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -17369,29 +17407,29 @@ function launcherActivities(application) {
|
|
|
17369
17407
|
function readModuleNamespace(moduleRoot, manifest) {
|
|
17370
17408
|
if (manifest.attributes.package) return manifest.attributes.package;
|
|
17371
17409
|
for (const name2 of ["build.gradle", "build.gradle.kts"]) {
|
|
17372
|
-
const file =
|
|
17373
|
-
if (!
|
|
17410
|
+
const file = import_node_path17.default.join(moduleRoot, name2);
|
|
17411
|
+
if (!import_node_fs17.default.existsSync(file)) continue;
|
|
17374
17412
|
const match = /\bnamespace\s*=?\s*["']([\w.]+)["']/.exec(
|
|
17375
|
-
|
|
17413
|
+
import_node_fs17.default.readFileSync(file, "utf8")
|
|
17376
17414
|
);
|
|
17377
17415
|
if (match) return match[1];
|
|
17378
17416
|
}
|
|
17379
17417
|
return void 0;
|
|
17380
17418
|
}
|
|
17381
17419
|
function readModuleRootModuleName(moduleRoot) {
|
|
17382
|
-
const sourceSets =
|
|
17383
|
-
const manifestFile =
|
|
17384
|
-
if (!
|
|
17385
|
-
const document = parseXml(
|
|
17420
|
+
const sourceSets = import_node_path17.default.join(moduleRoot, "src");
|
|
17421
|
+
const manifestFile = import_node_path17.default.join(sourceSets, "main/AndroidManifest.xml");
|
|
17422
|
+
if (!import_node_fs17.default.existsSync(manifestFile)) return null;
|
|
17423
|
+
const document = parseXml(import_node_fs17.default.readFileSync(manifestFile, "utf8"), manifestFile);
|
|
17386
17424
|
const manifest = document.children[0];
|
|
17387
17425
|
const application = manifest?.children.find((child) => child.name === "application");
|
|
17388
17426
|
if (manifest?.name !== "manifest" || !application) return null;
|
|
17389
17427
|
const launchers = launcherActivities(application);
|
|
17390
17428
|
if (launchers.length === 0) return null;
|
|
17391
|
-
for (const set2 of
|
|
17392
|
-
const file =
|
|
17393
|
-
if (!set2.isDirectory() || set2.name === "main" || !
|
|
17394
|
-
if (
|
|
17429
|
+
for (const set2 of import_node_fs17.default.readdirSync(sourceSets, { withFileTypes: true })) {
|
|
17430
|
+
const file = import_node_path17.default.join(sourceSets, set2.name, "AndroidManifest.xml");
|
|
17431
|
+
if (!set2.isDirectory() || set2.name === "main" || !import_node_fs17.default.existsSync(file)) continue;
|
|
17432
|
+
if (import_node_fs17.default.readFileSync(file, "utf8").includes("<activity")) return void 0;
|
|
17395
17433
|
}
|
|
17396
17434
|
const launcher = launchers[0];
|
|
17397
17435
|
const enabled = launcher.attributes["android:enabled"];
|
|
@@ -17403,23 +17441,23 @@ function readModuleRootModuleName(moduleRoot) {
|
|
|
17403
17441
|
const qualified = declared.startsWith(".") ? namespace && `${namespace}${declared}` : declared.includes(".") ? declared : namespace && `${namespace}.${declared}`;
|
|
17404
17442
|
if (!qualified || qualified.includes("$")) return void 0;
|
|
17405
17443
|
const relative3 = qualified.split(".").join("/");
|
|
17406
|
-
const files =
|
|
17444
|
+
const files = import_node_fs17.default.readdirSync(sourceSets, { withFileTypes: true }).filter((set2) => set2.isDirectory()).flatMap(
|
|
17407
17445
|
(set2) => ["java", "kotlin"].flatMap(
|
|
17408
17446
|
(language) => ["kt", "java"].map(
|
|
17409
|
-
(extension) =>
|
|
17447
|
+
(extension) => import_node_path17.default.join(sourceSets, set2.name, language, `${relative3}.${extension}`)
|
|
17410
17448
|
)
|
|
17411
17449
|
)
|
|
17412
|
-
).filter((file) =>
|
|
17450
|
+
).filter((file) => import_node_fs17.default.existsSync(file));
|
|
17413
17451
|
if (files.length !== 1) return void 0;
|
|
17414
17452
|
return readAndroidRootModuleFromActivitySource(
|
|
17415
|
-
|
|
17453
|
+
import_node_fs17.default.readFileSync(files[0], "utf8"),
|
|
17416
17454
|
qualified.slice(qualified.lastIndexOf(".") + 1)
|
|
17417
17455
|
);
|
|
17418
17456
|
}
|
|
17419
17457
|
function readAndroidLauncherRootModuleName(projectRoot) {
|
|
17420
|
-
const androidRoot =
|
|
17421
|
-
if (!
|
|
17422
|
-
const names =
|
|
17458
|
+
const androidRoot = import_node_path17.default.join(projectRoot, "android");
|
|
17459
|
+
if (!import_node_fs17.default.existsSync(androidRoot)) return void 0;
|
|
17460
|
+
const names = import_node_fs17.default.readdirSync(androidRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory()).map((entry) => readModuleRootModuleName(import_node_path17.default.join(androidRoot, entry.name))).filter((name2) => name2 !== null);
|
|
17423
17461
|
return names.length === 1 ? names[0] : void 0;
|
|
17424
17462
|
}
|
|
17425
17463
|
|
|
@@ -17745,7 +17783,7 @@ function parseOpenStepPlist(text2) {
|
|
|
17745
17783
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
17746
17784
|
var NEVER_MEMBER = /(?:^|\/)(?:Info\.plist|[^/]+\.entitlements|[^/]+\.xcconfig|\.DS_Store)$/;
|
|
17747
17785
|
var BUNDLE_DIR = /\.(xcassets|bundle|lproj|xcdatamodeld|scnassets|spriteatlas|rcproject|storyboardc|icon)$/;
|
|
17748
|
-
function xcodePathResolver(objects, projectDir,
|
|
17786
|
+
function xcodePathResolver(objects, projectDir, join9) {
|
|
17749
17787
|
const parents = /* @__PURE__ */ new Map();
|
|
17750
17788
|
for (const [id, entry] of Object.entries(objects)) {
|
|
17751
17789
|
if (!isDict(entry)) continue;
|
|
@@ -17763,11 +17801,11 @@ function xcodePathResolver(objects, projectDir, join8) {
|
|
|
17763
17801
|
const own = str(entry.path) ?? "";
|
|
17764
17802
|
const tree2 = str(entry.sourceTree) ?? "<group>";
|
|
17765
17803
|
if (tree2 === "<absolute>") result = own;
|
|
17766
|
-
else if (tree2 === "SOURCE_ROOT") result =
|
|
17804
|
+
else if (tree2 === "SOURCE_ROOT") result = join9(projectDir, own);
|
|
17767
17805
|
else if (tree2 === "<group>") {
|
|
17768
17806
|
const parent = parents.get(id);
|
|
17769
17807
|
const base = parent ? resolve5(parent) : projectDir;
|
|
17770
|
-
if (base !== null) result =
|
|
17808
|
+
if (base !== null) result = join9(base, own);
|
|
17771
17809
|
}
|
|
17772
17810
|
}
|
|
17773
17811
|
paths.set(id, result);
|
|
@@ -17789,7 +17827,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
17789
17827
|
if (isDict(group) && group.isa === "PBXFileSystemSynchronizedRootGroup")
|
|
17790
17828
|
synchronizedGroups.push({ id, group });
|
|
17791
17829
|
}
|
|
17792
|
-
return (targetId, resolvePath, filesUnder,
|
|
17830
|
+
return (targetId, resolvePath, filesUnder, join9, visit3) => {
|
|
17793
17831
|
const target = objects[targetId];
|
|
17794
17832
|
if (!isDict(target)) return;
|
|
17795
17833
|
for (const phaseId of list(target.buildPhases)) {
|
|
@@ -17824,7 +17862,7 @@ function xcodeTargetMemberVisitor(objects) {
|
|
|
17824
17862
|
for (const relative3 of list(exception.membershipExceptions))
|
|
17825
17863
|
exceptions.add(relative3);
|
|
17826
17864
|
}
|
|
17827
|
-
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative3) => filesUnder(
|
|
17865
|
+
const members = owned.has(groupId) ? filesUnder(folder) : [...exceptions].flatMap((relative3) => filesUnder(join9(folder, relative3)));
|
|
17828
17866
|
for (const file of members) {
|
|
17829
17867
|
const relative3 = file.slice(prefix2.length);
|
|
17830
17868
|
const excepted = [...exceptions].some(
|
|
@@ -18222,7 +18260,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
18222
18260
|
if (resourceUri) {
|
|
18223
18261
|
if (!selectedTarget)
|
|
18224
18262
|
throw new Error("native app icon target membership is unresolved");
|
|
18225
|
-
const
|
|
18263
|
+
const join9 = (base, own) => {
|
|
18226
18264
|
const segments = [];
|
|
18227
18265
|
for (const segment of `${base}/${own}`.split("/")) {
|
|
18228
18266
|
if (segment === "" || segment === ".") continue;
|
|
@@ -18235,14 +18273,14 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
18235
18273
|
const project = Object.values(objects).find(
|
|
18236
18274
|
(object2) => isRecord(object2) && object2.isa === "PBXProject"
|
|
18237
18275
|
);
|
|
18238
|
-
const projectDir =
|
|
18276
|
+
const projectDir = join9(
|
|
18239
18277
|
pbxprojPath.replace(/(?:^|\/)[^/]+\.xcodeproj\/project\.pbxproj$/, ""),
|
|
18240
18278
|
isRecord(project) && typeof project.projectDirPath === "string" ? project.projectDirPath : ""
|
|
18241
18279
|
);
|
|
18242
18280
|
const paths = Object.keys(files);
|
|
18243
18281
|
xcodeTargetMemberVisitor(objects)(
|
|
18244
18282
|
selectedTarget.id,
|
|
18245
|
-
xcodePathResolver(objects, projectDir,
|
|
18283
|
+
xcodePathResolver(objects, projectDir, join9),
|
|
18246
18284
|
(file) => {
|
|
18247
18285
|
if (Object.hasOwn(files, file)) return [file];
|
|
18248
18286
|
const prefix2 = file === "" ? "" : `${file.replace(/\/$/, "")}/`;
|
|
@@ -18250,7 +18288,7 @@ function nativeAppIdentityFromIos(files, parseInfoPlist, iosTarget, resourceUri)
|
|
|
18250
18288
|
(path30) => path30.startsWith(prefix2) && !/(?:^|\/)\./.test(path30.slice(prefix2.length))
|
|
18251
18289
|
);
|
|
18252
18290
|
},
|
|
18253
|
-
|
|
18291
|
+
join9,
|
|
18254
18292
|
(file, kind) => {
|
|
18255
18293
|
if (kind === "resource") resources.add(file);
|
|
18256
18294
|
}
|
|
@@ -18344,26 +18382,27 @@ function extractNativeAppIdentityFromFiles(files, platform, parseInfoPlist, iosT
|
|
|
18344
18382
|
|
|
18345
18383
|
// src/native-app-identity-project.ts
|
|
18346
18384
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18347
|
-
var
|
|
18385
|
+
var import_node_fs24 = __toESM(require("node:fs"), 1);
|
|
18348
18386
|
var import_node_module4 = require("node:module");
|
|
18349
|
-
var
|
|
18387
|
+
var import_node_path27 = __toESM(require("node:path"), 1);
|
|
18350
18388
|
init_is_record();
|
|
18351
18389
|
|
|
18352
18390
|
// src/swift-objc-standin.ts
|
|
18353
18391
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18354
|
-
var
|
|
18392
|
+
var import_node_crypto8 = require("node:crypto");
|
|
18393
|
+
init_is_record();
|
|
18355
18394
|
|
|
18356
18395
|
// src/swift-objc-platform.ts
|
|
18357
18396
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18358
18397
|
|
|
18359
18398
|
// src/swift-toolchain.ts
|
|
18360
18399
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18361
|
-
var
|
|
18362
|
-
var
|
|
18400
|
+
var import_node_fs18 = __toESM(require("node:fs"), 1);
|
|
18401
|
+
var import_node_path18 = __toESM(require("node:path"), 1);
|
|
18363
18402
|
function peachsimPackageRoot() {
|
|
18364
18403
|
let dir = __sootsim_import_meta_dirname;
|
|
18365
|
-
while (!
|
|
18366
|
-
dir =
|
|
18404
|
+
while (!import_node_fs18.default.existsSync(import_node_path18.default.join(dir, "package.json")) && dir !== import_node_path18.default.dirname(dir))
|
|
18405
|
+
dir = import_node_path18.default.dirname(dir);
|
|
18367
18406
|
return dir;
|
|
18368
18407
|
}
|
|
18369
18408
|
var SWIFT_HOST_COMPILER_RELEASE = "swift-6.4.0-RELEASE-custom-81b2c791c27276bf";
|
|
@@ -18526,18 +18565,18 @@ var compilerArchives = {
|
|
|
18526
18565
|
|
|
18527
18566
|
// src/swift-objc-sdk.ts
|
|
18528
18567
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18529
|
-
var
|
|
18568
|
+
var import_node_path20 = __toESM(require("node:path"), 1);
|
|
18530
18569
|
|
|
18531
18570
|
// src/swift-objc-sdk-tree.ts
|
|
18532
18571
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18533
|
-
var
|
|
18534
|
-
var
|
|
18572
|
+
var import_node_fs19 = require("node:fs");
|
|
18573
|
+
var import_node_path19 = __toESM(require("node:path"), 1);
|
|
18535
18574
|
function readIosSdkTree(root) {
|
|
18536
|
-
return (0,
|
|
18537
|
-
const file =
|
|
18575
|
+
return (0, import_node_fs19.readdirSync)(root, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => {
|
|
18576
|
+
const file = import_node_path19.default.join(entry.parentPath, entry.name);
|
|
18538
18577
|
return [
|
|
18539
|
-
|
|
18540
|
-
(0,
|
|
18578
|
+
import_node_path19.default.relative(root, file).split(import_node_path19.default.sep).join("/"),
|
|
18579
|
+
(0, import_node_fs19.readFileSync)(file, "utf8")
|
|
18541
18580
|
];
|
|
18542
18581
|
}).sort(([a], [b]) => a < b ? -1 : 1);
|
|
18543
18582
|
}
|
|
@@ -18545,7 +18584,7 @@ function readIosSdkTree(root) {
|
|
|
18545
18584
|
// src/swift-objc-sdk.ts
|
|
18546
18585
|
var IOS_SDK_TARGET = "arm64-apple-ios16.0-simulator";
|
|
18547
18586
|
var OVERLAY_PATH = /^usr\/lib\/swift\/([^/]+)\.swiftmodule\/arm64-apple-ios-simulator\.swiftinterface$/;
|
|
18548
|
-
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(
|
|
18587
|
+
var tree = typeof __PEACH_BUNDLED_IOS_SDK__ === "undefined" ? readIosSdkTree(import_node_path20.default.join(peachsimPackageRoot(), "sdk", "ios")) : Object.entries(__PEACH_BUNDLED_IOS_SDK__).sort(([a], [b]) => a < b ? -1 : 1);
|
|
18549
18588
|
var IOS_SDK_HEADERS = {};
|
|
18550
18589
|
var IOS_SDK_OVERLAYS = {};
|
|
18551
18590
|
for (const [file, text2] of tree) {
|
|
@@ -18603,6 +18642,9 @@ function moduleMapName(text2) {
|
|
|
18603
18642
|
return index < 0 ? void 0 : tokens[index + 1];
|
|
18604
18643
|
}
|
|
18605
18644
|
|
|
18645
|
+
// src/swift-standin-emit.ts
|
|
18646
|
+
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18647
|
+
|
|
18606
18648
|
// src/swift-objc-standin.ts
|
|
18607
18649
|
var NATIVE_GRAPH_SDK_VERSION = "27.1";
|
|
18608
18650
|
var WASI_EMULATION = [
|
|
@@ -18618,7 +18660,7 @@ var NATIVE_GRAPH_INPUTS = {
|
|
|
18618
18660
|
compiler: "Apple Swift version 6.4 (swiftlang-6.4.0.34.1 clang-2100.3.34.1)",
|
|
18619
18661
|
target: IOS_SDK_TARGET
|
|
18620
18662
|
};
|
|
18621
|
-
var NATIVE_GRAPH_ID = (0,
|
|
18663
|
+
var NATIVE_GRAPH_ID = (0, import_node_crypto8.createHash)("sha256").update(JSON.stringify(NATIVE_GRAPH_INPUTS)).digest("hex");
|
|
18622
18664
|
function stripExternalSourceMarks(text2) {
|
|
18623
18665
|
return text2.split("\n").map(
|
|
18624
18666
|
(line) => line.startsWith("#define PEACH_SWIFT_CLASS(") ? line : line.replace(/PEACH_SWIFT_CLASS\(\w+\)\s*/g, "")
|
|
@@ -18638,39 +18680,39 @@ ${text2}`
|
|
|
18638
18680
|
);
|
|
18639
18681
|
return [...headers, ...overlays].sort(([a], [b]) => a < b ? -1 : 1);
|
|
18640
18682
|
}
|
|
18641
|
-
var IOS_SDK_ID = (0,
|
|
18683
|
+
var IOS_SDK_ID = (0, import_node_crypto8.createHash)("sha256").update(JSON.stringify(iosSdkEntries())).digest("hex").slice(0, 16);
|
|
18642
18684
|
|
|
18643
18685
|
// src/xcode-project.ts
|
|
18644
18686
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18645
18687
|
var import_node_child_process7 = require("node:child_process");
|
|
18646
|
-
var
|
|
18647
|
-
var
|
|
18648
|
-
var
|
|
18688
|
+
var import_node_crypto11 = require("node:crypto");
|
|
18689
|
+
var import_node_fs23 = __toESM(require("node:fs"), 1);
|
|
18690
|
+
var import_node_path26 = __toESM(require("node:path"), 1);
|
|
18649
18691
|
var import_plist3 = __toESM(require("plist"), 1);
|
|
18650
18692
|
init_is_record();
|
|
18651
18693
|
|
|
18652
18694
|
// src/prepared-xcode-phases.ts
|
|
18653
18695
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18654
|
-
var
|
|
18655
|
-
var
|
|
18656
|
-
var
|
|
18696
|
+
var import_node_crypto9 = require("node:crypto");
|
|
18697
|
+
var import_node_fs20 = __toESM(require("node:fs"), 1);
|
|
18698
|
+
var import_node_path21 = __toESM(require("node:path"), 1);
|
|
18657
18699
|
var workspaces = /* @__PURE__ */ new Map();
|
|
18658
18700
|
var recording;
|
|
18659
18701
|
function relativeFile(root, file) {
|
|
18660
|
-
const relative3 =
|
|
18661
|
-
if (!relative3 || relative3 === ".." || relative3.startsWith(`..${
|
|
18702
|
+
const relative3 = import_node_path21.default.relative(root, file);
|
|
18703
|
+
if (!relative3 || relative3 === ".." || relative3.startsWith(`..${import_node_path21.default.sep}`) || import_node_path21.default.isAbsolute(relative3))
|
|
18662
18704
|
throw new Error(`prepared Xcode output is outside its workspace: ${file}`);
|
|
18663
|
-
return relative3.split(
|
|
18705
|
+
return relative3.split(import_node_path21.default.sep).join("/");
|
|
18664
18706
|
}
|
|
18665
18707
|
function output(root, file) {
|
|
18666
18708
|
const relative3 = relativeFile(root, file);
|
|
18667
|
-
const stat =
|
|
18709
|
+
const stat = import_node_fs20.default.statSync(file, { throwIfNoEntry: false });
|
|
18668
18710
|
if (!stat) return { path: relative3, sha256: null };
|
|
18669
18711
|
if (!stat.isFile()) throw new Error(`prepared Xcode output is not a file: ${file}`);
|
|
18670
|
-
relativeFile(root,
|
|
18671
|
-
const bytes =
|
|
18712
|
+
relativeFile(root, import_node_fs20.default.realpathSync(file));
|
|
18713
|
+
const bytes = import_node_fs20.default.readFileSync(file);
|
|
18672
18714
|
const prefix2 = Buffer.from(root);
|
|
18673
|
-
const hash = (0,
|
|
18715
|
+
const hash = (0, import_node_crypto9.createHash)("sha256");
|
|
18674
18716
|
let offset = 0;
|
|
18675
18717
|
for (let index = bytes.indexOf(prefix2); index !== -1; index = bytes.indexOf(prefix2, offset)) {
|
|
18676
18718
|
hash.update(bytes.subarray(offset, index)).update("\0workspace\0");
|
|
@@ -18684,8 +18726,8 @@ function output(root, file) {
|
|
|
18684
18726
|
}
|
|
18685
18727
|
function preparedXcodePhase(project, target, phase, configuration, outputs, recorded) {
|
|
18686
18728
|
const root = recording?.root ?? [...workspaces.keys()].find((root2) => {
|
|
18687
|
-
const relative3 =
|
|
18688
|
-
return relative3 !== ".." && !relative3.startsWith(`..${
|
|
18729
|
+
const relative3 = import_node_path21.default.relative(root2, project);
|
|
18730
|
+
return relative3 !== ".." && !relative3.startsWith(`..${import_node_path21.default.sep}`) && !import_node_path21.default.isAbsolute(relative3);
|
|
18689
18731
|
});
|
|
18690
18732
|
if (!root) return false;
|
|
18691
18733
|
const entry = {
|
|
@@ -18721,10 +18763,10 @@ function preparedXcodePhase(project, target, phase, configuration, outputs, reco
|
|
|
18721
18763
|
|
|
18722
18764
|
// src/swift-binary-modules.ts
|
|
18723
18765
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18724
|
-
var
|
|
18725
|
-
var
|
|
18766
|
+
var import_node_fs21 = __toESM(require("node:fs"), 1);
|
|
18767
|
+
var import_node_path22 = __toESM(require("node:path"), 1);
|
|
18726
18768
|
init_home_paths();
|
|
18727
|
-
var cacheDir2 =
|
|
18769
|
+
var cacheDir2 = import_node_path22.default.join(cacheDir(), "swift-binary-modules");
|
|
18728
18770
|
function frameworkModules(paths) {
|
|
18729
18771
|
const modules = /* @__PURE__ */ new Set();
|
|
18730
18772
|
for (const file of paths) {
|
|
@@ -18734,21 +18776,21 @@ function frameworkModules(paths) {
|
|
|
18734
18776
|
return [...modules].sort();
|
|
18735
18777
|
}
|
|
18736
18778
|
function localSwiftBinaryModules(dir) {
|
|
18737
|
-
if (!
|
|
18738
|
-
const slices =
|
|
18779
|
+
if (!import_node_fs21.default.existsSync(dir)) return [];
|
|
18780
|
+
const slices = import_node_fs21.default.readdirSync(dir, { withFileTypes: true }).filter((slice) => slice.isDirectory());
|
|
18739
18781
|
const frameworks = frameworkModules(
|
|
18740
18782
|
slices.flatMap(
|
|
18741
|
-
(slice) =>
|
|
18783
|
+
(slice) => import_node_fs21.default.readdirSync(import_node_path22.default.join(dir, slice.name)).map((entry) => `${slice.name}/${entry}`)
|
|
18742
18784
|
)
|
|
18743
18785
|
);
|
|
18744
18786
|
if (frameworks.length > 0) return frameworks;
|
|
18745
18787
|
const modules = /* @__PURE__ */ new Set();
|
|
18746
18788
|
for (const slice of slices) {
|
|
18747
|
-
const headers =
|
|
18748
|
-
if (!
|
|
18749
|
-
for (const file of
|
|
18750
|
-
if (
|
|
18751
|
-
const module2 = moduleMapName(
|
|
18789
|
+
const headers = import_node_path22.default.join(dir, slice.name, "Headers");
|
|
18790
|
+
if (!import_node_fs21.default.existsSync(headers)) continue;
|
|
18791
|
+
for (const file of import_node_fs21.default.readdirSync(headers, { recursive: true, encoding: "utf8" })) {
|
|
18792
|
+
if (import_node_path22.default.basename(file) !== "module.modulemap") continue;
|
|
18793
|
+
const module2 = moduleMapName(import_node_fs21.default.readFileSync(import_node_path22.default.join(headers, file), "utf8"));
|
|
18752
18794
|
if (module2) modules.add(module2);
|
|
18753
18795
|
}
|
|
18754
18796
|
}
|
|
@@ -18760,9 +18802,9 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
18760
18802
|
|
|
18761
18803
|
// src/swift-coverage/provenance.ts
|
|
18762
18804
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18763
|
-
var
|
|
18764
|
-
var
|
|
18765
|
-
var
|
|
18805
|
+
var import_node_crypto10 = require("node:crypto");
|
|
18806
|
+
var import_node_fs22 = require("node:fs");
|
|
18807
|
+
var import_node_path23 = require("node:path");
|
|
18766
18808
|
var SWIFT_COVERAGE_DIGEST_SOURCES = [
|
|
18767
18809
|
"swift-coverage/indexdump.ts",
|
|
18768
18810
|
"swift-coverage/indexing.ts",
|
|
@@ -18792,11 +18834,11 @@ function swiftCoverageSourceDigests(srcDir) {
|
|
|
18792
18834
|
return Object.fromEntries(
|
|
18793
18835
|
SWIFT_COVERAGE_DIGEST_SOURCES.map((file) => [
|
|
18794
18836
|
file,
|
|
18795
|
-
(0,
|
|
18837
|
+
(0, import_node_crypto10.createHash)("sha256").update((0, import_node_fs22.readFileSync)((0, import_node_path23.join)(srcDir, file))).digest("hex")
|
|
18796
18838
|
])
|
|
18797
18839
|
);
|
|
18798
18840
|
}
|
|
18799
|
-
var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0,
|
|
18841
|
+
var swiftCoverageProvenance = typeof define_SWIFT_COVERAGE_SOURCE_DIGESTS_default === "object" ? define_SWIFT_COVERAGE_SOURCE_DIGESTS_default : swiftCoverageSourceDigests((0, import_node_path23.join)(__sootsim_import_meta_dirname, ".."));
|
|
18800
18842
|
|
|
18801
18843
|
// src/swift-coverage/xcode-asset-symbols.ts
|
|
18802
18844
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -18983,7 +19025,7 @@ var assetSymbolSettingKeys = [
|
|
|
18983
19025
|
// src/swift-package-manifest.ts
|
|
18984
19026
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
18985
19027
|
var import_node_child_process6 = require("node:child_process");
|
|
18986
|
-
var
|
|
19028
|
+
var import_node_path24 = __toESM(require("node:path"), 1);
|
|
18987
19029
|
var import_node_util4 = require("node:util");
|
|
18988
19030
|
init_home_paths();
|
|
18989
19031
|
|
|
@@ -19026,9 +19068,6 @@ var import_node_os4 = __toESM(require("node:os"), 1);
|
|
|
19026
19068
|
// src/admitted-mac-build.ts
|
|
19027
19069
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19028
19070
|
|
|
19029
|
-
// src/swift-compile.ts
|
|
19030
|
-
init_home_paths();
|
|
19031
|
-
|
|
19032
19071
|
// src/retired-cache-directory.ts
|
|
19033
19072
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19034
19073
|
|
|
@@ -19046,7 +19085,6 @@ init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
|
19046
19085
|
|
|
19047
19086
|
// src/swift-shared-sdk.ts
|
|
19048
19087
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19049
|
-
init_home_paths();
|
|
19050
19088
|
|
|
19051
19089
|
// src/swift-design-time.ts
|
|
19052
19090
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
@@ -19213,7 +19251,7 @@ var FOUNDATION_IMPLICIT_MODULES = [
|
|
|
19213
19251
|
var FOUNDATION_IMPLICIT_FLAGS = FOUNDATION_IMPLICIT_MODULES.map(
|
|
19214
19252
|
(module2) => `, "-Xfrontend", "-import-module", "-Xfrontend", "${module2}"`
|
|
19215
19253
|
).join("");
|
|
19216
|
-
var compilerSourceDigest = true ? "
|
|
19254
|
+
var compilerSourceDigest = true ? "5bed84d1d29562932f8ef8e54d9dae7b5b378ffb937861030ae5b732eda8dafd" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
19217
19255
|
var CORE_FOUNDATION_HANDLE_IMPORTS = [
|
|
19218
19256
|
"CFAllocator",
|
|
19219
19257
|
"CFArray",
|
|
@@ -19239,12 +19277,12 @@ var rootLocks = host[ROOT_LOCKS] ??= /* @__PURE__ */ new Map();
|
|
|
19239
19277
|
var SHARED_ARTIFACT_BUDGET_BYTES = 4 * 1024 ** 3;
|
|
19240
19278
|
|
|
19241
19279
|
// src/swift-package-manifest.ts
|
|
19242
|
-
var cacheDir3 =
|
|
19280
|
+
var cacheDir3 = import_node_path24.default.join(cacheDir(), "swift-manifests");
|
|
19243
19281
|
var execFileAsync = (0, import_node_util4.promisify)(import_node_child_process6.execFile);
|
|
19244
19282
|
|
|
19245
19283
|
// src/xcode-json-project.ts
|
|
19246
19284
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
19247
|
-
var
|
|
19285
|
+
var import_node_path25 = __toESM(require("node:path"), 1);
|
|
19248
19286
|
var import_json52 = __toESM(require_lib(), 1);
|
|
19249
19287
|
var isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
19250
19288
|
var text = (value) => typeof value === "string" ? value : void 0;
|
|
@@ -19302,7 +19340,7 @@ var PHASE_ISA = {
|
|
|
19302
19340
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
19303
19341
|
const json = import_json52.default.parse(source);
|
|
19304
19342
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
19305
|
-
const projectDir =
|
|
19343
|
+
const projectDir = import_node_path25.default.dirname(xcodeproj);
|
|
19306
19344
|
const objects = {};
|
|
19307
19345
|
let next = 0;
|
|
19308
19346
|
const add = (entry, id) => {
|
|
@@ -19315,7 +19353,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
19315
19353
|
const base = /^<([A-Z]+)>\/(.*)$/.exec(raw);
|
|
19316
19354
|
if (base) {
|
|
19317
19355
|
if (base[1] === "PROJECT")
|
|
19318
|
-
return { sourceTree: "<absolute>", path:
|
|
19356
|
+
return { sourceTree: "<absolute>", path: import_node_path25.default.join(projectDir, base[2]) };
|
|
19319
19357
|
if (base[1] === "PRODUCTS")
|
|
19320
19358
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base[2] };
|
|
19321
19359
|
return null;
|
|
@@ -19323,7 +19361,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
19323
19361
|
const unescaped = raw.replaceAll("\\<", "<");
|
|
19324
19362
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
19325
19363
|
if (unescaped.startsWith("~")) return null;
|
|
19326
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
19364
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path25.default.join(groupDir, unescaped) };
|
|
19327
19365
|
};
|
|
19328
19366
|
const memberships = [];
|
|
19329
19367
|
const folders = [];
|
|
@@ -19334,7 +19372,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
19334
19372
|
const kind = text(entry.kind) ?? "file-reference";
|
|
19335
19373
|
const raw = text(entry.path) ?? "";
|
|
19336
19374
|
const located = raw === "" ? null : locate(raw, parent.dir);
|
|
19337
|
-
const name2 = text(entry.name) ??
|
|
19375
|
+
const name2 = text(entry.name) ?? import_node_path25.default.basename(raw);
|
|
19338
19376
|
const node = { id: "", name: name2, dir: null, parent, children: [] };
|
|
19339
19377
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
19340
19378
|
node.dir = raw === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -19455,7 +19493,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
19455
19493
|
if (!isObject(entry)) continue;
|
|
19456
19494
|
const repository = text(entry.repository);
|
|
19457
19495
|
const local = text(entry.path);
|
|
19458
|
-
const name2 = local !== void 0 ?
|
|
19496
|
+
const name2 = local !== void 0 ? import_node_path25.default.basename(import_node_path25.default.resolve(import_node_path25.default.dirname(xcodeproj), local)) : import_node_path25.default.basename(repository ?? "").replace(/\.git$/, "");
|
|
19459
19497
|
const id = text(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
19460
19498
|
isa: "XCRemoteSwiftPackageReference",
|
|
19461
19499
|
repositoryURL: repository ?? "",
|
|
@@ -19665,28 +19703,28 @@ var CONDITIONS = {
|
|
|
19665
19703
|
variant: "normal"
|
|
19666
19704
|
};
|
|
19667
19705
|
function walkFiles(dir) {
|
|
19668
|
-
if (!
|
|
19706
|
+
if (!import_node_fs23.default.existsSync(dir)) return [];
|
|
19669
19707
|
const out = [];
|
|
19670
|
-
for (const entry of
|
|
19708
|
+
for (const entry of import_node_fs23.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
19671
19709
|
if (entry.name.startsWith(".")) continue;
|
|
19672
|
-
const full =
|
|
19710
|
+
const full = import_node_path26.default.join(dir, entry.name);
|
|
19673
19711
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
19674
19712
|
else if (entry.isFile()) out.push(full);
|
|
19675
19713
|
}
|
|
19676
19714
|
return out;
|
|
19677
19715
|
}
|
|
19678
|
-
var isDirectory = (dir) =>
|
|
19716
|
+
var isDirectory = (dir) => import_node_fs23.default.existsSync(dir) && import_node_fs23.default.statSync(dir).isDirectory();
|
|
19679
19717
|
function readXcconfig(file, read) {
|
|
19680
|
-
if (read.includes(file) || !
|
|
19718
|
+
if (read.includes(file) || !import_node_fs23.default.existsSync(file)) return {};
|
|
19681
19719
|
read.push(file);
|
|
19682
19720
|
const settings = {};
|
|
19683
|
-
for (const raw of
|
|
19721
|
+
for (const raw of import_node_fs23.default.readFileSync(file, "utf8").split("\n")) {
|
|
19684
19722
|
const line = raw.replace(/\/\/.*$/, "").trim();
|
|
19685
19723
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
19686
19724
|
if (include) {
|
|
19687
19725
|
Object.assign(
|
|
19688
19726
|
settings,
|
|
19689
|
-
readXcconfig(
|
|
19727
|
+
readXcconfig(import_node_path26.default.resolve(import_node_path26.default.dirname(file), include[1]), read)
|
|
19690
19728
|
);
|
|
19691
19729
|
continue;
|
|
19692
19730
|
}
|
|
@@ -19736,22 +19774,22 @@ function decodeXml(text2) {
|
|
|
19736
19774
|
return text2.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
19737
19775
|
}
|
|
19738
19776
|
function workspaceReferences(workspace) {
|
|
19739
|
-
const data =
|
|
19740
|
-
if (!
|
|
19777
|
+
const data = import_node_path26.default.join(workspace, "contents.xcworkspacedata");
|
|
19778
|
+
if (!import_node_fs23.default.existsSync(data))
|
|
19741
19779
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
19742
|
-
const container =
|
|
19780
|
+
const container = import_node_path26.default.dirname(workspace);
|
|
19743
19781
|
const locate = (location, base) => {
|
|
19744
19782
|
const colon = location.indexOf(":");
|
|
19745
19783
|
const kind = location.slice(0, colon);
|
|
19746
19784
|
const rest = location.slice(colon + 1);
|
|
19747
|
-
if (kind === "group") return
|
|
19748
|
-
if (kind === "container" || kind === "self") return
|
|
19749
|
-
if (kind === "absolute") return
|
|
19750
|
-
throw new Error(`${
|
|
19785
|
+
if (kind === "group") return import_node_path26.default.resolve(base, rest);
|
|
19786
|
+
if (kind === "container" || kind === "self") return import_node_path26.default.resolve(container, rest);
|
|
19787
|
+
if (kind === "absolute") return import_node_path26.default.resolve(rest);
|
|
19788
|
+
throw new Error(`${import_node_path26.default.basename(workspace)} has an unsupported location ${location}`);
|
|
19751
19789
|
};
|
|
19752
19790
|
const groups = [container];
|
|
19753
19791
|
const references = [];
|
|
19754
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
19792
|
+
for (const [, closing, tag, attributes, selfClosing] of import_node_fs23.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
19755
19793
|
if (closing) {
|
|
19756
19794
|
if (tag === "Group") groups.pop();
|
|
19757
19795
|
continue;
|
|
@@ -19802,8 +19840,8 @@ function remotePackageRequirements(projects) {
|
|
|
19802
19840
|
var loaded2 = /* @__PURE__ */ new Map();
|
|
19803
19841
|
function xcodeProjectFile(xcodeproj) {
|
|
19804
19842
|
for (const name2 of ["project.pbxproj", "project.xcproj"]) {
|
|
19805
|
-
const file =
|
|
19806
|
-
if (
|
|
19843
|
+
const file = import_node_path26.default.join(xcodeproj, name2);
|
|
19844
|
+
if (import_node_fs23.default.existsSync(file)) return file;
|
|
19807
19845
|
}
|
|
19808
19846
|
return null;
|
|
19809
19847
|
}
|
|
@@ -19811,8 +19849,8 @@ function loadProject(xcodeproj) {
|
|
|
19811
19849
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
19812
19850
|
if (!projectFile)
|
|
19813
19851
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
19814
|
-
const source =
|
|
19815
|
-
const digest = (0,
|
|
19852
|
+
const source = import_node_fs23.default.readFileSync(projectFile, "utf8");
|
|
19853
|
+
const digest = (0, import_node_crypto11.createHash)("sha256").update(source).digest("hex");
|
|
19816
19854
|
const cached2 = loaded2.get(projectFile);
|
|
19817
19855
|
if (cached2?.digest === digest) return cached2.project;
|
|
19818
19856
|
const root = projectFile.endsWith(".xcproj") ? readXcodeJsonProject(xcodeproj, source) : parseOpenStepPlist(source);
|
|
@@ -19828,10 +19866,10 @@ function loadProject(xcodeproj) {
|
|
|
19828
19866
|
if (!project || project.isa !== "PBXProject") {
|
|
19829
19867
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
19830
19868
|
}
|
|
19831
|
-
const projectDir =
|
|
19832
|
-
|
|
19869
|
+
const projectDir = import_node_fs23.default.realpathSync(
|
|
19870
|
+
import_node_path26.default.resolve(import_node_path26.default.dirname(xcodeproj), str(project.projectDirPath) ?? "")
|
|
19833
19871
|
);
|
|
19834
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
19872
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path26.default.join);
|
|
19835
19873
|
const result = {
|
|
19836
19874
|
xcodeproj,
|
|
19837
19875
|
projectFile,
|
|
@@ -19866,8 +19904,8 @@ function targetSettings(ref, configuration, builtins, options = {}, overrides =
|
|
|
19866
19904
|
const relative3 = str(config.baseConfigurationReferenceRelativePath);
|
|
19867
19905
|
const own = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
19868
19906
|
const directory = anchor ? project.resolvePath(anchor) : null;
|
|
19869
|
-
const baseFile = base ? project.resolvePath(base) : directory && relative3 ?
|
|
19870
|
-
if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !
|
|
19907
|
+
const baseFile = base ? project.resolvePath(base) : directory && relative3 ? import_node_path26.default.resolve(directory, relative3) : null;
|
|
19908
|
+
if (options.requireSources !== false && (base || anchor || relative3) && (!baseFile || !import_node_fs23.default.existsSync(baseFile)))
|
|
19871
19909
|
throw new Error(
|
|
19872
19910
|
`Unable to open base configuration reference file '${baseFile ?? base ?? relative3 ?? anchor}'`
|
|
19873
19911
|
);
|
|
@@ -19959,26 +19997,26 @@ function scriptCommand(shell, script) {
|
|
|
19959
19997
|
return [executable, ...args, "-c", script];
|
|
19960
19998
|
}
|
|
19961
19999
|
function expandSearchPath(directory, rules2) {
|
|
19962
|
-
if (
|
|
20000
|
+
if (import_node_path26.default.basename(directory) !== "**") return [directory];
|
|
19963
20001
|
const expanded = [];
|
|
19964
20002
|
const seen = /* @__PURE__ */ new Set();
|
|
19965
|
-
const queue = [
|
|
20003
|
+
const queue = [import_node_path26.default.dirname(directory)];
|
|
19966
20004
|
for (let at = 0; at < queue.length; at++) {
|
|
19967
20005
|
const current = queue[at];
|
|
19968
20006
|
let real;
|
|
19969
20007
|
try {
|
|
19970
|
-
real =
|
|
20008
|
+
real = import_node_fs23.default.realpathSync(current);
|
|
19971
20009
|
} catch {
|
|
19972
20010
|
continue;
|
|
19973
20011
|
}
|
|
19974
|
-
if (!
|
|
20012
|
+
if (!import_node_fs23.default.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
19975
20013
|
seen.add(real);
|
|
19976
20014
|
expanded.push(current);
|
|
19977
|
-
for (const entry of
|
|
20015
|
+
for (const entry of import_node_fs23.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
19978
20016
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
19979
20017
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
19980
20018
|
continue;
|
|
19981
|
-
queue.push(
|
|
20019
|
+
queue.push(import_node_path26.default.join(current, entry.name));
|
|
19982
20020
|
}
|
|
19983
20021
|
}
|
|
19984
20022
|
return expanded;
|
|
@@ -20049,7 +20087,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
20049
20087
|
for (const token of tokens) {
|
|
20050
20088
|
if (token.startsWith("-")) break;
|
|
20051
20089
|
const file = resolve5(token);
|
|
20052
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
20090
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path26.default.resolve(projectDir, file));
|
|
20053
20091
|
}
|
|
20054
20092
|
}
|
|
20055
20093
|
return catalogs;
|
|
@@ -20094,14 +20132,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
20094
20132
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
20095
20133
|
return [];
|
|
20096
20134
|
copies.push({
|
|
20097
|
-
from:
|
|
20098
|
-
to:
|
|
20135
|
+
from: import_node_path26.default.resolve(projectDir, operands[0]),
|
|
20136
|
+
to: import_node_path26.default.resolve(projectDir, operands[1])
|
|
20099
20137
|
});
|
|
20100
20138
|
}
|
|
20101
20139
|
return copies;
|
|
20102
20140
|
}
|
|
20103
20141
|
function fileListEntries(file, absolute) {
|
|
20104
|
-
return
|
|
20142
|
+
return import_node_fs23.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
20105
20143
|
}
|
|
20106
20144
|
function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
20107
20145
|
const { project, target, id: targetId } = ref;
|
|
@@ -20114,7 +20152,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20114
20152
|
const copiedFiles = [];
|
|
20115
20153
|
let generatedInfoPlist = false;
|
|
20116
20154
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
20117
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
20155
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path26.default.resolve(project.projectDir, declaredInfoPlist) : null;
|
|
20118
20156
|
const isPreparedOutput = (file) => file === infoPlistOutput || options.requireSources !== false && file.endsWith(".swift");
|
|
20119
20157
|
for (const phaseId of list(target.buildPhases)) {
|
|
20120
20158
|
const phase = project.object(phaseId);
|
|
@@ -20129,7 +20167,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20129
20167
|
copiedFiles.push(
|
|
20130
20168
|
...shellCopies(str(phase.shellScript) ?? "", settings, project.projectDir)
|
|
20131
20169
|
);
|
|
20132
|
-
const absolute = (raw) =>
|
|
20170
|
+
const absolute = (raw) => import_node_path26.default.resolve(project.projectDir, expand(raw, settings));
|
|
20133
20171
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
20134
20172
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
20135
20173
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -20138,7 +20176,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20138
20176
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
20139
20177
|
).map((raw) => {
|
|
20140
20178
|
const file = absolute(raw);
|
|
20141
|
-
if (!
|
|
20179
|
+
if (!import_node_fs23.default.existsSync(file)) {
|
|
20142
20180
|
return { file, entries: [] };
|
|
20143
20181
|
}
|
|
20144
20182
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -20159,7 +20197,7 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20159
20197
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
20160
20198
|
];
|
|
20161
20199
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
20162
|
-
for (const file of inputFiles) if (
|
|
20200
|
+
for (const file of inputFiles) if (import_node_fs23.default.existsSync(file)) projectInputs.add(file);
|
|
20163
20201
|
}
|
|
20164
20202
|
if (options.prepareGeneratedSources === true && allOutputs.some(isPreparedOutput)) {
|
|
20165
20203
|
const configuration = settings("CONFIGURATION");
|
|
@@ -20172,10 +20210,10 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20172
20210
|
false
|
|
20173
20211
|
))
|
|
20174
20212
|
continue;
|
|
20175
|
-
const phaseDir =
|
|
20213
|
+
const phaseDir = import_node_path26.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
20176
20214
|
for (const lists of fileLists.values())
|
|
20177
20215
|
for (const { file } of lists)
|
|
20178
|
-
if (!
|
|
20216
|
+
if (!import_node_fs23.default.existsSync(file))
|
|
20179
20217
|
throw new Error(
|
|
20180
20218
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
20181
20219
|
);
|
|
@@ -20194,25 +20232,25 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20194
20232
|
const lists = fileLists.get(kind);
|
|
20195
20233
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
20196
20234
|
lists.forEach((_item, index) => {
|
|
20197
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
20235
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path26.default.join(
|
|
20198
20236
|
phaseDir,
|
|
20199
20237
|
`${kind}-${index}.xcfilelist`
|
|
20200
20238
|
);
|
|
20201
20239
|
});
|
|
20202
20240
|
}
|
|
20203
|
-
const signature = (0,
|
|
20241
|
+
const signature = (0, import_node_crypto11.createHash)("sha256").update(
|
|
20204
20242
|
JSON.stringify([phase, [...settingKeys].map((key2) => [key2, settings(key2)])])
|
|
20205
20243
|
);
|
|
20206
20244
|
for (const file of inputFiles) {
|
|
20207
20245
|
signature.update(file);
|
|
20208
|
-
if (
|
|
20209
|
-
const stat =
|
|
20246
|
+
if (import_node_fs23.default.existsSync(file)) {
|
|
20247
|
+
const stat = import_node_fs23.default.statSync(file);
|
|
20210
20248
|
signature.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
20211
20249
|
} else signature.update("missing");
|
|
20212
20250
|
}
|
|
20213
20251
|
const stamp = signature.digest("hex");
|
|
20214
20252
|
const key = `${project.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
20215
|
-
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) =>
|
|
20253
|
+
if (preparedSourcePhases.get(key) === stamp && allOutputs.every((file) => import_node_fs23.default.existsSync(file))) {
|
|
20216
20254
|
preparedXcodePhase(
|
|
20217
20255
|
project.projectFile,
|
|
20218
20256
|
targetId,
|
|
@@ -20223,14 +20261,14 @@ function targetMembers(ref, settings, options, settingKeys, projectInputs) {
|
|
|
20223
20261
|
);
|
|
20224
20262
|
continue;
|
|
20225
20263
|
}
|
|
20226
|
-
|
|
20227
|
-
|
|
20228
|
-
|
|
20264
|
+
import_node_fs23.default.mkdirSync(phaseDir, { recursive: true });
|
|
20265
|
+
import_node_fs23.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
20266
|
+
import_node_fs23.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
20229
20267
|
for (const output2 of allOutputs)
|
|
20230
|
-
|
|
20268
|
+
import_node_fs23.default.mkdirSync(import_node_path26.default.dirname(output2), { recursive: true });
|
|
20231
20269
|
for (const [kind, lists] of fileLists)
|
|
20232
20270
|
lists.forEach((item, index) => {
|
|
20233
|
-
|
|
20271
|
+
import_node_fs23.default.writeFileSync(
|
|
20234
20272
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
20235
20273
|
`${item.entries.join("\n")}
|
|
20236
20274
|
`
|
|
@@ -20257,7 +20295,7 @@ ${output2}`
|
|
|
20257
20295
|
);
|
|
20258
20296
|
}
|
|
20259
20297
|
const missing2 = allOutputs.filter(
|
|
20260
|
-
(file) => file === infoPlistOutput && !
|
|
20298
|
+
(file) => file === infoPlistOutput && !import_node_fs23.default.existsSync(file)
|
|
20261
20299
|
);
|
|
20262
20300
|
if (missing2.length > 0)
|
|
20263
20301
|
throw new Error(
|
|
@@ -20277,8 +20315,8 @@ ${output2}`
|
|
|
20277
20315
|
project.visitMembers(
|
|
20278
20316
|
targetId,
|
|
20279
20317
|
project.resolvePath,
|
|
20280
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
20281
|
-
|
|
20318
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs23.default.existsSync(file) ? [file] : [],
|
|
20319
|
+
import_node_path26.default.join,
|
|
20282
20320
|
(file, kind) => {
|
|
20283
20321
|
if (kind === "header") {
|
|
20284
20322
|
headers.add(file);
|
|
@@ -20288,9 +20326,9 @@ ${output2}`
|
|
|
20288
20326
|
resources.add(file);
|
|
20289
20327
|
return;
|
|
20290
20328
|
}
|
|
20291
|
-
if (!
|
|
20329
|
+
if (!import_node_fs23.default.existsSync(file)) {
|
|
20292
20330
|
if (options.requireSources === false) return;
|
|
20293
|
-
const script = scriptForOutput.get(
|
|
20331
|
+
const script = scriptForOutput.get(import_node_path26.default.normalize(file));
|
|
20294
20332
|
throw new Error(
|
|
20295
20333
|
script ? `${targetName}: missing generated source ${file} (Run Script "${script}" declares it in outputPaths; run the script or check in its output)` : `${targetName}: missing source ${file}`
|
|
20296
20334
|
);
|
|
@@ -20311,37 +20349,37 @@ ${output2}`
|
|
|
20311
20349
|
function commonAncestor(dirs) {
|
|
20312
20350
|
let common = dirs[0];
|
|
20313
20351
|
for (const dir of dirs) {
|
|
20314
|
-
while (common !==
|
|
20315
|
-
common =
|
|
20352
|
+
while (common !== import_node_path26.default.dirname(common) && import_node_path26.default.relative(common, dir).startsWith(".."))
|
|
20353
|
+
common = import_node_path26.default.dirname(common);
|
|
20316
20354
|
}
|
|
20317
20355
|
return common;
|
|
20318
20356
|
}
|
|
20319
|
-
var isPodsProject = (xcodeproj) =>
|
|
20357
|
+
var isPodsProject = (xcodeproj) => import_node_path26.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path26.default.basename(import_node_path26.default.dirname(xcodeproj)) === "Pods";
|
|
20320
20358
|
function installedPodsSandbox(pods) {
|
|
20321
|
-
const podfileLock =
|
|
20322
|
-
const manifestLock =
|
|
20323
|
-
if (!
|
|
20359
|
+
const podfileLock = import_node_path26.default.join(import_node_path26.default.dirname(pods), "Podfile.lock");
|
|
20360
|
+
const manifestLock = import_node_path26.default.join(pods, "Manifest.lock");
|
|
20361
|
+
if (!import_node_fs23.default.existsSync(podfileLock))
|
|
20324
20362
|
throw new Error(
|
|
20325
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
20363
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path26.default.dirname(pods)}`
|
|
20326
20364
|
);
|
|
20327
|
-
if (!
|
|
20365
|
+
if (!import_node_fs23.default.existsSync(manifestLock) || !import_node_fs23.default.readFileSync(manifestLock).equals(import_node_fs23.default.readFileSync(podfileLock)))
|
|
20328
20366
|
throw new Error(
|
|
20329
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
20367
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path26.default.dirname(pods)}`
|
|
20330
20368
|
);
|
|
20331
20369
|
const specChecksums = {};
|
|
20332
|
-
const lines =
|
|
20370
|
+
const lines = import_node_fs23.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
20333
20371
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
20334
20372
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
20335
20373
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
20336
20374
|
if (!entry) break;
|
|
20337
20375
|
specChecksums[entry[1]] = entry[2];
|
|
20338
20376
|
}
|
|
20339
|
-
const specs =
|
|
20377
|
+
const specs = import_node_path26.default.join(pods, "Local Podspecs");
|
|
20340
20378
|
return {
|
|
20341
20379
|
podfileLock,
|
|
20342
20380
|
manifestLock,
|
|
20343
20381
|
specChecksums,
|
|
20344
|
-
localPodspecs: isDirectory(specs) ?
|
|
20382
|
+
localPodspecs: isDirectory(specs) ? import_node_fs23.default.readdirSync(specs).filter((name2) => name2.endsWith(".podspec.json")).sort().map((name2) => import_node_path26.default.join(specs, name2)) : []
|
|
20345
20383
|
};
|
|
20346
20384
|
}
|
|
20347
20385
|
function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
@@ -20353,14 +20391,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
20353
20391
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
20354
20392
|
if (installedPods && isPodsProject(xcodeproj))
|
|
20355
20393
|
throw new Error(
|
|
20356
|
-
`${
|
|
20394
|
+
`${import_node_path26.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path26.default.dirname(import_node_path26.default.dirname(xcodeproj))}`
|
|
20357
20395
|
);
|
|
20358
20396
|
return;
|
|
20359
20397
|
}
|
|
20360
|
-
const key =
|
|
20361
|
-
if (projectAt.has(key) || !installedPods && key.split(
|
|
20398
|
+
const key = import_node_fs23.default.realpathSync(xcodeproj);
|
|
20399
|
+
if (projectAt.has(key) || !installedPods && key.split(import_node_path26.default.sep).includes("Pods"))
|
|
20362
20400
|
return;
|
|
20363
|
-
if (isPodsProject(key)) cocoapods = installedPodsSandbox(
|
|
20401
|
+
if (isPodsProject(key)) cocoapods = installedPodsSandbox(import_node_path26.default.dirname(key));
|
|
20364
20402
|
const project = loadProject(key);
|
|
20365
20403
|
projectAt.set(key, project);
|
|
20366
20404
|
projects.push(project);
|
|
@@ -20376,12 +20414,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
20376
20414
|
for (const reference of listed)
|
|
20377
20415
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
20378
20416
|
if (projects.length === 0) {
|
|
20379
|
-
throw new Error(`${
|
|
20417
|
+
throw new Error(`${import_node_path26.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
20380
20418
|
}
|
|
20381
|
-
const podfile =
|
|
20382
|
-
if (installedPods && !cocoapods &&
|
|
20419
|
+
const podfile = import_node_path26.default.join(import_node_path26.default.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
20420
|
+
if (installedPods && !cocoapods && import_node_fs23.default.existsSync(podfile))
|
|
20383
20421
|
throw new Error(
|
|
20384
|
-
`${podfile} is not installed into ${
|
|
20422
|
+
`${podfile} is not installed into ${import_node_path26.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path26.default.dirname(podfile)} and open the workspace it writes`
|
|
20385
20423
|
);
|
|
20386
20424
|
return { listed, projects, projectAt, cocoapods };
|
|
20387
20425
|
}
|
|
@@ -20417,7 +20455,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options = {}) {
|
|
|
20417
20455
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
20418
20456
|
}
|
|
20419
20457
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
20420
|
-
const project = loadProject(
|
|
20458
|
+
const project = loadProject(import_node_fs23.default.realpathSync(xcodeproj));
|
|
20421
20459
|
for (const [id, target] of Object.entries(project.objects)) {
|
|
20422
20460
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
20423
20461
|
if (isIosAppTarget({ project, id, target }, { requireSources: false }))
|
|
@@ -20425,30 +20463,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
20425
20463
|
}
|
|
20426
20464
|
}
|
|
20427
20465
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
20428
|
-
const container =
|
|
20466
|
+
const container = import_node_fs23.default.realpathSync(xcodeprojOrWorkspace);
|
|
20429
20467
|
const { projects } = workspaceProjects(container);
|
|
20430
20468
|
const containers = [
|
|
20431
20469
|
.../* @__PURE__ */ new Set([container, ...projects.map((project2) => project2.xcodeproj)])
|
|
20432
20470
|
];
|
|
20433
20471
|
const found = containers.flatMap(
|
|
20434
20472
|
(dir) => [
|
|
20435
|
-
|
|
20436
|
-
...isDirectory(
|
|
20473
|
+
import_node_path26.default.join(dir, "xcshareddata"),
|
|
20474
|
+
...isDirectory(import_node_path26.default.join(dir, "xcuserdata")) ? import_node_fs23.default.readdirSync(import_node_path26.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path26.default.join(dir, "xcuserdata", user)) : []
|
|
20437
20475
|
].map((data) => ({
|
|
20438
20476
|
dir,
|
|
20439
|
-
file:
|
|
20477
|
+
file: import_node_path26.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
20440
20478
|
}))
|
|
20441
|
-
).find((candidate) =>
|
|
20479
|
+
).find((candidate) => import_node_fs23.default.existsSync(candidate.file));
|
|
20442
20480
|
if (!found) {
|
|
20443
20481
|
const known = containers.flatMap(
|
|
20444
|
-
(dir) =>
|
|
20482
|
+
(dir) => import_node_fs23.default.existsSync(import_node_path26.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs23.default.readdirSync(import_node_path26.default.join(dir, "xcshareddata", "xcschemes")).filter((name3) => name3.endsWith(".xcscheme")).map((name3) => name3.slice(0, -".xcscheme".length)).sort() : []
|
|
20445
20483
|
);
|
|
20446
20484
|
throw new Error(
|
|
20447
|
-
`${
|
|
20485
|
+
`${import_node_path26.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
20448
20486
|
);
|
|
20449
20487
|
}
|
|
20450
20488
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
20451
|
-
|
|
20489
|
+
import_node_fs23.default.readFileSync(found.file, "utf8")
|
|
20452
20490
|
);
|
|
20453
20491
|
const attribute = (text2, name3) => {
|
|
20454
20492
|
const value = new RegExp(`\\b${name3}\\s*=\\s*"([^"]*)"`).exec(text2)?.[1];
|
|
@@ -20461,12 +20499,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
20461
20499
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
20462
20500
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
20463
20501
|
}
|
|
20464
|
-
const projectPath =
|
|
20465
|
-
|
|
20502
|
+
const projectPath = import_node_path26.default.resolve(
|
|
20503
|
+
import_node_path26.default.dirname(found.dir),
|
|
20466
20504
|
referenced.slice("container:".length)
|
|
20467
20505
|
);
|
|
20468
20506
|
const project = projects.find(
|
|
20469
|
-
(candidate) =>
|
|
20507
|
+
(candidate) => import_node_fs23.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs23.default.realpathSync(projectPath)
|
|
20470
20508
|
);
|
|
20471
20509
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint);
|
|
20472
20510
|
const name2 = target && str(target.target.name);
|
|
@@ -20476,9 +20514,9 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
20476
20514
|
var NativeAppTargetSelectionError = class extends Error {
|
|
20477
20515
|
};
|
|
20478
20516
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
20479
|
-
const nested =
|
|
20480
|
-
const iosRoot =
|
|
20481
|
-
const projects =
|
|
20517
|
+
const nested = import_node_path26.default.join(projectRoot, "ios");
|
|
20518
|
+
const iosRoot = import_node_fs23.default.existsSync(nested) ? nested : projectRoot;
|
|
20519
|
+
const projects = import_node_fs23.default.readdirSync(iosRoot, { withFileTypes: true }).filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj"));
|
|
20482
20520
|
if (projects.length === 0) return null;
|
|
20483
20521
|
if (projects.length > 1 && !iosTarget) {
|
|
20484
20522
|
throw new NativeAppTargetSelectionError(
|
|
@@ -20488,7 +20526,7 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
20488
20526
|
let project = projects[0];
|
|
20489
20527
|
if (iosTarget && projects.length > 1) {
|
|
20490
20528
|
const matches = projects.filter(
|
|
20491
|
-
(entry) => listXcodeAppTargets(
|
|
20529
|
+
(entry) => listXcodeAppTargets(import_node_path26.default.join(iosRoot, entry.name), {
|
|
20492
20530
|
requireSources: false
|
|
20493
20531
|
}).includes(iosTarget)
|
|
20494
20532
|
);
|
|
@@ -20500,19 +20538,19 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
20500
20538
|
);
|
|
20501
20539
|
project = matches[0];
|
|
20502
20540
|
}
|
|
20503
|
-
const xcodeproj =
|
|
20541
|
+
const xcodeproj = import_node_path26.default.join(iosRoot, project.name);
|
|
20504
20542
|
const appTargets = listXcodeAppTargets(xcodeproj, { requireSources: false });
|
|
20505
20543
|
let target = iosTarget ?? defaultXcodeAppTarget(xcodeproj);
|
|
20506
20544
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
20507
20545
|
if (!iosTarget) {
|
|
20508
20546
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
20509
|
-
const container =
|
|
20547
|
+
const container = import_node_fs23.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
20510
20548
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
20511
|
-
if (
|
|
20549
|
+
if (import_node_fs23.default.existsSync(import_node_path26.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
20512
20550
|
return true;
|
|
20513
|
-
const users =
|
|
20514
|
-
return
|
|
20515
|
-
(user) =>
|
|
20551
|
+
const users = import_node_path26.default.join(dir, "xcuserdata");
|
|
20552
|
+
return import_node_fs23.default.existsSync(users) && import_node_fs23.default.readdirSync(users).some(
|
|
20553
|
+
(user) => import_node_fs23.default.existsSync(import_node_path26.default.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
20516
20554
|
);
|
|
20517
20555
|
});
|
|
20518
20556
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -20521,8 +20559,8 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
20521
20559
|
throw new Error(`native app identity has no application target ${target}`);
|
|
20522
20560
|
return { xcodeproj, target };
|
|
20523
20561
|
}
|
|
20524
|
-
var workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
20525
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
20562
|
+
var workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path26.default.join(
|
|
20563
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path26.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
20526
20564
|
"xcshareddata",
|
|
20527
20565
|
"swiftpm",
|
|
20528
20566
|
"Package.resolved"
|
|
@@ -20537,7 +20575,7 @@ var SwiftPackageResolutionRequired = class extends Error {
|
|
|
20537
20575
|
}
|
|
20538
20576
|
};
|
|
20539
20577
|
function readXcodeAppTarget(input, targetName, configurationName, options = {}) {
|
|
20540
|
-
const xcodeprojOrWorkspace =
|
|
20578
|
+
const xcodeprojOrWorkspace = import_node_fs23.default.realpathSync(input);
|
|
20541
20579
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
20542
20580
|
const { listed, projects, projectAt, cocoapods } = workspaceProjects(
|
|
20543
20581
|
xcodeprojOrWorkspace,
|
|
@@ -20546,11 +20584,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20546
20584
|
const allTargets = projects.flatMap(projectTargets);
|
|
20547
20585
|
const appTargets = allTargets.filter((ref) => isIosAppTarget(ref, options));
|
|
20548
20586
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
20549
|
-
const container =
|
|
20587
|
+
const container = import_node_path26.default.basename(xcodeprojOrWorkspace);
|
|
20550
20588
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
20551
20589
|
if (named.length !== 1) {
|
|
20590
|
+
if (appTargets.length === 0)
|
|
20591
|
+
throw new Error(
|
|
20592
|
+
`${container} has no application targets; open a project or workspace that contains one`
|
|
20593
|
+
);
|
|
20552
20594
|
throw new Error(
|
|
20553
|
-
targetName && named.length === 0 ? `${container} has no application target ${targetName}; it has ${appTargetNames.join(", ") || "none"}` : targetName ? `${container} has ${named.length} application targets named ${targetName}; open its .xcodeproj` : `${container} has ${appTargetNames.length} application targets (${appTargetNames.join(", ")
|
|
20595
|
+
targetName && named.length === 0 ? `${container} has no application target ${targetName}; it has ${appTargetNames.join(", ") || "none"}` : targetName ? `${container} has ${named.length} application targets named ${targetName}; open its .xcodeproj` : `${container} has ${appTargetNames.length} application targets (${appTargetNames.join(", ")}); pass --target`
|
|
20554
20596
|
);
|
|
20555
20597
|
}
|
|
20556
20598
|
const app = named[0];
|
|
@@ -20559,15 +20601,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20559
20601
|
for (const ref of allTargets) {
|
|
20560
20602
|
const product = ref.project.object(str(ref.target.productReference));
|
|
20561
20603
|
const file = str(product?.path);
|
|
20562
|
-
if (file && !byProduct.has(
|
|
20563
|
-
byProduct.set(
|
|
20604
|
+
if (file && !byProduct.has(import_node_path26.default.basename(file)))
|
|
20605
|
+
byProduct.set(import_node_path26.default.basename(file), ref);
|
|
20564
20606
|
}
|
|
20565
20607
|
const proxied = (project, proxyId) => {
|
|
20566
20608
|
const proxy = project.object(proxyId);
|
|
20567
20609
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
20568
20610
|
const portal = str(proxy.containerPortal);
|
|
20569
20611
|
const portalPath = project.resolvePath(portal ?? "");
|
|
20570
|
-
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath &&
|
|
20612
|
+
const owner = project.object(portal)?.isa === "PBXProject" ? project : portalPath && import_node_fs23.default.existsSync(portalPath) ? projectAt.get(import_node_fs23.default.realpathSync(portalPath)) : void 0;
|
|
20571
20613
|
const remote = str(proxy.remoteGlobalIDString);
|
|
20572
20614
|
if (!owner || !remote) return void 0;
|
|
20573
20615
|
return projectTargets(owner).find(
|
|
@@ -20591,7 +20633,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20591
20633
|
const buildFile = project.object(buildFileId);
|
|
20592
20634
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
20593
20635
|
const file = project.object(str(buildFile.fileRef));
|
|
20594
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
20636
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path26.default.basename(str(file.path) ?? "")) : void 0;
|
|
20595
20637
|
if (resolved) found.push(resolved);
|
|
20596
20638
|
}
|
|
20597
20639
|
}
|
|
@@ -20648,8 +20690,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20648
20690
|
ref.project.visitMembers(
|
|
20649
20691
|
ref.id,
|
|
20650
20692
|
ref.project.resolvePath,
|
|
20651
|
-
(file) => isDirectory(file) ? walkFiles(file) :
|
|
20652
|
-
|
|
20693
|
+
(file) => isDirectory(file) ? walkFiles(file) : import_node_fs23.default.existsSync(file) ? [file] : [],
|
|
20694
|
+
import_node_path26.default.join,
|
|
20653
20695
|
(file, kind) => {
|
|
20654
20696
|
if (kind === "header") found.push(file);
|
|
20655
20697
|
}
|
|
@@ -20665,12 +20707,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20665
20707
|
for (const ref of projectTargets(project)) {
|
|
20666
20708
|
const product = productName(ref);
|
|
20667
20709
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
20668
|
-
const name2 =
|
|
20710
|
+
const name2 = import_node_path26.default.basename(file);
|
|
20669
20711
|
if (!entries.has(name2))
|
|
20670
20712
|
entries.set(name2, visibility !== "Project" ? `${product}/${name2}` : file);
|
|
20671
20713
|
}
|
|
20672
20714
|
for (const file of synchronizedHeaders(ref)) {
|
|
20673
|
-
const name2 =
|
|
20715
|
+
const name2 = import_node_path26.default.basename(file);
|
|
20674
20716
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
20675
20717
|
}
|
|
20676
20718
|
}
|
|
@@ -20680,7 +20722,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20680
20722
|
if (folder === null) continue;
|
|
20681
20723
|
for (const file of walkFiles(folder)) {
|
|
20682
20724
|
if (!HEADER_FILE.test(file)) continue;
|
|
20683
|
-
const name2 =
|
|
20725
|
+
const name2 = import_node_path26.default.basename(file);
|
|
20684
20726
|
if (!entries.has(name2)) entries.set(name2, file);
|
|
20685
20727
|
}
|
|
20686
20728
|
}
|
|
@@ -20688,18 +20730,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20688
20730
|
for (const id of Object.keys(project.objects)) {
|
|
20689
20731
|
if (project.object(id)?.isa !== "PBXFileReference") continue;
|
|
20690
20732
|
const file = project.resolvePath(id);
|
|
20691
|
-
if (file && HEADER_FILE.test(file) && !entries.has(
|
|
20692
|
-
entries.set(
|
|
20733
|
+
if (file && HEADER_FILE.test(file) && !entries.has(import_node_path26.default.basename(file)))
|
|
20734
|
+
entries.set(import_node_path26.default.basename(file), file);
|
|
20693
20735
|
}
|
|
20694
20736
|
const map2 = [...entries];
|
|
20695
20737
|
projectHeaderMaps.set(project, map2);
|
|
20696
20738
|
return map2;
|
|
20697
20739
|
};
|
|
20698
20740
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
20699
|
-
const buildDir = (project) =>
|
|
20741
|
+
const buildDir = (project) => import_node_path26.default.join(project.projectDir, ".build/peach-xcode/Build");
|
|
20700
20742
|
const podsBuild = {
|
|
20701
|
-
SYMROOT:
|
|
20702
|
-
OBJROOT:
|
|
20743
|
+
SYMROOT: import_node_path26.default.join(buildDir(app.project), "Products"),
|
|
20744
|
+
OBJROOT: import_node_path26.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
20703
20745
|
};
|
|
20704
20746
|
const moduleTarget = (ref) => {
|
|
20705
20747
|
const name2 = str(ref.target.name) ?? ref.id;
|
|
@@ -20714,15 +20756,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20714
20756
|
TARGET_NAME: name2,
|
|
20715
20757
|
TARGETNAME: "$(TARGET_NAME)",
|
|
20716
20758
|
PROJECT: "$(PROJECT_NAME)",
|
|
20717
|
-
PROJECT_NAME:
|
|
20759
|
+
PROJECT_NAME: import_node_path26.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
20718
20760
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
20719
20761
|
SRCROOT: ref.project.projectDir,
|
|
20720
20762
|
SOURCE_ROOT: ref.project.projectDir,
|
|
20721
20763
|
PROJECT_DIR: ref.project.projectDir,
|
|
20722
|
-
SYMROOT:
|
|
20764
|
+
SYMROOT: import_node_path26.default.join(buildDir(ref.project), "Products"),
|
|
20723
20765
|
BUILD_DIR: "$(SYMROOT)",
|
|
20724
20766
|
BUILD_ROOT: "$(SYMROOT)",
|
|
20725
|
-
OBJROOT:
|
|
20767
|
+
OBJROOT: import_node_path26.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
20726
20768
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
20727
20769
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
20728
20770
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -20764,7 +20806,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20764
20806
|
xcconfigs
|
|
20765
20807
|
);
|
|
20766
20808
|
const searchRules = recursiveSearchRules(settings2);
|
|
20767
|
-
const absolute = (file) =>
|
|
20809
|
+
const absolute = (file) => import_node_path26.default.resolve(ref.project.projectDir, file);
|
|
20768
20810
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
20769
20811
|
const product = settings2("PRODUCT_NAME");
|
|
20770
20812
|
const moduleName = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -20795,7 +20837,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20795
20837
|
`${name2}: Swift compatibility header phase has no Swift producer sources`
|
|
20796
20838
|
);
|
|
20797
20839
|
const building = options.prepareGeneratedSources && options.requireSources !== false;
|
|
20798
|
-
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
20840
|
+
const versioning = building && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path26.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
20799
20841
|
if (versioning) {
|
|
20800
20842
|
const version = settings2("CURRENT_PROJECT_VERSION");
|
|
20801
20843
|
const custom = [
|
|
@@ -20808,7 +20850,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20808
20850
|
].filter((key) => settings2(key));
|
|
20809
20851
|
if (custom.length)
|
|
20810
20852
|
throw new Error(
|
|
20811
|
-
`${name2}: Xcode generates ${
|
|
20853
|
+
`${name2}: Xcode generates ${import_node_path26.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
20812
20854
|
);
|
|
20813
20855
|
const symbol = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
20814
20856
|
const [major, minor] = version.split(".");
|
|
@@ -20821,9 +20863,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20821
20863
|
` const double ${symbol}VersionNumber __attribute__ ((used)) = (double)${number};`,
|
|
20822
20864
|
""
|
|
20823
20865
|
].join("\n");
|
|
20824
|
-
if (!
|
|
20825
|
-
|
|
20826
|
-
|
|
20866
|
+
if (!import_node_fs23.default.existsSync(versioning) || import_node_fs23.default.readFileSync(versioning, "utf8") !== unit) {
|
|
20867
|
+
import_node_fs23.default.mkdirSync(import_node_path26.default.dirname(versioning), { recursive: true });
|
|
20868
|
+
import_node_fs23.default.writeFileSync(versioning, unit);
|
|
20827
20869
|
}
|
|
20828
20870
|
allSources.push(versioning);
|
|
20829
20871
|
}
|
|
@@ -20842,7 +20884,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20842
20884
|
const headerFiles = headerPhase(ref);
|
|
20843
20885
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
20844
20886
|
for (const { file, visibility } of headerFiles) {
|
|
20845
|
-
const name3 =
|
|
20887
|
+
const name3 = import_node_path26.default.basename(file);
|
|
20846
20888
|
const published = visibility !== "Project";
|
|
20847
20889
|
if (!ownHeaders.has(name3))
|
|
20848
20890
|
ownHeaders.set(name3, published ? `${product}/${name3}` : file);
|
|
@@ -20850,7 +20892,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20850
20892
|
ownHeaders.set(`${product}/${name3}`, file);
|
|
20851
20893
|
}
|
|
20852
20894
|
for (const file of synchronizedHeaders(ref)) {
|
|
20853
|
-
const name3 =
|
|
20895
|
+
const name3 = import_node_path26.default.basename(file);
|
|
20854
20896
|
if (ownHeaders.has(name3)) continue;
|
|
20855
20897
|
ownHeaders.set(name3, file);
|
|
20856
20898
|
const qualified = `${product}/${name3}`;
|
|
@@ -20862,24 +20904,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20862
20904
|
const otherProduct = productName(other);
|
|
20863
20905
|
for (const { file, visibility } of headerPhase(other)) {
|
|
20864
20906
|
if (visibility === "Project") continue;
|
|
20865
|
-
const key = `${otherProduct}/${
|
|
20907
|
+
const key = `${otherProduct}/${import_node_path26.default.basename(file)}`;
|
|
20866
20908
|
if (!nonFrameworkHeaders.has(key)) nonFrameworkHeaders.set(key, file);
|
|
20867
20909
|
}
|
|
20868
20910
|
}
|
|
20869
|
-
const wrapper =
|
|
20911
|
+
const wrapper = import_node_path26.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
20870
20912
|
const moduleMap = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
20871
|
-
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ?
|
|
20872
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap &&
|
|
20913
|
+
const frameworkUmbrella = !compatibility && framework && members.sources.length > 0 && moduleMap ? import_node_path26.default.join(import_node_path26.default.dirname(moduleMap), `${moduleName}-umbrella.h`) : null;
|
|
20914
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap && import_node_fs23.default.existsSync(moduleMap) && import_node_fs23.default.existsSync(frameworkUmbrella) ? {
|
|
20873
20915
|
framework: true,
|
|
20874
20916
|
moduleMap,
|
|
20875
20917
|
umbrella: frameworkUmbrella,
|
|
20876
|
-
outputModuleMap:
|
|
20877
|
-
outputUmbrella:
|
|
20918
|
+
outputModuleMap: import_node_path26.default.join(wrapper, "Modules", "module.modulemap"),
|
|
20919
|
+
outputUmbrella: import_node_path26.default.join(
|
|
20878
20920
|
wrapper,
|
|
20879
20921
|
"Headers",
|
|
20880
|
-
|
|
20922
|
+
import_node_path26.default.basename(frameworkUmbrella)
|
|
20881
20923
|
),
|
|
20882
|
-
outputHeader:
|
|
20924
|
+
outputHeader: import_node_path26.default.join(
|
|
20883
20925
|
wrapper,
|
|
20884
20926
|
"Headers",
|
|
20885
20927
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName}-Swift.h`
|
|
@@ -20893,10 +20935,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20893
20935
|
outputUmbrella: compatibility.outputUmbrella,
|
|
20894
20936
|
outputHeader: compatibility.outputHeader
|
|
20895
20937
|
} : frameworkCompatibility;
|
|
20896
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap &&
|
|
20938
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap && import_node_path26.default.relative(import_node_path26.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap).split(import_node_path26.default.sep)[0] !== ".." && import_node_fs23.default.existsSync(moduleMap) ? import_node_fs23.default.readdirSync(import_node_path26.default.dirname(moduleMap)).flatMap((entry) => {
|
|
20897
20939
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
20898
|
-
const file =
|
|
20899
|
-
return
|
|
20940
|
+
const file = import_node_path26.default.join(import_node_path26.default.dirname(moduleMap), entry);
|
|
20941
|
+
return import_node_fs23.default.existsSync(file) ? [file] : [];
|
|
20900
20942
|
}) : [];
|
|
20901
20943
|
const fileFlags = {};
|
|
20902
20944
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -20960,21 +21002,23 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
20960
21002
|
),
|
|
20961
21003
|
...podHeaders.filter((file) => HEADER_FILE.test(file))
|
|
20962
21004
|
],
|
|
20963
|
-
headers
|
|
21005
|
+
headers: [
|
|
21006
|
+
.../* @__PURE__ */ new Set([...headers, ...headerFiles.map(({ file }) => file)])
|
|
21007
|
+
],
|
|
20964
21008
|
prefixHeader: settings2("GCC_PREFIX_HEADER") ? absolute(settings2("GCC_PREFIX_HEADER")) : null,
|
|
20965
21009
|
bridgingHeader: settings2("SWIFT_OBJC_BRIDGING_HEADER") ? absolute(settings2("SWIFT_OBJC_BRIDGING_HEADER")) : null,
|
|
20966
21010
|
// xcode searches its products' include directory before
|
|
20967
21011
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
20968
21012
|
headerSearchPaths: [
|
|
20969
|
-
|
|
21013
|
+
import_node_path26.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
20970
21014
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
20971
21015
|
(raw) => expandSearchPath(absolute(raw), searchRules)
|
|
20972
21016
|
),
|
|
20973
|
-
|
|
21017
|
+
import_node_path26.default.join(
|
|
20974
21018
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
20975
21019
|
settings2("CURRENT_ARCH")
|
|
20976
21020
|
),
|
|
20977
|
-
|
|
21021
|
+
import_node_path26.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
20978
21022
|
settings2("DERIVED_FILE_DIR")
|
|
20979
21023
|
],
|
|
20980
21024
|
userHeaderSearchPaths: settingList(
|
|
@@ -21024,10 +21068,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21024
21068
|
...headerFiles.flatMap(
|
|
21025
21069
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
21026
21070
|
[
|
|
21027
|
-
|
|
21071
|
+
import_node_path26.default.join(
|
|
21028
21072
|
wrapper,
|
|
21029
21073
|
visibility === "Public" ? "Headers" : "PrivateHeaders",
|
|
21030
|
-
|
|
21074
|
+
import_node_path26.default.basename(file)
|
|
21031
21075
|
),
|
|
21032
21076
|
file
|
|
21033
21077
|
]
|
|
@@ -21041,7 +21085,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21041
21085
|
return [];
|
|
21042
21086
|
const destination = expand(
|
|
21043
21087
|
str(phase.dstPath) ?? "",
|
|
21044
|
-
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ?
|
|
21088
|
+
(name3) => name3 === "PUBLIC_HEADERS_FOLDER_PATH" ? import_node_path26.default.join(wrapper, "Headers") : name3 === "PRIVATE_HEADERS_FOLDER_PATH" ? import_node_path26.default.join(wrapper, "PrivateHeaders") : settings2(name3)
|
|
21045
21089
|
);
|
|
21046
21090
|
return list(phase.files).flatMap((id) => {
|
|
21047
21091
|
const file = ref.project.resolvePath(
|
|
@@ -21049,17 +21093,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21049
21093
|
);
|
|
21050
21094
|
return file && HEADER_FILE.test(file) ? [
|
|
21051
21095
|
[
|
|
21052
|
-
|
|
21096
|
+
import_node_path26.default.resolve(
|
|
21053
21097
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
21054
21098
|
destination,
|
|
21055
|
-
|
|
21099
|
+
import_node_path26.default.basename(file)
|
|
21056
21100
|
),
|
|
21057
21101
|
file
|
|
21058
21102
|
]
|
|
21059
21103
|
] : [];
|
|
21060
21104
|
});
|
|
21061
21105
|
}),
|
|
21062
|
-
...moduleMap ? [[
|
|
21106
|
+
...moduleMap ? [[import_node_path26.default.join(wrapper, "Modules", "module.modulemap"), moduleMap]] : []
|
|
21063
21107
|
]) : Object.fromEntries([
|
|
21064
21108
|
...podHeaders.map((file) => [file, file]),
|
|
21065
21109
|
...moduleMap ? [[moduleMap, moduleMap]] : []
|
|
@@ -21091,7 +21135,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21091
21135
|
const frameworkTargets = selectedTargets.filter((target) => target !== builtTargets.at(-1)).filter(({ ref }) => MODULE_PRODUCTS.has(str(ref.target.productType) ?? "")).map(({ ref, module: module3 }) => ({ ref, framework: module3 }));
|
|
21092
21136
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
21093
21137
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
21094
|
-
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) =>
|
|
21138
|
+
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path26.default.dirname(file)).filter((dir) => import_node_fs23.default.existsSync(dir)) : []
|
|
21095
21139
|
);
|
|
21096
21140
|
const expandValue = (value, settings2) => {
|
|
21097
21141
|
if (typeof value === "string") return expand(value, settings2);
|
|
@@ -21107,12 +21151,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21107
21151
|
const bundleTargets = builtTargets.filter(
|
|
21108
21152
|
({ ref }) => ref.target.productType === RESOURCE_BUNDLE
|
|
21109
21153
|
);
|
|
21110
|
-
for (const owner of options.installedPods ?
|
|
21154
|
+
for (const owner of options.installedPods ? builtTargets : []) {
|
|
21111
21155
|
for (const phaseId of list(owner.ref.target.buildPhases)) {
|
|
21112
21156
|
const phase = owner.ref.project.object(phaseId);
|
|
21113
21157
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
21114
21158
|
continue;
|
|
21115
|
-
const absolute = (raw) =>
|
|
21159
|
+
const absolute = (raw) => import_node_path26.default.resolve(owner.ref.project.projectDir, expand(raw, owner.settings));
|
|
21116
21160
|
const entries = (paths) => paths.flatMap((raw) => {
|
|
21117
21161
|
const file = absolute(raw);
|
|
21118
21162
|
xcconfigs.add(file);
|
|
@@ -21128,7 +21172,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21128
21172
|
].filter((file) => file.endsWith(".bundle"));
|
|
21129
21173
|
if (inputs.length !== outputs.length)
|
|
21130
21174
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
21131
|
-
const destinationRoot =
|
|
21175
|
+
const destinationRoot = import_node_path26.default.join(
|
|
21132
21176
|
owner.settings("TARGET_BUILD_DIR"),
|
|
21133
21177
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
21134
21178
|
);
|
|
@@ -21137,24 +21181,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21137
21181
|
const file = str(
|
|
21138
21182
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
21139
21183
|
);
|
|
21140
|
-
return file &&
|
|
21184
|
+
return file && import_node_path26.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
21141
21185
|
});
|
|
21142
21186
|
if (!product && !isDirectory(input2))
|
|
21143
21187
|
throw new Error(
|
|
21144
21188
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
21145
21189
|
);
|
|
21146
|
-
const destination =
|
|
21147
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
21190
|
+
const destination = import_node_path26.default.relative(destinationRoot, outputs[index]);
|
|
21191
|
+
if (destination === ".." || destination.startsWith(`..${import_node_path26.default.sep}`) || import_node_path26.default.isAbsolute(destination) || import_node_path26.default.basename(input2) !== import_node_path26.default.basename(destination))
|
|
21148
21192
|
throw new Error(
|
|
21149
21193
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
21150
21194
|
);
|
|
21151
|
-
const infoFile = product ?
|
|
21195
|
+
const infoFile = product ? import_node_path26.default.resolve(
|
|
21152
21196
|
product.ref.project.projectDir,
|
|
21153
21197
|
product.settings("INFOPLIST_FILE")
|
|
21154
21198
|
) : null;
|
|
21155
21199
|
if (infoFile) xcconfigs.add(infoFile);
|
|
21156
21200
|
const prefix2 = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
21157
|
-
const bundlePath = prefix2 + destination.split(
|
|
21201
|
+
const bundlePath = prefix2 + destination.split(import_node_path26.default.sep).join("/");
|
|
21158
21202
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
21159
21203
|
throw new Error(
|
|
21160
21204
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -21165,21 +21209,21 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21165
21209
|
resources: product.module.resources,
|
|
21166
21210
|
infoPlist: import_plist3.default.build(
|
|
21167
21211
|
expandValue(
|
|
21168
|
-
import_plist3.default.parse(
|
|
21212
|
+
import_plist3.default.parse(import_node_fs23.default.readFileSync(infoFile, "utf8")),
|
|
21169
21213
|
product.settings
|
|
21170
21214
|
)
|
|
21171
21215
|
)
|
|
21172
21216
|
} : {
|
|
21173
|
-
resources:
|
|
21217
|
+
resources: import_node_fs23.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path26.default.join(entry.parentPath, entry.name)).sort(),
|
|
21174
21218
|
sourceRoot: input2
|
|
21175
21219
|
}
|
|
21176
21220
|
});
|
|
21177
21221
|
}
|
|
21178
21222
|
}
|
|
21179
21223
|
}
|
|
21180
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
21224
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path26.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
21181
21225
|
const infoPlistPending = module2.generatedInfoPlist && !options.prepareGeneratedSources;
|
|
21182
|
-
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(
|
|
21226
|
+
const sourceInfo = infoPlistFile && !infoPlistPending ? import_plist3.default.parse(import_node_fs23.default.readFileSync(infoPlistFile, "utf8")) : {};
|
|
21183
21227
|
if (!sourceInfo || typeof sourceInfo !== "object" || Array.isArray(sourceInfo) || sourceInfo instanceof Date || Buffer.isBuffer(sourceInfo)) {
|
|
21184
21228
|
throw new Error(`${module2.name} Info.plist must contain a dictionary`);
|
|
21185
21229
|
}
|
|
@@ -21225,7 +21269,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21225
21269
|
};
|
|
21226
21270
|
}
|
|
21227
21271
|
const localPackageDirs = [
|
|
21228
|
-
...listed.filter((reference) =>
|
|
21272
|
+
...listed.filter((reference) => import_node_fs23.default.existsSync(import_node_path26.default.join(reference, "Package.swift"))),
|
|
21229
21273
|
...projects.flatMap(
|
|
21230
21274
|
(project) => Object.entries(project.objects).flatMap(([id, entry]) => {
|
|
21231
21275
|
if (!isDict(entry)) return [];
|
|
@@ -21235,19 +21279,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21235
21279
|
const packages = [];
|
|
21236
21280
|
while (pending.length > 0) {
|
|
21237
21281
|
const dir = pending.pop();
|
|
21238
|
-
if (
|
|
21282
|
+
if (import_node_fs23.default.existsSync(import_node_path26.default.join(dir, "Package.swift"))) {
|
|
21239
21283
|
packages.push(dir);
|
|
21240
21284
|
continue;
|
|
21241
21285
|
}
|
|
21242
21286
|
if (!isDirectory(dir)) continue;
|
|
21243
|
-
for (const child of
|
|
21287
|
+
for (const child of import_node_fs23.default.readdirSync(dir, { withFileTypes: true }))
|
|
21244
21288
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
21245
|
-
pending.push(
|
|
21289
|
+
pending.push(import_node_path26.default.join(dir, child.name));
|
|
21246
21290
|
}
|
|
21247
21291
|
return packages;
|
|
21248
21292
|
}
|
|
21249
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
21250
|
-
return candidate &&
|
|
21293
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path26.default.resolve(project.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project.resolvePath(id) : null;
|
|
21294
|
+
return candidate && import_node_fs23.default.existsSync(import_node_path26.default.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
21251
21295
|
})
|
|
21252
21296
|
)
|
|
21253
21297
|
];
|
|
@@ -21270,7 +21314,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21270
21314
|
const searchedFrameworks = /* @__PURE__ */ new Map();
|
|
21271
21315
|
const frameworkSearchDirectories = /* @__PURE__ */ new Set();
|
|
21272
21316
|
for (const { ref, settings: settings2 } of builtTargets) {
|
|
21273
|
-
const absolute = (raw) =>
|
|
21317
|
+
const absolute = (raw) => import_node_path26.default.resolve(ref.project.projectDir, expand(raw, settings2));
|
|
21274
21318
|
const requested = options.nativeModules;
|
|
21275
21319
|
const includeBinary = (name2, dir) => {
|
|
21276
21320
|
if (!requested || nativeTargets.has(ref) || requested.includes(name2) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -21282,14 +21326,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21282
21326
|
for (const directory of expandSearchPath(absolute(raw), searchRules)) {
|
|
21283
21327
|
if (frameworkSearchDirectories.has(directory)) continue;
|
|
21284
21328
|
frameworkSearchDirectories.add(directory);
|
|
21285
|
-
if (!
|
|
21329
|
+
if (!import_node_fs23.default.statSync(directory, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory))
|
|
21286
21330
|
continue;
|
|
21287
|
-
for (const entry of
|
|
21331
|
+
for (const entry of import_node_fs23.default.readdirSync(directory, { withFileTypes: true })) {
|
|
21288
21332
|
const name2 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
21289
21333
|
if (!name2 || byProduct.has(entry.name) || searchedFrameworks.has(name2))
|
|
21290
21334
|
continue;
|
|
21291
|
-
const file =
|
|
21292
|
-
if (
|
|
21335
|
+
const file = import_node_path26.default.join(directory, entry.name);
|
|
21336
|
+
if (import_node_fs23.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
21293
21337
|
searchedFrameworks.set(name2, file);
|
|
21294
21338
|
}
|
|
21295
21339
|
}
|
|
@@ -21297,9 +21341,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21297
21341
|
}
|
|
21298
21342
|
for (const raw of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
21299
21343
|
const dir = absolute(raw);
|
|
21300
|
-
const modulemap =
|
|
21301
|
-
if (!
|
|
21302
|
-
const name2 = moduleMapName(
|
|
21344
|
+
const modulemap = import_node_path26.default.join(dir, "module.modulemap");
|
|
21345
|
+
if (!import_node_fs23.default.existsSync(modulemap)) continue;
|
|
21346
|
+
const name2 = moduleMapName(import_node_fs23.default.readFileSync(modulemap, "utf8"));
|
|
21303
21347
|
if (name2 && !binaryFrameworks.has(name2)) includeBinary(name2, dir);
|
|
21304
21348
|
}
|
|
21305
21349
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -21308,7 +21352,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21308
21352
|
const inputs = list(phase.inputPaths).map(absolute);
|
|
21309
21353
|
for (const raw of list(phase.inputFileListPaths)) {
|
|
21310
21354
|
const file = absolute(raw);
|
|
21311
|
-
if (!
|
|
21355
|
+
if (!import_node_fs23.default.existsSync(file)) continue;
|
|
21312
21356
|
xcconfigs.add(file);
|
|
21313
21357
|
inputs.push(...fileListEntries(file, absolute));
|
|
21314
21358
|
}
|
|
@@ -21357,7 +21401,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21357
21401
|
product,
|
|
21358
21402
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
21359
21403
|
kind: "local",
|
|
21360
|
-
dir:
|
|
21404
|
+
dir: import_node_path26.default.resolve(
|
|
21361
21405
|
project.projectDir,
|
|
21362
21406
|
str(reference.relativePath) ?? ""
|
|
21363
21407
|
)
|
|
@@ -21390,10 +21434,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21390
21434
|
// however it is rooted: xcode links -framework <name> from the sdk
|
|
21391
21435
|
// and a stale group-relative path to it contributes nothing.
|
|
21392
21436
|
/\/System\/Library\/Frameworks\/[^/]+$/.test(`/${rawPath}`) || // a target in the workspace builds it, so it exists only after that build
|
|
21393
|
-
byProduct.has(
|
|
21437
|
+
byProduct.has(import_node_path26.default.basename(rawPath)))
|
|
21394
21438
|
continue;
|
|
21395
21439
|
const resolved = fileId ? project.resolvePath(fileId) : null;
|
|
21396
|
-
if (fileId && resolved !== null && !
|
|
21440
|
+
if (fileId && resolved !== null && !import_node_fs23.default.existsSync(resolved))
|
|
21397
21441
|
throw new Error(
|
|
21398
21442
|
`${str(target.name) ?? "target"}: linked framework ${name2} (${fileId}) points at missing ${resolved} in ${project.projectFile}`
|
|
21399
21443
|
);
|
|
@@ -21416,7 +21460,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21416
21460
|
({ product }) => !options.nativeModules || nativeTargets.has(built.ref) || options.nativeModules.includes(product)
|
|
21417
21461
|
);
|
|
21418
21462
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
21419
|
-
let packageResolved =
|
|
21463
|
+
let packageResolved = import_node_fs23.default.existsSync(resolvedFile) ? [import_node_fs23.default.realpathSync(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path26.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs23.default.existsSync(file)).map((file) => import_node_fs23.default.realpathSync(file)).sort();
|
|
21420
21464
|
if (packageResolved.length === 0) {
|
|
21421
21465
|
const requirements = remotePackageRequirements(projects);
|
|
21422
21466
|
if (requirements.length > 0) {
|
|
@@ -21442,14 +21486,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21442
21486
|
} : {},
|
|
21443
21487
|
rootDir: commonAncestor(
|
|
21444
21488
|
[
|
|
21445
|
-
workspace ?
|
|
21489
|
+
workspace ? import_node_path26.default.dirname(workspace) : app.project.projectDir,
|
|
21446
21490
|
...used.map((project) => project.projectDir),
|
|
21447
21491
|
...localPackageDirs,
|
|
21448
21492
|
...linkedProducts.flatMap(
|
|
21449
|
-
({ source }) => source.kind === "local" &&
|
|
21493
|
+
({ source }) => source.kind === "local" && import_node_fs23.default.existsSync(source.dir) ? [source.dir] : []
|
|
21450
21494
|
),
|
|
21451
21495
|
...new Set(podSourceDirs)
|
|
21452
|
-
].map((dir) =>
|
|
21496
|
+
].map((dir) => import_node_fs23.default.realpathSync(dir))
|
|
21453
21497
|
),
|
|
21454
21498
|
projectFiles: [
|
|
21455
21499
|
.../* @__PURE__ */ new Set([
|
|
@@ -21468,7 +21512,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
21468
21512
|
resourceProducts,
|
|
21469
21513
|
linkedProducts,
|
|
21470
21514
|
localPackageDirs: [
|
|
21471
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
21515
|
+
...new Set(localPackageDirs.map((dir) => import_node_fs23.default.realpathSync(dir)))
|
|
21472
21516
|
].sort(),
|
|
21473
21517
|
binaryFrameworks: [...binaryFrameworks].map(([name2, file]) => ({ name: name2, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
21474
21518
|
packageResolved,
|
|
@@ -21558,7 +21602,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
21558
21602
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary.RTCAppGroupIdentifier);
|
|
21559
21603
|
const screenShareExtensionBundleId = typeof dictionary.ScreenShareExtensionBundleId === "string" ? dictionary.ScreenShareExtensionBundleId : void 0;
|
|
21560
21604
|
const rootModuleName = readRootModuleName(
|
|
21561
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
21605
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs24.default.existsSync(file)).map((file) => import_node_fs24.default.readFileSync(file, "utf8"))
|
|
21562
21606
|
);
|
|
21563
21607
|
return stampNativeBuildSdk({
|
|
21564
21608
|
applicationName,
|
|
@@ -21579,7 +21623,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
21579
21623
|
googleSignIn: readGoogleSignInConfiguration(
|
|
21580
21624
|
dictionary,
|
|
21581
21625
|
Object.fromEntries(
|
|
21582
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(
|
|
21626
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parseInfoPlist(import_node_fs24.default.readFileSync(file, "utf8"))])
|
|
21583
21627
|
)
|
|
21584
21628
|
),
|
|
21585
21629
|
supportedInterfaceOrientations,
|
|
@@ -21588,11 +21632,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
21588
21632
|
alternateIconNames: [...alternateIconNames],
|
|
21589
21633
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
21590
21634
|
app.resources,
|
|
21591
|
-
(file) =>
|
|
21635
|
+
(file) => import_node_fs24.default.readFileSync(file, "utf8"),
|
|
21592
21636
|
(file) => {
|
|
21593
|
-
const extension =
|
|
21637
|
+
const extension = import_node_path27.default.extname(file).toLowerCase();
|
|
21594
21638
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
21595
|
-
return `data:${contentType};base64,${
|
|
21639
|
+
return `data:${contentType};base64,${import_node_fs24.default.readFileSync(file).toString("base64")}`;
|
|
21596
21640
|
},
|
|
21597
21641
|
icons,
|
|
21598
21642
|
app.appIconName,
|
|
@@ -21621,23 +21665,23 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
21621
21665
|
const read = selectNativeAppIdentityReader(platform, {
|
|
21622
21666
|
android: () => null,
|
|
21623
21667
|
ios: () => {
|
|
21624
|
-
const nested =
|
|
21625
|
-
const iosRoot =
|
|
21668
|
+
const nested = import_node_path27.default.join(projectRoot, "ios");
|
|
21669
|
+
const iosRoot = import_node_fs24.default.existsSync(nested) ? nested : projectRoot;
|
|
21626
21670
|
const prefix2 = iosRoot === nested ? "ios/" : "";
|
|
21627
21671
|
const files = {};
|
|
21628
|
-
for (const entry of
|
|
21672
|
+
for (const entry of import_node_fs24.default.readdirSync(iosRoot, { withFileTypes: true })) {
|
|
21629
21673
|
if (entry.name === "Pods") continue;
|
|
21630
21674
|
if (entry.isDirectory()) {
|
|
21631
21675
|
const names = entry.name.endsWith(".xcodeproj") ? ["project.pbxproj"] : ["Info.plist", "AppDelegate.swift", "AppDelegate.mm", "AppDelegate.m"];
|
|
21632
21676
|
for (const name2 of names) {
|
|
21633
21677
|
const relative3 = `${prefix2}${entry.name}/${name2}`;
|
|
21634
|
-
const file =
|
|
21635
|
-
if (
|
|
21678
|
+
const file = import_node_path27.default.join(projectRoot, relative3);
|
|
21679
|
+
if (import_node_fs24.default.existsSync(file)) files[relative3] = import_node_fs24.default.readFileSync(file, "utf8");
|
|
21636
21680
|
}
|
|
21637
21681
|
} else if (/AppDelegate\.(?:swift|mm|m)$/.test(entry.name)) {
|
|
21638
21682
|
const relative3 = `${prefix2}${entry.name}`;
|
|
21639
|
-
const file =
|
|
21640
|
-
if (
|
|
21683
|
+
const file = import_node_path27.default.join(projectRoot, relative3);
|
|
21684
|
+
if (import_node_fs24.default.existsSync(file)) files[relative3] = import_node_fs24.default.readFileSync(file, "utf8");
|
|
21641
21685
|
}
|
|
21642
21686
|
}
|
|
21643
21687
|
const identity = extractNativeAppIdentityFromFiles(
|
|
@@ -21654,41 +21698,41 @@ function readNativeAppIdentityFromSources(projectRoot, platform, parseInfoPlist,
|
|
|
21654
21698
|
function readAndroidNativeAppIdentity(projectRoot, androidMergedManifest) {
|
|
21655
21699
|
const files = {};
|
|
21656
21700
|
if (androidMergedManifest) {
|
|
21657
|
-
const file =
|
|
21658
|
-
if (!
|
|
21659
|
-
files[androidMergedManifest] =
|
|
21701
|
+
const file = import_node_path27.default.resolve(projectRoot, androidMergedManifest);
|
|
21702
|
+
if (!import_node_fs24.default.existsSync(file)) return null;
|
|
21703
|
+
files[androidMergedManifest] = import_node_fs24.default.readFileSync(file, "utf8");
|
|
21660
21704
|
} else {
|
|
21661
|
-
const androidRoot =
|
|
21662
|
-
if (!
|
|
21705
|
+
const androidRoot = import_node_path27.default.join(projectRoot, "android");
|
|
21706
|
+
if (!import_node_fs24.default.existsSync(androidRoot)) return null;
|
|
21663
21707
|
const collect = (directory) => {
|
|
21664
|
-
for (const entry of
|
|
21665
|
-
const file =
|
|
21708
|
+
for (const entry of import_node_fs24.default.readdirSync(directory, { withFileTypes: true })) {
|
|
21709
|
+
const file = import_node_path27.default.join(directory, entry.name);
|
|
21666
21710
|
if (entry.isDirectory()) collect(file);
|
|
21667
21711
|
else if (entry.isFile() && entry.name === "AndroidManifest.xml")
|
|
21668
|
-
files[
|
|
21712
|
+
files[import_node_path27.default.relative(projectRoot, file).split(import_node_path27.default.sep).join("/")] = import_node_fs24.default.readFileSync(file, "utf8");
|
|
21669
21713
|
}
|
|
21670
21714
|
};
|
|
21671
|
-
for (const module2 of
|
|
21715
|
+
for (const module2 of import_node_fs24.default.readdirSync(androidRoot, { withFileTypes: true })) {
|
|
21672
21716
|
if (!module2.isDirectory()) continue;
|
|
21673
|
-
const outputs =
|
|
21717
|
+
const outputs = import_node_path27.default.join(
|
|
21674
21718
|
androidRoot,
|
|
21675
21719
|
module2.name,
|
|
21676
21720
|
"build/intermediates/merged_manifests"
|
|
21677
21721
|
);
|
|
21678
|
-
if (
|
|
21722
|
+
if (import_node_fs24.default.existsSync(outputs)) collect(outputs);
|
|
21679
21723
|
}
|
|
21680
21724
|
}
|
|
21681
21725
|
for (const manifest of Object.keys(files)) {
|
|
21682
21726
|
const resourceDirectory = androidMergedResourceValuesDirectory(manifest);
|
|
21683
21727
|
if (!resourceDirectory) continue;
|
|
21684
|
-
const absolute =
|
|
21685
|
-
if (!
|
|
21686
|
-
for (const entry of
|
|
21728
|
+
const absolute = import_node_path27.default.resolve(projectRoot, resourceDirectory);
|
|
21729
|
+
if (!import_node_fs24.default.existsSync(absolute)) continue;
|
|
21730
|
+
for (const entry of import_node_fs24.default.readdirSync(absolute, { withFileTypes: true })) {
|
|
21687
21731
|
if (!entry.isDirectory() || !/^values(?:-|$)/.test(entry.name)) continue;
|
|
21688
|
-
for (const resource of
|
|
21732
|
+
for (const resource of import_node_fs24.default.readdirSync(import_node_path27.default.join(absolute, entry.name))) {
|
|
21689
21733
|
if (!resource.endsWith(".xml")) continue;
|
|
21690
21734
|
const file = `${resourceDirectory}/${entry.name}/${resource}`;
|
|
21691
|
-
files[file] =
|
|
21735
|
+
files[file] = import_node_fs24.default.readFileSync(import_node_path27.default.resolve(projectRoot, file), "utf8");
|
|
21692
21736
|
}
|
|
21693
21737
|
}
|
|
21694
21738
|
}
|
|
@@ -21705,7 +21749,7 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
21705
21749
|
const app = readIosAppTarget(projectRoot, iosTarget, environment);
|
|
21706
21750
|
if (!app) return null;
|
|
21707
21751
|
const identity = readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist);
|
|
21708
|
-
const projectManifestPath =
|
|
21752
|
+
const projectManifestPath = import_node_path27.default.join(projectRoot, "package.json");
|
|
21709
21753
|
const projectRequire = (0, import_node_module4.createRequire)(projectManifestPath);
|
|
21710
21754
|
let reanimatedManifestPath;
|
|
21711
21755
|
try {
|
|
@@ -21719,22 +21763,22 @@ function readIosNativeAppIdentity(projectRoot, parseInfoPlist, iosTarget, enviro
|
|
|
21719
21763
|
throw error;
|
|
21720
21764
|
}
|
|
21721
21765
|
const installedManifest = JSON.parse(
|
|
21722
|
-
|
|
21766
|
+
import_node_fs24.default.readFileSync(reanimatedManifestPath, "utf8")
|
|
21723
21767
|
);
|
|
21724
21768
|
const installedVersion = isRecord(installedManifest) ? nonEmptyString2(installedManifest.version) : void 0;
|
|
21725
21769
|
if (!installedVersion) throw new Error("Reanimated package version is malformed");
|
|
21726
21770
|
if (Number.parseInt(installedVersion, 10) < 4) return identity;
|
|
21727
21771
|
const defaults = JSON.parse(
|
|
21728
|
-
|
|
21729
|
-
|
|
21730
|
-
|
|
21772
|
+
import_node_fs24.default.readFileSync(
|
|
21773
|
+
import_node_path27.default.join(
|
|
21774
|
+
import_node_path27.default.dirname(reanimatedManifestPath),
|
|
21731
21775
|
"src/featureFlags/staticFlags.json"
|
|
21732
21776
|
),
|
|
21733
21777
|
"utf8"
|
|
21734
21778
|
)
|
|
21735
21779
|
);
|
|
21736
21780
|
if (!isRecord(defaults)) throw new Error("Reanimated static flags are malformed");
|
|
21737
|
-
const manifest = JSON.parse(
|
|
21781
|
+
const manifest = JSON.parse(import_node_fs24.default.readFileSync(projectManifestPath, "utf8"));
|
|
21738
21782
|
const reanimated = isRecord(manifest) ? manifest.reanimated : void 0;
|
|
21739
21783
|
const overrides = isRecord(reanimated) ? reanimated.staticFeatureFlags : void 0;
|
|
21740
21784
|
if (overrides !== void 0 && !isRecord(overrides)) {
|
|
@@ -21769,9 +21813,9 @@ function readIosAppTarget(projectRoot, iosTarget, environment) {
|
|
|
21769
21813
|
// src/native-firebase-config.ts
|
|
21770
21814
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
|
21771
21815
|
var import_node_child_process8 = require("node:child_process");
|
|
21772
|
-
var
|
|
21816
|
+
var import_node_fs25 = __toESM(require("node:fs"), 1);
|
|
21773
21817
|
var import_node_os5 = __toESM(require("node:os"), 1);
|
|
21774
|
-
var
|
|
21818
|
+
var import_node_path28 = __toESM(require("node:path"), 1);
|
|
21775
21819
|
init_is_record();
|
|
21776
21820
|
var EXPO_CONFIG_SCRIPT = `const { createRequire } = require('node:module');
|
|
21777
21821
|
const { writeFileSync } = require('node:fs');
|
|
@@ -21790,13 +21834,13 @@ const result = JSON.stringify(getConfig(root, { skipSDKVersionRequirement: true
|
|
|
21790
21834
|
if (Buffer.byteLength(result) > 1024 * 1024) throw new Error('Expo native configuration exceeds 1 MiB.');
|
|
21791
21835
|
writeFileSync(process.argv[2], result, { mode: 0o600 });`;
|
|
21792
21836
|
function hasExpoConfig(projectRoot) {
|
|
21793
|
-
const appJsonPath =
|
|
21794
|
-
const appJson =
|
|
21837
|
+
const appJsonPath = import_node_path28.default.join(projectRoot, "app.json");
|
|
21838
|
+
const appJson = import_node_fs25.default.existsSync(appJsonPath) ? JSON.parse(import_node_fs25.default.readFileSync(appJsonPath, "utf8")) : null;
|
|
21795
21839
|
const staticExpo = isRecord(appJson) && (isRecord(appJson.expo) || [appJson.ios, appJson.android].some(
|
|
21796
21840
|
(value) => isRecord(value) && typeof value.googleServicesFile === "string"
|
|
21797
21841
|
));
|
|
21798
21842
|
return staticExpo || ["app.config.js", "app.config.ts", "app.config.cjs", "app.config.mjs"].some(
|
|
21799
|
-
(name2) =>
|
|
21843
|
+
(name2) => import_node_fs25.default.existsSync(import_node_path28.default.join(projectRoot, name2))
|
|
21800
21844
|
);
|
|
21801
21845
|
}
|
|
21802
21846
|
function expoConfigArgs(projectRoot, resultPath) {
|
|
@@ -21804,22 +21848,22 @@ function expoConfigArgs(projectRoot, resultPath) {
|
|
|
21804
21848
|
"--input-type=commonjs",
|
|
21805
21849
|
"-e",
|
|
21806
21850
|
EXPO_CONFIG_SCRIPT,
|
|
21807
|
-
|
|
21851
|
+
import_node_path28.default.resolve(projectRoot),
|
|
21808
21852
|
resultPath
|
|
21809
21853
|
];
|
|
21810
21854
|
}
|
|
21811
21855
|
function readExpoConfigResult(resultPath, status, stderr) {
|
|
21812
21856
|
if (status !== 0)
|
|
21813
21857
|
throw new Error(stderr || "Expo native configuration evaluation failed.");
|
|
21814
|
-
const resolved = JSON.parse(
|
|
21858
|
+
const resolved = JSON.parse(import_node_fs25.default.readFileSync(resultPath, "utf8"));
|
|
21815
21859
|
if (!isRecord(resolved)) throw new Error("Expo native configuration is unavailable.");
|
|
21816
21860
|
return resolved;
|
|
21817
21861
|
}
|
|
21818
|
-
var resultDirectory = () =>
|
|
21862
|
+
var resultDirectory = () => import_node_fs25.default.mkdtempSync(import_node_path28.default.join(import_node_os5.default.tmpdir(), "peach-expo-config-"));
|
|
21819
21863
|
function readExpoConfig(projectRoot) {
|
|
21820
21864
|
if (!hasExpoConfig(projectRoot)) return {};
|
|
21821
21865
|
const directory = resultDirectory();
|
|
21822
|
-
const resultPath =
|
|
21866
|
+
const resultPath = import_node_path28.default.join(directory, "config.json");
|
|
21823
21867
|
try {
|
|
21824
21868
|
const child = (0, import_node_child_process8.spawnSync)("node", expoConfigArgs(projectRoot, resultPath), {
|
|
21825
21869
|
cwd: projectRoot,
|
|
@@ -21831,7 +21875,7 @@ function readExpoConfig(projectRoot) {
|
|
|
21831
21875
|
if (child.error) throw child.error;
|
|
21832
21876
|
return readExpoConfigResult(resultPath, child.status, child.stderr);
|
|
21833
21877
|
} finally {
|
|
21834
|
-
|
|
21878
|
+
import_node_fs25.default.rmSync(directory, { recursive: true, force: true });
|
|
21835
21879
|
}
|
|
21836
21880
|
}
|
|
21837
21881
|
function evaluateFirebaseGuard(header, resources) {
|
|
@@ -21853,7 +21897,7 @@ function evaluateFirebaseGuard(header, resources) {
|
|
|
21853
21897
|
}
|
|
21854
21898
|
clauses.push(condition.slice(start).trim());
|
|
21855
21899
|
const sources = resources.filter(
|
|
21856
|
-
(file) =>
|
|
21900
|
+
(file) => import_node_path28.default.basename(file) === "GoogleService-Info.plist"
|
|
21857
21901
|
);
|
|
21858
21902
|
const bound = /* @__PURE__ */ new Map();
|
|
21859
21903
|
for (const clause of clauses) {
|
|
@@ -21869,7 +21913,7 @@ function evaluateFirebaseGuard(header, resources) {
|
|
|
21869
21913
|
const dictionary = /^let\s+(\w+)\s*=\s*NSDictionary\s*\(\s*contentsOfFile:\s*(\w+)\s*\)$/.exec(clause);
|
|
21870
21914
|
if (dictionary && typeof bound.get(dictionary[2]) === "string") {
|
|
21871
21915
|
const parsed = parsePlistSource(
|
|
21872
|
-
|
|
21916
|
+
import_node_fs25.default.readFileSync(String(bound.get(dictionary[2])), "utf8")
|
|
21873
21917
|
);
|
|
21874
21918
|
if (!isRecord(parsed)) return false;
|
|
21875
21919
|
bound.set(dictionary[1], parsed);
|
|
@@ -21951,7 +21995,7 @@ function findDefaultConfigureCall(body, sources) {
|
|
|
21951
21995
|
const [, type, name2] = call;
|
|
21952
21996
|
for (const file of sources) {
|
|
21953
21997
|
if (!file.endsWith(".swift")) continue;
|
|
21954
|
-
const source = blankSwiftObjcLiterals(
|
|
21998
|
+
const source = blankSwiftObjcLiterals(import_node_fs25.default.readFileSync(file, "utf8"));
|
|
21955
21999
|
const declaration = new RegExp(
|
|
21956
22000
|
`\\b(?:enum|struct|class)\\s+${type}\\b[^{]*\\{`
|
|
21957
22001
|
).exec(source);
|
|
@@ -21973,10 +22017,10 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGen
|
|
|
21973
22017
|
prepareGeneratedSources
|
|
21974
22018
|
});
|
|
21975
22019
|
const delegates = app.allSources.filter(
|
|
21976
|
-
(file) => /^AppDelegate\.(swift|mm|m)$/.test(
|
|
22020
|
+
(file) => /^AppDelegate\.(swift|mm|m)$/.test(import_node_path28.default.basename(file))
|
|
21977
22021
|
);
|
|
21978
22022
|
const defaultConfigured = delegates.some((file) => {
|
|
21979
|
-
const raw =
|
|
22023
|
+
const raw = import_node_fs25.default.readFileSync(file, "utf8");
|
|
21980
22024
|
const source = blankSwiftObjcLiterals(raw);
|
|
21981
22025
|
const launch = /(?:\bfunc\s+application\s*\([\s\S]*?didFinishLaunchingWithOptions[\s\S]*?\)\s*->\s*Bool|^-\s*\(BOOL\)\s*application\s*:[\s\S]*?didFinishLaunchingWithOptions[^{]*)\s*\{/m.exec(
|
|
21982
22026
|
source
|
|
@@ -22041,17 +22085,17 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGen
|
|
|
22041
22085
|
return guarded;
|
|
22042
22086
|
});
|
|
22043
22087
|
if (!defaultConfigured) return null;
|
|
22044
|
-
const bundle =
|
|
22088
|
+
const bundle = import_node_path28.default.join(
|
|
22045
22089
|
app.settings("BUILT_PRODUCTS_DIR"),
|
|
22046
22090
|
app.settings("WRAPPER_NAME") || `${app.settings("PRODUCT_NAME")}.app`
|
|
22047
22091
|
);
|
|
22048
22092
|
const staged = app.copiedFiles.filter(
|
|
22049
|
-
({ from, to }) => to ===
|
|
22050
|
-
).map(({ from }) =>
|
|
22093
|
+
({ from, to }) => to === import_node_path28.default.join(bundle, "GoogleService-Info.plist") && import_node_fs25.default.existsSync(from)
|
|
22094
|
+
).map(({ from }) => import_node_fs25.default.realpathSync(from));
|
|
22051
22095
|
const resources = [
|
|
22052
22096
|
.../* @__PURE__ */ new Set([
|
|
22053
22097
|
...app.resources.filter(
|
|
22054
|
-
(file) => /^GoogleService-Info\.plist$/.test(
|
|
22098
|
+
(file) => /^GoogleService-Info\.plist$/.test(import_node_path28.default.basename(file))
|
|
22055
22099
|
),
|
|
22056
22100
|
...staged
|
|
22057
22101
|
])
|
|
@@ -22060,7 +22104,7 @@ function readTargetGoogleServicesFile(projectRoot, xcodeproj, target, prepareGen
|
|
|
22060
22104
|
throw new Error(
|
|
22061
22105
|
"native Firebase default initialization requires one GoogleService-Info.plist build resource"
|
|
22062
22106
|
);
|
|
22063
|
-
return
|
|
22107
|
+
return import_node_path28.default.relative(import_node_fs25.default.realpathSync(projectRoot), resources[0]);
|
|
22064
22108
|
}
|
|
22065
22109
|
function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], iosTarget, config = readExpoConfig(projectRoot), prepareGeneratedSources = false) {
|
|
22066
22110
|
const result = {};
|
|
@@ -22081,8 +22125,8 @@ function readNativeFirebaseConfig(projectRoot, platforms = ["ios", "android"], i
|
|
|
22081
22125
|
const native = config[platform];
|
|
22082
22126
|
if (!isRecord(native) || typeof native.googleServicesFile !== "string") continue;
|
|
22083
22127
|
try {
|
|
22084
|
-
const source =
|
|
22085
|
-
|
|
22128
|
+
const source = import_node_fs25.default.readFileSync(
|
|
22129
|
+
import_node_path28.default.resolve(projectRoot, native.googleServicesFile),
|
|
22086
22130
|
"utf8"
|
|
22087
22131
|
);
|
|
22088
22132
|
const parsed = platform === "ios" ? parsePlistSource(source) : JSON.parse(source);
|
|
@@ -22347,7 +22391,7 @@ function withPeach(config, options = {}) {
|
|
|
22347
22391
|
const configuredBundleUrl = "/index.bundle?platform=ios&dev=true&hot=true&minify=false";
|
|
22348
22392
|
const cfgServer = config.server;
|
|
22349
22393
|
const port = resolveMetroPort(cfgServer);
|
|
22350
|
-
const metroServerId = (0,
|
|
22394
|
+
const metroServerId = (0, import_node_crypto12.randomUUID)();
|
|
22351
22395
|
const bundleUrl = tagRnxBundleForPlugin(
|
|
22352
22396
|
configuredBundleUrl,
|
|
22353
22397
|
`http://localhost:${port}`,
|