@w3streamdev/plugin-core 1.0.2 → 1.0.3

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/dist/index.d.mts CHANGED
@@ -27,7 +27,7 @@ interface ServerPluginRecord {
27
27
  }
28
28
 
29
29
  /**
30
- * @w3streamdev/plugin-core — StoreSyncManager
30
+ * @w3stream/plugin-core — StoreSyncManager
31
31
  *
32
32
  * Maintains in-memory store state per plugin and synchronizes updates
33
33
  * across local iframes and remote peers via RTK data channel.
@@ -76,9 +76,9 @@ declare class StoreSyncManager {
76
76
  }
77
77
 
78
78
  /**
79
- * @w3streamdev/plugin-core — W3PostMessageBridge (host side)
79
+ * @w3stream/plugin-core — W3PostMessageBridge (host side)
80
80
  *
81
- * Host-side mirror of the PostMessageTransport in @w3streamdev/plugin-core.
81
+ * Host-side mirror of the PostMessageTransport in @w3stream/plugin-sdk.
82
82
  * Manages the full handshake lifecycle between the host page and plugin iframe.
83
83
  *
84
84
  * Sequence (per PRD Section 2.2 and 4.6):
@@ -114,7 +114,7 @@ declare class W3PostMessageBridge {
114
114
  }
115
115
 
116
116
  /**
117
- * @w3streamdev/plugin-core — W3PluginObject
117
+ * @w3stream/plugin-core — W3PluginObject
118
118
  *
119
119
  * Factory function returning an RTKPlugin-compatible object that
120
120
  * <rtk-plugins>, <rtk-plugin-main>, and <rtk-plugins-toggle> can use
@@ -176,13 +176,13 @@ interface W3PluginObject {
176
176
  declare function createW3PluginObject(serverPlugin: ServerPluginRecord, meeting: unknown, _config: PluginInfraConfig, storeSync?: StoreSyncManager): W3PluginObject;
177
177
 
178
178
  /**
179
- * @w3streamdev/plugin-core — PluginManager
179
+ * @w3stream/plugin-core — PluginManager
180
180
  *
181
181
  * Fetches plugins from your plugin server, builds RTKPlugin-compatible objects,
182
182
  * and patches the meeting object so <rtk-plugins>, <rtk-plugin-main>, and
183
183
  * <rtk-plugins-toggle> work against your own infrastructure.
184
184
  *
185
- * Reference: PRD Section 4 — Package 3: @w3streamdev/plugin-core
185
+ * Reference: PRD Section 4 — Package 3: @w3stream/plugin-core
186
186
  */
187
187
 
