peachsim 0.1.2023 → 0.1.2024
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 +1 -1
- package/dist-lib/bridge-constants.cjs +1 -1
- package/dist-lib/bridge-contract-input.cjs +1 -1
- package/dist-lib/bridge-contract-input.mjs +1 -1
- package/dist-lib/bridge-contract.cjs +1 -1
- package/dist-lib/bridge-contract.mjs +1 -1
- package/dist-lib/bundle-channel.cjs +114 -38
- package/dist-lib/capture-contract.cjs +1 -1
- package/dist-lib/capture-contract.mjs +1 -1
- package/dist-lib/cloud-contract.cjs +1 -1
- package/dist-lib/cloud-contract.mjs +1 -1
- package/dist-lib/cloud-test-args.cjs +1 -1
- package/dist-lib/cloud-test-args.mjs +1 -1
- package/dist-lib/cloud.cjs +1 -1
- package/dist-lib/cloud.mjs +1 -1
- package/dist-lib/config.cjs +1 -1
- package/dist-lib/config.mjs +1 -1
- package/dist-lib/detox/index.cjs +1 -1
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +29 -16
- package/dist-lib/expo-swift-metadata.cjs +1 -1
- package/dist-lib/expo-swift-metadata.mjs +1 -1
- package/dist-lib/home-paths.cjs +1 -1
- package/dist-lib/host/bridge-host.cjs +111 -37
- package/dist-lib/host/fetch-proxy-handler.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
- package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
- package/dist-lib/host/replacement-module-handler.cjs +1 -1
- package/dist-lib/host/websocket-proxy.cjs +1 -1
- package/dist-lib/index.cjs +33 -8
- package/dist-lib/jump-to-source-babel.cjs +1 -1
- package/dist-lib/jump-to-source-native.cjs +1 -1
- package/dist-lib/kotlin-host.cjs +1 -1
- package/dist-lib/menu.cjs +1 -1
- package/dist-lib/menu.mjs +1 -1
- package/dist-lib/metro-fingerprint-registry.cjs +1 -1
- package/dist-lib/metro-fingerprint-registry.mjs +1 -1
- package/dist-lib/metro-production-bundle.cjs +1 -1
- package/dist-lib/metro-production-bundle.mjs +1 -1
- package/dist-lib/metro.cjs +33 -8
- package/dist-lib/native-app-identity-project.cjs +33 -8
- package/dist-lib/native-app-identity-project.mjs +33 -8
- package/dist-lib/native-app-identity.cjs +1 -1
- package/dist-lib/native-app-identity.mjs +1 -1
- package/dist-lib/native-firebase-metadata.cjs +1 -1
- package/dist-lib/native-firebase-metadata.mjs +1 -1
- package/dist-lib/pdfium-raster.cjs +1 -1
- package/dist-lib/pdfium-raster.mjs +1 -1
- package/dist-lib/plist.cjs +1 -1
- package/dist-lib/plist.mjs +1 -1
- package/dist-lib/profiles.cjs +1 -1
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +24 -24
- package/dist-lib/public-origins-lib.json +53 -53
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +1 -1
- package/dist-lib/reap-browser.cjs +1 -1
- package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
- package/dist-lib/sdk.cjs +1 -1
- package/dist-lib/sdk.mjs +1 -1
- package/dist-lib/skills.cjs +114 -38
- package/dist-lib/swift-compile.cjs +11 -3
- package/dist-lib/swift-compile.mjs +11 -3
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +1 -1
- package/dist-lib/swift-submit.mjs +1 -1
- package/dist-lib/swift-toolchain.cjs +21 -11
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +28 -15
- package/dist-lib/vite.cjs +1 -1
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/package.json +1 -1
- package/src/swift-toolchain.ts +21 -10
- package/src/turbo-bundle.ts +8 -0
- package/src/turbo-source.ts +60 -18
- package/src/xcode-project.ts +30 -5
package/dist-lib/vite-swift.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2024 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = '', __sootsim_import_meta_filename = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; __sootsim_import_meta_filename = __filename; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -39,7 +39,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
39
39
|
var define_SWIFT_COVERAGE_SOURCE_DIGESTS_default;
|
|
40
40
|
var init_define_SWIFT_COVERAGE_SOURCE_DIGESTS = __esm({
|
|
41
41
|
"<define:__SWIFT_COVERAGE_SOURCE_DIGESTS__>"() {
|
|
42
|
-
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "
|
|
42
|
+
define_SWIFT_COVERAGE_SOURCE_DIGESTS_default = { "swift-coverage/indexdump.ts": "0d82d8eeb96bf377f409ea7e33274c341a710c0e071f6b6e17571a23d8d92412", "swift-coverage/indexing.ts": "633ccf19eec1f382a8847d0ee1dca42a2792a3c60aafd43622ed5152b09b8272", "swift-coverage/types.ts": "5bd72edc235189d69835155cb0367a1aee14332405896366af3be606dbe8cce8", "swift-coverage/source.ts": "8b398ceb60faf4a5729842cab60f49c2e601d6fc6bbbc1faec9023ecb8141990", "swift-coverage/package.ts": "1f0068be7461fa7c5a7a891faf318f305cbed2e94c19667ba76627f7e5be260b", "swift-coverage/xcode.ts": "65a500b806ce1c3a496de27f2e0ad77287c0f6795c618342c08af647f92af1fa", "swift-coverage/xcode-assets.ts": "99e03b74c961d2449afd58c2cbc415ba91d1d469a4f89e461c137fd6c305b27c", "swift-coverage/xcode-asset-symbols.ts": "1b2a67733bc9d139b351466270205452a6172140bc25080d72619e2952c44671", "swift-coverage/xcode-bridging.ts": "33184be8c5daf6646aa5a1276a4e15531f1be27b7c26f56550e0fbb1fc678a11", "swift-coverage/xcode-packages.ts": "8e6020d17d24474150a5a50d042aca6261819ef75c79680a287a66f395909915", "swift-coverage/xcode-strings.ts": "f2dd4c7cd8ef77035184b0132909c2fa09fd20ed06b7757c2f1f960bfdde031c", "swift-coverage/reader.ts": "da559b67ecd1161dea70c980b5f98f2c55af3550f0714479100fa5e9e813625c", "swift-coverage/provenance.ts": "eb3b41ae8b58b48f6758f084800f188dfb1edb227e483abdd6b80cde66e849b9", "swift-package-manifest.ts": "4b7d4a715cdaf57468ead23f2ff9dce76d02c6a888d73d144d4baa2ae571ba3c", "swift-package.ts": "0b82b3773f9c0b27636f277d9c123b3e631b9c9980995d67d67efa6b3176df4a", "swift-source-file.ts": "93fd659ed63a27b67f54a7c229a7ceb636dc9c59e68414920ba36cff1eda1f94", "swift-toolchain.ts": "1e190da48e39a8b58a4f784208c965177b09b9535a77e3455a1bab0b62d07783", "home-paths.ts": "af600a7f017474946ede726320a133d830e77e4e287b043d4fea026a945ce748", "xcode-header-search.ts": "f8c3d557b4eca5ddad32907545353eb7ad53b2ebd0969d9ed8f7275e109a13b1", "xcode-project.ts": "3dea1482aa4180b576e9151c1a687590d4b43261cadf7657788febb480a640d9", "xcode-target-members.ts": "ad7589132bffab265e8a10b64e24484fe88b4a2b1cc0ee19a97f151a002eca77", "xcode-json-project.ts": "41990ebbe4b488eef34e74c4608b4b48e5a5b299ba98ca7fbcfdfa0e77be63b6", "openstep-plist.ts": "74e6ce1dac80c9c318e0e9f5e3e8cd19a898a8820c36fc160609695bcb59dcd3" };
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
|
|
@@ -4935,11 +4935,7 @@ function verifySwiftSdk(swift, sdk) {
|
|
|
4935
4935
|
}
|
|
4936
4936
|
function installSwiftSdkArchive(swift, sdk, archive) {
|
|
4937
4937
|
validateSwiftSdkIdentity(sdk);
|
|
4938
|
-
const staging = import_node_fs6.default.realpathSync(
|
|
4939
|
-
import_node_fs6.default.mkdtempSync(
|
|
4940
|
-
import_node_path4.default.join(scratch?.directory ?? import_node_os3.default.tmpdir(), "peach-sdk-verification-")
|
|
4941
|
-
)
|
|
4942
|
-
);
|
|
4938
|
+
const staging = import_node_fs6.default.realpathSync(swiftSdkStagingDirectory("peach-sdk-verification-"));
|
|
4943
4939
|
try {
|
|
4944
4940
|
if (swiftFileChecksum(archive) !== sdk.wasmSdkChecksum)
|
|
4945
4941
|
throw new Error("declared Swift SDK archive checksum mismatch");
|
|
@@ -5006,6 +5002,11 @@ function installSwiftSdkArchive(swift, sdk, archive) {
|
|
|
5006
5002
|
if (file.startsWith(staging + import_node_path4.default.sep)) sdkFileHashes.delete(file);
|
|
5007
5003
|
}
|
|
5008
5004
|
}
|
|
5005
|
+
function swiftSdkStagingDirectory(prefix) {
|
|
5006
|
+
const parent = scratch?.directory ?? import_node_os3.default.tmpdir();
|
|
5007
|
+
if (!import_node_fs6.default.existsSync(parent)) throw new Error(`Swift SDK install is missing ${parent}`);
|
|
5008
|
+
return import_node_fs6.default.mkdtempSync(import_node_path4.default.join(parent, prefix));
|
|
5009
|
+
}
|
|
5009
5010
|
function installSwiftWasmSdk(release, sdk) {
|
|
5010
5011
|
validateSwiftSdkIdentity(sdk);
|
|
5011
5012
|
ensureSwiftLinuxRuntime(release);
|
|
@@ -5015,9 +5016,7 @@ function installSwiftWasmSdk(release, sdk) {
|
|
|
5015
5016
|
} catch {
|
|
5016
5017
|
}
|
|
5017
5018
|
const swift = import_node_path4.default.join(swiftCompiler(release), "swift");
|
|
5018
|
-
const staging =
|
|
5019
|
-
import_node_path4.default.join(scratch?.directory ?? import_node_os3.default.tmpdir(), "builder-swift-sdk-")
|
|
5020
|
-
);
|
|
5019
|
+
const staging = swiftSdkStagingDirectory("builder-swift-sdk-");
|
|
5021
5020
|
const archive = import_node_path4.default.join(staging, "sdk.artifactbundle.tar.gz");
|
|
5022
5021
|
try {
|
|
5023
5022
|
if (sdk.wasmSdkUrl.startsWith("file:"))
|
|
@@ -5049,6 +5048,8 @@ function swiftFileChecksum(file) {
|
|
|
5049
5048
|
}
|
|
5050
5049
|
function swiftHostCompilerFiles(release, root) {
|
|
5051
5050
|
const file = import_node_path4.default.join(root, "compiler.json");
|
|
5051
|
+
if (!import_node_fs6.default.existsSync(file))
|
|
5052
|
+
throw new Error(`Swift compiler ${release} is missing ${file}`);
|
|
5052
5053
|
const pin2 = release === privateSwiftRelease() ? {
|
|
5053
5054
|
identity: release.replace(/^.*-custom-/, ""),
|
|
5054
5055
|
manifest: swiftFileChecksum(file)
|
|
@@ -5064,6 +5065,9 @@ function swiftHostCompilerFiles(release, root) {
|
|
|
5064
5065
|
return files2.map(([relative2, checksum]) => {
|
|
5065
5066
|
if (relative2.startsWith("/") || relative2.split("/").includes("..") || typeof checksum !== "string")
|
|
5066
5067
|
throw new Error(`Swift compiler binary mismatch: ${relative2}`);
|
|
5068
|
+
const binary = import_node_path4.default.join(root, relative2);
|
|
5069
|
+
if (!import_node_fs6.default.existsSync(binary))
|
|
5070
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`);
|
|
5067
5071
|
return [relative2, checksum];
|
|
5068
5072
|
});
|
|
5069
5073
|
}
|
|
@@ -5078,6 +5082,9 @@ async function swiftCompilerAsync(release, signal) {
|
|
|
5078
5082
|
const cached = verifiedCompilers.get(release);
|
|
5079
5083
|
if (cached) return cached;
|
|
5080
5084
|
const bin = swiftToolchainBin(release);
|
|
5085
|
+
const binary = import_node_path4.default.join(bin, "swift");
|
|
5086
|
+
if (!import_node_fs6.default.existsSync(binary))
|
|
5087
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`);
|
|
5081
5088
|
if (release.includes("-custom-")) {
|
|
5082
5089
|
const root = import_node_path4.default.resolve(bin, "../..");
|
|
5083
5090
|
for (const [relative2, checksum] of swiftHostCompilerFiles(release, root)) {
|
|
@@ -5090,7 +5097,7 @@ async function swiftCompilerAsync(release, signal) {
|
|
|
5090
5097
|
throw new Error(`Swift compiler binary mismatch: ${relative2}`);
|
|
5091
5098
|
}
|
|
5092
5099
|
}
|
|
5093
|
-
const { stdout } = await (0, import_node_util.promisify)(import_node_child_process4.execFile)(
|
|
5100
|
+
const { stdout } = await (0, import_node_util.promisify)(import_node_child_process4.execFile)(binary, ["--version"], {
|
|
5094
5101
|
encoding: "utf8",
|
|
5095
5102
|
env: swiftEnvironment(),
|
|
5096
5103
|
signal
|
|
@@ -5104,9 +5111,12 @@ function swiftCompiler(release) {
|
|
|
5104
5111
|
const cached = verifiedCompilers.get(release);
|
|
5105
5112
|
if (cached) return cached;
|
|
5106
5113
|
const bin = swiftToolchainBin(release);
|
|
5114
|
+
const binary = import_node_path4.default.join(bin, "swift");
|
|
5115
|
+
if (!import_node_fs6.default.existsSync(binary))
|
|
5116
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`);
|
|
5107
5117
|
if (release.includes("-custom-"))
|
|
5108
5118
|
verifySwiftHostCompiler(release, import_node_path4.default.resolve(bin, "../.."));
|
|
5109
|
-
const version2 = (0, import_node_child_process4.execFileSync)(
|
|
5119
|
+
const version2 = (0, import_node_child_process4.execFileSync)(binary, ["--version"], {
|
|
5110
5120
|
encoding: "utf8",
|
|
5111
5121
|
env: swiftEnvironment(),
|
|
5112
5122
|
stdio: ["ignore", "pipe", "pipe"]
|
|
@@ -16973,7 +16983,7 @@ var darwinRecordsRegion = (quoted) => quoted.length ? ["-Wl,--start-lib", ...quo
|
|
|
16973
16983
|
var REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
16974
16984
|
var MULTI_MANIFEST_VERSION = 68;
|
|
16975
16985
|
var SWIFT_HEADER_PRODUCTS_TARGET = "PeachHeaderProducts";
|
|
16976
|
-
var compilerSourceDigest = true ? "
|
|
16986
|
+
var compilerSourceDigest = true ? "62300abaade33badb0eb38ca4bb176c724e0c46b99bbc9981dfdec21bf9c3d27" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
16977
16987
|
function swiftArtifactHash(input, release, moduleRoot) {
|
|
16978
16988
|
const hash = (0, import_node_crypto13.createHash)("sha256");
|
|
16979
16989
|
hash.update(`swift-compile
|
|
@@ -28624,7 +28634,10 @@ function readXcodeAppTarget(input, targetName, configurationName, options = {})
|
|
|
28624
28634
|
import_plist2.default.parse(import_node_fs37.default.readFileSync(entitlementsFile, "utf8")),
|
|
28625
28635
|
(value) => expand(value, (key2) => {
|
|
28626
28636
|
const resolved = settings(key2);
|
|
28627
|
-
if (!resolved)
|
|
28637
|
+
if (!resolved)
|
|
28638
|
+
throw new Error(
|
|
28639
|
+
`${entitlementsFile} references $(${key2}), which ${module2.name}'s build settings do not define${key2 === "CFBundleIdentifier" ? " (set PRODUCT_BUNDLE_IDENTIFIER; Xcode supplies it as CFBundleIdentifier)" : ""}`
|
|
28640
|
+
);
|
|
28628
28641
|
return resolved;
|
|
28629
28642
|
})
|
|
28630
28643
|
) : void 0;
|
|
@@ -29981,7 +29994,7 @@ function sourceClosureDigest(srcDir, entrypoints) {
|
|
|
29981
29994
|
return hash.digest("hex");
|
|
29982
29995
|
}
|
|
29983
29996
|
var standinSourceDigest = (srcDir = __sootsim_import_meta_dirname) => sourceClosureDigest(srcDir, STANDIN_DIGEST_ENTRYPOINTS);
|
|
29984
|
-
var STANDIN_SOURCE_DIGEST = true ? "
|
|
29997
|
+
var STANDIN_SOURCE_DIGEST = true ? "45fe12f22344d1e23a6afb0d49b48dc17521ea87010594b3664e90487b0aa10c" : standinSourceDigest();
|
|
29985
29998
|
|
|
29986
29999
|
// src/swift-standins.ts
|
|
29987
30000
|
init_define_SWIFT_COVERAGE_SOURCE_DIGESTS();
|
package/dist-lib/vite.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2024 | (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;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2024 | (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 __defProp = Object.defineProperty;
|
package/package.json
CHANGED
package/src/swift-toolchain.ts
CHANGED
|
@@ -856,11 +856,7 @@ function verifySwiftSdk(swift: string, sdk: SwiftWasmSdk): void {
|
|
|
856
856
|
/** install or qualify existing bytes, serializing shared-store mutation without replacement. */
|
|
857
857
|
function installSwiftSdkArchive(swift: string, sdk: SwiftWasmSdk, archive: string): void {
|
|
858
858
|
validateSwiftSdkIdentity(sdk)
|
|
859
|
-
const staging = fs.realpathSync(
|
|
860
|
-
fs.mkdtempSync(
|
|
861
|
-
path.join(scratch?.directory ?? os.tmpdir(), 'peach-sdk-verification-'),
|
|
862
|
-
),
|
|
863
|
-
)
|
|
859
|
+
const staging = fs.realpathSync(swiftSdkStagingDirectory('peach-sdk-verification-'))
|
|
864
860
|
try {
|
|
865
861
|
if (swiftFileChecksum(archive) !== sdk.wasmSdkChecksum)
|
|
866
862
|
throw new Error('declared Swift SDK archive checksum mismatch')
|
|
@@ -930,6 +926,12 @@ function installSwiftSdkArchive(swift: string, sdk: SwiftWasmSdk, archive: strin
|
|
|
930
926
|
}
|
|
931
927
|
}
|
|
932
928
|
|
|
929
|
+
function swiftSdkStagingDirectory(prefix: string): string {
|
|
930
|
+
const parent = scratch?.directory ?? os.tmpdir()
|
|
931
|
+
if (!fs.existsSync(parent)) throw new Error(`Swift SDK install is missing ${parent}`)
|
|
932
|
+
return fs.mkdtempSync(path.join(parent, prefix))
|
|
933
|
+
}
|
|
934
|
+
|
|
933
935
|
/** verify the compiler and install a declared SDK under the shared store lock. */
|
|
934
936
|
export function installSwiftWasmSdk(release: string, sdk: SwiftWasmSdk): void {
|
|
935
937
|
validateSwiftSdkIdentity(sdk)
|
|
@@ -941,9 +943,7 @@ export function installSwiftWasmSdk(release: string, sdk: SwiftWasmSdk): void {
|
|
|
941
943
|
// an unverified existing SDK must be compared with the declared archive.
|
|
942
944
|
}
|
|
943
945
|
const swift = path.join(swiftCompiler(release), 'swift')
|
|
944
|
-
const staging =
|
|
945
|
-
path.join(scratch?.directory ?? os.tmpdir(), 'builder-swift-sdk-'),
|
|
946
|
-
)
|
|
946
|
+
const staging = swiftSdkStagingDirectory('builder-swift-sdk-')
|
|
947
947
|
const archive = path.join(staging, 'sdk.artifactbundle.tar.gz')
|
|
948
948
|
try {
|
|
949
949
|
if (sdk.wasmSdkUrl.startsWith('file:'))
|
|
@@ -978,6 +978,8 @@ export function swiftFileChecksum(file: string): string {
|
|
|
978
978
|
|
|
979
979
|
function swiftHostCompilerFiles(release: string, root: string): [string, string][] {
|
|
980
980
|
const file = path.join(root, 'compiler.json')
|
|
981
|
+
if (!fs.existsSync(file))
|
|
982
|
+
throw new Error(`Swift compiler ${release} is missing ${file}`)
|
|
981
983
|
// a private compiler has no qualified entry: its installed manifest is the
|
|
982
984
|
// pin, and every binary it lists must still match.
|
|
983
985
|
const pin =
|
|
@@ -1012,6 +1014,9 @@ function swiftHostCompilerFiles(release: string, root: string): [string, string]
|
|
|
1012
1014
|
typeof checksum !== 'string'
|
|
1013
1015
|
)
|
|
1014
1016
|
throw new Error(`Swift compiler binary mismatch: ${relative}`)
|
|
1017
|
+
const binary = path.join(root, relative)
|
|
1018
|
+
if (!fs.existsSync(binary))
|
|
1019
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`)
|
|
1015
1020
|
return [relative, checksum]
|
|
1016
1021
|
})
|
|
1017
1022
|
}
|
|
@@ -1034,6 +1039,9 @@ export async function swiftCompilerAsync(
|
|
|
1034
1039
|
const cached = verifiedCompilers.get(release)
|
|
1035
1040
|
if (cached) return cached
|
|
1036
1041
|
const bin = swiftToolchainBin(release)
|
|
1042
|
+
const binary = path.join(bin, 'swift')
|
|
1043
|
+
if (!fs.existsSync(binary))
|
|
1044
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`)
|
|
1037
1045
|
if (release.includes('-custom-')) {
|
|
1038
1046
|
const root = path.resolve(bin, '../..')
|
|
1039
1047
|
for (const [relative, checksum] of swiftHostCompilerFiles(release, root)) {
|
|
@@ -1046,7 +1054,7 @@ export async function swiftCompilerAsync(
|
|
|
1046
1054
|
throw new Error(`Swift compiler binary mismatch: ${relative}`)
|
|
1047
1055
|
}
|
|
1048
1056
|
}
|
|
1049
|
-
const { stdout } = await promisify(execFile)(
|
|
1057
|
+
const { stdout } = await promisify(execFile)(binary, ['--version'], {
|
|
1050
1058
|
encoding: 'utf8',
|
|
1051
1059
|
env: swiftEnvironment(),
|
|
1052
1060
|
signal,
|
|
@@ -1061,9 +1069,12 @@ export function swiftCompiler(release: string): string {
|
|
|
1061
1069
|
const cached = verifiedCompilers.get(release)
|
|
1062
1070
|
if (cached) return cached
|
|
1063
1071
|
const bin = swiftToolchainBin(release)
|
|
1072
|
+
const binary = path.join(bin, 'swift')
|
|
1073
|
+
if (!fs.existsSync(binary))
|
|
1074
|
+
throw new Error(`Swift compiler ${release} is missing ${binary}`)
|
|
1064
1075
|
if (release.includes('-custom-'))
|
|
1065
1076
|
verifySwiftHostCompiler(release, path.resolve(bin, '../..'))
|
|
1066
|
-
const version = execFileSync(
|
|
1077
|
+
const version = execFileSync(binary, ['--version'], {
|
|
1067
1078
|
encoding: 'utf8',
|
|
1068
1079
|
env: swiftEnvironment(),
|
|
1069
1080
|
stdio: ['ignore', 'pipe', 'pipe'],
|
package/src/turbo-bundle.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { createRequire } from 'node:module'
|
|
2
2
|
import path from 'node:path'
|
|
3
|
+
import { loadRNXAppConfig } from '../cli/app-config'
|
|
4
|
+
import { resolveAppProject } from '../cli/app-project'
|
|
3
5
|
import { prebuiltExpoNative } from './expo-native-prebuilt'
|
|
4
6
|
import { prepareNativeAppRoot } from './expo-native-workspace'
|
|
5
7
|
import { installedNativeLibraries } from './installed-native-libraries'
|
|
@@ -24,10 +26,16 @@ export async function compiledTurboProviders(
|
|
|
24
26
|
projectRoot?: string,
|
|
25
27
|
iosTarget?: string,
|
|
26
28
|
) {
|
|
29
|
+
const config = await loadRNXAppConfig(resolveAppProject(appRoot))
|
|
30
|
+
const answered = new Set([
|
|
31
|
+
...Object.keys(config?.nativeModules ?? {}),
|
|
32
|
+
...Object.keys(config?.nativeViews ?? {}),
|
|
33
|
+
])
|
|
27
34
|
return discoverTurboProviders(
|
|
28
35
|
appRoot,
|
|
29
36
|
projectRoot ?? (await prepareNativeAppRoot(appRoot)),
|
|
30
37
|
iosTarget,
|
|
38
|
+
answered,
|
|
31
39
|
)
|
|
32
40
|
}
|
|
33
41
|
|
package/src/turbo-source.ts
CHANGED
|
@@ -263,18 +263,56 @@ function object(value: unknown): value is Record<string, unknown> {
|
|
|
263
263
|
return value !== null && typeof value === 'object' && !Array.isArray(value)
|
|
264
264
|
}
|
|
265
265
|
|
|
266
|
+
function packageManifest(root: string): Record<string, unknown> | null {
|
|
267
|
+
const manifestPath = path.join(root, 'package.json')
|
|
268
|
+
if (!fs.existsSync(manifestPath)) return null
|
|
269
|
+
const value: unknown = JSON.parse(fs.readFileSync(manifestPath, 'utf8'))
|
|
270
|
+
if (!object(value)) throw new Error(`${root}: package.json needs a name and version`)
|
|
271
|
+
return value
|
|
272
|
+
}
|
|
273
|
+
|
|
266
274
|
function packageInfo(root: string): TurboPackage {
|
|
267
275
|
root = fs.realpathSync(root)
|
|
268
|
-
const value
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
)
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
const value = packageManifest(root)
|
|
277
|
+
if (value) {
|
|
278
|
+
if (typeof value.name !== 'string' || typeof value.version !== 'string')
|
|
279
|
+
throw new Error(`${root}: package.json needs a name and version`)
|
|
280
|
+
return { name: value.name, version: value.version, root }
|
|
281
|
+
}
|
|
282
|
+
// create-expo-module --local ships expo-module.config.json and no package.json
|
|
283
|
+
let name = path.basename(root)
|
|
284
|
+
const configPath = path.join(root, 'expo-module.config.json')
|
|
285
|
+
if (fs.existsSync(configPath)) {
|
|
286
|
+
const config: unknown = JSON.parse(fs.readFileSync(configPath, 'utf8'))
|
|
287
|
+
if (object(config) && typeof config.name === 'string' && config.name !== '')
|
|
288
|
+
name = config.name
|
|
289
|
+
}
|
|
290
|
+
return { name, version: '0.0.0', root }
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
const DECLARED_MODULE_NAME = /\bName\(\s*"(\w+)"\s*\)/g
|
|
294
|
+
const EXPORTED_MODULE = /\bRCT_(?:EXPORT_MODULE(?:_NO_LOAD)?|EXTERN_MODULE)\s*\(\s*(\w*)/g
|
|
295
|
+
|
|
296
|
+
function moduleNamesAnswered(
|
|
297
|
+
root: string,
|
|
298
|
+
files: readonly string[],
|
|
299
|
+
answered: ReadonlySet<string>,
|
|
300
|
+
): boolean {
|
|
301
|
+
const names: string[] = []
|
|
302
|
+
for (const file of files) {
|
|
303
|
+
if (!/\.(?:swift|m|mm)$/.test(file)) continue
|
|
304
|
+
const text = stripComments(fs.readFileSync(path.join(root, file), 'utf8'))
|
|
305
|
+
for (const match of text.matchAll(DECLARED_MODULE_NAME))
|
|
306
|
+
if (match[1]) names.push(match[1])
|
|
307
|
+
for (const match of text.matchAll(EXPORTED_MODULE)) {
|
|
308
|
+
if (match[1]) names.push(match[1])
|
|
309
|
+
else {
|
|
310
|
+
const cls = /@implementation\s+(\w+)/.exec(text)?.[1]
|
|
311
|
+
if (cls) names.push(cls)
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
return names.length > 0 && names.every((name) => answered.has(name))
|
|
278
316
|
}
|
|
279
317
|
|
|
280
318
|
const sha256 = (data: string | Uint8Array) =>
|
|
@@ -918,6 +956,7 @@ export async function discoverTurboProviders(
|
|
|
918
956
|
appRoot: string,
|
|
919
957
|
projectRoot?: string,
|
|
920
958
|
iosTarget?: string,
|
|
959
|
+
answered: ReadonlySet<string> = new Set(),
|
|
921
960
|
): Promise<TurboProvider[]> {
|
|
922
961
|
const providers: TurboProvider[] = []
|
|
923
962
|
const candidates: { provider: TurboProvider; fabric: boolean }[] = []
|
|
@@ -951,6 +990,13 @@ export async function discoverTurboProviders(
|
|
|
951
990
|
if (!sources) continue
|
|
952
991
|
const { root, files } = sources
|
|
953
992
|
if (fabric || (files !== null && registers(root, files))) {
|
|
993
|
+
const nameFiles = files ?? podGlobFiles(pod)
|
|
994
|
+
if (
|
|
995
|
+
answered.size > 0 &&
|
|
996
|
+
nameFiles &&
|
|
997
|
+
moduleNamesAnswered(root, nameFiles, answered)
|
|
998
|
+
)
|
|
999
|
+
continue
|
|
954
1000
|
const dependencies = await Promise.all(
|
|
955
1001
|
podspecDependencies(pod.text).map((dep) =>
|
|
956
1002
|
resolveExternalTurboPod(dep.name, dep.requirements, dep.subspecs),
|
|
@@ -1051,10 +1097,8 @@ export async function collectTurboSources(options: {
|
|
|
1051
1097
|
let moduleProviders = false
|
|
1052
1098
|
const installedCodegenNames = new Set(
|
|
1053
1099
|
installedHeaderPods.flatMap((pod) => {
|
|
1054
|
-
const manifest
|
|
1055
|
-
|
|
1056
|
-
)
|
|
1057
|
-
if (!object(manifest) || !object(manifest.codegenConfig)) return []
|
|
1100
|
+
const manifest = packageManifest(pod.packageRoot)
|
|
1101
|
+
if (!manifest || !object(manifest.codegenConfig)) return []
|
|
1058
1102
|
const config = manifest.codegenConfig
|
|
1059
1103
|
return typeof config.name === 'string' && config.includesGeneratedCode !== true
|
|
1060
1104
|
? [config.name]
|
|
@@ -1680,11 +1724,9 @@ export async function collectTurboSources(options: {
|
|
|
1680
1724
|
}
|
|
1681
1725
|
for (const [name, relative] of pod.installed?.mappedHeaders ?? [])
|
|
1682
1726
|
header([name], { label, root, relative })
|
|
1683
|
-
const manifest
|
|
1684
|
-
fs.readFileSync(path.join(provider.root, 'package.json'), 'utf8'),
|
|
1685
|
-
)
|
|
1727
|
+
const manifest = packageManifest(provider.root)
|
|
1686
1728
|
const codegenConfig =
|
|
1687
|
-
|
|
1729
|
+
manifest && object(manifest.codegenConfig) ? manifest.codegenConfig : null
|
|
1688
1730
|
const sources: string[] = []
|
|
1689
1731
|
const codegenObjCSources: string[] = []
|
|
1690
1732
|
const swiftSources: string[] = []
|
package/src/xcode-project.ts
CHANGED
|
@@ -1616,7 +1616,17 @@ export function readXcodeScheme(
|
|
|
1616
1616
|
)
|
|
1617
1617
|
const target = project && projectTargets(project).find((ref) => ref.id === blueprint)
|
|
1618
1618
|
const name = target && str(target.target.name)
|
|
1619
|
-
if (!name)
|
|
1619
|
+
if (!name) {
|
|
1620
|
+
const declared = (project ? [project] : projects).flatMap((candidate) =>
|
|
1621
|
+
projectTargets(candidate).flatMap((ref) => {
|
|
1622
|
+
const targetName = str(ref.target.name)
|
|
1623
|
+
return targetName ? [targetName] : []
|
|
1624
|
+
}),
|
|
1625
|
+
)
|
|
1626
|
+
throw new Error(
|
|
1627
|
+
`scheme ${scheme} runs blueprint ${blueprint}, which no project here declares (declared targets: ${declared.join(', ') || 'none'})`,
|
|
1628
|
+
)
|
|
1629
|
+
}
|
|
1620
1630
|
return { target: name, configuration }
|
|
1621
1631
|
}
|
|
1622
1632
|
|
|
@@ -1677,8 +1687,18 @@ export function selectIosAppTarget(
|
|
|
1677
1687
|
requireSources: false,
|
|
1678
1688
|
}).includes(iosTarget),
|
|
1679
1689
|
)
|
|
1680
|
-
if (matches.length === 0)
|
|
1681
|
-
|
|
1690
|
+
if (matches.length === 0) {
|
|
1691
|
+
const known = [
|
|
1692
|
+
...new Set(
|
|
1693
|
+
projects.flatMap((entry) =>
|
|
1694
|
+
listXcodeAppTargets(entry.xcodeproj, { requireSources: false }),
|
|
1695
|
+
),
|
|
1696
|
+
),
|
|
1697
|
+
]
|
|
1698
|
+
throw new Error(
|
|
1699
|
+
`native app identity has no application target ${iosTarget}; pass --target with one of: ${known.join(', ') || 'none'}`,
|
|
1700
|
+
)
|
|
1701
|
+
}
|
|
1682
1702
|
if (matches.length > 1)
|
|
1683
1703
|
throw new Error(
|
|
1684
1704
|
`native app identity target ${iosTarget} is ambiguous across ${matches.map((entry) => entry.name).join(', ')}`,
|
|
@@ -1710,7 +1730,9 @@ export function selectIosAppTarget(
|
|
|
1710
1730
|
if (hasScheme) target = readXcodeScheme(container, target).target
|
|
1711
1731
|
}
|
|
1712
1732
|
if (!appTargets.includes(target))
|
|
1713
|
-
throw new Error(
|
|
1733
|
+
throw new Error(
|
|
1734
|
+
`native app identity has no application target ${target}; pass --target with one of: ${appTargets.join(', ') || 'none'}`,
|
|
1735
|
+
)
|
|
1714
1736
|
return { xcodeproj, target, workspace: project.workspace }
|
|
1715
1737
|
}
|
|
1716
1738
|
|
|
@@ -2698,7 +2720,10 @@ export function readXcodeAppTarget(
|
|
|
2698
2720
|
(value) =>
|
|
2699
2721
|
expand(value, (key) => {
|
|
2700
2722
|
const resolved = settings(key)
|
|
2701
|
-
if (!resolved)
|
|
2723
|
+
if (!resolved)
|
|
2724
|
+
throw new Error(
|
|
2725
|
+
`${entitlementsFile} references $(${key}), which ${module.name}'s build settings do not define${key === 'CFBundleIdentifier' ? ' (set PRODUCT_BUNDLE_IDENTIFIER; Xcode supplies it as CFBundleIdentifier)' : ''}`,
|
|
2726
|
+
)
|
|
2702
2727
|
return resolved
|
|
2703
2728
|
}),
|
|
2704
2729
|
)
|