Skip to content

Make @wdio/browserstack-service v8 line self-contained for extraction#10

Open
AakashHotchandani wants to merge 4 commits into
v8from
extract/browserstack-service-standalone-v8
Open

Make @wdio/browserstack-service v8 line self-contained for extraction#10
AakashHotchandani wants to merge 4 commits into
v8from
extract/browserstack-service-standalone-v8

Conversation

@AakashHotchandani

Copy link
Copy Markdown
Owner

What

Mirror of the v9 extraction (PR #9), applied to the v8 maintenance line so it can build, test, and release independently of the WebdriverIO monorepo while keeping the @wdio/browserstack-service name. Confined to packages/wdio-browserstack-service.

Why

@wdio/browserstack-service ships parallel lines on npm: latest = v9 (main), v8 = v8 (this v8 branch), v7 = legacy. To release v8 fixes on BrowserStack's timeline (for WebdriverIO v8 / Node 16 users) without waiting on the TSC train, the v8 line needs the same self-containment as v9.

The v8-critical bit: dist-tag safety

package.json sets publishConfig.tag: "v8" and Changesets baseBranch: v8, so releases publish to the v8 dist-tag and never move latest (which points at v9). npm OIDC trusted-publishing is per-package, so the same delegation used for v9 covers v8 automatically.

Key changes (v8 values)

  • peerDependencies: webdriverio/@wdio/types/@wdio/reporter/@wdio/logger^8.0.0 (+ devDeps); @wdio/cli peer stays ^5–^8.
  • Self-contained tsconfig.json + tsconfig.prod.json.
  • scripts/build.mjs — standalone esbuild, single index entry (v8 has no ./cleanup export), target: node16.
  • src/request-handler.tsunref the poller (same lifecycle fix as v9).
  • .changeset/ (baseBranch v8) + .github/workflows/ (trigger on v8, OIDC, publishes v8 tag).
  • Keeps engines ^16.13 || >=18 and the single . export.
  • EXTRACTION-V8.md — dist-tag strategy + v8↔v9 differences + follow-ups.

v8 ↔ v9 differences handled

Node 16 support; single entrypoint; got/formdata-node/glob ^10/tar ^6/uuid ^10 (vs v9 undici/glob ^11/tar ^7); ^8 peers; publishes to v8 tag.

Follow-ups (same as v9)

Test wiring (copy the v8 root __mocks__ mirroring v9) — build/release plumbing doesn't depend on it. Sync the fork's v8 (3e62544) with upstream v8 (cdbd52e / 8.48.0) before a real cutover.

Review surface on the fork (base = v8), not for upstream. Companion to PR #9 (v9). See EXTRACTION-V8.md.

AakashHotchandani and others added 4 commits June 9, 2026 13:39
Mirror of the v9 extraction, applied to the v8 maintenance line so it can build,
test, and release independently of the WebdriverIO monorepo while keeping the
@wdio name. Confined to packages/wdio-browserstack-service. v8 ↔ v9 differences
are handled (Node 16 support, single `.` export, got/formdata deps, ^8 peers).

- package.json: webdriverio/@wdio/types/reporter/logger → peerDependencies (^8.0.0)
  + devDependencies; add build/test/release scripts + toolchain devDeps;
  publishConfig.tag = "v8" so releases publish to the v8 dist-tag (never latest);
  keep engines ^16.13||>=18, @wdio/cli peer ^5–^8, single `.` export
- tsconfig.json/tsconfig.prod.json: self-contained (no ../../ refs)
- scripts/build.mjs: standalone esbuild, single index entry, target node16
- src/request-handler.ts: unref the batch-polling interval
- .changeset (baseBranch v8) + .github workflows (on v8, OIDC, v8 tag)
- .npmignore, vitest.config.ts, EXTRACTION-V8.md (dist-tag strategy + diffs)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lowlist + @types

Validated the v8 standalone build end-to-end and corrected three v8-specific issues
the v9 path didn't have:
- build with `tsc -p tsconfig.prod.json` (emits JS + d.ts, structure-preserving),
  NOT an esbuild single-file bundle. v8 has a top-level-await inside a circular
  module graph that a single bundle can't express (the monorepo builds v8 with
  `tsc -b`). Removed scripts/build.mjs + esbuild devDep.
- `files` allowlist (build + root types) instead of .npmignore: the `scripts`
  npmignore rule matched build/scripts/ at depth and dropped it from the tarball.
- added @types/uuid (uuid@10 has no bundled types) + @types/yauzl devDeps.

PoC: npm install (no monorepo) → tsc build → pack → install as @wdio/browserstack-service
→ resolves to v8 build 8.48.0, webdriverio deduped, imports cleanly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…h v9)

Copy the manual mocks the v8 suite resolves by convention from the monorepo root
into the package __mocks__: @wdio/logger, @wdio/reporter (stats imported from the
published @wdio/reporter), browserstack-local, fs, got, chalk. v8 uses `got` (not a
global fetch), so vitest.config has no fetch setup file. The got mock's W3C
element-key literal is de-literalized to avoid a secret-scanner false positive.

Validated: a single file runs green standalone (tests/bstackLogger.test.ts 6/6).
The all-at-once suite has the same teardown caveat as v9 (documented).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… is the v9-shared follow-up)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.

1 participant