chore(site): preset pipeline — scan source directories instead of barrel files (#1333)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-04-14 12:28:16 -05:00
committed by GitHub
co-authored by Claude Opus 4.6
parent d8cd59e0fd
commit 7daec38b88
13 changed files with 536 additions and 143 deletions
@@ -11,3 +11,5 @@ import { volumeFeature } from './volume';
export const videoFeatures = [playbackFeature, volumeFeature];
export const audioFeatures = [playbackFeature];
export const backgroundFeatures = [];
@@ -0,0 +1,29 @@
{
"name": "@videojs/html",
"exports": {
"./video": {
"types": "./src/presets/video.ts",
"default": "./src/presets/video.ts"
},
"./video/*": {
"types": "./src/define/video/*.ts",
"default": "./src/define/video/*.ts"
},
"./audio": {
"types": "./src/presets/audio.ts",
"default": "./src/presets/audio.ts"
},
"./audio/*": {
"types": "./src/define/audio/*.ts",
"default": "./src/define/audio/*.ts"
},
"./background": {
"types": "./src/presets/background.ts",
"default": "./src/presets/background.ts"
},
"./background/*": {
"types": "./src/define/background/*.ts",
"default": "./src/define/background/*.ts"
}
}
}
@@ -0,0 +1,9 @@
/**
* Mock HTML background player element.
*
* Exercises: player exclusion — has static tagName but class name
* contains "Player", so it should NOT appear in skins or media elements.
*/
export class BackgroundVideoPlayerElement extends HTMLElement {
static readonly tagName = 'background-video-player';
}
@@ -0,0 +1,10 @@
/**
* Mock HTML background video skin element.
*
* Exercises: skin detection via *Skin*Element naming + static tagName.
*/
import { SkinElement } from '../skin-element';
export class BackgroundVideoSkinElement extends SkinElement {
static readonly tagName = 'background-video-skin';
}
@@ -0,0 +1,8 @@
/**
* Mock HTML background video re-export.
*
* Exercises: `export *` re-export that resolves to a file with static tagName.
* Mirrors real define/background/video.ts which re-exports from
* define/media/background-video.ts (the file that registers the custom element).
*/
export * from '../media/background-video';
@@ -0,0 +1,8 @@
/**
* Mock HTML background preset.
*
* Exercises: intentionally incomplete barrel — only exports the feature bundle.
* The skin and media element are NOT re-exported here, proving the pipeline
* must scan the directory (define/background/) to find them.
*/
export { backgroundFeatures } from '../../../core/src/dom/store/features/presets';
@@ -0,0 +1,29 @@
{
"name": "@videojs/react",
"exports": {
"./video": {
"types": "./src/presets/video/index.ts",
"default": "./src/presets/video/index.ts"
},
"./video/*": {
"types": "./src/presets/video/*.ts",
"default": "./src/presets/video/*.ts"
},
"./audio": {
"types": "./src/presets/audio/index.ts",
"default": "./src/presets/audio/index.ts"
},
"./audio/*": {
"types": "./src/presets/audio/*.ts",
"default": "./src/presets/audio/*.ts"
},
"./background": {
"types": "./src/presets/background/index.ts",
"default": "./src/presets/background/index.ts"
},
"./background/*": {
"types": "./src/presets/background/*.ts",
"default": "./src/presets/background/*.ts"
}
}
}
@@ -0,0 +1,4 @@
/**
* Mock React BackgroundVideo media component.
*/
export function BackgroundVideo(): void {}
@@ -0,0 +1,8 @@
/**
* Mock React background preset.
*
* Exercises: preset with no features, single skin, custom media element.
*/
export { backgroundFeatures } from '../../../../core/src/dom/store/features/presets';
export { BackgroundVideo } from '../../media/background-video';
export * from './skin';
@@ -0,0 +1,4 @@
/**
* Mock React BackgroundVideoSkin component.
*/
export function BackgroundVideoSkin(): void {}