peachsim 0.1.2560 → 0.1.2562
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 +52 -12
- 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 +2 -2
- package/dist-lib/dev-bundle-resolution.cjs +1 -1
- package/dist-lib/esm-chunks/{acorn-CO5WASBN.mjs → acorn-Q22M6WOR.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-3BESMJQO.mjs → chunk-2SO2C5FV.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-RL2FZIJ4.mjs → chunk-36FHDERF.mjs} +5 -5
- package/dist-lib/esm-chunks/{chunk-XOEBZM45.mjs → chunk-A4JEVAJE.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-D2E3LXDA.mjs → chunk-AM4K5S4B.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-JGCU4O43.mjs → chunk-BHYC2MNS.mjs} +3 -3
- package/dist-lib/esm-chunks/{chunk-3BCOQ4H2.mjs → chunk-CNAMYVUQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-KVRVF6Q6.mjs → chunk-GKMAR3UN.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-B5EXH3LW.mjs → chunk-GZISBWKM.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-27TSGHLA.mjs → chunk-HJZRIROU.mjs} +4 -4
- package/dist-lib/esm-chunks/{chunk-2HHFMQBN.mjs → chunk-JKZVLPH3.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-TBSCDD2J.mjs → chunk-MNFZO6P7.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-GKOJM3J2.mjs → chunk-ONETXZWG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-5PEKPAXB.mjs → chunk-PDHKRXLR.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2UZ7WW4Y.mjs → chunk-PLJGPUCK.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-SSY2MDJY.mjs → chunk-QAR3QLGG.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-HLKBS5IR.mjs → chunk-QN6HZZRJ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-2GEELRIL.mjs → chunk-SCRYU7HQ.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-P6EKH2IL.mjs → chunk-UESWZZED.mjs} +2 -2
- package/dist-lib/esm-chunks/{chunk-R7VDCV2V.mjs → chunk-VOOX3EIF.mjs} +59 -19
- package/dist-lib/esm-chunks/{chunk-LAHNJ2GO.mjs → chunk-XGXCADRS.mjs} +1 -1
- package/dist-lib/esm-chunks/{chunk-YCGMZYJG.mjs → chunk-YHV5ITC4.mjs} +5 -5
- package/dist-lib/esm-chunks/{metro-layout-parser-O2CVDM6R.mjs → metro-layout-parser-6NROM3NC.mjs} +3 -3
- package/dist-lib/esm-chunks/{swift-package-prebuilt-SY3FNEHX.mjs → swift-package-prebuilt-4SGKMCEQ.mjs} +10 -10
- package/dist-lib/esm-chunks/{swift-sdk-app-module-J3RFODQ7.mjs → swift-sdk-app-module-K2BBOWB3.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-4OZNBMXU.mjs → swift-sdk-image-2OORMZCP.mjs} +13 -13
- package/dist-lib/esm-chunks/{swift-sdk-image-producer-ZPXRBMCV.mjs → swift-sdk-image-producer-XQ3KW7BR.mjs} +4 -4
- package/dist-lib/expo-swift-bundle.cjs +50 -10
- 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 +92 -41
- package/dist-lib/host/fetch-proxy-handler.cjs +5 -5
- 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 +2 -2
- package/dist-lib/native-app-identity-project.mjs +15 -15
- 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 +79 -79
- package/dist-lib/public-origins-lib.json +69 -69
- 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 +7 -7
- package/dist-lib/skills.cjs +98 -47
- package/dist-lib/swift-compile.cjs +48 -8
- package/dist-lib/swift-compile.mjs +10 -10
- 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 +5 -5
- 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/@xmldom/xmldom.cjs +1 -1
- package/dist-lib/vendor/acorn.cjs +1 -1
- package/dist-lib/vendor/bplist-parser.cjs +1 -1
- package/dist-lib/vendor/ignore.cjs +1 -1
- package/dist-lib/vendor/magic-string.cjs +1 -1
- package/dist-lib/vendor/plist.cjs +1 -1
- package/dist-lib/vendor/smol-toml.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/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/browser-object-url.d.ts +1 -8
- package/dist-types/packages/peach-globals/src/browser-url.d.ts +8 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/src/runtime-assets.ts +49 -43
- package/src/swift-compile.ts +54 -8
- package/src/swiftContract.ts +2 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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 __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
4
|
var __commonJS = (cb, mod) => function __require() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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
|
|
|
4
4
|
// ../../node_modules/valibot/dist/index.cjs
|
package/dist-lib/vendor/ws.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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 __getOwnPropNames = Object.getOwnPropertyNames;
|
package/dist-lib/vendor/zod.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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 __getOwnPropNames = Object.getOwnPropertyNames;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (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;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/*! peach v0.1.
|
|
1
|
+
/*! peach v0.1.2562 | (c) 2026 Tamagui LLC | Proprietary; see LICENSE */
|
|
2
2
|
import {
|
|
3
3
|
parse
|
|
4
|
-
} from "./esm-chunks/chunk-
|
|
4
|
+
} from "./esm-chunks/chunk-A4JEVAJE.mjs";
|
|
5
5
|
import {
|
|
6
6
|
__privateAdd,
|
|
7
7
|
__privateGet,
|
|
8
8
|
__publicField
|
|
9
|
-
} from "./esm-chunks/chunk-
|
|
9
|
+
} from "./esm-chunks/chunk-JKZVLPH3.mjs";
|
|
10
10
|
|
|
11
11
|
// src/worklet-kernel.ts
|
|
12
12
|
var Unsupported = class extends Error {
|
|
@@ -50,6 +50,7 @@ export type PreviewUploadInitRequest = {
|
|
|
50
50
|
contentHash: string;
|
|
51
51
|
hasBundle?: boolean;
|
|
52
52
|
bundleSizeBytes?: number;
|
|
53
|
+
bundleUploadSizeBytes?: number;
|
|
53
54
|
bundleContentType?: string;
|
|
54
55
|
bundleNativeAppIdentityHeader?: string | null;
|
|
55
56
|
bundleEncoding?: 'gzip' | 'br';
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
new (url: string | URL, base?: string | URL): URL;
|
|
3
|
-
prototype: URL;
|
|
4
|
-
canParse(url: string | URL, base?: string | URL): boolean;
|
|
5
|
-
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
-
parse(url: string | URL, base?: string | URL): URL | null;
|
|
7
|
-
revokeObjectURL(url: string): void;
|
|
8
|
-
};
|
|
1
|
+
export { BrowserURL } from './browser-url.d.ts';
|
|
9
2
|
export declare const createBrowserObjectURL: (obj: Blob | MediaSource) => string;
|
|
10
3
|
export declare const revokeBrowserObjectURL: (url: string) => void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const BrowserURL: {
|
|
2
|
+
new (url: string | URL, base?: string | URL): URL;
|
|
3
|
+
prototype: URL;
|
|
4
|
+
canParse(url: string | URL, base?: string | URL): boolean;
|
|
5
|
+
createObjectURL(obj: Blob | MediaSource): string;
|
|
6
|
+
parse(url: string | URL, base?: string | URL): URL | null;
|
|
7
|
+
revokeObjectURL(url: string): void;
|
|
8
|
+
};
|
package/package.json
CHANGED
package/runtime-companion.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"abi":1,"sha256":"
|
|
1
|
+
{"abi":1,"sha256":"e4f8c9667fee8ed0bd41316d684267b2b7fd65309e3430a850786931e5589010","file":"node/cli-e4f8c9667fee8ed0bd41316d684267b2b7fd65309e3430a850786931e5589010.cjs"}
|
package/src/runtime-assets.ts
CHANGED
|
@@ -228,10 +228,16 @@ export function resolveRuntimeFilePath(
|
|
|
228
228
|
// isolated surface: Swift timed waits block with Atomics.wait on a
|
|
229
229
|
// SharedArrayBuffer, which exists only when the document and its workers are
|
|
230
230
|
// isolated. require-corp because Safari does not isolate under credentialless.
|
|
231
|
+
export const runtimeIsolationHeaders = {
|
|
232
|
+
'cross-origin-opener-policy': 'same-origin',
|
|
233
|
+
'cross-origin-embedder-policy': 'require-corp',
|
|
234
|
+
'cross-origin-resource-policy': 'cross-origin',
|
|
235
|
+
}
|
|
236
|
+
|
|
231
237
|
export function setRuntimeIsolationHeaders(res: ServerResponse) {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
238
|
+
for (const [name, value] of Object.entries(runtimeIsolationHeaders)) {
|
|
239
|
+
res.setHeader(name, value)
|
|
240
|
+
}
|
|
235
241
|
}
|
|
236
242
|
|
|
237
243
|
export function sendShellHtml(res: ServerResponse, html: string) {
|
|
@@ -240,37 +246,32 @@ export function sendShellHtml(res: ServerResponse, html: string) {
|
|
|
240
246
|
res.end(html)
|
|
241
247
|
}
|
|
242
248
|
|
|
249
|
+
// content-hashed artifacts (`name?sha256=<full hash>`, the one url scheme
|
|
250
|
+
// from src/site/cacheControl) are immutable: the url changes when the bytes
|
|
251
|
+
// do, so a warm document reuses its cache and a new artifact can never
|
|
252
|
+
// serve stale. (this file keeps its own 3-line predicate instead of
|
|
253
|
+
// importing the shared helper: the packaged CLI serves standalone.)
|
|
254
|
+
export function runtimeFileHeaders(filePath: string, url: string, lastModified: string) {
|
|
255
|
+
const immutable =
|
|
256
|
+
/^canvaskit-graphite-pipelines-[0-9a-f]{8}\.bin$/.test(path.basename(filePath)) ||
|
|
257
|
+
/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(url)
|
|
258
|
+
return {
|
|
259
|
+
...runtimeIsolationHeaders,
|
|
260
|
+
'content-type': MIME_TYPES[path.extname(filePath)] || 'application/octet-stream',
|
|
261
|
+
'cache-control': immutable ? 'public, max-age=31536000, immutable' : 'no-cache',
|
|
262
|
+
...(!immutable && { 'last-modified': lastModified }),
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
243
266
|
export function serveRuntimeFile(req: any, res: any, fullPath: string) {
|
|
244
|
-
setRuntimeIsolationHeaders(res)
|
|
245
|
-
const ext = path.extname(fullPath)
|
|
246
267
|
const stat = fs.statSync(fullPath)
|
|
247
|
-
const
|
|
248
|
-
|
|
249
|
-
if (
|
|
250
|
-
res.setHeader('cache-control', 'public, max-age=31536000, immutable')
|
|
268
|
+
const headers = runtimeFileHeaders(fullPath, req?.url ?? '', stat.mtime.toUTCString())
|
|
269
|
+
for (const [name, value] of Object.entries(headers)) res.setHeader(name, value)
|
|
270
|
+
if (!headers['last-modified']) {
|
|
251
271
|
fs.createReadStream(fullPath).pipe(res)
|
|
252
272
|
return
|
|
253
273
|
}
|
|
254
|
-
|
|
255
|
-
// from src/site/cacheControl) are immutable: the url changes when the bytes
|
|
256
|
-
// do, so a warm document reuses its cache and a new artifact can never
|
|
257
|
-
// serve stale. (this file keeps its own 3-line predicate instead of
|
|
258
|
-
// importing the shared helper: the packaged CLI serves standalone.)
|
|
259
|
-
if (/[?&]sha256=[a-f0-9]{64}(?:&|$)/.test(req?.url ?? '')) {
|
|
260
|
-
res.setHeader('cache-control', 'public, max-age=31536000, immutable')
|
|
261
|
-
fs.createReadStream(fullPath).pipe(res)
|
|
262
|
-
return
|
|
263
|
-
}
|
|
264
|
-
// these urls are STABLE across dev rebuilds and runtime version switches
|
|
265
|
-
// (both worker entries, canvaskit-graphite.wasm, and the html shells are
|
|
266
|
-
// unhashed), so the
|
|
267
|
-
// browser must revalidate every load — the old year-long immutable here made every
|
|
268
|
-
// new tab run a stale cached tenant entry against a fresh engine,
|
|
269
|
-
// which also broke `do reload` ("bridge never reconnected"). no-cache +
|
|
270
|
-
// last-modified keeps repeat loads cheap 304s on localhost.
|
|
271
|
-
res.setHeader('cache-control', 'no-cache')
|
|
272
|
-
res.setHeader('last-modified', lastModified)
|
|
273
|
-
if (req?.headers?.['if-modified-since'] === lastModified) {
|
|
274
|
+
if (req?.headers?.['if-modified-since'] === headers['last-modified']) {
|
|
274
275
|
res.statusCode = 304
|
|
275
276
|
res.end()
|
|
276
277
|
return
|
|
@@ -278,6 +279,17 @@ export function serveRuntimeFile(req: any, res: any, fullPath: string) {
|
|
|
278
279
|
sendFileWithRanges(req, res, fullPath, stat.size, {})
|
|
279
280
|
}
|
|
280
281
|
|
|
282
|
+
export function runtimeFileRange(header: string | null | undefined, total: number) {
|
|
283
|
+
const parts = /^bytes=(\d*)-(\d*)$/.exec(header ?? '')
|
|
284
|
+
if (!parts) return
|
|
285
|
+
const [, startRaw, endRaw] = parts
|
|
286
|
+
if ((!startRaw && !endRaw) || (startRaw && endRaw && Number(endRaw) < Number(startRaw)))
|
|
287
|
+
return
|
|
288
|
+
const start = startRaw ? Number(startRaw) : Math.max(0, total - Number(endRaw))
|
|
289
|
+
const end = startRaw && endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
|
|
290
|
+
return start > end || start >= total ? null : { start, end }
|
|
291
|
+
}
|
|
292
|
+
|
|
281
293
|
// a file body that honours a single `bytes=` range. a media element can only
|
|
282
294
|
// seek a resource whose server answers ranges, so any file a <video> or
|
|
283
295
|
// <audio> might load goes through here.
|
|
@@ -289,20 +301,14 @@ export function sendFileWithRanges(
|
|
|
289
301
|
headers: Record<string, string>,
|
|
290
302
|
) {
|
|
291
303
|
const head = (req?.method || 'GET').toUpperCase() === 'HEAD'
|
|
292
|
-
const range =
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
const start
|
|
300
|
-
const end = startRaw && endRaw ? Math.min(Number(endRaw), total - 1) : total - 1
|
|
301
|
-
if (start > end || start >= total) {
|
|
302
|
-
res.writeHead(416, { ...headers, 'Content-Range': `bytes */${total}` })
|
|
303
|
-
res.end()
|
|
304
|
-
return
|
|
305
|
-
}
|
|
304
|
+
const range = runtimeFileRange(req?.headers?.range, total)
|
|
305
|
+
if (range === null) {
|
|
306
|
+
res.writeHead(416, { ...headers, 'Content-Range': `bytes */${total}` })
|
|
307
|
+
res.end()
|
|
308
|
+
return
|
|
309
|
+
}
|
|
310
|
+
if (range) {
|
|
311
|
+
const { start, end } = range
|
|
306
312
|
res.writeHead(206, {
|
|
307
313
|
...headers,
|
|
308
314
|
'Content-Range': `bytes ${start}-${end}/${total}`,
|
package/src/swift-compile.ts
CHANGED
|
@@ -6894,18 +6894,60 @@ export function writeSwiftProject(
|
|
|
6894
6894
|
target: buildProduct(`${SWIFT_HEADER_PRODUCTS_TARGET}${level}`, producers),
|
|
6895
6895
|
producers,
|
|
6896
6896
|
}))
|
|
6897
|
-
const
|
|
6897
|
+
const earlyNativeTargets = [
|
|
6898
6898
|
...new Set([
|
|
6899
6899
|
...(input.staticClangTargets ?? []),
|
|
6900
|
-
...[...native].flatMap(([name, plan]) =>
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
(plan.late ? [plan.late.name] : [])),
|
|
6904
|
-
]),
|
|
6900
|
+
...[...native].flatMap(([name, plan]) =>
|
|
6901
|
+
!plan.mixed && plan.sources.length > 0 ? [name] : [],
|
|
6902
|
+
),
|
|
6905
6903
|
]),
|
|
6906
6904
|
]
|
|
6907
|
-
const
|
|
6908
|
-
|
|
6905
|
+
const nativeBuildTargets = [
|
|
6906
|
+
...new Set([
|
|
6907
|
+
...earlyNativeTargets,
|
|
6908
|
+
...[...native].flatMap(
|
|
6909
|
+
([, plan]) =>
|
|
6910
|
+
plan.groups?.map((group) => group.name) ?? (plan.late ? [plan.late.name] : []),
|
|
6911
|
+
),
|
|
6912
|
+
]),
|
|
6913
|
+
]
|
|
6914
|
+
let nativePrerequisiteTargets: string[] = []
|
|
6915
|
+
if (headerCompiler && earlyNativeTargets.length > 0) {
|
|
6916
|
+
const reachableFromProducers = new Set<string>()
|
|
6917
|
+
const visitReachable = (name: string): void => {
|
|
6918
|
+
if (reachableFromProducers.has(name)) return
|
|
6919
|
+
reachableFromProducers.add(name)
|
|
6920
|
+
for (const dependency of dependencies.get(name) ?? []) visitReachable(dependency)
|
|
6921
|
+
}
|
|
6922
|
+
for (const producer of orderedProducers) visitReachable(producer)
|
|
6923
|
+
const swiftDependent = new Map<string, boolean>()
|
|
6924
|
+
const reachesSwift = (name: string, seen = new Set<string>()): boolean => {
|
|
6925
|
+
const cached = swiftDependent.get(name)
|
|
6926
|
+
if (cached !== undefined) return cached
|
|
6927
|
+
if (seen.has(name)) return false
|
|
6928
|
+
seen.add(name)
|
|
6929
|
+
const result =
|
|
6930
|
+
swiftTargets.has(name) ||
|
|
6931
|
+
(dependencies.get(name) ?? []).some((dependency) =>
|
|
6932
|
+
reachesSwift(dependency, seen),
|
|
6933
|
+
)
|
|
6934
|
+
seen.delete(name)
|
|
6935
|
+
if (seen.size === 0) swiftDependent.set(name, result)
|
|
6936
|
+
return result
|
|
6937
|
+
}
|
|
6938
|
+
nativePrerequisiteTargets = earlyNativeTargets.filter(
|
|
6939
|
+
(name) => reachableFromProducers.has(name) && !reachesSwift(name),
|
|
6940
|
+
)
|
|
6941
|
+
}
|
|
6942
|
+
const nativePrerequisiteSet = new Set(nativePrerequisiteTargets)
|
|
6943
|
+
const remainingNativeBuildTargets = nativeBuildTargets.filter(
|
|
6944
|
+
(name) => !nativePrerequisiteSet.has(name),
|
|
6945
|
+
)
|
|
6946
|
+
const nativePrerequisiteTarget = nativePrerequisiteTargets.length
|
|
6947
|
+
? buildProduct('PeachHeaderNativePrereqs', nativePrerequisiteTargets)
|
|
6948
|
+
: undefined
|
|
6949
|
+
const nativeProductTarget = remainingNativeBuildTargets.length
|
|
6950
|
+
? buildProduct('PeachNativeProducts', remainingNativeBuildTargets)
|
|
6909
6951
|
: undefined
|
|
6910
6952
|
files.set(manifestPath, manifest)
|
|
6911
6953
|
syncSwiftTree(layout.root, files)
|
|
@@ -6918,6 +6960,7 @@ export function writeSwiftProject(
|
|
|
6918
6960
|
if (files.has(clangWrapper) && (statSync(clangWrapper).mode & 0o7777) !== 0o755)
|
|
6919
6961
|
chmodSync(clangWrapper, 0o755)
|
|
6920
6962
|
return {
|
|
6963
|
+
nativePrerequisiteTarget,
|
|
6921
6964
|
headerBuilds,
|
|
6922
6965
|
nativeHeaderDeclarations,
|
|
6923
6966
|
nativeProductTarget,
|
|
@@ -8700,6 +8743,9 @@ async function compileSwiftProjectOnce(
|
|
|
8700
8743
|
// swiftpm's transitive swift module maps are not C declarations:
|
|
8701
8744
|
// importing them would shadow SDK modules such as ObjectiveC.
|
|
8702
8745
|
const stages = [
|
|
8746
|
+
...(preparation.nativePrerequisiteTarget
|
|
8747
|
+
? [{ target: preparation.nativePrerequisiteTarget, producers: [] }]
|
|
8748
|
+
: []),
|
|
8703
8749
|
...preparation.headerBuilds,
|
|
8704
8750
|
...(preparation.nativeProductTarget
|
|
8705
8751
|
? [{ target: preparation.nativeProductTarget, producers: [] }]
|
package/src/swiftContract.ts
CHANGED
|
@@ -216,6 +216,8 @@ export function isSwiftHeaderAliases(value: unknown): value is SwiftHeaderAliase
|
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
export interface SwiftProjectPreparation {
|
|
219
|
+
/** pure-clang prerequisites of header producers commit their objects before Swift builds. */
|
|
220
|
+
nativePrerequisiteTarget?: string
|
|
219
221
|
/** dependency-ordered stages; independent producers share one SwiftPM build. */
|
|
220
222
|
headerBuilds: { target: string; producers: string[] }[]
|
|
221
223
|
/** completed native products commit their object records before the app build. */
|