Skip to content

fix: resolve TypeScript errors with moduleResolution nodenext and skipLibCheck false#1313

Open
R-Delfino95 wants to merge 13 commits intomuxinc:mainfrom
R-Delfino95:fix/typeScript-errors
Open

fix: resolve TypeScript errors with moduleResolution nodenext and skipLibCheck false#1313
R-Delfino95 wants to merge 13 commits intomuxinc:mainfrom
R-Delfino95:fix/typeScript-errors

Conversation

@R-Delfino95
Copy link
Copy Markdown
Contributor

@R-Delfino95 R-Delfino95 commented Apr 16, 2026

Resolves #1299

  • Vendor `mux-embed`'s type declarations into `playback-core/src/vendor/mux-embed.ts`. TypeScript compiles this into `dist/types/vendor/mux-embed.d.ts` and emits a correct relative reference path for consumers.
  • Added a `vendor:types` npm script (`scripts/vendor-mux-embed-types.mjs`) that copies the types directly from `node_modules/mux-embed/dist/types/mux-embed.d.ts`. It's hooked into `prebuild:types` so it runs automatically on every build, and a separate `verify:vendor` script in CI fails the build if the committed vendored copy drifts from the installed `mux-embed` — keeping the source-of-truth honest at review time, not just at publish time.
  • Moved `@types/google_interactive_media_ads_types` to `dependencies` in `mux-video`.
  • Removed the broken `/// ` from `mux-video/src/ads/index.ts` — it's no longer needed since playback-core's vendored reference propagates transitiv
  • Stamp the resolved `mux-embed` version in the vendored file header (`// Source: mux-embed@X.Y.Z / ...`) so type drift after a dependency bump is visible at a glance in PR diffs.
  • Validate that the package resolved in `vendor-mux-embed-types.mjs` is actually `mux-embed` — defensive against edge cases in monorepo / symlink layouts where the directory walk-up could resolve the wrong `package.json`.

Vendoring guardrails

To keep the vendored types honest over time:

Guardrail Where What it catches
Version stamp in header `scripts/vendor-mux-embed-types.mjs` Silent drift after a dependency bump
Package-name sanity check `scripts/vendor-mux-embed-types.mjs` Wrong `package.json` resolved in non-standard layouts
`verify:vendor` in CI `scripts/verify-vendor-drift.mjs` + `.github/workflows/ci.yml` Stale `src/vendor/mux-embed.ts` committed without regeneration

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 16, 2026

@R-Delfino95 is attempting to deploy a commit to the Mux Team on Vercel.

A member of the Team first needs to authorize it.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Apr 16, 2026

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@Jerricho93 Jerricho93 self-assigned this Apr 24, 2026
@R-Delfino95 R-Delfino95 marked this pull request as ready for review May 4, 2026 19:06
@R-Delfino95 R-Delfino95 requested a review from a team as a code owner May 4, 2026 19:06
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 289670b. Configure here.

Comment thread packages/playback-core/scripts/vendor-mux-embed-types.mjs
@R-Delfino95 R-Delfino95 requested a review from luwes May 7, 2026 18:50
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.

Bug: moduleResolution: "nodenext", incorrect mux-embed and google_interactive_media_ads_types types

2 participants