Skip to content

Commit

Permalink
初期ファイル追加
Browse files Browse the repository at this point in the history
  • Loading branch information
voluntas committed Jan 10, 2025
1 parent de2101f commit 4a097f4
Show file tree
Hide file tree
Showing 33 changed files with 4,491 additions and 131 deletions.
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 設定については README.md を参照してください
VITE_SORA_SIGNALING_URL=
VITE_SORA_CHANNEL_ID_PREFIX=
VITE_SECRET_KEY=
20 changes: 20 additions & 0 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependency Review Action
#
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging.
#
# Source repository: https://github.com/actions/dependency-review-action
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement
name: 'Dependency Review'
on: [pull_request]

permissions:
contents: read

jobs:
dependency-review:
runs-on: ubuntu-24.04
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v4
- name: 'Dependency Review'
uses: actions/dependency-review-action@v4
75 changes: 75 additions & 0 deletions .github/workflows/e2e-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: e2e-test

on:
push:
branches:
- main
- feature/*
paths-ignore:
- "**.md"
- "LICENSE"
- "NOTICE"
schedule:
# UTC 時間で毎日 2:00 (JST で 11:00) に実行、月曜日から金曜日
- cron: "0 2 * * 1-5"

jobs:
e2e-test:
timeout-minutes: 20
runs-on: ubuntu-24.04
strategy:
matrix:
node: ["20", "22", "23"]
# browser: ["chromium", "firefox", "webkit"]
browser: ["chromium"]
env:
VITE_SORA_SIGNALING_URL: ${{ secrets.TEST_SIGNALING_URL }}
VITE_SORA_CHANNEL_ID_PREFIX: ${{ secrets.TEST_CHANNEL_ID_PREFIX }}
VITE_SECRET_KEY: ${{ secrets.TEST_SECRET_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- uses: pnpm/action-setup@v4
- run: pnpm --version
- run: pnpm install
- run: pnpm exec playwright install ${{ matrix.browser }} --with-deps
- run: pnpm exec playwright test --project=${{ matrix.browser }}
env:
VITE_SORA_CHANNEL_ID_SUFFIX: _${{ matrix.node }}
# - uses: actions/upload-artifact@v4
# if: always()
# with:
# name: playwright-report
# path: playwright-report/
# retention-days: 30

# slack_notify_succeeded:
# needs: [e2e-test]
# runs-on: ubuntu-24.04
# if: success()
# steps:
# - name: Slack Notification
# if: success()
# uses: rtCamp/action-slack-notify@v2
# env:
# SLACK_CHANNEL: sora-js-sdk
# SLACK_COLOR: good
# SLACK_TITLE: Succeeded
# SLACK_ICON_EMOJI: ":star-struck:"
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
slack_notify_failed:
needs: [e2e-test]
runs-on: ubuntu-24.04
if: failure()
steps:
- name: Slack Notification
if: failure()
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: sora-js-sdk
SLACK_COLOR: danger
SLACK_TITLE: Failed
SLACK_ICON_EMOJI: ":japanese_ogre:"
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
142 changes: 12 additions & 130 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,130 +1,12 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
node_modules
dist/

# .env
.env*
!.env.template

# playwright
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
49 changes: 48 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,48 @@
# sora-js-sdk-examples
# Sora JavaScript SDK サンプル

## 使い方

```bash
$ git clone [email protected]:shiguredo/sora-js-sdk-examples.git
$ cd sora-js-sdk-examples
# .env.local を作成して適切な値を設定してください
$ cp .env.template .env.local
$ pnpm install
$ pnpm dev
```

### Sora Labo を利用する場合の .env.local の設定

```bash
# Sora Labo の Signaling URL を指定してください
VITE_SORA_SIGNALING_URL=wss://sora.sora-labo.shiguredo.app/signaling
# Sora Labo にログインした GitHub ログイン名と GitHub ID を指定してください
# {GitHubLoginName}_{GitHubID}_ の用に指定してください
VITE_SORA_CHANNEL_ID_PREFIX={GitHubLoginName}_{GitHubId}_
# Sora Labo の Secret Key を指定してください
VITE_SECRET_KEY=SecretKey
```

### Sora Cloud を利用する場合の .env.local の設定

```bash
# Sora Cloud の Signaling URL を指定してください
VITE_SORA_SIGNALING_URL=wss://sora.sora-cloud.shiguredo.app/signaling
# Sora Cloud のプロジェクト ID + @ を指定してください
VITE_SORA_CHANNEL_ID_PREFIX={ProjectId}@
# Sora Cloud の API Key を指定してください
VITE_SECRET_KEY=SecretKey
```

### Sora を利用する場合の .env.local の設定

```bash
# Sora の Signaling URL を指定してください
VITE_SORA_SIGNALING_URL=wss://sora.example.com/signaling
# 好きな文字列を指定してください
VITE_SORA_CHANNEL_ID_PREFIX=example
# 設定不要です
VITE_SECRET_KEY=
```

## ライセンス
34 changes: 34 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"organizeImports": {
"enabled": true
},
"files": {
"include": ["*.mjs", "*.mts", "*.ts", "*.json", "*.jsonc"]
},
"linter": {
"enabled": true,
"rules": {
"recommended": true
}
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"json": {
"parser": {
"allowComments": true
},
"formatter": {
"enabled": true,
"indentStyle": "space"
}
},
"javascript": {
"formatter": {
"enabled": true,
"indentStyle": "space"
}
}
}
54 changes: 54 additions & 0 deletions check_stereo/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<html lang="ja">

<head>
<meta charset="utf-8">
<title>Stereo Check シンプルサンプル</title>

<style>
button {
margin: 15px 0;
padding: 10px 20px;
font-size: 16px;
}
</style>
</head>

<body>
<h2>Stereo Check サンプル</h2>
<div class="container">
<h2>Sendonly</h2>
<!-- 音声入力デバイス選択を追加 -->
<div>
<label for="sendonly-audio-input">音声入力デバイス:</label>
<select id="sendonly-audio-input"></select>
</div>
<button id="sendonly-connect">connect</button>
<div id="sendonly-connection-id"></div>
<div>
<h3>Waveform</h3>
<div id="sendonly-channels"></div>
<div id="sendonly-difference-value"></div>
<canvas id="sendonly-waveform" width="800" height="400"></canvas>
</div>
</div>
<div class="container">
<h2>Recvonly</h2>
<div>
<label>
<input type="checkbox" id="forceStereoOutput" name="forceStereoOutput"> forceStereoOutput
</label>
</div>
<button id="recvonly-connect">connect</button>
<div id="recvonly-connection-id"></div>
<div>
<h3>Waveform</h3>
<div id="recvonly-difference-value"></div>
<canvas id="recvonly-waveform" width="800" height="400"></canvas>
</div>
<audio id="recvonly-audio" controls autoplay muted></audio>
</div>

<script type="module" src="./main.ts"></script>
</body>

</html>
Loading

0 comments on commit 4a097f4

Please sign in to comment.