From 2db76cee5f60bc7ada74bfc324b39e558db629ae Mon Sep 17 00:00:00 2001 From: Matt McClure Date: Tue, 27 Oct 2026 18:17:14 +0000 Subject: [PATCH] test(installation): skip media the cdn build excludes in the workspace contract simple-moq-video is kept off the CDN (cdnMediaExclusions in packages/cdn/vite.config.ts), so CDN_MEDIA_SUBPATHS rightly omits it, but the contract test compared the list against every html media definition. Claude-Session: https://claude.ai/code/session_01DaH4ihf1LLPqmXShYkvBat --- packages/cdn/vite.config.ts | 3 ++- packages/installation/src/tests/workspace-contract.test.ts | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/cdn/vite.config.ts b/packages/cdn/vite.config.ts index 358106fc12..b20cc552a5 100644 --- a/packages/cdn/vite.config.ts +++ b/packages/cdn/vite.config.ts @@ -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) diff --git a/packages/installation/src/tests/workspace-contract.test.ts b/packages/installation/src/tests/workspace-contract.test.ts index a7a81c4dfc..cc91e91472 100644 --- a/packages/installation/src/tests/workspace-contract.test.ts +++ b/packages/installation/src/tests/workspace-contract.test.ts @@ -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']); + 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 }) @@ -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);