@use-everywhere/core 0.6.0 → 0.8.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/dist/index.cjs +981 -127
- package/dist/index.d.cts +736 -47
- package/dist/index.d.ts +736 -47
- package/dist/index.js +972 -127
- package/dist/testing.cjs +1 -0
- package/dist/testing.d.cts +2 -1
- package/dist/testing.d.ts +2 -1
- package/dist/testing.js +1 -0
- package/dist/transport.types-CV1WZOhy.d.cts +20 -0
- package/dist/transport.types-CV1WZOhy.d.ts +20 -0
- package/package.json +30 -12
- package/dist/transport.types-tQ1cu6Xm.d.cts +0 -12
- package/dist/transport.types-tQ1cu6Xm.d.ts +0 -12
package/dist/testing.cjs
CHANGED
package/dist/testing.d.cts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { T as Transport } from './transport.types-
|
|
1
|
+
import { T as Transport, a as TransportKind } from './transport.types-CV1WZOhy.cjs';
|
|
2
2
|
|
|
3
3
|
/** One simulated client on a MemoryHub. Create via hub.connect(). */
|
|
4
4
|
declare class MemoryTransport implements Transport {
|
|
5
5
|
private hub;
|
|
6
|
+
readonly kind: TransportKind;
|
|
6
7
|
private listeners;
|
|
7
8
|
private closed;
|
|
8
9
|
constructor(hub: MemoryHub);
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { T as Transport } from './transport.types-
|
|
1
|
+
import { T as Transport, a as TransportKind } from './transport.types-CV1WZOhy.js';
|
|
2
2
|
|
|
3
3
|
/** One simulated client on a MemoryHub. Create via hub.connect(). */
|
|
4
4
|
declare class MemoryTransport implements Transport {
|
|
5
5
|
private hub;
|
|
6
|
+
readonly kind: TransportKind;
|
|
6
7
|
private listeners;
|
|
7
8
|
private closed;
|
|
8
9
|
constructor(hub: MemoryHub);
|
package/dist/testing.js
CHANGED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which mechanism a transport actually uses. Worth surfacing, because they are
|
|
3
|
+
* not equivalent: `storage` is a fallback with lower fidelity than
|
|
4
|
+
* `broadcast-channel`, and `none` means nothing is being shared at all.
|
|
5
|
+
*/
|
|
6
|
+
type TransportKind = 'broadcast-channel' | 'storage' | 'memory' | 'none' | (string & {});
|
|
7
|
+
/**
|
|
8
|
+
* Minimal message bus. Implementations: BroadcastChannelTransport (same-origin),
|
|
9
|
+
* StorageTransport (fallback), NoopTransport (SSR / local-only), MemoryTransport
|
|
10
|
+
* (tests). A transport never echoes a client's own posts back to it.
|
|
11
|
+
*/
|
|
12
|
+
interface Transport {
|
|
13
|
+
/** What this transport is. Optional so a custom transport need not declare one. */
|
|
14
|
+
readonly kind?: TransportKind;
|
|
15
|
+
post(data: unknown): void;
|
|
16
|
+
subscribe(listener: (data: unknown) => void): () => void;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type { Transport as T, TransportKind as a };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which mechanism a transport actually uses. Worth surfacing, because they are
|
|
3
|
+
* not equivalent: `storage` is a fallback with lower fidelity than
|
|
4
|
+
* `broadcast-channel`, and `none` means nothing is being shared at all.
|
|
5
|
+
*/
|
|
6
|
+
type TransportKind = 'broadcast-channel' | 'storage' | 'memory' | 'none' | (string & {});
|
|
7
|
+
/**
|
|
8
|
+
* Minimal message bus. Implementations: BroadcastChannelTransport (same-origin),
|
|
9
|
+
* StorageTransport (fallback), NoopTransport (SSR / local-only), MemoryTransport
|
|
10
|
+
* (tests). A transport never echoes a client's own posts back to it.
|
|
11
|
+
*/
|
|
12
|
+
interface Transport {
|
|
13
|
+
/** What this transport is. Optional so a custom transport need not declare one. */
|
|
14
|
+
readonly kind?: TransportKind;
|
|
15
|
+
post(data: unknown): void;
|
|
16
|
+
subscribe(listener: (data: unknown) => void): () => void;
|
|
17
|
+
close(): void;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type { Transport as T, TransportKind as a };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@use-everywhere/core",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Cross-tab shared state, events, presence, and cross-origin window channels",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Jonatan Kruszewski <jonakrusze@gmail.com>",
|
|
@@ -58,67 +58,84 @@
|
|
|
58
58
|
"name": "everything (import *)",
|
|
59
59
|
"path": "dist/index.js",
|
|
60
60
|
"import": "*",
|
|
61
|
-
"limit": "
|
|
61
|
+
"limit": "8.78 kB"
|
|
62
62
|
},
|
|
63
63
|
{
|
|
64
64
|
"name": "createLeader",
|
|
65
65
|
"path": "dist/index.js",
|
|
66
66
|
"import": "{ createLeader }",
|
|
67
|
-
"limit": "
|
|
67
|
+
"limit": "3.23 kB"
|
|
68
68
|
},
|
|
69
69
|
{
|
|
70
70
|
"name": "createSharedStore",
|
|
71
71
|
"path": "dist/index.js",
|
|
72
72
|
"import": "{ createSharedStore }",
|
|
73
|
-
"limit": "
|
|
73
|
+
"limit": "3.90 kB"
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
"name": "createSharedReducer",
|
|
77
|
+
"path": "dist/index.js",
|
|
78
|
+
"import": "{ createSharedReducer }",
|
|
79
|
+
"limit": "3.79 kB"
|
|
74
80
|
},
|
|
75
81
|
{
|
|
76
82
|
"name": "createChannel",
|
|
77
83
|
"path": "dist/index.js",
|
|
78
84
|
"import": "{ createChannel }",
|
|
79
|
-
"limit": "
|
|
85
|
+
"limit": "2.74 kB"
|
|
80
86
|
},
|
|
81
87
|
{
|
|
82
88
|
"name": "createPresence",
|
|
83
89
|
"path": "dist/index.js",
|
|
84
90
|
"import": "{ createPresence }",
|
|
85
|
-
"limit": "
|
|
91
|
+
"limit": "2.47 kB"
|
|
86
92
|
},
|
|
87
93
|
{
|
|
88
94
|
"name": "openWindow (opener side)",
|
|
89
95
|
"path": "dist/index.js",
|
|
90
96
|
"import": "{ openWindow }",
|
|
91
|
-
"limit": "1.
|
|
97
|
+
"limit": "1.23 kB"
|
|
92
98
|
},
|
|
93
99
|
{
|
|
94
100
|
"name": "connectToOpener (child side)",
|
|
95
101
|
"path": "dist/index.js",
|
|
96
102
|
"import": "{ connectToOpener }",
|
|
97
|
-
"limit": "1.
|
|
103
|
+
"limit": "1.09 kB"
|
|
98
104
|
},
|
|
99
105
|
{
|
|
100
106
|
"name": "observeBus + enableDebug",
|
|
101
107
|
"path": "dist/index.js",
|
|
102
108
|
"import": "{ observeBus, enableDebug }",
|
|
103
|
-
"limit": "
|
|
109
|
+
"limit": "316 B"
|
|
104
110
|
},
|
|
105
111
|
{
|
|
106
112
|
"name": "localStorageAdapter",
|
|
107
113
|
"path": "dist/index.js",
|
|
108
114
|
"import": "{ localStorageAdapter }",
|
|
109
|
-
"limit": "
|
|
115
|
+
"limit": "655 B"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"name": "indexedDbAdapter",
|
|
119
|
+
"path": "dist/index.js",
|
|
120
|
+
"import": "{ indexedDbAdapter }",
|
|
121
|
+
"limit": "447 B"
|
|
110
122
|
},
|
|
111
123
|
{
|
|
112
124
|
"name": "MemoryHub (testing subpath)",
|
|
113
125
|
"path": "dist/testing.js",
|
|
114
126
|
"import": "{ MemoryHub }",
|
|
115
|
-
"limit": "
|
|
127
|
+
"limit": "267 B"
|
|
116
128
|
}
|
|
117
129
|
],
|
|
118
130
|
"devDependencies": {
|
|
119
131
|
"@arethetypeswrong/cli": "^0.18.5",
|
|
120
132
|
"@size-limit/preset-small-lib": "^13.0.1",
|
|
133
|
+
"@stryker-mutator/core": "^9.6.1",
|
|
134
|
+
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
121
135
|
"@vitest/coverage-v8": "^4.1.10",
|
|
136
|
+
"esbuild": "^0.28.1",
|
|
137
|
+
"fake-indexeddb": "^6.2.5",
|
|
138
|
+
"fast-check": "^4.9.0",
|
|
122
139
|
"happy-dom": "^20.11.1",
|
|
123
140
|
"publint": "^0.3.21",
|
|
124
141
|
"size-limit": "^13.0.1",
|
|
@@ -139,6 +156,7 @@
|
|
|
139
156
|
"typecheck": "tsc --noEmit",
|
|
140
157
|
"size": "size-limit",
|
|
141
158
|
"check:exports": "publint --strict && attw --pack .",
|
|
142
|
-
"pack:smoke": "node --import tsx ../tooling/pack-smoke.ts"
|
|
159
|
+
"pack:smoke": "node --import tsx ../tooling/pack-smoke.ts",
|
|
160
|
+
"mutation": "stryker run && node --import tsx ../tooling/check-mutation.ts reports/mutation/mutation.json"
|
|
143
161
|
}
|
|
144
162
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal message bus. Implementations: BroadcastChannelTransport (same-origin),
|
|
3
|
-
* NoopTransport (SSR / local-only), MemoryTransport (tests). A transport never
|
|
4
|
-
* echoes a client's own posts back to it.
|
|
5
|
-
*/
|
|
6
|
-
interface Transport {
|
|
7
|
-
post(data: unknown): void;
|
|
8
|
-
subscribe(listener: (data: unknown) => void): () => void;
|
|
9
|
-
close(): void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type { Transport as T };
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Minimal message bus. Implementations: BroadcastChannelTransport (same-origin),
|
|
3
|
-
* NoopTransport (SSR / local-only), MemoryTransport (tests). A transport never
|
|
4
|
-
* echoes a client's own posts back to it.
|
|
5
|
-
*/
|
|
6
|
-
interface Transport {
|
|
7
|
-
post(data: unknown): void;
|
|
8
|
-
subscribe(listener: (data: unknown) => void): () => void;
|
|
9
|
-
close(): void;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export type { Transport as T };
|