peachsim 0.1.1654 → 0.1.1655
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 +237 -196
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/expo-swift-bundle.cjs +237 -196
- 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 +264 -208
- package/dist-lib/host/fetch-proxy-handler.cjs +28 -13
- 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 +2 -2
- 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 +1 -1
- package/dist-lib/native-app-identity-project.cjs +1 -1
- package/dist-lib/native-app-identity-project.mjs +1 -1
- 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/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 +23 -23
- package/dist-lib/public-origins-lib.json +51 -51
- package/dist-lib/react-native-host-modules.cjs +1 -1
- package/dist-lib/react-native-host-modules.mjs +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 +265 -209
- package/dist-lib/swift-compile.cjs +237 -196
- package/dist-lib/swift-compile.mjs +237 -196
- 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 +1 -1
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +237 -196
- package/dist-lib/vite.cjs +2 -2
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +4 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/host/fetch-proxy-handler.ts +27 -10
- package/src/swift-compile.ts +286 -237
- package/src/swiftContract.ts +2 -0
package/dist-lib/skills.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.1655 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
let __sootsim_import_meta_url = '', __sootsim_import_meta_dirname = ''; try { __sootsim_import_meta_url = require('url').pathToFileURL(__filename).href; __sootsim_import_meta_dirname = __dirname; } catch {}
|
|
3
3
|
"use strict";
|
|
4
4
|
var __create = Object.create;
|
|
@@ -50346,6 +50346,7 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
50346
50346
|
] : compileTargets(input);
|
|
50347
50347
|
const files2 = /* @__PURE__ */ new Map();
|
|
50348
50348
|
const native = /* @__PURE__ */ new Map();
|
|
50349
|
+
const targetFailures = [];
|
|
50349
50350
|
const bySourcePath = [...targets].sort(
|
|
50350
50351
|
(left, right) => right.path.length - left.path.length
|
|
50351
50352
|
);
|
|
@@ -50396,188 +50397,212 @@ function writeSwiftProject(layout, input, moduleRoot) {
|
|
|
50396
50397
|
if (units.length === 0) continue;
|
|
50397
50398
|
const settings = input.nativeTargets?.find((value) => value.name === target.name);
|
|
50398
50399
|
if (entries.some(([file]) => file.endsWith(".swift")) || settings && units.some(([file]) => /\.mm?$/.test(file))) {
|
|
50399
|
-
|
|
50400
|
-
|
|
50401
|
-
|
|
50400
|
+
const swift = entries.some(([file]) => file.endsWith(".swift"));
|
|
50401
|
+
try {
|
|
50402
|
+
if (!settings)
|
|
50403
|
+
throw new Error(
|
|
50404
|
+
`mixed target ${target.name} requires its original native target settings; SwiftPM does not compile mixed source targets`
|
|
50405
|
+
);
|
|
50406
|
+
const headers = settings.headers;
|
|
50407
|
+
const roots2 = settings.bridgingHeader ? [settings.bridgingHeader] : settings.publicHeaders;
|
|
50408
|
+
for (const file of headers) {
|
|
50409
|
+
const destination = import_node_path11.default.join(layout.root, file);
|
|
50410
|
+
(0, import_node_fs13.mkdirSync)(import_node_path11.default.dirname(destination), { recursive: true });
|
|
50411
|
+
(0, import_node_fs13.writeFileSync)(destination, input.files[file]);
|
|
50412
|
+
}
|
|
50413
|
+
const search = [
|
|
50414
|
+
.../* @__PURE__ */ new Set([
|
|
50415
|
+
...settings?.headerSearchPaths ?? [],
|
|
50416
|
+
...headers.map((file) => import_node_path11.default.posix.dirname(file))
|
|
50417
|
+
])
|
|
50418
|
+
].flatMap((dir) => ["-I", import_node_path11.default.join(layout.root, dir)]);
|
|
50419
|
+
const pin = distribution ?? JSON.parse((0, import_node_fs13.readFileSync)(import_node_path11.default.join(moduleRoot, "toolchain.json"), "utf8"));
|
|
50420
|
+
const release = pin.release;
|
|
50421
|
+
const toolchainBin = swiftToolchain(release, swiftModuleSdk(moduleRoot));
|
|
50422
|
+
const sdkHeaders = materializeObjcSdk(
|
|
50423
|
+
import_node_path11.default.join(layout.root, ".build", "peach-objc-sdk")
|
|
50402
50424
|
);
|
|
50403
|
-
|
|
50404
|
-
|
|
50405
|
-
|
|
50406
|
-
|
|
50407
|
-
|
|
50408
|
-
|
|
50409
|
-
|
|
50410
|
-
|
|
50411
|
-
|
|
50412
|
-
|
|
50413
|
-
|
|
50414
|
-
|
|
50415
|
-
|
|
50416
|
-
|
|
50417
|
-
|
|
50418
|
-
|
|
50419
|
-
|
|
50420
|
-
|
|
50421
|
-
|
|
50422
|
-
|
|
50423
|
-
|
|
50424
|
-
|
|
50425
|
-
|
|
50426
|
-
|
|
50427
|
-
|
|
50428
|
-
|
|
50429
|
-
|
|
50430
|
-
|
|
50431
|
-
|
|
50432
|
-
|
|
50433
|
-
|
|
50434
|
-
|
|
50435
|
-
|
|
50436
|
-
|
|
50437
|
-
|
|
50438
|
-
|
|
50439
|
-
|
|
50440
|
-
|
|
50441
|
-
|
|
50442
|
-
|
|
50443
|
-
|
|
50444
|
-
|
|
50445
|
-
|
|
50446
|
-
|
|
50447
|
-
|
|
50448
|
-
|
|
50449
|
-
|
|
50450
|
-
|
|
50451
|
-
|
|
50452
|
-
|
|
50453
|
-
|
|
50454
|
-
|
|
50455
|
-
|
|
50456
|
-
|
|
50457
|
-
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
50458
|
-
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
50459
|
-
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
50460
|
-
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
50461
|
-
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
50462
|
-
if (accessor) {
|
|
50463
|
-
files2.set(accessorHeader, accessor.header);
|
|
50464
|
-
files2.set(import_node_path11.default.join(layout.root, accessorUnit), accessor.body);
|
|
50465
|
-
}
|
|
50466
|
-
const sourceHeaders = import_node_path11.default.join(
|
|
50467
|
-
layout.root,
|
|
50468
|
-
".build",
|
|
50469
|
-
"peach-objc-originals",
|
|
50470
|
-
target.name
|
|
50471
|
-
);
|
|
50472
|
-
(0, import_node_fs13.mkdirSync)(sourceHeaders, { recursive: true });
|
|
50473
|
-
const modulemap = import_node_path11.default.join(sourceHeaders, "module.modulemap");
|
|
50474
|
-
(0, import_node_fs13.writeFileSync)(
|
|
50475
|
-
modulemap,
|
|
50476
|
-
`module ${swiftTargetModuleName(target.name)} {
|
|
50425
|
+
const stageFlags = (flags2, sdkInclude) => flags2.map(
|
|
50426
|
+
(flag) => flag.replaceAll(SWIFT_NATIVE_INPUT_ROOT, layout.root).replaceAll(SWIFT_NATIVE_SDK_INCLUDE, sdkInclude)
|
|
50427
|
+
);
|
|
50428
|
+
const originalFlags = [
|
|
50429
|
+
...settings?.flags ?? [],
|
|
50430
|
+
...search,
|
|
50431
|
+
...(settings?.frameworkSearchPaths ?? []).flatMap((dir) => [
|
|
50432
|
+
"-F",
|
|
50433
|
+
import_node_path11.default.join(layout.root, dir)
|
|
50434
|
+
]),
|
|
50435
|
+
"-I",
|
|
50436
|
+
headerDirectory
|
|
50437
|
+
];
|
|
50438
|
+
const flags = stageFlags(
|
|
50439
|
+
originalFlags,
|
|
50440
|
+
import_node_path11.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
50441
|
+
);
|
|
50442
|
+
const prefixHeader = settings?.prefixHeader ? ["-include", import_node_path11.default.join(layout.root, settings.prefixHeader)] : [];
|
|
50443
|
+
const bundleName = entries.some(([file]) => file.endsWith(".swift")) ? void 0 : swiftObjCResourceBundleName({
|
|
50444
|
+
target: target.name,
|
|
50445
|
+
path: target.path,
|
|
50446
|
+
resources: resourceTargets.find((candidate) => candidate.name === target.name)?.resources ?? false,
|
|
50447
|
+
usesBundleMacro: entries.some(
|
|
50448
|
+
([file, contents]) => /\.(?:c|cc|cpp|cxx|m|mm|h|hpp|hh|hxx)$/.test(file) && /\bSWIFTPM_MODULE_BUNDLE\b/.test(contents)
|
|
50449
|
+
),
|
|
50450
|
+
bundles: input.resourceBundles
|
|
50451
|
+
});
|
|
50452
|
+
const accessor = bundleName === void 0 ? void 0 : swiftObjCResourceAccessor(bundleName);
|
|
50453
|
+
const accessorHeader = import_node_path11.default.join(
|
|
50454
|
+
layout.root,
|
|
50455
|
+
target.path,
|
|
50456
|
+
OBJC_RESOURCE_ACCESSOR_HEADER
|
|
50457
|
+
);
|
|
50458
|
+
const accessorUnit = `${prefix}${OBJC_RESOURCE_ACCESSOR_BODY}`;
|
|
50459
|
+
if (accessor && (input.files[accessorUnit] !== void 0 || input.files[`${prefix}${OBJC_RESOURCE_ACCESSOR_HEADER}`] !== void 0))
|
|
50460
|
+
throw new Error(`target ${target.name} already contains its resource accessor`);
|
|
50461
|
+
const nativeUnits = accessor ? [...units, [accessorUnit, accessor.body]] : units;
|
|
50462
|
+
const accessorFlags = accessor ? ["-include", accessorHeader] : [];
|
|
50463
|
+
if (accessor) {
|
|
50464
|
+
files2.set(accessorHeader, accessor.header);
|
|
50465
|
+
files2.set(import_node_path11.default.join(layout.root, accessorUnit), accessor.body);
|
|
50466
|
+
}
|
|
50467
|
+
if (roots2.length) {
|
|
50468
|
+
const sourceHeaders = import_node_path11.default.join(
|
|
50469
|
+
layout.root,
|
|
50470
|
+
".build",
|
|
50471
|
+
"peach-objc-originals",
|
|
50472
|
+
target.name
|
|
50473
|
+
);
|
|
50474
|
+
(0, import_node_fs13.mkdirSync)(sourceHeaders, { recursive: true });
|
|
50475
|
+
const modulemap = import_node_path11.default.join(sourceHeaders, "module.modulemap");
|
|
50476
|
+
(0, import_node_fs13.writeFileSync)(
|
|
50477
|
+
modulemap,
|
|
50478
|
+
`module ${swiftTargetModuleName(target.name)} {
|
|
50477
50479
|
${roots2.map((file) => `header ${JSON.stringify(import_node_path11.default.join(layout.root, file))}`).join("\n")}
|
|
50478
50480
|
export *
|
|
50479
50481
|
}
|
|
50480
50482
|
`
|
|
50481
|
-
|
|
50482
|
-
|
|
50483
|
-
|
|
50484
|
-
|
|
50485
|
-
|
|
50486
|
-
|
|
50487
|
-
|
|
50488
|
-
|
|
50489
|
-
|
|
50490
|
-
|
|
50483
|
+
);
|
|
50484
|
+
const view = objcView(
|
|
50485
|
+
{
|
|
50486
|
+
module: swiftTargetModuleName(target.name),
|
|
50487
|
+
headers: sourceHeaders,
|
|
50488
|
+
modulemap
|
|
50489
|
+
},
|
|
50490
|
+
toolchainBin,
|
|
50491
|
+
import_node_path11.default.join(moduleRoot, "ios-simulator-stdlib"),
|
|
50492
|
+
import_node_path11.default.join(layout.root, ".build", "peach-objc-sdk"),
|
|
50493
|
+
import_node_path11.default.join(layout.root, ".build", "peach-objc-imports", target.name),
|
|
50494
|
+
{
|
|
50495
|
+
flags: stageFlags(originalFlags, import_node_path11.default.join(sdkHeaders, "usr/include")),
|
|
50496
|
+
target: `arm64-apple-ios${settings?.deploymentTarget ?? "16.0"}-simulator`
|
|
50497
|
+
}
|
|
50498
|
+
);
|
|
50499
|
+
const defined = /* @__PURE__ */ new Set();
|
|
50500
|
+
const declarations = (node) => {
|
|
50501
|
+
if (!node || typeof node !== "object") return;
|
|
50502
|
+
const name3 = Reflect.get(node, "name");
|
|
50503
|
+
if (Reflect.get(node, "kind") === "ObjCInterfaceDecl" && Reflect.get(node, "super") && typeof name3 === "string")
|
|
50504
|
+
defined.add(name3);
|
|
50505
|
+
const children = Reflect.get(node, "inner");
|
|
50506
|
+
if (Array.isArray(children)) for (const child of children) declarations(child);
|
|
50507
|
+
};
|
|
50508
|
+
declarations(view.clangAST);
|
|
50509
|
+
const foreignTypes = /* @__PURE__ */ new Map();
|
|
50510
|
+
for (const graph of view.graphs)
|
|
50511
|
+
for (const symbol of graph.symbols) {
|
|
50512
|
+
const nativeName = /^c:objc\(cs\)(\w+)$/.exec(
|
|
50513
|
+
symbol.identifier.precise
|
|
50514
|
+
)?.[1];
|
|
50515
|
+
if (nativeName && defined.has(nativeName))
|
|
50516
|
+
foreignTypes.set(symbol.pathComponents[0], nativeName);
|
|
50517
|
+
}
|
|
50518
|
+
imports.set(target.name, {
|
|
50519
|
+
view,
|
|
50520
|
+
classes: [...foreignTypes.values()],
|
|
50521
|
+
headers: roots2.map((file) => import_node_path11.default.join(layout.root, file)),
|
|
50522
|
+
foreignTypes
|
|
50523
|
+
});
|
|
50491
50524
|
}
|
|
50492
|
-
|
|
50493
|
-
|
|
50494
|
-
|
|
50495
|
-
|
|
50496
|
-
|
|
50497
|
-
|
|
50498
|
-
|
|
50499
|
-
const children = Reflect.get(node, "inner");
|
|
50500
|
-
if (Array.isArray(children)) for (const child of children) declarations(child);
|
|
50501
|
-
};
|
|
50502
|
-
declarations(view.clangAST);
|
|
50503
|
-
const foreignTypes = /* @__PURE__ */ new Map();
|
|
50504
|
-
for (const graph of view.graphs)
|
|
50505
|
-
for (const symbol of graph.symbols) {
|
|
50506
|
-
const nativeName = /^c:objc\(cs\)(\w+)$/.exec(symbol.identifier.precise)?.[1];
|
|
50507
|
-
if (nativeName && defined.has(nativeName))
|
|
50508
|
-
foreignTypes.set(symbol.pathComponents[0], nativeName);
|
|
50509
|
-
}
|
|
50510
|
-
imports.set(target.name, {
|
|
50511
|
-
view,
|
|
50512
|
-
classes: [...foreignTypes.values()],
|
|
50513
|
-
headers: roots2.map((file) => import_node_path11.default.join(layout.root, file)),
|
|
50514
|
-
foreignTypes
|
|
50515
|
-
});
|
|
50516
|
-
const thunk = "PeachObjCImports.generated.m";
|
|
50517
|
-
const groups = /* @__PURE__ */ new Map();
|
|
50518
|
-
for (const [file] of nativeUnits) {
|
|
50519
|
-
const origin = settings?.sourceDirectories[file];
|
|
50520
|
-
if (origin) (0, import_node_fs13.mkdirSync)(import_node_path11.default.join(layout.root, origin), { recursive: true });
|
|
50521
|
-
const perFile = [
|
|
50522
|
-
...origin ? ["-iquote", import_node_path11.default.join(layout.root, origin)] : [],
|
|
50523
|
-
...stageFlags(
|
|
50524
|
-
settings?.fileFlags[file] ?? [],
|
|
50525
|
-
import_node_path11.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
50526
|
-
)
|
|
50527
|
-
];
|
|
50528
|
-
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
50529
|
-
const identity = (0, import_node_crypto11.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
50530
|
-
const group = groups.get(identity) ?? {
|
|
50531
|
-
name: `${target.name}SwiftImplementation_${identity}`,
|
|
50532
|
-
sources: [],
|
|
50533
|
-
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
50534
|
-
cxxFlags: [
|
|
50535
|
-
...flags,
|
|
50536
|
-
...prefixHeader,
|
|
50537
|
-
...accessorFlags,
|
|
50525
|
+
const thunks = roots2.length ? ["PeachObjCImports.generated.m"] : [];
|
|
50526
|
+
const groups = /* @__PURE__ */ new Map();
|
|
50527
|
+
for (const [file] of nativeUnits) {
|
|
50528
|
+
const origin = settings?.sourceDirectories[file];
|
|
50529
|
+
if (origin) (0, import_node_fs13.mkdirSync)(import_node_path11.default.join(layout.root, origin), { recursive: true });
|
|
50530
|
+
const perFile = [
|
|
50531
|
+
...origin ? ["-iquote", import_node_path11.default.join(layout.root, origin)] : [],
|
|
50538
50532
|
...stageFlags(
|
|
50539
|
-
|
|
50533
|
+
settings?.fileFlags[file] ?? [],
|
|
50540
50534
|
import_node_path11.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
50541
|
-
)
|
|
50542
|
-
|
|
50543
|
-
|
|
50544
|
-
|
|
50545
|
-
|
|
50546
|
-
|
|
50547
|
-
|
|
50548
|
-
|
|
50549
|
-
|
|
50550
|
-
|
|
50551
|
-
|
|
50552
|
-
|
|
50553
|
-
|
|
50554
|
-
|
|
50555
|
-
|
|
50556
|
-
|
|
50557
|
-
|
|
50535
|
+
)
|
|
50536
|
+
];
|
|
50537
|
+
const cxx = /\.(?:cc|cpp|cxx|mm)$/.test(file);
|
|
50538
|
+
const identity = (0, import_node_crypto11.createHash)("sha256").update(JSON.stringify([cxx, perFile])).digest("hex").slice(0, 12);
|
|
50539
|
+
const group = groups.get(identity) ?? {
|
|
50540
|
+
name: `${target.name}SwiftImplementation_${identity}`,
|
|
50541
|
+
sources: [],
|
|
50542
|
+
flags: [...flags, ...prefixHeader, ...accessorFlags, ...perFile],
|
|
50543
|
+
cxxFlags: [
|
|
50544
|
+
...flags,
|
|
50545
|
+
...prefixHeader,
|
|
50546
|
+
...accessorFlags,
|
|
50547
|
+
...stageFlags(
|
|
50548
|
+
cxx ? settings.cxxFlags : [],
|
|
50549
|
+
import_node_path11.default.join(swiftSdkPaths(moduleRoot, toolchainBin).sysroot, "include")
|
|
50550
|
+
),
|
|
50551
|
+
...perFile
|
|
50552
|
+
]
|
|
50553
|
+
};
|
|
50554
|
+
group.sources.push(file.slice(prefix.length));
|
|
50555
|
+
groups.set(identity, group);
|
|
50556
|
+
}
|
|
50557
|
+
if (thunks.length)
|
|
50558
|
+
groups.set("imports", {
|
|
50559
|
+
name: `${target.name}ObjCImports`,
|
|
50560
|
+
sources: thunks,
|
|
50561
|
+
flags: [...flags, "-fobjc-arc"],
|
|
50562
|
+
cxxFlags: [...flags, "-fobjc-arc"]
|
|
50563
|
+
});
|
|
50564
|
+
const include2 = import_node_path11.default.join(layout.root, target.path, "include");
|
|
50565
|
+
files2.set(
|
|
50566
|
+
import_node_path11.default.join(include2, "module.modulemap"),
|
|
50567
|
+
`module ${target.name}ImplementationDeclarations { export * }
|
|
50558
50568
|
`
|
|
50559
|
-
|
|
50560
|
-
|
|
50561
|
-
|
|
50562
|
-
|
|
50563
|
-
|
|
50564
|
-
|
|
50565
|
-
|
|
50566
|
-
|
|
50567
|
-
|
|
50568
|
-
|
|
50569
|
-
|
|
50570
|
-
|
|
50571
|
-
|
|
50572
|
-
|
|
50573
|
-
|
|
50574
|
-
|
|
50575
|
-
|
|
50576
|
-
|
|
50577
|
-
|
|
50578
|
-
|
|
50579
|
-
|
|
50580
|
-
|
|
50569
|
+
);
|
|
50570
|
+
native.set(target.name, {
|
|
50571
|
+
mixed: true,
|
|
50572
|
+
path: target.path,
|
|
50573
|
+
includeDirectory: include2,
|
|
50574
|
+
sources: nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
50575
|
+
lateSources: [
|
|
50576
|
+
...nativeUnits.map(([file]) => file.slice(prefix.length)),
|
|
50577
|
+
...thunks
|
|
50578
|
+
],
|
|
50579
|
+
exclude: [
|
|
50580
|
+
...entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length)),
|
|
50581
|
+
...accessor ? [OBJC_RESOURCE_ACCESSOR_HEADER, OBJC_RESOURCE_ACCESSOR_BODY] : [],
|
|
50582
|
+
...thunks,
|
|
50583
|
+
"include"
|
|
50584
|
+
],
|
|
50585
|
+
groups: [...groups.values()],
|
|
50586
|
+
late: {
|
|
50587
|
+
name: `${target.name}SwiftImplementation`,
|
|
50588
|
+
producers: [
|
|
50589
|
+
target.name,
|
|
50590
|
+
...(target.dependencies ?? []).filter((dependency) => swiftTargets.has(dependency.name)).map((dependency) => dependency.name)
|
|
50591
|
+
]
|
|
50592
|
+
}
|
|
50593
|
+
});
|
|
50594
|
+
} catch (error) {
|
|
50595
|
+
if (!swift || !(error instanceof Error)) throw error;
|
|
50596
|
+
targetFailures.push(`${target.name}: ${error.message}`);
|
|
50597
|
+
native.set(target.name, {
|
|
50598
|
+
mixed: true,
|
|
50599
|
+
path: target.path,
|
|
50600
|
+
includeDirectory: import_node_path11.default.join(layout.root, target.path, "include"),
|
|
50601
|
+
sources: [],
|
|
50602
|
+
lateSources: [],
|
|
50603
|
+
exclude: entries.filter(([file]) => !file.endsWith(".swift") && !file.endsWith(".metal")).map(([file]) => file.slice(prefix.length))
|
|
50604
|
+
});
|
|
50605
|
+
}
|
|
50581
50606
|
continue;
|
|
50582
50607
|
}
|
|
50583
50608
|
const includes = `${prefix}include/`;
|
|
@@ -50740,20 +50765,27 @@ export *
|
|
|
50740
50765
|
for (const name3 of objcProducers) {
|
|
50741
50766
|
const target = targets.find((value) => value.name === name3);
|
|
50742
50767
|
const prefix = target.path === "." ? "" : `${target.path}/`;
|
|
50743
|
-
|
|
50744
|
-
|
|
50745
|
-
|
|
50746
|
-
|
|
50747
|
-
|
|
50748
|
-
|
|
50749
|
-
|
|
50750
|
-
|
|
50751
|
-
|
|
50752
|
-
|
|
50753
|
-
|
|
50754
|
-
|
|
50755
|
-
|
|
50756
|
-
|
|
50768
|
+
let exported;
|
|
50769
|
+
try {
|
|
50770
|
+
exported = swiftObjCExports({
|
|
50771
|
+
module: swiftTargetModuleName(name3),
|
|
50772
|
+
sources: Object.entries(input.files).filter(
|
|
50773
|
+
([file]) => file.startsWith(prefix) && file.endsWith(".swift") && !targets.some(
|
|
50774
|
+
(candidate) => candidate.name !== name3 && candidate.path !== "." && candidate.path.startsWith(prefix) && file.startsWith(`${candidate.path}/`)
|
|
50775
|
+
) && !target.exclude?.some(
|
|
50776
|
+
(excluded) => file.slice(prefix.length) === excluded || file.slice(prefix.length).startsWith(`${excluded}/`)
|
|
50777
|
+
)
|
|
50778
|
+
),
|
|
50779
|
+
mask: swiftCodeMask,
|
|
50780
|
+
declarationStart,
|
|
50781
|
+
selector: objcSelectorName,
|
|
50782
|
+
foreignTypes: imports.get(name3)?.foreignTypes
|
|
50783
|
+
});
|
|
50784
|
+
} catch (error) {
|
|
50785
|
+
if (!(error instanceof Error)) throw error;
|
|
50786
|
+
targetFailures.push(`${name3}: ${error.message}`);
|
|
50787
|
+
continue;
|
|
50788
|
+
}
|
|
50757
50789
|
const original = imports.get(name3);
|
|
50758
50790
|
if (!exported && !original) continue;
|
|
50759
50791
|
objcModules.add(name3);
|
|
@@ -51025,6 +51057,7 @@ public func __peachObjcExportRoot() { _objcRegisterPeerClass(NSObject.self, nati
|
|
|
51025
51057
|
for (const dependency of dependencies.get(producer) ?? []) include(dependency);
|
|
51026
51058
|
return {
|
|
51027
51059
|
headerProducers: producers.filter((name3) => !included.has(name3)),
|
|
51060
|
+
targetFailures,
|
|
51028
51061
|
...rootOwner && objcExports ? {
|
|
51029
51062
|
objcImplementations: {
|
|
51030
51063
|
owner: import_node_path11.default.join(layout.root, rootOwner),
|
|
@@ -51243,6 +51276,9 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
51243
51276
|
return retain(root, built2);
|
|
51244
51277
|
}
|
|
51245
51278
|
const preparation = writeSwiftProject(layout, input, moduleRoot);
|
|
51279
|
+
const unprepared = preparation.targetFailures.map(
|
|
51280
|
+
(failure3) => `error: target ${failure3}`
|
|
51281
|
+
);
|
|
51246
51282
|
const swift = import_node_path11.default.join(options.toolchainBin, "swift");
|
|
51247
51283
|
if (!(0, import_node_fs13.existsSync)(swift)) {
|
|
51248
51284
|
throw new Error(
|
|
@@ -51392,18 +51428,23 @@ function compileSwiftProjectUnit(input, options) {
|
|
|
51392
51428
|
);
|
|
51393
51429
|
} catch (retryError) {
|
|
51394
51430
|
throw new Error(
|
|
51395
|
-
|
|
51396
|
-
|
|
51397
|
-
|
|
51398
|
-
|
|
51431
|
+
[
|
|
51432
|
+
...unprepared,
|
|
51433
|
+
projectDiagnostic(outputOf(retryError), layout, input.files)
|
|
51434
|
+
].join("\n"),
|
|
51435
|
+
{ cause: retryError }
|
|
51399
51436
|
);
|
|
51400
51437
|
}
|
|
51401
51438
|
} else {
|
|
51402
|
-
throw new Error(
|
|
51403
|
-
|
|
51404
|
-
|
|
51439
|
+
throw new Error(
|
|
51440
|
+
[...unprepared, projectDiagnostic(output, layout, input.files)].join(
|
|
51441
|
+
"\n"
|
|
51442
|
+
),
|
|
51443
|
+
{ cause: error }
|
|
51444
|
+
);
|
|
51405
51445
|
}
|
|
51406
51446
|
}
|
|
51447
|
+
if (unprepared.length) throw new Error(unprepared.join("\n"));
|
|
51407
51448
|
const artifact = {
|
|
51408
51449
|
hash: hash2,
|
|
51409
51450
|
bytes: (0, import_node_fs13.readFileSync)(builtArtifact(layout)),
|
|
@@ -51526,7 +51567,7 @@ var init_swift_compile = __esm({
|
|
|
51526
51567
|
`;
|
|
51527
51568
|
REACTOR_FLAG = '"-Xclang-linker", "-mexec-model=reactor",\n';
|
|
51528
51569
|
MULTI_MANIFEST_VERSION = 39;
|
|
51529
|
-
compilerSourceDigest = true ? "
|
|
51570
|
+
compilerSourceDigest = true ? "042e57f70d169ec5fd94262a87fc4d50da0c31cc6a6c329e56f12d4b7c5484a1" : swiftCompilerSourceDigest(__sootsim_import_meta_dirname);
|
|
51530
51571
|
DIRECTIVE = /^[ \t]*#(?:if|elseif)\b/;
|
|
51531
51572
|
OS_IOS = /\b(?:os\(\s*iOS\s*\)|targetEnvironment\(\s*simulator\s*\))/g;
|
|
51532
51573
|
OBJC_ATTRIBUTE = /^@(?:objcMembers\b|objc\b(?:(\s*)\(([^()]*)\))?|IBAction\b)/;
|
|
@@ -64634,7 +64675,7 @@ var init_runtime_assets = __esm({
|
|
|
64634
64675
|
var runtime_companion_default;
|
|
64635
64676
|
var init_runtime_companion = __esm({
|
|
64636
64677
|
"runtime-companion.json"() {
|
|
64637
|
-
runtime_companion_default = { abi: 1, sha256: "
|
|
64678
|
+
runtime_companion_default = { abi: 1, sha256: "6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce", file: "node/cli-6f6a55398d832d1703346a258bf9f81bf78fded8cf5d83cdf51e5e15ccd7a1ce.cjs" };
|
|
64638
64679
|
}
|
|
64639
64680
|
});
|
|
64640
64681
|
|
|
@@ -71112,18 +71153,32 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
|
|
|
71112
71153
|
await route.respond(proxyRes, hopCookies);
|
|
71113
71154
|
res.statusCode = status;
|
|
71114
71155
|
if (isBundleProxyRequestUrl(req.url) && method === "GET" && status === 200 && targetUrl.pathname.endsWith(".bundle") && proxyRes.headers["x-peach-rolldown-inventory"] !== "1") {
|
|
71115
|
-
const
|
|
71116
|
-
|
|
71117
|
-
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
71118
|
-
}
|
|
71119
|
-
const payload = Buffer.concat(chunks).toString("utf8");
|
|
71120
|
-
const contentType2 = typeof proxyRes.headers["content-type"] === "string" ? proxyRes.headers["content-type"] : void 0;
|
|
71121
|
-
const annotated = await getCliRuntime().rolldown_bundle_inventory.attachRolldownBundleHttpPayload(
|
|
71122
|
-
payload,
|
|
71123
|
-
contentType2
|
|
71124
|
-
);
|
|
71156
|
+
const contentType2 = typeof proxyRes.headers["content-type"] === "string" ? proxyRes.headers["content-type"] : "";
|
|
71157
|
+
const inventory = getCliRuntime().rolldown_bundle_inventory;
|
|
71125
71158
|
res.removeHeader("content-length");
|
|
71126
|
-
|
|
71159
|
+
const annotate = async function* () {
|
|
71160
|
+
const decoder = new TextDecoder();
|
|
71161
|
+
let payload = "";
|
|
71162
|
+
let sent = 0;
|
|
71163
|
+
let bundleStarted = false;
|
|
71164
|
+
for await (const chunk of proxyRes) {
|
|
71165
|
+
payload += decoder.decode(chunk, { stream: true });
|
|
71166
|
+
if (bundleStarted) continue;
|
|
71167
|
+
const releasable = inventory.releasableMultipartPrefix(payload, contentType2);
|
|
71168
|
+
bundleStarted = releasable.bundleStarted;
|
|
71169
|
+
if (releasable.length > sent) {
|
|
71170
|
+
yield Buffer.from(payload.slice(sent, releasable.length), "utf8");
|
|
71171
|
+
sent = releasable.length;
|
|
71172
|
+
}
|
|
71173
|
+
}
|
|
71174
|
+
payload += decoder.decode();
|
|
71175
|
+
const annotated = await inventory.attachRolldownBundleHttpPayload(
|
|
71176
|
+
payload,
|
|
71177
|
+
contentType2
|
|
71178
|
+
);
|
|
71179
|
+
yield Buffer.from(annotated.slice(sent), "utf8");
|
|
71180
|
+
};
|
|
71181
|
+
await (0, import_promises5.pipeline)(import_stream.Readable.from(annotate(), { objectMode: false }), res);
|
|
71127
71182
|
return;
|
|
71128
71183
|
}
|
|
71129
71184
|
await (0, import_promises5.pipeline)(proxyRes, res);
|
|
@@ -71170,13 +71225,14 @@ async function proxyUpstream(req, res, upstreamUrl, reportFailure, route) {
|
|
|
71170
71225
|
else req.socket.destroy();
|
|
71171
71226
|
}
|
|
71172
71227
|
}
|
|
71173
|
-
var import_http2, import_https, import_node_http2, import_promises5, fetchProxyHttpAgent, fetchProxyHttpsAgent, FETCH_PROXY_CORS_HEADERS, APP_API_HEADER_REWRITES;
|
|
71228
|
+
var import_http2, import_https, import_node_http2, import_stream, import_promises5, fetchProxyHttpAgent, fetchProxyHttpsAgent, FETCH_PROXY_CORS_HEADERS, APP_API_HEADER_REWRITES;
|
|
71174
71229
|
var init_fetch_proxy_handler = __esm({
|
|
71175
71230
|
"src/host/fetch-proxy-handler.ts"() {
|
|
71176
71231
|
"use strict";
|
|
71177
71232
|
import_http2 = __toESM(require("http"), 1);
|
|
71178
71233
|
import_https = __toESM(require("https"), 1);
|
|
71179
71234
|
import_node_http2 = require("node:http2");
|
|
71235
|
+
import_stream = require("stream");
|
|
71180
71236
|
import_promises5 = require("stream/promises");
|
|
71181
71237
|
init_backend_origin();
|
|
71182
71238
|
init_bundleGlobalFooter();
|