Skip to content

Commit b4cb787

Browse files
committed
fix: preserve size report helper on base checkout
1 parent 6e55aba commit b4cb787

3 files changed

Lines changed: 15 additions & 21 deletions

File tree

‎scripts/lib/snapshot-bridge-assets.mjs‎

Lines changed: 0 additions & 13 deletions
This file was deleted.

‎scripts/size-report-install.mjs‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@ import { execFileSync } from 'node:child_process';
22
import fs from 'node:fs';
33
import os from 'node:os';
44
import path from 'node:path';
5-
import {
6-
assertSnapshotBridgeAssets,
7-
SNAPSHOT_BRIDGE_ASSET_PATHS,
8-
} from './lib/snapshot-bridge-assets.mjs';
5+
import { assertSnapshotBridgeAssets, SNAPSHOT_BRIDGE_ASSET_PATHS } from './size-report-package.mjs';
96

107
export function measureCleanInstalledPackage(tarballPath, packageName) {
118
const workDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-device-size-install-'));

‎scripts/size-report-package.mjs‎

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,20 @@ import {
77
formatMaybeBytes,
88
formatSignedBytes,
99
} from './size-report-format.mjs';
10-
import {
11-
assertSnapshotBridgeAssets,
12-
SNAPSHOT_BRIDGE_ASSET_PATHS,
13-
} from './lib/snapshot-bridge-assets.mjs';
10+
11+
export const SNAPSHOT_BRIDGE_ASSET_PATHS = Object.freeze([
12+
'apple/snapshot-bridge/SnapshotBridge.m',
13+
'apple/snapshot-bridge/SnapshotBridgeRuntime.m',
14+
'apple/snapshot-bridge/SnapshotBridgeRuntime.h',
15+
]);
16+
17+
export function assertSnapshotBridgeAssets(presentPaths, context) {
18+
const present = new Set(presentPaths);
19+
const missing = SNAPSHOT_BRIDGE_ASSET_PATHS.filter((assetPath) => !present.has(assetPath));
20+
if (missing.length > 0) {
21+
throw new Error(`${context} is missing: ${missing.join(', ')}`);
22+
}
23+
}
1424

1525
const PACKAGE_COMPONENTS = [
1626
{

0 commit comments

Comments
 (0)