Skip to content

Commit 8653652

Browse files
authored
Merge pull request #395 from boostcampwm-2022/dev
Deploy: 6주차 배포
2 parents 13aa9e3 + 4f727fe commit 8653652

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+1795
-1034
lines changed

.github/workflows/ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ jobs:
3434
- name: Install Dependencies
3535
if: steps.cache.outputs.cache-hit != 'true'
3636
run: npm ci
37+
38+
- name: For CRDT package directory
39+
shell: bash
40+
run: |
41+
cd @wabinar/crdt
42+
npm test
3743
3844
- name: For client directory
3945
run: |

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# ignore secret keys
22
deploy-scripts/vault-secrets
33

4+
# ignore jest test coverage directories
5+
**/coverage
6+
47
# ignore settings for yarn berry zero install
58
.yarn/*
69
!.yarn/cache

@wabinar/api-types/block.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
import { BlockType } from '@wabinar/constants/block';
2+
import LinkedList, {
3+
RemoteDeleteOperation,
4+
RemoteInsertOperation,
5+
} from '@wabinar/crdt/linked-list';
6+
7+
export interface LoadType {
8+
id: string;
9+
}
10+
11+
export interface LoadedType {
12+
type: BlockType;
13+
}
14+
15+
export interface UpdateType {
16+
id: string;
17+
type: BlockType;
18+
}
19+
20+
export interface UpdatedType {
21+
id: string;
22+
type: BlockType;
23+
}
24+
25+
export interface InitText {
26+
id: string;
27+
}
28+
29+
export interface InitializedText {
30+
id: string;
31+
crdt: LinkedList;
32+
}
33+
34+
export interface InsertText {
35+
id: string;
36+
op: RemoteInsertOperation;
37+
}
38+
39+
export interface InsertedText {
40+
id: string;
41+
op: RemoteInsertOperation;
42+
}
43+
44+
export interface DeleteText {
45+
id: string;
46+
op: RemoteDeleteOperation;
47+
}
48+
49+
export interface DeletedText {
50+
id: string;
51+
op: RemoteDeleteOperation;
52+
}
53+
54+
export interface UpdateText {
55+
id: string;
56+
ops: RemoteInsertOperation[];
57+
}
58+
59+
export interface UpdatedText {
60+
id: string;
61+
crdt: LinkedList;
62+
}

@wabinar/api-types/mom.ts

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
import LinkedList, {
2+
RemoteDeleteOperation,
3+
RemoteInsertOperation,
4+
} from '@wabinar/crdt/linked-list';
5+
6+
export type Mom = {
7+
_id: string;
8+
title: string;
9+
createdAt: Date;
10+
};
11+
12+
export interface Created {
13+
mom: Mom;
14+
}
15+
16+
export interface Select {
17+
id: string;
18+
}
19+
20+
export interface Selected {
21+
mom: Mom;
22+
}
23+
24+
export interface UpdateTitle {
25+
title: string;
26+
}
27+
28+
export interface UpdatedTitle {
29+
title: string;
30+
}
31+
32+
export interface Initialized {
33+
crdt: LinkedList;
34+
}
35+
36+
export interface InsertBlock {
37+
blockId: string;
38+
op: RemoteInsertOperation;
39+
}
40+
41+
export interface InsertedBlock {
42+
op: RemoteInsertOperation;
43+
}
44+
45+
export interface DeleteBlock {
46+
blockId: string;
47+
op: RemoteDeleteOperation;
48+
}
49+
50+
export interface DeletedBlock {
51+
op: RemoteDeleteOperation;
52+
}

@wabinar/constants/socket-message.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ export const WORKSPACE_EVENT = {
99
RECEIVE_ANSWER: 'receive-answer',
1010
SEND_ICE: 'send-ice',
1111
RECEIVE_ICE: 'receive-ice',
12-
RECEIVE_BYE: 'receive_bye',
12+
AUDIO_STATE_CHANGED: 'audio-state-changed',
13+
VIDEO_STATE_CHANGED: 'video-state-changed',
14+
SEND_BYE: 'send-bye',
15+
RECEIVE_BYE: 'receive-bye',
16+
EXISTING_ROOM_USERS: 'existing-room-users',
1317
};
1418

1519
export const MOM_EVENT = {
@@ -20,6 +24,8 @@ export const MOM_EVENT = {
2024
INSERT_BLOCK: 'insert-block',
2125
DELETE_BLOCK: 'delete-block',
2226
UPDATED: 'updated-mom',
27+
LOADED: 'loaded-mom',
28+
REQUEST_LOADED: 'request-loaded',
2329
};
2430

2531
export const BLOCK_EVENT = {

@wabinar/crdt/jest.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module.exports = {
22
preset: 'ts-jest', // to use typescript
33
verbose: true,
4-
modulePathIgnorePatterns: ['<rootDir>/dist/'],
4+
collectCoverage: true,
55
};

0 commit comments

Comments
 (0)