Skip to content

Commit

Permalink
Merge pull request #577 from shiguredo/feature/remove-pnpm-workspace
Browse files Browse the repository at this point in the history
pnpm workspace を examples のみにする
  • Loading branch information
voluntas authored Dec 15, 2024
2 parents 505be40 + b8b8cf3 commit 80715e8
Show file tree
Hide file tree
Showing 39 changed files with 117 additions and 141 deletions.
12 changes: 6 additions & 6 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# テストに利用する Sora の Signaling URL を指定してください
# サンプルやテストに利用する Sora の Signaling URL を指定してください
VITE_SORA_SIGNALING_URL=ws://127.0.0.1:5000/signaling
# テストに利用する Sora の ChannelID のプレフィックスを指定してください
VITE_SORA_CHANNEL_ID_PREFIX=sora-js-sdk-e2e-test_
# テストに利用する Sora の API URL を指定ください、不要であれば空欄で大丈夫です
# サンプルやテストに利用する Sora の ChannelID のプレフィックスを指定してください
VITE_SORA_CHANNEL_ID_PREFIX=sora-js-sdk_
# サンプルやテストに利用する Sora の API URL を指定ください、不要であれば空欄で大丈夫です
VITE_SORA_API_URL=http://127.0.0.1:5000/
# テストに利用するアクセストークンを指定してください、不要であれば空欄で大丈夫です
VITE_ACCESS_TOKEN=access_token
# サンプルやテストに利用するアクセストークンを指定してください、不要であれば空欄で大丈夫です
VITE_ACCESS_TOKEN=access_token
1 change: 0 additions & 1 deletion .github/workflows/npm-pkg-e2e-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ jobs:
"2021.1.7",
]
node: ["18", "20", "22"]
# node: ["18"]
# browser: ["chromium", "firefox", "webkit"]
browser: ["chromium"]
env:
Expand Down
13 changes: 11 additions & 2 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,26 @@

### misc

- [UPDATE] パッケージ E2E テストに 2024.2.2 / 2024.2.0 / 2021.1.7 を追加する
- @voluntas
- [ADD] E2E テストに `"type": "close"` のテストを追加する
- @voluntas
- [ADD] E2E テストに `"type": "switched"` のテストを追加する
- @voluntas
- [CHANGE] tsconfig.json の target と module を ES2022 に変更する
- @voluntas
- [CHANGE] examples 以下専用の vite.config.mjs を用意する
- pnpm run dev は vite --config examples/vite.config.mjs を実行するようにする
- @voluntas
- [CHANGE] tests/ 以下を vitest と playwright に分ける
- @voluntas
- [CHANGE] pnpm workspace の packages を辞めて src に切り替える
- @voluntas
- [CHANGE] canary リリース方法を `canary.py` に変更する
- `release_canary.sh` は削除
- @voluntas
- [FIX] パッケージの E2E テストを修正する
- @voluntas
- [UPDATE] パッケージ E2E テストに 2024.2.2 / 2024.2.0 / 2021.1.7 を追加する
- @voluntas

## 2024.2.2

Expand Down
14 changes: 6 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,10 @@ Please read <https://github.com/shiguredo/oss> before use.

