Keysystem update for wrts DRMEngine#73
Conversation
- add structured DRM request and certificate config types - extend `KeySystem` with `templateConfigurations` - add `createTemplateConfigurations()` helper for DRM capability templates - support robustness-only templates intended to be completed from metadata - add utility and tests for template generation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
So we can watch the coverage in the terminal without having to open the lcov report in a browser.
And also add a missing test case
PR #73 Review — Keysystem update for wrts DRMEngineAuthor: Thomas Jammet | Base: main | +268/-20 across 5 files OverviewRefactors the Breaking ChangesThis PR contains multiple breaking API changes that affect downstream consumers:
These are all intentional architectural improvements, but they should be flagged as a major/breaking version bump (semver major), not just reflected in the changelog. Code Quality Issues1. Misplaced test — doesn't test The first test in the 2. Inline comments explain WHAT, not WHY ( // If no content types are provided, we create a single configuration with robustness values only
// Create a complete configuration for each combination of audio/video content types and robustness valuesProject convention: "Default to writing no comments. Only add one when the WHY is non-obvious." Both of these describe what the code does, which the code itself already shows. Remove them; the JSDoc covers the contract adequately. 3. Silent ignore of In the main loop path, if 4. export type DRMCertificateConfig =
| string
| Uint8Array
| {
url?: string; // optional
data?: Uint8Array; // optional
headers?: Record<string, string | null>;
};Both 5. The original was What Works Well
SummarySolid implementation, good test coverage. The main asks before merging:
|
|
I think the names and DRMKeySystemConfig should have its property called "configurations", it's enough clear: |
|
In seeing again the code, I think that it could be simplify in: |
It also now support a default value instead of just an empty string fallback
…solved media capabilities
|
@claude review |
PR #73 — Keysystem Update for WRTS DRMEngineAuthor: Thomas Jammet | Branch: OverviewThis PR refactors DRM type definitions in
Code Quality & Style
Type design — Issues & Risks1. include: ['src/**/*.ts'], // includes *.spec.ts filesThis instruments test files themselves for coverage, which inflates metrics meaninglessly. Should be: include: ['src/**/!(*.spec).ts'],or add an 2. Breaking change — no migration notes
3. JSDoc typo in Should be 4. Missing edge-case test
Test CoverageCoverage is thorough for both new units:
One gap: no test for what happens when all params are omitted ( SummarySolid PR overall. The logic is correct, the tests are comprehensive, and the type restructuring is an improvement. The main things to address before merging:
|
|
🎉 This PR is included in version 7.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🚀 Features
KeySystemwithtemplateConfigurationscreateTemplateConfigurations()helper for DRM capability templatesOther