@vonage/client-sdk 0.1.5 → 0.2.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,30 +1,18 @@
1
1
  {
2
2
  "name": "@vonage/client-sdk",
3
- "version": "0.1.5",
3
+ "version": "0.2.0-alpha.0",
4
4
  "description": "",
5
5
  "type": "module",
6
- "module": "dist/index.mjs",
7
- "main": "dist/index.cjs",
8
- "types": "dist/index.d.ts",
9
- "typesVersions": {
10
- "*": {
11
- "voice": [
12
- "dist/voice/index.d.ts"
13
- ]
14
- }
15
- },
6
+ "module": "dist/client/index.mjs",
7
+ "main": "dist/client/index.cjs",
8
+ "types": "dist/client/index.d.ts",
16
9
  "exports": {
17
- "./voice": {
18
- "types": "./dist/voice/index.d.ts",
19
- "import": "./dist/voice/index.mjs",
20
- "require": "./dist/voice/index.cjs"
21
- },
22
10
  ".": {
23
- "types": "./dist/index.d.ts",
11
+ "types": "./dist/client/index.d.ts",
12
+ "import": "./dist/client/index.mjs",
13
+ "require": "./dist/client/index.cjs",
24
14
  "browser": "./dist/vonageClientSDK.js",
25
- "deno": "./dist/vonageClientSDK.mjs",
26
- "import": "./dist/index.mjs",
27
- "require": "./dist/index.cjs"
15
+ "deno": "./dist/vonageClientSDK.mjs"
28
16
  }
29
17
  },
30
18
  "scripts": {
@@ -56,6 +44,7 @@
56
44
  "devDependencies": {
57
45
  "@rollup/plugin-commonjs": "^24.0.0",
58
46
  "@rollup/plugin-json": "^6.0.0",
47
+ "@rollup/plugin-multi-entry": "^6.0.0",
59
48
  "@rollup/plugin-node-resolve": "^15.0.1",
60
49
  "@rollup/plugin-terser": "^0.2.1",
61
50
  "@swc/core": "^1.3.24",
@@ -70,6 +59,8 @@
70
59
  "eslint-plugin-prettier": "^4.0.0",
71
60
  "prettier": "^2.5.1",
72
61
  "rollup": "^3.9.0",
62
+ "rollup-plugin-cjs-es": "^2.0.0",
63
+ "rollup-plugin-sizes": "^1.0.5",
73
64
  "rollup-plugin-swc3": "^0.8.0",
74
65
  "rollup-plugin-typescript2": "^0.34.1",
75
66
  "tslib": "^2.4.1",
package/rollup.config.js CHANGED
@@ -3,24 +3,27 @@ import commonjs from '@rollup/plugin-commonjs';
3
3
  import json from '@rollup/plugin-json';
4
4
  import typescript from 'rollup-plugin-typescript2';
5
5
  import terser from '@rollup/plugin-terser';
6
+ import sizes from 'rollup-plugin-sizes';
6
7
 
7
8
  /**
8
9
  * @type {import('rollup').RollupOptions}
9
10
  */
10
11
  const browserBundles = [
11
12
  {
12
- input: 'src/index.ts',
13
+ input: 'src/client/index.ts',
13
14
  output: [
14
15
  {
15
16
  name: 'vonageClientSDK',
16
17
  file: 'dist/vonageClientSDK.js',
17
- format: 'umd'
18
+ format: 'umd',
19
+ exports: 'named'
18
20
  },
19
21
  {
20
22
  name: 'vonageClientSDK',
21
23
  file: 'dist/vonageClientSDK.min.js',
22
24
  format: 'umd',
23
- plugins: [terser()]
25
+ plugins: [terser()],
26
+ exports: 'named'
24
27
  },
25
28
  {
26
29
  file: 'dist/vonageClientSDK.mjs',
@@ -51,7 +54,7 @@ const browserBundles = [
51
54
  */
52
55
  const npmBundles = [
53
56
  {
54
- input: 'src/voice/index.ts',
57
+ input: 'src/client/index.ts',
55
58
  external: [
56
59
  'axios',
57
60
  'socket.io-client',
@@ -59,14 +62,15 @@ const npmBundles = [
59
62
  'sdp-transform',
60
63
  'events'
61
64
  ],
65
+ treeshake: true,
62
66
  output: [
63
67
  {
64
- file: './dist/voice/index.mjs',
68
+ file: './dist/client/index.mjs',
65
69
  format: 'es',
66
70
  exports: 'named'
67
71
  },
68
72
  {
69
- file: './dist/voice/index.cjs',
73
+ file: './dist/client/index.cjs',
70
74
  format: 'cjs',
71
75
  exports: 'named'
72
76
  }
@@ -81,32 +85,9 @@ const npmBundles = [
81
85
  declaration: false
82
86
  }
83
87
  }
84
- })
88
+ }),
89
+ sizes()
85
90
  ]
86
- },
87
- {
88
- input: 'src/index.ts',
89
- external: [
90
- './voice',
91
- 'axios',
92
- 'socket.io-client',
93
- 'socketio-wildcard',
94
- 'sdp-transform',
95
- 'events'
96
- ],
97
- output: [
98
- {
99
- file: './dist/index.mjs',
100
- format: 'es',
101
- exports: 'named'
102
- },
103
- {
104
- file: './dist/index.cjs',
105
- format: 'cjs',
106
- exports: 'named'
107
- }
108
- ],
109
- plugins: [typescript()]
110
91
  }
111
92
  ];
112
93
 
package/dist/index.cjs DELETED
@@ -1,27 +0,0 @@
1
- 'use strict';
2
-
3
- var voice = require('./voice');
4
-
5
-
6
-
7
- Object.defineProperty(exports, 'ClientConfig', {
8
- enumerable: true,
9
- get: function () { return voice.ClientConfig; }
10
- });
11
- Object.defineProperty(exports, 'ConfigRegion', {
12
- enumerable: true,
13
- get: function () { return voice.ConfigRegion; }
14
- });
15
- Object.defineProperty(exports, 'LoggingLevel', {
16
- enumerable: true,
17
- get: function () { return voice.LoggingLevel; }
18
- });
19
- Object.defineProperty(exports, 'SessionErrorReason', {
20
- enumerable: true,
21
- get: function () { return voice.SessionErrorReason; }
22
- });
23
- exports.VoiceClient = voice;
24
- Object.defineProperty(exports, 'setDefaultLoggingLevel', {
25
- enumerable: true,
26
- get: function () { return voice.setDefaultLoggingLevel; }
27
- });
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export { default as VoiceClient, ClientConfig, ConfigRegion, setDefaultLoggingLevel, LoggingLevel, Invite, VoiceCall, Conversation, RTCQuality, SessionErrorReason } from './voice';
package/dist/index.mjs DELETED
@@ -1 +0,0 @@
1
- export { ClientConfig, ConfigRegion, LoggingLevel, SessionErrorReason, default as VoiceClient, setDefaultLoggingLevel } from './voice';
@@ -1,26 +0,0 @@
1
- import { vonage } from '../kotlin/clientsdk-clientcore_js';
2
- import '../coreExtend';
3
- import '../global';
4
- /**
5
- * Minimal Interface built on top of KMP export
6
- * DO NOT ADD CODE HERE UNLESS REALLY NEEDEED!!111!
7
- */
8
- export type VonageEvent = vonage.CoreClientEvents;
9
- export type Invite = vonage.VoiceInviteJS;
10
- export type VoiceCall = vonage.VoiceCallJS;
11
- export type Conversation = vonage.ConversationJS;
12
- export type RTCQuality = vonage.RTCQualityJS;
13
- export type SessionErrorReason = vonage.SessionErrorReasonJS;
14
- export declare const SessionErrorReason: typeof vonage.SessionErrorReasonJS;
15
- export declare const ConfigRegion: typeof vonage.CoreClientConfigRegionJS;
16
- export declare const LoggingLevel: typeof vonage.LoggingLevelJS;
17
- export declare const setDefaultLoggingLevel: typeof vonage.setDefaultLoggingLevel;
18
- export declare class ClientConfig extends vonage.CoreClientConfigJS {
19
- constructor(region?: vonage.CoreClientConfigRegionJS);
20
- }
21
- export declare class VoiceClient extends vonage.CoreClientJS {
22
- private callbacks;
23
- constructor();
24
- on<T extends keyof VonageEvent, Fn extends VonageEvent[T]>(event: T, callback: Fn): void;
25
- }
26
- export default VoiceClient;
@@ -1,2 +0,0 @@
1
- export { VoiceClient as default } from './VoiceClient';
2
- export * from './VoiceClient';