Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@
"bin",
"dist",
"apple/snapshot-bridge",
"!apple/snapshot-bridge/README.md",
"apple/fold-helper",
"android/snapshot-helper/dist",
"!android/snapshot-helper/dist/*.idsig",
Expand Down
13 changes: 9 additions & 4 deletions packages/ad-script/src/internal/__tests__/script.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,8 @@ test('screenshot replay script round-trips a quoted --crop-on selector', () => {
});

test('snapshot replay script parses full refresh flags', () => {
const ignoredLegacyFlag = '-' + 'c';
const parsed = parseReplayScriptDetailed(
['snapshot', '-i', ignoredLegacyFlag, '--raw', '--force-full', '-d', '2', '-s', '"@e1"'].join(
' ',
) + '\n',
['snapshot', '-i', '--raw', '--force-full', '-d', '2', '-s', '"@e1"'].join(' ') + '\n',
).actions;

assert.deepEqual(parsed[0]?.positionals, []);
Expand All @@ -186,6 +183,14 @@ test('snapshot replay script parses full refresh flags', () => {
assert.equal(parsed[0]?.flags.snapshotScope, '@e1');
});

test('snapshot unknown tokens do not consume subsequent flags', () => {
for (const token of ['--backend', '-c', '--unknown']) {
const [action] = parseReplayScriptDetailed(`snapshot ${token} --raw\n`).actions;
assert.deepEqual(action?.positionals, []);
assert.deepEqual(action?.flags, { snapshotRaw: true });
}
});

test('snapshot replay script writes interactive refresh flags', () => {
const actions: SessionAction[] = [
{
Expand Down
8 changes: 0 additions & 8 deletions packages/ad-script/src/internal/script.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,6 @@ function parseReplayScriptLine(line: string): SessionAction | null {
action.flags.snapshotInteractiveOnly = true;
continue;
}
if (token === '-c') {
continue;
}
if (token === '--raw') {
action.flags.snapshotRaw = true;
continue;
Expand All @@ -311,11 +308,6 @@ function parseReplayScriptLine(line: string): SessionAction | null {
index += 1;
continue;
}
if (token === '--backend' && index + 1 < args.length) {
// Backward compatibility: ignore legacy snapshot backend token.
index += 1;
continue;
}
}
return action;
}
Expand Down
1 change: 1 addition & 0 deletions scripts/size-report-package.d.mts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// it is not in the typechecked program). TypeScript resolves this file when a checked module
// imports `./size-report-package.mjs`; keep it in step with the exports there.
export type NpmPackEntry = Readonly<{ path: string; size: number }>;
export function assertSnapshotBridgeAssets(presentPaths: Iterable<string>, context: string): void;
export function assertBundledLicenseNotices(
entries: readonly NpmPackEntry[],
options?: Readonly<{ noticesRoot?: string; context?: string }>,
Expand Down
2 changes: 1 addition & 1 deletion src/daemon-provider-rental-restart.fixtures.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'node:fs';
import path from 'node:path';
import { startDaemonRuntime } from '@agent-device/daemon';
import { captureHostEnvironment } from '@agent-device/host-kit/process';
import { captureHostEnvironment } from '@agent-device/host-kit/environment';
import { createDaemonRuntimeDeps } from './daemon-composition.ts';

export const rentalRestartFixturePath = new URL(import.meta.url);
Expand Down
2 changes: 1 addition & 1 deletion src/daemon-provider-rental-restart.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import net from 'node:net';
import path from 'node:path';
import type { DaemonResponse } from '@agent-device/kernel/contracts';
import { startDaemonRuntime } from '@agent-device/daemon';
import { captureHostEnvironment } from '@agent-device/host-kit/process';
import { captureHostEnvironment } from '@agent-device/host-kit/environment';
import { mkdtempForTestSync, selectPlugin } from '@agent-device/test-kit';
import { createDaemonRuntimeDeps } from './daemon-composition.ts';
import { expect, test, vi } from 'vitest';
Expand Down
11 changes: 9 additions & 2 deletions test/repo-guards/macos-helper-package-contents.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
macosHelperPackFailures,
readMacosHelperTestTargets,
} from '../../scripts/lib/macos-helper-pack.mjs';
import { assertSnapshotBridgeAssets } from '../../scripts/size-report-package.mjs';

// The `@agent-device/macos` package ships `macos-helper` and builds it on the user's machine. Its
// manifest declares the test targets, and `files` ships only each target's PackStub.swift: SwiftPM
Expand Down Expand Up @@ -80,9 +81,15 @@ test('the macOS plugin pack is a buildable helper package with one PackStub.swif
);
});

test('the core pack carries no macOS helper', () => {
test('the core pack retains bridge assets and ships only the root README', () => {
const paths = packedPaths(repoRoot);
assertSnapshotBridgeAssets(paths, 'Core pack snapshot bridge');
assert.deepEqual(
packedPaths(repoRoot).filter((entryPath) => /(?:^|\/)macos-helper(?:\/|$)/.test(entryPath)),
paths.filter((entryPath) => /^readme(?:\.|$)/i.test(path.posix.basename(entryPath))),
['README.md'],
);
assert.deepEqual(
paths.filter((entryPath) => /(?:^|\/)macos-helper(?:\/|$)/.test(entryPath)),
[],
);
});
Expand Down
Loading