Skip to content
Open
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
5 changes: 3 additions & 2 deletions extension/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "extension",
"name": "@cb/extension",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down Expand Up @@ -52,6 +52,7 @@
"concurrently": "^9.1.2",
"postcss": "^8.4.38",
"puppeteer": "^24.1.0",
"tailwindcss": "^3.4.3"
"tailwindcss": "^3.4.3",
"@cb/common": "workspace:*"
}
}
16 changes: 2 additions & 14 deletions extension/src/db/converter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,9 @@ import {
QueryDocumentSnapshot,
SnapshotOptions,
} from "firebase/firestore";
import { Room, PeerConnection } from "@cb/common/firebase";

export interface Room {
questionId: string;
usernames: string[];
}

export interface PeerConnection {
username?: string;

offer?: RTCSessionDescriptionInit;
offerCandidates: RTCIceCandidate[];

answer?: RTCSessionDescriptionInit;
answerCandidates: RTCIceCandidate[];
}
export type { Room, PeerConnection };
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Export for backwards compatibility


export const roomConverter: FirestoreDataConverter<Room, Room> = {
toFirestore: (data: Room) => data,
Expand Down
2 changes: 1 addition & 1 deletion firebase/functions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "functions",
"name": "@cb/functions",
"private": true,
"version": "0.0.0",
"type": "module",
Expand Down
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"devDependencies": {
"@eslint/js": "^9.22.0",
"@tsconfig/node22": "^22.0.1",
"@typescript-eslint/eslint-plugin": "^8.26.1",
"eslint": "^9.22.0",
"eslint-plugin-react": "^7.37.4",
Expand All @@ -17,7 +18,8 @@
},
"scripts": {
"prepare": "husky",
"test": "pnpm vitest"
"test": "pnpm vitest",
"build": "pnpm run -r build"
},
"lint-staged": {
"*.{ts,tsx,md,html,css}": [
Expand Down
16 changes: 16 additions & 0 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "@cb/common",
"private": true,
"version": "0.0.0",
"exports": {
"./firebase": {
"import": "./dist/firebase/index.js",
"types": "./dist/firebase/index.d.ts"
}
},
"scripts": {
"build": "tsc"
},
"depedencies": {},
"devDependencies": {}
}
16 changes: 16 additions & 0 deletions packages/common/src/firebase/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
export interface Room {
questionId: string;
usernames: string[];
}

export interface PeerConnection {
username?: string;

offer?: RTCSessionDescriptionInit;
offerCandidates: RTCIceCandidate[];

answer?: RTCSessionDescriptionInit;
answerCandidates: RTCIceCandidate[];
}

export {};
Empty file.
8 changes: 8 additions & 0 deletions packages/common/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"compilerOptions": {
"outDir": "dist",
"declaration": true,
"lib": ["DOM", "ES2022"]
},
"extends": ["@tsconfig/node22/tsconfig.json"]
}
Loading