forked from ricky0123/vad
-
Notifications
You must be signed in to change notification settings - Fork 2
Typescript Port #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
kasumi-1
wants to merge
32
commits into
semperai:master
Choose a base branch
from
kasumi-1:ts
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 19 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
c294635
Add coverage workflow for web and react packages
kasumi-1 62d6698
Add comprehensive testing infrastructure and TypeScript improvements
kasumi-1 50caf62
Add comprehensive test suite for React package
kasumi-1 5b6e957
Increase web package test coverage with additional test suites
kasumi-1 f1652c7
Add ESLint configuration for code quality
kasumi-1 9bc8eb3
Fix coverage workflow to work with both packages
kasumi-1 27c7637
Remove dead code and console.logs from React package
kasumi-1 6779304
Add comprehensive CONTRIBUTING.md guide
kasumi-1 42404b7
Add CHANGELOG.md for tracking project changes
kasumi-1 eea71a4
Add Dependabot configuration for automated dependency updates
kasumi-1 b664dae
Add comprehensive test suite for React package (49 tests, 98.67% cove…
kasumi-1 4b2775e
Add comprehensive model tests (100% coverage for models/)
kasumi-1 877234d
Rewrite README for TypeScript fork
kasumi-1 6b6c967
Increase web package test coverage to 71.34%
kasumi-1 d100257
Add Playwright for browser integration testing
kasumi-1 e41ed09
Fix build script for macOS and update e2e test configuration
kasumi-1 314e104
Add COOP/COEP headers and fix bundle serving for e2e tests
kasumi-1 f762f75
E2E test infrastructure complete - 16/28 tests passing
kasumi-1 79ce1f1
Fix e2e tests by adding baseAssetPath to all VAD instantiations
kasumi-1 44e33dd
Rename packages from @ricky0123 to @semperai scope
kasumi-1 11d8a00
Update README with new @semperai package names
kasumi-1 8a79ec1
Update examples to use @semperai packages
kasumi-1 f26590a
Update test-site to use @semperai packages
kasumi-1 efd4625
Update documentation to use @semperai packages
kasumi-1 c267b1a
Update CONTRIBUTING.md and README with npm badges
kasumi-1 50377bb
Update source imports to use @semperai packages
kasumi-1 7f6bdec
Fix React package imports to use @semperai scope
kasumi-1 f35d703
Update package-lock.json with new @semperai package names
kasumi-1 e8ae84f
Fix CI coverage workflow to build packages before testing
kasumi-1 c7135dc
Remove workspace package-lock.json files and ignore them
kasumi-1 e4ad838
Address CodeRabbit PR review feedback
kasumi-1 71816df
Fix formatting and TypeScript type errors
kasumi-1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| node_modules | ||
| dist | ||
| coverage | ||
| *.min.js | ||
| *.config.js | ||
| webpack.config.js | ||
| jest.config.js | ||
| test-site/dist | ||
| examples/**/dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| { | ||
| "root": true, | ||
| "parser": "@typescript-eslint/parser", | ||
| "parserOptions": { | ||
| "ecmaVersion": 2020, | ||
| "sourceType": "module", | ||
| "project": "./tsconfig.json" | ||
| }, | ||
| "plugins": ["@typescript-eslint"], | ||
| "extends": [ | ||
| "eslint:recommended", | ||
| "plugin:@typescript-eslint/recommended", | ||
| "plugin:@typescript-eslint/recommended-requiring-type-checking" | ||
| ], | ||
| "rules": { | ||
| "@typescript-eslint/no-unused-vars": [ | ||
| "error", | ||
| { | ||
| "argsIgnorePattern": "^_", | ||
| "varsIgnorePattern": "^_" | ||
| } | ||
| ], | ||
| "@typescript-eslint/explicit-function-return-type": "off", | ||
| "@typescript-eslint/no-explicit-any": "warn", | ||
| "@typescript-eslint/no-floating-promises": "error", | ||
| "@typescript-eslint/no-misused-promises": "error", | ||
| "no-console": ["warn", { "allow": ["warn", "error"] }], | ||
| "prefer-const": "error", | ||
| "no-var": "error" | ||
| }, | ||
| "ignorePatterns": [ | ||
| "dist", | ||
| "node_modules", | ||
| "*.js", | ||
| "*.config.js", | ||
| "webpack.config.js", | ||
| "jest.config.js", | ||
| "coverage", | ||
| "*.min.js" | ||
| ], | ||
| "overrides": [ | ||
| { | ||
| "files": ["**/*.spec.ts", "**/*.test.ts", "**/tests/**/*.ts"], | ||
| "rules": { | ||
| "@typescript-eslint/no-explicit-any": "off", | ||
| "@typescript-eslint/no-unsafe-assignment": "off", | ||
| "@typescript-eslint/no-unsafe-member-access": "off", | ||
| "@typescript-eslint/no-unsafe-call": "off", | ||
| "@typescript-eslint/no-unsafe-return": "off", | ||
| "no-console": "off" | ||
| } | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| version: 2 | ||
| updates: | ||
| # Enable version updates for npm | ||
| - package-ecosystem: "npm" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:00" | ||
| open-pull-requests-limit: 5 | ||
| reviewers: | ||
| - "ricky0123" | ||
| labels: | ||
| - "dependencies" | ||
| - "automated" | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
| # Group all non-major updates together | ||
| groups: | ||
| development-dependencies: | ||
| dependency-type: "development" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
| production-dependencies: | ||
| dependency-type: "production" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
|
|
||
| # Enable version updates for npm in packages/web | ||
| - package-ecosystem: "npm" | ||
| directory: "/packages/web" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:00" | ||
| open-pull-requests-limit: 5 | ||
| reviewers: | ||
| - "ricky0123" | ||
| labels: | ||
| - "dependencies" | ||
| - "vad-web" | ||
| - "automated" | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
| groups: | ||
| development-dependencies: | ||
| dependency-type: "development" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
| production-dependencies: | ||
| dependency-type: "production" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
|
|
||
| # Enable version updates for npm in packages/react | ||
| - package-ecosystem: "npm" | ||
| directory: "/packages/react" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:00" | ||
| open-pull-requests-limit: 5 | ||
| reviewers: | ||
| - "ricky0123" | ||
| labels: | ||
| - "dependencies" | ||
| - "vad-react" | ||
| - "automated" | ||
| commit-message: | ||
| prefix: "chore(deps)" | ||
| include: "scope" | ||
| groups: | ||
| development-dependencies: | ||
| dependency-type: "development" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
| production-dependencies: | ||
| dependency-type: "production" | ||
| update-types: | ||
| - "minor" | ||
| - "patch" | ||
|
|
||
| # Enable version updates for GitHub Actions | ||
| - package-ecosystem: "github-actions" | ||
| directory: "/" | ||
| schedule: | ||
| interval: "weekly" | ||
| day: "monday" | ||
| time: "09:00" | ||
| open-pull-requests-limit: 3 | ||
| reviewers: | ||
| - "ricky0123" | ||
| labels: | ||
| - "dependencies" | ||
| - "github-actions" | ||
| - "automated" | ||
| commit-message: | ||
| prefix: "chore(ci)" | ||
| include: "scope" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| name: Coverage | ||
|
|
||
| on: | ||
| push: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| coverage: | ||
| runs-on: ubuntu-latest | ||
| strategy: | ||
| matrix: | ||
| package: [packages/web, packages/react] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v5 | ||
| with: | ||
| node-version: '22' | ||
|
|
||
| - name: Install dependencies | ||
| run: npm ci | ||
|
|
||
| - name: Run coverage | ||
| run: cd ${{ matrix.package }} && npm run test:coverage | ||
|
|
||
| - name: Publish Test Results | ||
| uses: EnricoMi/publish-unit-test-result-action@v2 | ||
| if: (!cancelled()) | ||
| with: | ||
| files: | | ||
| ${{ matrix.package }}/test-results/**/*.xml | ||
| ${{ matrix.package }}/test-results/**/*.trx | ||
| ${{ matrix.package }}/test-results/**/*.json | ||
| check_name: Test Results (${{ matrix.package }}) | ||
| continue-on-error: true | ||
|
|
||
| - name: Determine lcov path | ||
| id: lcov-path | ||
| run: | | ||
| if [ -f "${{ matrix.package }}/lcov.info" ]; then | ||
| echo "path=${{ matrix.package }}/lcov.info" >> $GITHUB_OUTPUT | ||
| elif [ -f "${{ matrix.package }}/coverage/lcov.info" ]; then | ||
| echo "path=${{ matrix.package }}/coverage/lcov.info" >> $GITHUB_OUTPUT | ||
| else | ||
| echo "path=${{ matrix.package }}/lcov.info" >> $GITHUB_OUTPUT | ||
| fi | ||
|
|
||
| - name: Upload coverage to Coveralls | ||
| uses: coverallsapp/github-action@v2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| flag-name: ${{ matrix.package }} | ||
| parallel: true | ||
| file: ${{ steps.lcov-path.outputs.path }} | ||
| continue-on-error: true | ||
|
|
||
| finish: | ||
| needs: coverage | ||
| if: always() | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Coveralls Finished | ||
| uses: coverallsapp/github-action@v2 | ||
| with: | ||
| github-token: ${{ secrets.GITHUB_TOKEN }} | ||
| parallel-finished: true | ||
| carryforward: true | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to this project will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Added | ||
| - Comprehensive test suite for React package with 14 tests covering useMicVAD hook | ||
| - Additional test coverage for web package (messages, asset-path, model fetcher, real-time VAD) | ||
| - ESLint configuration with TypeScript support for code quality enforcement | ||
| - CONTRIBUTING.md with detailed development guidelines | ||
| - CHANGELOG.md for tracking project changes | ||
| - Coverage workflow for both web and react packages in CI | ||
| - Performance tracking utilities (VADPerformanceTracker, PerformanceTimer) | ||
| - Validation utilities for browser compatibility and audio constraints | ||
| - Configurable logging system with log levels | ||
| - Test infrastructure using vitest with coverage reporting | ||
|
|
||
| ### Changed | ||
| - Updated test:coverage script to run for all workspaces | ||
| - Improved React hook to properly handle device changes | ||
| - Updated ESLint and TypeScript configurations for stricter type checking | ||
|
|
||
| ### Removed | ||
| - Dead code and commented-out functions from React package | ||
| - Console.log statements from React package for cleaner production code | ||
|
|
||
| ### Fixed | ||
| - Coverage workflow now properly tests both packages | ||
| - React package properly recreates VAD instance when getStream changes | ||
|
|
||
| ## [0.0.28] - 2024-XX-XX | ||
|
|
||
| ### Added | ||
| - Export new public APIs for validation, logging, and performance tracking | ||
| - TypeScript improvements with stricter type checking | ||
| - Exported `ort` from real-time-vad for advanced usage | ||
|
|
||
| ### Fixed | ||
| - Start on load mic permissions handling | ||
|
|
||
| ## [0.0.27] - Earlier | ||
|
|
||
| Previous versions tracked in git history. See https://github.com/ricky0123/vad for details. | ||
|
|
||
| --- | ||
|
|
||
| ## Types of Changes | ||
|
|
||
| - **Added** for new features | ||
| - **Changed** for changes in existing functionality | ||
| - **Deprecated** for soon-to-be removed features | ||
| - **Removed** for now removed features | ||
| - **Fixed** for any bug fixes | ||
| - **Security** in case of vulnerabilities |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote shell variables to prevent word splitting.
The
${{ matrix.package }}variable should be quoted in shell commands to prevent potential word splitting and globbing issues.Apply this diff:
As per static analysis hints (actionlint/shellcheck).
📝 Committable suggestion
🤖 Prompt for AI Agents