Skip to content

Commit 7a799d9

Browse files
committed
chore(gates): keep execution dependencies with the native plugin
1 parent cdb2f48 commit 7a799d9

6 files changed

Lines changed: 28 additions & 21 deletions

File tree

‎package.json‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,6 @@
301301
}
302302
},
303303
"devDependencies": {
304-
"@agent-device/ad-replay": "workspace:*",
305304
"@agent-device/ad-script": "workspace:*",
306305
"@agent-device/apple-runner": "workspace:*",
307306
"@agent-device/capture-kit": "workspace:*",
@@ -331,7 +330,6 @@
331330
"@agent-device/react-native": "workspace:*",
332331
"@agent-device/remote": "workspace:*",
333332
"@agent-device/replay-port": "workspace:*",
334-
"@agent-device/replay-test": "workspace:*",
335333
"@agent-device/selectors": "workspace:*",
336334
"@agent-device/session-journal": "workspace:*",
337335
"@agent-device/test-kit": "workspace:*",

‎packages/daemon/package.json‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
"@agent-device/platform-apple": "workspace:*",
1818
"@agent-device/platform-web": "workspace:*",
1919
"@agent-device/replay-port": "workspace:*",
20-
"@agent-device/replay-test": "workspace:*",
2120
"@agent-device/selectors": "workspace:*",
2221
"@agent-device/session-journal": "workspace:*"
2322
},

‎packages/daemon/tsconfig.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@
6262
{
6363
"path": "../replay-port"
6464
},
65-
{
66-
"path": "../replay-test"
67-
},
6865
{
6966
"path": "../selectors"
7067
},

‎pnpm-lock.yaml‎

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎scripts/layering/package-boundaries.test.ts‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import assert from 'node:assert/strict';
66
import { execFileSync } from 'node:child_process';
77
import fs from 'node:fs';
88
import os from 'node:os';
9+
import { createRequire } from 'node:module';
910
import path from 'node:path';
1011
import { test } from 'node:test';
1112
import { listSourceFiles } from './check.ts';
@@ -866,8 +867,9 @@ test('the real tree parses, declares, and passes R11', () => {
866867
'root must declare the ad-script workspace dependency',
867868
);
868869
assert.ok(
869-
rootWorkspaceDependencyNames(repoRoot).has('@agent-device/ad-replay'),
870-
'root must declare the ad-replay workspace dependency',
870+
!rootWorkspaceDependencyNames(repoRoot).has('@agent-device/ad-replay') &&
871+
!rootWorkspaceDependencyNames(repoRoot).has('@agent-device/replay-test'),
872+
'core must not depend on the optional native execution engines',
871873
);
872874
assert.ok(
873875
rootWorkspaceDependencyNames(repoRoot).has('@agent-device/selectors'),
@@ -889,6 +891,7 @@ test('the real tree parses, declares, and passes R11', () => {
889891
});
890892

891893
test('Node resolution enforces the exports map at runtime', () => {
894+
const replayPackageRequire = createRequire(path.join(repoRoot, 'packages/replay/package.json'));
892895
// Real resolver, not the gate's model: a deep import is a resolution error,
893896
// and the legal subpath realpaths OUTSIDE node_modules (pnpm symlink), which
894897
// is what lets --experimental-strip-types load package sources in dev.
@@ -915,11 +918,15 @@ test('Node resolution enforces the exports map at runtime', () => {
915918
'@agent-device/ad-replay/testing',
916919
'@agent-device/ad-replay/internal/target-verification.ts',
917920
'@agent-device/ad-replay/src/index.ts',
921+
'@agent-device/replay-test/src/internal/session-test.ts',
918922
'@agent-device/selectors/internal/parse.ts',
919923
'@agent-device/selectors/src/index.ts',
920924
]) {
921925
assert.throws(
922-
() => import.meta.resolve(deep),
926+
() =>
927+
deep.startsWith('@agent-device/ad-replay/') || deep.startsWith('@agent-device/replay-test/')
928+
? replayPackageRequire.resolve(deep)
929+
: import.meta.resolve(deep),
923930
/ERR_PACKAGE_PATH_NOT_EXPORTED|Package subpath|No "exports" main/,
924931
`${deep} must not resolve`,
925932
);
@@ -952,7 +959,9 @@ test('Node resolution enforces the exports map at runtime', () => {
952959
assert.ok(xmlResolved.endsWith('packages/xml/src/index.ts'), xmlResolved);
953960
const adScriptResolved = import.meta.resolve('@agent-device/ad-script');
954961
assert.ok(adScriptResolved.endsWith('packages/ad-script/src/index.ts'), adScriptResolved);
955-
const adReplayResolved = import.meta.resolve('@agent-device/ad-replay');
962+
const adReplayResolved = replayPackageRequire.resolve('@agent-device/ad-replay');
963+
const replayTestResolved = replayPackageRequire.resolve('@agent-device/replay-test');
964+
assert.ok(replayTestResolved.endsWith('packages/replay-test/src/index.ts'), replayTestResolved);
956965
assert.ok(adReplayResolved.endsWith('packages/ad-replay/src/index.ts'), adReplayResolved);
957966
const selectorsResolved = import.meta.resolve('@agent-device/selectors');
958967
assert.ok(selectorsResolved.endsWith('packages/selectors/src/index.ts'), selectorsResolved);

‎scripts/layering/project-references.test.ts‎

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,15 @@ test('root workspace dependencies cover every core package and exclude optional
128128
.map(([name]) => name)
129129
.sort();
130130
const expected = readWorkspacePackages(repoRoot)
131-
.filter((pkg) => !['@agent-device/maestro', '@agent-device/replay'].includes(pkg.name))
131+
.filter(
132+
(pkg) =>
133+
![
134+
'@agent-device/maestro',
135+
'@agent-device/replay',
136+
'@agent-device/ad-replay',
137+
'@agent-device/replay-test',
138+
].includes(pkg.name),
139+
)
132140
.map((pkg) => pkg.name)
133141
.sort();
134142
assert.deepEqual(
@@ -139,7 +147,12 @@ test('root workspace dependencies cover every core package and exclude optional
139147
'specifiers through these declarations)',
140148
);
141149
assert.ok(
142-
!declared.includes('@agent-device/maestro') && !declared.includes('@agent-device/replay'),
150+
![
151+
'@agent-device/maestro',
152+
'@agent-device/replay',
153+
'@agent-device/ad-replay',
154+
'@agent-device/replay-test',
155+
].some((name) => declared.includes(name)),
143156
'The optional engine must be installed through the plugin store. R11 rejects undeclared imports from core.',
144157
);
145158
});

0 commit comments

Comments
 (0)