feat: add @launchdarkly/o11y as the shared browser foundation, publish highlight.run as a thin alias - #756
feat: add @launchdarkly/o11y as the shared browser foundation, publish highlight.run as a thin alias#756Vadman97 wants to merge 3 commits into
Conversation
…h highlight.run as a thin alias Move the browser SDK implementation from sdk/highlight-run to sdk/@launchdarkly/o11y and publish it as @launchdarkly/o11y. highlight.run becomes a thin wrapper that re-exports @launchdarkly/o11y (same five entry points and UMD bundle), so it keeps publishing unchanged for existing users. @launchdarkly/observability and @launchdarkly/session-replay now depend on @launchdarkly/o11y instead of highlight.run, so the whole LaunchDarkly browser SDK dependency chain lives under the @launchdarkly/* scope. - turbo: highlight.run#typegen -> @launchdarkly/o11y#typegen - release-please: register sdk/@launchdarkly/o11y (seeded at 1.1.20, lockstep with the wrappers) - check-published-types: verify @launchdarkly/o11y (owns the rolled-up .d.ts) - docs CI: typedoc from sdk/@launchdarkly/o11y, same output path - .gitignore / CLAUDE.md / analytics-taxonomy.md path updates Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
| export default defineConfig({ | ||
| envPrefix: ['REACT_APP_'], | ||
| server: { | ||
| host: '0.0.0.0', |
There was a problem hiding this comment.
High severity vulnerability may affect your project—review required:
Line 11 lists a dependency (vite) with a known High severity vulnerability.
ℹ️ Why this matters
Affected versions of vite and vite-plus are vulnerable to Exposure of Sensitive Information to an Unauthorized Actor / Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). Vite's server.fs.deny blocklist—which protects sensitive files such as .env and certificate files from being served—can be bypassed on Windows using alternate path representations (NTFS Alternate Data Stream syntax like /.env::$DATA?raw, or 8.3 short filenames), allowing an attacker to read otherwise-denied files when the dev server is exposed to the network.
References: https://euvd.enisa.europa.eu/vulnerability/EUVD-2026-38303, GHSA, CVE
To resolve this comment:
Check if you are running the Vite dev server or vite-plus on Windows.
- If you're affected, upgrade this dependency to at least version 6.4.3 at yarn.lock.
- If you're not affected, comment
/fp we don't use this [condition]
💬 Ignore this finding
To ignore this, reply with:
/fp <comment>for false positive/ar <comment>for acceptable risk/other <comment>for all other reasons
You can view more details on this finding in the Semgrep AppSec Platform here.
There was a problem hiding this comment.
/fp we don't use the vite dev server with this dependency. The flagged vite5 alias (vite 5.4.21) is a devDependency invoked only as vite build to produce the production bundle; the dev server (vite dev) runs on vite@^6.4.3, which is already the patched version. Builds run on ubuntu in CI and macOS locally, not Windows, so the server.fs.deny Windows path bypass is not reachable.
Context: this devDependency predates this PR (added in #603 as a "dual vite" setup) and only shows up here because sdk/highlight-run was renamed to sdk/@launchdarkly/o11y. Vite 5 has no patched release for this advisory (fix is 6.4.3+), so removing it means moving the o11y production build to vite 6, which currently fails on the inline worker bundle (cross-fetch CJS interop via graphql-request). That migration is a separate follow-up.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7b8136a. Configure here.
…shes topologically highlight.run now depends on @launchdarkly/o11y at runtime, but the Monorepo workflow published highlight.run before the @launchdarkly/* OIDC step. After a version bump, `npm install highlight.run` could fail until (or forever, if) the o11y publish landed. - turbo.yml: run the @launchdarkly/* publish first; a failure there stops the job before highlight.run is published. - publish-npm.sh: sort workspaces topologically instead of relying on alphabetical order (o11y -> observability/session-replay -> observability-next). - package.json: `--topological` on both `yarn workspaces foreach` publish scripts so highlight.run publishes before @highlight-run/node, next, remix. - manual-publish.yml: document the ordering constraint for manual highlight publishes. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Brings in #758 (WebKit/iPad performance hardening) and #759 (release 1.1.21 / 10.7.3). Conflict resolutions: - .release-please-manifest.json: take main's bumps; seed sdk/@launchdarkly/o11y at 1.1.21 to stay in lockstep with @launchdarkly/observability and @launchdarkly/session-replay. - sdk/@launchdarkly/o11y/package.json: version 1.1.20 -> 1.1.21 (same). - sdk/highlight-run/package.json: take main's 10.7.3, keep the wrapper description. - sdk/highlight-run/vite.config.ts: keep the wrapper config; port main's OTEL_DEDUPE resolve/dedupe change to sdk/@launchdarkly/o11y/vite.config.ts, which is now byte-identical to main's sdk/highlight-run/vite.config.ts. - body-limits.test.ts: placed under the renamed sdk/@launchdarkly/o11y path. All other #758 source changes were auto-applied onto the renamed o11y paths (zero-diff renames against main). Verified: yarn dedupe --check, wrapper builds, 27 o11y test files / 496 tests, size-limit 170.29 kB brotli. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Two follow-up commits since the approvals: e0e9367 – publish ordering (Bugbot finding). f3ce874 – merge of
Re-verified locally: Semgrep's vite finding is answered inline as a false positive: the flagged |

Summary
Introduces
@launchdarkly/o11yas the shared browser foundation that@launchdarkly/observabilityand@launchdarkly/session-replayare built on, and turnshighlight.runinto a thin compatibility wrapper over it so both names keep publishing (dual publishing).Motivation (from a teammate's question): our own packages currently pull
highlight.runin as a runtime dependency of@launchdarkly/observability/@launchdarkly/session-replay. Tooling that allow-lists by@launchdarkly/*(dependency quarantines, exclusions, namespace protection) can't express that today. After this change every runtime dependency in the LD browser SDK chain is under the@launchdarkly/*scope.What changed
Source move (git rename, no code changes):
sdk/highlight-run/**→sdk/@launchdarkly/o11y/**. The package is renamed to@launchdarkly/o11y; build config, exports map (.,./observe,./record,./ld/observe,./ld/record), UMD global (LD), tests, codegen, typedoc, and size-limit are all unchanged apart from two relative paths (tsconfigproject reference,codegen.ymlschema path).highlight.runbecomes a wrapper (sdk/highlight-run), exactly like the other two wrappers:export * from '@launchdarkly/o11y'(+ one file per subpath entry), bundled by vite into a self-contained package with the same 5 entry points andindex.umd.js. Keeps its ownCHANGELOG.md, version line (10.x), README (with a pointer note), and continues to publish viayarn publish:highlight. All in-repo consumers (@highlight-run/next,remix,node,react, e2e apps) keep importinghighlight.rununtouched.Wrappers re-pointed:
@launchdarkly/observabilityand@launchdarkly/session-replaynow depend on and re-export from@launchdarkly/o11yinstead ofhighlight.run.Plumbing:
turbo.json:highlight.run#typegen→@launchdarkly/o11y#typegen(the rrweb build ordering).release-please-config.json+ manifest: registersdk/@launchdarkly/o11y(node release type, same settings as siblings). Manifest seeded at1.1.20so it ships in lockstep with@launchdarkly/observability/@launchdarkly/session-replay; thenode-workspaceplugin then bumps the three wrappers whenever o11y changes, as it does forhighlight.runtoday.scripts/check-published-types.mjs: now packs and type-checks@launchdarkly/o11y(the package that owns the rolled-up.d.tsand whose runtime deps are all on npm). The wrappers useworkspace:sonpm packcan't test them, same as before.publish-docs.yml,manual-publish-docs.yml): typedoc now runs fromsdk/@launchdarkly/o11y; output path stayspackages/@launchdarkly/observabilityso the docs URL doesn't move..gitignore,CLAUDE.md,analytics-taxonomy.md: path updates.yarn.lock: workspace re-link only, no new third-party deps.Things reviewers should know
@launchdarkly/o11ydoes not exist on npm yet, andpublish-npm.shuses npm OIDC trusted publishing, which requires the package to already exist with a trusted publisher configured. Before merging, an npm org admin needs to create the package and addlaunchdarkly/observability-sdk/turbo.ymlas its trusted publisher (same setup as the other@launchdarkly/*packages). Otherwise thePublish @launchdarkly npm packagesstep onmainwill fail for o11y (the other packages are unaffected; the script exits on first failure so ordering matters — o11y sorts beforeobservability).src/version.tsreads its ownpackage.json, sofirstloadVersion/clientVersionon sessions moves from thehighlight.runline (10.7.2) to the@launchdarklyline (1.1.20) for all three wrappers. The backend only stores these fields (InitializeSession→ session row); nothing gates on them. This is arguably more correct: it's the version customers actually install.highlight.run(LD SDK hook metadataname: 'highlight.run'/'highlight.run/ld', error-frame and XHR self-filtering on'highlight.run', console warning prefix). Renaming those affects telemetry/dashboards and deserves its own PR.@launchdarkly/o11yexactly as they inlinedhighlight.run.Verification
All run locally in a fresh worktree off
mainwith a cleanyarn install:yarn dedupe --check✅yarn turbo run build --filter 'highlight.run...' --filter @launchdarkly/observability --filter @launchdarkly/session-replay✅ (15 tasks: rrweb deps → observability-shared → o11y typegen/build → the three wrappers)yarn turbo run test --filter @launchdarkly/o11y✅ — 26 test files, 491 tests;enforce-size171.64 kB brotli (limit 256 kB)node scripts/check-published-types.mjs✅ — packed@launchdarkly/o11yinstalls into a clean consumer and type-checks withskipLibCheck: falseunder bothbundlerandnoderesolutionprettier --checkon every changed file ✅highlight.run'sdist/index.jsanddist/index.umd.jsexport exactly the same named surface as@launchdarkly/o11y(GenerateSecureID, H, HighlightSegmentMiddleware, LDObserve, LDRecord, MetricCategory, Observe, Record, __testing, configureElectronHighlight); the UMD bundle evaluated in jsdom setswindow.H(25 methods) andH.getRecordingState()returnsNotRecording. UMD size 793 KB vs 794 KB for o11y.@launchdarkly/observabilityexportsdefault, LDObserve;@launchdarkly/session-replayexportsdefault, LDRecord, as before.highlight.run.d.tsis a one-lineexport * from '@launchdarkly/o11y[/subpath]'; the two@launchdarkly/*wrappers'.d.tsre-export from@launchdarkly/o11y.Not run here: the e2e apps (they import
highlight.run, which is unchanged at the API level) and the actual npm publish (see the prerequisite above).Follow-ups (not in this PR)
@highlight-run/next/remix/node/reactshould also move to@launchdarkly/o11y, or stay on thehighlight.runalias as the highlight-branded family.'highlight.run'runtime identifiers above once dashboards/queries are ready for it.highlight.runon npm with a pointer to@launchdarkly/observability/@launchdarkly/session-replay.Note
Overview
Introduces
@launchdarkly/o11yas the shared browser implementation (session replay + observability) and repoints@launchdarkly/observabilityand@launchdarkly/session-replayto depend on and re-export it instead ofhighlight.run.highlight.runstays published as a thin bundled alias (export * from '@launchdarkly/o11y') so existing imports keep working.Release and docs plumbing follow the new layout:
turbo.ymlpublishes@launchdarkly/*beforehighlight.run(runtime dep on@launchdarkly/o11y),publish-npm.shand rootpublishscripts use topological ordering,check-published-types.mjsvalidates@launchdarkly/o11y's rolled-up types, TypeDoc/docs CI targetssdk/@launchdarkly/o11y(still published to the observability docs path), and release-please registers the new package.Reviewed by Cursor Bugbot for commit f3ce874. Bugbot is set up for automated code reviews on this repo. Configure here.