Skip to content

Commit 26e6c96

Browse files
[chore]: move integration libs into peer deps (#2101)
# why - pnpm installs optional deps by default, which meant installing `stagehand` would also pull in `playwright-core`, `patchright-core`, & `puppeteer-core` - these packages should be supplied by the consumer **_only if_** they want to use `stagehand` with an existing browser automation framework. they are otherwise not required - moving them into peer dependencies prevents unnecessary installs, & reflects a more accurate dependency graph # what changed - moved `playwright-core`, `patchright-core`, & `puppeteer-core` in `packages/core` from optional deps to optional peer deps <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Moved `playwright-core`, `patchright-core`, and `puppeteer-core` to optional peer dependencies in `@browserbasehq/stagehand` to stop automatic installs and let consumers opt in only if needed. Also aligned `playwright` version ranges across packages. - **Dependencies** - In `packages/core`: moved `playwright-core`, `patchright-core`, `puppeteer-core` from optional deps to optional peer deps (all marked optional). - Updated internal dev deps to keep tests working: `playwright`, `playwright-core`, `puppeteer-core`, `patchright-core`. - Aligned `playwright` ranges: `packages/evals` uses `>=1.55.1 <1.57.0`; `packages/server-v3` and `packages/server-v4` use `^1.55.1`. - **Migration** - If you use Stagehand with Playwright, add `playwright-core@^1.55.1`. - If you use Puppeteer, add `puppeteer-core@^24.43.0`. - If you use Patchright, add `patchright-core@^1.55.2`. <sup>Written for commit dc726fc. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. -->
1 parent 8e5a460 commit 26e6c96

6 files changed

Lines changed: 52 additions & 42 deletions

File tree

.changeset/public-tables-act.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@browserbasehq/stagehand": patch
3+
---
4+
5+
move playwright-core, puppeteer-core, patchright-core from optional dependencies to peer dependencies

packages/core/package.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,22 @@
6060
"license": "MIT",
6161
"peerDependencies": {
6262
"deepmerge": "^4.3.1",
63+
"patchright-core": "^1.55.2",
64+
"playwright-core": "^1.55.1",
65+
"puppeteer-core": "^24.43.0",
6366
"zod": "^3.25.76 || ^4.2.0"
6467
},
68+
"peerDependenciesMeta": {
69+
"patchright-core": {
70+
"optional": true
71+
},
72+
"playwright-core": {
73+
"optional": true
74+
},
75+
"puppeteer-core": {
76+
"optional": true
77+
}
78+
},
6579
"dependencies": {
6680
"@ai-sdk/provider": "^2.0.0",
6781
"@anthropic-ai/sdk": "0.39.0",
@@ -96,14 +110,10 @@
96110
"@langchain/core": "^0.3.80",
97111
"bufferutil": "^4.0.9",
98112
"chrome-launcher": "^1.2.0",
99-
"ollama-ai-provider-v2": "^1.5.0",
100-
"patchright-core": "^1.55.2",
101-
"playwright": "^1.59.1",
102-
"playwright-core": "^1.59.1",
103-
"puppeteer-core": "^24.43.0"
113+
"ollama-ai-provider-v2": "^1.5.0"
104114
},
105115
"devDependencies": {
106-
"@playwright/test": "^1.59.1",
116+
"@playwright/test": "^1.55.1",
107117
"@types/adm-zip": "^0.5.7",
108118
"@types/jsdom": "^27.0.0",
109119
"@types/node": "^20.11.30",
@@ -113,9 +123,11 @@
113123
"chalk": "^5.4.1",
114124
"eslint": "10.0.2",
115125
"jsdom": "^29.1.1",
116-
"playwright": "^1.52.0",
117-
"playwright-core": "^1.54.1",
126+
"patchright-core": "^1.55.2",
127+
"playwright": "^1.55.1",
128+
"playwright-core": "^1.55.1",
118129
"prettier": "^3.2.5",
130+
"puppeteer-core": "^24.43.0",
119131
"tsx": "*",
120132
"vitest": "^4.0.8",
121133
"zod": "^3.25.76 || ^4.2.0"

packages/evals/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"ai": "^5.0.133",
3030
"dotenv": "^17.3.1",
3131
"openai": "^4.104.0",
32-
"playwright": "^1.55.1",
32+
"playwright": ">=1.55.1 <1.57.0",
3333
"sharp": "^0.34.5",
3434
"tsx": "*",
3535
"zod": "^4.2.1"

packages/server-v3/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"http-status-codes": "^2.3.0",
3636
"pino": "^9.7.0",
3737
"pino-pretty": "^11.3.0",
38-
"playwright": "1.55.1",
38+
"playwright": "^1.55.1",
3939
"uuid": "^11.0.5",
4040
"zod": "^4.2.1"
4141
},

packages/server-v4/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
"http-status-codes": "^2.3.0",
4242
"pino": "^9.7.0",
4343
"pino-pretty": "^11.3.0",
44-
"playwright": "1.55.1",
44+
"playwright": "^1.55.1",
4545
"postgres": "^3.4.8",
4646
"uuid": "^11.0.5",
4747
"zod": "^4.2.1"

pnpm-lock.yaml

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

0 commit comments

Comments
 (0)