Skip to content

Commit

Permalink
Revert "FCE-883 / Bundle webrtc package in ts-client (#186)" (#200)
Browse files Browse the repository at this point in the history
This reverts commit 5e200dd.

## Description

I revert the bundler PR due to finding a problem with resolving types.
Long story short:

1. TSUP allows me to bundle an external package as long as it's a
`dependency`.
2. TSUP's `--dts-resolve` flag for bundling types from external package
works only if the package is a `devDependency` (????)

So I can either bundle js or type definitions. (wtf?)
The documentation of those feature is really poor and I'd rather revert
to use `rollup` or other more mature bundler.
  • Loading branch information
czerwiukk authored Nov 26, 2024
1 parent 5e200dd commit fd8fddd
Show file tree
Hide file tree
Showing 21 changed files with 41 additions and 7,825 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Protoc
uses: arduino/setup-protoc@v3
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install node dependencies
Expand All @@ -48,4 +46,4 @@ jobs:
path: "docs"
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v2
5 changes: 1 addition & 4 deletions .github/workflows/node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- name: Install Protoc
uses: arduino/setup-protoc@v3
cache: 'npm'

- name: Install dependencies ⬇️
run: yarn --immutable
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/playwright.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ jobs:
with:
node-version: 20
cache: npm
- name: Install Protoc
uses: arduino/setup-protoc@v3

- name: Install dependencies ⬇️
run: yarn --immutable

Expand Down
17 changes: 7 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"

- name: Install Protoc
uses: arduino/setup-protoc@v3
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: yarn npm publish --access public
- run: yarn npm publish --access public
working-directory: packages/ts-client
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Expand All @@ -34,11 +31,11 @@ jobs:
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn
- run: yarn build
- run: yarn npm publish --access public
- run: yarn npm publish --access public
working-directory: packages/react-client
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 3 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "packages/protobufs/protos"]
path = packages/protobufs/protos
[submodule "packages/ts-client/protos"]
path = packages/ts-client/protos
url = https://github.com/fishjam-cloud/protos.git
branch = master
1 change: 0 additions & 1 deletion e2e-tests/ts-client/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
"preview": "vite preview"
},
"dependencies": {
"@fishjam-cloud/protobufs": "workspace:*",
"@fishjam-cloud/ts-client": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
8 changes: 3 additions & 5 deletions e2e-tests/ts-client/app/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import type {
BandwidthLimit,
SimulcastConfig,
} from "@fishjam-cloud/ts-client";
import { WebRTCEndpoint, sdkVersion } from "@fishjam-cloud/ts-client";
import { PeerMessage } from "@fishjam-cloud/protobufs/fishjamPeer";
import { WebRTCEndpoint } from "@fishjam-cloud/ts-client";
import { PeerMessage } from "@fishjam-cloud/ts-client/protos";
import { useEffect, useState, useSyncExternalStore } from "react";
import { MockComponent } from "./MockComponent";
import { VideoPlayerWithDetector } from "./VideoPlayerWithDetector";
Expand Down Expand Up @@ -101,9 +101,7 @@ function connect(token: string, metadata: EndpointMetadata) {
websocket.binaryType = "arraybuffer";

function socketOpenHandler(_event: Event) {
const message = PeerMessage.encode({
authRequest: { token, sdkVersion },
}).finish();
const message = PeerMessage.encode({ authRequest: { token } }).finish();
websocket.send(message);
}

Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@
"license": "MIT",
"private": true,
"workspaces": [
"packages/protobufs",
"packages/webrtc-client",
"packages/ts-client",
"packages/react-client",
"packages/webrtc-client",
"examples/ts-client/*",
"examples/react-client/*",
"e2e-tests/ts-client/app",
Expand Down
Loading

0 comments on commit fd8fddd

Please sign in to comment.