Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor CMCD controller and tests to use the common media library utilities #5903

Merged
merged 16 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -752,15 +752,8 @@ export class ChunkMetadata {
// @public
export class CMCDController implements ComponentAPI {
constructor(hls: Hls);
static appendQueryToUri(uri: any, query: any): any;
// (undocumented)
destroy(): void;
// Warning: (ae-forgotten-export) The symbol "CMCD" needs to be exported by the entry point hls.d.ts
static serialize(data: CMCD): string;
// Warning: (ae-forgotten-export) The symbol "CMCDHeaders" needs to be exported by the entry point hls.d.ts
static toHeaders(data: CMCD): Partial<CMCDHeaders>;
static toQuery(data: CMCD): string;
static uuid(): string;
}

// Warning: (ae-missing-release-tag) "CMCDControllerConfig" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand All @@ -770,6 +763,7 @@ export type CMCDControllerConfig = {
sessionId?: string;
contentId?: string;
useHeaders?: boolean;
includeKeys?: string[];
littlespex marked this conversation as resolved.
Show resolved Hide resolved
};

// Warning: (ae-missing-release-tag) "ComponentAPI" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
Expand Down
4 changes: 2 additions & 2 deletions build-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const buildTypeToOutputName = {
light: `hls.light`,
};

/* Allow to customise builds through env-vars */
/* Allow to customize builds through env-vars */
// eslint-disable-next-line no-undef
const env = process.env;

Expand Down Expand Up @@ -96,7 +96,7 @@ const babelTsWithPresetEnvTargets = ({ targets, stripConsole }) =>
babel({
extensions,
babelHelpers: 'bundled',
exclude: 'node_modules/**',
exclude: /node_modules\/(?!(@svta)\/).*/,
Copy link
Collaborator

Choose a reason for hiding this comment

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

😅

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

That is an unfortunate side effect of rollup's babel plugin config rules:

When relying on Babel configuration files you cannot include files already excluded there.

https://github.com/rollup/plugins/blob/2c58b01a45d31e0abd72c9c83a86c826c898cd24/packages/babel/types/index.d.ts#L8

Copy link
Collaborator

Choose a reason for hiding this comment

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

Not excluding it ensures that babel does the es conversion correct? We have es-check verifying that the .js output is es5 w/o modules so I think we're good.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Correct. CML is targeted at ESNEXT and needs top be transpiled. It would just be clearer if we could "include CML" via the include config property instead of "exclude everything but CML".

assumptions: {
noDocumentAll: true,
noClassCalls: true,
Expand Down
12 changes: 12 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"@rollup/plugin-replace": "5.0.5",
"@rollup/plugin-terser": "0.4.4",
"@rollup/plugin-typescript": "11.1.5",
"@svta/common-media-library": "0.4.5",
"@types/chai": "4.3.10",
"@types/chart.js": "2.9.40",
"@types/mocha": "10.0.4",
Expand Down
1 change: 1 addition & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export type CMCDControllerConfig = {
sessionId?: string;
contentId?: string;
useHeaders?: boolean;
includeKeys?: string[];
};

export type DRMSystemOptions = {
Expand Down
Loading
Loading