188
188
  declare class PluginList {
package/dist/index.d.ts CHANGED
@@ -27,7 +27,7 @@ interface ServerPluginRecord {
27
27
  }
28
28
 
29
29
  /**
30
- * @w3streamdev/plugin-core — StoreSyncManager
30
+ * @w3stream/plugin-core — StoreSyncManager
31
31
  *
32
32
  * Maintains in-memory store state per plugin and synchronizes updates
33
33
  * across local iframes and remote peers via RTK data channel.
@@ -76,9 +76,9 @@ declare class StoreSyncManager {
76
76
  }
77
77
 
78
78
  /**
79
- * @w3streamdev/plugin-core — W3PostMessageBridge (host side)
79
+ * @w3stream/plugin-core — W3PostMessageBridge (host side)
80
80
  *
81
- * Host-side mirror of the PostMessageTransport in @w3streamdev/plugin-core.
81
+ * Host-side mirror of the PostMessageTransport in @w3stream/plugin-sdk.
82
82
  * Manages the full handshake lifecycle between the host page and plugin iframe.
83
83
  *
84
84
  * Sequence (per PRD Section 2.2 and 4.6):
@@ -114,7 +114,7 @@ declare class W3PostMessageBridge {
114
114
  }
115
115
 
116
116
  /**
117
- * @w3streamdev/plugin-core — W3PluginObject
117
+ * @w3stream/plugin-core — W3PluginObject
118
118
  *
119
119
  * Factory function returning an RTKPlugin-compatible object that
120
120
  * <rtk-plugins>, <rtk-plugin-main>, and <rtk-plugins-toggle> can use
@@ -176,13 +176,13 @@ interface W3PluginObject {
176
176
  declare function createW3PluginObject(serverPlugin: ServerPluginRecord, meeting: unknown, _config: PluginInfraConfig, storeSync?: StoreSyncManager): W3PluginObject;
177
177
 
178
178
  /**
179
- * @w3streamdev/plugin-core — PluginManager
179
+ * @w3stream/plugin-core — PluginManager
180
180
  *
181
181
  * Fetches plugins from your plugin server, builds RTKPlugin-compatible objects,
182
182
  * and patches the meeting object so <rtk-plugins>, <rtk-plugin-main>, and
183
183
  * <rtk-plugins-toggle> work against your own infrastructure.
184
184
  *
185
- * Reference: PRD Section 4 — Package 3: @w3streamdev/plugin-core
185
+ * Reference: PRD Section 4 — Package 3: @w3stream/plugin-core
186
186
  */
187
187
 
188
188
  declare class PluginList {
package/dist/index.js CHANGED
@@ -530,15 +530,16 @@ async function patchMeeting(meeting, config) {
530
530
  const all = new PluginList();
531
531
  all._setItems(pluginObjects);
532
532
  const active = new PluginList();
533
- const pluginsProxy = {
534
- all,
535
- active
536
- };
537
- Object.defineProperty(m, "plugins", {
538
- value: pluginsProxy,
539
- writable: true,
540
- configurable: true
541
- });
533
+ const existingPlugins = m.plugins ?? {};
534
+ existingPlugins["all"] = all;
535
+ existingPlugins["active"] = active;
536
+ if (!m.plugins) {
537
+ Object.defineProperty(m, "plugins", {
538
+ value: existingPlugins,
539
+ writable: true,
540
+ configurable: true
541
+ });
542
+ }
542
543
  if (m.participants?.on) {
543
544
  const handleBroadcast = (...args) => {
544
545
  let data;
package/dist/index.mjs CHANGED
@@ -489,15 +489,16 @@ async function patchMeeting(meeting, config) {
489
489
  const all = new PluginList();
490
490
  all._setItems(pluginObjects);
491
491
  const active = new PluginList();
492
- const pluginsProxy = {
493
- all,
494
- active
495
- };
496
- Object.defineProperty(m, "plugins", {
497
- value: pluginsProxy,
498
- writable: true,
499
- configurable: true
500
- });
492
+ const existingPlugins = m.plugins ?? {};
493
+ existingPlugins["all"] = all;
494
+ existingPlugins["active"] = active;
495
+ if (!m.plugins) {
496
+ Object.defineProperty(m, "plugins", {
497
+ value: existingPlugins,
498
+ writable: true,
499
+ configurable: true
500
+ });
501
+ }
501
502
  if (m.participants?.on) {
502
503
  const handleBroadcast = (...args) => {
503
504
  let data;
package/package.json CHANGED
@@ -1,42 +1,38 @@
1
- {
2
- "name": "@w3streamdev/plugin-core",
3
- "version": "1.0.2",
4
- "description": "Host-side patch layer — wires @cloudflare/realtimekit into your plugin infrastructure",
5
- "main": "dist/index.js",
6
- "module": "dist/index.mjs",
7
- "types": "dist/index.d.ts",
8
- "exports": {
9
- ".": {
10
- "types": "./dist/index.d.ts",
11
- "import": "./dist/index.mjs",
12
- "require": "./dist/index.js"
13
- }
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "scripts": {
19
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
20
- "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
21
- "typecheck": "tsc --noEmit",
22
- "lint": "eslint src",
23
- "clean": "rm -rf dist"
24
- },
25
- "peerDependencies": {
26
- "@cloudflare/realtimekit": ">=0"
27
- },
28
- "peerDependenciesMeta": {
29
- "@cloudflare/realtimekit": {
30
- "optional": false
31
- }
32
- },
33
- "dependencies": {
34
- "eventemitter3": "^5.0.1"
35
- },
36
- "devDependencies": {
37
- "@cloudflare/realtimekit": "latest",
38
- "tsup": "^8.0.0",
39
- "typescript": "^5.4.0"
40
- },
41
- "license": "MIT"
42
- }
1
+ {
2
+ "name": "@w3streamdev/plugin-core",
3
+ "version": "1.0.3",
4
+ "description": "Host-side patch layer — wires @cloudflare/realtimekit into your plugin infrastructure",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "import": "./dist/index.mjs",
12
+ "require": "./dist/index.js"
13
+ }
14
+ },
15
+ "files": ["dist"],
16
+ "scripts": {
17
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean",
18
+ "dev": "tsup src/index.ts --format cjs,esm --dts --watch",
19
+ "typecheck": "tsc --noEmit",
20
+ "lint": "eslint src",
21
+ "clean": "rm -rf dist"
22
+ },
23
+ "peerDependencies": {
24
+ "@cloudflare/realtimekit": ">=0"
25
+ },
26
+ "peerDependenciesMeta": {
27
+ "@cloudflare/realtimekit": { "optional": false }
28
+ },
29
+ "dependencies": {
30
+ "eventemitter3": "^5.0.1"
31
+ },
32
+ "devDependencies": {
33
+ "@cloudflare/realtimekit": "latest",
34
+ "tsup": "^8.0.0",
35
+ "typescript": "^5.4.0"
36
+ },
37
+ "license": "MIT"
38
+ }