Skip to content

feat: monorepo conversion — add @wdio/browserstack-service alongside the gRPC core#37

Open
AakashHotchandani wants to merge 1 commit into
mainfrom
migration/monorepo-add-wdio-browserstack-service
Open

feat: monorepo conversion — add @wdio/browserstack-service alongside the gRPC core#37
AakashHotchandani wants to merge 1 commit into
mainfrom
migration/monorepo-add-wdio-browserstack-service

Conversation

@AakashHotchandani

Copy link
Copy Markdown
Collaborator

What

Converts this repo into an npm workspace and adds the WebdriverIO service so BrowserStack can publish @wdio/browserstack-service from here on its own cadence (WebdriverIO TSC has approved this and will set up OIDC trusted publishing). Nothing changes for end users — same package name, same services: ['browserstack'].

Layout

Package npm Notes
packages/core @browserstack/wdio-browserstack-service the existing gRPC/protobuf core, moved here via git mv (history preserved); build & behavior unchanged
packages/browserstack-service @wdio/browserstack-service the WebdriverIO service (extracted from the monorepo)

The core (owned by @browserstack/sdk-dev) is behavior-unchanged

  • Moved to packages/core/; buf generate + tsc build and the files allowlist are unchanged.
  • Changesets ignores @browserstack/wdio-browserstack-service (.changeset/config.json) — this pipeline never versions or publishes the core. Your manual publish flow continues exactly as before.

Release pipeline (service only)

  • Changesets + npm OIDC trusted publishing (.github/workflows/release.yml) — no long-lived token, provenance-signed.
  • mainlatest (v9); a future v8 branch → v8 dist-tag (via per-branch publishConfig.tag; the workflow hardcodes no tag).
  • An included changeset bumps the first release to 9.29.0 (npm latest is currently 9.28.0).

Test-infra fix

The @wdio/reporter mock imported the real module from inside its own mock (a top-level vi.importActual + a static import), which deadlocked vitest and hung reporter.test.ts. Replaced with runtime stubs (those classes are only used as TS types). Full suite now: 39 files / 980 tests pass and the run exits cleanly.

Verified locally

  • npm ci + npm run build (core via buf+tsc, service via esbuild+tsc) ✅
  • npm test39 files / 980 tests pass, clean exit
  • npm pack → clean 80-file / ~590 kB tarball (only build/ + README + LICENSE + ambient d.ts; no docs/logs/maps) ✅
  • Real BrowserStack session with the packed tarball: services: ['browserstack'] resolved, session created, spec green, webdriverio deduped to a single copy ✅

To go live (after this merges)

  1. An @wdio npm org admin sets a Trusted Publisher on @wdio/browserstack-service: Org browserstack, Repo wdio-browserstack-service, Workflow release.yml, Environment empty.
  2. Merge the Changesets "Version Packages" PR → first publish (9.29.0).
  3. Then the WebdriverIO monorepo PRs remove the in-repo service + update docs links.

Note: docs/ includes the migration plan and architecture notes for reviewers — trim before merge if you'd rather not keep strategy docs in the public repo.

🤖 Generated with Claude Code

…ide the gRPC core

Adds the WebdriverIO service (@wdio/browserstack-service) as packages/browserstack-service
and moves the existing gRPC/protobuf core (@browserstack/wdio-browserstack-service) into
packages/core (git history preserved), so both ship from this repo.

- npm workspace: root build builds core then service; tests scoped to the service.
- service: esbuild bundle (deps external) + tsc declarations; strict files allowlist
  (build + README + LICENSE + ambient d.ts); peerDeps for webdriverio/@wdio/* so the
  consumer keeps a single shared copy.
- release: Changesets + npm OIDC trusted publishing via .github/workflows/release.yml
  (main -> latest, v8 -> v8 dist-tag); the gRPC core is ignored by Changesets and stays
  on the SDK team's manual publish flow.
- fix(tests): the @wdio/reporter mock no longer imports the real module from within its
  own mock (a top-level vi.importActual + static import deadlocked vitest and hung
  reporter.test.ts); stub the stats classes instead. Full suite: 39 files / 980 tests
  pass and the run exits cleanly.
- repo metadata -> browserstack/wdio-browserstack-service; an added changeset bumps the
  first release to 9.29.0 (current npm latest is 9.28.0).

Verified locally: npm ci + build + test green; clean 80-file / ~590kB tarball; a real
BrowserStack session passed with webdriverio deduped to one copy.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
): Promise<string> {
return new Promise((resolve) => {
const process = exec(
cmdCommand,
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