dsh-caveman 0.1.1 → 0.1.2

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.
Files changed (2) hide show
  1. package/lib/index.js +8 -3
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -61,9 +61,11 @@ export function apply(ctx) {
61
61
  const projections = ctx.get('sessionProjections')
62
62
 
63
63
  if (projections !== undefined) {
64
+ // rc.7+: client visibility requires wire (viewSchema + view); the bare
65
+ // top-level schema/view fields are ignored by the rc.2 registry.
64
66
  projections.register({
65
67
  key: 'caveman',
66
- schema,
68
+ stateSchema: schema,
67
69
  stateVersion: 1,
68
70
  init: () => ({ mode: 'full' }),
69
71
  apply: (state, event) => {
@@ -72,7 +74,10 @@ export function apply(ctx) {
72
74
  if (!VALID.includes(mode) || state.mode === mode) return state
73
75
  return { mode }
74
76
  },
75
- view: (state) => ({ mode: state.mode }),
77
+ wire: {
78
+ viewSchema: schema,
79
+ view: (state) => ({ mode: state.mode }),
80
+ },
76
81
  })
77
82
  }
78
83
 
@@ -190,4 +195,4 @@ export function apply(ctx) {
190
195
  }
191
196
 
192
197
  console.log('[caveman] host active (event projection + KNOWN registration)')
193
- }
198
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-caveman",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "exports": {
@@ -35,4 +35,4 @@
35
35
  "inject": []
36
36
  }
37
37
  }
38
- }
38
+ }