Skip to content
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
3 changes: 2 additions & 1 deletion packages/cdn/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ const cdnPresets = [
// `development` condition to html's dev output and the prod build follows `default`.
// `simple-moq-video` is deliberately kept off the CDN: the MoQ engine has no error slot yet, so the element cannot
// report a failed transport, an unsupported codec, or a bad catalog. Publishing it would ship a player that fails
// silently. Remove it from this list once the engine surfaces errors.
// silently. Remove it from this list, and from `CDN_EXCLUDED_MEDIA` in the installation workspace contract test, once
// the engine surfaces errors.
const cdnMediaExclusions = new Set(['media/simple-moq-video']);
const cdnHtmlDefinitionEntries = cdnHtmlEntries(resolve(htmlDistDir, 'define')).filter(
({ name }) => !cdnMediaExclusions.has(name)
Expand Down
4 changes: 4 additions & 0 deletions packages/installation/src/tests/workspace-contract.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ const extensionPackages = new Set(
Object.values(INSTALLATION_EXTENSION_DEFINITIONS).map(({ packageName }) => packageName)
);

/** Definitions the CDN build leaves out; mirrors `cdnMediaExclusions` in `packages/cdn/vite.config.ts`. */
const CDN_EXCLUDED_MEDIA = new Set(['simple-moq-video']);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2: CDN_EXCLUDED_MEDIA is a second hand-maintained copy of cdnMediaExclusions in packages/cdn/vite.config.ts, and it uses a different key format ('simple-moq-video' vs 'media/simple-moq-video'). If the CDN exclusion changes without this set changing, the contract test will keep passing while the CDN build and CDN_MEDIA_SUBPATHS drift apart. Consider sharing one exported list between the two, or having the test assert the exclusion explicitly against the vite config.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At packages/installation/src/tests/workspace-contract.test.ts, line 40:

<comment>`CDN_EXCLUDED_MEDIA` is a second hand-maintained copy of `cdnMediaExclusions` in `packages/cdn/vite.config.ts`, and it uses a different key format (`'simple-moq-video'` vs `'media/simple-moq-video'`). If the CDN exclusion changes without this set changing, the contract test will keep passing while the CDN build and `CDN_MEDIA_SUBPATHS` drift apart. Consider sharing one exported list between the two, or having the test assert the exclusion explicitly against the vite config.</comment>

<file context>
@@ -36,6 +36,9 @@ const extensionPackages = new Set(
 );
 
+/** Definitions the CDN build leaves out; mirrors `cdnMediaExclusions` in `packages/cdn/vite.config.ts`. */
+const CDN_EXCLUDED_MEDIA = new Set(['simple-moq-video']);
+
 describe('installation workspace contract', () => {
</file context>


describe('installation workspace contract', () => {
it('keeps CDN media support aligned with the definitions its build republishes', () => {
const definitions = globSync('packages/html/src/define/media/**/*.ts', { cwd: workspaceRoot })
Expand All @@ -45,6 +48,7 @@ describe('installation workspace contract', () => {
.replace(/\/index\.ts$/, '')
.replace(/\.ts$/, '')
)
.filter((subpath) => !CDN_EXCLUDED_MEDIA.has(subpath))
.sort();

expect([...CDN_MEDIA_SUBPATHS].sort()).toEqual(definitions);
Expand Down
Loading