jazz-tools 0.18.20 → 0.18.21

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.
@@ -1,59 +1,67 @@
1
- <script lang="ts" generics="S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema">
2
- import type { AuthSecretStorage, InstanceOfSchema } from "jazz-tools";
3
- import {
4
- Account,
5
- type AccountClass,
6
- type AnyAccountSchema,
7
- type CoValueFromRaw,
8
- } from "jazz-tools";
9
- import {
10
- JazzBrowserContextManager,
11
- type JazzContextManagerProps,
12
- } from "jazz-tools/browser";
13
- import { type Snippet, setContext, untrack } from "svelte";
14
- import { JAZZ_AUTH_CTX, JAZZ_CTX, type JazzContext } from "./jazz.svelte.js";
15
-
16
- let props: JazzContextManagerProps<S> & { children?: Snippet } = $props();
17
-
18
- const contextManager = new JazzBrowserContextManager<S>();
19
-
20
- const ctx = $state<JazzContext<InstanceOfSchema<S>>>({ current: undefined });
21
-
22
- setContext<JazzContext<InstanceOfSchema<S>>>(JAZZ_CTX, ctx);
23
- setContext<AuthSecretStorage>(
24
- JAZZ_AUTH_CTX,
25
- contextManager.getAuthSecretStorage(),
26
- );
27
-
28
- $effect(() => {
29
- props.sync.when;
30
- props.sync.peer;
31
- props.storage;
32
- props.guestMode;
33
- return untrack(() => {
34
- if (!props.sync) return;
35
-
36
- contextManager
37
- .createContext({
38
- sync: props.sync,
39
- storage: props.storage,
40
- guestMode: props.guestMode,
41
- AccountSchema: props.AccountSchema,
42
- defaultProfileName: props.defaultProfileName,
43
- onAnonymousAccountDiscarded: props.onAnonymousAccountDiscarded,
44
- onLogOut: props.onLogOut,
45
- })
46
- .catch((error) => {
47
- console.error("Error creating Jazz browser context:", error);
48
- });
1
+ <script
2
+ lang="ts"
3
+ generics="S extends (AccountClass<Account> & CoValueFromRaw<Account>) | AnyAccountSchema"
4
+ >
5
+ import type { AuthSecretStorage, InstanceOfSchema } from "jazz-tools";
6
+ import {
7
+ Account,
8
+ type AccountClass,
9
+ type AnyAccountSchema,
10
+ type CoValueFromRaw,
11
+ } from "jazz-tools";
12
+ import {
13
+ JazzBrowserContextManager,
14
+ type JazzContextManagerProps,
15
+ } from "jazz-tools/browser";
16
+ import { type Snippet, setContext, untrack } from "svelte";
17
+ import { JAZZ_AUTH_CTX, JAZZ_CTX, type JazzContext } from "./jazz.svelte.js";
18
+
19
+ let props: JazzContextManagerProps<S> & {
20
+ children?: Snippet;
21
+ enableSSR?: boolean;
22
+ } = $props();
23
+
24
+ const contextManager = new JazzBrowserContextManager<S>({
25
+ useAnonymousFallback: props.enableSSR,
26
+ });
27
+
28
+ const ctx = $state<JazzContext<InstanceOfSchema<S>>>({ current: undefined });
29
+
30
+ setContext<JazzContext<InstanceOfSchema<S>>>(JAZZ_CTX, ctx);
31
+ setContext<AuthSecretStorage>(
32
+ JAZZ_AUTH_CTX,
33
+ contextManager.getAuthSecretStorage(),
34
+ );
35
+
36
+ $effect(() => {
37
+ props.sync.when;
38
+ props.sync.peer;
39
+ props.storage;
40
+ props.guestMode;
41
+ return untrack(() => {
42
+ if (!props.sync) return;
43
+
44
+ contextManager
45
+ .createContext({
46
+ sync: props.sync,
47
+ storage: props.storage,
48
+ guestMode: props.guestMode,
49
+ AccountSchema: props.AccountSchema,
50
+ defaultProfileName: props.defaultProfileName,
51
+ onAnonymousAccountDiscarded: props.onAnonymousAccountDiscarded,
52
+ onLogOut: props.onLogOut,
53
+ })
54
+ .catch((error) => {
55
+ console.error("Error creating Jazz browser context:", error);
56
+ });
57
+ });
49
58
  });
50
- });
51
59
 
52
- $effect(() => {
53
- return contextManager.subscribe(() => {
54
- ctx.current = contextManager.getCurrentValue();
60
+ $effect(() => {
61
+ return contextManager.subscribe(() => {
62
+ ctx.current = contextManager.getCurrentValue();
63
+ });
55
64
  });
56
- });
57
65
  </script>
58
66
 
59
67
  {#if ctx.current}
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.svelte.d.ts","sourceRoot":"","sources":["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C,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG;QAAE,UAAU,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACzc,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,gBAAgB,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IACxM,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,QAAQ,EAAE,qBAAmC,CAAC;AAClC,KAAK,QAAQ,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC,GAAG,gBAAgB,IAAI,YAAY,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AACnI,eAAe,QAAQ,CAAC"}
@@ -1,8 +1,8 @@
1
1
 
2
- > jazz-tools@0.18.20 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.18.21 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
- CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
5
+ CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts","tools/ssr":"src/tools/ssr/index.ts"}
6
6
  CLI Using tsconfig: tsconfig.json
7
7
  CLI Building entry: {"index":"src/browser/index.ts"}
8
8
  CLI Using tsconfig: tsconfig.json
@@ -16,9 +16,7 @@
16
16
  CLI Using tsconfig: tsconfig.json
17
17
  CLI Building entry: {"index":"src/prosemirror/index.ts"}
18
18
  CLI Using tsconfig: tsconfig.json
19
- CLI Building entry: {"ssr":"src/react/ssr.ts"}
20
- CLI Using tsconfig: tsconfig.json
21
- CLI Building entry: {"index":"src/react/index.ts","testing":"src/react/testing.tsx"}
19
+ CLI Building entry: {"index":"src/react/index.ts","testing":"src/react/testing.tsx","ssr":"src/react/ssr.ts"}
22
20
  CLI Using tsconfig: tsconfig.json
23
21
  CLI Building entry: {"index":"src/react-core/index.ts","testing":"src/react-core/testing.tsx"}
24
22
  CLI Using tsconfig: tsconfig.json
@@ -64,8 +62,6 @@
64
62
  CLI Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
65
63
  CLI tsup v8.5.0
66
64
  CLI Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
67
- CLI tsup v8.5.0
68
- CLI Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
69
65
  CLI Target: es2021
70
66
  CLI Target: es2021
71
67
  CLI Target: es2021
@@ -81,9 +77,6 @@
81
77
  CLI Target: es2021
82
78
  CLI Target: es2021
83
79
  CLI Target: es2021
84
- CLI Target: es2021
85
- CLI Cleaning output folder
86
- ESM Build start
87
80
  CLI Cleaning output folder
88
81
  ESM Build start
89
82
  CLI Cleaning output folder
@@ -114,98 +107,103 @@
114
107
  ESM Build start
115
108
  CLI Cleaning output folder
116
109
  ESM Build start
117
- ESM dist/tiptap/index.js 564.00 B
118
- ESM dist/tiptap/index.js.map 1.21 KB
119
- ESM ⚡️ Build success in 20ms
120
- ESM dist/react/ssr.js 688.00 B
121
- ESM dist/react/ssr.js.map 1.12 KB
122
- ESM ⚡️ Build success in 23ms
123
110
  ESM dist/worker/index.js 3.19 KB
124
111
  ESM dist/worker/edge-wasm.js 215.00 B
125
112
  ESM dist/worker/index.js.map 6.17 KB
126
113
  ESM dist/worker/edge-wasm.js.map 434.00 B
127
- ESM ⚡️ Build success in 39ms
114
+ ESM ⚡️ Build success in 14ms
115
+ ESM dist/tiptap/index.js 564.00 B
116
+ ESM dist/tiptap/index.js.map 1.21 KB
117
+ ESM ⚡️ Build success in 20ms
128
118
  ESM dist/better-auth/auth/client.js 4.50 KB
129
119
  ESM dist/better-auth/auth/server.js 8.36 KB
130
120
  ESM dist/better-auth/auth/react.js 799.00 B
131
121
  ESM dist/better-auth/auth/client.js.map 8.32 KB
132
122
  ESM dist/better-auth/auth/server.js.map 15.29 KB
133
123
  ESM dist/better-auth/auth/react.js.map 2.04 KB
134
- ESM ⚡️ Build success in 44ms
135
- ESM dist/react-native/index.js 2.53 KB
136
- ESM dist/react-native/testing.js 120.00 B
137
- ESM dist/react-native/crypto.js 161.00 B
138
- ESM dist/react-native/index.js.map 5.68 KB
139
- ESM dist/react-native/testing.js.map 176.00 B
140
- ESM dist/react-native/crypto.js.map 197.00 B
141
- ESM ⚡️ Build success in 48ms
124
+ ESM ⚡️ Build success in 24ms
142
125
  ESM dist/media/index.js 236.00 B
126
+ ESM dist/media/index.browser.js 2.79 KB
143
127
  ESM dist/media/index.native.js 2.90 KB
144
128
  ESM dist/media/index.server.js 2.95 KB
145
- ESM dist/media/index.browser.js 2.79 KB
146
129
  ESM dist/media/chunk-W3S526L3.js 6.47 KB
147
130
  ESM dist/media/index.js.map 71.00 B
131
+ ESM dist/media/index.browser.js.map 6.15 KB
148
132
  ESM dist/media/index.native.js.map 6.09 KB
149
133
  ESM dist/media/index.server.js.map 6.37 KB
150
- ESM dist/media/index.browser.js.map 6.15 KB
151
134
  ESM dist/media/chunk-W3S526L3.js.map 16.57 KB
152
- ESM ⚡️ Build success in 55ms
135
+ ESM ⚡️ Build success in 30ms
153
136
  ESM dist/react-core/index.js 11.11 KB
154
137
  ESM dist/react-core/testing.js 1.22 KB
155
138
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
156
139
  ESM dist/react-core/index.js.map 35.83 KB
157
140
  ESM dist/react-core/testing.js.map 1.86 KB
158
141
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
159
- ESM ⚡️ Build success in 53ms
142
+ ESM ⚡️ Build success in 43ms
160
143
  ESM dist/browser/index.js 14.16 KB
161
144
  ESM dist/browser/index.js.map 30.05 KB
162
- ESM ⚡️ Build success in 62ms
145
+ ESM ⚡️ Build success in 46ms
146
+ ESM dist/react-native/index.js 2.53 KB
147
+ ESM dist/react-native/testing.js 120.00 B
148
+ ESM dist/react-native/crypto.js 161.00 B
149
+ ESM dist/react-native/index.js.map 5.68 KB
150
+ ESM dist/react-native/testing.js.map 176.00 B
151
+ ESM dist/react-native/crypto.js.map 197.00 B
152
+ ESM ⚡️ Build success in 42ms
163
153
  ESM dist/expo/index.js 4.68 KB
164
154
  ESM dist/expo/testing.js 112.00 B
165
155
  ESM dist/expo/crypto.js 153.00 B
166
156
  ESM dist/expo/index.js.map 10.23 KB
167
157
  ESM dist/expo/crypto.js.map 189.00 B
168
158
  ESM dist/expo/testing.js.map 168.00 B
169
- ESM ⚡️ Build success in 65ms
159
+ ESM ⚡️ Build success in 49ms
160
+ ESM dist/prosemirror/index.js 77.76 KB
161
+ ESM dist/prosemirror/index.js.map 307.20 KB
162
+ ESM ⚡️ Build success in 50ms
163
+ ESM dist/better-auth/database-adapter/index.js 26.34 KB
164
+ ESM dist/better-auth/database-adapter/index.js.map 57.62 KB
165
+ ESM ⚡️ Build success in 46ms
170
166
  ESM dist/react-native-core/index.js 18.65 KB
171
167
  ESM dist/react-native-core/testing.js 119.00 B
172
168
  ESM dist/react-native-core/crypto.js 2.10 KB
173
169
  ESM dist/react-native-core/index.js.map 37.83 KB
174
170
  ESM dist/react-native-core/testing.js.map 175.00 B
175
171
  ESM dist/react-native-core/crypto.js.map 4.25 KB
176
- ESM ⚡️ Build success in 59ms
177
- ESM dist/react/testing.js 122.00 B
172
+ ESM ⚡️ Build success in 49ms
178
173
  ESM dist/react/index.js 24.93 KB
174
+ ESM dist/react/testing.js 122.00 B
175
+ ESM dist/react/ssr.js 707.00 B
179
176
  ESM dist/react/testing.js.map 165.00 B
180
177
  ESM dist/react/index.js.map 53.78 KB
181
- ESM ⚡️ Build success in 62ms
182
- ESM dist/better-auth/database-adapter/index.js 26.34 KB
183
- ESM dist/better-auth/database-adapter/index.js.map 57.62 KB
184
- ESM ⚡️ Build success in 57ms
185
- ESM dist/prosemirror/index.js 77.76 KB
186
- ESM dist/prosemirror/index.js.map 307.20 KB
187
- ESM ⚡️ Build success in 64ms
178
+ ESM dist/react/ssr.js.map 1.12 KB
179
+ ESM ⚡️ Build success in 51ms
188
180
  ESM dist/inspector/index.js 69.71 KB
189
181
  ESM dist/inspector/index.js.map 121.38 KB
190
- ESM ⚡️ Build success in 78ms
191
- ESM dist/testing.js 8.33 KB
192
- ESM dist/index.js 26.13 KB
193
- ESM dist/chunk-TVHI2UMO.js 177.69 KB
194
- ESM dist/testing.js.map 15.87 KB
182
+ ESM ⚡️ Build success in 68ms
183
+ ESM dist/tools/ssr.js 156.00 B
184
+ ESM dist/testing.js 8.36 KB
185
+ ESM dist/index.js 26.24 KB
186
+ ESM dist/chunk-BOMSRY5H.js 704.00 B
187
+ ESM dist/chunk-PZ5AY32C.js 233.00 B
188
+ ESM dist/chunk-D5L6ES2M.js 177.57 KB
189
+ ESM dist/tools/ssr.js.map 71.00 B
190
+ ESM dist/testing.js.map 15.88 KB
191
+ ESM dist/chunk-BOMSRY5H.js.map 1.12 KB
195
192
  ESM dist/index.js.map 52.92 KB
196
- ESM dist/chunk-TVHI2UMO.js.map 422.99 KB
197
- ESM ⚡️ Build success in 102ms
193
+ ESM dist/chunk-PZ5AY32C.js.map 71.00 B
194
+ ESM dist/chunk-D5L6ES2M.js.map 422.99 KB
195
+ ESM ⚡️ Build success in 86ms
198
196
  ESM dist/inspector/register-custom-element.js 218.00 B
199
197
  ESM dist/inspector/register-custom-element.js.map 314.00 B
200
198
  ESM dist/inspector/custom-element-G6SPZEBR.js 1.54 MB
201
199
  ESM dist/inspector/custom-element-G6SPZEBR.js.map 2.36 MB
202
- ESM ⚡️ Build success in 143ms
200
+ ESM ⚡️ Build success in 123ms
203
201
 
204
- > jazz-tools@0.18.20 types /home/runner/_work/jazz/jazz/packages/jazz-tools
202
+ > jazz-tools@0.18.21 types /home/runner/_work/jazz/jazz/packages/jazz-tools
205
203
  > tsc --outDir dist
206
204
 
207
205
 
208
- > jazz-tools@0.18.20 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
206
+ > jazz-tools@0.18.21 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
209
207
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
210
208
 
211
209
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.18.21
4
+
5
+ ### Patch Changes
6
+
7
+ - 6819f20: Implements SSR options for SvelteKit
8
+ - cojson@0.18.21
9
+ - cojson-storage-indexeddb@0.18.21
10
+ - cojson-transport-ws@0.18.21
11
+
3
12
  ## 0.18.20
4
13
 
5
14
  ### Patch Changes
@@ -0,0 +1,26 @@
1
+ // src/tools/ssr/ssr.ts
2
+ import { WebSocketPeerWithReconnection } from "cojson-transport-ws";
3
+ import { PureJSCrypto } from "cojson/dist/crypto/PureJSCrypto";
4
+ import { createAnonymousJazzContext } from "jazz-tools";
5
+ function createSSRJazzAgent(opts) {
6
+ const ssrNode = createAnonymousJazzContext({
7
+ crypto: new PureJSCrypto(),
8
+ peersToLoadFrom: []
9
+ });
10
+ const wsPeer = new WebSocketPeerWithReconnection({
11
+ peer: opts.peer,
12
+ reconnectionTimeout: 100,
13
+ addPeer: (peer) => {
14
+ ssrNode.agent.node.syncManager.addPeer(peer);
15
+ },
16
+ removePeer: () => {
17
+ }
18
+ });
19
+ wsPeer.enable();
20
+ return ssrNode.agent;
21
+ }
22
+
23
+ export {
24
+ createSSRJazzAgent
25
+ };
26
+ //# sourceMappingURL=chunk-BOMSRY5H.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tools/ssr/ssr.ts"],"sourcesContent":["import { WebSocketPeerWithReconnection } from \"cojson-transport-ws\";\nimport { PureJSCrypto } from \"cojson/dist/crypto/PureJSCrypto\";\nimport { createAnonymousJazzContext } from \"jazz-tools\";\n\nexport function createSSRJazzAgent(opts: { peer: string }) {\n const ssrNode = createAnonymousJazzContext({\n crypto: new PureJSCrypto(),\n peersToLoadFrom: [],\n });\n\n const wsPeer = new WebSocketPeerWithReconnection({\n peer: opts.peer,\n reconnectionTimeout: 100,\n addPeer: (peer) => {\n ssrNode.agent.node.syncManager.addPeer(peer);\n },\n removePeer: () => {},\n });\n\n wsPeer.enable();\n\n return ssrNode.agent;\n}\n"],"mappings":";AAAA,SAAS,qCAAqC;AAC9C,SAAS,oBAAoB;AAC7B,SAAS,kCAAkC;AAEpC,SAAS,mBAAmB,MAAwB;AACzD,QAAM,UAAU,2BAA2B;AAAA,IACzC,QAAQ,IAAI,aAAa;AAAA,IACzB,iBAAiB,CAAC;AAAA,EACpB,CAAC;AAED,QAAM,SAAS,IAAI,8BAA8B;AAAA,IAC/C,MAAM,KAAK;AAAA,IACX,qBAAqB;AAAA,IACrB,SAAS,CAAC,SAAS;AACjB,cAAQ,MAAM,KAAK,YAAY,QAAQ,IAAI;AAAA,IAC7C;AAAA,IACA,YAAY,MAAM;AAAA,IAAC;AAAA,EACrB,CAAC;AAED,SAAO,OAAO;AAEd,SAAO,QAAQ;AACjB;","names":[]}
@@ -1,8 +1,6 @@
1
- var __defProp = Object.defineProperty;
2
- var __export = (target, all) => {
3
- for (var name in all)
4
- __defProp(target, name, { get: all[name], enumerable: true });
5
- };
1
+ import {
2
+ __export
3
+ } from "./chunk-PZ5AY32C.js";
6
4
 
7
5
  // src/tools/implementation/zodSchema/zodReExport.ts
8
6
  var zodReExport_exports = {};
@@ -6199,4 +6197,4 @@ export {
6199
6197
  JazzContextManager
6200
6198
  };
6201
6199
  /* istanbul ignore file -- @preserve */
6202
- //# sourceMappingURL=chunk-TVHI2UMO.js.map
6200
+ //# sourceMappingURL=chunk-D5L6ES2M.js.map