Skip to content

Commit

Permalink
Merge pull request #109 from SuperViz/lab
Browse files Browse the repository at this point in the history
Oct Update - Beta #2
  • Loading branch information
carlossantos74 authored Oct 23, 2024
2 parents 5ce3ead + 0adbbdc commit cd70da7
Show file tree
Hide file tree
Showing 11 changed files with 37 additions and 10 deletions.
3 changes: 2 additions & 1 deletion packages/autodesk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/autodesk-viewer-plugin",
"version": "1.22.1-beta.1",
"version": "1.22.2-lab.1",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand All @@ -27,6 +27,7 @@
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch",
"prepack": "pnpm build",
"semantic-release": "semantic-release"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/matterport/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/matterport-plugin",
"version": "1.2.1-beta.1",
"version": "1.2.2-lab.1",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand All @@ -26,6 +26,7 @@
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch",
"prepack": "pnpm build",
"semantic-release": "semantic-release"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
{
"name": "@superviz/react-sdk",
"private": false,
"version": "1.14.1-beta.1",
"version": "1.14.2-lab.1",
"type": "module",
"scripts": {
"watch": "./node_modules/typescript/bin/tsc && vite build --watch",
"build": "./node_modules/typescript/bin/tsc && vite build && cp package.json dist/package.json && cp README.md dist/README.md",
"prepack": "pnpm build",
"lint": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
"lint:fix": "eslint --fix 'src/**/*.{jsx,ts,tsx}'",
"format": "prettier --write src//**/*.{ts,tsx,css} --config ./.prettierrc",
Expand Down
3 changes: 2 additions & 1 deletion packages/realtime/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/realtime",
"version": "1.2.1-beta.1",
"version": "1.2.2-lab.2",
"description": "SuperViz Real-Time",
"main": "./dist/node/index.cjs.js",
"module": "./dist/browser/index.js",
Expand Down Expand Up @@ -31,6 +31,7 @@
"watch": "concurrently -n code,types \"pnpm run watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch --outDir ./dist",
"prepack": "pnpm build",
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"test:unit:coverage": "jest --coverage",
Expand Down
11 changes: 10 additions & 1 deletion packages/realtime/src/services/channel/channel.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { LIMITS_MOCK } from '../../../__mocks__/limits.mock';
import { MOCK_OBSERVER_HELPER } from '../../../__mocks__/observer-helper.mock';
import { MOCK_LOCAL_PARTICIPANT } from '../../../__mocks__/participants.mock';
import { RealtimeChannelState } from '../../component/types';
import { IOC } from '../io';

import { Channel } from './channel';
import { RealtimeChannelState } from '../../component/types';

jest.useFakeTimers();

Expand Down Expand Up @@ -77,6 +77,15 @@ describe('Realtime Channel', () => {

expect(spy).toHaveBeenCalled();
});

test('should reset an event if no callback is provided', () => {
ChannelInstance['observers']['test'] = MOCK_OBSERVER_HELPER;
const spy = jest.spyOn(ChannelInstance['observers']['test'], 'reset' as any);

ChannelInstance.unsubscribe('test');

expect(spy).toHaveBeenCalled();
});
});

describe('subscribeToRealtimeEvents', () => {
Expand Down
5 changes: 5 additions & 0 deletions packages/realtime/src/services/channel/channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,11 @@ export class Channel extends Observable {
event: string,
callback?: Callback<T>,
): void => {
if (!callback) {
this.observers[event]?.reset();
return;
}

this.observers[event]?.unsubscribe(callback);
};

Expand Down
3 changes: 2 additions & 1 deletion packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/sdk",
"version": "6.7.1-beta.1",
"version": "6.7.2-lab.2",
"description": "SuperViz SDK",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -17,6 +17,7 @@
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch --outDir ./dist",
"prepack": "pnpm build",
"test:unit": "jest",
"test:unit:watch": "jest --watch",
"test:unit:coverage": "jest --coverage",
Expand Down
7 changes: 6 additions & 1 deletion packages/sdk/src/services/remote-config-service/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { version } from '../../../package.json';
import { RemoteConfigParams } from '../../common/types/remote-config.types';
import { EnvironmentTypes } from '../../common/types/sdk-options.types';
import { doRequest } from '../../common/utils';
Expand All @@ -22,10 +21,16 @@ export default class RemoteConfigService {
const all = await import('../../../.remote-config.js');
return all.default.remoteConfig;
}

const { version } = await import('../../../package.json');

console.log(`[SuperViz] - v.${version}`);

const remoteConfigParams: RemoteConfigParams = {
version,
environment,
};

const url = this.createUrl(remoteConfigParams);
return doRequest(url, 'GET', null) as Promise<RemoteConfig>;
}
Expand Down
3 changes: 2 additions & 1 deletion packages/socket-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/socket-client",
"version": "1.13.1-beta.1",
"version": "1.13.2-lab.4",
"description": "SuperViz Socket Client",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -15,6 +15,7 @@
"scripts": {
"build": "node ./.esbuild/build.js",
"postbuild": "./node_modules/typescript/bin/tsc --emitDeclarationOnly --declaration",
"prepack": "pnpm build",
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch --outDir dist",
Expand Down
3 changes: 2 additions & 1 deletion packages/three/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/threejs-plugin",
"version": "1.2.1-beta.1",
"version": "1.2.2-lab.1",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
Expand All @@ -23,6 +23,7 @@
"scripts": {
"build": "node ./.esbuild/build.js",
"postbuild": "./node_modules/typescript/bin/tsc",
"prepack": "pnpm build",
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
"watch:types": "./node_modules/typescript/bin/tsc --watch",
Expand Down
3 changes: 2 additions & 1 deletion packages/yjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@superviz/yjs",
"version": "1.0.1-beta.1",
"version": "1.0.2-lab.1",
"description": "",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
Expand All @@ -17,6 +17,7 @@
"test:unit:coverage": "jest --coverage",
"test:unit:ci": "jest --ci",
"build": "node ./.esbuild/build.js",
"prepack": "pnpm build",
"postbuild": "./node_modules/typescript/bin/tsc --declaration --emitDeclarationOnly --declarationDir dist",
"watch": "concurrently -n code,types \"pnpm watch:code\" \"pnpm watch:types\"",
"watch:code": "node ./.esbuild/watch.js",
Expand Down

0 comments on commit cd70da7

Please sign in to comment.