Files
iptvnator/libs/shared
4grayandClaude Opus 5 b62aac86c0 refactor(deps): drop uuid for a shared crypto-based id helper
Supersedes #1252 (and the stale #872). Bumping uuid to 14 is not a lockfile
change: v14 is ESM-only, which is what produced the wall of "Jest encountered
an unexpected token" on #872, and `apps/web/jest.config.ts` only kept it
working by mapping `^uuid$` at a `wrapper.mjs` that v14 no longer ships. On top
of that the bump needs the specifier synced in
`libs/shared/m3u-utils/package.json` or `@nx/dependency-checks` fails lint,
which is the real error on #1252.

All four call sites only ever needed `v4()`, so the dependency goes away
instead. `createRandomId()` in `@iptvnator/shared/interfaces` prefers
`crypto.randomUUID()` and falls back to building the same v4 shape from
`crypto.getRandomValues()`. The fallback is not defensive padding: the
self-hosted PWA is regularly served over plain http on a LAN address, which is
not a secure context, and browsers only expose `randomUUID` in secure contexts.
`getRandomValues` stays available there — it is what uuid's own v4 used.

`@types/uuid` goes too; it only existed for the untyped v9 package.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 19:44:40 +02:00
..