Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

New version 🎉 #704

Merged
merged 31 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
8fa91af
feat: move drawing events to own channel
Raspincel Jun 12, 2024
81f689e
fix: broken room state services
Raspincel Jun 12, 2024
9004cb9
fix: resolve annotation for all participants in room
Raspincel Jun 12, 2024
4d91df3
Merge pull request #691 from SuperViz/feat/drawing-channel
carlossantos74 Jun 12, 2024
452d851
Merge pull request #692 from SuperViz/fix/resolve-annotation-for-all
carlossantos74 Jun 12, 2024
8570088
chore(deps): update all packages to latest
carlossantos74 Jun 23, 2024
79b5a52
ci: update runtime version
carlossantos74 Jun 23, 2024
7bb0ef7
chore(deps): fix web components test runner versions
carlossantos74 Jun 23, 2024
254fb72
chore(build config): update watch config
carlossantos74 Jun 23, 2024
30db5e8
refactor: remove totally ably dependency
carlossantos74 Jun 23, 2024
6c7ad48
feat: observer and handle ioc connection states
carlossantos74 Jun 23, 2024
b2778e1
Merge pull request #693 from SuperViz/core/removing-ably
Raspincel Jun 24, 2024
809faf2
fix: clear set participant interval when receives new host from room …
carlossantos74 Jun 24, 2024
2ca4ad5
Merge pull request #694 from SuperViz/fix/kick-participant-interval
carlossantos74 Jun 24, 2024
21233c2
fix: uncomment and fix test
Raspincel Jun 25, 2024
4f50d97
Merge pull request #695 from SuperViz/fix/commented-test
carlossantos74 Jun 25, 2024
44ced67
fix: add suport to ESM entrypoint and build it in separated chunks
carlossantos74 Jun 25, 2024
4ca7010
Merge pull request #696 from SuperViz/fix/kick-participant-interval
carlossantos74 Jun 26, 2024
fac1ccb
fix: mimify build files
carlossantos74 Jun 26, 2024
930ee27
Merge pull request #697 from SuperViz/fix/kick-participant-interval
carlossantos74 Jun 26, 2024
ba408d2
fix: remove many entrypoints and build based on index
carlossantos74 Jun 26, 2024
c479264
Merge pull request #698 from SuperViz/fix/kick-participant-interval
carlossantos74 Jun 26, 2024
0bdf132
feat: improve esm build
carlossantos74 Jun 27, 2024
10ad452
fix: watch options
carlossantos74 Jun 27, 2024
696136e
Merge pull request #699 from SuperViz/fix/kick-participant-interval
carlossantos74 Jun 27, 2024
c82856a
fix: esm entrypoints
carlossantos74 Jul 1, 2024
b3c453c
Merge pull request #700 from SuperViz/fix/kick-participant-interval
carlossantos74 Jul 1, 2024
d4e25af
fix: local remote config file load
carlossantos74 Jul 1, 2024
5845883
Merge pull request #702 from SuperViz/fix/kick-participant-interval
carlossantos74 Jul 1, 2024
43522ef
fix: retrieve user list from store to validade if room has host
carlossantos74 Jul 3, 2024
b3a06f3
Merge pull request #703 from SuperViz/fix/kick-participant-interval
carlossantos74 Jul 3, 2024
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
29 changes: 17 additions & 12 deletions .esbuild/build.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
const baseConfig = require('./config');
const { cjsConfig, esmConfig } = require('./config');
const esbuild = require('esbuild');

const config = Object.assign({}, baseConfig, {
minify: true,
drop: ['debugger', 'console'],
});
(async () => {
try {
await Promise.all([
esbuild.build({
...cjsConfig,
outfile: 'lib/index.cjs.js',
}),

require('esbuild')
.build({
...config,
outfile: 'lib/index.js',
})
.catch((error) => {
esbuild.build({
...esmConfig,
outdir: 'lib',
}),
]);
} catch (error) {
console.error(error);
process.exit(1);
});
}
})();
41 changes: 37 additions & 4 deletions .esbuild/config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
require('dotenv').config();
const { style } = require('./plugins/style-loader');
const glob = require('glob');

