peachsim 0.1.2680 → 0.1.2681
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/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +1 -1
- package/dist-lib/auth/shared-session.cjs +1 -1
- package/dist-lib/backend-origin.cjs +1 -1
- package/dist-lib/beta.cjs +1 -1
- package/dist-lib/beta.mjs +2 -2
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +5 -5
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +3 -3
- package/dist-lib/bundle-channel.cjs +904 -827
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +3 -3
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +3 -3
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +2 -2
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +7 -7
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +5 -5
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-KFRNGPIS.mjs → acorn-PR2XQSSU.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-UTPHWDOY.mjs → chunk-4FLAV4CH.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TTFIUXYS.mjs → chunk-7E6FTDFH.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-X6TNJRLY.mjs → chunk-AE55UVNN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5ZUDE2OE.mjs → chunk-AN2MS7YE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-ISLJJHL6.mjs → chunk-BMLK7CSL.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-NDNSEMKC.mjs → chunk-COZNDKTJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-MA526IJY.mjs → chunk-EULMEAZP.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-54DXR7XC.mjs → chunk-FETYD3YY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-UASVIFF4.mjs → chunk-H6ZWWX3Q.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-BZZUMB6S.mjs → chunk-HHGF6SPD.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-6FMJ3RGV.mjs → chunk-I6ET6AKV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HTM32XYI.mjs → chunk-I7QX2CR7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YIBGV5BP.mjs → chunk-J6HBVHOS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-BRJ7ARFB.mjs → chunk-KTGBQAWI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SZLZ7MYO.mjs → chunk-KZ6UAKVY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RXNQMOOQ.mjs → chunk-LN55QJTY.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SAKCEYPB.mjs → chunk-MCESDV7T.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2DSJ4Y2B.mjs → chunk-MIB25WM5.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-AKMQQCL4.mjs → chunk-NET7R6JQ.mjs} +6 -6
- package/dist-lib/esm-chunks/{chunk-S2R5CB3W.mjs → chunk-QZIWFRDI.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YOSTYBQ5.mjs → chunk-RICNI6K7.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-D7K24QPS.mjs → chunk-VRIDWK4F.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-I567ROA6.mjs → chunk-YHFSPPEY.mjs} +14 -14
- package/dist-lib/esm-chunks/{chunk-63IRSGUP.mjs → chunk-ZIU5CFK4.mjs} +1 -1
- package/dist-lib/esm-chunks/{metro-layout-parser-6ETCKA7E.mjs → metro-layout-parser-IRQ5U7LT.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-GTSH3CYC.mjs → swift-package-prebuilt-I3H6PNXA.mjs} +12 -12
- package/dist-lib/esm-chunks/{swift-sdk-app-module-PUPJSKNY.mjs → swift-sdk-app-module-GVKIKJFL.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-YPS6TJTZ.mjs → swift-sdk-image-SQUIDGQL.mjs} +16 -16
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-5NMRH53W.mjs → swift-sdk-image-producer-HTOOFVQH.mjs} +5 -5
- package/dist-lib/expo-swift-bundle.cjs +736 -659
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +7 -7
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +740 -663
- package/dist-lib/host/fetch-proxy-handler.cjs +83 -80
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +3 -3
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +3 -3
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +4 -4
- package/dist-lib/native-app-identity-project.cjs +410 -304
- package/dist-lib/native-app-identity-project.mjs +418 -312
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +6 -6
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +3 -3
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +2 -2
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +3 -3
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +87 -85
- package/dist-lib/public-origins-lib.json +73 -71
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +2 -2
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +8 -8
- package/dist-lib/skills.cjs +780 -703
- package/dist-lib/swift-compile.cjs +1 -1
- package/dist-lib/swift-compile.mjs +12 -12
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +3 -3
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +6 -6
- package/dist-lib/swift-svg-raster.cjs +1 -1
- package/dist-lib/swift-svg-raster.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
- package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/stream-json.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
- package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
- package/dist-lib/vendor/sucrase.cjs +1 -1
- package/dist-lib/vendor/terser.cjs +1 -1
- package/dist-lib/vendor/valibot.cjs +1 -1
- package/dist-lib/vendor/ws.cjs +1 -1
- package/dist-lib/vendor/zod.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +3 -3
- package/package.json +1 -1
- package/src/expo-swift-host.ts +73 -31
- package/src/swift-xcframework.ts +13 -7
- package/src/turbo-codegen-intake.ts +4 -1
- package/src/xcode-project.ts +57 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2681 | (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;
|
|
@@ -68846,7 +68846,7 @@ var init_provenance = __esm({
|
|
|
68846
68846
|
import_node_crypto45 = require("node:crypto");
|
|
68847
68847
|
import_node_fs75 = require("node:fs");
|
|
68848
68848
|
import_node_path75 = require("node:path");
|
|
68849
|
-
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"692791414734a0fe5949c1d2638941d5de882b8737675deae2e3a49512f2a126","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"
|
|
68849
|
+
swiftCoverageProvenance = true ? JSON.parse('{"swift-coverage/indexdump.ts":"0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412","swift-coverage/indexing.ts":"633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272","swift-coverage/types.ts":"bd8fae54ea6c53e110cd8a5d7b57c1d532dd0166e09fdaea63c4f270c3780dd1","swift-coverage/source.ts":"c151758a9f67631bc61473c375df0dc017da6902a34533b2cf4fc4fd7d19b6ee","swift-coverage/package.ts":"1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b","swift-coverage/xcode.ts":"d6a3228567a46c6d5280895383093889d9b868958a117881061bdd74729a225f","swift-coverage/xcode-assets.ts":"d98d6294b359528f7733b26db6f80f554782354faa235605f9562be4ad98b8a3","swift-coverage/xcode-asset-symbols.ts":"1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671","swift-coverage/xcode-bridging.ts":"33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11","swift-coverage/xcode-packages.ts":"5c83f56357d880243ab485b260d23abd0094583ffa2287dac6e9e7eb18c3673d","swift-coverage/xcode-strings.ts":"facdbeb9de6bb12da4ab4954553edfaadd0e486f1181443138be70c3d8396236","swift-coverage/reader.ts":"da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c","swift-coverage/provenance.ts":"f5039c16e63c6129e22b71203f58982c68cef6e282a4f236b93da28edd39c108","swift-package-manifest.ts":"523fdfffc0cff95c8df7beeca437622a07d4fd666f0bb22b0ff67d14c42a7b10","swift-package.ts":"05c6cf101fbc944f6684a70db0a9c5aede846b2f0482a6b4a5a0abed737d4658","swift-source-file.ts":"8becce5e73b76a61d9d202c1ecfb39b1238e9bbf0e77841f1c51c98fa9ac7bd3","swift-toolchain.ts":"692791414734a0fe5949c1d2638941d5de882b8737675deae2e3a49512f2a126","home-paths.ts":"d1606390f0e8e50f0ff72544eadb3d49dfabf08e004c1218f2998c36fb8995dd","xcode-header-search.ts":"c72b724fc497e4cf603c355f86eb3c07c929ad299758cffbc6ff88ed241654c6","xcode-project.ts":"d140088a94d032e28788e18bf11499965e0c626255fd904538764ededcf1d751","xcode-target-members.ts":"2379e6d411c5d63fa65ddc24c4e4fc8bfcd001b5be109b694c848fe62908db86","xcode-json-project.ts":"df6d6db28e0c8cfdf1f480e1e32d35f12c9cf1936642d5dda923889fb18a8fd6","openstep-plist.ts":"da11f86885ef1e25979ad989f332195c113c4b7a43f108e8d36646973430b81b"}') : swiftCoverageSourceDigests((0, import_node_path75.join)(__sootsim_import_meta_dirname, ".."));
|
|
68850
68850
|
}
|
|
68851
68851
|
});
|
|
68852
68852
|
|
|
@@ -69976,6 +69976,151 @@ var init_xcode_assets = __esm({
|
|
|
69976
69976
|
}
|
|
69977
69977
|
});
|
|
69978
69978
|
|
|
69979
|
+
// src/swift-source-file.ts
|
|
69980
|
+
function relativeInside(root, file) {
|
|
69981
|
+
const relative4 = import_node_path78.default.relative(root, file);
|
|
69982
|
+
return relative4 === ".." || relative4.startsWith(`..${import_node_path78.default.sep}`) || import_node_path78.default.isAbsolute(relative4) ? null : relative4;
|
|
69983
|
+
}
|
|
69984
|
+
function replaceRoot(text7, root, replacement) {
|
|
69985
|
+
return root === import_node_path78.default.parse(root).root ? text7 : text7.replaceAll(root, replacement);
|
|
69986
|
+
}
|
|
69987
|
+
function projectSourceKey(canonicalRoots, file) {
|
|
69988
|
+
const canonicalFile = import_node_fs78.default.realpathSync(file);
|
|
69989
|
+
for (const root of canonicalRoots) {
|
|
69990
|
+
const relative4 = relativeInside(root, canonicalFile);
|
|
69991
|
+
if (relative4 !== null) return `./${relative4}`;
|
|
69992
|
+
}
|
|
69993
|
+
return canonicalFile;
|
|
69994
|
+
}
|
|
69995
|
+
function packageInputPath(canonicalRoot, file) {
|
|
69996
|
+
const canonicalFile = import_node_fs78.default.realpathSync(file);
|
|
69997
|
+
if (relativeInside(canonicalRoot, canonicalFile) === null) {
|
|
69998
|
+
throw new Error(`swift input escapes the selected package: ${file}`);
|
|
69999
|
+
}
|
|
70000
|
+
return canonicalFile;
|
|
70001
|
+
}
|
|
70002
|
+
function readPackageFile(root, file, maxBytes) {
|
|
70003
|
+
const canonicalFile = packageInputPath(import_node_fs78.default.realpathSync(root), file);
|
|
70004
|
+
const expected = import_node_fs78.default.statSync(canonicalFile);
|
|
70005
|
+
const fd = import_node_fs78.default.openSync(canonicalFile, import_node_fs78.default.constants.O_RDONLY | import_node_fs78.default.constants.O_NOFOLLOW);
|
|
70006
|
+
try {
|
|
70007
|
+
const stat = import_node_fs78.default.fstatSync(fd);
|
|
70008
|
+
if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
|
|
70009
|
+
throw new Error(`swift input changed while opening: ${file}`);
|
|
70010
|
+
}
|
|
70011
|
+
if (!stat.isFile() || stat.size > maxBytes) {
|
|
70012
|
+
throw new Error(`swift input exceeds ${maxBytes} bytes: ${file}`);
|
|
70013
|
+
}
|
|
70014
|
+
const bytes = Buffer.alloc(stat.size + 1);
|
|
70015
|
+
let offset = 0;
|
|
70016
|
+
while (offset < bytes.length) {
|
|
70017
|
+
const count = import_node_fs78.default.readSync(fd, bytes, offset, bytes.length - offset, null);
|
|
70018
|
+
if (count === 0) break;
|
|
70019
|
+
offset += count;
|
|
70020
|
+
}
|
|
70021
|
+
if (offset !== stat.size || import_node_fs78.default.fstatSync(fd).size !== stat.size) {
|
|
70022
|
+
throw new Error(`swift input changed while reading: ${file}`);
|
|
70023
|
+
}
|
|
70024
|
+
return bytes.subarray(0, offset);
|
|
70025
|
+
} finally {
|
|
70026
|
+
import_node_fs78.default.closeSync(fd);
|
|
70027
|
+
}
|
|
70028
|
+
}
|
|
70029
|
+
var import_node_fs78, import_node_path78;
|
|
70030
|
+
var init_swift_source_file = __esm({
|
|
70031
|
+
"src/swift-source-file.ts"() {
|
|
70032
|
+
"use strict";
|
|
70033
|
+
import_node_fs78 = __toESM(require("node:fs"), 1);
|
|
70034
|
+
import_node_path78 = __toESM(require("node:path"), 1);
|
|
70035
|
+
}
|
|
70036
|
+
});
|
|
70037
|
+
|
|
70038
|
+
// src/swift-xcframework.ts
|
|
70039
|
+
function simulatorNativeLibrary(dir) {
|
|
70040
|
+
if (dir.endsWith(".framework")) {
|
|
70041
|
+
const name3 = import_node_path79.default.basename(dir, ".framework");
|
|
70042
|
+
return {
|
|
70043
|
+
name: name3,
|
|
70044
|
+
file: import_node_path79.default.join(dir, name3),
|
|
70045
|
+
slice: import_node_path79.default.dirname(dir),
|
|
70046
|
+
kind: "framework"
|
|
70047
|
+
};
|
|
70048
|
+
}
|
|
70049
|
+
if (!dir.endsWith(".xcframework")) return null;
|
|
70050
|
+
const info = parsePlistBytes(import_node_fs79.default.readFileSync(import_node_path79.default.join(dir, "Info.plist")));
|
|
70051
|
+
if (!isRecord(info) || !Array.isArray(info.AvailableLibraries))
|
|
70052
|
+
throw new Error(`${dir}: invalid XCFramework library declarations`);
|
|
70053
|
+
const matches = [];
|
|
70054
|
+
for (const entry of info.AvailableLibraries) {
|
|
70055
|
+
if (!isRecord(entry)) throw new Error(`${dir}: invalid XCFramework library entry`);
|
|
70056
|
+
if (entry.SupportedPlatform !== "ios" || entry.SupportedPlatformVariant !== "simulator")
|
|
70057
|
+
continue;
|
|
70058
|
+
if (typeof entry.LibraryPath !== "string" || typeof entry.LibraryIdentifier !== "string")
|
|
70059
|
+
throw new Error(`${dir}: invalid simulator library paths`);
|
|
70060
|
+
const archive = /\.a$/.test(entry.LibraryPath);
|
|
70061
|
+
const framework = /\.framework$/.test(entry.LibraryPath);
|
|
70062
|
+
if (!archive && !framework) continue;
|
|
70063
|
+
const slice = import_node_path79.default.resolve(dir, entry.LibraryIdentifier);
|
|
70064
|
+
const bundle = import_node_path79.default.resolve(dir, entry.LibraryIdentifier, entry.LibraryPath);
|
|
70065
|
+
const bundleRelative = import_node_path79.default.relative(dir, bundle);
|
|
70066
|
+
if (bundleRelative.startsWith("..") || import_node_path79.default.isAbsolute(bundleRelative))
|
|
70067
|
+
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
70068
|
+
let name3 = entry.LibraryPath;
|
|
70069
|
+
let file = bundle;
|
|
70070
|
+
if (framework) {
|
|
70071
|
+
name3 = import_node_path79.default.basename(bundle, ".framework");
|
|
70072
|
+
file = import_node_path79.default.join(bundle, name3);
|
|
70073
|
+
}
|
|
70074
|
+
const relative4 = import_node_path79.default.relative(dir, file);
|
|
70075
|
+
if (relative4.startsWith("..") || import_node_path79.default.isAbsolute(relative4))
|
|
70076
|
+
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
70077
|
+
if (framework) {
|
|
70078
|
+
matches.push({ name: name3, file, slice, kind: "framework" });
|
|
70079
|
+
continue;
|
|
70080
|
+
}
|
|
70081
|
+
const headers = typeof entry.HeadersPath === "string" ? import_node_path79.default.resolve(slice, entry.HeadersPath) : void 0;
|
|
70082
|
+
if (headers && relativeInside(slice, headers) === null)
|
|
70083
|
+
throw new Error(`${dir}: headers escape their XCFramework slice`);
|
|
70084
|
+
matches.push({ name: name3, file, slice, kind: "archive", headers });
|
|
70085
|
+
}
|
|
70086
|
+
if (matches.length === 0) return null;
|
|
70087
|
+
if (matches.length !== 1) throw new Error(`${dir}: ambiguous simulator library`);
|
|
70088
|
+
return matches[0];
|
|
70089
|
+
}
|
|
70090
|
+
function isDynamicLibrary2(file) {
|
|
70091
|
+
const fd = import_node_fs79.default.openSync(file, "r");
|
|
70092
|
+
try {
|
|
70093
|
+
const read = (offset) => {
|
|
70094
|
+
const bytes = Buffer.alloc(16);
|
|
70095
|
+
import_node_fs79.default.readSync(fd, bytes, 0, 16, offset);
|
|
70096
|
+
return bytes;
|
|
70097
|
+
};
|
|
70098
|
+
let header = read(0);
|
|
70099
|
+
const universal = header.readUInt32BE(0);
|
|
70100
|
+
if (universal === 3405691582 || universal === 3405691583) {
|
|
70101
|
+
const arch = read(8);
|
|
70102
|
+
header = read(
|
|
70103
|
+
universal === 3405691582 ? arch.readUInt32BE(8) : Number(arch.readBigUInt64BE(8))
|
|
70104
|
+
);
|
|
70105
|
+
}
|
|
70106
|
+
const magic = header.readUInt32LE(0);
|
|
70107
|
+
return (magic === 4277009103 || magic === 4277009102) && header.readUInt32LE(12) === 6;
|
|
70108
|
+
} finally {
|
|
70109
|
+
import_node_fs79.default.closeSync(fd);
|
|
70110
|
+
}
|
|
70111
|
+
}
|
|
70112
|
+
var import_node_fs79, import_node_path79;
|
|
70113
|
+
var init_swift_xcframework = __esm({
|
|
70114
|
+
"src/swift-xcframework.ts"() {
|
|
70115
|
+
"use strict";
|
|
70116
|
+
import_node_fs79 = __toESM(require("node:fs"), 1);
|
|
70117
|
+
import_node_path79 = __toESM(require("node:path"), 1);
|
|
70118
|
+
init_is_record();
|
|
70119
|
+
init_plist_bytes();
|
|
70120
|
+
init_swift_source_file();
|
|
70121
|
+
}
|
|
70122
|
+
});
|
|
70123
|
+
|
|
69979
70124
|
// src/intent-definition/system-types.ts
|
|
69980
70125
|
function systemIntentType(kind, name3) {
|
|
69981
70126
|
const hashes = kind === "Enum" ? systemEnumHashes : systemObjectHashes;
|
|
@@ -71583,17 +71728,17 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
71583
71728
|
throw new Error(`${definition2}: invalid intent code generation language ${language}`);
|
|
71584
71729
|
if (prefix) identifier(prefix);
|
|
71585
71730
|
if (module2) identifier(module2);
|
|
71586
|
-
const source =
|
|
71731
|
+
const source = import_node_fs80.default.readFileSync(definition2);
|
|
71587
71732
|
const key2 = (0, import_node_crypto48.createHash)("sha256").update(
|
|
71588
71733
|
JSON.stringify([intentCompilerRevision, definition2, prefix, language, module2])
|
|
71589
71734
|
).update("\0").update(source).digest("hex");
|
|
71590
|
-
const cache =
|
|
71591
|
-
const output =
|
|
71592
|
-
const localization = definition2.split(
|
|
71593
|
-
const compiledRelative =
|
|
71594
|
-
const compiled =
|
|
71595
|
-
const generated =
|
|
71596
|
-
if (
|
|
71735
|
+
const cache = import_node_path80.default.join(derivedDirectory, "IntentDefinitions");
|
|
71736
|
+
const output = import_node_path80.default.join(cache, key2);
|
|
71737
|
+
const localization = definition2.split(import_node_path80.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
71738
|
+
const compiledRelative = import_node_path80.default.join("Resources", localization, import_node_path80.default.basename(definition2));
|
|
71739
|
+
const compiled = import_node_path80.default.join(output, compiledRelative);
|
|
71740
|
+
const generated = import_node_path80.default.join(output, "Sources");
|
|
71741
|
+
if (import_node_fs80.default.existsSync(compiled) && import_node_fs80.default.existsSync(generated)) return { compiled, generated };
|
|
71597
71742
|
let metadata;
|
|
71598
71743
|
let sources;
|
|
71599
71744
|
try {
|
|
@@ -71603,34 +71748,34 @@ function preparePortableIntent(definition2, derivedDirectory, prefix, language,
|
|
|
71603
71748
|
} catch (cause) {
|
|
71604
71749
|
throw new Error(`could not compile intent definition ${definition2}`, { cause });
|
|
71605
71750
|
}
|
|
71606
|
-
|
|
71607
|
-
const stage =
|
|
71751
|
+
import_node_fs80.default.mkdirSync(cache, { recursive: true });
|
|
71752
|
+
const stage = import_node_fs80.default.mkdtempSync(import_node_path80.default.join(cache, ".compile-"));
|
|
71608
71753
|
try {
|
|
71609
|
-
const sourceDirectory =
|
|
71610
|
-
const resource =
|
|
71611
|
-
|
|
71612
|
-
|
|
71613
|
-
|
|
71754
|
+
const sourceDirectory = import_node_path80.default.join(stage, "Sources");
|
|
71755
|
+
const resource = import_node_path80.default.join(stage, compiledRelative);
|
|
71756
|
+
import_node_fs80.default.mkdirSync(sourceDirectory);
|
|
71757
|
+
import_node_fs80.default.mkdirSync(import_node_path80.default.dirname(resource), { recursive: true });
|
|
71758
|
+
import_node_fs80.default.writeFileSync(resource, metadata);
|
|
71614
71759
|
for (const [file, contents2] of sources)
|
|
71615
|
-
|
|
71760
|
+
import_node_fs80.default.writeFileSync(import_node_path80.default.join(sourceDirectory, file), contents2);
|
|
71616
71761
|
try {
|
|
71617
|
-
|
|
71762
|
+
import_node_fs80.default.renameSync(stage, output);
|
|
71618
71763
|
} catch (error) {
|
|
71619
|
-
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !
|
|
71764
|
+
if (!isRecord(error) || error.code !== "EEXIST" && error.code !== "ENOTEMPTY" || !import_node_fs80.default.existsSync(compiled) || !import_node_fs80.default.existsSync(generated))
|
|
71620
71765
|
throw error;
|
|
71621
71766
|
}
|
|
71622
71767
|
return { compiled, generated };
|
|
71623
71768
|
} finally {
|
|
71624
|
-
|
|
71769
|
+
import_node_fs80.default.rmSync(stage, { recursive: true, force: true });
|
|
71625
71770
|
}
|
|
71626
71771
|
}
|
|
71627
|
-
var import_node_crypto48,
|
|
71772
|
+
var import_node_crypto48, import_node_fs80, import_node_path80, intentCompilerRevision;
|
|
71628
71773
|
var init_xcode_intents = __esm({
|
|
71629
71774
|
"src/xcode-intents.ts"() {
|
|
71630
71775
|
"use strict";
|
|
71631
71776
|
import_node_crypto48 = require("node:crypto");
|
|
71632
|
-
|
|
71633
|
-
|
|
71777
|
+
import_node_fs80 = __toESM(require("node:fs"), 1);
|
|
71778
|
+
import_node_path80 = __toESM(require("node:path"), 1);
|
|
71634
71779
|
init_fields();
|
|
71635
71780
|
init_metadata();
|
|
71636
71781
|
init_plist_reader();
|
|
@@ -71686,7 +71831,7 @@ function remoteVersionRequirement(entry) {
|
|
|
71686
71831
|
function readXcodeJsonProject(xcodeproj, source) {
|
|
71687
71832
|
const json = Bun.JSON5.parse(source);
|
|
71688
71833
|
if (!isJsonObject(json)) throw new Error(`${xcodeproj}/project.xcproj is not an object`);
|
|
71689
|
-
const projectDir =
|
|
71834
|
+
const projectDir = import_node_path81.default.dirname(xcodeproj);
|
|
71690
71835
|
const objects = {};
|
|
71691
71836
|
let next = 0;
|
|
71692
71837
|
const add = (entry, id) => {
|
|
@@ -71699,7 +71844,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
71699
71844
|
const base2 = /^<([A-Z]+)>\/(.*)$/.exec(raw2);
|
|
71700
71845
|
if (base2) {
|
|
71701
71846
|
if (base2[1] === "PROJECT")
|
|
71702
|
-
return { sourceTree: "<absolute>", path:
|
|
71847
|
+
return { sourceTree: "<absolute>", path: import_node_path81.default.join(projectDir, base2[2]) };
|
|
71703
71848
|
if (base2[1] === "PRODUCTS")
|
|
71704
71849
|
return { sourceTree: "BUILT_PRODUCTS_DIR", path: base2[2] };
|
|
71705
71850
|
return null;
|
|
@@ -71707,7 +71852,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
71707
71852
|
const unescaped = raw2.replaceAll("\\<", "<");
|
|
71708
71853
|
if (unescaped.startsWith("/")) return { sourceTree: "<absolute>", path: unescaped };
|
|
71709
71854
|
if (unescaped.startsWith("~")) return null;
|
|
71710
|
-
return groupDir === null ? null : { sourceTree: "<absolute>", path:
|
|
71855
|
+
return groupDir === null ? null : { sourceTree: "<absolute>", path: import_node_path81.default.join(groupDir, unescaped) };
|
|
71711
71856
|
};
|
|
71712
71857
|
const memberships = [];
|
|
71713
71858
|
const folders = [];
|
|
@@ -71718,7 +71863,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
71718
71863
|
const kind = text6(entry.kind) ?? "file-reference";
|
|
71719
71864
|
const raw2 = text6(entry.path) ?? "";
|
|
71720
71865
|
const located = raw2 === "" ? null : locate(raw2, parent.dir);
|
|
71721
|
-
const name3 = text6(entry.name) ??
|
|
71866
|
+
const name3 = text6(entry.name) ?? import_node_path81.default.basename(raw2);
|
|
71722
71867
|
const node = { id: "", name: name3, dir: null, parent, children: [] };
|
|
71723
71868
|
if (kind === "group" || kind === "variant-group" || kind === "version-group") {
|
|
71724
71869
|
node.dir = raw2 === "" ? parent.dir : located?.sourceTree === "<absolute>" ? located.path : null;
|
|
@@ -71839,7 +71984,7 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
71839
71984
|
if (!isObject(entry)) continue;
|
|
71840
71985
|
const repository = text6(entry.repository);
|
|
71841
71986
|
const local = text6(entry.path);
|
|
71842
|
-
const name3 = local !== void 0 ?
|
|
71987
|
+
const name3 = local !== void 0 ? import_node_path81.default.basename(import_node_path81.default.resolve(import_node_path81.default.dirname(xcodeproj), local)) : import_node_path81.default.basename(repository ?? "").replace(/\.git$/, "");
|
|
71843
71988
|
const id = text6(entry.kind) === "local" && local !== void 0 ? add({ isa: "XCLocalSwiftPackageReference", relativePath: local }) : add({
|
|
71844
71989
|
isa: "XCRemoteSwiftPackageReference",
|
|
71845
71990
|
repositoryURL: repository ?? "",
|
|
@@ -72011,11 +72156,11 @@ function readXcodeJsonProject(xcodeproj, source) {
|
|
|
72011
72156
|
function isJsonObject(value) {
|
|
72012
72157
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72013
72158
|
}
|
|
72014
|
-
var
|
|
72159
|
+
var import_node_path81, isObject, text6, items, PHASE_ISA;
|
|
72015
72160
|
var init_xcode_json_project = __esm({
|
|
72016
72161
|
"src/xcode-json-project.ts"() {
|
|
72017
72162
|
"use strict";
|
|
72018
|
-
|
|
72163
|
+
import_node_path81 = __toESM(require("node:path"), 1);
|
|
72019
72164
|
isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
72020
72165
|
text6 = (value) => typeof value === "string" ? value : void 0;
|
|
72021
72166
|
items = (value) => Array.isArray(value) ? value : [];
|
|
@@ -72097,27 +72242,27 @@ var init_xcode_swift_features = __esm({
|
|
|
72097
72242
|
|
|
72098
72243
|
// src/xcode-project.ts
|
|
72099
72244
|
function walkFiles(dir) {
|
|
72100
|
-
if (!
|
|
72245
|
+
if (!import_node_fs81.default.existsSync(dir)) return [];
|
|
72101
72246
|
const out = [];
|
|
72102
|
-
for (const entry of
|
|
72247
|
+
for (const entry of import_node_fs81.default.readdirSync(dir, { withFileTypes: true }).sort((left, right) => left.name.localeCompare(right.name))) {
|
|
72103
72248
|
if (entry.name.startsWith(".")) continue;
|
|
72104
|
-
const full =
|
|
72249
|
+
const full = import_node_path82.default.join(dir, entry.name);
|
|
72105
72250
|
if (entry.isDirectory()) out.push(...walkFiles(full));
|
|
72106
72251
|
else if (entry.isFile()) out.push(full);
|
|
72107
72252
|
}
|
|
72108
72253
|
return out;
|
|
72109
72254
|
}
|
|
72110
72255
|
function readXcconfig(file, read) {
|
|
72111
|
-
if (read.includes(file) || !
|
|
72256
|
+
if (read.includes(file) || !import_node_fs81.default.existsSync(file)) return {};
|
|
72112
72257
|
read.push(file);
|
|
72113
72258
|
const settings = {};
|
|
72114
|
-
for (const raw2 of
|
|
72259
|
+
for (const raw2 of import_node_fs81.default.readFileSync(file, "utf8").split("\n")) {
|
|
72115
72260
|
const line = raw2.replace(/\/\/.*$/, "").trim();
|
|
72116
72261
|
const include = /^#include\??\s+"([^"]+)"/.exec(line);
|
|
72117
72262
|
if (include) {
|
|
72118
72263
|
Object.assign(
|
|
72119
72264
|
settings,
|
|
72120
|
-
readXcconfig(
|
|
72265
|
+
readXcconfig(import_node_path82.default.resolve(import_node_path82.default.dirname(file), include[1]), read)
|
|
72121
72266
|
);
|
|
72122
72267
|
continue;
|
|
72123
72268
|
}
|
|
@@ -72162,8 +72307,8 @@ function applyOperator(value, operator) {
|
|
|
72162
72307
|
return value.replace(/[^A-Za-z0-9_]/g, "_").replace(/^[0-9]/, "_");
|
|
72163
72308
|
case "standardizepath":
|
|
72164
72309
|
if (value === ".") return value;
|
|
72165
|
-
if (
|
|
72166
|
-
return
|
|
72310
|
+
if (import_node_path82.default.posix.isAbsolute(value))
|
|
72311
|
+
return import_node_path82.default.posix.normalize(value).replace(/(?<=.)\/$/, "");
|
|
72167
72312
|
return value.split("/").filter((component) => component !== "" && component !== ".").join("/");
|
|
72168
72313
|
}
|
|
72169
72314
|
throw new Error(`unsupported build setting operator :${operator}`);
|
|
@@ -72172,22 +72317,22 @@ function decodeXml(text7) {
|
|
|
72172
72317
|
return text7.replaceAll(""", '"').replaceAll("'", "'").replaceAll("<", "<").replaceAll(">", ">").replaceAll("&", "&");
|
|
72173
72318
|
}
|
|
72174
72319
|
function workspaceReferences(workspace) {
|
|
72175
|
-
const data =
|
|
72176
|
-
if (!
|
|
72320
|
+
const data = import_node_path82.default.join(workspace, "contents.xcworkspacedata");
|
|
72321
|
+
if (!import_node_fs81.default.existsSync(data))
|
|
72177
72322
|
throw new Error(`${workspace} has no contents.xcworkspacedata`);
|
|
72178
|
-
const container =
|
|
72323
|
+
const container = import_node_path82.default.dirname(workspace);
|
|
72179
72324
|
const locate = (location, base2) => {
|
|
72180
72325
|
const colon = location.indexOf(":");
|
|
72181
72326
|
const kind = location.slice(0, colon);
|
|
72182
72327
|
const rest = location.slice(colon + 1);
|
|
72183
|
-
if (kind === "group") return
|
|
72184
|
-
if (kind === "container" || kind === "self") return
|
|
72185
|
-
if (kind === "absolute") return
|
|
72186
|
-
throw new Error(`${
|
|
72328
|
+
if (kind === "group") return import_node_path82.default.resolve(base2, rest);
|
|
72329
|
+
if (kind === "container" || kind === "self") return import_node_path82.default.resolve(container, rest);
|
|
72330
|
+
if (kind === "absolute") return import_node_path82.default.resolve(rest);
|
|
72331
|
+
throw new Error(`${import_node_path82.default.basename(workspace)} has an unsupported location ${location}`);
|
|
72187
72332
|
};
|
|
72188
72333
|
const groups = [container];
|
|
72189
72334
|
const references = [];
|
|
72190
|
-
for (const [, closing, tag, attributes, selfClosing] of
|
|
72335
|
+
for (const [, closing, tag, attributes, selfClosing] of import_node_fs81.default.readFileSync(data, "utf8").matchAll(/<(\/?)(Group|FileRef)\b([^>]*?)(\/?)>/g)) {
|
|
72191
72336
|
if (closing) {
|
|
72192
72337
|
if (tag === "Group") groups.pop();
|
|
72193
72338
|
continue;
|
|
@@ -72201,29 +72346,29 @@ function workspaceReferences(workspace) {
|
|
|
72201
72346
|
return references;
|
|
72202
72347
|
}
|
|
72203
72348
|
function enclosingXcodeWorkspace(xcodeproj) {
|
|
72204
|
-
const project2 =
|
|
72205
|
-
for (let dir =
|
|
72206
|
-
for (const name3 of
|
|
72349
|
+
const project2 = import_node_fs81.default.realpathSync.native(xcodeproj);
|
|
72350
|
+
for (let dir = import_node_path82.default.dirname(project2); ; dir = import_node_path82.default.dirname(dir)) {
|
|
72351
|
+
for (const name3 of import_node_fs81.default.readdirSync(dir).sort()) {
|
|
72207
72352
|
if (!name3.endsWith(".xcworkspace")) continue;
|
|
72208
|
-
const workspace =
|
|
72209
|
-
if (!
|
|
72353
|
+
const workspace = import_node_path82.default.join(dir, name3);
|
|
72354
|
+
if (!import_node_fs81.default.existsSync(import_node_path82.default.join(workspace, "contents.xcworkspacedata"))) continue;
|
|
72210
72355
|
if (workspaceReferences(workspace).some(
|
|
72211
|
-
(reference) =>
|
|
72356
|
+
(reference) => import_node_fs81.default.existsSync(reference) && import_node_fs81.default.realpathSync.native(reference) === project2
|
|
72212
72357
|
))
|
|
72213
72358
|
return workspace;
|
|
72214
72359
|
}
|
|
72215
|
-
if (
|
|
72360
|
+
if (import_node_fs81.default.existsSync(import_node_path82.default.join(dir, ".git")) || import_node_path82.default.dirname(dir) === dir) return null;
|
|
72216
72361
|
}
|
|
72217
72362
|
}
|
|
72218
72363
|
function findXcodeProject(input) {
|
|
72219
|
-
const resolved =
|
|
72364
|
+
const resolved = import_node_path82.default.resolve(input);
|
|
72220
72365
|
if (resolved.endsWith(".xcworkspace")) {
|
|
72221
|
-
return
|
|
72366
|
+
return import_node_path82.default.dirname(resolved).endsWith(".xcodeproj") ? import_node_path82.default.dirname(resolved) : resolved;
|
|
72222
72367
|
}
|
|
72223
72368
|
if (resolved.endsWith(".xcodeproj")) return resolved;
|
|
72224
72369
|
if (!isDirectory3(resolved)) return null;
|
|
72225
72370
|
for (const extension of [".xcworkspace", ".xcodeproj"]) {
|
|
72226
|
-
const found =
|
|
72371
|
+
const found = import_node_fs81.default.readdirSync(resolved).filter((name3) => name3.endsWith(extension)).sort();
|
|
72227
72372
|
if (found.length > 1) {
|
|
72228
72373
|
if (extension === ".xcworkspace") {
|
|
72229
72374
|
const selected = selectXcodeWorkspace(resolved, found);
|
|
@@ -72233,14 +72378,14 @@ function findXcodeProject(input) {
|
|
|
72233
72378
|
`${resolved} holds ${found.length} ${extension} bundles (${found.join(", ")}); pass one`
|
|
72234
72379
|
);
|
|
72235
72380
|
}
|
|
72236
|
-
if (found.length === 1) return
|
|
72381
|
+
if (found.length === 1) return import_node_path82.default.join(resolved, found[0]);
|
|
72237
72382
|
}
|
|
72238
72383
|
return null;
|
|
72239
72384
|
}
|
|
72240
72385
|
function sameXcodeProject(reference, xcodeproj) {
|
|
72241
|
-
if (
|
|
72386
|
+
if (import_node_path82.default.normalize(reference) === import_node_path82.default.normalize(xcodeproj)) return true;
|
|
72242
72387
|
try {
|
|
72243
|
-
return
|
|
72388
|
+
return import_node_fs81.default.existsSync(reference) && import_node_fs81.default.existsSync(xcodeproj) && import_node_fs81.default.realpathSync.native(reference) === import_node_fs81.default.realpathSync.native(xcodeproj);
|
|
72244
72389
|
} catch {
|
|
72245
72390
|
return false;
|
|
72246
72391
|
}
|
|
@@ -72248,38 +72393,38 @@ function sameXcodeProject(reference, xcodeproj) {
|
|
|
72248
72393
|
function selectXcodeWorkspace(directory2, workspaces) {
|
|
72249
72394
|
const sorted2 = [...workspaces].sort();
|
|
72250
72395
|
if (sorted2.length === 0) return null;
|
|
72251
|
-
if (sorted2.length === 1) return
|
|
72252
|
-
const xcodeprojs =
|
|
72396
|
+
if (sorted2.length === 1) return import_node_path82.default.join(directory2, sorted2[0]);
|
|
72397
|
+
const xcodeprojs = import_node_fs81.default.readdirSync(directory2).filter((name3) => name3.endsWith(".xcodeproj")).sort();
|
|
72253
72398
|
if (xcodeprojs.length !== 1) return null;
|
|
72254
|
-
const app =
|
|
72399
|
+
const app = import_node_path82.default.join(directory2, xcodeprojs[0]);
|
|
72255
72400
|
const referencing = sorted2.filter((workspace) => {
|
|
72256
72401
|
try {
|
|
72257
|
-
return workspaceReferences(
|
|
72402
|
+
return workspaceReferences(import_node_path82.default.join(directory2, workspace)).some(
|
|
72258
72403
|
(reference) => sameXcodeProject(reference, app)
|
|
72259
72404
|
);
|
|
72260
72405
|
} catch {
|
|
72261
72406
|
return false;
|
|
72262
72407
|
}
|
|
72263
72408
|
});
|
|
72264
|
-
if (referencing.length === 1) return
|
|
72409
|
+
if (referencing.length === 1) return import_node_path82.default.join(directory2, referencing[0]);
|
|
72265
72410
|
if (referencing.length === 0) return null;
|
|
72266
|
-
const own2 = `${
|
|
72411
|
+
const own2 = `${import_node_path82.default.basename(app, ".xcodeproj")}.xcworkspace`;
|
|
72267
72412
|
const named = referencing.filter((workspace) => workspace === own2);
|
|
72268
|
-
return named.length === 1 ?
|
|
72413
|
+
return named.length === 1 ? import_node_path82.default.join(directory2, named[0]) : null;
|
|
72269
72414
|
}
|
|
72270
72415
|
function installedXcodeWorkspace(projectRoot) {
|
|
72271
|
-
const ios =
|
|
72272
|
-
if (!
|
|
72416
|
+
const ios = import_node_path82.default.join(projectRoot, "ios");
|
|
72417
|
+
if (!import_node_fs81.default.existsSync(ios)) return null;
|
|
72273
72418
|
return selectXcodeWorkspace(
|
|
72274
72419
|
ios,
|
|
72275
|
-
|
|
72420
|
+
import_node_fs81.default.readdirSync(ios).filter((name3) => name3.endsWith(".xcworkspace"))
|
|
72276
72421
|
);
|
|
72277
72422
|
}
|
|
72278
72423
|
function requireInstalledXcodeWorkspace(projectRoot, needed) {
|
|
72279
72424
|
const workspace = installedXcodeWorkspace(projectRoot);
|
|
72280
72425
|
if (!workspace)
|
|
72281
72426
|
throw new Error(
|
|
72282
|
-
`${needed} needs an installed pod workspace in ${
|
|
72427
|
+
`${needed} needs an installed pod workspace in ${import_node_path82.default.join(projectRoot, "ios")}`
|
|
72283
72428
|
);
|
|
72284
72429
|
return workspace;
|
|
72285
72430
|
}
|
|
@@ -72320,8 +72465,8 @@ function remotePackageRequirements(projects2) {
|
|
|
72320
72465
|
}
|
|
72321
72466
|
function xcodeProjectFile(xcodeproj) {
|
|
72322
72467
|
for (const name3 of ["project.pbxproj", "project.xcproj"]) {
|
|
72323
|
-
const file =
|
|
72324
|
-
if (
|
|
72468
|
+
const file = import_node_path82.default.join(xcodeproj, name3);
|
|
72469
|
+
if (import_node_fs81.default.existsSync(file)) return file;
|
|
72325
72470
|
}
|
|
72326
72471
|
return null;
|
|
72327
72472
|
}
|
|
@@ -72329,7 +72474,7 @@ function loadProject(xcodeproj) {
|
|
|
72329
72474
|
const projectFile = xcodeProjectFile(xcodeproj);
|
|
72330
72475
|
if (!projectFile)
|
|
72331
72476
|
throw new Error(`${xcodeproj} has no project.pbxproj or project.xcproj`);
|
|
72332
|
-
const source =
|
|
72477
|
+
const source = import_node_fs81.default.readFileSync(projectFile, "utf8");
|
|
72333
72478
|
const digest3 = (0, import_node_crypto49.createHash)("sha256").update(source).digest("hex");
|
|
72334
72479
|
const cached2 = loaded3.get(projectFile);
|
|
72335
72480
|
if (cached2?.digest === digest3) return cached2.project;
|
|
@@ -72346,10 +72491,10 @@ function loadProject(xcodeproj) {
|
|
|
72346
72491
|
if (!project2 || project2.isa !== "PBXProject") {
|
|
72347
72492
|
throw new Error(`${projectFile} has no PBXProject root`);
|
|
72348
72493
|
}
|
|
72349
|
-
const projectDir =
|
|
72350
|
-
|
|
72494
|
+
const projectDir = import_node_fs81.default.realpathSync.native(
|
|
72495
|
+
import_node_path82.default.resolve(import_node_path82.default.dirname(xcodeproj), str(project2.projectDirPath) ?? "")
|
|
72351
72496
|
);
|
|
72352
|
-
const resolvePath = xcodePathResolver(objects, projectDir,
|
|
72497
|
+
const resolvePath = xcodePathResolver(objects, projectDir, import_node_path82.default.join);
|
|
72353
72498
|
const result = {
|
|
72354
72499
|
xcodeproj,
|
|
72355
72500
|
projectFile,
|
|
@@ -72380,9 +72525,9 @@ function xcodeInstallationIdentity() {
|
|
|
72380
72525
|
if (process.platform !== "darwin") return null;
|
|
72381
72526
|
const selected = process.env.DEVELOPER_DIR || selectedDeveloperDir(true);
|
|
72382
72527
|
if (!selected) return null;
|
|
72383
|
-
const directory2 =
|
|
72528
|
+
const directory2 = import_node_path82.default.extname(selected) === ".app" ? import_node_path82.default.join(selected, "Contents", "Developer") : selected;
|
|
72384
72529
|
const versionFile = `${directory2}/../version.plist`;
|
|
72385
|
-
const version2 =
|
|
72530
|
+
const version2 = import_node_fs81.default.existsSync(versionFile) ? (0, import_node_crypto49.createHash)("sha256").update(import_node_fs81.default.readFileSync(versionFile)).digest("hex") : null;
|
|
72386
72531
|
return { directory: directory2, version: version2 };
|
|
72387
72532
|
}
|
|
72388
72533
|
function defaultConfiguration(project2) {
|
|
@@ -72402,7 +72547,7 @@ function expandValue(value, settings) {
|
|
|
72402
72547
|
return value;
|
|
72403
72548
|
}
|
|
72404
72549
|
function processedInfoPlist(name3, file, settings, settingKeys) {
|
|
72405
|
-
const source = file ? parsePlist(
|
|
72550
|
+
const source = file ? parsePlist(import_node_fs81.default.readFileSync(file, "utf8")) : {};
|
|
72406
72551
|
if (!source || typeof source !== "object" || Array.isArray(source) || source instanceof Date || Buffer.isBuffer(source))
|
|
72407
72552
|
throw new Error(`${name3} Info.plist must contain a dictionary`);
|
|
72408
72553
|
const info = {};
|
|
@@ -72442,8 +72587,8 @@ function targetSettings(ref, configuration, builtins, options2 = {}, overrides =
|
|
|
72442
72587
|
const relative4 = str(config.baseConfigurationReferenceRelativePath);
|
|
72443
72588
|
const own2 = isDict(config.buildSettings) ? config.buildSettings : {};
|
|
72444
72589
|
const directory2 = anchor ? project2.resolvePath(anchor) : null;
|
|
72445
|
-
const baseFile = base2 ? project2.resolvePath(base2) : directory2 && relative4 ?
|
|
72446
|
-
if ((options2.requireSources !== false || options2.installedPods) && (base2 || anchor || relative4) && (!baseFile || !
|
|
72590
|
+
const baseFile = base2 ? project2.resolvePath(base2) : directory2 && relative4 ? import_node_path82.default.resolve(directory2, relative4) : null;
|
|
72591
|
+
if ((options2.requireSources !== false || options2.installedPods) && (base2 || anchor || relative4) && (!baseFile || !import_node_fs81.default.existsSync(baseFile)))
|
|
72447
72592
|
throw new Error(
|
|
72448
72593
|
`Unable to open base configuration reference file '${baseFile ?? base2 ?? relative4 ?? anchor}'`
|
|
72449
72594
|
);
|
|
@@ -72537,10 +72682,10 @@ function hostMacroPluginFlags(flags) {
|
|
|
72537
72682
|
if (flags[index - 1] !== "-load-plugin-executable") return flag;
|
|
72538
72683
|
const separator = flag.lastIndexOf("#");
|
|
72539
72684
|
if (separator < 0) return flag;
|
|
72540
|
-
const root =
|
|
72541
|
-
const manifest =
|
|
72542
|
-
if (!
|
|
72543
|
-
const pkg = JSON.parse(
|
|
72685
|
+
const root = import_node_path82.default.dirname(import_node_path82.default.dirname(flag.slice(0, separator)));
|
|
72686
|
+
const manifest = import_node_path82.default.join(root, "package.json");
|
|
72687
|
+
if (!import_node_fs81.default.existsSync(manifest)) return flag;
|
|
72688
|
+
const pkg = JSON.parse(import_node_fs81.default.readFileSync(manifest, "utf8"));
|
|
72544
72689
|
if (!isRecord(pkg) || pkg.name !== "expo-modules-macros") return flag;
|
|
72545
72690
|
const macros = (0, import_node_module5.createRequire)(manifest)(root);
|
|
72546
72691
|
if (!isRecord(macros) || typeof macros.getScannerBinaryPath !== "function")
|
|
@@ -72558,26 +72703,26 @@ function scriptCommand(shell, script) {
|
|
|
72558
72703
|
return [executable, ...args, "-c", script];
|
|
72559
72704
|
}
|
|
72560
72705
|
function expandSearchPath(directory2, rules2) {
|
|
72561
|
-
if (
|
|
72706
|
+
if (import_node_path82.default.basename(directory2) !== "**") return [directory2];
|
|
72562
72707
|
const expanded = [];
|
|
72563
72708
|
const seen = /* @__PURE__ */ new Set();
|
|
72564
|
-
const queue = [
|
|
72709
|
+
const queue = [import_node_path82.default.dirname(directory2)];
|
|
72565
72710
|
for (let at = 0; at < queue.length; at++) {
|
|
72566
72711
|
const current2 = queue[at];
|
|
72567
72712
|
let real;
|
|
72568
72713
|
try {
|
|
72569
|
-
real =
|
|
72714
|
+
real = import_node_fs81.default.realpathSync.native(current2);
|
|
72570
72715
|
} catch {
|
|
72571
72716
|
continue;
|
|
72572
72717
|
}
|
|
72573
|
-
if (!
|
|
72718
|
+
if (!import_node_fs81.default.statSync(real).isDirectory() || seen.has(real)) continue;
|
|
72574
72719
|
seen.add(real);
|
|
72575
72720
|
expanded.push(current2);
|
|
72576
|
-
for (const entry of
|
|
72721
|
+
for (const entry of import_node_fs81.default.readdirSync(real, { withFileTypes: true }).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0)) {
|
|
72577
72722
|
if (entry.isSymbolicLink() ? !rules2.followLinks : !entry.isDirectory()) continue;
|
|
72578
72723
|
if (rules2.excluded.some((pattern) => pattern.test(entry.name)) && !rules2.included.some((pattern) => pattern.test(entry.name)))
|
|
72579
72724
|
continue;
|
|
72580
|
-
queue.push(
|
|
72725
|
+
queue.push(import_node_path82.default.join(current2, entry.name));
|
|
72581
72726
|
}
|
|
72582
72727
|
}
|
|
72583
72728
|
return expanded;
|
|
@@ -72588,7 +72733,7 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
72588
72733
|
const rules2 = recursiveSearchRules(settings);
|
|
72589
72734
|
const directories = new Set(
|
|
72590
72735
|
settingList(settings("LIBRARY_SEARCH_PATHS")).flatMap(
|
|
72591
|
-
(raw2) => expandSearchPath(
|
|
72736
|
+
(raw2) => expandSearchPath(import_node_path82.default.resolve(projectDir, expand(raw2, settings)), rules2)
|
|
72592
72737
|
)
|
|
72593
72738
|
);
|
|
72594
72739
|
const resolved = [];
|
|
@@ -72601,18 +72746,18 @@ function searchedLinkerFlags(projectDir, settings, libraryDirectories) {
|
|
|
72601
72746
|
}
|
|
72602
72747
|
let archive;
|
|
72603
72748
|
for (const directory2 of directories) {
|
|
72604
|
-
const file = (extension) =>
|
|
72749
|
+
const file = (extension) => import_node_path82.default.join(directory2, `lib${name3}.${extension}`);
|
|
72605
72750
|
const dylib = file("dylib");
|
|
72606
|
-
const parent =
|
|
72751
|
+
const parent = import_node_path82.default.dirname(dylib);
|
|
72607
72752
|
let present = libraryDirectories.get(parent);
|
|
72608
72753
|
if (present === void 0) {
|
|
72609
|
-
present =
|
|
72754
|
+
present = import_node_fs81.default.existsSync(parent);
|
|
72610
72755
|
libraryDirectories.set(parent, present);
|
|
72611
72756
|
}
|
|
72612
72757
|
if (!present) continue;
|
|
72613
|
-
if (
|
|
72758
|
+
if (import_node_fs81.default.existsSync(dylib) || import_node_fs81.default.existsSync(file("tbd"))) break;
|
|
72614
72759
|
const staticLibrary = file("a");
|
|
72615
|
-
if (!
|
|
72760
|
+
if (!import_node_fs81.default.existsSync(staticLibrary)) continue;
|
|
72616
72761
|
archive = staticLibrary;
|
|
72617
72762
|
break;
|
|
72618
72763
|
}
|
|
@@ -72709,7 +72854,7 @@ function shellAssetCatalogs(script, settings, projectDir) {
|
|
|
72709
72854
|
for (const token of tokens2) {
|
|
72710
72855
|
if (token.startsWith("-")) break;
|
|
72711
72856
|
const file = resolve4(token);
|
|
72712
|
-
if (file?.endsWith(".xcassets")) catalogs.push(
|
|
72857
|
+
if (file?.endsWith(".xcassets")) catalogs.push(import_node_path82.default.resolve(projectDir, file));
|
|
72713
72858
|
}
|
|
72714
72859
|
}
|
|
72715
72860
|
return catalogs;
|
|
@@ -72754,14 +72899,14 @@ function shellCopies(script, settings, projectDir) {
|
|
|
72754
72899
|
if (operands.length !== 2 || operands.some((operand) => operand.startsWith("-")))
|
|
72755
72900
|
return [];
|
|
72756
72901
|
copies.push({
|
|
72757
|
-
from:
|
|
72758
|
-
to:
|
|
72902
|
+
from: import_node_path82.default.resolve(projectDir, operands[0]),
|
|
72903
|
+
to: import_node_path82.default.resolve(projectDir, operands[1])
|
|
72759
72904
|
});
|
|
72760
72905
|
}
|
|
72761
72906
|
return copies;
|
|
72762
72907
|
}
|
|
72763
72908
|
function fileListEntries(file, absolute) {
|
|
72764
|
-
return
|
|
72909
|
+
return import_node_fs81.default.readFileSync(file, "utf8").split(/\r?\n/).map((line) => line.trim()).filter((line) => line !== "" && !line.startsWith("#")).map(absolute);
|
|
72765
72910
|
}
|
|
72766
72911
|
function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
72767
72912
|
const { project: project2, target, id: targetId } = ref;
|
|
@@ -72775,17 +72920,17 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72775
72920
|
const copiedFiles = [];
|
|
72776
72921
|
let generatedInfoPlist = false;
|
|
72777
72922
|
const declaredInfoPlist = settings("INFOPLIST_FILE");
|
|
72778
|
-
const infoPlistOutput = declaredInfoPlist ?
|
|
72923
|
+
const infoPlistOutput = declaredInfoPlist ? import_node_path82.default.resolve(project2.projectDir, declaredInfoPlist) : null;
|
|
72779
72924
|
const isPreparedOutput = (file) => file === infoPlistOutput || options2.requireSources !== false && file.endsWith(".swift");
|
|
72780
72925
|
let absentSources = false;
|
|
72781
72926
|
if (options2.prepareGeneratedSources === true && options2.requireSources !== false)
|
|
72782
72927
|
project2.visitMembers(
|
|
72783
72928
|
targetId,
|
|
72784
|
-
xcodePathResolver(project2.objects, project2.projectDir,
|
|
72785
|
-
(file) => isDirectory3(file) ? walkFiles(file) :
|
|
72786
|
-
|
|
72929
|
+
xcodePathResolver(project2.objects, project2.projectDir, import_node_path82.default.join, settings),
|
|
72930
|
+
(file) => isDirectory3(file) ? walkFiles(file) : import_node_fs81.default.existsSync(file) ? [file] : [],
|
|
72931
|
+
import_node_path82.default.join,
|
|
72787
72932
|
(file, kind) => {
|
|
72788
|
-
if (kind !== "header" && kind !== "resource" && !
|
|
72933
|
+
if (kind !== "header" && kind !== "resource" && !import_node_fs81.default.existsSync(file))
|
|
72789
72934
|
absentSources = true;
|
|
72790
72935
|
}
|
|
72791
72936
|
);
|
|
@@ -72804,7 +72949,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72804
72949
|
copiedFiles.push(
|
|
72805
72950
|
...shellCopies(str(phase.shellScript) ?? "", settings, project2.projectDir)
|
|
72806
72951
|
);
|
|
72807
|
-
const absolute = (raw2) =>
|
|
72952
|
+
const absolute = (raw2) => import_node_path82.default.resolve(project2.projectDir, expand(raw2, settings));
|
|
72808
72953
|
const inputs2 = list(phase.inputPaths).map(absolute);
|
|
72809
72954
|
const outputs = list(phase.outputPaths).map(absolute);
|
|
72810
72955
|
const fileLists = /* @__PURE__ */ new Map();
|
|
@@ -72813,7 +72958,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72813
72958
|
kind === "INPUT" ? phase.inputFileListPaths : phase.outputFileListPaths
|
|
72814
72959
|
).map((raw2) => {
|
|
72815
72960
|
const file = absolute(raw2);
|
|
72816
|
-
if (!
|
|
72961
|
+
if (!import_node_fs81.default.existsSync(file)) {
|
|
72817
72962
|
return { file, entries: [] };
|
|
72818
72963
|
}
|
|
72819
72964
|
return { file, entries: fileListEntries(file, absolute) };
|
|
@@ -72834,14 +72979,14 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72834
72979
|
...fileLists.get("OUTPUT").map((item) => item.file)
|
|
72835
72980
|
];
|
|
72836
72981
|
if (allOutputs.some((file) => file.endsWith(".swift") || file === infoPlistOutput)) {
|
|
72837
|
-
for (const file of inputFiles) if (
|
|
72982
|
+
for (const file of inputFiles) if (import_node_fs81.default.existsSync(file)) projectInputs.add(file);
|
|
72838
72983
|
}
|
|
72839
72984
|
const undeclaredGenerator = absentSources && beforeSources && allOutputs.length === 0 && str(phase.runOnlyForDeploymentPostprocessing) !== "1";
|
|
72840
72985
|
if (options2.prepareGeneratedSources === true && (allOutputs.some(isPreparedOutput) || undeclaredGenerator)) {
|
|
72841
|
-
const phaseDir =
|
|
72986
|
+
const phaseDir = import_node_path82.default.join(settings("TARGET_TEMP_DIR"), `Script-${phaseId}`);
|
|
72842
72987
|
for (const lists of fileLists.values())
|
|
72843
72988
|
for (const { file } of lists)
|
|
72844
|
-
if (!
|
|
72989
|
+
if (!import_node_fs81.default.existsSync(file))
|
|
72845
72990
|
throw new Error(
|
|
72846
72991
|
`${targetName}: Run Script "${script}" missing file list ${file}`
|
|
72847
72992
|
);
|
|
@@ -72860,7 +73005,7 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72860
73005
|
const lists = fileLists.get(kind);
|
|
72861
73006
|
env[`SCRIPT_${kind}_FILE_LIST_COUNT`] = String(lists.length);
|
|
72862
73007
|
lists.forEach((_item, index) => {
|
|
72863
|
-
env[`SCRIPT_${kind}_FILE_LIST_${index}`] =
|
|
73008
|
+
env[`SCRIPT_${kind}_FILE_LIST_${index}`] = import_node_path82.default.join(
|
|
72864
73009
|
phaseDir,
|
|
72865
73010
|
`${kind}-${index}.xcfilelist`
|
|
72866
73011
|
);
|
|
@@ -72871,22 +73016,22 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72871
73016
|
);
|
|
72872
73017
|
for (const file of inputFiles) {
|
|
72873
73018
|
signature2.update(file);
|
|
72874
|
-
if (
|
|
72875
|
-
const stat =
|
|
73019
|
+
if (import_node_fs81.default.existsSync(file)) {
|
|
73020
|
+
const stat = import_node_fs81.default.statSync(file);
|
|
72876
73021
|
signature2.update(`${stat.mtimeMs}:${stat.ctimeMs}:${stat.size}`);
|
|
72877
73022
|
} else signature2.update("missing");
|
|
72878
73023
|
}
|
|
72879
73024
|
const stamp = signature2.digest("hex");
|
|
72880
73025
|
const key2 = `${project2.projectFile}:${targetId}:${phaseId}:${settings("CONFIGURATION")}`;
|
|
72881
|
-
if (preparedSourcePhases.get(key2) === stamp && allOutputs.every((file) =>
|
|
73026
|
+
if (preparedSourcePhases.get(key2) === stamp && allOutputs.every((file) => import_node_fs81.default.existsSync(file)))
|
|
72882
73027
|
continue;
|
|
72883
|
-
|
|
73028
|
+
import_node_fs81.default.mkdirSync(phaseDir, { recursive: true });
|
|
72884
73029
|
if (process.platform === "linux") {
|
|
72885
73030
|
const bin = swiftToolchainBin(
|
|
72886
73031
|
privateSwiftRelease() ?? swiftNativePin().distribution.release
|
|
72887
73032
|
);
|
|
72888
|
-
const startup =
|
|
72889
|
-
|
|
73033
|
+
const startup = import_node_path82.default.join(phaseDir, "peach-tools.sh");
|
|
73034
|
+
import_node_fs81.default.writeFileSync(
|
|
72890
73035
|
startup,
|
|
72891
73036
|
'if [[ -n "$PEACH_PHASE_BASH_ENV" ]]; then source "$PEACH_PHASE_BASH_ENV"; fi\nexport PATH="$PEACH_PHASE_TOOLCHAIN:$PATH"\n'
|
|
72892
73037
|
);
|
|
@@ -72895,15 +73040,15 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72895
73040
|
env.PEACH_PHASE_TOOLCHAIN = bin;
|
|
72896
73041
|
env.PEACH_PHASE_BASH_ENV = env.BASH_ENV;
|
|
72897
73042
|
env.BASH_ENV = startup;
|
|
72898
|
-
env.PATH = [bin, env.PATH].filter(Boolean).join(
|
|
73043
|
+
env.PATH = [bin, env.PATH].filter(Boolean).join(import_node_path82.default.delimiter);
|
|
72899
73044
|
}
|
|
72900
|
-
|
|
72901
|
-
|
|
73045
|
+
import_node_fs81.default.mkdirSync(settings("BUILT_PRODUCTS_DIR"), { recursive: true });
|
|
73046
|
+
import_node_fs81.default.mkdirSync(settings("DERIVED_FILE_DIR"), { recursive: true });
|
|
72902
73047
|
for (const output of allOutputs)
|
|
72903
|
-
|
|
73048
|
+
import_node_fs81.default.mkdirSync(import_node_path82.default.dirname(output), { recursive: true });
|
|
72904
73049
|
for (const [kind, lists] of fileLists)
|
|
72905
73050
|
lists.forEach((item, index) => {
|
|
72906
|
-
|
|
73051
|
+
import_node_fs81.default.writeFileSync(
|
|
72907
73052
|
env[`SCRIPT_${kind}_FILE_LIST_${index}`],
|
|
72908
73053
|
`${item.entries.join("\n")}
|
|
72909
73054
|
`
|
|
@@ -72911,9 +73056,9 @@ function targetMembers(ref, settings, options2, settingKeys, projectInputs) {
|
|
|
72911
73056
|
});
|
|
72912
73057
|
const rawScript = str(phase.shellScript) ?? "";
|
|
72913
73058
|
if (rawScript.includes("generate-modules-provider")) {
|
|
72914
|
-
const preloadPath =
|
|
72915
|
-
|
|
72916
|
-
|
|
73059
|
+
const preloadPath = import_node_path82.default.join(phaseDir, "expo-scan-timeout.cjs");
|
|
73060
|
+
import_node_fs81.default.mkdirSync(phaseDir, { recursive: true });
|
|
73061
|
+
import_node_fs81.default.writeFileSync(
|
|
72917
73062
|
preloadPath,
|
|
72918
73063
|
[
|
|
72919
73064
|
"const cp = require('node:child_process');",
|
|
@@ -72951,7 +73096,7 @@ ${output}`
|
|
|
72951
73096
|
);
|
|
72952
73097
|
}
|
|
72953
73098
|
const missing2 = allOutputs.filter(
|
|
72954
|
-
(file) => file === infoPlistOutput && !
|
|
73099
|
+
(file) => file === infoPlistOutput && !import_node_fs81.default.existsSync(file)
|
|
72955
73100
|
);
|
|
72956
73101
|
if (missing2.length > 0)
|
|
72957
73102
|
throw new Error(
|
|
@@ -72962,9 +73107,9 @@ ${output}`
|
|
|
72962
73107
|
}
|
|
72963
73108
|
project2.visitMembers(
|
|
72964
73109
|
targetId,
|
|
72965
|
-
xcodePathResolver(project2.objects, project2.projectDir,
|
|
72966
|
-
(file) => isDirectory3(file) ? walkFiles(file) :
|
|
72967
|
-
|
|
73110
|
+
xcodePathResolver(project2.objects, project2.projectDir, import_node_path82.default.join, settings),
|
|
73111
|
+
(file) => isDirectory3(file) ? walkFiles(file) : import_node_fs81.default.existsSync(file) ? [file] : [],
|
|
73112
|
+
import_node_path82.default.join,
|
|
72968
73113
|
(file, kind, bundleName) => {
|
|
72969
73114
|
if (kind === "header") {
|
|
72970
73115
|
headers.add(file);
|
|
@@ -72975,9 +73120,9 @@ ${output}`
|
|
|
72975
73120
|
if (bundleName) resourceNames[file] = bundleName;
|
|
72976
73121
|
return;
|
|
72977
73122
|
}
|
|
72978
|
-
if (!
|
|
73123
|
+
if (!import_node_fs81.default.existsSync(file)) {
|
|
72979
73124
|
if (options2.requireSources === false) return;
|
|
72980
|
-
const script = scriptForOutput.get(
|
|
73125
|
+
const script = scriptForOutput.get(import_node_path82.default.normalize(file));
|
|
72981
73126
|
throw new Error(
|
|
72982
73127
|
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}`
|
|
72983
73128
|
);
|
|
@@ -72988,21 +73133,21 @@ ${output}`
|
|
|
72988
73133
|
);
|
|
72989
73134
|
if (options2.prepareGeneratedSources && options2.requireSources !== false) {
|
|
72990
73135
|
const interfaceFiles = [...resources].filter(
|
|
72991
|
-
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(
|
|
73136
|
+
(file) => /\.(storyboard|xib)$/.test(file) && !file.split(import_node_path82.default.sep).some((part) => part.endsWith(".bundle"))
|
|
72992
73137
|
);
|
|
72993
73138
|
let launchName = settings("INFOPLIST_KEY_UILaunchStoryboardName");
|
|
72994
|
-
if (process.platform !== "darwin" && !launchName && infoPlistOutput &&
|
|
72995
|
-
const info = parsePlist(
|
|
73139
|
+
if (process.platform !== "darwin" && !launchName && infoPlistOutput && import_node_fs81.default.existsSync(infoPlistOutput)) {
|
|
73140
|
+
const info = parsePlist(import_node_fs81.default.readFileSync(infoPlistOutput, "utf8"));
|
|
72996
73141
|
const declared = isRecord(info) ? info.UILaunchStoryboardName : void 0;
|
|
72997
73142
|
if (typeof declared === "string") launchName = expand(declared, settings);
|
|
72998
73143
|
}
|
|
72999
73144
|
const interfaceOutputs = /* @__PURE__ */ new Set();
|
|
73000
73145
|
for (const file of interfaceFiles) {
|
|
73001
|
-
const localization = file.split(
|
|
73146
|
+
const localization = file.split(import_node_path82.default.sep).findLast((part) => part.endsWith(".lproj")) ?? "";
|
|
73002
73147
|
const isStoryboard = file.endsWith(".storyboard");
|
|
73003
73148
|
const extension = isStoryboard ? ".storyboardc" : ".nib";
|
|
73004
|
-
const name3 =
|
|
73005
|
-
const output =
|
|
73149
|
+
const name3 = import_node_path82.default.basename(file, import_node_path82.default.extname(file));
|
|
73150
|
+
const output = import_node_path82.default.join(
|
|
73006
73151
|
settings("DERIVED_FILE_DIR"),
|
|
73007
73152
|
"InterfaceBuilder",
|
|
73008
73153
|
localization,
|
|
@@ -73021,10 +73166,10 @@ ${output}`
|
|
|
73021
73166
|
const inputs2 = JSON.stringify([
|
|
73022
73167
|
1,
|
|
73023
73168
|
args,
|
|
73024
|
-
(0, import_node_crypto49.createHash)("sha256").update(
|
|
73169
|
+
(0, import_node_crypto49.createHash)("sha256").update(import_node_fs81.default.readFileSync(file)).digest("hex")
|
|
73025
73170
|
]);
|
|
73026
73171
|
const developer = settings("DEVELOPER_DIR");
|
|
73027
|
-
const cached2 =
|
|
73172
|
+
const cached2 = import_node_fs81.default.existsSync(output) && import_node_fs81.default.existsSync(stamp) ? import_node_fs81.default.readFileSync(stamp, "utf8").split("\n") : [];
|
|
73028
73173
|
projectInputs.add(file);
|
|
73029
73174
|
resources.delete(file);
|
|
73030
73175
|
if (cached2[0] !== inputs2 || process.platform === "darwin" && cached2[1] !== developer) {
|
|
@@ -73034,15 +73179,15 @@ ${output}`
|
|
|
73034
73179
|
`${targetName}: Interface Builder compilation requires macOS and Xcode`
|
|
73035
73180
|
);
|
|
73036
73181
|
}
|
|
73037
|
-
|
|
73038
|
-
|
|
73039
|
-
|
|
73182
|
+
import_node_fs81.default.rmSync(output, { recursive: true, force: true });
|
|
73183
|
+
import_node_fs81.default.rmSync(stamp, { force: true });
|
|
73184
|
+
import_node_fs81.default.mkdirSync(import_node_path82.default.dirname(output), { recursive: true });
|
|
73040
73185
|
(0, import_node_child_process42.execFileSync)("xcrun", ["ibtool", "--compile", output, file, ...args], {
|
|
73041
73186
|
cwd: project2.projectDir,
|
|
73042
73187
|
stdio: ["ignore", "pipe", "pipe"],
|
|
73043
73188
|
timeout: runScriptTimeoutMs
|
|
73044
73189
|
});
|
|
73045
|
-
|
|
73190
|
+
import_node_fs81.default.writeFileSync(stamp, `${inputs2}
|
|
73046
73191
|
${developer}
|
|
73047
73192
|
`);
|
|
73048
73193
|
}
|
|
@@ -73084,33 +73229,33 @@ ${developer}
|
|
|
73084
73229
|
function commonAncestor(dirs) {
|
|
73085
73230
|
let common2 = dirs[0];
|
|
73086
73231
|
for (const dir of dirs) {
|
|
73087
|
-
while (common2 !==
|
|
73088
|
-
common2 =
|
|
73232
|
+
while (common2 !== import_node_path82.default.dirname(common2) && import_node_path82.default.relative(common2, dir).startsWith(".."))
|
|
73233
|
+
common2 = import_node_path82.default.dirname(common2);
|
|
73089
73234
|
}
|
|
73090
73235
|
return common2;
|
|
73091
73236
|
}
|
|
73092
73237
|
function installedPodsSandbox(pods) {
|
|
73093
|
-
const podfileLock =
|
|
73094
|
-
const manifestLock =
|
|
73095
|
-
if (!
|
|
73238
|
+
const podfileLock = import_node_path82.default.join(import_node_path82.default.dirname(pods), "Podfile.lock");
|
|
73239
|
+
const manifestLock = import_node_path82.default.join(pods, "Manifest.lock");
|
|
73240
|
+
if (!import_node_fs81.default.existsSync(podfileLock))
|
|
73096
73241
|
throw new Error(
|
|
73097
|
-
`${pods} has no ${podfileLock}: run \`pod install\` in ${
|
|
73242
|
+
`${pods} has no ${podfileLock}: run \`pod install\` in ${import_node_path82.default.dirname(pods)}`
|
|
73098
73243
|
);
|
|
73099
|
-
if (!
|
|
73244
|
+
if (!import_node_fs81.default.existsSync(manifestLock) || !import_node_fs81.default.readFileSync(manifestLock).equals(import_node_fs81.default.readFileSync(podfileLock)))
|
|
73100
73245
|
throw new Error(
|
|
73101
|
-
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${
|
|
73246
|
+
`The sandbox is not in sync with the Podfile.lock: ${manifestLock} differs from ${podfileLock}. Run \`pod install\` in ${import_node_path82.default.dirname(pods)}`
|
|
73102
73247
|
);
|
|
73103
73248
|
const specChecksums = {};
|
|
73104
|
-
const lines =
|
|
73249
|
+
const lines = import_node_fs81.default.readFileSync(manifestLock, "utf8").split("\n");
|
|
73105
73250
|
const start = lines.indexOf("SPEC CHECKSUMS:");
|
|
73106
73251
|
for (const line of start === -1 ? [] : lines.slice(start + 1)) {
|
|
73107
73252
|
const entry = /^ {2}"?([^":]+)"?: ([0-9a-f]+)$/.exec(line);
|
|
73108
73253
|
if (!entry) break;
|
|
73109
73254
|
specChecksums[entry[1]] = entry[2];
|
|
73110
73255
|
}
|
|
73111
|
-
const specs =
|
|
73112
|
-
const generated =
|
|
73113
|
-
if (
|
|
73256
|
+
const specs = import_node_path82.default.join(pods, "Local Podspecs");
|
|
73257
|
+
const generated = import_node_path82.default.join(pods, POD_GRAPH_SPECIFICATIONS);
|
|
73258
|
+
if (import_node_fs81.default.existsSync(generated))
|
|
73114
73259
|
return {
|
|
73115
73260
|
podfileLock,
|
|
73116
73261
|
manifestLock,
|
|
@@ -73118,15 +73263,15 @@ function installedPodsSandbox(pods) {
|
|
|
73118
73263
|
localPodspecs: readPodGraphSpecifications(generated),
|
|
73119
73264
|
specificationFiles: [generated]
|
|
73120
73265
|
};
|
|
73121
|
-
const specificationFiles = isDirectory3(specs) ?
|
|
73266
|
+
const specificationFiles = isDirectory3(specs) ? import_node_fs81.default.readdirSync(specs).filter((name3) => name3.endsWith(".podspec.json")).sort().map((name3) => import_node_path82.default.join(specs, name3)) : [];
|
|
73122
73267
|
return {
|
|
73123
73268
|
podfileLock,
|
|
73124
73269
|
manifestLock,
|
|
73125
73270
|
specChecksums,
|
|
73126
73271
|
localPodspecs: new Map(
|
|
73127
73272
|
specificationFiles.map((file) => [
|
|
73128
|
-
|
|
73129
|
-
|
|
73273
|
+
import_node_path82.default.basename(file, ".podspec.json"),
|
|
73274
|
+
import_node_fs81.default.readFileSync(file, "utf8")
|
|
73130
73275
|
])
|
|
73131
73276
|
),
|
|
73132
73277
|
specificationFiles
|
|
@@ -73141,14 +73286,14 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
73141
73286
|
if (!xcodeProjectFile(xcodeproj)) {
|
|
73142
73287
|
if (installedPods && isPodsProject(xcodeproj))
|
|
73143
73288
|
throw new Error(
|
|
73144
|
-
`${
|
|
73289
|
+
`${import_node_path82.default.basename(xcodeprojOrWorkspace)} builds ${xcodeproj}, which is not installed: run \`pod install\` in ${import_node_path82.default.dirname(import_node_path82.default.dirname(xcodeproj))}`
|
|
73145
73290
|
);
|
|
73146
73291
|
return;
|
|
73147
73292
|
}
|
|
73148
|
-
const key2 =
|
|
73149
|
-
if (projectAt.has(key2) || !installedPods && key2.split(
|
|
73293
|
+
const key2 = import_node_fs81.default.realpathSync.native(xcodeproj);
|
|
73294
|
+
if (projectAt.has(key2) || !installedPods && key2.split(import_node_path82.default.sep).includes("Pods"))
|
|
73150
73295
|
return;
|
|
73151
|
-
if (isPodsProject(key2)) cocoapods = installedPodsSandbox(
|
|
73296
|
+
if (isPodsProject(key2)) cocoapods = installedPodsSandbox(import_node_path82.default.dirname(key2));
|
|
73152
73297
|
const project2 = loadProject(key2);
|
|
73153
73298
|
projectAt.set(key2, project2);
|
|
73154
73299
|
projects2.push(project2);
|
|
@@ -73164,12 +73309,12 @@ function workspaceProjects(xcodeprojOrWorkspace, installedPods = false) {
|
|
|
73164
73309
|
for (const reference of listed)
|
|
73165
73310
|
if (reference.endsWith(".xcodeproj")) addProject(reference);
|
|
73166
73311
|
if (projects2.length === 0) {
|
|
73167
|
-
throw new Error(`${
|
|
73312
|
+
throw new Error(`${import_node_path82.default.basename(xcodeprojOrWorkspace)} lists no Xcode project`);
|
|
73168
73313
|
}
|
|
73169
|
-
const podfile =
|
|
73170
|
-
if (installedPods && !cocoapods &&
|
|
73314
|
+
const podfile = import_node_path82.default.join(import_node_path82.default.dirname(xcodeprojOrWorkspace), "Podfile");
|
|
73315
|
+
if (installedPods && !cocoapods && import_node_fs81.default.existsSync(podfile))
|
|
73171
73316
|
throw new Error(
|
|
73172
|
-
`${podfile} is not installed into ${
|
|
73317
|
+
`${podfile} is not installed into ${import_node_path82.default.basename(xcodeprojOrWorkspace)}: run \`pod install\` in ${import_node_path82.default.dirname(podfile)} and open the workspace it writes`
|
|
73173
73318
|
);
|
|
73174
73319
|
return { listed, projects: projects2, projectAt, cocoapods };
|
|
73175
73320
|
}
|
|
@@ -73206,7 +73351,7 @@ function listXcodeAppTargets(xcodeprojOrWorkspace, options2 = {}) {
|
|
|
73206
73351
|
return workspaceProjects(xcodeprojOrWorkspace).projects.flatMap(projectTargets).filter((ref) => isIosAppTarget(ref, options2)).map((ref) => str(ref.target.name) ?? ref.id);
|
|
73207
73352
|
}
|
|
73208
73353
|
function defaultXcodeAppTarget(xcodeproj) {
|
|
73209
|
-
const project2 = loadProject(
|
|
73354
|
+
const project2 = loadProject(import_node_fs81.default.realpathSync.native(xcodeproj));
|
|
73210
73355
|
for (const [id, target] of Object.entries(project2.objects)) {
|
|
73211
73356
|
if (!isDict(target) || target.isa !== "PBXNativeTarget") continue;
|
|
73212
73357
|
if (isIosAppTarget({ project: project2, id, target }, { requireSources: false }))
|
|
@@ -73214,30 +73359,30 @@ function defaultXcodeAppTarget(xcodeproj) {
|
|
|
73214
73359
|
}
|
|
73215
73360
|
}
|
|
73216
73361
|
function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
73217
|
-
const container =
|
|
73362
|
+
const container = import_node_fs81.default.realpathSync.native(xcodeprojOrWorkspace);
|
|
73218
73363
|
const { projects: projects2 } = workspaceProjects(container);
|
|
73219
73364
|
const containers = [
|
|
73220
73365
|
.../* @__PURE__ */ new Set([container, ...projects2.map((project3) => project3.xcodeproj)])
|
|
73221
73366
|
];
|
|
73222
73367
|
const found = containers.flatMap(
|
|
73223
73368
|
(dir) => [
|
|
73224
|
-
|
|
73225
|
-
...isDirectory3(
|
|
73369
|
+
import_node_path82.default.join(dir, "xcshareddata"),
|
|
73370
|
+
...isDirectory3(import_node_path82.default.join(dir, "xcuserdata")) ? import_node_fs81.default.readdirSync(import_node_path82.default.join(dir, "xcuserdata")).sort().map((user) => import_node_path82.default.join(dir, "xcuserdata", user)) : []
|
|
73226
73371
|
].map((data) => ({
|
|
73227
73372
|
dir,
|
|
73228
|
-
file:
|
|
73373
|
+
file: import_node_path82.default.join(data, "xcschemes", `${scheme}.xcscheme`)
|
|
73229
73374
|
}))
|
|
73230
|
-
).find((candidate) =>
|
|
73375
|
+
).find((candidate) => import_node_fs81.default.existsSync(candidate.file));
|
|
73231
73376
|
if (!found) {
|
|
73232
73377
|
const known = containers.flatMap(
|
|
73233
|
-
(dir) =>
|
|
73378
|
+
(dir) => import_node_fs81.default.existsSync(import_node_path82.default.join(dir, "xcshareddata", "xcschemes")) ? import_node_fs81.default.readdirSync(import_node_path82.default.join(dir, "xcshareddata", "xcschemes")).filter((name4) => name4.endsWith(".xcscheme")).map((name4) => name4.slice(0, -".xcscheme".length)).sort() : []
|
|
73234
73379
|
);
|
|
73235
73380
|
throw new Error(
|
|
73236
|
-
`${
|
|
73381
|
+
`${import_node_path82.default.basename(container)} has no scheme ${scheme}; it shares ${known.join(", ") || "none"}`
|
|
73237
73382
|
);
|
|
73238
73383
|
}
|
|
73239
73384
|
const launch = /<LaunchAction\b([^>]*)>([\s\S]*?)<\/LaunchAction>/.exec(
|
|
73240
|
-
|
|
73385
|
+
import_node_fs81.default.readFileSync(found.file, "utf8")
|
|
73241
73386
|
);
|
|
73242
73387
|
const attribute2 = (text7, name4) => {
|
|
73243
73388
|
const value = new RegExp(`\\b${name4}\\s*=\\s*"([^"]*)"`).exec(text7)?.[1];
|
|
@@ -73250,12 +73395,12 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
73250
73395
|
if (!configuration || !blueprint || !referenced?.startsWith("container:")) {
|
|
73251
73396
|
throw new Error(`scheme ${scheme} runs no application target`);
|
|
73252
73397
|
}
|
|
73253
|
-
const projectPath =
|
|
73254
|
-
|
|
73398
|
+
const projectPath = import_node_path82.default.resolve(
|
|
73399
|
+
import_node_path82.default.dirname(found.dir),
|
|
73255
73400
|
referenced.slice("container:".length)
|
|
73256
73401
|
);
|
|
73257
73402
|
const project2 = projects2.find(
|
|
73258
|
-
(candidate) =>
|
|
73403
|
+
(candidate) => import_node_fs81.default.existsSync(projectPath) && candidate.xcodeproj === import_node_fs81.default.realpathSync.native(projectPath)
|
|
73259
73404
|
);
|
|
73260
73405
|
const target = project2 && projectTargets(project2).find((ref) => ref.id === blueprint);
|
|
73261
73406
|
const name3 = target && str(target.target.name);
|
|
@@ -73273,26 +73418,26 @@ function readXcodeScheme(xcodeprojOrWorkspace, scheme) {
|
|
|
73273
73418
|
return { target: name3, configuration };
|
|
73274
73419
|
}
|
|
73275
73420
|
function selectIosAppTarget(projectRoot, iosTarget) {
|
|
73276
|
-
const nested =
|
|
73277
|
-
const iosRoot =
|
|
73278
|
-
const entries2 =
|
|
73421
|
+
const nested = import_node_path82.default.join(projectRoot, "ios");
|
|
73422
|
+
const iosRoot = import_node_fs81.default.existsSync(nested) ? nested : projectRoot;
|
|
73423
|
+
const entries2 = import_node_fs81.default.readdirSync(iosRoot, { withFileTypes: true });
|
|
73279
73424
|
const projects2 = (entries2.some((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")) ? entries2.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcodeproj")).map((entry) => ({
|
|
73280
|
-
xcodeproj:
|
|
73425
|
+
xcodeproj: import_node_path82.default.join(iosRoot, entry.name),
|
|
73281
73426
|
workspace: null
|
|
73282
73427
|
})) : entries2.filter((entry) => entry.isDirectory() && entry.name.endsWith(".xcworkspace")).flatMap((entry) => {
|
|
73283
|
-
const workspace =
|
|
73428
|
+
const workspace = import_node_path82.default.join(iosRoot, entry.name);
|
|
73284
73429
|
return workspaceReferences(workspace).map((xcodeproj2) => ({
|
|
73285
73430
|
xcodeproj: xcodeproj2,
|
|
73286
73431
|
workspace
|
|
73287
73432
|
}));
|
|
73288
73433
|
}).filter(
|
|
73289
|
-
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(
|
|
73434
|
+
({ xcodeproj: xcodeproj2 }) => xcodeproj2.endsWith(".xcodeproj") && !xcodeproj2.split(import_node_path82.default.sep).includes("Pods") && import_node_fs81.default.existsSync(xcodeproj2)
|
|
73290
73435
|
).filter(
|
|
73291
73436
|
({ xcodeproj: xcodeproj2 }) => listXcodeAppTargets(xcodeproj2, { requireSources: false }).length > 0
|
|
73292
73437
|
)).map(({ xcodeproj: xcodeproj2, workspace }) => ({
|
|
73293
73438
|
xcodeproj: xcodeproj2,
|
|
73294
73439
|
workspace,
|
|
73295
|
-
name:
|
|
73440
|
+
name: import_node_path82.default.basename(xcodeproj2)
|
|
73296
73441
|
}));
|
|
73297
73442
|
if (projects2.length === 0) return null;
|
|
73298
73443
|
if (projects2.length > 1 && !iosTarget) {
|
|
@@ -73331,13 +73476,13 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
73331
73476
|
if (!target) throw new Error("native app identity has no iOS application target");
|
|
73332
73477
|
if (!iosTarget) {
|
|
73333
73478
|
const workspace = xcodeproj.replace(/\.xcodeproj$/, ".xcworkspace");
|
|
73334
|
-
const container =
|
|
73479
|
+
const container = import_node_fs81.default.existsSync(workspace) ? workspace : xcodeproj;
|
|
73335
73480
|
const hasScheme = [container, xcodeproj].some((dir) => {
|
|
73336
|
-
if (
|
|
73481
|
+
if (import_node_fs81.default.existsSync(import_node_path82.default.join(dir, "xcshareddata", "xcschemes", `${target}.xcscheme`)))
|
|
73337
73482
|
return true;
|
|
73338
|
-
const users =
|
|
73339
|
-
return
|
|
73340
|
-
(user) =>
|
|
73483
|
+
const users = import_node_path82.default.join(dir, "xcuserdata");
|
|
73484
|
+
return import_node_fs81.default.existsSync(users) && import_node_fs81.default.readdirSync(users).some(
|
|
73485
|
+
(user) => import_node_fs81.default.existsSync(import_node_path82.default.join(users, user, "xcschemes", `${target}.xcscheme`))
|
|
73341
73486
|
);
|
|
73342
73487
|
});
|
|
73343
73488
|
if (hasScheme) target = readXcodeScheme(container, target).target;
|
|
@@ -73349,7 +73494,7 @@ function selectIosAppTarget(projectRoot, iosTarget) {
|
|
|
73349
73494
|
return { xcodeproj, target, workspace: project2.workspace };
|
|
73350
73495
|
}
|
|
73351
73496
|
async function resolveXcodeSwiftPackages(input, signal, target, configuration) {
|
|
73352
|
-
if (
|
|
73497
|
+
if (import_node_fs81.default.existsSync(workspaceResolvedFile(import_node_fs81.default.realpathSync.native(input)))) return;
|
|
73353
73498
|
try {
|
|
73354
73499
|
readXcodeAppTarget(input, target, configuration, {
|
|
73355
73500
|
installedPods: true,
|
|
@@ -73368,7 +73513,7 @@ async function resolveXcodeSwiftPackages(input, signal, target, configuration) {
|
|
|
73368
73513
|
function readXcodeAppTarget(input, targetName, configurationName, options2 = {}) {
|
|
73369
73514
|
if (isBazelPackage(input))
|
|
73370
73515
|
return readBazelAppTarget(input, targetName, configurationName, options2);
|
|
73371
|
-
const xcodeprojOrWorkspace =
|
|
73516
|
+
const xcodeprojOrWorkspace = import_node_fs81.default.realpathSync.native(input);
|
|
73372
73517
|
const workspace = xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : null;
|
|
73373
73518
|
const { listed, projects: projects2, projectAt, cocoapods } = workspaceProjects(
|
|
73374
73519
|
xcodeprojOrWorkspace,
|
|
@@ -73379,7 +73524,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73379
73524
|
(ref) => options2.frameworkMachOType ? ref.target.name === targetName && FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") : isIosAppTarget(ref, options2) || targetName !== void 0 && ref.target.name === targetName && ref.target.productType === APP_EXTENSION
|
|
73380
73525
|
);
|
|
73381
73526
|
const appTargetNames = appTargets.map((ref) => str(ref.target.name) ?? ref.id);
|
|
73382
|
-
const container =
|
|
73527
|
+
const container = import_node_path82.default.basename(xcodeprojOrWorkspace);
|
|
73383
73528
|
const named = targetName ? appTargets.filter((ref) => ref.target.name === targetName) : appTargets;
|
|
73384
73529
|
if (named.length !== 1) {
|
|
73385
73530
|
if (options2.frameworkMachOType)
|
|
@@ -73408,15 +73553,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73408
73553
|
for (const ref of allTargets) {
|
|
73409
73554
|
const product = ref.project.object(str(ref.target.productReference));
|
|
73410
73555
|
const file = str(product?.path);
|
|
73411
|
-
if (file && !byProduct.has(
|
|
73412
|
-
byProduct.set(
|
|
73556
|
+
if (file && !byProduct.has(import_node_path82.default.basename(file)))
|
|
73557
|
+
byProduct.set(import_node_path82.default.basename(file), ref);
|
|
73413
73558
|
}
|
|
73414
73559
|
const proxied = (project2, proxyId) => {
|
|
73415
73560
|
const proxy = project2.object(proxyId);
|
|
73416
73561
|
if (proxy?.isa !== "PBXContainerItemProxy") return void 0;
|
|
73417
73562
|
const portal = str(proxy.containerPortal);
|
|
73418
73563
|
const portalPath = project2.resolvePath(portal ?? "");
|
|
73419
|
-
const owner = project2.object(portal)?.isa === "PBXProject" ? project2 : portalPath &&
|
|
73564
|
+
const owner = project2.object(portal)?.isa === "PBXProject" ? project2 : portalPath && import_node_fs81.default.existsSync(portalPath) ? projectAt.get(import_node_fs81.default.realpathSync.native(portalPath)) : void 0;
|
|
73420
73565
|
const remote = str(proxy.remoteGlobalIDString);
|
|
73421
73566
|
if (!owner || !remote) return void 0;
|
|
73422
73567
|
return projectTargets(owner).find(
|
|
@@ -73433,7 +73578,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73433
73578
|
const buildFile = project2.object(buildFileId);
|
|
73434
73579
|
if (!buildFile || !xcodeBuildFileBuildsForIos(buildFile)) continue;
|
|
73435
73580
|
const file = project2.object(str(buildFile.fileRef));
|
|
73436
|
-
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project2, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(
|
|
73581
|
+
const resolved = file?.isa === "PBXReferenceProxy" ? proxied(project2, str(file.remoteRef)) : file && str(file.sourceTree) === "BUILT_PRODUCTS_DIR" ? byProduct.get(import_node_path82.default.basename(str(file.path) ?? "")) : void 0;
|
|
73437
73582
|
if (resolved)
|
|
73438
73583
|
found.push({
|
|
73439
73584
|
target: resolved,
|
|
@@ -73514,7 +73659,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73514
73659
|
const otherProduct = productName(other);
|
|
73515
73660
|
for (const { file, visibility } of headerPhase(other)) {
|
|
73516
73661
|
if (visibility === "Project") continue;
|
|
73517
|
-
const key2 = `${otherProduct}/${
|
|
73662
|
+
const key2 = `${otherProduct}/${import_node_path82.default.basename(file)}`;
|
|
73518
73663
|
if (!headers.has(key2)) headers.set(key2, file);
|
|
73519
73664
|
}
|
|
73520
73665
|
}
|
|
@@ -73544,8 +73689,8 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73544
73689
|
ref.project.visitMembers(
|
|
73545
73690
|
ref.id,
|
|
73546
73691
|
ref.project.resolvePath,
|
|
73547
|
-
(file) => isDirectory3(file) ? walkFiles(file) :
|
|
73548
|
-
|
|
73692
|
+
(file) => isDirectory3(file) ? walkFiles(file) : import_node_fs81.default.existsSync(file) ? [file] : [],
|
|
73693
|
+
import_node_path82.default.join,
|
|
73549
73694
|
(file, kind) => {
|
|
73550
73695
|
if (kind === "header") found.push(file);
|
|
73551
73696
|
}
|
|
@@ -73561,12 +73706,12 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73561
73706
|
for (const ref of projectTargets(project2)) {
|
|
73562
73707
|
const product = productName(ref);
|
|
73563
73708
|
for (const { file, visibility } of headerPhase(ref)) {
|
|
73564
|
-
const name3 =
|
|
73709
|
+
const name3 = import_node_path82.default.basename(file);
|
|
73565
73710
|
if (!entries2.has(name3))
|
|
73566
73711
|
entries2.set(name3, visibility !== "Project" ? `${product}/${name3}` : file);
|
|
73567
73712
|
}
|
|
73568
73713
|
for (const file of synchronizedHeaders(ref)) {
|
|
73569
|
-
const name3 =
|
|
73714
|
+
const name3 = import_node_path82.default.basename(file);
|
|
73570
73715
|
if (!entries2.has(name3)) entries2.set(name3, file);
|
|
73571
73716
|
}
|
|
73572
73717
|
}
|
|
@@ -73576,7 +73721,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73576
73721
|
if (folder === null) continue;
|
|
73577
73722
|
for (const file of walkFiles(folder)) {
|
|
73578
73723
|
if (!HEADER_FILE.test(file)) continue;
|
|
73579
|
-
const name3 =
|
|
73724
|
+
const name3 = import_node_path82.default.basename(file);
|
|
73580
73725
|
if (!entries2.has(name3)) entries2.set(name3, file);
|
|
73581
73726
|
}
|
|
73582
73727
|
}
|
|
@@ -73584,18 +73729,18 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73584
73729
|
for (const id of Object.keys(project2.objects)) {
|
|
73585
73730
|
if (project2.object(id)?.isa !== "PBXFileReference") continue;
|
|
73586
73731
|
const file = project2.resolvePath(id);
|
|
73587
|
-
if (file && HEADER_FILE.test(file) && !entries2.has(
|
|
73588
|
-
entries2.set(
|
|
73732
|
+
if (file && HEADER_FILE.test(file) && !entries2.has(import_node_path82.default.basename(file)))
|
|
73733
|
+
entries2.set(import_node_path82.default.basename(file), file);
|
|
73589
73734
|
}
|
|
73590
73735
|
const map2 = [...entries2];
|
|
73591
73736
|
projectHeaderMaps.set(project2, map2);
|
|
73592
73737
|
return map2;
|
|
73593
73738
|
};
|
|
73594
73739
|
const xcconfigs = /* @__PURE__ */ new Set();
|
|
73595
|
-
const buildDir = (project2) =>
|
|
73740
|
+
const buildDir = (project2) => import_node_path82.default.join(project2.projectDir, ".build/peach-xcode/Build");
|
|
73596
73741
|
const workspaceBuild = {
|
|
73597
|
-
SYMROOT:
|
|
73598
|
-
OBJROOT:
|
|
73742
|
+
SYMROOT: import_node_path82.default.join(buildDir(app.project), "Products"),
|
|
73743
|
+
OBJROOT: import_node_path82.default.join(buildDir(app.project), "Intermediates.noindex")
|
|
73599
73744
|
};
|
|
73600
73745
|
const moduleTarget = (ref) => {
|
|
73601
73746
|
const name3 = str(ref.target.name) ?? ref.id;
|
|
@@ -73611,16 +73756,16 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73611
73756
|
TARGET_NAME: name3,
|
|
73612
73757
|
TARGETNAME: "$(TARGET_NAME)",
|
|
73613
73758
|
PROJECT: "$(PROJECT_NAME)",
|
|
73614
|
-
PROJECT_NAME:
|
|
73759
|
+
PROJECT_NAME: import_node_path82.default.basename(ref.project.xcodeproj, ".xcodeproj"),
|
|
73615
73760
|
PROJECT_CLASS_PREFIX: isDict(ref.project.project.attributes) ? str(ref.project.project.attributes.CLASSPREFIX) ?? "" : "",
|
|
73616
73761
|
PROJECT_FILE_PATH: ref.project.xcodeproj,
|
|
73617
73762
|
SRCROOT: ref.project.projectDir,
|
|
73618
73763
|
SOURCE_ROOT: ref.project.projectDir,
|
|
73619
73764
|
PROJECT_DIR: ref.project.projectDir,
|
|
73620
|
-
SYMROOT:
|
|
73765
|
+
SYMROOT: import_node_path82.default.join(buildDir(ref.project), "Products"),
|
|
73621
73766
|
BUILD_DIR: "$(SYMROOT)",
|
|
73622
73767
|
BUILD_ROOT: "$(SYMROOT)",
|
|
73623
|
-
OBJROOT:
|
|
73768
|
+
OBJROOT: import_node_path82.default.join(buildDir(ref.project), "Intermediates.noindex"),
|
|
73624
73769
|
CONFIGURATION_BUILD_DIR: "$(BUILD_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)",
|
|
73625
73770
|
BUILT_PRODUCTS_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
73626
73771
|
TARGET_BUILD_DIR: "$(CONFIGURATION_BUILD_DIR)",
|
|
@@ -73669,7 +73814,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73669
73814
|
xcconfigs
|
|
73670
73815
|
);
|
|
73671
73816
|
const searchRules = recursiveSearchRules(settings2);
|
|
73672
|
-
const absolute = (file) =>
|
|
73817
|
+
const absolute = (file) => import_node_path82.default.resolve(ref.project.projectDir, file);
|
|
73673
73818
|
const framework = FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "");
|
|
73674
73819
|
const product = settings2("PRODUCT_NAME");
|
|
73675
73820
|
const moduleName2 = applyOperator(settings2("PRODUCT_MODULE_NAME"), "c99extidentifier");
|
|
@@ -73700,7 +73845,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73700
73845
|
`${name3}: Swift compatibility header phase has no Swift producer sources`
|
|
73701
73846
|
);
|
|
73702
73847
|
const building2 = options2.prepareGeneratedSources && options2.requireSources !== false;
|
|
73703
|
-
const versioning = building2 && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ?
|
|
73848
|
+
const versioning = building2 && allSources.length > 0 && settings2("VERSIONING_SYSTEM") === "apple-generic" ? import_node_path82.default.join(settings2("DERIVED_FILE_DIR"), `${product}_vers.c`) : null;
|
|
73704
73849
|
if (versioning) {
|
|
73705
73850
|
const version2 = settings2("CURRENT_PROJECT_VERSION");
|
|
73706
73851
|
const custom = [
|
|
@@ -73713,7 +73858,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73713
73858
|
].filter((key2) => settings2(key2));
|
|
73714
73859
|
if (custom.length)
|
|
73715
73860
|
throw new Error(
|
|
73716
|
-
`${name3}: Xcode generates ${
|
|
73861
|
+
`${name3}: Xcode generates ${import_node_path82.default.basename(versioning)} with ${custom.join(", ")}; peach does not model VERSION_INFO_* overrides`
|
|
73717
73862
|
);
|
|
73718
73863
|
const symbol2 = product.replace(/^[^A-Za-z_]/, "_").replace(/[^A-Za-z0-9_]/g, "_");
|
|
73719
73864
|
const [major, minor] = version2.split(".");
|
|
@@ -73726,9 +73871,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73726
73871
|
` const double ${symbol2}VersionNumber __attribute__ ((used)) = (double)${number3};`,
|
|
73727
73872
|
""
|
|
73728
73873
|
].join("\n");
|
|
73729
|
-
if (!
|
|
73730
|
-
|
|
73731
|
-
|
|
73874
|
+
if (!import_node_fs81.default.existsSync(versioning) || import_node_fs81.default.readFileSync(versioning, "utf8") !== unit2) {
|
|
73875
|
+
import_node_fs81.default.mkdirSync(import_node_path82.default.dirname(versioning), { recursive: true });
|
|
73876
|
+
import_node_fs81.default.writeFileSync(versioning, unit2);
|
|
73732
73877
|
}
|
|
73733
73878
|
allSources.push(versioning);
|
|
73734
73879
|
}
|
|
@@ -73747,7 +73892,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73747
73892
|
const headerFiles3 = headerPhase(ref);
|
|
73748
73893
|
const ownHeaders = /* @__PURE__ */ new Map();
|
|
73749
73894
|
for (const { file, visibility } of headerFiles3) {
|
|
73750
|
-
const name4 =
|
|
73895
|
+
const name4 = import_node_path82.default.basename(file);
|
|
73751
73896
|
const published3 = visibility !== "Project";
|
|
73752
73897
|
if (!ownHeaders.has(name4))
|
|
73753
73898
|
ownHeaders.set(name4, published3 ? `${product}/${name4}` : file);
|
|
@@ -73755,35 +73900,35 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73755
73900
|
ownHeaders.set(`${product}/${name4}`, file);
|
|
73756
73901
|
}
|
|
73757
73902
|
for (const file of synchronizedHeaders(ref)) {
|
|
73758
|
-
const name4 =
|
|
73903
|
+
const name4 = import_node_path82.default.basename(file);
|
|
73759
73904
|
if (ownHeaders.has(name4)) continue;
|
|
73760
73905
|
ownHeaders.set(name4, file);
|
|
73761
73906
|
const qualified3 = `${product}/${name4}`;
|
|
73762
73907
|
if (!ownHeaders.has(qualified3)) ownHeaders.set(qualified3, file);
|
|
73763
73908
|
}
|
|
73764
73909
|
const nonFrameworkHeaders = nonFrameworkHeadersOf(ref.project);
|
|
73765
|
-
const wrapper =
|
|
73766
|
-
const publicHeaders =
|
|
73910
|
+
const wrapper = import_node_path82.default.join(settings2("BUILT_PRODUCTS_DIR"), `${product}.framework`);
|
|
73911
|
+
const publicHeaders = import_node_path82.default.resolve(
|
|
73767
73912
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
73768
|
-
settings2("PUBLIC_HEADERS_FOLDER_PATH") ||
|
|
73913
|
+
settings2("PUBLIC_HEADERS_FOLDER_PATH") || import_node_path82.default.join(wrapper, "Headers")
|
|
73769
73914
|
);
|
|
73770
|
-
const privateHeaders =
|
|
73915
|
+
const privateHeaders = import_node_path82.default.resolve(
|
|
73771
73916
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
73772
|
-
settings2("PRIVATE_HEADERS_FOLDER_PATH") ||
|
|
73917
|
+
settings2("PRIVATE_HEADERS_FOLDER_PATH") || import_node_path82.default.join(wrapper, "PrivateHeaders")
|
|
73773
73918
|
);
|
|
73774
73919
|
const moduleMap2 = (settings2("DEFINES_MODULE") === "YES" || !framework) && settings2("MODULEMAP_FILE") ? absolute(settings2("MODULEMAP_FILE")) : null;
|
|
73775
|
-
const frameworkUmbrella = !compatibility && framework && members2.sources.length > 0 && moduleMap2 ?
|
|
73776
|
-
const frameworkCompatibility = frameworkUmbrella && moduleMap2 &&
|
|
73920
|
+
const frameworkUmbrella = !compatibility && framework && members2.sources.length > 0 && moduleMap2 ? import_node_path82.default.join(import_node_path82.default.dirname(moduleMap2), `${moduleName2}-umbrella.h`) : null;
|
|
73921
|
+
const frameworkCompatibility = frameworkUmbrella && moduleMap2 && import_node_fs81.default.existsSync(moduleMap2) && import_node_fs81.default.existsSync(frameworkUmbrella) ? {
|
|
73777
73922
|
framework: true,
|
|
73778
73923
|
moduleMap: moduleMap2,
|
|
73779
73924
|
umbrella: frameworkUmbrella,
|
|
73780
|
-
outputModuleMap:
|
|
73781
|
-
outputUmbrella:
|
|
73925
|
+
outputModuleMap: import_node_path82.default.join(wrapper, "Modules", "module.modulemap"),
|
|
73926
|
+
outputUmbrella: import_node_path82.default.join(
|
|
73782
73927
|
wrapper,
|
|
73783
73928
|
"Headers",
|
|
73784
|
-
|
|
73929
|
+
import_node_path82.default.basename(frameworkUmbrella)
|
|
73785
73930
|
),
|
|
73786
|
-
outputHeader:
|
|
73931
|
+
outputHeader: import_node_path82.default.join(
|
|
73787
73932
|
wrapper,
|
|
73788
73933
|
"Headers",
|
|
73789
73934
|
settings2("SWIFT_OBJC_INTERFACE_HEADER_NAME") || `${moduleName2}-Swift.h`
|
|
@@ -73797,10 +73942,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73797
73942
|
outputUmbrella: compatibility.outputUmbrella,
|
|
73798
73943
|
outputHeader: compatibility.outputHeader
|
|
73799
73944
|
} : frameworkCompatibility;
|
|
73800
|
-
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap2 &&
|
|
73945
|
+
const podHeaders = !framework && isPodsProject(ref.project.xcodeproj) && moduleMap2 && import_node_path82.default.relative(import_node_path82.default.join(ref.project.projectDir, "Headers", "Public"), moduleMap2).split(import_node_path82.default.sep)[0] !== ".." && import_node_fs81.default.existsSync(moduleMap2) ? import_node_fs81.default.readdirSync(import_node_path82.default.dirname(moduleMap2)).flatMap((entry) => {
|
|
73801
73946
|
if (!/\.(h|hh|hpp|hxx|modulemap)$/.test(entry)) return [];
|
|
73802
|
-
const file =
|
|
73803
|
-
return
|
|
73947
|
+
const file = import_node_path82.default.join(import_node_path82.default.dirname(moduleMap2), entry);
|
|
73948
|
+
return import_node_fs81.default.existsSync(file) ? [file] : [];
|
|
73804
73949
|
}) : [];
|
|
73805
73950
|
const fileFlags = {};
|
|
73806
73951
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -73886,15 +74031,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73886
74031
|
// xcode searches its products' include directory before
|
|
73887
74032
|
// HEADER_SEARCH_PATHS and the target's derived sources after.
|
|
73888
74033
|
headerSearchPaths: [
|
|
73889
|
-
|
|
74034
|
+
import_node_path82.default.join(settings2("BUILT_PRODUCTS_DIR"), "include"),
|
|
73890
74035
|
...settingList(settings2("HEADER_SEARCH_PATHS")).flatMap(
|
|
73891
74036
|
(raw2) => expandSearchPath(absolute(raw2), searchRules)
|
|
73892
74037
|
),
|
|
73893
|
-
|
|
74038
|
+
import_node_path82.default.join(
|
|
73894
74039
|
`${settings2("DERIVED_FILE_DIR")}-normal`,
|
|
73895
74040
|
settings2("CURRENT_ARCH")
|
|
73896
74041
|
),
|
|
73897
|
-
|
|
74042
|
+
import_node_path82.default.join(settings2("DERIVED_FILE_DIR"), settings2("CURRENT_ARCH")),
|
|
73898
74043
|
settings2("DERIVED_FILE_DIR")
|
|
73899
74044
|
],
|
|
73900
74045
|
userHeaderSearchPaths: settingList(
|
|
@@ -73944,9 +74089,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73944
74089
|
...headerFiles3.flatMap(
|
|
73945
74090
|
({ file, visibility }) => visibility === "Project" ? [] : [
|
|
73946
74091
|
[
|
|
73947
|
-
|
|
74092
|
+
import_node_path82.default.join(
|
|
73948
74093
|
visibility === "Public" ? publicHeaders : privateHeaders,
|
|
73949
|
-
|
|
74094
|
+
import_node_path82.default.basename(file)
|
|
73950
74095
|
),
|
|
73951
74096
|
file
|
|
73952
74097
|
]
|
|
@@ -73968,17 +74113,17 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73968
74113
|
);
|
|
73969
74114
|
return file && HEADER_FILE.test(file) ? [
|
|
73970
74115
|
[
|
|
73971
|
-
|
|
74116
|
+
import_node_path82.default.resolve(
|
|
73972
74117
|
settings2("BUILT_PRODUCTS_DIR"),
|
|
73973
74118
|
destination,
|
|
73974
|
-
|
|
74119
|
+
import_node_path82.default.basename(file)
|
|
73975
74120
|
),
|
|
73976
74121
|
file
|
|
73977
74122
|
]
|
|
73978
74123
|
] : [];
|
|
73979
74124
|
});
|
|
73980
74125
|
}),
|
|
73981
|
-
...moduleMap2 ? [[
|
|
74126
|
+
...moduleMap2 ? [[import_node_path82.default.join(wrapper, "Modules", "module.modulemap"), moduleMap2]] : []
|
|
73982
74127
|
]) : Object.fromEntries([
|
|
73983
74128
|
...podHeaders.map((file) => [file, file]),
|
|
73984
74129
|
...moduleMap2 ? [[moduleMap2, moduleMap2]] : []
|
|
@@ -73989,6 +74134,49 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
73989
74134
|
};
|
|
73990
74135
|
};
|
|
73991
74136
|
const builtTargets = order.map((ref) => ({ ref, ...moduleTarget(ref) }));
|
|
74137
|
+
const xcframeworkCopies = builtTargets.flatMap(
|
|
74138
|
+
({ ref, settings: settings2 }) => list(ref.target.buildPhases).flatMap((phaseId) => {
|
|
74139
|
+
const phase = ref.project.object(phaseId);
|
|
74140
|
+
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy XCFrameworks")
|
|
74141
|
+
return [];
|
|
74142
|
+
const absolute = (raw2) => import_node_path82.default.resolve(ref.project.projectDir, expand(raw2, settings2));
|
|
74143
|
+
const files2 = (paths, lists) => [
|
|
74144
|
+
...list(paths).map(absolute),
|
|
74145
|
+
...list(lists).flatMap((raw2) => {
|
|
74146
|
+
const file = absolute(raw2);
|
|
74147
|
+
if (!import_node_fs81.default.existsSync(file)) return [];
|
|
74148
|
+
xcconfigs.add(file);
|
|
74149
|
+
return fileListEntries(file, absolute);
|
|
74150
|
+
})
|
|
74151
|
+
];
|
|
74152
|
+
const destinations = new Set(
|
|
74153
|
+
files2(phase.outputPaths, phase.outputFileListPaths).map(
|
|
74154
|
+
(file) => import_node_path82.default.dirname(file)
|
|
74155
|
+
)
|
|
74156
|
+
);
|
|
74157
|
+
const slices = files2(phase.inputPaths, phase.inputFileListPaths).flatMap(
|
|
74158
|
+
(file) => file.endsWith(".xcframework") && import_node_fs81.default.existsSync(file) ? [simulatorNativeLibrary(file)?.slice ?? []].flat() : []
|
|
74159
|
+
);
|
|
74160
|
+
return destinations.size === 1 && slices.length > 0 ? [{ destination: [...destinations][0], slices }] : [];
|
|
74161
|
+
})
|
|
74162
|
+
);
|
|
74163
|
+
const copiedSearchPath = (directory2) => {
|
|
74164
|
+
for (const { destination, slices } of xcframeworkCopies) {
|
|
74165
|
+
const rest = relativeInside(destination, directory2);
|
|
74166
|
+
if (rest === null) continue;
|
|
74167
|
+
const found = slices.map((slice) => import_node_path82.default.join(slice, rest)).filter((candidate) => isDirectory3(candidate));
|
|
74168
|
+
if (found.length) return found;
|
|
74169
|
+
}
|
|
74170
|
+
return [directory2];
|
|
74171
|
+
};
|
|
74172
|
+
if (xcframeworkCopies.length)
|
|
74173
|
+
for (const { module: module3 } of builtTargets) {
|
|
74174
|
+
const objc = module3.objc;
|
|
74175
|
+
if (!objc) continue;
|
|
74176
|
+
objc.headerSearchPaths = objc.headerSearchPaths.flatMap(copiedSearchPath);
|
|
74177
|
+
objc.userHeaderSearchPaths = objc.userHeaderSearchPaths.flatMap(copiedSearchPath);
|
|
74178
|
+
objc.frameworkSearchPaths = objc.frameworkSearchPaths.flatMap(copiedSearchPath);
|
|
74179
|
+
}
|
|
73992
74180
|
for (const { ref, module: module3, settings: settings2 } of builtTargets)
|
|
73993
74181
|
module3.targetDependencies = [
|
|
73994
74182
|
.../* @__PURE__ */ new Set([
|
|
@@ -74017,7 +74205,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74017
74205
|
const generate = settings2("GENERATE_INFOPLIST_FILE") === "YES";
|
|
74018
74206
|
if (!FRAMEWORK_PRODUCTS.has(str(ref.target.productType) ?? "") || !plistSetting && !generate || module3.generatedInfoPlist && !options2.prepareGeneratedSources)
|
|
74019
74207
|
return { ref, framework: module3 };
|
|
74020
|
-
const file = plistSetting ?
|
|
74208
|
+
const file = plistSetting ? import_node_path82.default.resolve(ref.project.projectDir, plistSetting) : null;
|
|
74021
74209
|
if (file) xcconfigs.add(file);
|
|
74022
74210
|
const info2 = processedInfoPlist(module3.name, file, productSettings2, keys);
|
|
74023
74211
|
if (generate) {
|
|
@@ -74033,7 +74221,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74033
74221
|
});
|
|
74034
74222
|
const frameworks = frameworkTargets.map(({ framework }) => framework);
|
|
74035
74223
|
const podSourceDirs = builtTargets.slice(0, -1).flatMap(
|
|
74036
|
-
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) =>
|
|
74224
|
+
({ ref, module: module3 }) => isPodsProject(ref.project.xcodeproj) ? [...module3.allSources, ...module3.objc?.headers ?? []].map((file) => import_node_path82.default.dirname(file)).filter((dir) => import_node_fs81.default.existsSync(dir)) : []
|
|
74037
74225
|
);
|
|
74038
74226
|
const resourceProducts = [];
|
|
74039
74227
|
const bundleTargets = builtTargets.filter(
|
|
@@ -74044,7 +74232,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74044
74232
|
const phase = owner.ref.project.object(phaseId);
|
|
74045
74233
|
if (phase?.isa !== "PBXShellScriptBuildPhase" || str(phase.name) !== "[CP] Copy Pods Resources")
|
|
74046
74234
|
continue;
|
|
74047
|
-
const absolute = (raw2) =>
|
|
74235
|
+
const absolute = (raw2) => import_node_path82.default.resolve(owner.ref.project.projectDir, expand(raw2, owner.settings));
|
|
74048
74236
|
const entries2 = (paths) => paths.flatMap((raw2) => {
|
|
74049
74237
|
const file = absolute(raw2);
|
|
74050
74238
|
xcconfigs.add(file);
|
|
@@ -74060,7 +74248,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74060
74248
|
].filter((file) => file.endsWith(".bundle"));
|
|
74061
74249
|
if (inputs2.length !== outputs.length)
|
|
74062
74250
|
throw new Error(`${owner.module.name}: resource bundle copy lists differ`);
|
|
74063
|
-
const destinationRoot =
|
|
74251
|
+
const destinationRoot = import_node_path82.default.join(
|
|
74064
74252
|
owner.settings("TARGET_BUILD_DIR"),
|
|
74065
74253
|
owner.settings("UNLOCALIZED_RESOURCES_FOLDER_PATH")
|
|
74066
74254
|
);
|
|
@@ -74069,24 +74257,24 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74069
74257
|
const file = str(
|
|
74070
74258
|
target.ref.project.object(str(target.ref.target.productReference))?.path
|
|
74071
74259
|
);
|
|
74072
|
-
return file &&
|
|
74260
|
+
return file && import_node_path82.default.join(target.settings("TARGET_BUILD_DIR"), file) === input2;
|
|
74073
74261
|
});
|
|
74074
74262
|
if (!product && !isDirectory3(input2))
|
|
74075
74263
|
throw new Error(
|
|
74076
74264
|
`${owner.module.name}: resource bundle input has no selected producer: ${input2}`
|
|
74077
74265
|
);
|
|
74078
|
-
const destination =
|
|
74079
|
-
if (destination === ".." || destination.startsWith(`..${
|
|
74266
|
+
const destination = import_node_path82.default.relative(destinationRoot, outputs[index]);
|
|
74267
|
+
if (destination === ".." || destination.startsWith(`..${import_node_path82.default.sep}`) || import_node_path82.default.isAbsolute(destination) || import_node_path82.default.basename(input2) !== import_node_path82.default.basename(destination))
|
|
74080
74268
|
throw new Error(
|
|
74081
74269
|
`${owner.module.name}: invalid resource bundle copy destination`
|
|
74082
74270
|
);
|
|
74083
|
-
const infoFile = product ?
|
|
74271
|
+
const infoFile = product ? import_node_path82.default.resolve(
|
|
74084
74272
|
product.ref.project.projectDir,
|
|
74085
74273
|
product.settings("INFOPLIST_FILE")
|
|
74086
74274
|
) : null;
|
|
74087
74275
|
if (infoFile) xcconfigs.add(infoFile);
|
|
74088
74276
|
const prefix = owner.ref === app ? "" : `Frameworks/${owner.module.moduleName}.framework/`;
|
|
74089
|
-
const bundlePath = prefix + destination.split(
|
|
74277
|
+
const bundlePath = prefix + destination.split(import_node_path82.default.sep).join("/");
|
|
74090
74278
|
if (resourceProducts.some((resource) => resource.path === bundlePath))
|
|
74091
74279
|
throw new Error(
|
|
74092
74280
|
`${owner.module.name}: duplicate resource bundle destination ${bundlePath}`
|
|
@@ -74097,20 +74285,20 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74097
74285
|
resources: product.module.resources,
|
|
74098
74286
|
infoPlist: buildPlist(
|
|
74099
74287
|
expandValue(
|
|
74100
|
-
parsePlist(
|
|
74288
|
+
parsePlist(import_node_fs81.default.readFileSync(infoFile, "utf8")),
|
|
74101
74289
|
product.productSettings
|
|
74102
74290
|
)
|
|
74103
74291
|
)
|
|
74104
74292
|
} : {
|
|
74105
|
-
resources:
|
|
74293
|
+
resources: import_node_fs81.default.readdirSync(input2, { recursive: true, withFileTypes: true }).filter((entry) => entry.isFile()).map((entry) => import_node_path82.default.join(entry.parentPath, entry.name)).sort(),
|
|
74106
74294
|
sourceRoot: input2
|
|
74107
74295
|
}
|
|
74108
74296
|
});
|
|
74109
74297
|
}
|
|
74110
74298
|
}
|
|
74111
74299
|
}
|
|
74112
|
-
const infoPlistFile = settings("INFOPLIST_FILE") ?
|
|
74113
|
-
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ?
|
|
74300
|
+
const infoPlistFile = settings("INFOPLIST_FILE") ? import_node_path82.default.resolve(app.project.projectDir, settings("INFOPLIST_FILE")) : null;
|
|
74301
|
+
const entitlementsFile = settings("CODE_SIGN_ENTITLEMENTS") ? import_node_path82.default.resolve(app.project.projectDir, settings("CODE_SIGN_ENTITLEMENTS")) : null;
|
|
74114
74302
|
const infoPlistPending = module2.generatedInfoPlist && !options2.prepareGeneratedSources;
|
|
74115
74303
|
const info = processedInfoPlist(
|
|
74116
74304
|
module2.name,
|
|
@@ -74119,7 +74307,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74119
74307
|
settingKeys
|
|
74120
74308
|
);
|
|
74121
74309
|
const bundleIdentifier = productSettings("PRODUCT_BUNDLE_IDENTIFIER") || (typeof info.CFBundleIdentifier === "string" ? info.CFBundleIdentifier : "");
|
|
74122
|
-
const entitlements = entitlementsFile ? parsePlist(
|
|
74310
|
+
const entitlements = entitlementsFile ? parsePlist(import_node_fs81.default.readFileSync(entitlementsFile, "utf8")) : void 0;
|
|
74123
74311
|
const keychainAccessGroups = entitlementsFile ? readKeychainAccessGroups(
|
|
74124
74312
|
entitlements,
|
|
74125
74313
|
(value) => expand(value, (key2) => {
|
|
@@ -74157,7 +74345,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74157
74345
|
};
|
|
74158
74346
|
}
|
|
74159
74347
|
const localPackageDirs = [
|
|
74160
|
-
...listed.filter((reference) =>
|
|
74348
|
+
...listed.filter((reference) => import_node_fs81.default.existsSync(import_node_path82.default.join(reference, "Package.swift"))),
|
|
74161
74349
|
...projects2.flatMap(
|
|
74162
74350
|
(project2) => Object.entries(project2.objects).flatMap(([id, entry]) => {
|
|
74163
74351
|
if (!isDict(entry)) return [];
|
|
@@ -74167,19 +74355,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74167
74355
|
const packages = [];
|
|
74168
74356
|
while (pending2.length > 0) {
|
|
74169
74357
|
const dir = pending2.pop();
|
|
74170
|
-
if (
|
|
74358
|
+
if (import_node_fs81.default.existsSync(import_node_path82.default.join(dir, "Package.swift"))) {
|
|
74171
74359
|
packages.push(dir);
|
|
74172
74360
|
continue;
|
|
74173
74361
|
}
|
|
74174
74362
|
if (!isDirectory3(dir)) continue;
|
|
74175
|
-
for (const child of
|
|
74363
|
+
for (const child of import_node_fs81.default.readdirSync(dir, { withFileTypes: true }))
|
|
74176
74364
|
if (child.isDirectory() && !child.name.startsWith("."))
|
|
74177
|
-
pending2.push(
|
|
74365
|
+
pending2.push(import_node_path82.default.join(dir, child.name));
|
|
74178
74366
|
}
|
|
74179
74367
|
return packages;
|
|
74180
74368
|
}
|
|
74181
|
-
const candidate = entry.isa === "XCLocalSwiftPackageReference" ?
|
|
74182
|
-
return candidate &&
|
|
74369
|
+
const candidate = entry.isa === "XCLocalSwiftPackageReference" ? import_node_path82.default.resolve(project2.projectDir, str(entry.relativePath) ?? "") : entry.isa === "PBXFileReference" ? project2.resolvePath(id) : null;
|
|
74370
|
+
return candidate && import_node_fs81.default.existsSync(import_node_path82.default.join(candidate, "Package.swift")) ? [candidate] : [];
|
|
74183
74371
|
})
|
|
74184
74372
|
)
|
|
74185
74373
|
];
|
|
@@ -74209,7 +74397,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74209
74397
|
if ((flag === "-framework" || flag === "-weak_framework") && name3)
|
|
74210
74398
|
sdkFrameworks.add(name3);
|
|
74211
74399
|
});
|
|
74212
|
-
const absolute = (raw2) =>
|
|
74400
|
+
const absolute = (raw2) => import_node_path82.default.resolve(ref.project.projectDir, expand(raw2, settings2));
|
|
74213
74401
|
const requested = options2.nativeModules;
|
|
74214
74402
|
const includeBinary = (name3, dir) => {
|
|
74215
74403
|
if (!requested || nativeTargets2.has(ref) || requested.includes(name3) || dir.endsWith(".xcframework") && localSwiftBinaryModules(dir).some((module3) => requested.includes(module3)))
|
|
@@ -74221,14 +74409,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74221
74409
|
for (const directory2 of expandSearchPath(absolute(raw2), searchRules)) {
|
|
74222
74410
|
if (frameworkSearchDirectories.has(directory2)) continue;
|
|
74223
74411
|
frameworkSearchDirectories.add(directory2);
|
|
74224
|
-
if (!
|
|
74412
|
+
if (!import_node_fs81.default.statSync(directory2, { throwIfNoEntry: false })?.isDirectory() || /\.sdk\/(?:System|Developer)\/Library\/Frameworks\/?$/.test(directory2))
|
|
74225
74413
|
continue;
|
|
74226
|
-
for (const entry of
|
|
74414
|
+
for (const entry of import_node_fs81.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
74227
74415
|
const name3 = /^(.+)\.framework$/.exec(entry.name)?.[1];
|
|
74228
74416
|
if (!name3 || byProduct.has(entry.name) || searchedFrameworks.has(name3))
|
|
74229
74417
|
continue;
|
|
74230
|
-
const file =
|
|
74231
|
-
if (
|
|
74418
|
+
const file = import_node_path82.default.join(directory2, entry.name);
|
|
74419
|
+
if (import_node_fs81.default.statSync(file, { throwIfNoEntry: false })?.isDirectory())
|
|
74232
74420
|
searchedFrameworks.set(name3, file);
|
|
74233
74421
|
}
|
|
74234
74422
|
}
|
|
@@ -74236,9 +74424,9 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74236
74424
|
}
|
|
74237
74425
|
for (const raw2 of settingList(settings2("SWIFT_INCLUDE_PATHS"))) {
|
|
74238
74426
|
const dir = absolute(raw2);
|
|
74239
|
-
const modulemap =
|
|
74240
|
-
if (!
|
|
74241
|
-
const name3 = moduleMapName(
|
|
74427
|
+
const modulemap = import_node_path82.default.join(dir, "module.modulemap");
|
|
74428
|
+
if (!import_node_fs81.default.existsSync(modulemap)) continue;
|
|
74429
|
+
const name3 = moduleMapName(import_node_fs81.default.readFileSync(modulemap, "utf8"));
|
|
74242
74430
|
if (name3 && !binaryFrameworks.has(name3)) includeBinary(name3, dir);
|
|
74243
74431
|
}
|
|
74244
74432
|
for (const phaseId of list(ref.target.buildPhases)) {
|
|
@@ -74247,7 +74435,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74247
74435
|
const inputs2 = list(phase.inputPaths).map(absolute);
|
|
74248
74436
|
for (const raw2 of list(phase.inputFileListPaths)) {
|
|
74249
74437
|
const file = absolute(raw2);
|
|
74250
|
-
if (!
|
|
74438
|
+
if (!import_node_fs81.default.existsSync(file)) continue;
|
|
74251
74439
|
xcconfigs.add(file);
|
|
74252
74440
|
inputs2.push(...fileListEntries(file, absolute));
|
|
74253
74441
|
}
|
|
@@ -74312,7 +74500,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74312
74500
|
...productAttributes.get(dependencyId)?.length ? { attributes: productAttributes.get(dependencyId) } : {},
|
|
74313
74501
|
source: reference?.isa === "XCRemoteSwiftPackageReference" ? { kind: "remote", url: str(reference.repositoryURL) ?? "" } : reference?.isa === "XCLocalSwiftPackageReference" ? {
|
|
74314
74502
|
kind: "local",
|
|
74315
|
-
dir:
|
|
74503
|
+
dir: import_node_path82.default.resolve(
|
|
74316
74504
|
project2.projectDir,
|
|
74317
74505
|
str(reference.relativePath) ?? ""
|
|
74318
74506
|
)
|
|
@@ -74346,14 +74534,14 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74346
74534
|
continue;
|
|
74347
74535
|
}
|
|
74348
74536
|
if (tree2 === "BUILT_PRODUCTS_DIR" || tree2 === "DEVELOPER_DIR" || // a target in the workspace builds it, so it exists only after that build
|
|
74349
|
-
byProduct.has(
|
|
74537
|
+
byProduct.has(import_node_path82.default.basename(rawPath)))
|
|
74350
74538
|
continue;
|
|
74351
74539
|
const resolved = fileId ? project2.resolvePath(fileId) : null;
|
|
74352
|
-
if (fileId && resolved !== null && !
|
|
74353
|
-
const parts = resolved.split(
|
|
74540
|
+
if (fileId && resolved !== null && !import_node_fs81.default.existsSync(resolved)) {
|
|
74541
|
+
const parts = resolved.split(import_node_path82.default.sep);
|
|
74354
74542
|
const pods = parts.lastIndexOf("Pods");
|
|
74355
|
-
const sandbox = parts.slice(0, pods + 1).join(
|
|
74356
|
-
if (!options2.installedPods && options2.requireSources === false && pods > 0 &&
|
|
74543
|
+
const sandbox = parts.slice(0, pods + 1).join(import_node_path82.default.sep);
|
|
74544
|
+
if (!options2.installedPods && options2.requireSources === false && pods > 0 && import_node_fs81.default.existsSync(import_node_path82.default.join(import_node_path82.default.dirname(sandbox), "Podfile")))
|
|
74357
74545
|
continue;
|
|
74358
74546
|
if (!ios_sdk_frameworks_default.frameworks.includes(name3))
|
|
74359
74547
|
throw new Error(
|
|
@@ -74381,7 +74569,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74381
74569
|
({ product }) => !options2.nativeModules || nativeTargets2.has(built2.ref) || options2.nativeModules.includes(product)
|
|
74382
74570
|
);
|
|
74383
74571
|
const resolvedFile = workspaceResolvedFile(xcodeprojOrWorkspace);
|
|
74384
|
-
let packageResolved =
|
|
74572
|
+
let packageResolved = import_node_fs81.default.existsSync(resolvedFile) ? [import_node_fs81.default.realpathSync.native(resolvedFile)] : [...new Set(localPackageDirs.map((dir) => import_node_path82.default.join(dir, "Package.resolved")))].filter((file) => import_node_fs81.default.existsSync(file)).map((file) => import_node_fs81.default.realpathSync.native(file)).sort();
|
|
74385
74573
|
if (packageResolved.length === 0) {
|
|
74386
74574
|
const requirements = remotePackageRequirements(projects2);
|
|
74387
74575
|
if (requirements.length > 0) {
|
|
@@ -74437,19 +74625,19 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74437
74625
|
} : {},
|
|
74438
74626
|
rootDir: commonAncestor(
|
|
74439
74627
|
[
|
|
74440
|
-
workspace ?
|
|
74628
|
+
workspace ? import_node_path82.default.dirname(workspace) : app.project.projectDir,
|
|
74441
74629
|
...used.map((project2) => project2.projectDir),
|
|
74442
74630
|
...localPackageDirs,
|
|
74443
74631
|
...linkedProducts.flatMap(
|
|
74444
|
-
({ source }) => source.kind === "local" &&
|
|
74632
|
+
({ source }) => source.kind === "local" && import_node_fs81.default.existsSync(source.dir) ? [source.dir] : []
|
|
74445
74633
|
),
|
|
74446
74634
|
...new Set(podSourceDirs),
|
|
74447
74635
|
// a target's own files may sit beside the project, such as an asset
|
|
74448
74636
|
// catalog one folder up, and xcode builds them from there
|
|
74449
74637
|
...new Set(
|
|
74450
|
-
[...module2.allSources, ...module2.resources].filter((file) =>
|
|
74638
|
+
[...module2.allSources, ...module2.resources].filter((file) => import_node_fs81.default.existsSync(file)).map((file) => import_node_path82.default.dirname(file))
|
|
74451
74639
|
)
|
|
74452
|
-
].map((dir) =>
|
|
74640
|
+
].map((dir) => import_node_fs81.default.realpathSync.native(dir))
|
|
74453
74641
|
),
|
|
74454
74642
|
projectFiles: [
|
|
74455
74643
|
.../* @__PURE__ */ new Set([
|
|
@@ -74475,7 +74663,7 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74475
74663
|
resourceProducts,
|
|
74476
74664
|
linkedProducts,
|
|
74477
74665
|
localPackageDirs: [
|
|
74478
|
-
...new Set(localPackageDirs.map((dir) =>
|
|
74666
|
+
...new Set(localPackageDirs.map((dir) => import_node_fs81.default.realpathSync.native(dir)))
|
|
74479
74667
|
].sort(),
|
|
74480
74668
|
binaryFrameworks: [...binaryFrameworks].map(([name3, file]) => ({ name: name3, path: file })).sort((left, right) => left.name.localeCompare(right.name)),
|
|
74481
74669
|
sdkFrameworks: [...sdkFrameworks].filter(
|
|
@@ -74488,15 +74676,15 @@ function readXcodeAppTarget(input, targetName, configurationName, options2 = {})
|
|
|
74488
74676
|
cocoapods
|
|
74489
74677
|
};
|
|
74490
74678
|
}
|
|
74491
|
-
var import_node_child_process42, import_node_crypto49,
|
|
74679
|
+
var import_node_child_process42, import_node_crypto49, import_node_fs81, import_node_module5, import_node_path82, XCODE_DEFAULT_IOS_DEPLOYMENT_TARGET, runScriptTimeoutMs, CXX_STANDARD_ALIASES, PRE_CXX20_STANDARDS, APPLICATION, APP_EXTENSION, RESOURCE_BUNDLE, PRODUCT_MACH_O_TYPES, FRAMEWORK_PRODUCTS, HEADER_FILE, MODULE_PRODUCTS, CONDITIONS, isDirectory3, loaded3, developerDir, preparedSourcePhases, isPodsProject, targetRefs, NativeAppTargetSelectionError, workspaceResolvedFile, SwiftPackageResolutionRequired;
|
|
74492
74680
|
var init_xcode_project = __esm({
|
|
74493
74681
|
"src/xcode-project.ts"() {
|
|
74494
74682
|
"use strict";
|
|
74495
74683
|
import_node_child_process42 = require("node:child_process");
|
|
74496
74684
|
import_node_crypto49 = require("node:crypto");
|
|
74497
|
-
|
|
74685
|
+
import_node_fs81 = __toESM(require("node:fs"), 1);
|
|
74498
74686
|
import_node_module5 = require("node:module");
|
|
74499
|
-
|
|
74687
|
+
import_node_path82 = __toESM(require("node:path"), 1);
|
|
74500
74688
|
init_bazel_project();
|
|
74501
74689
|
init_ios_sdk_frameworks();
|
|
74502
74690
|
init_is_record();
|
|
@@ -74508,7 +74696,9 @@ var init_xcode_project = __esm({
|
|
|
74508
74696
|
init_swift_distribution();
|
|
74509
74697
|
init_swift_native_pin();
|
|
74510
74698
|
init_swift_package();
|
|
74699
|
+
init_swift_source_file();
|
|
74511
74700
|
init_swift_toolchain();
|
|
74701
|
+
init_swift_xcframework();
|
|
74512
74702
|
init_xcode_intents();
|
|
74513
74703
|
init_xcode_json_project();
|
|
74514
74704
|
init_xcode_swift_features();
|
|
@@ -74561,15 +74751,15 @@ var init_xcode_project = __esm({
|
|
|
74561
74751
|
arch: "arm64",
|
|
74562
74752
|
variant: "normal"
|
|
74563
74753
|
};
|
|
74564
|
-
isDirectory3 = (dir) =>
|
|
74754
|
+
isDirectory3 = (dir) => import_node_fs81.default.existsSync(dir) && import_node_fs81.default.statSync(dir).isDirectory();
|
|
74565
74755
|
loaded3 = /* @__PURE__ */ new Map();
|
|
74566
74756
|
preparedSourcePhases = /* @__PURE__ */ new Map();
|
|
74567
|
-
isPodsProject = (xcodeproj) =>
|
|
74757
|
+
isPodsProject = (xcodeproj) => import_node_path82.default.basename(xcodeproj) === "Pods.xcodeproj" && import_node_path82.default.basename(import_node_path82.default.dirname(xcodeproj)) === "Pods";
|
|
74568
74758
|
targetRefs = /* @__PURE__ */ new WeakMap();
|
|
74569
74759
|
NativeAppTargetSelectionError = class extends Error {
|
|
74570
74760
|
};
|
|
74571
|
-
workspaceResolvedFile = (xcodeprojOrWorkspace) =>
|
|
74572
|
-
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace :
|
|
74761
|
+
workspaceResolvedFile = (xcodeprojOrWorkspace) => import_node_path82.default.join(
|
|
74762
|
+
xcodeprojOrWorkspace.endsWith(".xcworkspace") ? xcodeprojOrWorkspace : import_node_path82.default.join(xcodeprojOrWorkspace, "project.xcworkspace"),
|
|
74573
74763
|
"xcshareddata",
|
|
74574
74764
|
"swiftpm",
|
|
74575
74765
|
"Package.resolved"
|
|
@@ -74605,7 +74795,7 @@ function workspacePackageManager(root, declared, excluded) {
|
|
|
74605
74795
|
{ manager: "yarn", files: ["yarn.lock"] },
|
|
74606
74796
|
{ manager: "npm", files: ["package-lock.json"] }
|
|
74607
74797
|
].filter(
|
|
74608
|
-
({ files: files2 }) => files2.some((file) => !excluded(file) &&
|
|
74798
|
+
({ files: files2 }) => files2.some((file) => !excluded(file) && import_node_fs82.default.existsSync(import_node_path83.default.join(root, file)))
|
|
74609
74799
|
);
|
|
74610
74800
|
if (locks.length !== 1) return manager;
|
|
74611
74801
|
const lockedManager = locks[0].manager;
|
|
@@ -74619,9 +74809,9 @@ function pinnedNodeVersion(root, manifest) {
|
|
|
74619
74809
|
return exactVersionFile(root, ".nvmrc") ?? exactVersionFile(root, ".node-version");
|
|
74620
74810
|
}
|
|
74621
74811
|
function exactVersionFile(root, name3) {
|
|
74622
|
-
const file =
|
|
74623
|
-
if (!
|
|
74624
|
-
const version2 =
|
|
74812
|
+
const file = import_node_path83.default.join(root, name3);
|
|
74813
|
+
if (!import_node_fs82.default.existsSync(file)) return null;
|
|
74814
|
+
const version2 = import_node_fs82.default.readFileSync(file, "utf8").trim().replace(/^v/, "");
|
|
74625
74815
|
return EXACT_VERSION.test(version2) ? version2 : null;
|
|
74626
74816
|
}
|
|
74627
74817
|
async function hashExpoWorkspace(app, signal) {
|
|
@@ -74633,15 +74823,15 @@ async function hashExpoSourceWorkspace(app, signal) {
|
|
|
74633
74823
|
return { root, hash };
|
|
74634
74824
|
}
|
|
74635
74825
|
function pnpmStoreArgs(root) {
|
|
74636
|
-
const modules =
|
|
74637
|
-
if (!
|
|
74826
|
+
const modules = import_node_path83.default.join(root, "node_modules", ".modules.yaml");
|
|
74827
|
+
if (!import_node_fs82.default.existsSync(modules)) return [];
|
|
74638
74828
|
const store = /^\s*"?storeDir"?:\s*["']?([^"'\n,]+)/m.exec(
|
|
74639
|
-
|
|
74829
|
+
import_node_fs82.default.readFileSync(modules, "utf8")
|
|
74640
74830
|
);
|
|
74641
74831
|
return store ? ["--store-dir", store[1]] : [];
|
|
74642
74832
|
}
|
|
74643
74833
|
function linkedPackageDirectories(root, app) {
|
|
74644
|
-
const appRelative =
|
|
74834
|
+
const appRelative = import_node_path83.default.relative(root, app);
|
|
74645
74835
|
return localPackageDirectories(root, app).filter(
|
|
74646
74836
|
(directory2) => directory2 !== "" && directory2 !== appRelative
|
|
74647
74837
|
);
|
|
@@ -74649,11 +74839,11 @@ function linkedPackageDirectories(root, app) {
|
|
|
74649
74839
|
function localPackageDirectories(root, app) {
|
|
74650
74840
|
const directories = /* @__PURE__ */ new Set();
|
|
74651
74841
|
const visit3 = (directory2) => {
|
|
74652
|
-
const relative4 =
|
|
74842
|
+
const relative4 = import_node_path83.default.relative(root, directory2);
|
|
74653
74843
|
if (directories.has(relative4)) return;
|
|
74654
74844
|
directories.add(relative4);
|
|
74655
74845
|
const manifest = JSON.parse(
|
|
74656
|
-
|
|
74846
|
+
import_node_fs82.default.readFileSync(import_node_path83.default.join(directory2, "package.json"), "utf8")
|
|
74657
74847
|
);
|
|
74658
74848
|
for (const name3 of Object.keys({
|
|
74659
74849
|
...manifest.dependencies,
|
|
@@ -74661,12 +74851,12 @@ function localPackageDirectories(root, app) {
|
|
|
74661
74851
|
...manifest.peerDependencies,
|
|
74662
74852
|
...manifest.optionalDependencies
|
|
74663
74853
|
})) {
|
|
74664
|
-
for (let at = directory2; ; at =
|
|
74665
|
-
const link =
|
|
74666
|
-
if (
|
|
74667
|
-
const target =
|
|
74668
|
-
const within2 =
|
|
74669
|
-
if (!within2.startsWith("..") && !within2.split(
|
|
74854
|
+
for (let at = directory2; ; at = import_node_path83.default.dirname(at)) {
|
|
74855
|
+
const link = import_node_path83.default.join(at, "node_modules", name3);
|
|
74856
|
+
if (import_node_fs82.default.existsSync(link)) {
|
|
74857
|
+
const target = import_node_fs82.default.realpathSync(link);
|
|
74858
|
+
const within2 = import_node_path83.default.relative(root, target);
|
|
74859
|
+
if (!within2.startsWith("..") && !within2.split(import_node_path83.default.sep).includes("node_modules") && import_node_fs82.default.existsSync(import_node_path83.default.join(target, "package.json")))
|
|
74670
74860
|
visit3(target);
|
|
74671
74861
|
break;
|
|
74672
74862
|
}
|
|
@@ -74678,7 +74868,7 @@ function localPackageDirectories(root, app) {
|
|
|
74678
74868
|
return [...directories];
|
|
74679
74869
|
}
|
|
74680
74870
|
async function hashWorkspaceInputs(app, everyByte, signal, sourceOnly = false, podsEnvironment = reactNativePodsEnvironment()) {
|
|
74681
|
-
app =
|
|
74871
|
+
app = import_node_fs82.default.realpathSync(app);
|
|
74682
74872
|
const key2 = JSON.stringify([app, everyByte, sourceOnly, podsEnvironment]);
|
|
74683
74873
|
let pending2 = hashing.get(key2);
|
|
74684
74874
|
if (!pending2) {
|
|
@@ -74698,22 +74888,22 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
74698
74888
|
sourceOnly,
|
|
74699
74889
|
linkedPackageDirectories(root, app)
|
|
74700
74890
|
);
|
|
74701
|
-
const appRelative =
|
|
74702
|
-
const manifest = JSON.parse(
|
|
74891
|
+
const appRelative = import_node_path83.default.relative(root, app);
|
|
74892
|
+
const manifest = JSON.parse(import_node_fs82.default.readFileSync(import_node_path83.default.join(root, "package.json"), "utf8"));
|
|
74703
74893
|
const hash = (0, import_node_crypto50.createHash)("sha256");
|
|
74704
74894
|
const native = (0, import_node_crypto50.createHash)("sha256");
|
|
74705
74895
|
const nativeDirectories = localPackageDirectories(root, app);
|
|
74706
74896
|
const versionFree = new Set(
|
|
74707
74897
|
nativeDirectories.filter((directory2) => directory2 !== appRelative && directory2 !== "").filter(
|
|
74708
|
-
(directory2) => !
|
|
74709
|
-
).map((directory2) => directory2.split(
|
|
74898
|
+
(directory2) => !import_node_fs82.default.readdirSync(import_node_path83.default.join(root, directory2)).some((name3) => NATIVE_PACKAGE_ENTRY.test(name3))
|
|
74899
|
+
).map((directory2) => directory2.split(import_node_path83.default.sep).join("/"))
|
|
74710
74900
|
);
|
|
74711
74901
|
const versioned = new Set(
|
|
74712
|
-
nativeDirectories.map((directory2) => directory2.split(
|
|
74902
|
+
nativeDirectories.map((directory2) => directory2.split(import_node_path83.default.sep).join("/")).filter((directory2) => !versionFree.has(directory2))
|
|
74713
74903
|
);
|
|
74714
74904
|
const nativeConfigBytes = (posix2, bytes) => {
|
|
74715
|
-
const directory2 =
|
|
74716
|
-
if (
|
|
74905
|
+
const directory2 = import_node_path83.default.posix.dirname(posix2);
|
|
74906
|
+
if (import_node_path83.default.posix.basename(posix2) === "package.json" && versionFree.has(directory2)) {
|
|
74717
74907
|
const { version: _version, ...manifest2 } = JSON.parse(bytes.toString("utf8"));
|
|
74718
74908
|
return JSON.stringify(manifest2);
|
|
74719
74909
|
}
|
|
@@ -74727,21 +74917,21 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
74727
74917
|
return !(workspaces && entry && !versioned.has(entry) && /^ {6}"version": "[^"]*",$/.test(line));
|
|
74728
74918
|
}).join("\n");
|
|
74729
74919
|
};
|
|
74730
|
-
const steersNative = (relative4) => !relative4.includes(
|
|
74731
|
-
(directory2) => directory2 === "" || relative4 === directory2 || relative4.startsWith(directory2 +
|
|
74920
|
+
const steersNative = (relative4) => !relative4.includes(import_node_path83.default.sep) || relative4.startsWith(`patches${import_node_path83.default.sep}`) || relative4.startsWith(import_node_path83.default.join("scripts", "lib", "expo-plugins") + import_node_path83.default.sep) || nativeDirectories.some(
|
|
74921
|
+
(directory2) => directory2 === "" || relative4 === directory2 || relative4.startsWith(directory2 + import_node_path83.default.sep)
|
|
74732
74922
|
);
|
|
74733
74923
|
const steps = [];
|
|
74734
74924
|
const unread = [];
|
|
74735
74925
|
const walk4 = (directory2) => {
|
|
74736
|
-
const entries2 =
|
|
74926
|
+
const entries2 = import_node_fs82.default.readdirSync(directory2, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name));
|
|
74737
74927
|
for (const entry of entries2) {
|
|
74738
|
-
const file =
|
|
74739
|
-
const relative4 =
|
|
74928
|
+
const file = import_node_path83.default.join(directory2, entry.name);
|
|
74929
|
+
const relative4 = import_node_path83.default.relative(root, file);
|
|
74740
74930
|
if (excluded(relative4, entry.isDirectory())) continue;
|
|
74741
74931
|
const firstStep = steps.length;
|
|
74742
74932
|
steps.push(() => hash.update(`${relative4}\0`));
|
|
74743
74933
|
if (entry.isSymbolicLink()) {
|
|
74744
|
-
const link = `link\0${
|
|
74934
|
+
const link = `link\0${import_node_fs82.default.readlinkSync(file)}\0`;
|
|
74745
74935
|
steps.push(() => {
|
|
74746
74936
|
hash.update(link);
|
|
74747
74937
|
if (steersNative(relative4)) native.update(`${relative4}\0${link}`);
|
|
@@ -74751,9 +74941,9 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
74751
74941
|
walk4(file);
|
|
74752
74942
|
if (sourceOnly && steps.length === firstStep + 2) steps.length = firstStep;
|
|
74753
74943
|
} else if (entry.isFile()) {
|
|
74754
|
-
const posix2 = relative4.split(
|
|
74944
|
+
const posix2 = relative4.split(import_node_path83.default.sep).join("/");
|
|
74755
74945
|
if (NATIVE_CONFIG_FILE.test(posix2)) {
|
|
74756
|
-
const bytes =
|
|
74946
|
+
const bytes = import_node_fs82.default.readFileSync(file);
|
|
74757
74947
|
steps.push(() => {
|
|
74758
74948
|
if (everyByte) hash.update(`file\0${bytes.length}\0`).update(bytes);
|
|
74759
74949
|
if (steersNative(relative4))
|
|
@@ -74762,7 +74952,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
74762
74952
|
continue;
|
|
74763
74953
|
}
|
|
74764
74954
|
if (everyByte) {
|
|
74765
|
-
const stat =
|
|
74955
|
+
const stat = import_node_fs82.default.statSync(file);
|
|
74766
74956
|
const known = fileDigests.get(file);
|
|
74767
74957
|
const content = known?.ino === stat.ino && known.size === stat.size && known.mtimeMs === stat.mtimeMs && known.ctimeMs === stat.ctimeMs ? known : {
|
|
74768
74958
|
ino: stat.ino,
|
|
@@ -74783,7 +74973,7 @@ async function walkWorkspaceInputs(app, everyByte, sourceOnly, podsEnvironment)
|
|
|
74783
74973
|
for (let start = 0; start < unread.length; start += 32) {
|
|
74784
74974
|
await Promise.all(
|
|
74785
74975
|
unread.slice(start, start + 32).map(async ({ file, content }) => {
|
|
74786
|
-
const bytes = await
|
|
74976
|
+
const bytes = await import_node_fs82.default.promises.readFile(file);
|
|
74787
74977
|
content.size = bytes.length;
|
|
74788
74978
|
content.digest = (0, import_node_crypto50.createHash)("sha256").update(bytes).digest("hex");
|
|
74789
74979
|
fileDigests.set(file, content);
|
|
@@ -74830,13 +75020,13 @@ async function pruneExpoNativeWorkspaces(parent, keep) {
|
|
|
74830
75020
|
const retire = (directory2, used) => withSwiftRootLock(
|
|
74831
75021
|
directory2,
|
|
74832
75022
|
async () => {
|
|
74833
|
-
const retired =
|
|
75023
|
+
const retired = import_node_path83.default.join(
|
|
74834
75024
|
parent,
|
|
74835
|
-
`${RETIRED_PREFIX2}${process.pid}-${
|
|
75025
|
+
`${RETIRED_PREFIX2}${process.pid}-${import_node_path83.default.basename(directory2)}`
|
|
74836
75026
|
);
|
|
74837
|
-
if (
|
|
75027
|
+
if (import_node_fs82.default.statSync(directory2, { throwIfNoEntry: false })?.mtimeMs !== used) return;
|
|
74838
75028
|
try {
|
|
74839
|
-
|
|
75029
|
+
import_node_fs82.default.renameSync(directory2, retired);
|
|
74840
75030
|
} catch (error) {
|
|
74841
75031
|
if (error instanceof Error && "code" in error && error.code === "ENOENT") return;
|
|
74842
75032
|
throw error;
|
|
@@ -74847,15 +75037,15 @@ async function pruneExpoNativeWorkspaces(parent, keep) {
|
|
|
74847
75037
|
false
|
|
74848
75038
|
);
|
|
74849
75039
|
const complete = [];
|
|
74850
|
-
for (const name3 of
|
|
74851
|
-
const directory2 =
|
|
75040
|
+
for (const name3 of import_node_fs82.default.readdirSync(parent)) {
|
|
75041
|
+
const directory2 = import_node_path83.default.join(parent, name3);
|
|
74852
75042
|
if (name3.startsWith(RETIRED_PREFIX2)) {
|
|
74853
75043
|
reapRetiredCacheDirectory(parent, name3);
|
|
74854
75044
|
continue;
|
|
74855
75045
|
}
|
|
74856
|
-
const used =
|
|
75046
|
+
const used = import_node_fs82.default.statSync(directory2, { throwIfNoEntry: false })?.mtimeMs;
|
|
74857
75047
|
if (directory2 === keep || used === void 0) continue;
|
|
74858
|
-
if (
|
|
75048
|
+
if (import_node_fs82.default.existsSync(import_node_path83.default.join(directory2, ".peach-complete")) || import_node_fs82.default.existsSync(import_node_path83.default.join(directory2, ".peach-project-complete")))
|
|
74859
75049
|
complete.push({ directory: directory2, used });
|
|
74860
75050
|
else if (Date.now() - used > ABANDONED_WORKSPACE_MS) await retire(directory2, used);
|
|
74861
75051
|
}
|
|
@@ -74864,38 +75054,38 @@ async function pruneExpoNativeWorkspaces(parent, keep) {
|
|
|
74864
75054
|
}
|
|
74865
75055
|
function syncChangedFiles(root, work, appRelative, excluded, installed) {
|
|
74866
75056
|
const copyIfNewer = (file, relative4, newerOnly) => {
|
|
74867
|
-
const source =
|
|
74868
|
-
const target =
|
|
74869
|
-
const existing =
|
|
75057
|
+
const source = import_node_fs82.default.statSync(file);
|
|
75058
|
+
const target = import_node_path83.default.join(work, relative4);
|
|
75059
|
+
const existing = import_node_fs82.default.statSync(target, { throwIfNoEntry: false });
|
|
74870
75060
|
if (existing && (newerOnly ? existing.mtime.getTime() >= source.mtime.getTime() : existing.size === source.size && existing.mtime.getTime() === source.mtime.getTime()))
|
|
74871
75061
|
return;
|
|
74872
|
-
|
|
75062
|
+
import_node_fs82.default.mkdirSync(import_node_path83.default.dirname(target), { recursive: true });
|
|
74873
75063
|
const staged = `${target}.${process.pid}.peach-sync`;
|
|
74874
|
-
|
|
74875
|
-
|
|
74876
|
-
|
|
75064
|
+
import_node_fs82.default.copyFileSync(file, staged);
|
|
75065
|
+
import_node_fs82.default.utimesSync(staged, source.atime, source.mtime);
|
|
75066
|
+
import_node_fs82.default.renameSync(staged, target);
|
|
74877
75067
|
};
|
|
74878
75068
|
const walkInstalled = (directory2) => {
|
|
74879
|
-
for (const entry of
|
|
74880
|
-
const file =
|
|
75069
|
+
for (const entry of import_node_fs82.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
75070
|
+
const file = import_node_path83.default.join(directory2, entry.name);
|
|
74881
75071
|
if (entry.isDirectory()) walkInstalled(file);
|
|
74882
|
-
else if (entry.isFile()) copyIfNewer(file,
|
|
75072
|
+
else if (entry.isFile()) copyIfNewer(file, import_node_path83.default.relative(root, file), true);
|
|
74883
75073
|
}
|
|
74884
75074
|
};
|
|
74885
|
-
const sourceIos =
|
|
75075
|
+
const sourceIos = import_node_fs82.default.existsSync(import_node_path83.default.join(root, appRelative, "ios", "Podfile"));
|
|
74886
75076
|
const walk4 = (directory2) => {
|
|
74887
|
-
for (const entry of
|
|
74888
|
-
const file =
|
|
74889
|
-
const relative4 =
|
|
74890
|
-
if (installed && entry.name === "node_modules" && entry.isDirectory() &&
|
|
75077
|
+
for (const entry of import_node_fs82.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
75078
|
+
const file = import_node_path83.default.join(directory2, entry.name);
|
|
75079
|
+
const relative4 = import_node_path83.default.relative(root, file);
|
|
75080
|
+
if (installed && entry.name === "node_modules" && entry.isDirectory() && import_node_fs82.default.existsSync(import_node_path83.default.join(work, relative4))) {
|
|
74891
75081
|
walkInstalled(file);
|
|
74892
75082
|
continue;
|
|
74893
75083
|
}
|
|
74894
|
-
if (excluded(relative4, entry.isDirectory()) || entry.isSymbolicLink() || !sourceIos && relative4 ===
|
|
75084
|
+
if (excluded(relative4, entry.isDirectory()) || entry.isSymbolicLink() || !sourceIos && relative4 === import_node_path83.default.join(appRelative, "ios"))
|
|
74895
75085
|
continue;
|
|
74896
75086
|
if (entry.isDirectory()) walk4(file);
|
|
74897
75087
|
else if (entry.isFile()) {
|
|
74898
|
-
if (NATIVE_CONFIG_FILE.test(relative4.split(
|
|
75088
|
+
if (NATIVE_CONFIG_FILE.test(relative4.split(import_node_path83.default.sep).join("/"))) continue;
|
|
74899
75089
|
copyIfNewer(file, relative4, false);
|
|
74900
75090
|
}
|
|
74901
75091
|
}
|
|
@@ -74906,10 +75096,10 @@ function watchRoot(root) {
|
|
|
74906
75096
|
const existing = watches.get(root);
|
|
74907
75097
|
if (existing) return existing;
|
|
74908
75098
|
const watch = { edits: 0 };
|
|
74909
|
-
const watcher =
|
|
74910
|
-
const parts = filename?.split(
|
|
75099
|
+
const watcher = import_node_fs82.default.watch(root, { recursive: true }, (_event, filename) => {
|
|
75100
|
+
const parts = filename?.split(import_node_path83.default.sep) ?? [];
|
|
74911
75101
|
const { excluded } = watch;
|
|
74912
|
-
if (excluded && parts.some((_, index) => excluded(parts.slice(0, index + 1).join(
|
|
75102
|
+
if (excluded && parts.some((_, index) => excluded(parts.slice(0, index + 1).join(import_node_path83.default.sep))))
|
|
74913
75103
|
return;
|
|
74914
75104
|
if (filename && watch.ignoredLater?.(filename)) return;
|
|
74915
75105
|
watch.edits += 1;
|
|
@@ -74925,8 +75115,8 @@ function watchRoot(root) {
|
|
|
74925
75115
|
}
|
|
74926
75116
|
async function prepareExpoNativeWorkspace(app, signal, target) {
|
|
74927
75117
|
const prepared = await prepare2(app, "workspace", signal);
|
|
74928
|
-
const ios =
|
|
74929
|
-
const workspaces =
|
|
75118
|
+
const ios = import_node_path83.default.join(prepared.app, "ios");
|
|
75119
|
+
const workspaces = import_node_fs82.default.readdirSync(ios).filter((name3) => name3.endsWith(".xcworkspace"));
|
|
74930
75120
|
const workspace = selectXcodeWorkspace(ios, workspaces);
|
|
74931
75121
|
if (!workspace) throw new Error(`expected one Expo workspace in ${ios}`);
|
|
74932
75122
|
await resolveXcodeSwiftPackages(workspace, signal, target);
|
|
@@ -74943,13 +75133,13 @@ function prepareExpoNativeProject(app, signal, dependencies = "lockfile") {
|
|
|
74943
75133
|
);
|
|
74944
75134
|
}
|
|
74945
75135
|
function prepare2(app, stage, signal) {
|
|
74946
|
-
app =
|
|
75136
|
+
app = import_node_fs82.default.realpathSync(app);
|
|
74947
75137
|
const podsEnvironment = reactNativePodsEnvironment();
|
|
74948
75138
|
const key2 = `${app}\0${stage}\0${JSON.stringify(podsEnvironment)}`;
|
|
74949
75139
|
const last = current.get(key2);
|
|
74950
|
-
if (last && last.watch.edits === last.edits && (
|
|
75140
|
+
if (last && last.watch.edits === last.edits && (import_node_fs82.default.existsSync(import_node_path83.default.join(last.result.work, ".peach-complete")) || stage !== "workspace" && import_node_fs82.default.existsSync(import_node_path83.default.join(last.result.work, ".peach-project-complete")))) {
|
|
74951
75141
|
const now = /* @__PURE__ */ new Date();
|
|
74952
|
-
|
|
75142
|
+
import_node_fs82.default.utimesSync(last.result.work, now, now);
|
|
74953
75143
|
return Promise.resolve(last.result);
|
|
74954
75144
|
}
|
|
74955
75145
|
let shared = preparing.get(key2);
|
|
@@ -74972,25 +75162,25 @@ function prepare2(app, stage, signal) {
|
|
|
74972
75162
|
}
|
|
74973
75163
|
async function copyInstalledWorkspace(root, destination, excluded) {
|
|
74974
75164
|
const installed = [];
|
|
74975
|
-
await
|
|
75165
|
+
await import_node_fs82.default.promises.cp(root, destination, {
|
|
74976
75166
|
recursive: true,
|
|
74977
|
-
mode:
|
|
75167
|
+
mode: import_node_fs82.default.constants.COPYFILE_FICLONE,
|
|
74978
75168
|
preserveTimestamps: true,
|
|
74979
75169
|
verbatimSymlinks: true,
|
|
74980
75170
|
filter: (source) => {
|
|
74981
|
-
const relative4 =
|
|
74982
|
-
if (
|
|
75171
|
+
const relative4 = import_node_path83.default.relative(root, source);
|
|
75172
|
+
if (import_node_path83.default.basename(source) === "node_modules") installed.push(relative4);
|
|
74983
75173
|
return !excluded(relative4);
|
|
74984
75174
|
}
|
|
74985
75175
|
});
|
|
74986
75176
|
const entries2 = installed.flatMap((relative4) => {
|
|
74987
|
-
const source =
|
|
74988
|
-
if (
|
|
74989
|
-
|
|
75177
|
+
const source = import_node_path83.default.join(root, relative4);
|
|
75178
|
+
if (import_node_fs82.default.lstatSync(source).isSymbolicLink()) {
|
|
75179
|
+
import_node_fs82.default.symlinkSync(import_node_fs82.default.readlinkSync(source), import_node_path83.default.join(destination, relative4));
|
|
74990
75180
|
return [];
|
|
74991
75181
|
}
|
|
74992
|
-
|
|
74993
|
-
return
|
|
75182
|
+
import_node_fs82.default.mkdirSync(import_node_path83.default.join(destination, relative4));
|
|
75183
|
+
return import_node_fs82.default.readdirSync(source).filter((name3) => name3 !== ".cache").map((name3) => import_node_path83.default.join(relative4, name3));
|
|
74994
75184
|
});
|
|
74995
75185
|
if (process.platform === "darwin") {
|
|
74996
75186
|
await new Promise((resolve4, reject) => {
|
|
@@ -75002,8 +75192,8 @@ async function copyInstalledWorkspace(root, destination, excluded) {
|
|
|
75002
75192
|
);
|
|
75003
75193
|
child.stdin?.end(
|
|
75004
75194
|
entries2.flatMap((relative4) => [
|
|
75005
|
-
|
|
75006
|
-
|
|
75195
|
+
import_node_path83.default.join(root, relative4),
|
|
75196
|
+
import_node_path83.default.join(destination, relative4)
|
|
75007
75197
|
]).join("\0")
|
|
75008
75198
|
);
|
|
75009
75199
|
});
|
|
@@ -75016,32 +75206,32 @@ async function copyInstalledWorkspace(root, destination, excluded) {
|
|
|
75016
75206
|
"-R",
|
|
75017
75207
|
"-p",
|
|
75018
75208
|
"--reflink=auto",
|
|
75019
|
-
|
|
75020
|
-
|
|
75209
|
+
import_node_path83.default.join(root, relative4),
|
|
75210
|
+
import_node_path83.default.join(destination, relative4)
|
|
75021
75211
|
]);
|
|
75022
75212
|
return clone();
|
|
75023
75213
|
};
|
|
75024
75214
|
await Promise.all(Array.from({ length: 8 }, clone));
|
|
75025
75215
|
}
|
|
75026
75216
|
function nativeWorkspacesDir(root) {
|
|
75027
|
-
const device =
|
|
75217
|
+
const device = import_node_fs82.default.statSync(root).dev;
|
|
75028
75218
|
for (const cache of [
|
|
75029
75219
|
sharedCacheDir(cacheDir()),
|
|
75030
75220
|
cacheDir(),
|
|
75031
|
-
|
|
75221
|
+
import_node_path83.default.join(import_node_os19.default.homedir(), ".peach-cache")
|
|
75032
75222
|
]) {
|
|
75033
75223
|
let existing = cache;
|
|
75034
|
-
while (!
|
|
75035
|
-
if (
|
|
75036
|
-
return
|
|
75037
|
-
}
|
|
75038
|
-
let mount =
|
|
75039
|
-
while (
|
|
75040
|
-
mount =
|
|
75041
|
-
const tmpRoots = /* @__PURE__ */ new Set(["/tmp", "/var/tmp",
|
|
75224
|
+
while (!import_node_fs82.default.existsSync(existing)) existing = import_node_path83.default.dirname(existing);
|
|
75225
|
+
if (import_node_fs82.default.statSync(existing).dev === device)
|
|
75226
|
+
return import_node_path83.default.join(cache, "expo-native-workspaces");
|
|
75227
|
+
}
|
|
75228
|
+
let mount = import_node_fs82.default.realpathSync(root);
|
|
75229
|
+
while (import_node_path83.default.dirname(mount) !== mount && import_node_fs82.default.statSync(import_node_path83.default.dirname(mount)).dev === device)
|
|
75230
|
+
mount = import_node_path83.default.dirname(mount);
|
|
75231
|
+
const tmpRoots = /* @__PURE__ */ new Set(["/tmp", "/var/tmp", import_node_fs82.default.realpathSync(import_node_os19.default.tmpdir())]);
|
|
75042
75232
|
if (tmpRoots.has(mount))
|
|
75043
|
-
return
|
|
75044
|
-
return
|
|
75233
|
+
return import_node_path83.default.join(sharedCacheDir(cacheDir()), "expo-native-workspaces");
|
|
75234
|
+
return import_node_path83.default.join(mount, ".peach-cache", "expo-native-workspaces");
|
|
75045
75235
|
}
|
|
75046
75236
|
function preparedExpoWorkspacesDir(app) {
|
|
75047
75237
|
return nativeWorkspacesDir(findWorkspaceRoot(app));
|
|
@@ -75055,7 +75245,7 @@ function trackedSourceEntries(root, work) {
|
|
|
75055
75245
|
if (listed.status !== 0) return [];
|
|
75056
75246
|
return listed.stdout.toString("utf8").split("\0").filter((entry) => {
|
|
75057
75247
|
const tab = entry.indexOf(" ");
|
|
75058
|
-
return tab > 0 &&
|
|
75248
|
+
return tab > 0 && import_node_fs82.default.existsSync(import_node_path83.default.join(work, entry.slice(tab + 1)));
|
|
75059
75249
|
});
|
|
75060
75250
|
}
|
|
75061
75251
|
function initializeWorkspaceGit(root, work) {
|
|
@@ -75104,42 +75294,42 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75104
75294
|
);
|
|
75105
75295
|
watch.excluded = excluded;
|
|
75106
75296
|
watch.ignoredLater = await untrackedIgnored(root, linkedPackageDirectories(root, app));
|
|
75107
|
-
const manifest = JSON.parse(
|
|
75108
|
-
const appManifest = JSON.parse(
|
|
75109
|
-
const work =
|
|
75297
|
+
const manifest = JSON.parse(import_node_fs82.default.readFileSync(import_node_path83.default.join(root, "package.json"), "utf8"));
|
|
75298
|
+
const appManifest = JSON.parse(import_node_fs82.default.readFileSync(import_node_path83.default.join(app, "package.json"), "utf8"));
|
|
75299
|
+
const work = import_node_path83.default.join(
|
|
75110
75300
|
nativeWorkspacesDir(root),
|
|
75111
75301
|
stage === "installed-project" ? `${nativeHash}-installed` : nativeHash
|
|
75112
75302
|
);
|
|
75113
75303
|
report(`hashed ${root}`);
|
|
75114
75304
|
const result = await withSwiftRootLock(work, async (lease) => {
|
|
75115
|
-
const marker =
|
|
75116
|
-
const projectMarker =
|
|
75117
|
-
const preparedApp =
|
|
75118
|
-
const projectReady =
|
|
75305
|
+
const marker = import_node_path83.default.join(work, ".peach-complete");
|
|
75306
|
+
const projectMarker = import_node_path83.default.join(work, ".peach-project-complete");
|
|
75307
|
+
const preparedApp = import_node_path83.default.join(work, appRelative);
|
|
75308
|
+
const projectReady = import_node_fs82.default.existsSync(marker) || import_node_fs82.default.existsSync(projectMarker);
|
|
75119
75309
|
if (projectReady) {
|
|
75120
75310
|
syncChangedFiles(
|
|
75121
75311
|
root,
|
|
75122
75312
|
work,
|
|
75123
75313
|
appRelative,
|
|
75124
75314
|
excluded,
|
|
75125
|
-
stage === "workspace" && !
|
|
75315
|
+
stage === "workspace" && !import_node_fs82.default.existsSync(marker)
|
|
75126
75316
|
);
|
|
75127
75317
|
report(`reusing prepared workspace ${work}`);
|
|
75128
75318
|
}
|
|
75129
75319
|
if (!projectReady) {
|
|
75130
75320
|
const partial = `${work}.${process.pid}.partial`;
|
|
75131
|
-
await
|
|
75132
|
-
await
|
|
75133
|
-
|
|
75321
|
+
await import_node_fs82.default.promises.rm(partial, { recursive: true, force: true });
|
|
75322
|
+
await import_node_fs82.default.promises.rm(work, { recursive: true, force: true });
|
|
75323
|
+
import_node_fs82.default.mkdirSync(import_node_path83.default.dirname(work), { recursive: true });
|
|
75134
75324
|
report("copying workspace");
|
|
75135
75325
|
await copyInstalledWorkspace(root, partial, excluded);
|
|
75136
|
-
|
|
75326
|
+
import_node_fs82.default.renameSync(partial, work);
|
|
75137
75327
|
initializeWorkspaceGit(root, work);
|
|
75138
75328
|
report("copied workspace");
|
|
75139
75329
|
}
|
|
75140
|
-
if (projectReady && (stage !== "workspace" ||
|
|
75330
|
+
if (projectReady && (stage !== "workspace" || import_node_fs82.default.existsSync(marker))) {
|
|
75141
75331
|
const now2 = /* @__PURE__ */ new Date();
|
|
75142
|
-
|
|
75332
|
+
import_node_fs82.default.utimesSync(work, now2, now2);
|
|
75143
75333
|
return { app: preparedApp, work };
|
|
75144
75334
|
}
|
|
75145
75335
|
const trustedConfigs = /* @__PURE__ */ new Set();
|
|
@@ -75151,10 +75341,10 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75151
75341
|
if (result2.status !== 0) continue;
|
|
75152
75342
|
const configs = JSON.parse(result2.stdout);
|
|
75153
75343
|
for (const config of configs) {
|
|
75154
|
-
const relative4 =
|
|
75155
|
-
if (relative4.startsWith("..") ||
|
|
75156
|
-
const copy =
|
|
75157
|
-
if (
|
|
75344
|
+
const relative4 = import_node_path83.default.relative(root, config.path);
|
|
75345
|
+
if (relative4.startsWith("..") || import_node_path83.default.isAbsolute(relative4)) continue;
|
|
75346
|
+
const copy = import_node_path83.default.join(work, relative4);
|
|
75347
|
+
if (import_node_fs82.default.existsSync(copy) && import_node_fs82.default.readFileSync(config.path).equals(import_node_fs82.default.readFileSync(copy)))
|
|
75158
75348
|
trustedConfigs.add(copy);
|
|
75159
75349
|
}
|
|
75160
75350
|
}
|
|
@@ -75162,7 +75352,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75162
75352
|
MISE_TRUSTED_CONFIG_PATHS: [
|
|
75163
75353
|
process.env.MISE_TRUSTED_CONFIG_PATHS,
|
|
75164
75354
|
...trustedConfigs
|
|
75165
|
-
].filter(Boolean).join(
|
|
75355
|
+
].filter(Boolean).join(import_node_path83.default.delimiter)
|
|
75166
75356
|
};
|
|
75167
75357
|
const run16 = (command, args, cwd, env = {}, admit = true) => {
|
|
75168
75358
|
const admitted = admit && teamMachineInstalled();
|
|
@@ -75180,8 +75370,8 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75180
75370
|
const nodeVersion = pinnedNodeVersion(root, manifest);
|
|
75181
75371
|
const pinnedBun = manager.startsWith("bun@");
|
|
75182
75372
|
const prefix = nodeVersion ? ["mise", "exec", `node@${nodeVersion}`, ...pinnedBun ? [manager] : [], "--"] : [];
|
|
75183
|
-
const bunPrefix =
|
|
75184
|
-
const bunExecutable =
|
|
75373
|
+
const bunPrefix = import_node_path83.default.join(cacheDir(), "package-managers", manager);
|
|
75374
|
+
const bunExecutable = import_node_path83.default.join(bunPrefix, "node_modules/.bin/bun");
|
|
75185
75375
|
const install = manager === "pnpm" || manager.startsWith("pnpm@") ? [
|
|
75186
75376
|
"npx",
|
|
75187
75377
|
"--yes",
|
|
@@ -75196,7 +75386,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75196
75386
|
);
|
|
75197
75387
|
const installEnv = {
|
|
75198
75388
|
npm_config_ignore_scripts: "false",
|
|
75199
|
-
...pinnedBun && !nodeVersion ? { PATH: [
|
|
75389
|
+
...pinnedBun && !nodeVersion ? { PATH: [import_node_path83.default.dirname(bunExecutable), process.env.PATH].join(import_node_path83.default.delimiter) } : {}
|
|
75200
75390
|
};
|
|
75201
75391
|
const execute = async (args, cwd, env = {}) => {
|
|
75202
75392
|
const command = [...prefix, ...args];
|
|
@@ -75222,7 +75412,7 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75222
75412
|
);
|
|
75223
75413
|
}
|
|
75224
75414
|
}
|
|
75225
|
-
if (install[0] === "npm" &&
|
|
75415
|
+
if (install[0] === "npm" && import_node_fs82.default.existsSync(import_node_path83.default.join(work, "package-lock.json"))) {
|
|
75226
75416
|
report("checking npm lockfile");
|
|
75227
75417
|
const check2 = [
|
|
75228
75418
|
...prefix,
|
|
@@ -75250,9 +75440,9 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75250
75440
|
report,
|
|
75251
75441
|
oneSdkPrepared
|
|
75252
75442
|
);
|
|
75253
|
-
|
|
75443
|
+
import_node_fs82.default.writeFileSync(projectMarker, "complete\n");
|
|
75254
75444
|
}
|
|
75255
|
-
if (stage === "workspace" && !
|
|
75445
|
+
if (stage === "workspace" && !import_node_fs82.default.existsSync(marker)) {
|
|
75256
75446
|
await prepareNativeProject(
|
|
75257
75447
|
preparedApp,
|
|
75258
75448
|
work,
|
|
@@ -75262,14 +75452,14 @@ async function prepareWorkspace(app, stage, key2, podsEnvironment) {
|
|
|
75262
75452
|
report,
|
|
75263
75453
|
oneSdkPrepared
|
|
75264
75454
|
);
|
|
75265
|
-
|
|
75455
|
+
import_node_fs82.default.writeFileSync(marker, "complete\n");
|
|
75266
75456
|
}
|
|
75267
75457
|
const now = /* @__PURE__ */ new Date();
|
|
75268
|
-
|
|
75458
|
+
import_node_fs82.default.utimesSync(work, now, now);
|
|
75269
75459
|
return { app: preparedApp, work };
|
|
75270
75460
|
});
|
|
75271
75461
|
if (stage === "workspace") readInstalledPodspecs(app, result.app);
|
|
75272
|
-
await pruneExpoNativeWorkspaces(
|
|
75462
|
+
await pruneExpoNativeWorkspaces(import_node_path83.default.dirname(work), work);
|
|
75273
75463
|
current.set(key2, { watch, edits, result });
|
|
75274
75464
|
return result;
|
|
75275
75465
|
}
|
|
@@ -75277,20 +75467,20 @@ function declaresNativeDependency(manifest, name3) {
|
|
|
75277
75467
|
return Object.hasOwn(manifest.dependencies ?? {}, name3) || Object.hasOwn(manifest.devDependencies ?? {}, name3);
|
|
75278
75468
|
}
|
|
75279
75469
|
async function prepareNativeProject(app, workspace, manifest, stage, execute, report, oneSdkPrepared) {
|
|
75280
|
-
const appRequire = (0, import_node_module6.createRequire)(
|
|
75470
|
+
const appRequire = (0, import_node_module6.createRequire)(import_node_path83.default.join(app, "package.json"));
|
|
75281
75471
|
const sourcePodEnv = {
|
|
75282
75472
|
EXPO_USE_PRECOMPILED_MODULES: "0",
|
|
75283
75473
|
ONE_PREBUILT_IOS: "0",
|
|
75284
75474
|
RCT_NEW_ARCH_ENABLED: process.env.RCT_NEW_ARCH_ENABLED ?? "1"
|
|
75285
75475
|
};
|
|
75286
75476
|
const declares2 = (name3) => declaresNativeDependency(manifest, name3);
|
|
75287
|
-
if (!
|
|
75477
|
+
if (!import_node_fs82.default.existsSync(import_node_path83.default.join(app, "ios", "Podfile"))) {
|
|
75288
75478
|
if (!declares2("expo") && !declares2("one"))
|
|
75289
75479
|
throw new Error(
|
|
75290
75480
|
`${app} has no ios/Podfile and declares neither expo nor one, so peach cannot generate an iOS project for it`
|
|
75291
75481
|
);
|
|
75292
75482
|
const prebuild = declares2("expo") ? [appRequire.resolve("expo/bin/cli"), "prebuild"] : [
|
|
75293
|
-
|
|
75483
|
+
import_node_path83.default.join(import_node_path83.default.dirname(appRequire.resolve("one/package.json")), "run.mjs"),
|
|
75294
75484
|
"prebuild"
|
|
75295
75485
|
];
|
|
75296
75486
|
await execute(
|
|
@@ -75326,25 +75516,25 @@ async function prepareNativeProject(app, workspace, manifest, stage, execute, re
|
|
|
75326
75516
|
function stageCachedQuickCryptoOpenSsl(app) {
|
|
75327
75517
|
const root = findWorkspaceRoot(app);
|
|
75328
75518
|
let packageDir = null;
|
|
75329
|
-
for (let at = app; ; at =
|
|
75330
|
-
const candidate =
|
|
75331
|
-
if (
|
|
75519
|
+
for (let at = app; ; at = import_node_path83.default.dirname(at)) {
|
|
75520
|
+
const candidate = import_node_path83.default.join(at, "node_modules", "react-native-quick-crypto");
|
|
75521
|
+
if (import_node_fs82.default.existsSync(import_node_path83.default.join(candidate, "QuickCrypto.podspec"))) {
|
|
75332
75522
|
packageDir = candidate;
|
|
75333
75523
|
break;
|
|
75334
75524
|
}
|
|
75335
|
-
if (at === root ||
|
|
75525
|
+
if (at === root || import_node_path83.default.dirname(at) === at) break;
|
|
75336
75526
|
}
|
|
75337
75527
|
if (!packageDir) return;
|
|
75338
|
-
const opensslDir =
|
|
75339
|
-
if (
|
|
75340
|
-
const podspec =
|
|
75528
|
+
const opensslDir = import_node_path83.default.join(packageDir, "ios", "openssl");
|
|
75529
|
+
if (import_node_fs82.default.existsSync(import_node_path83.default.join(opensslDir, "quickcrypto_openssl_prefix.h"))) return;
|
|
75530
|
+
const podspec = import_node_fs82.default.readFileSync(import_node_path83.default.join(packageDir, "QuickCrypto.podspec"), "utf8");
|
|
75341
75531
|
const sha2565 = /openssl_sha256\s*=\s*"([0-9a-f]{64})"/.exec(podspec)?.[1];
|
|
75342
75532
|
if (!sha2565) return;
|
|
75343
|
-
const archive =
|
|
75344
|
-
if (!
|
|
75533
|
+
const archive = import_node_path83.default.join(cacheDir(), "pod-archives", `${sha2565}.zip`);
|
|
75534
|
+
if (!import_node_fs82.default.existsSync(archive) || (0, import_node_crypto50.createHash)("sha256").update(import_node_fs82.default.readFileSync(archive)).digest("hex") !== sha2565)
|
|
75345
75535
|
return;
|
|
75346
|
-
|
|
75347
|
-
|
|
75536
|
+
import_node_fs82.default.rmSync(opensslDir, { recursive: true, force: true });
|
|
75537
|
+
import_node_fs82.default.mkdirSync(opensslDir, { recursive: true });
|
|
75348
75538
|
(0, import_node_child_process43.execFileSync)("unzip", ["-q", "-o", archive, "-d", opensslDir]);
|
|
75349
75539
|
}
|
|
75350
75540
|
async function runAdmitted(lease, command, args, cwd, extraEnv, admitted) {
|
|
@@ -75379,16 +75569,16 @@ ${failedOutputLine(command, cwd, bytes)}`
|
|
|
75379
75569
|
});
|
|
75380
75570
|
});
|
|
75381
75571
|
}
|
|
75382
|
-
var import_node_child_process43, import_node_crypto50,
|
|
75572
|
+
var import_node_child_process43, import_node_crypto50, import_node_fs82, import_node_module6, import_node_os19, import_node_path83, import_node_util11, isolatedGitEnv, EXACT_VERSION, NATIVE_CONFIG_FILE, NATIVE_SOURCE_FILE, fileDigests, NATIVE_PACKAGE_ENTRY, hashing, KEPT_WORKSPACES, WORKSPACE_GRACE_MS, ABANDONED_WORKSPACE_MS, RETIRED_PREFIX2, preparing, watches, current, CLONE_ENTRIES;
|
|
75383
75573
|
var init_expo_native_workspace = __esm({
|
|
75384
75574
|
"src/expo-native-workspace.ts"() {
|
|
75385
75575
|
"use strict";
|
|
75386
75576
|
import_node_child_process43 = require("node:child_process");
|
|
75387
75577
|
import_node_crypto50 = require("node:crypto");
|
|
75388
|
-
|
|
75578
|
+
import_node_fs82 = __toESM(require("node:fs"), 1);
|
|
75389
75579
|
import_node_module6 = require("node:module");
|
|
75390
75580
|
import_node_os19 = __toESM(require("node:os"), 1);
|
|
75391
|
-
|
|
75581
|
+
import_node_path83 = __toESM(require("node:path"), 1);
|
|
75392
75582
|
import_node_util11 = require("node:util");
|
|
75393
75583
|
init_detect();
|
|
75394
75584
|
init_admitted_mac_build();
|
|
@@ -75459,9 +75649,9 @@ function run() {
|
|
|
75459
75649
|
// cli/app-project.ts
|
|
75460
75650
|
function firstNamedFile(dir, names) {
|
|
75461
75651
|
for (const name3 of names) {
|
|
75462
|
-
const candidate =
|
|
75652
|
+
const candidate = import_node_path84.default.join(dir, name3);
|
|
75463
75653
|
try {
|
|
75464
|
-
if (
|
|
75654
|
+
if (import_node_fs83.default.statSync(candidate).isFile()) return candidate;
|
|
75465
75655
|
} catch {
|
|
75466
75656
|
}
|
|
75467
75657
|
}
|
|
@@ -75474,24 +75664,24 @@ function findRNXAppConfig(dir) {
|
|
|
75474
75664
|
return firstNamedFile(dir, PEACH_APP_CONFIG_NAMES);
|
|
75475
75665
|
}
|
|
75476
75666
|
function resolveAppProject(projectRoot) {
|
|
75477
|
-
const appDir =
|
|
75667
|
+
const appDir = import_node_path84.default.resolve(projectRoot);
|
|
75478
75668
|
try {
|
|
75479
|
-
if (!
|
|
75669
|
+
if (!import_node_fs83.default.statSync(appDir).isDirectory()) return null;
|
|
75480
75670
|
} catch {
|
|
75481
75671
|
return null;
|
|
75482
75672
|
}
|
|
75483
75673
|
const configPath = findRNXAppConfig(appDir);
|
|
75484
|
-
if (!configPath && !findExpoAppConfig(appDir) && !
|
|
75674
|
+
if (!configPath && !findExpoAppConfig(appDir) && !import_node_fs83.default.existsSync(import_node_path84.default.join(appDir, "package.json"))) {
|
|
75485
75675
|
return null;
|
|
75486
75676
|
}
|
|
75487
75677
|
return { appDir, configPath };
|
|
75488
75678
|
}
|
|
75489
|
-
var
|
|
75679
|
+
var import_node_fs83, import_node_path84, EXPO_APP_CONFIG_NAMES, PEACH_APP_CONFIG_NAMES;
|
|
75490
75680
|
var init_app_project = __esm({
|
|
75491
75681
|
"cli/app-project.ts"() {
|
|
75492
75682
|
"use strict";
|
|
75493
|
-
|
|
75494
|
-
|
|
75683
|
+
import_node_fs83 = __toESM(require("node:fs"), 1);
|
|
75684
|
+
import_node_path84 = __toESM(require("node:path"), 1);
|
|
75495
75685
|
EXPO_APP_CONFIG_NAMES = [
|
|
75496
75686
|
"app.config.js",
|
|
75497
75687
|
"app.config.ts",
|
|
@@ -75728,16 +75918,16 @@ var init_estree_walk = __esm({
|
|
|
75728
75918
|
|
|
75729
75919
|
// src/kotlin-toolchain.ts
|
|
75730
75920
|
function kotlinToolCommand(toolchain, sdkRoot, tool, args) {
|
|
75731
|
-
const lib =
|
|
75921
|
+
const lib = import_node_path85.default.resolve(import_node_path85.default.dirname(toolchain.kotlinc), "../lib");
|
|
75732
75922
|
return {
|
|
75733
|
-
file:
|
|
75923
|
+
file: import_node_path85.default.join(toolchain.javaHome, "bin", "java"),
|
|
75734
75924
|
args: [
|
|
75735
75925
|
"-cp",
|
|
75736
75926
|
[
|
|
75737
|
-
|
|
75738
|
-
|
|
75739
|
-
|
|
75740
|
-
].join(
|
|
75927
|
+
import_node_path85.default.join(sdkRoot, "tools.jar"),
|
|
75928
|
+
import_node_path85.default.join(lib, "kotlin-compiler.jar"),
|
|
75929
|
+
import_node_path85.default.join(lib, "kotlin-stdlib.jar")
|
|
75930
|
+
].join(import_node_path85.default.delimiter),
|
|
75741
75931
|
tool,
|
|
75742
75932
|
...args
|
|
75743
75933
|
]
|
|
@@ -75750,7 +75940,7 @@ async function runKotlinTool(toolchain, sdkRoot, tool, args, maxBuffer = 16 * 10
|
|
|
75750
75940
|
}
|
|
75751
75941
|
function readToolchain(moduleRoot) {
|
|
75752
75942
|
const parsed2 = JSON.parse(
|
|
75753
|
-
|
|
75943
|
+
import_node_fs84.default.readFileSync(import_node_path85.default.join(moduleRoot, "toolchain.json"), "utf8")
|
|
75754
75944
|
);
|
|
75755
75945
|
const download2 = (value) => {
|
|
75756
75946
|
if (!isRecord(value) || typeof value.url !== "string" || typeof value.sha256 !== "string" || !/^[a-f0-9]{64}$/.test(value.sha256))
|
|
@@ -75796,13 +75986,13 @@ function readToolchain(moduleRoot) {
|
|
|
75796
75986
|
};
|
|
75797
75987
|
}
|
|
75798
75988
|
function kotlinHome() {
|
|
75799
|
-
return
|
|
75989
|
+
return import_node_path85.default.join(rnxHomeDir(), "kotlin");
|
|
75800
75990
|
}
|
|
75801
75991
|
async function fetchVerified(download2, target) {
|
|
75802
|
-
if (
|
|
75803
|
-
if ((0, import_node_crypto51.createHash)("sha256").update(
|
|
75992
|
+
if (import_node_fs84.default.existsSync(target)) {
|
|
75993
|
+
if ((0, import_node_crypto51.createHash)("sha256").update(import_node_fs84.default.readFileSync(target)).digest("hex") !== download2.sha256)
|
|
75804
75994
|
throw new Error(
|
|
75805
|
-
`cached Kotlin download differs from its pin: ${
|
|
75995
|
+
`cached Kotlin download differs from its pin: ${import_node_path85.default.basename(target)}`
|
|
75806
75996
|
);
|
|
75807
75997
|
return;
|
|
75808
75998
|
}
|
|
@@ -75812,22 +76002,22 @@ async function fetchVerified(download2, target) {
|
|
|
75812
76002
|
const digest3 = (0, import_node_crypto51.createHash)("sha256").update(bytes).digest("hex");
|
|
75813
76003
|
if (digest3 !== download2.sha256)
|
|
75814
76004
|
throw new Error(`${download2.url} has sha256 ${digest3}, expected ${download2.sha256}`);
|
|
75815
|
-
|
|
76005
|
+
import_node_fs84.default.mkdirSync(import_node_path85.default.dirname(target), { recursive: true });
|
|
75816
76006
|
const partial = `${target}.${process.pid}.partial`;
|
|
75817
|
-
|
|
75818
|
-
|
|
76007
|
+
import_node_fs84.default.writeFileSync(partial, bytes);
|
|
76008
|
+
import_node_fs84.default.renameSync(partial, target);
|
|
75819
76009
|
}
|
|
75820
76010
|
async function ensureCompose(toolchain) {
|
|
75821
76011
|
const downloads = [...toolchain.composeLibraries, toolchain.composeLoader];
|
|
75822
|
-
const root =
|
|
76012
|
+
const root = import_node_path85.default.join(kotlinHome(), "compose", toolchain.composeArchive.sha256);
|
|
75823
76013
|
const verify = (dir) => {
|
|
75824
76014
|
for (const { name: name3, sha256: sha2565 } of downloads) {
|
|
75825
|
-
const actual = (0, import_node_crypto51.createHash)("sha256").update(
|
|
76015
|
+
const actual = (0, import_node_crypto51.createHash)("sha256").update(import_node_fs84.default.readFileSync(import_node_path85.default.join(dir, name3))).digest("hex");
|
|
75826
76016
|
if (actual !== sha2565)
|
|
75827
76017
|
throw new Error(`Compose input differs from its pin: ${name3}`);
|
|
75828
76018
|
}
|
|
75829
76019
|
};
|
|
75830
|
-
if (downloads.every(({ name: name3 }) =>
|
|
76020
|
+
if (downloads.every(({ name: name3 }) => import_node_fs84.default.existsSync(import_node_path85.default.join(root, name3)))) verify(root);
|
|
75831
76021
|
else
|
|
75832
76022
|
await installVerifiedTarball({
|
|
75833
76023
|
url: toolchain.composeArchive.url,
|
|
@@ -75842,8 +76032,8 @@ async function ensureCompose(toolchain) {
|
|
|
75842
76032
|
verify
|
|
75843
76033
|
});
|
|
75844
76034
|
return {
|
|
75845
|
-
libraries: toolchain.composeLibraries.map(({ name: name3 }) =>
|
|
75846
|
-
loader:
|
|
76035
|
+
libraries: toolchain.composeLibraries.map(({ name: name3 }) => import_node_path85.default.join(root, name3)),
|
|
76036
|
+
loader: import_node_path85.default.join(root, toolchain.composeLoader.name)
|
|
75847
76037
|
};
|
|
75848
76038
|
}
|
|
75849
76039
|
function ensureToolchain(toolchain) {
|
|
@@ -75851,11 +76041,11 @@ function ensureToolchain(toolchain) {
|
|
|
75851
76041
|
const pending2 = toolchains.get(key2);
|
|
75852
76042
|
if (pending2) return pending2;
|
|
75853
76043
|
const ready = (async () => {
|
|
75854
|
-
const dir =
|
|
75855
|
-
const compilerDir =
|
|
76044
|
+
const dir = import_node_path85.default.join(kotlinHome(), toolchain.compiler.version);
|
|
76045
|
+
const compilerDir = import_node_path85.default.join(dir, `compiler-${toolchain.compiler.sha256}`);
|
|
75856
76046
|
const installedMarker = "bin/kotlinc-wasm";
|
|
75857
|
-
const kotlinc =
|
|
75858
|
-
if (!
|
|
76047
|
+
const kotlinc = import_node_path85.default.join(compilerDir, installedMarker);
|
|
76048
|
+
if (!import_node_fs84.default.existsSync(kotlinc))
|
|
75859
76049
|
await installVerifiedTarball({
|
|
75860
76050
|
url: toolchain.compiler.url,
|
|
75861
76051
|
digest: {
|
|
@@ -75868,7 +76058,7 @@ function ensureToolchain(toolchain) {
|
|
|
75868
76058
|
stripComponents: 1,
|
|
75869
76059
|
label: `Kotlin compiler ${toolchain.compiler.version}`
|
|
75870
76060
|
});
|
|
75871
|
-
const java = process.env.JAVA_HOME ?
|
|
76061
|
+
const java = process.env.JAVA_HOME ? import_node_path85.default.join(process.env.JAVA_HOME, "bin", "java") : "java";
|
|
75872
76062
|
const { stderr } = await run6(java, ["-XshowSettings:properties", "-version"]).catch(
|
|
75873
76063
|
() => {
|
|
75874
76064
|
throw new Error(
|
|
@@ -75877,11 +76067,11 @@ function ensureToolchain(toolchain) {
|
|
|
75877
76067
|
}
|
|
75878
76068
|
);
|
|
75879
76069
|
const javaHome = /^\s*java\.home\s*=\s*(.+)$/m.exec(stderr)?.[1]?.trim();
|
|
75880
|
-
if (!javaHome || !
|
|
76070
|
+
if (!javaHome || !import_node_path85.default.isAbsolute(javaHome))
|
|
75881
76071
|
throw new Error("the configured Java runtime did not report an absolute java.home");
|
|
75882
|
-
const libraries = [
|
|
76072
|
+
const libraries = [import_node_path85.default.join(compilerDir, "lib", "kotlin-stdlib-wasm-js.klib")];
|
|
75883
76073
|
for (const library of toolchain.libraries) {
|
|
75884
|
-
const target =
|
|
76074
|
+
const target = import_node_path85.default.join(dir, library.name);
|
|
75885
76075
|
await fetchVerified(library, target);
|
|
75886
76076
|
libraries.push(target);
|
|
75887
76077
|
}
|
|
@@ -75893,14 +76083,14 @@ function ensureToolchain(toolchain) {
|
|
|
75893
76083
|
toolchains.set(key2, ready);
|
|
75894
76084
|
return ready;
|
|
75895
76085
|
}
|
|
75896
|
-
var import_node_child_process44, import_node_crypto51,
|
|
76086
|
+
var import_node_child_process44, import_node_crypto51, import_node_fs84, import_node_path85, import_node_util12, run6, toolchains;
|
|
75897
76087
|
var init_kotlin_toolchain = __esm({
|
|
75898
76088
|
"src/kotlin-toolchain.ts"() {
|
|
75899
76089
|
"use strict";
|
|
75900
76090
|
import_node_child_process44 = require("node:child_process");
|
|
75901
76091
|
import_node_crypto51 = require("node:crypto");
|
|
75902
|
-
|
|
75903
|
-
|
|
76092
|
+
import_node_fs84 = __toESM(require("node:fs"), 1);
|
|
76093
|
+
import_node_path85 = __toESM(require("node:path"), 1);
|
|
75904
76094
|
import_node_util12 = require("node:util");
|
|
75905
76095
|
init_src();
|
|
75906
76096
|
init_home_paths();
|
|
@@ -75910,65 +76100,6 @@ var init_kotlin_toolchain = __esm({
|
|
|
75910
76100
|
}
|
|
75911
76101
|
});
|
|
75912
76102
|
|
|
75913
|
-
// src/swift-source-file.ts
|
|
75914
|
-
function relativeInside(root, file) {
|
|
75915
|
-
const relative4 = import_node_path84.default.relative(root, file);
|
|
75916
|
-
return relative4 === ".." || relative4.startsWith(`..${import_node_path84.default.sep}`) || import_node_path84.default.isAbsolute(relative4) ? null : relative4;
|
|
75917
|
-
}
|
|
75918
|
-
function replaceRoot(text7, root, replacement) {
|
|
75919
|
-
return root === import_node_path84.default.parse(root).root ? text7 : text7.replaceAll(root, replacement);
|
|
75920
|
-
}
|
|
75921
|
-
function projectSourceKey(canonicalRoots, file) {
|
|
75922
|
-
const canonicalFile = import_node_fs83.default.realpathSync(file);
|
|
75923
|
-
for (const root of canonicalRoots) {
|
|
75924
|
-
const relative4 = relativeInside(root, canonicalFile);
|
|
75925
|
-
if (relative4 !== null) return `./${relative4}`;
|
|
75926
|
-
}
|
|
75927
|
-
return canonicalFile;
|
|
75928
|
-
}
|
|
75929
|
-
function packageInputPath(canonicalRoot, file) {
|
|
75930
|
-
const canonicalFile = import_node_fs83.default.realpathSync(file);
|
|
75931
|
-
if (relativeInside(canonicalRoot, canonicalFile) === null) {
|
|
75932
|
-
throw new Error(`swift input escapes the selected package: ${file}`);
|
|
75933
|
-
}
|
|
75934
|
-
return canonicalFile;
|
|
75935
|
-
}
|
|
75936
|
-
function readPackageFile(root, file, maxBytes) {
|
|
75937
|
-
const canonicalFile = packageInputPath(import_node_fs83.default.realpathSync(root), file);
|
|
75938
|
-
const expected = import_node_fs83.default.statSync(canonicalFile);
|
|
75939
|
-
const fd = import_node_fs83.default.openSync(canonicalFile, import_node_fs83.default.constants.O_RDONLY | import_node_fs83.default.constants.O_NOFOLLOW);
|
|
75940
|
-
try {
|
|
75941
|
-
const stat = import_node_fs83.default.fstatSync(fd);
|
|
75942
|
-
if (stat.dev !== expected.dev || stat.ino !== expected.ino) {
|
|
75943
|
-
throw new Error(`swift input changed while opening: ${file}`);
|
|
75944
|
-
}
|
|
75945
|
-
if (!stat.isFile() || stat.size > maxBytes) {
|
|
75946
|
-
throw new Error(`swift input exceeds ${maxBytes} bytes: ${file}`);
|
|
75947
|
-
}
|
|
75948
|
-
const bytes = Buffer.alloc(stat.size + 1);
|
|
75949
|
-
let offset = 0;
|
|
75950
|
-
while (offset < bytes.length) {
|
|
75951
|
-
const count = import_node_fs83.default.readSync(fd, bytes, offset, bytes.length - offset, null);
|
|
75952
|
-
if (count === 0) break;
|
|
75953
|
-
offset += count;
|
|
75954
|
-
}
|
|
75955
|
-
if (offset !== stat.size || import_node_fs83.default.fstatSync(fd).size !== stat.size) {
|
|
75956
|
-
throw new Error(`swift input changed while reading: ${file}`);
|
|
75957
|
-
}
|
|
75958
|
-
return bytes.subarray(0, offset);
|
|
75959
|
-
} finally {
|
|
75960
|
-
import_node_fs83.default.closeSync(fd);
|
|
75961
|
-
}
|
|
75962
|
-
}
|
|
75963
|
-
var import_node_fs83, import_node_path84;
|
|
75964
|
-
var init_swift_source_file = __esm({
|
|
75965
|
-
"src/swift-source-file.ts"() {
|
|
75966
|
-
"use strict";
|
|
75967
|
-
import_node_fs83 = __toESM(require("node:fs"), 1);
|
|
75968
|
-
import_node_path84 = __toESM(require("node:path"), 1);
|
|
75969
|
-
}
|
|
75970
|
-
});
|
|
75971
|
-
|
|
75972
76103
|
// src/swift-submit.ts
|
|
75973
76104
|
function httpSwiftCompileSubmit(context) {
|
|
75974
76105
|
const { assetReadToken, authorization, endpoint } = context;
|
|
@@ -76153,7 +76284,7 @@ function rnDependencies(reactNativeVersion, reactNativeRoot) {
|
|
|
76153
76284
|
if (reactNativeVersion === "1000.0.0") {
|
|
76154
76285
|
const versions = {};
|
|
76155
76286
|
for (const name3 of ["boost", "DoubleConversion", "fast_float", "fmt", "glog"]) {
|
|
76156
|
-
const file =
|
|
76287
|
+
const file = import_node_path86.default.join(reactNativeRoot, "third-party-podspecs", `${name3}.podspec`);
|
|
76157
76288
|
const text8 = readPackageFile(
|
|
76158
76289
|
reactNativeRoot,
|
|
76159
76290
|
file,
|
|
@@ -76163,7 +76294,7 @@ function rnDependencies(reactNativeVersion, reactNativeRoot) {
|
|
|
76163
76294
|
if (!version2) throw new Error(`${file}: cannot read dependency version`);
|
|
76164
76295
|
versions[name3] = version2;
|
|
76165
76296
|
}
|
|
76166
|
-
const helpers =
|
|
76297
|
+
const helpers = import_node_path86.default.join(reactNativeRoot, "scripts/cocoapods/helpers.rb");
|
|
76167
76298
|
const text7 = readPackageFile(
|
|
76168
76299
|
reactNativeRoot,
|
|
76169
76300
|
helpers,
|
|
@@ -76195,12 +76326,12 @@ function rnDependencies(reactNativeVersion, reactNativeRoot) {
|
|
|
76195
76326
|
return [];
|
|
76196
76327
|
}
|
|
76197
76328
|
function directory(dependency) {
|
|
76198
|
-
return
|
|
76329
|
+
return import_node_path86.default.join(rnxHomeDir(), "nitro-dependencies", dependency.sha256);
|
|
76199
76330
|
}
|
|
76200
76331
|
function manifestOf(dependency) {
|
|
76201
|
-
const file =
|
|
76202
|
-
if (!
|
|
76203
|
-
const value = JSON.parse(
|
|
76332
|
+
const file = import_node_path86.default.join(directory(dependency), "manifest.json");
|
|
76333
|
+
if (!import_node_fs85.default.existsSync(file)) return null;
|
|
76334
|
+
const value = JSON.parse(import_node_fs85.default.readFileSync(file, "utf8"));
|
|
76204
76335
|
if (!isRecord(value) || value.sha256 !== dependency.sha256 || !isRecord(value.files) || !Object.values(value.files).every((digest3) => typeof digest3 === "string"))
|
|
76205
76336
|
throw new Error(`invalid ${dependency.name} dependency manifest: ${file}`);
|
|
76206
76337
|
if (value.selection !== JSON.stringify([
|
|
@@ -76219,33 +76350,33 @@ async function prepareNitroDependencies(reactNativeVersion, reactNativeRoot) {
|
|
|
76219
76350
|
]) {
|
|
76220
76351
|
if (manifestOf(dependency)) continue;
|
|
76221
76352
|
const root = directory(dependency);
|
|
76222
|
-
const archive =
|
|
76353
|
+
const archive = import_node_path86.default.join(root, "source.tar.gz");
|
|
76223
76354
|
await fetchVerified(dependency, archive);
|
|
76224
|
-
const staging =
|
|
76355
|
+
const staging = import_node_fs85.default.mkdtempSync(import_node_path86.default.join(root, "tree-"));
|
|
76225
76356
|
await run7("tar", ["-xzf", archive, "-C", staging]);
|
|
76226
|
-
const tree2 =
|
|
76357
|
+
const tree2 = import_node_path86.default.join(staging, dependency.prefix);
|
|
76227
76358
|
const files2 = {};
|
|
76228
76359
|
const walk4 = (relative4) => {
|
|
76229
|
-
for (const entry of
|
|
76230
|
-
const name3 =
|
|
76360
|
+
for (const entry of import_node_fs85.default.readdirSync(import_node_path86.default.join(tree2, relative4), { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
76361
|
+
const name3 = import_node_path86.default.posix.join(relative4, entry.name);
|
|
76231
76362
|
if (entry.isSymbolicLink())
|
|
76232
76363
|
throw new Error(`${dependency.name} archive holds a symlink: ${name3}`);
|
|
76233
76364
|
if (entry.isDirectory()) walk4(name3);
|
|
76234
76365
|
else if (entry.isFile() && (dependency.files ?? HEADER4).test(entry.name))
|
|
76235
|
-
files2[name3] = (0, import_node_crypto52.createHash)("sha256").update(
|
|
76366
|
+
files2[name3] = (0, import_node_crypto52.createHash)("sha256").update(import_node_fs85.default.readFileSync(import_node_path86.default.join(tree2, name3))).digest("hex");
|
|
76236
76367
|
}
|
|
76237
76368
|
};
|
|
76238
76369
|
for (const sourceRoot of dependency.sourceDirectories ?? [dependency.headers.from])
|
|
76239
76370
|
walk4(sourceRoot);
|
|
76240
|
-
if (!
|
|
76371
|
+
if (!import_node_fs85.default.existsSync(import_node_path86.default.join(root, "tree")))
|
|
76241
76372
|
try {
|
|
76242
|
-
|
|
76373
|
+
import_node_fs85.default.renameSync(tree2, import_node_path86.default.join(root, "tree"));
|
|
76243
76374
|
} catch (error) {
|
|
76244
|
-
if (!
|
|
76375
|
+
if (!import_node_fs85.default.existsSync(import_node_path86.default.join(root, "tree"))) throw error;
|
|
76245
76376
|
}
|
|
76246
|
-
|
|
76247
|
-
const partial =
|
|
76248
|
-
|
|
76377
|
+
import_node_fs85.default.rmSync(staging, { recursive: true, force: true });
|
|
76378
|
+
const partial = import_node_path86.default.join(root, `manifest.json.${process.pid}.partial`);
|
|
76379
|
+
import_node_fs85.default.writeFileSync(
|
|
76249
76380
|
partial,
|
|
76250
76381
|
JSON.stringify({
|
|
76251
76382
|
sha256: dependency.sha256,
|
|
@@ -76256,7 +76387,7 @@ async function prepareNitroDependencies(reactNativeVersion, reactNativeRoot) {
|
|
|
76256
76387
|
files: files2
|
|
76257
76388
|
})
|
|
76258
76389
|
);
|
|
76259
|
-
|
|
76390
|
+
import_node_fs85.default.renameSync(partial, import_node_path86.default.join(root, "manifest.json"));
|
|
76260
76391
|
}
|
|
76261
76392
|
}
|
|
76262
76393
|
function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
|
|
@@ -76279,8 +76410,8 @@ function nitroDependencyReader(reactNativeVersion, reactNativeRoot) {
|
|
|
76279
76410
|
const relative4 = `${dependency.headers.from}${include.slice(dependency.headers.to.length)}`;
|
|
76280
76411
|
const digest3 = manifest.get(relative4);
|
|
76281
76412
|
if (!digest3) return null;
|
|
76282
|
-
const tree2 =
|
|
76283
|
-
const source =
|
|
76413
|
+
const tree2 = import_node_path86.default.join(directory(dependency), "tree");
|
|
76414
|
+
const source = import_node_path86.default.join(tree2, relative4);
|
|
76284
76415
|
const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
76285
76416
|
const original = (0, import_node_crypto52.createHash)("sha256").update(bytes).digest("hex");
|
|
76286
76417
|
if (original !== digest3)
|
|
@@ -76332,12 +76463,12 @@ function nitroDependencySources(reactNativeVersion, reactNativeRoot, select) {
|
|
|
76332
76463
|
for (const dependency of rnDependencies(reactNativeVersion, reactNativeRoot)) {
|
|
76333
76464
|
const manifest = manifestOf(dependency);
|
|
76334
76465
|
if (!manifest) throw new Error(`${dependency.name} source archive is not prepared`);
|
|
76335
|
-
const tree2 =
|
|
76466
|
+
const tree2 = import_node_path86.default.join(directory(dependency), "tree");
|
|
76336
76467
|
for (const [relative4, digest3] of manifest) {
|
|
76337
76468
|
if (!/\.(?:c|cc|cpp|cxx)$/.test(relative4)) continue;
|
|
76338
76469
|
const prepared = relative4.startsWith(`${dependency.headers.from}/`) ? dependency.headers.to + relative4.slice(dependency.headers.from.length) : relative4;
|
|
76339
76470
|
if (!select(dependency.name, prepared)) continue;
|
|
76340
|
-
const source =
|
|
76471
|
+
const source = import_node_path86.default.join(tree2, relative4);
|
|
76341
76472
|
const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
76342
76473
|
if ((0, import_node_crypto52.createHash)("sha256").update(bytes).digest("hex") !== digest3)
|
|
76343
76474
|
throw new Error(
|
|
@@ -76362,11 +76493,11 @@ function glogSources() {
|
|
|
76362
76493
|
const manifest = manifestOf(GLOG);
|
|
76363
76494
|
if (!manifest)
|
|
76364
76495
|
throw new Error("glog is not prepared; call prepareNitroDependencies first");
|
|
76365
|
-
const tree2 =
|
|
76496
|
+
const tree2 = import_node_path86.default.join(directory(GLOG), "tree");
|
|
76366
76497
|
const read = (relative4) => {
|
|
76367
76498
|
const digest3 = manifest.get(relative4);
|
|
76368
76499
|
if (!digest3) throw new Error(`glog ${GLOG.prefix} has no ${relative4}`);
|
|
76369
|
-
const source =
|
|
76500
|
+
const source = import_node_path86.default.join(tree2, relative4);
|
|
76370
76501
|
const bytes = readPackageFile(tree2, source, MAX_SWIFT_COMPILE_SOURCE_BYTES);
|
|
76371
76502
|
if ((0, import_node_crypto52.createHash)("sha256").update(bytes).digest("hex") !== digest3)
|
|
76372
76503
|
throw new Error(`glog source differs from its verified archive: ${relative4}`);
|
|
@@ -76406,14 +76537,14 @@ function glogSources() {
|
|
|
76406
76537
|
for (const unit2 of GLOG_UNITS) sources.push(read(unit2));
|
|
76407
76538
|
return sources;
|
|
76408
76539
|
}
|
|
76409
|
-
var import_node_child_process45, import_node_crypto52,
|
|
76540
|
+
var import_node_child_process45, import_node_crypto52, import_node_fs85, import_node_path86, import_node_util13, run7, DOUBLE_CONVERSION_WASM64_BACKPORT2, RN_SHARED_DEPENDENCIES, RN_FMT_11_DEPENDENCIES, RN_FAST_FLOAT_6_DEPENDENCIES, RN_FMT_12_DEPENDENCIES, HEADER4, GLOG, GLOG_SUBSTITUTIONS, GLOG_CONFIGURE, GLOG_CONFIG_APPENDIX, GLOG_UNITS;
|
|
76410
76541
|
var init_nitro_dependencies = __esm({
|
|
76411
76542
|
"src/nitro-dependencies.ts"() {
|
|
76412
76543
|
"use strict";
|
|
76413
76544
|
import_node_child_process45 = require("node:child_process");
|
|
76414
76545
|
import_node_crypto52 = require("node:crypto");
|
|
76415
|
-
|
|
76416
|
-
|
|
76546
|
+
import_node_fs85 = __toESM(require("node:fs"), 1);
|
|
76547
|
+
import_node_path86 = __toESM(require("node:path"), 1);
|
|
76417
76548
|
import_node_util13 = require("node:util");
|
|
76418
76549
|
init_home_paths();
|
|
76419
76550
|
init_is_record();
|
|
@@ -76693,7 +76824,7 @@ async function cliAdvertises(cli, args, token, appRoot) {
|
|
|
76693
76824
|
}
|
|
76694
76825
|
function declaresDependency(appRoot, name3) {
|
|
76695
76826
|
const manifest = JSON.parse(
|
|
76696
|
-
|
|
76827
|
+
import_node_fs86.default.readFileSync(import_node_path87.default.join(appRoot, "package.json"), "utf8")
|
|
76697
76828
|
);
|
|
76698
76829
|
return isRecord(manifest) && ["dependencies", "devDependencies"].some((field) => {
|
|
76699
76830
|
const group = manifest[field];
|
|
@@ -76702,7 +76833,7 @@ function declaresDependency(appRoot, name3) {
|
|
|
76702
76833
|
}
|
|
76703
76834
|
async function reactNativeAutolinkingConfig(appRoot, platform2, signal) {
|
|
76704
76835
|
signal?.throwIfAborted();
|
|
76705
|
-
const root =
|
|
76836
|
+
const root = import_node_fs86.default.realpathSync(appRoot);
|
|
76706
76837
|
const key2 = `${platform2}:${root}`;
|
|
76707
76838
|
let shared = inFlight.get(key2);
|
|
76708
76839
|
if (!shared) {
|
|
@@ -76721,15 +76852,15 @@ async function reactNativeAutolinkingConfig(appRoot, platform2, signal) {
|
|
|
76721
76852
|
});
|
|
76722
76853
|
}
|
|
76723
76854
|
async function readAutolinkingConfig(appRoot, platform2) {
|
|
76724
|
-
const appRequire = (0, import_node_module7.createRequire)(
|
|
76725
|
-
const expoManifest2 = appRequire.resolve.paths("expo")?.map((directory2) =>
|
|
76726
|
-
const expoRequire = expoManifest2 ? (0, import_node_module7.createRequire)(
|
|
76727
|
-
const nativeFile = (platform2 === "ios" ? ["ios/Podfile"] : ["android/settings.gradle", "android/settings.gradle.kts"]).map((name3) =>
|
|
76728
|
-
const nativeSource = nativeFile ?
|
|
76855
|
+
const appRequire = (0, import_node_module7.createRequire)(import_node_path87.default.join(appRoot, "package.json"));
|
|
76856
|
+
const expoManifest2 = appRequire.resolve.paths("expo")?.map((directory2) => import_node_path87.default.join(directory2, "expo/package.json")).find((manifest) => import_node_fs86.default.existsSync(manifest));
|
|
76857
|
+
const expoRequire = expoManifest2 ? (0, import_node_module7.createRequire)(import_node_fs86.default.realpathSync(expoManifest2)) : appRequire;
|
|
76858
|
+
const nativeFile = (platform2 === "ios" ? ["ios/Podfile"] : ["android/settings.gradle", "android/settings.gradle.kts"]).map((name3) => import_node_path87.default.join(appRoot, name3)).find((file) => import_node_fs86.default.existsSync(file));
|
|
76859
|
+
const nativeSource = nativeFile ? import_node_fs86.default.readFileSync(nativeFile, "utf8") : null;
|
|
76729
76860
|
const asksExpo = process.env.EXPO_USE_COMMUNITY_AUTOLINKING !== "1" && (nativeSource === null ? declaresDependency(appRoot, "expo") : nativeSource.includes("expo-modules-autolinking") || platform2 === "android" && nativeSource.includes("expoAutolinking.rnConfigCommand"));
|
|
76730
|
-
const expoAutolinker = asksExpo ? [appRequire, expoRequire].flatMap((req) => req.resolve.paths("expo-modules-autolinking") ?? []).map((directory2) =>
|
|
76861
|
+
const expoAutolinker = asksExpo ? [appRequire, expoRequire].flatMap((req) => req.resolve.paths("expo-modules-autolinking") ?? []).map((directory2) => import_node_path87.default.join(directory2, "expo-modules-autolinking/package.json")).find((manifest) => import_node_fs86.default.existsSync(manifest)) : void 0;
|
|
76731
76862
|
if (expoAutolinker) {
|
|
76732
|
-
const cli2 =
|
|
76863
|
+
const cli2 = import_node_path87.default.join(import_node_path87.default.dirname(expoAutolinker), "bin/expo-modules-autolinking.js");
|
|
76733
76864
|
if (await cliAdvertises(cli2, ["--help"], "react-native-config", appRoot)) {
|
|
76734
76865
|
const args = [
|
|
76735
76866
|
"react-native-config",
|
|
@@ -76754,15 +76885,15 @@ async function readAutolinkingConfig(appRoot, platform2) {
|
|
|
76754
76885
|
)
|
|
76755
76886
|
) : appRequire;
|
|
76756
76887
|
const cliManifest = cliRequire.resolve("@react-native-community/cli/package.json");
|
|
76757
|
-
const cli = JSON.parse(
|
|
76888
|
+
const cli = JSON.parse(import_node_fs86.default.readFileSync(cliManifest, "utf8"));
|
|
76758
76889
|
const bins = isRecord(cli) && isRecord(cli.bin) ? cli.bin : void 0;
|
|
76759
76890
|
const bin = [bins?.["rnc-cli"], bins?.["react-native"]].find(
|
|
76760
76891
|
(entry) => typeof entry === "string"
|
|
76761
76892
|
);
|
|
76762
76893
|
if (bin === void 0) throw new Error(`${cliManifest} declares no CLI bin`);
|
|
76763
|
-
const cliPath =
|
|
76894
|
+
const cliPath = import_node_path87.default.join(import_node_path87.default.dirname(cliManifest), bin);
|
|
76764
76895
|
const configManifest = JSON.parse(
|
|
76765
|
-
|
|
76896
|
+
import_node_fs86.default.readFileSync(
|
|
76766
76897
|
(0, import_node_module7.createRequire)(cliManifest).resolve(
|
|
76767
76898
|
"@react-native-community/cli-config/package.json"
|
|
76768
76899
|
),
|
|
@@ -76781,13 +76912,13 @@ async function readAutolinkingConfig(appRoot, platform2) {
|
|
|
76781
76912
|
})
|
|
76782
76913
|
);
|
|
76783
76914
|
}
|
|
76784
|
-
var
|
|
76915
|
+
var import_node_fs86, import_node_module7, import_node_path87, inFlight;
|
|
76785
76916
|
var init_react_native_autolinking = __esm({
|
|
76786
76917
|
"src/react-native-autolinking.ts"() {
|
|
76787
76918
|
"use strict";
|
|
76788
|
-
|
|
76919
|
+
import_node_fs86 = __toESM(require("node:fs"), 1);
|
|
76789
76920
|
import_node_module7 = require("node:module");
|
|
76790
|
-
|
|
76921
|
+
import_node_path87 = __toESM(require("node:path"), 1);
|
|
76791
76922
|
init_autolinker_process();
|
|
76792
76923
|
init_is_record();
|
|
76793
76924
|
inFlight = /* @__PURE__ */ new Map();
|
|
@@ -76802,26 +76933,26 @@ function readJson(root, relative4) {
|
|
|
76802
76933
|
return JSON.parse(
|
|
76803
76934
|
readPackageFile(
|
|
76804
76935
|
root,
|
|
76805
|
-
|
|
76936
|
+
import_node_path88.default.join(root, relative4),
|
|
76806
76937
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
76807
76938
|
).toString("utf8")
|
|
76808
76939
|
);
|
|
76809
76940
|
}
|
|
76810
76941
|
function packageInfo(root) {
|
|
76811
|
-
root =
|
|
76942
|
+
root = import_node_fs87.default.realpathSync(root);
|
|
76812
76943
|
const value = readJson(root, "package.json");
|
|
76813
76944
|
if (!object5(value) || typeof value.name !== "string" || value.name.length === 0 || typeof value.version !== "string" || value.version.length === 0)
|
|
76814
76945
|
throw new Error(`${root}: package.json needs a name and version`);
|
|
76815
76946
|
return { name: value.name, version: value.version, root };
|
|
76816
76947
|
}
|
|
76817
76948
|
function registrations(root) {
|
|
76818
|
-
const directory2 =
|
|
76819
|
-
const initializers =
|
|
76949
|
+
const directory2 = import_node_path88.default.join(root, "nitrogen/generated/ios");
|
|
76950
|
+
const initializers = import_node_fs87.default.readdirSync(directory2).filter((file) => file.endsWith("Autolinking.mm"));
|
|
76820
76951
|
if (initializers.length !== 1)
|
|
76821
76952
|
throw new Error(`${root}: expected one generated Nitro iOS initializer`);
|
|
76822
76953
|
const source = readPackageFile(
|
|
76823
76954
|
root,
|
|
76824
|
-
|
|
76955
|
+
import_node_path88.default.join(directory2, initializers[0]),
|
|
76825
76956
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
76826
76957
|
).toString("utf8");
|
|
76827
76958
|
const namespaces = [
|
|
@@ -76884,18 +77015,18 @@ function registrations(root) {
|
|
|
76884
77015
|
if (new Set(classes.map(({ name: name3 }) => name3)).size !== classes.length)
|
|
76885
77016
|
throw new Error(`${root}: duplicate generated Nitro iOS registration`);
|
|
76886
77017
|
classes.sort((a, b) => a.name.localeCompare(b.name));
|
|
76887
|
-
const ios =
|
|
76888
|
-
if (swiftModule === null &&
|
|
77018
|
+
const ios = import_node_path88.default.join(root, "ios");
|
|
77019
|
+
if (swiftModule === null && import_node_fs87.default.existsSync(ios) && import_node_fs87.default.readdirSync(ios, { recursive: true, encoding: "utf8" }).some((file) => file.endsWith(".swift") && !file.startsWith("Tests")))
|
|
76889
77020
|
swiftModule = initializers[0].slice(0, -"Autolinking.mm".length);
|
|
76890
77021
|
return { namespace, swiftModule, classes, views: viewNames(root, classes) };
|
|
76891
77022
|
}
|
|
76892
77023
|
function viewNames(root, classes) {
|
|
76893
|
-
const directory2 =
|
|
76894
|
-
if (!
|
|
77024
|
+
const directory2 = import_node_path88.default.join(root, "nitrogen/generated/shared/json");
|
|
77025
|
+
if (!import_node_fs87.default.existsSync(directory2)) return /* @__PURE__ */ new Set();
|
|
76895
77026
|
const views = /* @__PURE__ */ new Set();
|
|
76896
|
-
for (const file of
|
|
77027
|
+
for (const file of import_node_fs87.default.readdirSync(directory2)) {
|
|
76897
77028
|
if (!file.endsWith("Config.json")) continue;
|
|
76898
|
-
const config = readJson(root,
|
|
77029
|
+
const config = readJson(root, import_node_path88.default.join("nitrogen/generated/shared/json", file));
|
|
76899
77030
|
const name3 = object5(config) ? config.uiViewClassName : void 0;
|
|
76900
77031
|
if (typeof name3 === "string" && classes.some((entry) => entry.name === name3))
|
|
76901
77032
|
views.add(name3);
|
|
@@ -76904,10 +77035,10 @@ function viewNames(root, classes) {
|
|
|
76904
77035
|
}
|
|
76905
77036
|
function swiftViewComponent(root, swiftModule, name3) {
|
|
76906
77037
|
const directory2 = "nitrogen/generated/ios/c++/views";
|
|
76907
|
-
const read = (file) => readPackageFile(root,
|
|
77038
|
+
const read = (file) => readPackageFile(root, import_node_path88.default.join(root, file), MAX_SWIFT_COMPILE_SOURCE_BYTES).toString(
|
|
76908
77039
|
"utf8"
|
|
76909
77040
|
);
|
|
76910
|
-
const files2 =
|
|
77041
|
+
const files2 = import_node_fs87.default.existsSync(import_node_path88.default.join(root, directory2)) ? import_node_fs87.default.readdirSync(import_node_path88.default.join(root, directory2)).filter((file) => file.endsWith(".mm")) : [];
|
|
76911
77042
|
for (const file of files2) {
|
|
76912
77043
|
const source = read(`${directory2}/${file}`);
|
|
76913
77044
|
const created = /\bstd::shared_ptr<\w+>\s+hybridView\s*=\s*(\w+)::(\w+)::create(\w+)\(\);/.exec(
|
|
@@ -76936,7 +77067,7 @@ function swiftViewComponent(root, swiftModule, name3) {
|
|
|
76936
77067
|
const drop = /\bswiftPart\.(maybePrepareForRecycle|onDropView)\(\)/.exec(source)?.[1] ?? null;
|
|
76937
77068
|
return {
|
|
76938
77069
|
spec: spec[1],
|
|
76939
|
-
componentSource:
|
|
77070
|
+
componentSource: import_node_fs87.default.realpathSync(import_node_path88.default.join(root, directory2, file)),
|
|
76940
77071
|
props: parsed2.filter((prop) => prop.name !== "hybridRef"),
|
|
76941
77072
|
transaction: source.includes("hasTransactionPropChanges"),
|
|
76942
77073
|
drop
|
|
@@ -76945,8 +77076,8 @@ function swiftViewComponent(root, swiftModule, name3) {
|
|
|
76945
77076
|
throw new Error(`${root}: Nitro view ${name3} has no generated iOS view component`);
|
|
76946
77077
|
}
|
|
76947
77078
|
function hasNitroIosInitializer(root) {
|
|
76948
|
-
const generated =
|
|
76949
|
-
return
|
|
77079
|
+
const generated = import_node_path88.default.join(root, "nitrogen/generated/ios");
|
|
77080
|
+
return import_node_fs87.default.existsSync(generated) && import_node_fs87.default.readdirSync(generated).some((file) => file.endsWith("Autolinking.mm"));
|
|
76950
77081
|
}
|
|
76951
77082
|
function nitroRegisteredNames(root) {
|
|
76952
77083
|
if (!hasNitroIosInitializer(root)) return null;
|
|
@@ -76992,7 +77123,7 @@ async function iosAutolinkingConfig(appRoot, signal) {
|
|
|
76992
77123
|
return reactNativeAutolinkingConfig(appRoot, "ios", signal);
|
|
76993
77124
|
}
|
|
76994
77125
|
async function iosAutolinkedDependencies(appRoot, signal) {
|
|
76995
|
-
appRoot =
|
|
77126
|
+
appRoot = import_node_fs87.default.realpathSync(appRoot);
|
|
76996
77127
|
const config = await iosAutolinkingConfig(appRoot, signal);
|
|
76997
77128
|
const dependencies = object5(config) ? config.dependencies : void 0;
|
|
76998
77129
|
if (!object5(dependencies))
|
|
@@ -77020,13 +77151,13 @@ async function iosAutolinkedDependencies(appRoot, signal) {
|
|
|
77020
77151
|
function dependencyRootsFor(options2) {
|
|
77021
77152
|
if (options2.dependencyRoots !== void 0) return options2.dependencyRoots;
|
|
77022
77153
|
const appRequire = (0, import_node_module8.createRequire)(
|
|
77023
|
-
|
|
77154
|
+
import_node_path88.default.join(import_node_fs87.default.realpathSync(options2.appRoot), "package.json")
|
|
77024
77155
|
);
|
|
77025
77156
|
return {
|
|
77026
|
-
nitroModules:
|
|
77157
|
+
nitroModules: import_node_path88.default.dirname(
|
|
77027
77158
|
appRequire.resolve("react-native-nitro-modules/package.json")
|
|
77028
77159
|
),
|
|
77029
|
-
reactNative:
|
|
77160
|
+
reactNative: import_node_path88.default.dirname(appRequire.resolve("react-native/package.json"))
|
|
77030
77161
|
};
|
|
77031
77162
|
}
|
|
77032
77163
|
function prepareNitroSourceDependencies(options2) {
|
|
@@ -77034,7 +77165,7 @@ function prepareNitroSourceDependencies(options2) {
|
|
|
77034
77165
|
return prepareNitroDependencies(reactNative.version, reactNative.root);
|
|
77035
77166
|
}
|
|
77036
77167
|
function readPodspecMetadata(root, appRoot) {
|
|
77037
|
-
const podspecs =
|
|
77168
|
+
const podspecs = import_node_fs87.default.readdirSync(root).filter((file) => file.endsWith(".podspec")).sort();
|
|
77038
77169
|
if (podspecs.length === 0)
|
|
77039
77170
|
return {
|
|
77040
77171
|
podName: null,
|
|
@@ -77043,7 +77174,7 @@ function readPodspecMetadata(root, appRoot) {
|
|
|
77043
77174
|
defines: [],
|
|
77044
77175
|
cStandard: null
|
|
77045
77176
|
};
|
|
77046
|
-
const spec = loadPodspec(
|
|
77177
|
+
const spec = loadPodspec(import_node_path88.default.join(root, podspecs[0]), appRoot);
|
|
77047
77178
|
const members2 = podspecMembers(spec);
|
|
77048
77179
|
const configs = members2.map(
|
|
77049
77180
|
(member) => import_zod2.z.record(import_zod2.z.string(), import_zod2.z.union([import_zod2.z.string(), import_zod2.z.array(import_zod2.z.string())])).parse(member.attrs.get("pod_target_xcconfig") ?? {})
|
|
@@ -77064,7 +77195,7 @@ function readPodspecMetadata(root, appRoot) {
|
|
|
77064
77195
|
...field("HEADER_SEARCH_PATHS").matchAll(
|
|
77065
77196
|
/\$[({]PODS_TARGET_SRCROOT[)}]\/([^\s"'\\)}$]+)/g
|
|
77066
77197
|
)
|
|
77067
|
-
].map((match) => match[1].replace(/\/+$/, "")).filter((dir) =>
|
|
77198
|
+
].map((match) => match[1].replace(/\/+$/, "")).filter((dir) => import_node_fs87.default.existsSync(import_node_path88.default.join(root, dir)))
|
|
77068
77199
|
)
|
|
77069
77200
|
];
|
|
77070
77201
|
const defines = field("GCC_PREPROCESSOR_DEFINITIONS").split(/\s+/).filter(
|
|
@@ -77085,8 +77216,8 @@ function buildPodRootIndex(seedRoots, extraRoots, appRoot) {
|
|
|
77085
77216
|
const visitedRoots = /* @__PURE__ */ new Set();
|
|
77086
77217
|
const visitedDirectories = /* @__PURE__ */ new Set();
|
|
77087
77218
|
const addRoot = (candidate) => {
|
|
77088
|
-
if (!
|
|
77089
|
-
const real =
|
|
77219
|
+
if (!import_node_fs87.default.existsSync(import_node_path88.default.join(candidate, "package.json"))) return;
|
|
77220
|
+
const real = import_node_fs87.default.realpathSync(candidate);
|
|
77090
77221
|
if (visitedRoots.has(real)) return;
|
|
77091
77222
|
visitedRoots.add(real);
|
|
77092
77223
|
if (!hasNitroIosInitializer(real)) return;
|
|
@@ -77095,21 +77226,21 @@ function buildPodRootIndex(seedRoots, extraRoots, appRoot) {
|
|
|
77095
77226
|
};
|
|
77096
77227
|
for (const root of extraRoots) addRoot(root);
|
|
77097
77228
|
for (const seed of seedRoots) {
|
|
77098
|
-
const providerRequire = (0, import_node_module8.createRequire)(
|
|
77229
|
+
const providerRequire = (0, import_node_module8.createRequire)(import_node_path88.default.join(seed, "package.json"));
|
|
77099
77230
|
for (const dir of providerRequire.resolve.paths(".") ?? []) {
|
|
77100
|
-
if (!
|
|
77101
|
-
const directory2 =
|
|
77231
|
+
if (!import_node_fs87.default.existsSync(dir)) continue;
|
|
77232
|
+
const directory2 = import_node_fs87.default.realpathSync(dir);
|
|
77102
77233
|
if (visitedDirectories.has(directory2)) continue;
|
|
77103
77234
|
visitedDirectories.add(directory2);
|
|
77104
|
-
for (const entry of
|
|
77235
|
+
for (const entry of import_node_fs87.default.readdirSync(dir, { withFileTypes: true })) {
|
|
77105
77236
|
if (entry.name.startsWith(".")) continue;
|
|
77106
77237
|
if (entry.name.startsWith("@")) {
|
|
77107
|
-
const scopeDir =
|
|
77108
|
-
for (const scoped of
|
|
77109
|
-
if (!scoped.name.startsWith(".")) addRoot(
|
|
77238
|
+
const scopeDir = import_node_path88.default.join(dir, entry.name);
|
|
77239
|
+
for (const scoped of import_node_fs87.default.readdirSync(scopeDir, { withFileTypes: true })) {
|
|
77240
|
+
if (!scoped.name.startsWith(".")) addRoot(import_node_path88.default.join(scopeDir, scoped.name));
|
|
77110
77241
|
}
|
|
77111
77242
|
} else {
|
|
77112
|
-
addRoot(
|
|
77243
|
+
addRoot(import_node_path88.default.join(dir, entry.name));
|
|
77113
77244
|
}
|
|
77114
77245
|
}
|
|
77115
77246
|
}
|
|
@@ -77117,9 +77248,9 @@ function buildPodRootIndex(seedRoots, extraRoots, appRoot) {
|
|
|
77117
77248
|
return byPod;
|
|
77118
77249
|
}
|
|
77119
77250
|
function resolveDependencyManifestRoot(providerRoot, depName) {
|
|
77120
|
-
const providerRequire = (0, import_node_module8.createRequire)(
|
|
77121
|
-
const depManifest = providerRequire.resolve.paths(depName)?.map((directory2) =>
|
|
77122
|
-
return depManifest ?
|
|
77251
|
+
const providerRequire = (0, import_node_module8.createRequire)(import_node_path88.default.join(providerRoot, "package.json"));
|
|
77252
|
+
const depManifest = providerRequire.resolve.paths(depName)?.map((directory2) => import_node_path88.default.join(directory2, depName, "package.json")).find((candidate) => import_node_fs87.default.existsSync(candidate));
|
|
77253
|
+
return depManifest ? import_node_fs87.default.realpathSync(import_node_path88.default.dirname(depManifest)) : null;
|
|
77123
77254
|
}
|
|
77124
77255
|
function discoverSelectedAndPeerNitroNodes(options2) {
|
|
77125
77256
|
const selections = selectNitroProviders(options2.packageRoots, options2.answers);
|
|
@@ -77313,7 +77444,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77313
77444
|
if (file === original) return;
|
|
77314
77445
|
add(
|
|
77315
77446
|
file,
|
|
77316
|
-
`#include ${JSON.stringify(
|
|
77447
|
+
`#include ${JSON.stringify(import_node_path88.default.posix.relative(import_node_path88.default.posix.dirname(file), original))}
|
|
77317
77448
|
`
|
|
77318
77449
|
);
|
|
77319
77450
|
result.aliases[file] = original;
|
|
@@ -77331,13 +77462,13 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77331
77462
|
const flatAliases = flatAliasesByTarget.get(name3) ?? /* @__PURE__ */ new Map();
|
|
77332
77463
|
flatAliasesByTarget.set(name3, flatAliases);
|
|
77333
77464
|
const walk4 = (relative4) => {
|
|
77334
|
-
const disk =
|
|
77335
|
-
if (!
|
|
77336
|
-
if (
|
|
77465
|
+
const disk = import_node_path88.default.join(root, relative4);
|
|
77466
|
+
if (!import_node_fs87.default.existsSync(disk)) return;
|
|
77467
|
+
if (import_node_fs87.default.lstatSync(disk).isSymbolicLink())
|
|
77337
77468
|
throw new Error(`Nitro source directory is a symlink: ${disk}`);
|
|
77338
|
-
for (const entry of
|
|
77469
|
+
for (const entry of import_node_fs87.default.readdirSync(disk, { withFileTypes: true }).sort((a, b) => a.name.localeCompare(b.name))) {
|
|
77339
77470
|
if (entry.name.startsWith(".") || skip.has(entry.name)) continue;
|
|
77340
|
-
const sourceRelative =
|
|
77471
|
+
const sourceRelative = import_node_path88.default.posix.join(relative4, entry.name);
|
|
77341
77472
|
if (entry.isDirectory()) {
|
|
77342
77473
|
walk4(sourceRelative);
|
|
77343
77474
|
continue;
|
|
@@ -77346,12 +77477,12 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77346
77477
|
if (!select(entry.name)) continue;
|
|
77347
77478
|
if (/[\p{Cc}"\\]/u.test(sourceRelative))
|
|
77348
77479
|
throw new Error(`invalid Nitro source path: ${sourceRelative}`);
|
|
77349
|
-
const source =
|
|
77480
|
+
const source = import_node_fs87.default.realpathSync(import_node_path88.default.join(root, sourceRelative));
|
|
77350
77481
|
if (providerRoots.has(root) && /\.(?:c|cc|cpp|cxx|m|mm|swift)$/.test(entry.name) && !nativeSourceKeys.has(projectSourceKey([sourceRoot], source)))
|
|
77351
77482
|
continue;
|
|
77352
|
-
if (/\.mm?$/.test(entry.name) && /\bRCT_EXTERN_(?:REMAP_)?MODULE\s*\(/.test(
|
|
77483
|
+
if (/\.mm?$/.test(entry.name) && /\bRCT_EXTERN_(?:REMAP_)?MODULE\s*\(/.test(import_node_fs87.default.readFileSync(source, "utf8")))
|
|
77353
77484
|
continue;
|
|
77354
|
-
const key2 = `${targetPath(name3)}/upstream/${
|
|
77485
|
+
const key2 = `${targetPath(name3)}/upstream/${import_node_path88.default.relative(root, source).split(import_node_path88.default.sep).join("/")}`;
|
|
77355
77486
|
let original = originals.get(source);
|
|
77356
77487
|
if (!original) {
|
|
77357
77488
|
const bytes = readPackageFile(root, source, Infinity);
|
|
@@ -77391,7 +77522,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77391
77522
|
flatAliases.set(entry.name, flatKey);
|
|
77392
77523
|
alias(flatKey, original);
|
|
77393
77524
|
}
|
|
77394
|
-
const fromRoot =
|
|
77525
|
+
const fromRoot = import_node_path88.default.posix.relative(directory2, sourceRelative);
|
|
77395
77526
|
if (searchRootDirs.has(directory2) && fromRoot !== entry.name)
|
|
77396
77527
|
alias(`${targetPath(name3)}/include/${fromRoot}`, original);
|
|
77397
77528
|
for (const searchRoot of searchRootDirs) {
|
|
@@ -77422,7 +77553,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77422
77553
|
(file) => file.endsWith(".h") && file !== "JSIDynamic.h" || file === "jsi.cpp"
|
|
77423
77554
|
);
|
|
77424
77555
|
collect(nitro.root, "cpp", coreTarget, "NitroModules", /* @__PURE__ */ new Set(["views"]));
|
|
77425
|
-
if (
|
|
77556
|
+
if (import_node_fs87.default.existsSync(import_node_path88.default.join(nitro.root, "cpp/views"))) {
|
|
77426
77557
|
collect(
|
|
77427
77558
|
nitro.root,
|
|
77428
77559
|
"cpp/views",
|
|
@@ -77433,10 +77564,10 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77433
77564
|
/\.(?:h|hh|hpp|hxx|inl|inc)$/
|
|
77434
77565
|
);
|
|
77435
77566
|
}
|
|
77436
|
-
const appleLayout =
|
|
77567
|
+
const appleLayout = import_node_fs87.default.existsSync(import_node_path88.default.join(nitro.root, "apple"));
|
|
77437
77568
|
const nitroBridgeDirectories = appleLayout ? ["apple/core/core", "apple/core/utils"] : ["ios/core", "ios/utils"];
|
|
77438
77569
|
const bridgeHeaders = swiftModules.size > 0 || allModules.some(
|
|
77439
|
-
({ provider }) =>
|
|
77570
|
+
({ provider }) => import_node_fs87.default.existsSync(import_node_path88.default.join(provider.root, "ios")) && import_node_fs87.default.readdirSync(import_node_path88.default.join(provider.root, "ios"), {
|
|
77440
77571
|
recursive: true,
|
|
77441
77572
|
encoding: "utf8"
|
|
77442
77573
|
}).some((file) => /\.mm?$/.test(file) && !file.startsWith("Tests"))
|
|
@@ -77481,16 +77612,16 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77481
77612
|
const importedSwiftModules = (providerRoot) => {
|
|
77482
77613
|
const modules = /* @__PURE__ */ new Set();
|
|
77483
77614
|
for (const dir of ["ios", "nitrogen/generated/ios"]) {
|
|
77484
|
-
const rootDir =
|
|
77485
|
-
if (!
|
|
77486
|
-
for (const entry of
|
|
77615
|
+
const rootDir = import_node_path88.default.join(providerRoot, dir);
|
|
77616
|
+
if (!import_node_fs87.default.existsSync(rootDir)) continue;
|
|
77617
|
+
for (const entry of import_node_fs87.default.readdirSync(rootDir, {
|
|
77487
77618
|
recursive: true,
|
|
77488
77619
|
withFileTypes: true
|
|
77489
77620
|
})) {
|
|
77490
77621
|
if (!entry.isFile() || !entry.name.endsWith(".swift")) continue;
|
|
77491
77622
|
const source = readPackageFile(
|
|
77492
77623
|
providerRoot,
|
|
77493
|
-
|
|
77624
|
+
import_node_path88.default.join(entry.parentPath, entry.name),
|
|
77494
77625
|
MAX_SWIFT_COMPILE_SOURCE_BYTES
|
|
77495
77626
|
).toString("utf8");
|
|
77496
77627
|
for (const match of source.matchAll(/^\s*import\s+([A-Za-z_]\w*)/gm)) {
|
|
@@ -77511,20 +77642,20 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77511
77642
|
const peerDeps = object5(manifest.peerDependencies) ? Object.keys(manifest.peerDependencies).filter((name3) => !directDeps.has(name3)) : [];
|
|
77512
77643
|
const depNames = [...directDeps, ...peerDeps];
|
|
77513
77644
|
if (depNames.length === 0) return [];
|
|
77514
|
-
const providerRequire = (0, import_node_module8.createRequire)(
|
|
77645
|
+
const providerRequire = (0, import_node_module8.createRequire)(import_node_path88.default.join(providerRoot, "package.json"));
|
|
77515
77646
|
const podspecDeps = new Set(node.podspec.dependencies);
|
|
77516
77647
|
let swiftImports;
|
|
77517
77648
|
const deps = [];
|
|
77518
77649
|
for (const depName of [...new Set(depNames)].sort()) {
|
|
77519
|
-
const depManifest = providerRequire.resolve.paths(depName)?.map((directory2) =>
|
|
77650
|
+
const depManifest = providerRequire.resolve.paths(depName)?.map((directory2) => import_node_path88.default.join(directory2, depName, "package.json")).find((candidate) => import_node_fs87.default.existsSync(candidate));
|
|
77520
77651
|
if (!depManifest) continue;
|
|
77521
|
-
const depRoot =
|
|
77522
|
-
if (hasNitroIosInitializer(depRoot) || !
|
|
77652
|
+
const depRoot = import_node_fs87.default.realpathSync(import_node_path88.default.dirname(depManifest));
|
|
77653
|
+
if (hasNitroIosInitializer(depRoot) || !import_node_fs87.default.existsSync(import_node_path88.default.join(depRoot, "ios")))
|
|
77523
77654
|
continue;
|
|
77524
|
-
const podspecs =
|
|
77655
|
+
const podspecs = import_node_fs87.default.readdirSync(depRoot).filter((file) => file.endsWith(".podspec")).sort();
|
|
77525
77656
|
if (podspecs.length !== 1) continue;
|
|
77526
77657
|
const podName = podspecName(
|
|
77527
|
-
loadPodspec(
|
|
77658
|
+
loadPodspec(import_node_path88.default.join(depRoot, podspecs[0]), options2.appRoot)
|
|
77528
77659
|
);
|
|
77529
77660
|
if (!directDeps.has(depName) && !podspecDeps.has(podName)) {
|
|
77530
77661
|
swiftImports ??= importedSwiftModules(providerRoot);
|
|
@@ -77533,8 +77664,8 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77533
77664
|
let registered = companionPods.get(podName);
|
|
77534
77665
|
if (!registered) {
|
|
77535
77666
|
registered = [];
|
|
77536
|
-
const modulemapPath =
|
|
77537
|
-
if (
|
|
77667
|
+
const modulemapPath = import_node_path88.default.join(depRoot, "ios/module.modulemap");
|
|
77668
|
+
if (import_node_fs87.default.existsSync(modulemapPath)) {
|
|
77538
77669
|
const modulemapBytes = readPackageFile(depRoot, modulemapPath, Infinity);
|
|
77539
77670
|
const modulemapText = modulemapBytes.toString("utf8");
|
|
77540
77671
|
const clangModule = /\bmodule\s+([A-Za-z_]\w*)\s*\{/.exec(modulemapText)?.[1];
|
|
@@ -77553,7 +77684,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77553
77684
|
add(mapKey, modulemapText);
|
|
77554
77685
|
result.sources.push({
|
|
77555
77686
|
file: mapKey,
|
|
77556
|
-
source:
|
|
77687
|
+
source: import_node_fs87.default.realpathSync(modulemapPath),
|
|
77557
77688
|
sha256: (0, import_node_crypto53.createHash)("sha256").update(modulemapBytes).digest("hex")
|
|
77558
77689
|
});
|
|
77559
77690
|
registered.push(clangModule);
|
|
@@ -77589,22 +77720,22 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77589
77720
|
/^\s*#\s*(?:include|import)\s*([<"])([^>"\n]+)[>"]/gm
|
|
77590
77721
|
)) {
|
|
77591
77722
|
const candidates = quote3 === '"' ? [
|
|
77592
|
-
|
|
77723
|
+
import_node_path88.default.posix.join(import_node_path88.default.posix.dirname(includerRel), include),
|
|
77593
77724
|
include,
|
|
77594
|
-
...searchRoots.map((dir) =>
|
|
77595
|
-
|
|
77725
|
+
...searchRoots.map((dir) => import_node_path88.default.posix.join(dir, include)),
|
|
77726
|
+
import_node_path88.default.posix.join("cpp", include)
|
|
77596
77727
|
] : [
|
|
77597
|
-
...searchRoots.map((dir) =>
|
|
77598
|
-
|
|
77728
|
+
...searchRoots.map((dir) => import_node_path88.default.posix.join(dir, include)),
|
|
77729
|
+
import_node_path88.default.posix.join("cpp", include),
|
|
77599
77730
|
include
|
|
77600
77731
|
];
|
|
77601
77732
|
for (const candidate of candidates) {
|
|
77602
|
-
const normalized =
|
|
77733
|
+
const normalized = import_node_path88.default.posix.normalize(candidate);
|
|
77603
77734
|
if (normalized.startsWith("..")) continue;
|
|
77604
|
-
const disk =
|
|
77605
|
-
if (!
|
|
77606
|
-
const real =
|
|
77607
|
-
const canonicalRel =
|
|
77735
|
+
const disk = import_node_path88.default.join(root, normalized);
|
|
77736
|
+
if (!import_node_fs87.default.statSync(disk, { throwIfNoEntry: false })?.isFile()) continue;
|
|
77737
|
+
const real = import_node_fs87.default.realpathSync(disk);
|
|
77738
|
+
const canonicalRel = import_node_path88.default.relative(root, real).split(import_node_path88.default.sep).join("/");
|
|
77608
77739
|
if (canonicalRel.startsWith("..")) continue;
|
|
77609
77740
|
const key2 = `${prefix}${canonicalRel}`;
|
|
77610
77741
|
if (!Object.hasOwn(result.files, key2)) {
|
|
@@ -77638,13 +77769,13 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77638
77769
|
const podName = node.podspec.podName ?? config.swiftModule ?? module2.name;
|
|
77639
77770
|
const searchRoots = node.podspec.headerSearchPaths;
|
|
77640
77771
|
for (const dir of searchRoots) searchRootDirs.add(dir);
|
|
77641
|
-
const implementationHeaders =
|
|
77772
|
+
const implementationHeaders = import_node_fs87.default.existsSync(import_node_path88.default.join(module2.root, "cpp")) ? collect(module2.root, "cpp", targetName, podName) : /* @__PURE__ */ new Map();
|
|
77642
77773
|
for (const dir of searchRoots.filter(
|
|
77643
77774
|
(dir2) => dir2 !== "cpp" && !dir2.startsWith("cpp/") && dir2 !== "ios" && !dir2.startsWith("ios/") && !searchRoots.some((other) => other !== dir2 && dir2.startsWith(`${other}/`))
|
|
77644
77775
|
)) {
|
|
77645
77776
|
collect(module2.root, dir, targetName, podName);
|
|
77646
77777
|
}
|
|
77647
|
-
if (
|
|
77778
|
+
if (import_node_fs87.default.existsSync(import_node_path88.default.join(module2.root, "ios"))) {
|
|
77648
77779
|
const iosCollected = collect(
|
|
77649
77780
|
module2.root,
|
|
77650
77781
|
"ios",
|
|
@@ -77664,8 +77795,8 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77664
77795
|
}
|
|
77665
77796
|
}
|
|
77666
77797
|
admitTextualIncludes(module2.root, targetName, targetObj, searchRoots);
|
|
77667
|
-
const viewsDir =
|
|
77668
|
-
const viewHeaders =
|
|
77798
|
+
const viewsDir = import_node_path88.default.join(module2.root, "nitrogen/generated/shared/c++/views");
|
|
77799
|
+
const viewHeaders = import_node_fs87.default.existsSync(viewsDir) ? import_node_fs87.default.readdirSync(viewsDir).filter((file) => /\.(?:h|hh|hpp|hxx)$/.test(file)) : [];
|
|
77669
77800
|
const upstreamPrefix = `${targetPath(targetName)}/upstream/`;
|
|
77670
77801
|
const needsViews = viewHeaders.length > 0 && Object.entries(result.files).some(
|
|
77671
77802
|
([key2, text7]) => (key2.startsWith(`${upstreamPrefix}cpp/`) || key2.startsWith(`${upstreamPrefix}ios/`)) && viewHeaders.some((header) => text7.includes(header))
|
|
@@ -77733,7 +77864,7 @@ function collectNitroSources(options2, nativeSourceKeys, sourceRoot) {
|
|
|
77733
77864
|
for (const [, quote3, name3] of text7.matchAll(
|
|
77734
77865
|
/^\s*#\s*include\s*([<"])([^>"\n]+)[>"]/gm
|
|
77735
77866
|
)) {
|
|
77736
|
-
const relative4 = quote3 === '"' && includer ? [
|
|
77867
|
+
const relative4 = quote3 === '"' && includer ? [import_node_path88.default.posix.normalize(import_node_path88.default.posix.join(import_node_path88.default.posix.dirname(includer), name3))] : [];
|
|
77737
77868
|
for (const include of [...relative4, name3]) if (admit(targetName, include)) break;
|
|
77738
77869
|
}
|
|
77739
77870
|
};
|
|
@@ -77969,14 +78100,14 @@ extern "C" void ${registration.symbol}();
|
|
|
77969
78100
|
}
|
|
77970
78101
|
return result;
|
|
77971
78102
|
}
|
|
77972
|
-
var import_node_crypto53,
|
|
78103
|
+
var import_node_crypto53, import_node_fs87, import_node_module8, import_node_path88, import_zod2, nitroProviderTarget, NITRO_VIEWS_TARGET, PEER_PODSPEC_SKIP;
|
|
77973
78104
|
var init_nitro_source = __esm({
|
|
77974
78105
|
"src/nitro-source.ts"() {
|
|
77975
78106
|
"use strict";
|
|
77976
78107
|
import_node_crypto53 = require("node:crypto");
|
|
77977
|
-
|
|
78108
|
+
import_node_fs87 = __toESM(require("node:fs"), 1);
|
|
77978
78109
|
import_node_module8 = require("node:module");
|
|
77979
|
-
|
|
78110
|
+
import_node_path88 = __toESM(require("node:path"), 1);
|
|
77980
78111
|
import_zod2 = require("peachsim/vendor/zod");
|
|
77981
78112
|
init_nitro_dependencies();
|
|
77982
78113
|
init_podspec_sources();
|
|
@@ -78092,7 +78223,7 @@ async function resolveAppStubs(appDir, config, configDir) {
|
|
|
78092
78223
|
const { modules, views, hybridObjects } = expandStubs(appDir, source);
|
|
78093
78224
|
assertRegisteredHybridObjects(iosRoots.get(source.target), source, hybridObjects);
|
|
78094
78225
|
for (const [name3, answer2] of Object.entries(hybridObjects))
|
|
78095
|
-
nativeHybridObjects[name3] = answer2 === "unsupported" ? answer2 : { file: (0,
|
|
78226
|
+
nativeHybridObjects[name3] = answer2 === "unsupported" ? answer2 : { file: (0, import_node_path89.resolve)(source.baseDir, answer2) };
|
|
78096
78227
|
for (const [name3, stub] of Object.entries(modules))
|
|
78097
78228
|
nativeModules[name3] = lowerStub(stub, source.baseDir);
|
|
78098
78229
|
for (const [name3, stub] of Object.entries(views))
|
|
@@ -78156,10 +78287,10 @@ function assertRegisteredHybridObjects(root, source, hybridObjects) {
|
|
|
78156
78287
|
);
|
|
78157
78288
|
}
|
|
78158
78289
|
function lowerStub(stub, baseDir) {
|
|
78159
|
-
return stub === "noop" ? stub : { file: (0,
|
|
78290
|
+
return stub === "noop" ? stub : { file: (0, import_node_path89.resolve)(baseDir, stub) };
|
|
78160
78291
|
}
|
|
78161
78292
|
function readPackageJson(dir) {
|
|
78162
|
-
const text7 = readSmallFile((0,
|
|
78293
|
+
const text7 = readSmallFile((0, import_node_path89.join)(dir, "package.json"));
|
|
78163
78294
|
if (!text7) return null;
|
|
78164
78295
|
try {
|
|
78165
78296
|
const parsed2 = JSON.parse(text7);
|
|
@@ -78171,9 +78302,9 @@ function readPackageJson(dir) {
|
|
|
78171
78302
|
function installedPackageDir(appDir, name3) {
|
|
78172
78303
|
let current2 = appDir;
|
|
78173
78304
|
while (true) {
|
|
78174
|
-
const dir = (0,
|
|
78175
|
-
if ((0,
|
|
78176
|
-
const parent = (0,
|
|
78305
|
+
const dir = (0, import_node_path89.join)(current2, "node_modules", name3);
|
|
78306
|
+
if ((0, import_node_fs88.existsSync)((0, import_node_path89.join)(dir, "package.json"))) return (0, import_node_fs88.realpathSync)(dir);
|
|
78307
|
+
const parent = (0, import_node_path89.dirname)(current2);
|
|
78177
78308
|
if (parent === current2) return null;
|
|
78178
78309
|
current2 = parent;
|
|
78179
78310
|
}
|
|
@@ -78299,7 +78430,7 @@ function mergeRequests(previous, next) {
|
|
|
78299
78430
|
function packageNativeRequests(dir) {
|
|
78300
78431
|
const found = /* @__PURE__ */ new Map();
|
|
78301
78432
|
const directories = scanRepository(dir).directories.filter((sub) => {
|
|
78302
|
-
const segments = (0,
|
|
78433
|
+
const segments = (0, import_node_path89.relative)(dir, sub).split("/");
|
|
78303
78434
|
return !NATIVE_SOURCE_DIRS.has(segments[0]) && !segments.some((segment3) => PACKAGE_SKIP_DIRS.has(segment3));
|
|
78304
78435
|
});
|
|
78305
78436
|
let files2 = 0;
|
|
@@ -78307,7 +78438,7 @@ function packageNativeRequests(dir) {
|
|
|
78307
78438
|
for (const name3 of listDir(sub)) {
|
|
78308
78439
|
if (!SOURCE_FILE.test(name3) || name3.endsWith(".d.ts") || files2 >= 2e3) continue;
|
|
78309
78440
|
files2++;
|
|
78310
|
-
const file = (0,
|
|
78441
|
+
const file = (0, import_node_path89.join)(sub, name3);
|
|
78311
78442
|
const text7 = readSmallFile(file);
|
|
78312
78443
|
if (!text7) continue;
|
|
78313
78444
|
for (const { line: _line, ...request } of sourceNativeRequests(file, text7, true)) {
|
|
@@ -78425,27 +78556,27 @@ function wireSlotMigration(appDir, configPath, wire, kept = []) {
|
|
|
78425
78556
|
}
|
|
78426
78557
|
function listDir(dir) {
|
|
78427
78558
|
try {
|
|
78428
|
-
return (0,
|
|
78559
|
+
return (0, import_node_fs88.readdirSync)(dir);
|
|
78429
78560
|
} catch {
|
|
78430
78561
|
return [];
|
|
78431
78562
|
}
|
|
78432
78563
|
}
|
|
78433
78564
|
function readSmallFile(file) {
|
|
78434
78565
|
try {
|
|
78435
|
-
return (0,
|
|
78566
|
+
return (0, import_node_fs88.statSync)(file).size <= 1024 * 1024 ? (0, import_node_fs88.readFileSync)(file, "utf8") : null;
|
|
78436
78567
|
} catch {
|
|
78437
78568
|
return null;
|
|
78438
78569
|
}
|
|
78439
78570
|
}
|
|
78440
78571
|
function hasNativeCode(dir, platform2) {
|
|
78441
|
-
const expoConfig = (0,
|
|
78572
|
+
const expoConfig = (0, import_node_path89.join)(dir, "expo-module.config.json");
|
|
78442
78573
|
const platforms2 = metadataValue(readProjectJson(expoConfig), "platforms");
|
|
78443
78574
|
if (Array.isArray(platforms2))
|
|
78444
78575
|
return platforms2.includes(platform2) || platform2 === "ios" && platforms2.includes("apple");
|
|
78445
|
-
if ([platform2, "expo-module.config.json"].some((entry) => (0,
|
|
78576
|
+
if ([platform2, "expo-module.config.json"].some((entry) => (0, import_node_fs88.existsSync)((0, import_node_path89.join)(dir, entry))))
|
|
78446
78577
|
return true;
|
|
78447
78578
|
if (listDir(dir).some((name3) => name3.endsWith(".podspec"))) return true;
|
|
78448
|
-
const manifest = readSmallFile((0,
|
|
78579
|
+
const manifest = readSmallFile((0, import_node_path89.join)(dir, "package.json"));
|
|
78449
78580
|
return manifest !== null && manifest.includes('"codegenConfig"');
|
|
78450
78581
|
}
|
|
78451
78582
|
function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @__PURE__ */ new Set(), includeLegacy = false, providers) {
|
|
@@ -78458,7 +78589,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
78458
78589
|
(excluded) => dir === excluded || dir.startsWith(`${excluded}/`)
|
|
78459
78590
|
))
|
|
78460
78591
|
continue;
|
|
78461
|
-
if ((0,
|
|
78592
|
+
if ((0, import_node_fs88.existsSync)((0, import_node_path89.join)(dir, "expo-module.config.json"))) {
|
|
78462
78593
|
if (platform2 && !hasNativeCode(dir, platform2)) {
|
|
78463
78594
|
excludedModuleDirs.push(dir);
|
|
78464
78595
|
continue;
|
|
@@ -78467,7 +78598,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
78467
78598
|
}
|
|
78468
78599
|
for (const name3 of listDir(dir)) {
|
|
78469
78600
|
if (SOURCE_FILE.test(name3) && !name3.endsWith(".d.ts"))
|
|
78470
|
-
sourceFiles2.push((0,
|
|
78601
|
+
sourceFiles2.push((0, import_node_path89.join)(dir, name3));
|
|
78471
78602
|
}
|
|
78472
78603
|
}
|
|
78473
78604
|
}
|
|
@@ -78477,7 +78608,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
78477
78608
|
scanRepository(dir).directories.flatMap(
|
|
78478
78609
|
(sub) => listDir(sub).filter(
|
|
78479
78610
|
(name3) => NATIVE_SOURCE_FILE2.test(name3) && (!platform2 || (platform2 === "ios" ? name3.endsWith(".swift") : name3.endsWith(".kt")))
|
|
78480
|
-
).map((name3) => (0,
|
|
78611
|
+
).map((name3) => (0, import_node_path89.join)(sub, name3))
|
|
78481
78612
|
)
|
|
78482
78613
|
])
|
|
78483
78614
|
);
|
|
@@ -78486,7 +78617,7 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
78486
78617
|
const known = owners.get(dir);
|
|
78487
78618
|
if (known) return known;
|
|
78488
78619
|
const name3 = readPackageJson(dir)?.name;
|
|
78489
|
-
const parent = (0,
|
|
78620
|
+
const parent = (0, import_node_path89.dirname)(dir);
|
|
78490
78621
|
const result = typeof name3 === "string" ? name3 : parent === dir ? pkg.name ?? "app" : owner(parent);
|
|
78491
78622
|
owners.set(dir, result);
|
|
78492
78623
|
return result;
|
|
@@ -78500,22 +78631,22 @@ function scanLocalNative(appDir, pkg, answered, platform2, knownPackages = /* @_
|
|
|
78500
78631
|
else {
|
|
78501
78632
|
const moduleDir2 = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`));
|
|
78502
78633
|
if (moduleDir2 && (file.endsWith(".swift") || !known.expoModule)) {
|
|
78503
|
-
known.expoModule = (0,
|
|
78634
|
+
known.expoModule = (0, import_node_path89.relative)(appDir, moduleDir2) || ".";
|
|
78504
78635
|
known.swift = file.endsWith(".swift");
|
|
78505
78636
|
}
|
|
78506
78637
|
}
|
|
78507
78638
|
return;
|
|
78508
78639
|
}
|
|
78509
78640
|
providers ??= dependencyNativeOwners(appDir, pkg);
|
|
78510
|
-
const packageName = providers.get(key2) ?? owner((0,
|
|
78641
|
+
const packageName = providers.get(key2) ?? owner((0, import_node_path89.dirname)(file));
|
|
78511
78642
|
if (knownPackages.has(packageName)) return;
|
|
78512
78643
|
const moduleDir = expoModuleDirs.find((dir) => file.startsWith(`${dir}/`)) ?? null;
|
|
78513
78644
|
found.set(key2, {
|
|
78514
78645
|
kind,
|
|
78515
78646
|
name: name3,
|
|
78516
78647
|
package: packageName,
|
|
78517
|
-
path: `${(0,
|
|
78518
|
-
expoModule: moduleDir ? (0,
|
|
78648
|
+
path: `${(0, import_node_path89.relative)(appDir, file)}:${line}`,
|
|
78649
|
+
expoModule: moduleDir ? (0, import_node_path89.relative)(appDir, moduleDir) || "." : null,
|
|
78519
78650
|
optional: optional3,
|
|
78520
78651
|
swift: moduleDir ? (nativeFilesByModule.get(moduleDir) ?? []).some(
|
|
78521
78652
|
(path145) => path145.endsWith(".swift") && [...(readSmallFile(path145) ?? "").matchAll(/\bName\(\s*"(\w+)"\s*\)/g)].some(
|
|
@@ -78566,29 +78697,29 @@ function workspacePackageDirs(appDir, pkg) {
|
|
|
78566
78697
|
for (const name3 of Object.keys({ ...pkg.dependencies, ...pkg.devDependencies })) {
|
|
78567
78698
|
let current2 = appDir;
|
|
78568
78699
|
while (true) {
|
|
78569
|
-
const link = (0,
|
|
78570
|
-
if ((0,
|
|
78571
|
-
if ((0,
|
|
78572
|
-
const target = (0,
|
|
78700
|
+
const link = (0, import_node_path89.join)(current2, "node_modules", name3);
|
|
78701
|
+
if ((0, import_node_fs88.existsSync)(link)) {
|
|
78702
|
+
if ((0, import_node_fs88.lstatSync)(link).isSymbolicLink()) {
|
|
78703
|
+
const target = (0, import_node_fs88.realpathSync)(link);
|
|
78573
78704
|
if (!target.split("/").includes("node_modules") && !target.startsWith(`${appDir}/`)) {
|
|
78574
78705
|
dirs.add(target);
|
|
78575
78706
|
}
|
|
78576
78707
|
}
|
|
78577
78708
|
break;
|
|
78578
78709
|
}
|
|
78579
|
-
const parent = (0,
|
|
78710
|
+
const parent = (0, import_node_path89.dirname)(current2);
|
|
78580
78711
|
if (parent === current2) break;
|
|
78581
78712
|
current2 = parent;
|
|
78582
78713
|
}
|
|
78583
78714
|
}
|
|
78584
78715
|
return [...dirs];
|
|
78585
78716
|
}
|
|
78586
|
-
var
|
|
78717
|
+
var import_node_fs88, import_node_path89, import_acorn, import_sucrase2, SOURCE_FILE, NATIVE_LOOKUP, NATIVE_SOURCE_DIRS, PACKAGE_SKIP_DIRS, NATIVE_SOURCE_FILE2;
|
|
78587
78718
|
var init_app_stubs = __esm({
|
|
78588
78719
|
"cli/app-stubs.ts"() {
|
|
78589
78720
|
"use strict";
|
|
78590
|
-
|
|
78591
|
-
|
|
78721
|
+
import_node_fs88 = require("node:fs");
|
|
78722
|
+
import_node_path89 = require("node:path");
|
|
78592
78723
|
init_version_range();
|
|
78593
78724
|
import_acorn = require("peachsim/vendor/acorn");
|
|
78594
78725
|
import_sucrase2 = require("peachsim/vendor/sucrase");
|
|
@@ -80161,10 +80292,10 @@ var init_storeKitContract = __esm({
|
|
|
80161
80292
|
// src/storekit-test-store.ts
|
|
80162
80293
|
async function loadStoreKitTestStore(configuration, appDir) {
|
|
80163
80294
|
const catalog = readStoreKitCatalog(JSON.parse(await (0, import_promises7.readFile)(configuration, "utf8")));
|
|
80164
|
-
const identityPath =
|
|
80295
|
+
const identityPath = import_node_path90.default.join(
|
|
80165
80296
|
cacheDir(),
|
|
80166
80297
|
"storekit-identities",
|
|
80167
|
-
`${(0, import_node_crypto54.createHash)("sha256").update(
|
|
80298
|
+
`${(0, import_node_crypto54.createHash)("sha256").update(import_node_path90.default.resolve(appDir)).digest("hex")}.json`
|
|
80168
80299
|
);
|
|
80169
80300
|
let signing;
|
|
80170
80301
|
try {
|
|
@@ -80192,18 +80323,18 @@ async function loadStoreKitTestStore(configuration, appDir) {
|
|
|
80192
80323
|
privateKey: await crypto.subtle.exportKey("jwk", keys.privateKey),
|
|
80193
80324
|
certificate: Buffer.from(certificate.rawData).toString("base64")
|
|
80194
80325
|
};
|
|
80195
|
-
await (0, import_promises7.mkdir)(
|
|
80326
|
+
await (0, import_promises7.mkdir)(import_node_path90.default.dirname(identityPath), { recursive: true });
|
|
80196
80327
|
await (0, import_promises7.writeFile)(identityPath, JSON.stringify(signing), { mode: 384 });
|
|
80197
80328
|
}
|
|
80198
80329
|
return { ...catalog, signing };
|
|
80199
80330
|
}
|
|
80200
|
-
var import_node_crypto54, import_promises7,
|
|
80331
|
+
var import_node_crypto54, import_promises7, import_node_path90, import_x509;
|
|
80201
80332
|
var init_storekit_test_store = __esm({
|
|
80202
80333
|
"src/storekit-test-store.ts"() {
|
|
80203
80334
|
"use strict";
|
|
80204
80335
|
import_node_crypto54 = require("node:crypto");
|
|
80205
80336
|
import_promises7 = require("node:fs/promises");
|
|
80206
|
-
|
|
80337
|
+
import_node_path90 = __toESM(require("node:path"), 1);
|
|
80207
80338
|
init_storeKitContract();
|
|
80208
80339
|
import_x509 = require("peachsim/vendor/@peculiar/x509");
|
|
80209
80340
|
init_home_paths();
|
|
@@ -80223,12 +80354,12 @@ function resolveFileEntries(entries2, configDir) {
|
|
|
80223
80354
|
return Object.fromEntries(
|
|
80224
80355
|
Object.entries(entries2).map(([name3, resolution2]) => [
|
|
80225
80356
|
name3,
|
|
80226
|
-
resolution2 && typeof resolution2 === "object" && "file" in resolution2 && typeof resolution2.file === "string" ? { ...resolution2, file:
|
|
80357
|
+
resolution2 && typeof resolution2 === "object" && "file" in resolution2 && typeof resolution2.file === "string" ? { ...resolution2, file: import_node_path91.default.resolve(configDir, resolution2.file) } : resolution2
|
|
80227
80358
|
])
|
|
80228
80359
|
);
|
|
80229
80360
|
}
|
|
80230
80361
|
function resolveConfigReplacementFiles(config, configPath) {
|
|
80231
|
-
const configDir =
|
|
80362
|
+
const configDir = import_node_path91.default.dirname(configPath);
|
|
80232
80363
|
return {
|
|
80233
80364
|
...config,
|
|
80234
80365
|
modules: resolveFileEntries(config.modules, configDir)
|
|
@@ -80244,7 +80375,7 @@ async function loadRNXAppStubs(project2) {
|
|
|
80244
80375
|
return await resolveAppStubs(
|
|
80245
80376
|
project2.appDir,
|
|
80246
80377
|
config,
|
|
80247
|
-
project2.configPath ?
|
|
80378
|
+
project2.configPath ? import_node_path91.default.dirname(project2.configPath) : project2.appDir
|
|
80248
80379
|
);
|
|
80249
80380
|
} catch (error) {
|
|
80250
80381
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -80254,9 +80385,9 @@ async function loadRNXAppStubs(project2) {
|
|
|
80254
80385
|
async function loadConfigFile(project2) {
|
|
80255
80386
|
if (!project2.configPath) return void 0;
|
|
80256
80387
|
try {
|
|
80257
|
-
const configPath =
|
|
80388
|
+
const configPath = import_node_path91.default.resolve(project2.configPath);
|
|
80258
80389
|
delete (0, import_node_module9.createRequire)(__sootsim_import_meta_url).cache[configPath];
|
|
80259
|
-
const loaded4 = configPath.endsWith(".json") ? JSON.parse((0,
|
|
80390
|
+
const loaded4 = configPath.endsWith(".json") ? JSON.parse((0, import_node_fs89.readFileSync)(configPath, "utf8")) : Reflect.get(await import(configPath), "default");
|
|
80260
80391
|
if (!isPeachConfig(loaded4)) {
|
|
80261
80392
|
throw new Error("the default export must be a peach config object");
|
|
80262
80393
|
}
|
|
@@ -80300,7 +80431,7 @@ ${migration}`
|
|
|
80300
80431
|
config.initialState = {
|
|
80301
80432
|
...config.initialState,
|
|
80302
80433
|
storeKit: await loadStoreKitTestStore(
|
|
80303
|
-
|
|
80434
|
+
import_node_path91.default.resolve(import_node_path91.default.dirname(project2.configPath), config.storeKit.configuration),
|
|
80304
80435
|
project2.appDir
|
|
80305
80436
|
)
|
|
80306
80437
|
};
|
|
@@ -80319,13 +80450,13 @@ async function resolveRNXAppConfig(startDir = process.cwd()) {
|
|
|
80319
80450
|
const project2 = resolveAppProject(startDir);
|
|
80320
80451
|
return { project: project2, ...await loadRNXAppStubs(project2) };
|
|
80321
80452
|
}
|
|
80322
|
-
var
|
|
80453
|
+
var import_node_fs89, import_node_module9, import_node_path91, WIRE_SLOTS;
|
|
80323
80454
|
var init_app_config = __esm({
|
|
80324
80455
|
"src/app-config.ts"() {
|
|
80325
80456
|
"use strict";
|
|
80326
|
-
|
|
80457
|
+
import_node_fs89 = require("node:fs");
|
|
80327
80458
|
import_node_module9 = require("node:module");
|
|
80328
|
-
|
|
80459
|
+
import_node_path91 = __toESM(require("node:path"), 1);
|
|
80329
80460
|
init_app_project();
|
|
80330
80461
|
init_app_stubs();
|
|
80331
80462
|
init_answeredNativePackages();
|
|
@@ -80426,7 +80557,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
80426
80557
|
const rtcAppGroupIdentifier = nonEmptyString2(dictionary3.RTCAppGroupIdentifier);
|
|
80427
80558
|
const screenShareExtensionBundleId = typeof dictionary3.ScreenShareExtensionBundleId === "string" ? dictionary3.ScreenShareExtensionBundleId : void 0;
|
|
80428
80559
|
const rootModuleName = readRootModuleName(
|
|
80429
|
-
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) &&
|
|
80560
|
+
app.allSources.filter((file) => /Delegate\.(?:swift|mm|m)$/.test(file) && import_node_fs90.default.existsSync(file)).map((file) => import_node_fs90.default.readFileSync(file, "utf8"))
|
|
80430
80561
|
);
|
|
80431
80562
|
const identity2 = {
|
|
80432
80563
|
...app.keychainAccessGroups === void 0 ? {} : { keychainAccessGroups: app.keychainAccessGroups },
|
|
@@ -80450,7 +80581,7 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
80450
80581
|
googleSignIn: readGoogleSignInConfiguration(
|
|
80451
80582
|
dictionary3,
|
|
80452
80583
|
Object.fromEntries(
|
|
80453
|
-
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(
|
|
80584
|
+
app.resources.filter((file) => file.endsWith(".plist")).map((file) => [file, parsePlistBytes(import_node_fs90.default.readFileSync(file), parseInfoPlist)])
|
|
80454
80585
|
)
|
|
80455
80586
|
),
|
|
80456
80587
|
supportedInterfaceOrientations,
|
|
@@ -80460,11 +80591,11 @@ function readNativeAppIdentityFromXcodeTarget(app, parseInfoPlist = parsePlistSo
|
|
|
80460
80591
|
bundleIcons: resolveNativeBundleIcons(icons, catalogAlternateNames, (value) => value),
|
|
80461
80592
|
appIconArtwork: resolveNativeAppIconArtwork(
|
|
80462
80593
|
app.resources,
|
|
80463
|
-
(file) =>
|
|
80594
|
+
(file) => import_node_fs90.default.readFileSync(file, "utf8"),
|
|
80464
80595
|
(file) => {
|
|
80465
|
-
const extension =
|
|
80596
|
+
const extension = import_node_path92.default.extname(file).toLowerCase();
|
|
80466
80597
|
const contentType = extension === ".jpg" || extension === ".jpeg" ? "image/jpeg" : extension === ".webp" ? "image/webp" : "image/png";
|
|
80467
|
-
return `data:${contentType};base64,${
|
|
80598
|
+
return `data:${contentType};base64,${import_node_fs90.default.readFileSync(file).toString("base64")}`;
|
|
80468
80599
|
},
|
|
80469
80600
|
icons,
|
|
80470
80601
|
app.appIconName,
|
|
@@ -80493,13 +80624,13 @@ function readIosAppTarget(projectRoot, iosTarget, environment) {
|
|
|
80493
80624
|
environment
|
|
80494
80625
|
});
|
|
80495
80626
|
}
|
|
80496
|
-
var
|
|
80627
|
+
var import_node_fs90, import_node_module10, import_node_path92, SDK_BEFORE_SCENE_REQUIREMENT;
|
|
80497
80628
|
var init_native_app_identity_project = __esm({
|
|
80498
80629
|
"src/native-app-identity-project.ts"() {
|
|
80499
80630
|
"use strict";
|
|
80500
|
-
|
|
80631
|
+
import_node_fs90 = __toESM(require("node:fs"), 1);
|
|
80501
80632
|
import_node_module10 = require("node:module");
|
|
80502
|
-
|
|
80633
|
+
import_node_path92 = __toESM(require("node:path"), 1);
|
|
80503
80634
|
init_android_app_identity();
|
|
80504
80635
|
init_is_record();
|
|
80505
80636
|
init_native_app_identity();
|
|
@@ -80525,8 +80656,8 @@ var init_nativePreparationContract = __esm({
|
|
|
80525
80656
|
|
|
80526
80657
|
// src/native-preparation.ts
|
|
80527
80658
|
function ignoredChange(relative4) {
|
|
80528
|
-
const parts = relative4.split(
|
|
80529
|
-
return relative4 ===
|
|
80659
|
+
const parts = relative4.split(import_node_path93.default.sep);
|
|
80660
|
+
return relative4 === import_node_path93.default.join(".git", "index") || parts.includes(".cache") || parts.includes(".expo") || /(?:^|[\\/])node_modules[\\/]expo-widgets[\\/]bundle[\\/]build(?:[\\/]|$)/.test(
|
|
80530
80661
|
relative4
|
|
80531
80662
|
);
|
|
80532
80663
|
}
|
|
@@ -80548,7 +80679,7 @@ function watchNativeInputs(root) {
|
|
|
80548
80679
|
}
|
|
80549
80680
|
const inputs2 = { expiry, revision: (0, import_node_crypto55.randomUUID)() };
|
|
80550
80681
|
const watch = (directory2, recursive, name3) => {
|
|
80551
|
-
const watcher =
|
|
80682
|
+
const watcher = import_node_fs91.default.watch(
|
|
80552
80683
|
directory2,
|
|
80553
80684
|
{ recursive, persistent: false },
|
|
80554
80685
|
(_event, file) => {
|
|
@@ -80561,17 +80692,17 @@ function watchNativeInputs(root) {
|
|
|
80561
80692
|
const scan3 = (directory2, watchRoot2) => {
|
|
80562
80693
|
if (visited.has(directory2)) return;
|
|
80563
80694
|
visited.add(directory2);
|
|
80564
|
-
for (const entry of
|
|
80565
|
-
const file =
|
|
80566
|
-
if (ignoredChange(
|
|
80695
|
+
for (const entry of import_node_fs91.default.readdirSync(directory2, { withFileTypes: true })) {
|
|
80696
|
+
const file = import_node_path93.default.join(directory2, entry.name);
|
|
80697
|
+
if (ignoredChange(import_node_path93.default.relative(watchRoot2, file)) || entry.name === ".git") continue;
|
|
80567
80698
|
if (entry.isDirectory()) scan3(file, watchRoot2);
|
|
80568
80699
|
if (!entry.isSymbolicLink()) continue;
|
|
80569
|
-
const target =
|
|
80570
|
-
if (target === workspace || target.startsWith(workspace +
|
|
80571
|
-
const real =
|
|
80700
|
+
const target = import_node_path93.default.resolve(directory2, import_node_fs91.default.readlinkSync(file));
|
|
80701
|
+
if (target === workspace || target.startsWith(workspace + import_node_path93.default.sep)) continue;
|
|
80702
|
+
const real = import_node_fs91.default.realpathSync(file);
|
|
80572
80703
|
if (visited.has(real)) continue;
|
|
80573
|
-
watch(
|
|
80574
|
-
if (
|
|
80704
|
+
watch(import_node_path93.default.dirname(real), false, import_node_path93.default.basename(real));
|
|
80705
|
+
if (import_node_fs91.default.statSync(real).isDirectory()) {
|
|
80575
80706
|
watch(real, true);
|
|
80576
80707
|
scan3(real, real);
|
|
80577
80708
|
} else visited.add(real);
|
|
@@ -80587,13 +80718,13 @@ function watchNativeInputs(root) {
|
|
|
80587
80718
|
watchedInputs.set(workspace, inputs2);
|
|
80588
80719
|
return inputs2;
|
|
80589
80720
|
}
|
|
80590
|
-
var import_node_crypto55,
|
|
80721
|
+
var import_node_crypto55, import_node_fs91, import_node_path93, import_node_timers, setTimeoutNode, RETENTION_MS, watchedInputs, NativePreparation;
|
|
80591
80722
|
var init_native_preparation = __esm({
|
|
80592
80723
|
"src/native-preparation.ts"() {
|
|
80593
80724
|
"use strict";
|
|
80594
80725
|
import_node_crypto55 = require("node:crypto");
|
|
80595
|
-
|
|
80596
|
-
|
|
80726
|
+
import_node_fs91 = __toESM(require("node:fs"), 1);
|
|
80727
|
+
import_node_path93 = __toESM(require("node:path"), 1);
|
|
80597
80728
|
import_node_timers = require("node:timers");
|
|
80598
80729
|
init_nativePreparationContract();
|
|
80599
80730
|
init_runtime_assets();
|
|
@@ -80688,87 +80819,6 @@ var init_nitro_app_providers = __esm({
|
|
|
80688
80819
|
}
|
|
80689
80820
|
});
|
|
80690
80821
|
|
|
80691
|
-
// src/swift-xcframework.ts
|
|
80692
|
-
function simulatorNativeLibrary(dir) {
|
|
80693
|
-
if (dir.endsWith(".framework")) {
|
|
80694
|
-
const name3 = import_node_path93.default.basename(dir, ".framework");
|
|
80695
|
-
return { name: name3, file: import_node_path93.default.join(dir, name3), kind: "framework" };
|
|
80696
|
-
}
|
|
80697
|
-
if (!dir.endsWith(".xcframework")) return null;
|
|
80698
|
-
const info = parsePlistBytes(import_node_fs91.default.readFileSync(import_node_path93.default.join(dir, "Info.plist")));
|
|
80699
|
-
if (!isRecord(info) || !Array.isArray(info.AvailableLibraries))
|
|
80700
|
-
throw new Error(`${dir}: invalid XCFramework library declarations`);
|
|
80701
|
-
const matches = [];
|
|
80702
|
-
for (const entry of info.AvailableLibraries) {
|
|
80703
|
-
if (!isRecord(entry)) throw new Error(`${dir}: invalid XCFramework library entry`);
|
|
80704
|
-
if (entry.SupportedPlatform !== "ios" || entry.SupportedPlatformVariant !== "simulator")
|
|
80705
|
-
continue;
|
|
80706
|
-
if (typeof entry.LibraryPath !== "string" || typeof entry.LibraryIdentifier !== "string")
|
|
80707
|
-
throw new Error(`${dir}: invalid simulator library paths`);
|
|
80708
|
-
const archive = /\.a$/.test(entry.LibraryPath);
|
|
80709
|
-
const framework = /\.framework$/.test(entry.LibraryPath);
|
|
80710
|
-
if (!archive && !framework) continue;
|
|
80711
|
-
const bundle = import_node_path93.default.resolve(dir, entry.LibraryIdentifier, entry.LibraryPath);
|
|
80712
|
-
const bundleRelative = import_node_path93.default.relative(dir, bundle);
|
|
80713
|
-
if (bundleRelative.startsWith("..") || import_node_path93.default.isAbsolute(bundleRelative))
|
|
80714
|
-
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
80715
|
-
let name3 = entry.LibraryPath;
|
|
80716
|
-
let file = bundle;
|
|
80717
|
-
if (framework) {
|
|
80718
|
-
name3 = import_node_path93.default.basename(bundle, ".framework");
|
|
80719
|
-
file = import_node_path93.default.join(bundle, name3);
|
|
80720
|
-
}
|
|
80721
|
-
const relative4 = import_node_path93.default.relative(dir, file);
|
|
80722
|
-
if (relative4.startsWith("..") || import_node_path93.default.isAbsolute(relative4))
|
|
80723
|
-
throw new Error(`${dir}: library escapes its XCFramework`);
|
|
80724
|
-
if (framework) {
|
|
80725
|
-
matches.push({ name: name3, file, kind: "framework" });
|
|
80726
|
-
continue;
|
|
80727
|
-
}
|
|
80728
|
-
const slice = import_node_path93.default.resolve(dir, entry.LibraryIdentifier);
|
|
80729
|
-
const headers = typeof entry.HeadersPath === "string" ? import_node_path93.default.resolve(slice, entry.HeadersPath) : void 0;
|
|
80730
|
-
if (headers && relativeInside(slice, headers) === null)
|
|
80731
|
-
throw new Error(`${dir}: headers escape their XCFramework slice`);
|
|
80732
|
-
matches.push({ name: name3, file, kind: "archive", headers });
|
|
80733
|
-
}
|
|
80734
|
-
if (matches.length === 0) return null;
|
|
80735
|
-
if (matches.length !== 1) throw new Error(`${dir}: ambiguous simulator library`);
|
|
80736
|
-
return matches[0];
|
|
80737
|
-
}
|
|
80738
|
-
function isDynamicLibrary2(file) {
|
|
80739
|
-
const fd = import_node_fs91.default.openSync(file, "r");
|
|
80740
|
-
try {
|
|
80741
|
-
const read = (offset) => {
|
|
80742
|
-
const bytes = Buffer.alloc(16);
|
|
80743
|
-
import_node_fs91.default.readSync(fd, bytes, 0, 16, offset);
|
|
80744
|
-
return bytes;
|
|
80745
|
-
};
|
|
80746
|
-
let header = read(0);
|
|
80747
|
-
const universal = header.readUInt32BE(0);
|
|
80748
|
-
if (universal === 3405691582 || universal === 3405691583) {
|
|
80749
|
-
const arch = read(8);
|
|
80750
|
-
header = read(
|
|
80751
|
-
universal === 3405691582 ? arch.readUInt32BE(8) : Number(arch.readBigUInt64BE(8))
|
|
80752
|
-
);
|
|
80753
|
-
}
|
|
80754
|
-
const magic = header.readUInt32LE(0);
|
|
80755
|
-
return (magic === 4277009103 || magic === 4277009102) && header.readUInt32LE(12) === 6;
|
|
80756
|
-
} finally {
|
|
80757
|
-
import_node_fs91.default.closeSync(fd);
|
|
80758
|
-
}
|
|
80759
|
-
}
|
|
80760
|
-
var import_node_fs91, import_node_path93;
|
|
80761
|
-
var init_swift_xcframework = __esm({
|
|
80762
|
-
"src/swift-xcframework.ts"() {
|
|
80763
|
-
"use strict";
|
|
80764
|
-
import_node_fs91 = __toESM(require("node:fs"), 1);
|
|
80765
|
-
import_node_path93 = __toESM(require("node:path"), 1);
|
|
80766
|
-
init_is_record();
|
|
80767
|
-
init_plist_bytes();
|
|
80768
|
-
init_swift_source_file();
|
|
80769
|
-
}
|
|
80770
|
-
});
|
|
80771
|
-
|
|
80772
80822
|
// src/native-static-libraries.ts
|
|
80773
80823
|
function nonmodularFrameworkLibraries(directories, moduleRoot) {
|
|
80774
80824
|
return [
|
|
@@ -87494,7 +87544,7 @@ var init_swift_standin_digest = __esm({
|
|
|
87494
87544
|
];
|
|
87495
87545
|
RUNTIME_IMPORT = /(?:^|[;\n])[ \t]*(?:import|export)\s+(?!type(?:\s|\{))([\s\S]*?)\s+from\s*['"]([^'"]+)['"]|(?:^|[;\n])[ \t]*import\s+['"]([^'"]+)['"]|import\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
87496
87546
|
standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS, STANDIN_DIGEST_EXCLUDED_FILES);
|
|
87497
|
-
STANDIN_SOURCE_DIGEST = true ? "
|
|
87547
|
+
STANDIN_SOURCE_DIGEST = true ? "cdf4a04b8b51e0280fcba42b7e2b6356a9ea69d0c483e1a08dc29a0dafbc3207" : standinSourceDigest();
|
|
87498
87548
|
}
|
|
87499
87549
|
});
|
|
87500
87550
|
|
|
@@ -99071,7 +99121,7 @@ var init_expo_autolinking = __esm({
|
|
|
99071
99121
|
// src/turbo-codegen-intake.ts
|
|
99072
99122
|
function installedRendererDependencyGlobs(reactNativeRoot, appRoot) {
|
|
99073
99123
|
return Object.fromEntries(
|
|
99074
|
-
|
|
99124
|
+
RENDERER_DEPENDENCY_PODS.map((name3) => {
|
|
99075
99125
|
const spec = loadPodspec(
|
|
99076
99126
|
import_node_path119.default.join(reactNativeRoot, "third-party-podspecs", `${name3}.podspec`),
|
|
99077
99127
|
appRoot
|
|
@@ -99189,7 +99239,7 @@ async function runInstalledTurboCodegen(appRoot, outDir, signal) {
|
|
|
99189
99239
|
files: hashTree(generatedRoot)
|
|
99190
99240
|
};
|
|
99191
99241
|
}
|
|
99192
|
-
var import_node_child_process61, import_node_crypto71, import_node_fs117, import_node_module13, import_node_path119, import_node_util15, run10, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
99242
|
+
var import_node_child_process61, import_node_crypto71, import_node_fs117, import_node_module13, import_node_path119, import_node_util15, run10, RENDERER_DEPENDENCY_PODS, RENDERER_PODS, RENDERER_PODS_VERSIONED, COMPILED_SOURCE, LEGACY_BRIDGE_DEV_SUPPORT, LEGACY_BRIDGE_PODS, LEGACY_BRIDGE_PODS_VERSIONED;
|
|
99193
99243
|
var init_turbo_codegen_intake = __esm({
|
|
99194
99244
|
"src/turbo-codegen-intake.ts"() {
|
|
99195
99245
|
"use strict";
|
|
@@ -99204,6 +99254,7 @@ var init_turbo_codegen_intake = __esm({
|
|
|
99204
99254
|
init_nitro_source();
|
|
99205
99255
|
init_podspec_sources();
|
|
99206
99256
|
run10 = (0, import_node_util15.promisify)(import_node_child_process61.execFile);
|
|
99257
|
+
RENDERER_DEPENDENCY_PODS = ["RCT-Folly", "DoubleConversion", "fmt"];
|
|
99207
99258
|
RENDERER_PODS = /* @__PURE__ */ new Set([
|
|
99208
99259
|
"React-Fabric",
|
|
99209
99260
|
"React-FabricComponents",
|
|
@@ -105117,7 +105168,7 @@ var init_react_native_core = __esm({
|
|
|
105117
105168
|
init_swift_distribution();
|
|
105118
105169
|
init_swift_package();
|
|
105119
105170
|
init_swiftContract();
|
|
105120
|
-
recipe = true ? "
|
|
105171
|
+
recipe = true ? "db2c81d6628055a561c22667b098e4686f9d8924ffb229c4c7d9e15a25182502" : reactNativeCoreDigest(__sootsim_import_meta_dirname);
|
|
105121
105172
|
strings3 = (value) => isRecord(value) && Object.values(value).every((item) => typeof item === "string");
|
|
105122
105173
|
building = /* @__PURE__ */ new Map();
|
|
105123
105174
|
}
|
|
@@ -106336,7 +106387,7 @@ var init_nitro_superset = __esm({
|
|
|
106336
106387
|
init_nitroContract();
|
|
106337
106388
|
init_swift_standin_digest();
|
|
106338
106389
|
NITRO_SUPERSET_ENTRY_NAME = "superset";
|
|
106339
|
-
NITRO_COMPILER_DIGEST = true ? "
|
|
106390
|
+
NITRO_COMPILER_DIGEST = true ? "744976c15724422db8f3bc8d1fdfdcf68c3f91b185210a50951930d2ea18c38e" : nitroCompilerSourceDigest(__sootsim_import_meta_dirname, STANDIN_SOURCE_DIGEST2);
|
|
106340
106391
|
nitroSupersetLock = parseLock(nitro_superset_lock_default);
|
|
106341
106392
|
nitroSupersetKey = (inputs2) => nativeEntryKey({ ...inputs2, compiler: NITRO_COMPILER_DIGEST });
|
|
106342
106393
|
published = /* @__PURE__ */ new Map();
|
|
@@ -107315,7 +107366,7 @@ var init_expo_eager_seam_contract = __esm({
|
|
|
107315
107366
|
|
|
107316
107367
|
// src/expo-native-compiler-digest.ts
|
|
107317
107368
|
function expoNativeCompilerDigestValue() {
|
|
107318
|
-
return true ? "
|
|
107369
|
+
return true ? "dd69e490ecc79ee83e8cba98c4532818a62e9b0e93c21113e2d6c21ec60d8eee" : expoNativeCompilerDigest(__sootsim_import_meta_dirname);
|
|
107319
107370
|
}
|
|
107320
107371
|
var import_node_crypto81;
|
|
107321
107372
|
var init_expo_native_compiler_digest = __esm({
|
|
@@ -109302,6 +109353,8 @@ function enrichInstalledUnits(units, installed, namespaceGroups, provided, modul
|
|
|
109302
109353
|
return originals.some((file) => import_node_fs134.default.realpathSync(file).startsWith(reactNativeRoot)) ? [target.name] : [];
|
|
109303
109354
|
})
|
|
109304
109355
|
);
|
|
109356
|
+
for (const name3 of RENDERER_DEPENDENCY_PODS)
|
|
109357
|
+
if (targetByName.has(name3)) reactTargets.add(name3);
|
|
109305
109358
|
for (const [file, source] of Object.entries(installed.sourcePaths)) {
|
|
109306
109359
|
if (!file.endsWith(".swift") || !import_node_fs134.default.realpathSync(source).startsWith(reactNativeRoot))
|
|
109307
109360
|
continue;
|
|
@@ -111058,8 +111111,8 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
111058
111111
|
return prepared;
|
|
111059
111112
|
}
|
|
111060
111113
|
}
|
|
111061
|
-
const link = async (linked2) => {
|
|
111062
|
-
const packagePath = expoSwiftPackage(key2,
|
|
111114
|
+
const link = async (linked2, name3 = "linked-app") => {
|
|
111115
|
+
const packagePath = expoSwiftPackage(key2, name3);
|
|
111063
111116
|
preparePackage2(linked2, packagePath);
|
|
111064
111117
|
signal.throwIfAborted();
|
|
111065
111118
|
const stamp = sourceContentStamp(packagePath, module2.root);
|
|
@@ -111117,35 +111170,24 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
111117
111170
|
error instanceof SwiftMissingModulesError ? [...message.matchAll(/^ (\S+)/gm)].map((match) => match[1]) : []
|
|
111118
111171
|
);
|
|
111119
111172
|
return pool.filter(
|
|
111120
|
-
(unit2) => [
|
|
111173
|
+
(unit2) => [
|
|
111174
|
+
...Object.keys(unit2.files),
|
|
111175
|
+
...expoUnitAppPaths(unit2),
|
|
111176
|
+
...(unit2.nativeTargets ?? []).flatMap(
|
|
111177
|
+
(native) => [native.bridgingHeader, native.prefixHeader].filter(
|
|
111178
|
+
(file) => file !== null
|
|
111179
|
+
)
|
|
111180
|
+
)
|
|
111181
|
+
].some(
|
|
111121
111182
|
(name3) => nativeCopies.includes(name3) || errorFiles.some((file) => file === name3 || file.endsWith(`/${name3}`))
|
|
111122
111183
|
) || Object.values(unit2.files).some(
|
|
111123
111184
|
(source) => swiftImportNames(source).some((name3) => missing2.has(name3))
|
|
111124
111185
|
)
|
|
111125
111186
|
);
|
|
111126
111187
|
};
|
|
111127
|
-
let checked = candidates;
|
|
111128
111188
|
linked = [];
|
|
111129
|
-
let
|
|
111130
|
-
|
|
111131
|
-
for (; ; ) {
|
|
111132
|
-
const named = namedBy(failure2, rest);
|
|
111133
|
-
if (named.length === 0 || named.length === rest.length) break;
|
|
111134
|
-
rest = rest.filter((unit2) => !named.includes(unit2));
|
|
111135
|
-
report(`linking ${rest.length} namespaces the diagnostic does not name`);
|
|
111136
|
-
try {
|
|
111137
|
-
artifact = await link(rest);
|
|
111138
|
-
linked = rest;
|
|
111139
|
-
checked = candidates.filter((unit2) => !rest.includes(unit2));
|
|
111140
|
-
break;
|
|
111141
|
-
} catch (error) {
|
|
111142
|
-
signal.throwIfAborted();
|
|
111143
|
-
if (error instanceof ExpoSwiftLinkRefusal) throw error;
|
|
111144
|
-
failure2 = error;
|
|
111145
|
-
}
|
|
111146
|
-
}
|
|
111147
|
-
const linkedWithoutChecks = linked.length;
|
|
111148
|
-
for (const unit2 of checked) {
|
|
111189
|
+
let isolatedArtifact;
|
|
111190
|
+
const check2 = async (unit2) => {
|
|
111149
111191
|
signal.throwIfAborted();
|
|
111150
111192
|
const packagePath = expoSwiftPackage(key2, unit2.moduleId);
|
|
111151
111193
|
preparePackage2([unit2], packagePath);
|
|
@@ -111195,9 +111237,43 @@ async function compileExpoSwiftModulesTraced(root, base2, publishArtifact, optio
|
|
|
111195
111237
|
unitErrors.length ? unitErrors.join("\n") : diagnostic
|
|
111196
111238
|
);
|
|
111197
111239
|
}
|
|
111198
|
-
}
|
|
111240
|
+
};
|
|
111241
|
+
const isolate = async (group, failure2) => {
|
|
111242
|
+
const named = namedBy(failure2, group);
|
|
111243
|
+
if (group !== candidates)
|
|
111244
|
+
report(
|
|
111245
|
+
`${group.length} namespaces failed${named.length ? `, naming ${named.map((unit2) => unit2.moduleId).join(", ")}` : ""}: ${(failure2 instanceof Error ? failure2.message : String(failure2)).match(/^.+: error: .*$/m)?.[0] ?? "no source error"}`
|
|
111246
|
+
);
|
|
111247
|
+
const half = Math.ceil(group.length / 2);
|
|
111248
|
+
const parts = named.length > 0 && named.length < group.length ? [
|
|
111249
|
+
...named.map((unit2) => [unit2]),
|
|
111250
|
+
group.filter((unit2) => !named.includes(unit2))
|
|
111251
|
+
] : [group.slice(0, half), group.slice(half)];
|
|
111252
|
+
for (const part of parts) {
|
|
111253
|
+
signal.throwIfAborted();
|
|
111254
|
+
if (part.length === 0) continue;
|
|
111255
|
+
if (part.length === 1) {
|
|
111256
|
+
await check2(part[0]);
|
|
111257
|
+
continue;
|
|
111258
|
+
}
|
|
111259
|
+
const name3 = (0, import_node_crypto85.createHash)("sha256").update(part.map((unit2) => unit2.moduleId).join("\0")).digest("hex").slice(0, 16);
|
|
111260
|
+
report(`linking ${part.length} namespaces to isolate failures`);
|
|
111261
|
+
try {
|
|
111262
|
+
const built2 = await link(part, `isolate-${name3}`);
|
|
111263
|
+
linked.push(...part);
|
|
111264
|
+
isolatedArtifact = { units: part, artifact: built2 };
|
|
111265
|
+
} catch (error) {
|
|
111266
|
+
signal.throwIfAborted();
|
|
111267
|
+
if (error instanceof ExpoSwiftLinkRefusal) throw error;
|
|
111268
|
+
await isolate(part, error);
|
|
111269
|
+
}
|
|
111270
|
+
}
|
|
111271
|
+
};
|
|
111272
|
+
await isolate(candidates, linkError);
|
|
111199
111273
|
if (linked.length === candidates.length) throw linkError;
|
|
111200
|
-
if (
|
|
111274
|
+
if (isolatedArtifact?.units.length === linked.length)
|
|
111275
|
+
artifact = isolatedArtifact.artifact;
|
|
111276
|
+
else if (linked.length) {
|
|
111201
111277
|
try {
|
|
111202
111278
|
artifact = await link(linked);
|
|
111203
111279
|
} catch (error) {
|
|
@@ -111294,6 +111370,7 @@ var init_expo_swift_host = __esm({
|
|
|
111294
111370
|
init_swift_standins();
|
|
111295
111371
|
init_swift_submit();
|
|
111296
111372
|
init_swift_toolchain();
|
|
111373
|
+
init_turbo_codegen_intake();
|
|
111297
111374
|
init_turbo_source();
|
|
111298
111375
|
run11 = (0, import_node_util18.promisify)(import_node_child_process65.execFile);
|
|
111299
111376
|
scriptEnv = { ...process.env, [PEACH_FORKED_SCRIPT_ENV]: "1" };
|