Skip to content

Commit d609645

Browse files
committed
fix(ci): pin adapter patchright to core's exact version in E2E build
npm install with ^1.51.1 resolves a different patchright version than the one pnpm locked for core, causing TS2322 on Page type incompatibility. Read core's actual installed version and pin the adapter to it so both share structurally identical Page types during the E2E adapter build. Made-with: Cursor
1 parent 92511a1 commit d609645

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ jobs:
4848
const pkg = JSON.parse(require('fs').readFileSync('package.json'));
4949
pkg.devDependencies['@browserkit/core'] = 'file:../core';
5050
pkg.peerDependencies['@browserkit/core'] = '>=0.1.0';
51-
// Remove patchright from adapter devDeps so npm deduplicates to core's
52-
// instance — prevents duplicate Page types causing TS2322 errors.
53-
delete pkg.devDependencies['patchright'];
51+
// Pin patchright to the exact version installed in core so npm and
52+
// pnpm resolve the same Page type — prevents TS2322 on handler signatures.
53+
const corePr = JSON.parse(require('fs').readFileSync('../core/node_modules/patchright/package.json'));
54+
pkg.devDependencies['patchright'] = corePr.version;
5455
require('fs').writeFileSync('package.json', JSON.stringify(pkg, null, 2));
5556
"
5657
npm install

0 commit comments

Comments
 (0)