使い方は [Sora JavaScript SDK ドキュメント](https://sora-js-sdk.shiguredo.jp/) を参照してください。

- sora.min.js
- <https://www.jsdelivr.com/package/npm/sora-js-sdk>

## システム条件

- WebRTC SFU Sora 2023.2.0 以降
- TypeScript 5.6 以降
- WebRTC SFU Sora 2024.1.0 以降
- TypeScript 5.7 以降

### 注意

Expand Down Expand Up @@ -111,18 +108,19 @@ limitations under the License.
- [Sora JavaScript SDK](https://github.com/shiguredo/sora-javascript-sdk)
- [Sora JavaScript SDK ドキュメント](https://sora-js-sdk.shiguredo.jp/)
- [Sora iOS SDK](https://github.com/shiguredo/sora-ios-sdk)
- [Sora iOS SDK ドキュメント](https://sora-ios-sdk.shiguredo.jp/)
- [Sora iOS SDK クイックスタート](https://github.com/shiguredo/sora-ios-sdk-quickstart)
- [Sora iOS SDK サンプル集](https://github.com/shiguredo/sora-ios-sdk-samples)
- [Sora iOS SDK ドキュメント](https://sora-ios-sdk.shiguredo.jp/)
- [Sora Android SDK](https://github.com/shiguredo/sora-android-sdk)
- [Sora Android SDK ドキュメント](https://sora-android-sdk.shiguredo.jp/)
- [Sora Android SDK クイックスタート](https://github.com/shiguredo/sora-android-sdk-quickstart)
- [Sora Android SDK サンプル集](https://github.com/shiguredo/sora-android-sdk-samples)
- [Sora Android SDK ドキュメント](https://sora-android-sdk.shiguredo.jp/)
- [Sora Unity SDK](https://github.com/shiguredo/sora-unity-sdk)
- [Sora Unity SDK サンプル集](https://github.com/shiguredo/sora-unity-sdk-samples)
- [Sora Unity SDK ドキュメント](https://sora-unity-sdk.shiguredo.jp/)
- [Sora Unity SDK サンプル集](https://github.com/shiguredo/sora-unity-sdk-samples)
- [Sora Python SDK](https://github.com/shiguredo/sora-python-sdk)
- [Sora Python SDK ドキュメント](https://sora-python-sdk.shiguredo.jp/)
- [Sora Python SDK サンプル集](https://github.com/shiguredo/sora-python-sdk-samples)
- [Sora C++ SDK](https://github.com/shiguredo/sora-cpp-sdk)
- [Sora C SDK](https://github.com/shiguredo/sora-c-sdk)

Expand Down
39 changes: 39 additions & 0 deletions examples/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { resolve } from 'node:path'
import { defineConfig } from 'vite'

// root が examples なので examples/dist にビルドされる

export default defineConfig({
root: resolve(__dirname),
resolve: {
// NPM_PKG_E2E_TEST が true の時は alias を無効化する
// これは .github/workflows/npm-pkg-e2e-test.yml で、
// E2E テストで複数のバージョンの npm の sora-js-sdk をインストールして利用するため
alias: process.env.NPM_PKG_E2E_TEST
? {}
: {
'sora-js-sdk': resolve(__dirname, '../dist/sora.mjs'),
},
},
build: {
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
sendrecv: resolve(__dirname, 'sendrecv/index.html'),
sendonly: resolve(__dirname, 'sendonly/index.html'),
recvonly: resolve(__dirname, 'recvonly/index.html'),
check_stereo: resolve(__dirname, 'check_stereo/index.html'),
check_stereo_multi: resolve(__dirname, 'check_stereo_multi/index.html'),
replace_track: resolve(__dirname, 'replace_track/index.html'),
simulcast: resolve(__dirname, 'simulcast/index.html'),
spotlight_sendrecv: resolve(__dirname, 'spotlight_sendrecv/index.html'),
spotlight_sendonly: resolve(__dirname, 'spotlight_sendonly/index.html'),
spotlight_recvonly: resolve(__dirname, 'spotlight_recvonly/index.html'),
sendonly_audio: resolve(__dirname, 'sendonly_audio/index.html'),
messaging: resolve(__dirname, 'messaging/index.html'),
data_channel_signaling_only: resolve(__dirname, 'data_channel_signaling_only/index.html'),
},
},
},
envDir: resolve(__dirname, '..'),
})
14 changes: 8 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
}
},
"scripts": {
"dev": "vite",
"examples": "vite build",
"build": "vite build",
"watch": "vite build --watch",
"dev": "vite --config examples/vite.config.mjs",
"e2e-test": "pnpm run build && playwright test --project=chromium",
"build": "pnpm -r --filter=./packages/* build",
"lint": "biome lint",
"fmt": "biome format --write",
"test": "pnpm -r --filter=./packages/* test",
"check": "pnpm -r --filter=./packages/* --filter=./examples check",
"check": "tsc --noEmit",
"test": "vitest run",
"doc": "typedoc"
},
"repository": {
Expand All @@ -40,11 +40,13 @@
"@playwright/test": "1.49.1",
"typedoc": "0.27.5",
"typescript": "5.7.2",
"jsdom": "25.0.1",
"vite-plugin-dts": "4.3.0",
"vite": "6.0.3",
"vitest": "2.1.8"
},
"packageManager": "[email protected]",
"engines": {
"node": ">=18"
}
}
}
15 changes: 0 additions & 15 deletions packages/sdk/package.json

This file was deleted.

8 changes: 0 additions & 8 deletions packages/sdk/tsconfig.json

This file was deleted.

43 changes: 0 additions & 43 deletions packages/sdk/vite.config.mjs

This file was deleted.

2 changes: 1 addition & 1 deletion playwright.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineConfig, devices } from '@playwright/test'
// pnpm exec playwright test --ui

export default defineConfig({
testDir: 'tests',
testDir: 'tests/playwright',
// fullyParallel: true,
reporter: 'html',
use: {
Expand Down
15 changes: 6 additions & 9 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
packages:
- "packages/*"
- "examples"
- "examples"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions packages/sdk/src/types.ts → src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import type {
TRANSPORT_TYPE_WEBSOCKET,
} from './constants'

// declare const __SORA_JS_SDK_VERSION__: string

export type JSONType =
| null
| boolean
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { expect, test } from 'vitest'
import type { AudioCodecType, DataChannelDirection, VideoCodecType } from '../src/types'
import { createSignalingMessage } from '../src/utils'
import type { AudioCodecType, DataChannelDirection, VideoCodecType } from '../../src/types'
import { createSignalingMessage } from '../../src/utils'

const channelId = '7N3fsMHob'
const metadata = 'PG9A6RXgYqiqWKOVO'
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "ES2020",
"target": "ES2022",
"module": "ES2022",
"strict": true,
"declaration": true,
"strictNullChecks": true,
Expand All @@ -16,5 +16,6 @@
"types": [],
"lib": ["esnext", "dom", "dom.iterable", "scripthost"]
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules", "tests"]
}
61 changes: 31 additions & 30 deletions vite.config.mjs
Original file line number Diff line number Diff line change
@@ -1,42 +1,43 @@
import { resolve } from 'node:path'
import { defineConfig } from 'vite'
import dts from 'vite-plugin-dts'
import pkg from './package.json'

// root が examples なので examples/dist にビルドされる

const banner = `/**
* ${pkg.name}
* ${pkg.description}
* @version: ${pkg.version}
* @author: ${pkg.author}
* @license: ${pkg.license}
**/
`
export default defineConfig({
root: resolve(__dirname, 'examples'),
resolve: {
// NPM_PKG_E2E_TEST が true の時は alias を無効化する
// これは .github/workflows/npm-pkg-e2e-test.yml で、
// E2E テストで複数のバージョンの npm の sora-js-sdk をインストールして利用するため
alias: process.env.NPM_PKG_E2E_TEST
? {}
: {
'sora-js-sdk': resolve(__dirname, 'dist/sora.mjs'),
},
define: {
__SORA_JS_SDK_VERSION__: JSON.stringify(pkg.version),
},
root: process.cwd(),
build: {
minify: 'esbuild',
target: 'es2020',
emptyOutDir: true,
manifest: true,
outDir: resolve(__dirname, './dist'),
lib: {
entry: resolve(__dirname, 'src/sora.ts'),
name: 'WebRTC SFU Sora JavaScript SDK',
formats: ['es'],
fileName: 'sora',
},
rollupOptions: {
input: {
index: resolve(__dirname, 'examples/index.html'),
sendrecv: resolve(__dirname, 'examples/sendrecv/index.html'),
sendonly: resolve(__dirname, 'examples/sendonly/index.html'),
recvonly: resolve(__dirname, 'examples/recvonly/index.html'),
check_stereo: resolve(__dirname, 'examples/check_stereo/index.html'),
check_stereo_multi: resolve(__dirname, 'examples/check_stereo_multi/index.html'),
replace_track: resolve(__dirname, 'examples/replace_track/index.html'),
simulcast: resolve(__dirname, 'examples/simulcast/index.html'),
spotlight_sendrecv: resolve(__dirname, 'examples/spotlight_sendrecv/index.html'),
spotlight_sendonly: resolve(__dirname, 'examples/spotlight_sendonly/index.html'),
spotlight_recvonly: resolve(__dirname, 'examples/spotlight_recvonly/index.html'),
sendonly_audio: resolve(__dirname, 'examples/sendonly_audio/index.html'),
messaging: resolve(__dirname, 'examples/messaging/index.html'),
data_channel_signaling_only: resolve(
__dirname,
'examples/data_channel_signaling_only/index.html',
),
output: {
banner: banner,
},
},
},
envDir: resolve(__dirname, './'),
plugins: [
dts({
include: ['src/**/*'],
}),
],
})
Loading

0 comments on commit 80715e8

Please sign in to comment.