refactor(plugins): generate SDK egress policy from the server

This commit is contained in:
Maurice
2026-12-01 12:24:32 +01:00
parent c22c464e68
commit 871135edeb
10 changed files with 236 additions and 394 deletions
+2 -7
View File
@@ -46,14 +46,9 @@ describe.skipIf(!inMonorepo)('parity with the host', () => {
});
it('the vendored egress-policy helpers are byte-identical to the server\'s', () => {
const ours = fs.readFileSync(path.resolve(here, '../src/egress-policy.ts'), 'utf8').replace(/\r\n/g, '\n');
const ours = fs.readFileSync(path.resolve(here, '../src/generated/egress-policy.ts'), 'utf8').replace(/\r\n/g, '\n');
const theirs = fs.readFileSync(serverEgress, 'utf8').replace(/\r\n/g, '\n');
const marker = 'const apply = Reflect.apply;';
const end = '// ---------------------------------------------------------------------------\n// The dev-server guard.';
expect(ours.indexOf(marker)).toBeGreaterThan(-1);
expect(ours.indexOf(end)).toBeGreaterThan(ours.indexOf(marker));
expect(theirs.indexOf(marker)).toBeGreaterThan(-1);
expect(ours.slice(ours.indexOf(marker), ours.indexOf(end)).trim()).toBe(theirs.slice(theirs.indexOf(marker)).trim());
expect(ours).toBe(theirs);
});
});