peachsim 0.1.1716 → 0.1.1738
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -3
- package/cli/app-bundle-resources.ts +2 -1
- package/cli/app-fonts.ts +4 -4
- package/cli/app-splash.ts +4 -4
- package/cli/app-stubs.ts +17 -0
- package/cli/command-registry.ts +1 -0
- package/cli/commands/control.ts +83 -822
- package/cli/commands/coverage-swift.ts +112 -4
- package/cli/commands/daemon.ts +8 -0
- package/cli/commands/detox.ts +3 -0
- package/cli/commands/doctor.ts +19 -2
- package/cli/commands/inspect/actions.ts +74 -14
- package/cli/commands/inspect/core.ts +5 -1
- package/cli/commands/inspect/settling.ts +5 -2
- package/cli/commands/inspect/wait-ready.ts +6 -0
- package/cli/commands/inspect.ts +48 -45
- package/cli/commands/kotlin.ts +12 -2
- package/cli/commands/package.ts +760 -0
- package/cli/commands/serve.ts +6 -0
- package/cli/commands/shell-url.ts +838 -0
- package/cli/commands/swift.ts +42 -102
- package/cli/commands/test.ts +20 -0
- package/cli/commands/upload.ts +1 -1
- package/cli/device-option.ts +1 -1
- package/cli/main.ts +13 -1
- package/cli/native-input.ts +199 -0
- package/cli/outbound-endpoints.ts +26 -1
- package/cli/packaged-app-launcher.ts +95 -0
- package/cli/scene-video.ts +36 -12
- package/detox/index.ts +196 -24
- package/dist-lib/agent-daemon-client.cjs +1 -1
- package/dist-lib/agent-events.cjs +1 -1
- package/dist-lib/attached-projects.cjs +5 -2
- package/dist-lib/auth/shared-session.cjs +5 -2
- 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 +39889 -31873
- 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 +195 -63
- package/dist-lib/dev-bundle-resolution.cjs +14 -13
- package/dist-lib/expo-swift-bundle.cjs +18507 -11835
- package/dist-lib/expo-swift-metadata.cjs +4 -1
- package/dist-lib/expo-swift-metadata.mjs +3 -1
- package/dist-lib/home-paths.cjs +27 -3
- package/dist-lib/host/bridge-host.cjs +28373 -24090
- package/dist-lib/host/fetch-proxy-handler.cjs +235 -225
- 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 +915 -399
- 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 +335 -47
- package/dist-lib/menu.cjs +13 -1
- package/dist-lib/menu.mjs +13 -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 +918 -411
- package/dist-lib/native-app-identity-project.cjs +703 -283
- package/dist-lib/native-app-identity-project.mjs +500 -87
- package/dist-lib/native-app-identity.cjs +13 -2
- package/dist-lib/native-app-identity.mjs +13 -2
- 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 +5 -2
- package/dist-lib/public-brand.cjs +1 -1
- package/dist-lib/public-origins-lib-esm.json +28 -23
- package/dist-lib/public-origins-lib.json +418 -224
- package/dist-lib/react-native-host-modules.cjs +35 -2
- package/dist-lib/react-native-host-modules.mjs +35 -2
- package/dist-lib/reap-browser.cjs +12 -4
- package/dist-lib/scripts/dev-server-scanner.cjs +15 -8
- package/dist-lib/sdk.cjs +17 -7
- package/dist-lib/sdk.mjs +16 -7
- package/dist-lib/skills.cjs +44825 -29141
- package/dist-lib/swift-compile.cjs +616 -400
- package/dist-lib/swift-compile.mjs +528 -315
- package/dist-lib/swift-package.cjs +1 -1
- package/dist-lib/swift-package.mjs +1 -1
- package/dist-lib/swift-submit.cjs +2 -2
- package/dist-lib/swift-submit.mjs +2 -2
- package/dist-lib/swift-toolchain.cjs +105 -17
- package/dist-lib/swift.cjs +1 -1
- package/dist-lib/vite-swift.cjs +4660 -2252
- package/dist-lib/vite.cjs +248 -234
- package/dist-lib/worklet-executable.cjs +1 -1
- package/dist-lib/worklet-executable.mjs +1 -1
- package/dist-types/packages/peach-compat/src/stubs/native-seams/react-native-cookies.d.ts +17 -8
- package/dist-types/packages/peach-engine/src/engine/canvaskit-renderer.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/font-config.d.ts +7 -4
- package/dist-types/packages/peach-engine/src/engine/image-loader.d.ts +9 -6
- package/dist-types/packages/peach-engine/src/engine/liquid-glass.d.ts +0 -5
- package/dist-types/packages/peach-engine/src/engine/memory-counts.d.ts +11 -1
- package/dist-types/packages/peach-engine/src/engine/node.d.ts +5 -12
- package/dist-types/packages/peach-engine/src/engine/render-damage.d.ts +2 -2
- package/dist-types/packages/peach-engine/src/engine/text-first-baseline.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/engine/text-paragraph.d.ts +1 -0
- package/dist-types/packages/peach-engine/src/engine/types.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/native-preview-bundle.d.ts +2 -0
- package/dist-types/packages/peach-engine/src/render-worker/compositor-protocol.d.ts +9 -0
- package/dist-types/packages/peach-engine/src/render-worker/host-service-protocol.d.ts +3 -0
- package/dist-types/packages/peach-engine/src/render-worker/native-ui-commandContract.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +7 -2
- package/dist-types/packages/peach-engine/src/render-worker/shell-protocol.d.ts +5 -0
- package/dist-types/packages/peach-engine/src/render-worker/tree-sync-port.d.ts +1 -1
- package/dist-types/packages/peach-engine/src/render-worker/worklet-runtime.d.ts +36 -2
- package/dist-types/packages/peach-engine/src/shell-events.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/audioBridgeContract.d.ts +5 -0
- package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
- package/dist-types/packages/peach-globals/src/keyboardBridgeContract.d.ts +11 -0
- package/dist-types/packages/peach-globals/src/shellBridgeContract.d.ts +1 -0
- package/dist-types/packages/peach-globals/src/testBridgeContract.d.ts +9 -2
- package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
- package/kotlin/README.md +3 -0
- package/kotlin/sdk.tar.gz +0 -0
- package/package.json +1 -1
- package/runtime-companion.json +1 -1
- package/scripts/dev-server-scanner.ts +12 -25
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccount.h +55 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountCredential.h +35 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountStore.h +94 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACAccountType.h +53 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/ACError.h +37 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/Accounts.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Headers/AccountsDefines.h +13 -0
- package/sdk/ios/System/Library/Frameworks/Accounts.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASFoundation.h +52 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSession.h +128 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/ASWebAuthenticationSessionCallback.h +35 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Headers/AuthenticationServices.h +3 -0
- package/sdk/ios/System/Library/Frameworks/AuthenticationServices.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFHTTPMessage.h +724 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetwork.h +4 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Headers/CFNetworkDefs.h +27 -0
- package/sdk/ios/System/Library/Frameworks/CFNetwork.framework/Modules/module.modulemap +5 -0
- package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h +1301 -0
- package/sdk/ios/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h +3 -1
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +21 -50
- package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +6 -6
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.apinotes +58 -3
- package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +711 -46
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIInterface.h +23 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +7 -9
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIOrientation.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIStringDrawing.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIView.h +14 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewAnimating.h +12 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIViewController.h +16 -0
- package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIWindow.h +2 -0
- package/sdk/ios/usr/include/ConditionalMacros.h +619 -0
- package/sdk/ios/usr/include/module.modulemap +1 -0
- package/sdk/ios/usr/include/objc/objc-sync.h +59 -0
- package/sdk/ios/usr/include/os/signpost.h +414 -0
- package/sdk/ios/usr/include/os.modulemap +10 -0
- package/sdk/ios/usr/include/sys/cdefs.h +5 -0
- package/sdk/ios/usr/include/sys/ioccom.h +99 -0
- package/sdk/ios/usr/include/sys/syslog.h +236 -0
- package/sdk/ios/usr/include/syslog.h +24 -0
- package/sdk/ios/wasm/include/errno.h +4 -20
- package/sdk/ios/wasm/include/fcntl.h +4 -2
- package/sdk/ios/wasm/include/pthread.h +3 -0
- package/sdk/ios/wasm/include/setjmp.h +57 -0
- package/sdk/ios/wasm/include/stdio.h +24 -0
- package/sdk/ios/wasm/include/stdlib.h +32 -7
- package/sdk/ios/wasm/include/sys/file.h +7 -0
- package/sdk/ios/wasm/include/sys/ioctl.h +6 -0
- package/sdk/ios/wasm/include/sys/resource.h +2 -2
- package/sdk/ios/wasm/include/sys/syscall.h +9 -0
- package/sdk/ios/wasm/include/sys/time.h +10 -0
- package/sdk/ios/wasm/include/unistd.h +12 -3
- package/sdk/native-hashes.json +4 -3
- package/skills/contrast/SKILL.md +2 -1
- package/skills/peach-debug/SKILL.md +0 -1
- package/skills/peach-perf/SKILL.md +0 -1
- package/skills/peach-setup/SKILL.md +0 -1
- package/skills/peach-test/SKILL.md +7 -4
- package/skills/peach-visual/SKILL.md +0 -1
- package/src/admitted-mac-build.ts +3 -0
- package/src/android-app-identity.ts +18 -0
- package/src/android-autolinking.ts +1 -0
- package/src/android-bridge-packages.ts +279 -0
- package/src/android-root-module.ts +9 -9
- package/src/appPackageContract.ts +83 -0
- package/src/bridge-contract.ts +50 -0
- package/src/bundle-channel.mjs +41 -6
- package/src/cli-runtime.ts +9 -5
- package/src/dev-bundle-resolution.ts +7 -27
- package/src/dom-source-reference.ts +15 -0
- package/src/expo-discovery-cache.ts +134 -26
- package/src/expo-kotlin-host.ts +97 -26
- package/src/expo-manifest-body.ts +33 -0
- package/src/expo-native-workspace.ts +158 -38
- package/src/expo-swift-host.ts +350 -75
- package/src/expo-swift-ready.ts +5 -1
- package/src/expoKotlinContract.ts +12 -2
- package/src/expoSwiftContract.ts +10 -0
- package/src/generated/swift-c-predefines.json +1 -1
- package/src/home-paths.ts +41 -2
- package/src/host/app-package-handler.ts +47 -0
- package/src/host/bridge-host.ts +8 -0
- package/src/host/fetch-proxy-handler.ts +10 -0
- package/src/host/staged-host-files.ts +18 -0
- package/src/index.ts +3 -0
- package/src/kotlin-host.ts +225 -48
- package/src/kotlin-instance-source.ts +126 -0
- package/src/kotlinSdkContract.ts +2 -1
- package/src/menu.ts +14 -0
- package/src/native-app-identity-project.ts +7 -2
- package/src/native-app-identity.ts +11 -0
- package/src/native-firebase-config.ts +24 -1
- package/src/native-prebuilt.ts +154 -0
- package/src/nitro-adapter.lock.json +270 -270
- package/src/nitro-adapter.ts +56 -50
- package/src/nitro-bundle.ts +92 -74
- package/src/nitro-compile.ts +45 -14
- package/src/nitro-dependencies.ts +63 -46
- package/src/nitro-source.ts +64 -26
- package/src/nitroAdapterContract.ts +146 -98
- package/src/nitroContract.ts +71 -21
- package/src/react-native-bridge-modules.ts +70 -42
- package/src/react-native-host-modules.ts +34 -1
- package/src/reactNativeConfigurationContract.ts +14 -0
- package/src/reap-browser.ts +15 -3
- package/src/sdk.ts +5 -0
- package/src/settingsContract.ts +38 -1
- package/src/sim-client.ts +4 -1
- package/src/storageSnapshotContract.ts +32 -81
- package/src/swift-compile.ts +268 -89
- package/src/swift-coverage/indexdump.ts +22 -6
- package/src/swift-coverage/indexing.ts +4 -4
- package/src/swift-coverage/provenance.ts +1 -0
- package/src/swift-coverage/sdk.ts +104 -20
- package/src/swift-coverage/types.ts +34 -0
- package/src/swift-coverage/xcode-asset-symbols.ts +922 -0
- package/src/swift-coverage/xcode-assets.ts +89 -131
- package/src/swift-coverage/xcode.ts +10 -2
- package/src/swift-cxx-reachable.ts +2 -1
- package/src/swift-distribution.lock.json +20 -16
- package/src/swift-host.ts +98 -22
- package/src/swift-icu.ts +1 -1
- package/src/swift-link-roots.ts +118 -0
- package/src/swift-objc-compile.ts +144 -22
- package/src/swift-objc-import.ts +6 -0
- package/src/swift-objc-standin.ts +2 -14
- package/src/swift-package-manifest.ts +14 -6
- package/src/swift-packages.ts +75 -11
- package/src/swift-pdf-raster.ts +1 -0
- package/src/swift-root-lock.ts +17 -1
- package/src/swift-source-pods.ts +2 -10
- package/src/swift-standin-emit.ts +597 -57
- package/src/swift-standins.ts +599 -56
- package/src/swift-submit.ts +7 -1
- package/src/swift-toolchain.ts +140 -17
- package/src/turbo-bundle.ts +81 -0
- package/src/turbo-codegen-intake.ts +91 -0
- package/src/turbo-compile.ts +120 -0
- package/src/turbo-runtime.lock.json +69 -0
- package/src/turbo-source.ts +754 -0
- package/src/vite-plugin-one.ts +17 -12
- package/src/vite-plugin.ts +28 -15
- package/src/xcode-project.ts +223 -22
package/src/nitro-source.ts
CHANGED
|
@@ -30,6 +30,22 @@ export type NitroSourceOptions = { packageRoots: string[]; answers?: NitroAnswer
|
|
|
30
30
|
|
|
31
31
|
const run = promisify(execFile)
|
|
32
32
|
|
|
33
|
+
// an autolinker that exits 0 with unparseable stdout names what it printed,
|
|
34
|
+
// so a truncated or empty pipe read is distinguishable from a bad command.
|
|
35
|
+
function autolinkerJson(
|
|
36
|
+
command: string,
|
|
37
|
+
output: { stdout: string; stderr: string },
|
|
38
|
+
): unknown {
|
|
39
|
+
try {
|
|
40
|
+
return JSON.parse(output.stdout)
|
|
41
|
+
} catch (cause) {
|
|
42
|
+
throw new Error(
|
|
43
|
+
`${command} exited 0 with ${output.stdout.length} bytes of stdout that is not JSON (${cause instanceof Error ? cause.message : cause}); stderr: ${output.stderr.trim().slice(0, 500) || '(empty)'}; stdout: ${output.stdout.slice(0, 200) || '(empty)'}`,
|
|
44
|
+
{ cause },
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
33
49
|
type NitroPackage = { name: string; version: string; root: string }
|
|
34
50
|
|
|
35
51
|
/** source fragments for the common Swift host; its caller owns the executable,
|
|
@@ -240,7 +256,7 @@ async function cliAdvertises(
|
|
|
240
256
|
args: string[],
|
|
241
257
|
token: string,
|
|
242
258
|
): Promise<boolean> {
|
|
243
|
-
const { stdout } = await run(
|
|
259
|
+
const { stdout } = await run('node', [cli, ...args], {
|
|
244
260
|
timeout: 30_000,
|
|
245
261
|
maxBuffer: 1 * 1024 * 1024,
|
|
246
262
|
env: { ...process.env, [RNX_FORKED_SCRIPT_ENV]: '1' },
|
|
@@ -271,24 +287,27 @@ async function autolinkingConfig(
|
|
|
271
287
|
// through to their own `react-native config`, the command their Podfile's
|
|
272
288
|
// use_native_modules! runs.
|
|
273
289
|
if (await cliAdvertises(cli, ['--help'], 'react-native-config')) {
|
|
274
|
-
const
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
{
|
|
290
|
+
const args = [
|
|
291
|
+
cli,
|
|
292
|
+
'react-native-config',
|
|
293
|
+
'--json',
|
|
294
|
+
'--platform',
|
|
295
|
+
'ios',
|
|
296
|
+
'--project-root',
|
|
297
|
+
appRoot,
|
|
298
|
+
]
|
|
299
|
+
return autolinkerJson(
|
|
300
|
+
'expo-modules-autolinking react-native-config',
|
|
301
|
+
await run('node', args, {
|
|
286
302
|
timeout: 30_000,
|
|
287
303
|
maxBuffer: 8 * 1024 * 1024,
|
|
288
304
|
env: { ...process.env, [RNX_FORKED_SCRIPT_ENV]: '1' },
|
|
289
|
-
|
|
305
|
+
// expo's react-native.config.js calls findProjectRootSync() on the
|
|
306
|
+
// process cwd and ignores --project-root. the corpus bridge starts
|
|
307
|
+
// outside the app, where that walk finds no package.json.
|
|
308
|
+
cwd: appRoot,
|
|
309
|
+
}),
|
|
290
310
|
)
|
|
291
|
-
return JSON.parse(stdout)
|
|
292
311
|
}
|
|
293
312
|
}
|
|
294
313
|
// the app's own `react-native config`, the command its Podfile runs, so any
|
|
@@ -306,13 +325,15 @@ async function autolinkingConfig(
|
|
|
306
325
|
const configArgs = (await cliAdvertises(cliPath, ['config', '--help'], '--platform'))
|
|
307
326
|
? ['config', '--platform', 'ios']
|
|
308
327
|
: ['config']
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
328
|
+
return autolinkerJson(
|
|
329
|
+
`react-native ${configArgs.join(' ')}`,
|
|
330
|
+
await run('node', [cliPath, ...configArgs], {
|
|
331
|
+
cwd: appRoot,
|
|
332
|
+
timeout: 30_000,
|
|
333
|
+
maxBuffer: 16 * 1024 * 1024,
|
|
334
|
+
env: { ...process.env, [RNX_FORKED_SCRIPT_ENV]: '1', NO_COLOR: '1' },
|
|
335
|
+
}),
|
|
336
|
+
)
|
|
316
337
|
}
|
|
317
338
|
|
|
318
339
|
/** the packages react native's iOS autolinking links into the app that ship a
|
|
@@ -322,26 +343,43 @@ async function autolinkingConfig(
|
|
|
322
343
|
* app's Podfile asks expo-modules-autolinking, any other app the React Native
|
|
323
344
|
* CLI. */
|
|
324
345
|
export async function discoverNitroProviders(appRoot: string): Promise<string[]> {
|
|
346
|
+
return (await iosAutolinkedDependencies(appRoot))
|
|
347
|
+
.map(({ root }) => root)
|
|
348
|
+
.filter(hasNitroIosInitializer)
|
|
349
|
+
.sort()
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/** every dependency React Native iOS autolinking links into the app, with the
|
|
353
|
+
* podspec CocoaPods installs it from, as the app's own autolinker answers. */
|
|
354
|
+
export async function iosAutolinkedDependencies(
|
|
355
|
+
appRoot: string,
|
|
356
|
+
): Promise<{ name: string; root: string; podspecPath: string | null }[]> {
|
|
325
357
|
appRoot = fs.realpathSync(appRoot)
|
|
326
358
|
const appRequire = createRequire(path.join(appRoot, 'package.json'))
|
|
327
359
|
const config = await autolinkingConfig(appRoot, appRequire)
|
|
328
360
|
const dependencies = object(config) ? config.dependencies : undefined
|
|
329
361
|
if (!object(dependencies))
|
|
330
362
|
throw new Error(`${appRoot}: React Native autolinking config has no dependencies`)
|
|
331
|
-
const
|
|
363
|
+
const linked: { name: string; root: string; podspecPath: string | null }[] = []
|
|
332
364
|
for (const [name, dependency] of Object.entries(dependencies)) {
|
|
333
365
|
if (!object(dependency) || !object(dependency.platforms))
|
|
334
366
|
throw new Error(
|
|
335
367
|
`${appRoot}: React Native autolinking dependency ${name} is malformed`,
|
|
336
368
|
)
|
|
337
|
-
|
|
369
|
+
const ios = dependency.platforms.ios
|
|
370
|
+
if (ios == null) continue
|
|
338
371
|
if (typeof dependency.root !== 'string')
|
|
339
372
|
throw new Error(
|
|
340
373
|
`${appRoot}: React Native autolinking dependency ${name} has no root`,
|
|
341
374
|
)
|
|
342
|
-
|
|
375
|
+
linked.push({
|
|
376
|
+
name,
|
|
377
|
+
root: dependency.root,
|
|
378
|
+
podspecPath:
|
|
379
|
+
object(ios) && typeof ios.podspecPath === 'string' ? ios.podspecPath : null,
|
|
380
|
+
})
|
|
343
381
|
}
|
|
344
|
-
return
|
|
382
|
+
return linked.sort((a, b) => a.root.localeCompare(b.root))
|
|
345
383
|
}
|
|
346
384
|
|
|
347
385
|
function dependencyRootsFor(
|
|
@@ -1,16 +1,49 @@
|
|
|
1
|
-
// the prebuilt
|
|
2
|
-
// builder (packages/sootsim-swift/scripts/build-nitro-adapter-archive.ts),
|
|
1
|
+
// the prebuilt private adapter archives' shapes and identity rules, shared by
|
|
2
|
+
// their builder (packages/sootsim-swift/scripts/build-nitro-adapter-archive.ts),
|
|
3
3
|
// publisher (scripts/ops/nitro-adapter-publish.ts) and the installed CLI that
|
|
4
|
-
// downloads and verifies
|
|
5
|
-
//
|
|
4
|
+
// downloads and verifies them. two families exist: the Nitro adapter, built
|
|
5
|
+
// against an app's original React Native JSI and Nitro headers, and the
|
|
6
|
+
// TurboModule runtime, built against its JSI headers alone. nothing here reads
|
|
7
|
+
// adapter sources: an installed CLI carries this file and checks an archive
|
|
8
|
+
// against the lock it was built with.
|
|
6
9
|
import { createHash } from 'node:crypto'
|
|
7
10
|
import { readdirSync, readFileSync } from 'node:fs'
|
|
8
11
|
import path from 'node:path'
|
|
9
12
|
import { isRecord } from './is-record'
|
|
10
13
|
|
|
11
14
|
/** the file at the root of an unpacked adapter, and its install marker. */
|
|
12
|
-
export const
|
|
13
|
-
|
|
15
|
+
export const ADAPTER_MANIFEST = 'manifest.json'
|
|
16
|
+
|
|
17
|
+
export const ADAPTER_FAMILIES = {
|
|
18
|
+
nitro: {
|
|
19
|
+
label: 'Nitro adapter',
|
|
20
|
+
archive: 'libPeachNitroAdapter.a',
|
|
21
|
+
key: 'nitro-adapter',
|
|
22
|
+
headers: ['reactNativeJsi', 'nitroModules'],
|
|
23
|
+
},
|
|
24
|
+
turbo: {
|
|
25
|
+
label: 'TurboModule runtime',
|
|
26
|
+
archive: 'libPeachTurboRuntime.a',
|
|
27
|
+
key: 'turbo-runtime',
|
|
28
|
+
headers: ['reactNativeJsi'],
|
|
29
|
+
},
|
|
30
|
+
} as const
|
|
31
|
+
export type AdapterFamily = keyof typeof ADAPTER_FAMILIES
|
|
32
|
+
|
|
33
|
+
/** what a TurboModule host compiles against: the process's one JSI runtime
|
|
34
|
+
* over the host wire, which the turbo archive defines. */
|
|
35
|
+
export const TURBO_RUNTIME_HEADER = `#pragma once
|
|
36
|
+
#include <jsi/jsi.h>
|
|
37
|
+
#include <functional>
|
|
38
|
+
|
|
39
|
+
namespace peach::jsi_runtime {
|
|
40
|
+
// creates the process's one runtime. drain runs the work a consumer queued once
|
|
41
|
+
// the host's current call returns; dispose runs before the runtime ends.
|
|
42
|
+
facebook::jsi::Runtime& create(std::function<void()> drain, std::function<void()> dispose);
|
|
43
|
+
// asks the host to call drain after its current call returns.
|
|
44
|
+
void scheduleDrain();
|
|
45
|
+
}
|
|
46
|
+
`
|
|
14
47
|
|
|
15
48
|
// header staging the collector exposes: JSI without the dynamic and test
|
|
16
49
|
// pieces, and Nitro's cpp tree without views, copied to bare and nested names.
|
|
@@ -31,43 +64,42 @@ export const HEADER_STAGE = {
|
|
|
31
64
|
}
|
|
32
65
|
|
|
33
66
|
export interface NitroAdapterRoots {
|
|
34
|
-
nitroModules
|
|
67
|
+
nitroModules?: string
|
|
35
68
|
reactNative: string
|
|
36
69
|
}
|
|
37
70
|
|
|
71
|
+
/** each header closure's digest, keyed by the family's header names. */
|
|
72
|
+
export type AdapterHeaders = Record<string, string>
|
|
73
|
+
|
|
38
74
|
/** what the installed CLI needs to trust an archive; no private provenance. */
|
|
39
|
-
export interface
|
|
75
|
+
export interface AdapterManifest {
|
|
40
76
|
schema: 1
|
|
41
77
|
/** the guest platform the producer built for; every consumer matches it against the lock or its own recomputed identity. */
|
|
42
78
|
platform: string
|
|
43
79
|
target: string
|
|
44
80
|
recipe: string
|
|
45
81
|
adapter: { sha256: string }
|
|
46
|
-
headers:
|
|
82
|
+
headers: AdapterHeaders
|
|
47
83
|
compiler: string
|
|
48
84
|
sdk: { id: string; checksum: string }
|
|
49
85
|
framework: { distribution: string; wireAbi: string }
|
|
50
86
|
archive: { path: string; size: number; sha256: string }
|
|
51
87
|
}
|
|
52
88
|
|
|
53
|
-
/** every published tarball one CLI build installs, committed
|
|
54
|
-
* swift-distribution.lock.json: one build identity, and one archive per
|
|
55
|
-
*
|
|
56
|
-
export interface
|
|
57
|
-
|
|
89
|
+
/** every published tarball of one family one CLI build installs, committed
|
|
90
|
+
* beside swift-distribution.lock.json: one build identity, and one archive per
|
|
91
|
+
* set of original headers it was compiled against. */
|
|
92
|
+
export interface AdapterLock extends Omit<
|
|
93
|
+
AdapterManifest,
|
|
58
94
|
'schema' | 'archive' | 'headers'
|
|
59
95
|
> {
|
|
60
96
|
schema: 2
|
|
61
97
|
/** each downloaded .tar.gz, which installVerifiedTarball checks. */
|
|
62
|
-
archives: {
|
|
63
|
-
headers: NitroAdapterManifest['headers']
|
|
64
|
-
sha256: string
|
|
65
|
-
size: number
|
|
66
|
-
}[]
|
|
98
|
+
archives: { headers: AdapterHeaders; sha256: string; size: number }[]
|
|
67
99
|
}
|
|
68
100
|
|
|
69
101
|
/** the one archive an app's headers select: its manifest identity and tarball. */
|
|
70
|
-
export interface
|
|
102
|
+
export interface AdapterPin extends Omit<AdapterManifest, 'archive'> {
|
|
71
103
|
archive: { sha256: string; size: number }
|
|
72
104
|
}
|
|
73
105
|
|
|
@@ -94,7 +126,8 @@ function headerFiles(base: string, directory: string, skip: string[], keep: RegE
|
|
|
94
126
|
return files.sort()
|
|
95
127
|
}
|
|
96
128
|
|
|
97
|
-
/** the original header closures the collector exposes, with per-file hashes
|
|
129
|
+
/** the original header closures the collector exposes, with per-file hashes;
|
|
130
|
+
* the Nitro closure is empty without a Nitro root. */
|
|
98
131
|
export function headerClosure(roots: NitroAdapterRoots) {
|
|
99
132
|
const { jsi: j, nitro: n } = HEADER_STAGE
|
|
100
133
|
const jsiFiles = headerFiles(
|
|
@@ -103,115 +136,126 @@ export function headerClosure(roots: NitroAdapterRoots) {
|
|
|
103
136
|
j.skip,
|
|
104
137
|
new RegExp(j.keep),
|
|
105
138
|
).filter((file) => !file.endsWith(`/${j.exclude}`))
|
|
106
|
-
const nitroFiles =
|
|
139
|
+
const nitroFiles = roots.nitroModules
|
|
140
|
+
? headerFiles(roots.nitroModules, n.from, n.skip, new RegExp(n.keep))
|
|
141
|
+
: []
|
|
107
142
|
const hashes = (base: string, files: string[]) =>
|
|
108
143
|
Object.fromEntries(
|
|
109
144
|
files.map((file) => [file, sha256Hex(readFileSync(path.join(base, file)))]),
|
|
110
145
|
)
|
|
111
146
|
return {
|
|
112
147
|
jsi: hashes(roots.reactNative, jsiFiles),
|
|
113
|
-
nitro: hashes(roots.nitroModules, nitroFiles),
|
|
148
|
+
nitro: roots.nitroModules ? hashes(roots.nitroModules, nitroFiles) : {},
|
|
114
149
|
nitroFiles,
|
|
115
150
|
jsiFiles,
|
|
116
151
|
}
|
|
117
152
|
}
|
|
118
153
|
|
|
119
|
-
/** the digests an app's original
|
|
120
|
-
export function headerDigests(
|
|
154
|
+
/** the digests an app's original headers must match, in the family's order. */
|
|
155
|
+
export function headerDigests(
|
|
156
|
+
family: AdapterFamily,
|
|
157
|
+
roots: NitroAdapterRoots,
|
|
158
|
+
): AdapterHeaders {
|
|
121
159
|
const closure = headerClosure(roots)
|
|
122
|
-
|
|
160
|
+
const all: AdapterHeaders = {
|
|
161
|
+
reactNativeJsi: digest(closure.jsi),
|
|
162
|
+
nitroModules: digest(closure.nitro),
|
|
163
|
+
}
|
|
164
|
+
return Object.fromEntries(
|
|
165
|
+
ADAPTER_FAMILIES[family].headers.map((key) => [key, all[key]!]),
|
|
166
|
+
)
|
|
123
167
|
}
|
|
124
168
|
|
|
125
169
|
const hex64 = (value: unknown): value is string =>
|
|
126
170
|
typeof value === 'string' && /^[a-f0-9]{64}$/.test(value)
|
|
127
171
|
|
|
128
|
-
function text(value: unknown, what: string): string {
|
|
172
|
+
function text(family: AdapterFamily, value: unknown, what: string): string {
|
|
129
173
|
if (typeof value !== 'string' || !value)
|
|
130
|
-
throw new Error(`invalid
|
|
174
|
+
throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`)
|
|
131
175
|
return value
|
|
132
176
|
}
|
|
133
177
|
|
|
134
|
-
function digestField(value: unknown, what: string): string {
|
|
135
|
-
if (!hex64(value)) throw new Error(`invalid
|
|
178
|
+
function digestField(family: AdapterFamily, value: unknown, what: string): string {
|
|
179
|
+
if (!hex64(value)) throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} ${what}`)
|
|
136
180
|
return value
|
|
137
181
|
}
|
|
138
182
|
|
|
139
|
-
function
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
183
|
+
function headerSet(family: AdapterFamily, value: unknown): AdapterHeaders {
|
|
184
|
+
const keys = ADAPTER_FAMILIES[family].headers
|
|
185
|
+
if (!isRecord(value) || Object.keys(value).length !== keys.length)
|
|
186
|
+
throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} headers`)
|
|
187
|
+
return Object.fromEntries(
|
|
188
|
+
keys.map((key) => [key, digestField(family, value[key], `${key} header digest`)]),
|
|
189
|
+
)
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
function identity(family: AdapterFamily, value: unknown) {
|
|
193
|
+
const invalid = () => new Error(`invalid ${ADAPTER_FAMILIES[family].label} manifest`)
|
|
194
|
+
if (!isRecord(value) || value.schema !== 1) throw invalid()
|
|
195
|
+
const { adapter, sdk, framework } = value
|
|
196
|
+
if (!isRecord(adapter) || !isRecord(sdk) || !isRecord(framework)) throw invalid()
|
|
145
197
|
return {
|
|
146
198
|
schema: 1 as const,
|
|
147
|
-
platform: text(value.platform, 'platform'),
|
|
148
|
-
target: text(value.target, 'target'),
|
|
149
|
-
recipe: digestField(value.recipe, 'recipe'),
|
|
150
|
-
adapter: { sha256: digestField(adapter.sha256, 'adapter digest') },
|
|
151
|
-
headers:
|
|
152
|
-
|
|
153
|
-
nitroModules: digestField(headers.nitroModules, 'Nitro header digest'),
|
|
154
|
-
},
|
|
155
|
-
compiler: text(value.compiler, 'compiler'),
|
|
199
|
+
platform: text(family, value.platform, 'platform'),
|
|
200
|
+
target: text(family, value.target, 'target'),
|
|
201
|
+
recipe: digestField(family, value.recipe, 'recipe'),
|
|
202
|
+
adapter: { sha256: digestField(family, adapter.sha256, 'adapter digest') },
|
|
203
|
+
headers: headerSet(family, value.headers),
|
|
204
|
+
compiler: text(family, value.compiler, 'compiler'),
|
|
156
205
|
sdk: {
|
|
157
|
-
id: text(sdk.id, 'sdk id'),
|
|
158
|
-
checksum: digestField(sdk.checksum, 'sdk checksum'),
|
|
206
|
+
id: text(family, sdk.id, 'sdk id'),
|
|
207
|
+
checksum: digestField(family, sdk.checksum, 'sdk checksum'),
|
|
159
208
|
},
|
|
160
209
|
framework: {
|
|
161
|
-
distribution: text(framework.distribution, 'distribution'),
|
|
162
|
-
wireAbi: digestField(framework.wireAbi, 'wire abi'),
|
|
210
|
+
distribution: text(family, framework.distribution, 'distribution'),
|
|
211
|
+
wireAbi: digestField(family, framework.wireAbi, 'wire abi'),
|
|
163
212
|
},
|
|
164
213
|
}
|
|
165
214
|
}
|
|
166
215
|
|
|
167
216
|
/** keeps only the public fields, so a producer's private provenance never
|
|
168
217
|
* reaches a packed manifest. */
|
|
169
|
-
export function
|
|
218
|
+
export function parseAdapterManifest(
|
|
219
|
+
family: AdapterFamily,
|
|
220
|
+
value: unknown,
|
|
221
|
+
): AdapterManifest {
|
|
170
222
|
const archive = isRecord(value) ? value.archive : undefined
|
|
171
223
|
if (
|
|
172
224
|
!isRecord(archive) ||
|
|
173
|
-
|
|
174
|
-
archive.path !== NITRO_ADAPTER_ARCHIVE ||
|
|
225
|
+
archive.path !== ADAPTER_FAMILIES[family].archive ||
|
|
175
226
|
typeof archive.size !== 'number'
|
|
176
227
|
)
|
|
177
|
-
throw new Error(
|
|
228
|
+
throw new Error(`invalid ${ADAPTER_FAMILIES[family].label} archive record`)
|
|
178
229
|
return {
|
|
179
|
-
...identity(value),
|
|
230
|
+
...identity(family, value),
|
|
180
231
|
archive: {
|
|
181
|
-
path: archive
|
|
232
|
+
path: ADAPTER_FAMILIES[family].archive,
|
|
182
233
|
size: archive.size,
|
|
183
|
-
sha256: digestField(archive.sha256, 'archive digest'),
|
|
234
|
+
sha256: digestField(family, archive.sha256, 'archive digest'),
|
|
184
235
|
},
|
|
185
236
|
}
|
|
186
237
|
}
|
|
187
238
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
return {
|
|
191
|
-
reactNativeJsi: digestField(value.reactNativeJsi, 'JSI header digest'),
|
|
192
|
-
nitroModules: digestField(value.nitroModules, 'Nitro header digest'),
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const sameHeaders = (
|
|
197
|
-
a: NitroAdapterManifest['headers'],
|
|
198
|
-
b: NitroAdapterManifest['headers'],
|
|
199
|
-
) => a.reactNativeJsi === b.reactNativeJsi && a.nitroModules === b.nitroModules
|
|
239
|
+
const sameHeaders = (a: AdapterHeaders, b: AdapterHeaders) =>
|
|
240
|
+
JSON.stringify(a) === JSON.stringify(b)
|
|
200
241
|
|
|
201
|
-
export function
|
|
242
|
+
export function parseAdapterLock(family: AdapterFamily, value: unknown): AdapterLock {
|
|
243
|
+
const label = ADAPTER_FAMILIES[family].label
|
|
202
244
|
if (!isRecord(value) || value.schema !== 2 || !Array.isArray(value.archives))
|
|
203
|
-
throw new Error(
|
|
204
|
-
const { headers: _headers, ...shared } = identity({
|
|
245
|
+
throw new Error(`invalid ${label} lock`)
|
|
246
|
+
const { headers: _headers, ...shared } = identity(family, {
|
|
205
247
|
...value,
|
|
206
248
|
schema: 1,
|
|
207
|
-
headers:
|
|
249
|
+
headers: Object.fromEntries(
|
|
250
|
+
ADAPTER_FAMILIES[family].headers.map((key) => [key, '0'.repeat(64)]),
|
|
251
|
+
),
|
|
208
252
|
})
|
|
209
253
|
const archives = value.archives.map((entry: unknown) => {
|
|
210
254
|
if (!isRecord(entry) || typeof entry.size !== 'number')
|
|
211
|
-
throw new Error(
|
|
255
|
+
throw new Error(`invalid ${label} lock archive`)
|
|
212
256
|
return {
|
|
213
|
-
headers:
|
|
214
|
-
sha256: digestField(entry.sha256, 'lock archive digest'),
|
|
257
|
+
headers: headerSet(family, entry.headers),
|
|
258
|
+
sha256: digestField(family, entry.sha256, 'lock archive digest'),
|
|
215
259
|
size: entry.size,
|
|
216
260
|
}
|
|
217
261
|
})
|
|
@@ -219,16 +263,16 @@ export function parseNitroAdapterLock(value: unknown): NitroAdapterLock {
|
|
|
219
263
|
if (
|
|
220
264
|
archives.findIndex((other) => sameHeaders(other.headers, entry.headers)) !== index
|
|
221
265
|
)
|
|
222
|
-
throw new Error(
|
|
266
|
+
throw new Error(`${label} lock repeats a header set`)
|
|
223
267
|
})
|
|
224
268
|
return { ...shared, schema: 2, archives }
|
|
225
269
|
}
|
|
226
270
|
|
|
227
271
|
/** the archive built against these original headers, or null when none was published. */
|
|
228
|
-
export function
|
|
229
|
-
lock:
|
|
230
|
-
headers:
|
|
231
|
-
):
|
|
272
|
+
export function adapterPin(
|
|
273
|
+
lock: AdapterLock,
|
|
274
|
+
headers: AdapterHeaders,
|
|
275
|
+
): AdapterPin | null {
|
|
232
276
|
const entry = lock.archives.find((archive) => sameHeaders(archive.headers, headers))
|
|
233
277
|
if (!entry) return null
|
|
234
278
|
// manifest field order: the installed manifest is compared as JSON
|
|
@@ -248,11 +292,11 @@ export function nitroAdapterPin(
|
|
|
248
292
|
|
|
249
293
|
/** the lock with one published manifest's tarball added, replacing the archive
|
|
250
294
|
* for the same headers. every archive in a lock shares one build identity. */
|
|
251
|
-
export function
|
|
252
|
-
lock:
|
|
253
|
-
manifest:
|
|
295
|
+
export function withAdapterArchive(
|
|
296
|
+
lock: AdapterLock | null,
|
|
297
|
+
manifest: AdapterManifest,
|
|
254
298
|
tarball: { sha256: string; size: number },
|
|
255
|
-
):
|
|
299
|
+
): AdapterLock {
|
|
256
300
|
const { archive: _library, headers, schema: _schema, ...shared } = manifest
|
|
257
301
|
if (lock) {
|
|
258
302
|
const { archives: _archives, schema: _lockSchema, ...current } = lock
|
|
@@ -261,37 +305,41 @@ export function withNitroAdapterArchive(
|
|
|
261
305
|
'the archive was built with another adapter, recipe, compiler, SDK or distribution than the lock; rebuild every archive',
|
|
262
306
|
)
|
|
263
307
|
}
|
|
308
|
+
const order = (entry: { headers: AdapterHeaders }) =>
|
|
309
|
+
Object.values(entry.headers).join('')
|
|
264
310
|
const archives = [
|
|
265
311
|
...(lock?.archives ?? []).filter((entry) => !sameHeaders(entry.headers, headers)),
|
|
266
312
|
{ headers, ...tarball },
|
|
267
|
-
].sort((a, b) =>
|
|
268
|
-
`${a.headers.reactNativeJsi}${a.headers.nitroModules}`.localeCompare(
|
|
269
|
-
`${b.headers.reactNativeJsi}${b.headers.nitroModules}`,
|
|
270
|
-
),
|
|
271
|
-
)
|
|
313
|
+
].sort((a, b) => order(a).localeCompare(order(b)))
|
|
272
314
|
return { schema: 2, ...shared, archives }
|
|
273
315
|
}
|
|
274
316
|
|
|
275
317
|
/** the tarball's path under PEACH_SWIFT_ENDPOINT: content addressed, so immutable. */
|
|
276
|
-
export function
|
|
277
|
-
|
|
318
|
+
export function adapterArchiveKey(
|
|
319
|
+
family: AdapterFamily,
|
|
320
|
+
pin: { archive: { sha256: string } },
|
|
321
|
+
): string {
|
|
322
|
+
return `${ADAPTER_FAMILIES[family].key}/${pin.archive.sha256}.tar.gz`
|
|
278
323
|
}
|
|
279
324
|
|
|
280
325
|
/** throws unless an unpacked adapter is the one the pin names and its library
|
|
281
326
|
* bytes are the ones its manifest records. needs no adapter source. */
|
|
282
|
-
export function
|
|
327
|
+
export function verifyInstalledAdapter(
|
|
328
|
+
family: AdapterFamily,
|
|
283
329
|
directory: string,
|
|
284
|
-
pin:
|
|
285
|
-
):
|
|
286
|
-
const
|
|
287
|
-
|
|
330
|
+
pin: AdapterPin,
|
|
331
|
+
): AdapterManifest {
|
|
332
|
+
const label = ADAPTER_FAMILIES[family].label
|
|
333
|
+
const manifest = parseAdapterManifest(
|
|
334
|
+
family,
|
|
335
|
+
JSON.parse(readFileSync(path.join(directory, ADAPTER_MANIFEST), 'utf8')),
|
|
288
336
|
)
|
|
289
337
|
const { archive, ...recorded } = manifest
|
|
290
338
|
const { archive: _tarball, ...pinned } = pin
|
|
291
339
|
if (JSON.stringify(recorded) !== JSON.stringify(pinned))
|
|
292
|
-
throw new Error(
|
|
340
|
+
throw new Error(`${label} manifest does not match the lock this build carries`)
|
|
293
341
|
const bytes = readFileSync(path.join(directory, archive.path))
|
|
294
342
|
if (bytes.length !== archive.size || sha256Hex(bytes) !== archive.sha256)
|
|
295
|
-
throw new Error(
|
|
343
|
+
throw new Error(`${label} library does not match its manifest`)
|
|
296
344
|
return manifest
|
|
297
345
|
}
|