3.7 KiB
3.7 KiB
Tasks: enterprise-video
Change ID: enterprise-video
Package: @suaveplan/video
Layout: packages/media/video/video/
0. Pre-flight
- Confirm
@suaveplan/error+@suaveplan/eventsare shipped ongenesisviaworkspace:^. - Add
videoto themediasuper-category inscripts/folder-reorg/assignment.yml__categories__:row.
1. Scaffold
- Create
packages/media/video/video/{src,tests/setup}with feature directories. package.jsonat0.1.0,type: module,sideEffects: false.- Subpath exports per feature:
./error-codes/error-codes,./errors/errors,./types/video-types,./processor/processor,./pipeline-builder/pipeline-builder,./detection/detection,./duration/duration,./resize/resize,./trim/trim,./format/format,./instruments/instruments. tsconfig.lib.jsonmirroring@suaveplan/image.vite.config.tsmirroring@suaveplan/image.vitest.config.tsmirroring@suaveplan/image(forks pool, istanbul 100/100/100/100, polyfills setup).tests/setup/polyfills.tsre-exporting@suaveplan/testing/polyfills.
2. Error codes + typed error
src/error-codes/error-codes.ts—defineCodes("VIDEO", […])with 16 codes covering every upstream factory plusCONFIG_INVALID.VIDEO_ERROR_METADATA— preserved HTTP/severity/retry table.registerVideoErrorCodes()— callable alias returning the metadata table.src/errors/errors.ts—VideoError extends SuaveplanError<VideoCode>with typedcontext+ 15 upstream factories.- Co-located
.mdfor both modules.
3. Types + schemas
src/types/video-types/video-types.ts— Zod schemas for every public type; inferred types;RESOLUTION_PRESETS;VIDEO_MIME_TYPES;VideoEventMap.- Discriminated union
VideoTransformOpSchema(9 variants).
4. Pure helpers
src/detection/detection.ts—detectVideoFormat.src/resize/resize.ts—calculateVideoResize.src/trim/trim.ts—validateTrimRange.src/duration/duration.ts—formatDuration+parseDuration.src/format/format.ts—videoFormatToExtension.- Co-located
.mdper module.
5. Processor + builder
src/instruments/instruments.ts— meter, 2 counters + 2 histograms, tracer.src/processor/processor.ts—VideoProcessorcomposingEventBus<VideoEventMap>;extractMetadata+planTransform+createPipeline+on/once/off; AbortSignal + OTel + Zod config validation.src/pipeline-builder/pipeline-builder.ts—VideoPipelineBuilderfluent surface;build()emitspipeline.builtwhen wired.
6. Tests
- Per-feature
.test.tsfiles; all import from@suaveplan/testing/runner; everyit(...)carries{ timeout: 5000 }. processor.spec-conformance.test.tsvalidates OTel + AbortSignal + event-emission contracts end-to-end.
7. Barrel + README
src/index.tswith explicit named re-exports only.- Package
README.mdwith Modules index.
8. Pre-publish gate
bunx turbo lint typecheck test build --filter=@suaveplan/videogreen.bunx turbo test:coverage --filter=@suaveplan/videoat 100/100/100/100.- Banned-pattern scan clean.
- Subpath-export count matches feature-module count.
9. Fold + archive
- Fold
specs/video/spec.mdintoopenspec/specs/video/spec.md. - Move
openspec/changes/enterprise-video/toopenspec/archive/2026-05-25-enterprise-video/.
10. STATUS + MANIFEST refresh
- Flip
@suaveplan/videofrom-to migrated inSTATUS.md. - Update migrated/pending counter.
- Run
bun scripts/folder-reorg/generate-manifest.ts.