const entryPoints = glob
.sync('./src/**/*.ts')
.filter((file) => !file.endsWith('.d.ts') && !file.endsWith('.test.ts'));

const entries = Object.entries(process.env).filter((key) => key[0].startsWith('SDK_'));
const env = Object.fromEntries(entries);

module.exports = {
entryPoints: ['./src/index.ts'],
const config = {
loader: {
'.png': 'file',
'.svg': 'file',
Expand All @@ -16,9 +20,38 @@ module.exports = {
},
plugins: [style()],
bundle: true,
target: 'es6',
format: 'esm',
color: true,
minify: true,
logLevel: 'info',
sourcemap: true,
chunkNames: 'chunks/[name]-[hash]',
define: {
'process.env': JSON.stringify(env),
},
};

const esmConfig = {
...config,
entryPoints: ['src/index.ts'],
bundle: true,
sourcemap: true,
minify: true,
splitting: true,
format: 'esm',
define: { global: 'window', 'process.env': JSON.stringify(env) },
};

const cjsConfig = {
...config,
entryPoints: ['src/index.ts'],
bundle: true,
sourcemap: true,
minify: true,
platform: 'node',
target: ['node16'],
};

module.exports = {
esmConfig,
cjsConfig,
};
31 changes: 20 additions & 11 deletions .esbuild/watch.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
const baseConfig = require('./config');
const { cjsConfig, esmConfig } = require('./config');
const esbuild = require('esbuild');

const config = Object.assign({}, baseConfig, {
watch: true,
});
(async () => {
try {
const [cjsContext, esmContext] = await Promise.all([
esbuild.context({
...cjsConfig,
outfile: 'dist/index.cjs.js',
}),

require('esbuild')
.build({
...config,
outfile: 'dist/index.js',
})
.catch((error) => {
esbuild.context({
...esmConfig,
outdir: 'dist',
}),
]);

cjsContext.watch();
esmContext.watch();
} catch (error) {
console.error(error);
process.exit(1);
});
}
})();
6 changes: 3 additions & 3 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
- name: Create a .version.js file
Expand All @@ -42,7 +42,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
- name: Create a .version.js file
Expand All @@ -62,7 +62,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
- name: Create a .version.js file
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-beta-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-lab-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-prod-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: '18.x'
node-version: '20.x'
- name: Install dependencies
run: yarn install
env:
Expand Down
8 changes: 8 additions & 0 deletions __mocks__/io.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ import { jest } from '@jest/globals';
import { Room } from '@superviz/socket-client';

export const MOCK_IO = {
ClientState: {
CONNECTED: 'CONNECTED',
CONNECTING: 'CONNECTING',
DISCONNECTED: 'DISCONNECTED',
CONNECTION_ERROR: 'CONNECTION_ERROR',
RECONNECTING: 'RECONNECTING',
RECONNECT_ERROR: 'RECONNECT_ERROR',
},
PresenceEvents: {
JOINED_ROOM: 'presence.joined-room',
LEAVE: 'presence.leave',
Expand Down
12 changes: 0 additions & 12 deletions __mocks__/participants.mock.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Avatar, Group, Participant } from '../src';
import { MeetingColors, MeetingColorsHex } from '../src/common/types/meeting-colors.types';
import { ParticipantByGroupApi } from '../src/common/types/participant.types';
import { AblyParticipant } from '../src/services/realtime/ably/types';

export const MOCK_AVATAR: Avatar = {
imageUrl: 'unit-test-avatar-thumbnail.png',
Expand Down Expand Up @@ -50,17 +49,6 @@ export const MOCK_ABLY_PARTICIPANT_DATA_2 = {
color: MeetingColorsHex[1],
};

export const MOCK_ABLY_PARTICIPANT: AblyParticipant = {
extras: null,
clientId: MOCK_LOCAL_PARTICIPANT.id,
action: 'present',
connectionId: 'connection1',
encoding: 'h264',
id: 'unit-test-participant1-ably-id',
timestamp: new Date().getTime(),
data: MOCK_ABLY_PARTICIPANT_DATA_1,
};

export const MOCK_PARTICIPANT_LIST: ParticipantByGroupApi[] = [
{
id: 'unit-test-participant1-id',
Expand Down
78 changes: 0 additions & 78 deletions __mocks__/realtime.mock.ts

This file was deleted.

51 changes: 27 additions & 24 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"description": "SuperViz SDK",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
"import": "./lib/index.js",
"require": "./lib/index.cjs.js"
},
"files": [
"lib"
],
Expand Down Expand Up @@ -39,55 +43,54 @@
},
"homepage": "https://github.com/SuperViz/sdk#readme",
"devDependencies": {
"@commitlint/cli": "^18.0.0",
"@commitlint/config-conventional": "^18.0.0",
"@commitlint/cli": "^19.3.0",
"@commitlint/config-conventional": "^19.2.2",
"@esm-bundle/chai": "^4.3.4-fix.0",
"@jest/globals": "^29.7.0",
"@open-wc/testing-helpers": "^2.3.0",
"@types/debug": "^4.1.10",
"@types/jest": "^29.5.6",
"@types/lodash.isequal": "^4.5.6",
"@types/luxon": "^3.3.3",
"@types/node": "^20.8.8",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@open-wc/testing-helpers": "^3.0.1",
"@types/debug": "^4.1.12",
"@types/jest": "^29.5.12",
"@types/lodash.isequal": "^4.5.8",
"@types/luxon": "^3.4.2",
"@types/node": "^20.14.8",
"@typescript-eslint/eslint-plugin": "^7.13.1",
"@typescript-eslint/parser": "^7.13.1",
"@web/dev-server-esbuild": "^0.4.3",
"@web/dev-server-import-maps": "^0.2.0",
"@web/dev-server-legacy": "^2.0.3",
"@web/test-runner": "^0.17.2",
"@web/test-runner-playwright": "^0.10.2",
"concurrently": "^7.2.2",
"concurrently": "^8.2.2",
"cz-conventional-changelog": "^3.3.0",
"dotenv": "^16.0.1",
"esbuild": "^0.14.48",
"eslint": "^8.52.0",
"dotenv": "^16.4.5",
"esbuild": "^0.21.5",
"eslint": "^9.5.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.0",
"husky": "^8.0.3",
"eslint-plugin-import": "^2.29.1",
"husky": "^9.0.11",
"jest": "^29.7.0",
"jest-browser-globals": "^25.1.0-beta",
"jest-canvas-mock": "^2.5.2",
"jest-environment-jsdom": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"rimraf": "^5.0.5",
"semantic-release": "^22.0.5",
"ts-jest": "^29.1.2",
"rimraf": "^5.0.7",
"semantic-release": "^24.0.0",
"ts-jest": "^29.1.5",
"tsc": "^2.0.4",
"typescript": "^5.2.2",
"typescript": "^5.5.2",
"yargs": "^17.7.2"
},
"dependencies": {
"@superviz/socket-client": "1.5.1",
"ably": "^1.2.45",
"@superviz/socket-client": "1.8.0",
"bowser": "^2.11.0",
"bowser-jr": "^1.0.6",
"debug": "^4.3.4",
"lit": "^3.0.0",
"lit": "^3.1.4",
"lodash": "^4.17.21",
"lodash.debounce": "^4.0.8",
"lodash.isequal": "^4.5.0",
"luxon": "^3.4.3",
"luxon": "^3.4.4",
"rxjs": "^7.8.1",
"semantic-release-version-file": "^1.0.2"
},
Expand Down
Loading
Loading