Skip to content

[chore]: move integration libs into peer deps#2101

Open
seanmcguire12 wants to merge 2 commits intomainfrom
make-pw-peer-dep
Open

[chore]: move integration libs into peer deps#2101
seanmcguire12 wants to merge 2 commits intomainfrom
make-pw-peer-dep

Conversation

@seanmcguire12
Copy link
Copy Markdown
Member

@seanmcguire12 seanmcguire12 commented May 9, 2026

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

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.

Written for commit dc726fc. Summary will update on new commits.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 9, 2026

🦋 Changeset detected

Latest commit: dc726fc

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 4 packages
Name Type
@browserbasehq/stagehand Patch
@browserbasehq/stagehand-evals Patch
@browserbasehq/stagehand-server-v3 Patch
@browserbasehq/stagehand-server-v4 Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.
Architecture diagram
sequenceDiagram
    participant Consumer as Consumer Project
    participant Pkg as @browserbasehq/stagehand
    participant Core as packages/core
    participant Playwright as playwright-core
    participant Puppeteer as puppeteer-core
    participant Patchright as patchright-core
    participant Evals as packages/evals
    participant ServerV3 as packages/server-v3
    participant ServerV4 as packages/server-v4

    Note over Consumer,Core: Dependency Resolution Flow

    Consumer->>Pkg: install @browserbasehq/stagehand
    Pkg->>Core: resolve dependencies
    alt Consumer uses Playwright
        Core->>Playwright: optional peer dep: ^1.55.1
        alt Playwright not installed
            Core->>Core: skip Playwright-specific features
        else Playwright installed
            Core->>Playwright: use for browser automation
        end
    end
    alt Consumer uses Puppeteer
        Core->>Puppeteer: optional peer dep: ^24.43.0
        alt Puppeteer not installed
            Core->>Core: skip Puppeteer-specific features
        else Puppeteer installed
            Core->>Puppeteer: use for browser automation
        end
    end
    alt Consumer uses Patchright
        Core->>Patchright: optional peer dep: ^1.55.2
        alt Patchright not installed
            Core->>Core: skip Patchright-specific features
        else Patchright installed
            Core->>Patchright: use for browser automation
        end
    end

    Note over Core,ServerV4: Internal Dev Dependencies (not shipped)

    Core->>Core: devDependencies for testing
    Core->>Playwright: devDep: ^1.55.1
    Core->>Puppeteer: devDep: ^24.43.0
    Core->>Patchright: devDep: ^1.55.2

    Evals->>Playwright: devDep: >=1.55.1 <1.57.0
    ServerV3->>Playwright: dep: ^1.55.1
    ServerV4->>Playwright: dep: ^1.55.1
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants