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
25 changes: 23 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: CI

permissions:
contents: read

on:
push:
branches: [ main, develop ]
Expand All @@ -9,8 +12,10 @@ on:
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 20

strategy:
fail-fast: true
matrix:
node-version: [16.x, 18.x, 20.x]

Expand All @@ -26,23 +31,33 @@ jobs:

- name: Install dependencies
run: npm ci

- name: Lint (Node 20 quality gate)
if: matrix.node-version == '20.x'
run: npm run lint

- name: Build project
run: npm run build

- name: Demo route smoke test (Node 20)
if: matrix.node-version == '20.x'
run: npm run test:demo-smoke

- name: Run tests
run: npm test
run: npm test -- --runInBand

- name: Upload coverage reports
if: matrix.node-version == '20.x'
uses: actions/upload-artifact@v4
with:
name: coverage-reports
path: coverage/
if-no-files-found: ignore

build:
runs-on: ubuntu-latest
needs: test
timeout-minutes: 15

steps:
- name: Checkout code
Expand All @@ -56,12 +71,18 @@ jobs:

- name: Install dependencies
run: npm ci

- name: Lint quality gate
run: npm run lint

- name: Build all targets
run: npm run build

- name: Validate package exports
run: npm run verify:exports

- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: build-artifacts
path: dist/
path: dist/
87 changes: 59 additions & 28 deletions .github/workflows/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -1,89 +1,120 @@
name: PR Validation

permissions:
contents: read

on:
pull_request:
branches: [ main, develop ]

jobs:
validate:
runs-on: ubuntu-latest

timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4

with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20.x'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Check for package.json changes
id: package-check
run: |
if git diff --name-only origin/main...HEAD | grep -q "package.json"; then
set -euo pipefail
if git diff --name-only "${{ github.event.pull_request.base.sha }}" "${{ github.sha }}" | grep -q '^package.json$'; then
echo "package_changed=true" >> $GITHUB_OUTPUT
else
echo "package_changed=false" >> $GITHUB_OUTPUT
fi

- name: Validate version bump
if: steps.package-check.outputs.package_changed == 'true'
run: |
set -euo pipefail
CURRENT_VERSION=$(node -p "require('./package.json').version")
git checkout origin/main -- package.json
MAIN_VERSION=$(node -p "require('./package.json').version")
git checkout HEAD -- package.json

MAIN_VERSION=$(git show "${{ github.event.pull_request.base.sha }}:package.json" | node -e "let d='';process.stdin.on('data',c=>d+=c);process.stdin.on('end',()=>console.log(JSON.parse(d).version));")

echo "Main branch version: $MAIN_VERSION"
echo "PR version: $CURRENT_VERSION"

if [ "$CURRENT_VERSION" = "$MAIN_VERSION" ]; then
echo "Version not bumped in package.json"
echo "Version not bumped in package.json"
exit 1
else
echo "Version properly bumped: $MAIN_VERSION $CURRENT_VERSION"
echo "Version properly bumped: $MAIN_VERSION -> $CURRENT_VERSION"
fi


- name: Lint quality gate
run: npm run lint

- name: Build project
run: npm run build


- name: Demo route smoke test
run: npm run test:demo-smoke

- name: Run tests
run: npm test
run: npm test -- --runInBand

- name: Check package size
run: |
npm pack
PACKAGE_SIZE=$(du -sh *.tgz | cut -f1)
echo "📦 Package size: $PACKAGE_SIZE"

set -euo pipefail
PACKAGE_FILE=$(npm pack --silent)
PACKAGE_SIZE_BYTES=$(wc -c < "$PACKAGE_FILE")
echo "Package size (bytes): $PACKAGE_SIZE_BYTES"
rm -f "$PACKAGE_FILE"

- name: Validate exports
run: |
echo "Validating package exports..."
node -e "
const pkg = require('./package.json');
const fs = require('fs');

// Check main exports exist
console.log('Checking main exports...');
if (!fs.existsSync('./dist/index.cjs')) throw new Error('Missing main CJS build');
if (!fs.existsSync('./dist/index.esm.js')) throw new Error('Missing main ESM build');
if (!fs.existsSync('./dist/index.d.ts')) throw new Error('Missing main types');

// Check browser exports exist
console.log('Checking browser exports...');
if (!fs.existsSync('./dist/browser.esm.js')) throw new Error('Missing browser ESM build');
if (!fs.existsSync('./dist/browser.cjs')) throw new Error('Missing browser CJS build');
if (!fs.existsSync('./dist/browser.d.ts')) throw new Error('Missing browser types');

// Check server exports exist
console.log('Checking server exports...');
if (!fs.existsSync('./dist/server.esm.js')) throw new Error('Missing server ESM build');
if (!fs.existsSync('./dist/server.cjs')) throw new Error('Missing server CJS build');
if (!fs.existsSync('./dist/server.d.ts')) throw new Error('Missing server types');

console.log('✅ All exports validated successfully');
"

// Check react exports exist
console.log('Checking react exports...');
if (!fs.existsSync('./dist/react.esm.js')) throw new Error('Missing react ESM build');
if (!fs.existsSync('./dist/react.cjs')) throw new Error('Missing react CJS build');
if (!fs.existsSync('./dist/react.d.ts')) throw new Error('Missing react types');

// Check vue exports exist
console.log('Checking vue exports...');
if (!fs.existsSync('./dist/vue.esm.js')) throw new Error('Missing vue ESM build');
if (!fs.existsSync('./dist/vue.cjs')) throw new Error('Missing vue CJS build');
if (!fs.existsSync('./dist/vue.d.ts')) throw new Error('Missing vue types');

console.log('All exports validated successfully');
"

- name: Validate runtime subpath exports
run: |
node scripts/verify-exports.js
node scripts/verify-hook-export.js
node scripts/verify-vue-export.js
17 changes: 15 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Publish to NPM

permissions:
contents: write

on:
push:
tags:
Expand All @@ -14,10 +17,13 @@ on:
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@v4
Expand All @@ -28,17 +34,24 @@ jobs:

- name: Install dependencies
run: npm ci

- name: Lint quality gate
run: npm run lint

- name: Run tests
run: npm test
run: npm test -- --runInBand

- name: Build project
run: npm run build

- name: Validate package exports
run: npm run verify:exports

- name: Verify package contents
run: npm pack --dry-run

- name: Publish to NPM
if: ${{ secrets.NPM_TOKEN != '' }}
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -51,4 +64,4 @@ jobs:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
prerelease: false
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,10 @@ discord-engagement-plan.md
github-responses-ready-to-post.md
phase1-response-templates.md
CLAUDE.md

# Local maintenance artifacts
code-review-report.md
todo.md

# Exported patch diffs (generated artifacts)
patches/
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,25 @@
# Changelog

## [1.1.7] - 2026-02-06

### Added
- Comprehensive video streaming support (MP4, WebM, M3U8/HLS adaptive streaming)
- Video examples: `examples/video-streaming.js` with 6 complete examples
- React video player component: `examples/react-video-player.tsx` with basic, advanced, and playlist modes
- Video feature documentation in README with code examples and usage patterns

### Changed
- Expanded README with explicit video streaming feature documentation
- Updated package description to include video media support
- Enhanced package keywords to cover video formats (hls-streaming, m3u8-playlist, mp4-streaming, video-streaming)
- Improved gitignore to exclude generated maintenance artifacts and patch diffs

### Documentation
- Clarified universal media streaming capabilities (audio and video)
- Added dedicated "Video Streaming" section with MP4, M3U8/HLS, and seeking examples
- Updated problem/solution sections to address video codec and HLS challenges
- Documented range request support for video seeking

## [1.1.6] - 2025-10-21

### Fixed
Expand Down
Loading
Loading