jazz-tools 0.18.15 → 0.18.17

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 (91) hide show
  1. package/.svelte-kit/__package__/media/image.svelte +104 -98
  2. package/.svelte-kit/__package__/media/image.svelte.d.ts.map +1 -1
  3. package/.svelte-kit/__package__/tests/media/image.svelte.test.js +16 -2
  4. package/.turbo/turbo-build.log +48 -38
  5. package/CHANGELOG.md +20 -0
  6. package/dist/better-auth/database-adapter/index.d.ts +50 -0
  7. package/dist/better-auth/database-adapter/index.d.ts.map +1 -0
  8. package/dist/better-auth/database-adapter/index.js +920 -0
  9. package/dist/better-auth/database-adapter/index.js.map +1 -0
  10. package/dist/better-auth/database-adapter/repository/account.d.ts +24 -0
  11. package/dist/better-auth/database-adapter/repository/account.d.ts.map +1 -0
  12. package/dist/better-auth/database-adapter/repository/generic.d.ts +45 -0
  13. package/dist/better-auth/database-adapter/repository/generic.d.ts.map +1 -0
  14. package/dist/better-auth/database-adapter/repository/index.d.ts +6 -0
  15. package/dist/better-auth/database-adapter/repository/index.d.ts.map +1 -0
  16. package/dist/better-auth/database-adapter/repository/session.d.ts +29 -0
  17. package/dist/better-auth/database-adapter/repository/session.d.ts.map +1 -0
  18. package/dist/better-auth/database-adapter/repository/user.d.ts +30 -0
  19. package/dist/better-auth/database-adapter/repository/user.d.ts.map +1 -0
  20. package/dist/better-auth/database-adapter/repository/verification.d.ts +18 -0
  21. package/dist/better-auth/database-adapter/repository/verification.d.ts.map +1 -0
  22. package/dist/better-auth/database-adapter/schema.d.ts +27 -0
  23. package/dist/better-auth/database-adapter/schema.d.ts.map +1 -0
  24. package/dist/better-auth/database-adapter/tests/index.test.d.ts +2 -0
  25. package/dist/better-auth/database-adapter/tests/index.test.d.ts.map +1 -0
  26. package/dist/better-auth/database-adapter/tests/repository/account.test.d.ts +2 -0
  27. package/dist/better-auth/database-adapter/tests/repository/account.test.d.ts.map +1 -0
  28. package/dist/better-auth/database-adapter/tests/repository/generic.test.d.ts +2 -0
  29. package/dist/better-auth/database-adapter/tests/repository/generic.test.d.ts.map +1 -0
  30. package/dist/better-auth/database-adapter/tests/repository/session.test.d.ts +2 -0
  31. package/dist/better-auth/database-adapter/tests/repository/session.test.d.ts.map +1 -0
  32. package/dist/better-auth/database-adapter/tests/repository/user.test.d.ts +2 -0
  33. package/dist/better-auth/database-adapter/tests/repository/user.test.d.ts.map +1 -0
  34. package/dist/better-auth/database-adapter/tests/repository/verification.test.d.ts +2 -0
  35. package/dist/better-auth/database-adapter/tests/repository/verification.test.d.ts.map +1 -0
  36. package/dist/better-auth/database-adapter/tests/sync-utils.d.ts +16 -0
  37. package/dist/better-auth/database-adapter/tests/sync-utils.d.ts.map +1 -0
  38. package/dist/better-auth/database-adapter/tests/utils.test.d.ts +2 -0
  39. package/dist/better-auth/database-adapter/tests/utils.test.d.ts.map +1 -0
  40. package/dist/better-auth/database-adapter/utils.d.ts +16 -0
  41. package/dist/better-auth/database-adapter/utils.d.ts.map +1 -0
  42. package/dist/{chunk-GRN6OAUX.js → chunk-OTWWOZMB.js} +73 -4
  43. package/dist/chunk-OTWWOZMB.js.map +1 -0
  44. package/dist/index.js +1 -1
  45. package/dist/react/index.js +2 -0
  46. package/dist/react/index.js.map +1 -1
  47. package/dist/react/media/image.d.ts.map +1 -1
  48. package/dist/react-native-core/index.js +3 -1
  49. package/dist/react-native-core/index.js.map +1 -1
  50. package/dist/react-native-core/media/image.d.ts.map +1 -1
  51. package/dist/svelte/media/image.svelte +104 -98
  52. package/dist/svelte/media/image.svelte.d.ts.map +1 -1
  53. package/dist/svelte/tests/media/image.svelte.test.js +16 -2
  54. package/dist/testing.js +1 -1
  55. package/dist/tools/implementation/refs.d.ts +1 -1
  56. package/dist/tools/implementation/refs.d.ts.map +1 -1
  57. package/dist/tools/subscribe/CoValueCoreSubscription.d.ts +4 -0
  58. package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -1
  59. package/dist/tools/subscribe/SubscriptionScope.d.ts +7 -0
  60. package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
  61. package/dist/tools/subscribe/index.d.ts.map +1 -1
  62. package/jazz-tools-0.18.6.tgz +0 -0
  63. package/package.json +10 -5
  64. package/src/better-auth/database-adapter/index.ts +228 -0
  65. package/src/better-auth/database-adapter/repository/account.ts +131 -0
  66. package/src/better-auth/database-adapter/repository/generic.ts +297 -0
  67. package/src/better-auth/database-adapter/repository/index.ts +5 -0
  68. package/src/better-auth/database-adapter/repository/session.ts +190 -0
  69. package/src/better-auth/database-adapter/repository/user.ts +158 -0
  70. package/src/better-auth/database-adapter/repository/verification.ts +37 -0
  71. package/src/better-auth/database-adapter/schema.ts +222 -0
  72. package/src/better-auth/database-adapter/tests/index.test.ts +690 -0
  73. package/src/better-auth/database-adapter/tests/repository/account.test.ts +149 -0
  74. package/src/better-auth/database-adapter/tests/repository/generic.test.ts +183 -0
  75. package/src/better-auth/database-adapter/tests/repository/session.test.ts +419 -0
  76. package/src/better-auth/database-adapter/tests/repository/user.test.ts +673 -0
  77. package/src/better-auth/database-adapter/tests/repository/verification.test.ts +101 -0
  78. package/src/better-auth/database-adapter/tests/sync-utils.ts +127 -0
  79. package/src/better-auth/database-adapter/tests/utils.test.ts +787 -0
  80. package/src/better-auth/database-adapter/utils.ts +178 -0
  81. package/src/react/media/image.tsx +2 -0
  82. package/src/react/tests/media/image.test.tsx +20 -2
  83. package/src/react-native-core/media/image.tsx +4 -1
  84. package/src/svelte/media/image.svelte +104 -98
  85. package/src/svelte/tests/media/image.svelte.test.ts +18 -2
  86. package/src/tools/implementation/refs.ts +27 -3
  87. package/src/tools/subscribe/CoValueCoreSubscription.ts +14 -0
  88. package/src/tools/subscribe/SubscriptionScope.ts +62 -1
  89. package/src/tools/subscribe/index.ts +8 -0
  90. package/tsup.config.ts +7 -0
  91. package/dist/chunk-GRN6OAUX.js.map +0 -1
@@ -1,118 +1,122 @@
1
1
  <script lang="ts">
2
- import { ImageDefinition } from "jazz-tools";
3
- import { highestResAvailable } from "jazz-tools/media";
4
- import { onDestroy } from "svelte";
5
- import { CoState } from "../jazz.class.svelte";
6
- import type { ImageProps } from "./image.types.js";
7
-
8
- const { imageId, width, height, ...rest }: ImageProps = $props();
9
-
10
- const imageState = new CoState(ImageDefinition, () => imageId);
11
- let lastBestImage: [string, string] | null = null;
12
-
13
- /**
14
- * For lazy loading, we use the browser's strategy for images with loading="lazy".
15
- * We use an empty image, and when the browser triggers the load event, we load the best available image.
16
- * On page loading, if the image url is already in browser's cache, the load event is triggered immediately.
17
- * This is why we need to use a different blob url for every image.
18
- */
19
- let waitingLazyLoading = $state(rest.loading === "lazy");
20
- const lazyPlaceholder = $derived.by(() =>
21
- waitingLazyLoading ? URL.createObjectURL(emptyPixelBlob) : undefined,
22
- );
23
-
24
- const dimensions = $derived.by<{
25
- width: number | undefined;
26
- height: number | undefined;
27
- }>(() => {
28
- const originalWidth = imageState.current?.originalSize?.[0];
29
- const originalHeight = imageState.current?.originalSize?.[1];
30
-
31
- // Both width and height are "original"
32
- if (width === "original" && height === "original") {
33
- return { width: originalWidth, height: originalHeight };
34
- }
2
+ import { ImageDefinition } from "jazz-tools";
3
+ import { highestResAvailable } from "jazz-tools/media";
4
+ import { onDestroy } from "svelte";
5
+ import { CoState } from "../jazz.class.svelte";
6
+ import type { ImageProps } from "./image.types.js";
7
+
8
+ const { imageId, width, height, ...rest }: ImageProps = $props();
9
+
10
+ const imageState = new CoState(ImageDefinition, () => imageId);
11
+ let lastBestImage: [string, string] | null = null;
12
+
13
+ /**
14
+ * For lazy loading, we use the browser's strategy for images with loading="lazy".
15
+ * We use an empty image, and when the browser triggers the load event, we load the best available image.
16
+ * On page loading, if the image url is already in browser's cache, the load event is triggered immediately.
17
+ * This is why we need to use a different blob url for every image.
18
+ */
19
+ let waitingLazyLoading = $state(rest.loading === "lazy");
20
+ const lazyPlaceholder = $derived.by(() =>
21
+ waitingLazyLoading ? URL.createObjectURL(emptyPixelBlob) : undefined,
22
+ );
23
+
24
+ const dimensions = $derived.by<{
25
+ width: number | undefined;
26
+ height: number | undefined;
27
+ }>(() => {
28
+ const originalWidth = imageState.current?.originalSize?.[0];
29
+ const originalHeight = imageState.current?.originalSize?.[1];
35
30
 
36
- // Width is "original", height is a number
37
- if (width === "original" && typeof height === "number") {
38
- if (originalWidth && originalHeight) {
39
- return {
40
- width: Math.round((height * originalWidth) / originalHeight),
41
- height,
42
- };
31
+ // Both width and height are "original"
32
+ if (width === "original" && height === "original") {
33
+ return { width: originalWidth, height: originalHeight };
43
34
  }
44
- return { width: undefined, height };
45
- }
46
35
 
47
- // Height is "original", width is a number
48
- if (height === "original" && typeof width === "number") {
49
- if (originalWidth && originalHeight) {
50
- return {
51
- width,
52
- height: Math.round((width * originalHeight) / originalWidth),
53
- };
36
+ // Width is "original", height is a number
37
+ if (width === "original" && typeof height === "number") {
38
+ if (originalWidth && originalHeight) {
39
+ return {
40
+ width: Math.round((height * originalWidth) / originalHeight),
41
+ height,
42
+ };
43
+ }
44
+ return { width: undefined, height };
54
45
  }
55
- return { width, height: undefined };
56
- }
57
46
 
58
- // In all other cases, use the property value:
59
- return {
60
- width: width === "original" ? originalWidth : width,
61
- height: height === "original" ? originalHeight : height,
62
- };
63
- });
47
+ // Height is "original", width is a number
48
+ if (height === "original" && typeof width === "number") {
49
+ if (originalWidth && originalHeight) {
50
+ return {
51
+ width,
52
+ height: Math.round((width * originalHeight) / originalWidth),
53
+ };
54
+ }
55
+ return { width, height: undefined };
56
+ }
64
57
 
65
- const src = $derived.by(() => {
66
- if (waitingLazyLoading) {
67
- return lazyPlaceholder;
68
- }
58
+ // In all other cases, use the property value:
59
+ return {
60
+ width: width === "original" ? originalWidth : width,
61
+ height: height === "original" ? originalHeight : height,
62
+ };
63
+ });
69
64
 
70
- const image = imageState.current;
71
- if (!image) return undefined;
65
+ const src = $derived.by(() => {
66
+ if (waitingLazyLoading) {
67
+ return lazyPlaceholder;
68
+ }
72
69
 
73
- const bestImage = highestResAvailable(
74
- image,
75
- dimensions.width || dimensions.height || 9999,
76
- dimensions.height || dimensions.width || 9999,
77
- );
70
+ const image = imageState.current;
71
+ if (image === undefined)
72
+ return "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==";
78
73
 
79
- if (!bestImage) return image.placeholderDataURL;
80
- if (lastBestImage?.[0] === bestImage.image.$jazz.id) return lastBestImage?.[1];
74
+ if (!image) return undefined;
81
75
 
82
- const blob = bestImage.image.toBlob();
76
+ const bestImage = highestResAvailable(
77
+ image,
78
+ dimensions.width || dimensions.height || 9999,
79
+ dimensions.height || dimensions.width || 9999,
80
+ );
83
81
 
84
- if (blob) {
85
- const url = URL.createObjectURL(blob);
86
- revokeObjectURL(lastBestImage?.[1]);
87
- lastBestImage = [bestImage.image.$jazz.id, url];
88
- return url;
89
- }
82
+ if (!bestImage) return image.placeholderDataURL;
83
+ if (lastBestImage?.[0] === bestImage.image.$jazz.id)
84
+ return lastBestImage?.[1];
85
+
86
+ const blob = bestImage.image.toBlob();
87
+
88
+ if (blob) {
89
+ const url = URL.createObjectURL(blob);
90
+ revokeObjectURL(lastBestImage?.[1]);
91
+ lastBestImage = [bestImage.image.$jazz.id, url];
92
+ return url;
93
+ }
90
94
 
91
- return image.placeholderDataURL;
92
- });
95
+ return image.placeholderDataURL;
96
+ });
93
97
 
94
- // Cleanup object URL on component destroy
95
- onDestroy(() => {
96
- revokeObjectURL(lastBestImage?.[1]);
97
- });
98
+ // Cleanup object URL on component destroy
99
+ onDestroy(() => {
100
+ revokeObjectURL(lastBestImage?.[1]);
101
+ });
98
102
 
99
- function revokeObjectURL(url: string | undefined) {
100
- if (url && url.startsWith("blob:")) {
101
- URL.revokeObjectURL(url);
103
+ function revokeObjectURL(url: string | undefined) {
104
+ if (url && url.startsWith("blob:")) {
105
+ URL.revokeObjectURL(url);
106
+ }
102
107
  }
103
- }
104
108
 
105
- const emptyPixelBlob = new Blob(
106
- [
107
- Uint8Array.from(
108
- atob(
109
- "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
109
+ const emptyPixelBlob = new Blob(
110
+ [
111
+ Uint8Array.from(
112
+ atob(
113
+ "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8/5+hHgAHggJ/PchI7wAAAABJRU5ErkJggg==",
114
+ ),
115
+ (c) => c.charCodeAt(0),
110
116
  ),
111
- (c) => c.charCodeAt(0),
112
- ),
113
- ],
114
- { type: "image/png" },
115
- );
117
+ ],
118
+ { type: "image/png" },
119
+ );
116
120
  </script>
117
121
 
118
122
  <img
@@ -120,6 +124,8 @@ const emptyPixelBlob = new Blob(
120
124
  width={dimensions.width}
121
125
  height={dimensions.height}
122
126
  alt={rest.alt}
123
- onload={() => {waitingLazyLoading = false}}
127
+ onload={() => {
128
+ waitingLazyLoading = false;
129
+ }}
124
130
  {...rest}
125
131
  />
@@ -1 +1 @@
1
- {"version":3,"file":"image.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/media/image.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AA2HnD,QAAA,MAAM,KAAK,gDAAsC,CAAC;AAClD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"image.svelte.d.ts","sourceRoot":"","sources":["../../../../src/svelte/media/image.svelte.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAiInD,QAAA,MAAM,KAAK,gDAAsC,CAAC;AAClD,KAAK,KAAK,GAAG,UAAU,CAAC,OAAO,KAAK,CAAC,CAAC;AACtC,eAAe,KAAK,CAAC"}
@@ -10,7 +10,7 @@ describe("Image", async () => {
10
10
  });
11
11
  const renderWithAccount = (props) => render(Image, props, { account });
12
12
  describe("initial rendering", () => {
13
- it("should render nothing if coValue is not found", async () => {
13
+ it("should render a blank placeholder while waiting for the coValue to load", async () => {
14
14
  const { container } = renderWithAccount({
15
15
  imageId: "co_zMTubMby3QiKDYnW9e2BEXW7Xaq",
16
16
  alt: "test",
@@ -20,7 +20,21 @@ describe("Image", async () => {
20
20
  expect(img.getAttribute("width")).toBe(null);
21
21
  expect(img.getAttribute("height")).toBe(null);
22
22
  expect(img.alt).toBe("test");
23
- expect(img.src).toBe("");
23
+ expect(img.src).toBe("data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==");
24
+ });
25
+ it("should render nothing if coValue is not found", async () => {
26
+ const { container } = renderWithAccount({
27
+ imageId: "co_zMTubMby3QiKDYnW9e2BEXW7Xaq",
28
+ alt: "test",
29
+ });
30
+ await waitFor(() => {
31
+ const img = container.querySelector("img");
32
+ expect(img).toBeDefined();
33
+ expect(img.getAttribute("width")).toBe(null);
34
+ expect(img.getAttribute("height")).toBe(null);
35
+ expect(img.alt).toBe("test");
36
+ expect(img.src).toBe("");
37
+ });
24
38
  });
25
39
  it("should render an empty image if the image is not loaded yet", async () => {
26
40
  const original = FileStream.create({ owner: account.$jazz.owner });
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.18.15 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.18.17 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -32,6 +32,10 @@
32
32
  CLI Using tsconfig: tsconfig.json
33
33
  CLI Building entry: {"client":"src/better-auth/auth/client.ts","server":"src/better-auth/auth/server.ts","react":"src/better-auth/auth/react.tsx"}
34
34
  CLI Using tsconfig: tsconfig.json
35
+ CLI Building entry: {"index":"src/better-auth/database-adapter/index.ts"}
36
+ CLI Using tsconfig: tsconfig.json
37
+ CLI tsup v8.5.0
38
+ CLI Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
35
39
  CLI tsup v8.5.0
36
40
  CLI Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
37
41
  CLI tsup v8.5.0
@@ -77,6 +81,9 @@
77
81
  CLI Target: es2021
78
82
  CLI Target: es2021
79
83
  CLI Target: es2021
84
+ CLI Target: es2021
85
+ CLI Cleaning output folder
86
+ ESM Build start
80
87
  CLI Cleaning output folder
81
88
  ESM Build start
82
89
  CLI Cleaning output folder
@@ -109,93 +116,96 @@
109
116
  ESM Build start
110
117
  ESM dist/react/ssr.js 688.00 B
111
118
  ESM dist/react/ssr.js.map 1.12 KB
112
- ESM ⚡️ Build success in 15ms
119
+ ESM ⚡️ Build success in 20ms
113
120
  ESM dist/tiptap/index.js 564.00 B
114
121
  ESM dist/tiptap/index.js.map 1.21 KB
115
- ESM ⚡️ Build success in 13ms
122
+ ESM ⚡️ Build success in 15ms
116
123
  ESM dist/worker/index.js 3.19 KB
117
124
  ESM dist/worker/edge-wasm.js 215.00 B
118
125
  ESM dist/worker/index.js.map 6.17 KB
119
126
  ESM dist/worker/edge-wasm.js.map 434.00 B
120
- ESM ⚡️ Build success in 20ms
121
- ESM dist/better-auth/auth/client.js 4.44 KB
122
- ESM dist/better-auth/auth/server.js 8.36 KB
123
- ESM dist/better-auth/auth/react.js 799.00 B
124
- ESM dist/better-auth/auth/client.js.map 8.24 KB
125
- ESM dist/better-auth/auth/server.js.map 15.29 KB
126
- ESM dist/better-auth/auth/react.js.map 2.04 KB
127
- ESM ⚡️ Build success in 20ms
127
+ ESM ⚡️ Build success in 16ms
128
128
  ESM dist/media/index.js 236.00 B
129
129
  ESM dist/media/index.browser.js 2.79 KB
130
- ESM dist/media/index.server.js 2.95 KB
131
130
  ESM dist/media/index.native.js 2.90 KB
131
+ ESM dist/media/index.server.js 2.95 KB
132
132
  ESM dist/media/chunk-W3S526L3.js 6.47 KB
133
133
  ESM dist/media/index.js.map 71.00 B
134
134
  ESM dist/media/index.browser.js.map 6.15 KB
135
- ESM dist/media/index.server.js.map 6.37 KB
136
135
  ESM dist/media/index.native.js.map 6.09 KB
136
+ ESM dist/media/index.server.js.map 6.37 KB
137
137
  ESM dist/media/chunk-W3S526L3.js.map 16.57 KB
138
- ESM ⚡️ Build success in 28ms
139
- ESM dist/browser/index.js 13.64 KB
140
- ESM dist/browser/index.js.map 29.14 KB
141
138
  ESM ⚡️ Build success in 31ms
139
+ ESM dist/better-auth/auth/client.js 4.44 KB
140
+ ESM dist/better-auth/auth/react.js 799.00 B
141
+ ESM dist/better-auth/auth/server.js 8.36 KB
142
+ ESM dist/better-auth/auth/client.js.map 8.24 KB
143
+ ESM dist/better-auth/auth/react.js.map 2.04 KB
144
+ ESM dist/better-auth/auth/server.js.map 15.29 KB
145
+ ESM ⚡️ Build success in 27ms
142
146
  ESM dist/react-native/index.js 2.53 KB
143
- ESM dist/react-native/testing.js 120.00 B
144
147
  ESM dist/react-native/crypto.js 161.00 B
148
+ ESM dist/react-native/testing.js 120.00 B
145
149
  ESM dist/react-native/index.js.map 5.68 KB
146
- ESM dist/react-native/testing.js.map 176.00 B
147
150
  ESM dist/react-native/crypto.js.map 197.00 B
148
- ESM ⚡️ Build success in 30ms
151
+ ESM dist/react-native/testing.js.map 176.00 B
152
+ ESM ⚡️ Build success in 35ms
149
153
  ESM dist/react-core/index.js 10.72 KB
150
154
  ESM dist/react-core/testing.js 1.17 KB
151
155
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
152
156
  ESM dist/react-core/index.js.map 33.90 KB
153
157
  ESM dist/react-core/testing.js.map 1.82 KB
154
158
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
155
- ESM ⚡️ Build success in 33ms
159
+ ESM ⚡️ Build success in 32ms
156
160
  ESM dist/expo/index.js 4.68 KB
157
161
  ESM dist/expo/testing.js 112.00 B
158
162
  ESM dist/expo/crypto.js 153.00 B
159
163
  ESM dist/expo/index.js.map 10.23 KB
160
164
  ESM dist/expo/testing.js.map 168.00 B
161
165
  ESM dist/expo/crypto.js.map 189.00 B
162
- ESM ⚡️ Build success in 38ms
163
- ESM dist/prosemirror/index.js 77.76 KB
164
- ESM dist/prosemirror/index.js.map 307.20 KB
166
+ ESM ⚡️ Build success in 44ms
167
+ ESM dist/browser/index.js 13.64 KB
168
+ ESM dist/browser/index.js.map 29.14 KB
165
169
  ESM ⚡️ Build success in 46ms
166
- ESM dist/react/index.js 24.76 KB
167
- ESM dist/react/testing.js 122.00 B
168
- ESM dist/react/testing.js.map 165.00 B
169
- ESM dist/react/index.js.map 53.56 KB
170
- ESM ⚡️ Build success in 45ms
171
- ESM dist/react-native-core/index.js 18.03 KB
170
+ ESM dist/better-auth/database-adapter/index.js 26.34 KB
171
+ ESM dist/better-auth/database-adapter/index.js.map 57.62 KB
172
+ ESM ⚡️ Build success in 39ms
173
+ ESM dist/react-native-core/index.js 18.13 KB
172
174
  ESM dist/react-native-core/crypto.js 2.10 KB
173
175
  ESM dist/react-native-core/testing.js 119.00 B
174
- ESM dist/react-native-core/index.js.map 36.85 KB
176
+ ESM dist/react-native-core/index.js.map 36.96 KB
175
177
  ESM dist/react-native-core/crypto.js.map 4.25 KB
176
178
  ESM dist/react-native-core/testing.js.map 175.00 B
177
- ESM ⚡️ Build success in 45ms
179
+ ESM ⚡️ Build success in 51ms
180
+ ESM dist/react/index.js 24.88 KB
181
+ ESM dist/react/testing.js 122.00 B
182
+ ESM dist/react/testing.js.map 165.00 B
183
+ ESM dist/react/index.js.map 53.71 KB
184
+ ESM ⚡️ Build success in 52ms
185
+ ESM dist/prosemirror/index.js 77.76 KB
186
+ ESM dist/prosemirror/index.js.map 307.20 KB
187
+ ESM ⚡️ Build success in 54ms
178
188
  ESM dist/inspector/index.js 69.71 KB
179
189
  ESM dist/inspector/index.js.map 121.38 KB
180
190
  ESM ⚡️ Build success in 64ms
181
- ESM dist/index.js 26.13 KB
191
+ ESM dist/chunk-OTWWOZMB.js 176.08 KB
182
192
  ESM dist/testing.js 7.17 KB
183
- ESM dist/chunk-GRN6OAUX.js 174.37 KB
193
+ ESM dist/index.js 26.13 KB
194
+ ESM dist/chunk-OTWWOZMB.js.map 419.55 KB
184
195
  ESM dist/testing.js.map 14.10 KB
185
196
  ESM dist/index.js.map 52.92 KB
186
- ESM dist/chunk-GRN6OAUX.js.map 415.70 KB
187
- ESM ⚡️ Build success in 77ms
197
+ ESM ⚡️ Build success in 82ms
188
198
  ESM dist/inspector/register-custom-element.js 218.00 B
189
199
  ESM dist/inspector/register-custom-element.js.map 314.00 B
190
200
  ESM dist/inspector/custom-element-G6SPZEBR.js 1.54 MB
191
201
  ESM dist/inspector/custom-element-G6SPZEBR.js.map 2.36 MB
192
- ESM ⚡️ Build success in 110ms
202
+ ESM ⚡️ Build success in 123ms
193
203
 
194
- > jazz-tools@0.18.15 types /home/runner/_work/jazz/jazz/packages/jazz-tools
204
+ > jazz-tools@0.18.17 types /home/runner/_work/jazz/jazz/packages/jazz-tools
195
205
  > tsc --outDir dist
196
206
 
197
207
 
198
- > jazz-tools@0.18.15 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
208
+ > jazz-tools@0.18.17 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
199
209
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
200
210
 
201
211
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.18.17
4
+
5
+ ### Patch Changes
6
+
7
+ - 75d1afa: Fix an issue where a flash of alt text displays while an image definition is loading from storage
8
+ - 8aa4acd: Optimized the inactive subscriptions, improving performance of updates on created and loaded values by 2.5x
9
+ - Updated dependencies [925da72]
10
+ - cojson@0.18.17
11
+ - cojson-storage-indexeddb@0.18.17
12
+ - cojson-transport-ws@0.18.17
13
+
14
+ ## 0.18.16
15
+
16
+ ### Patch Changes
17
+
18
+ - 67b95b7: Introduced new Better Auth database adapter based on Jazz
19
+ - cojson@0.18.16
20
+ - cojson-storage-indexeddb@0.18.16
21
+ - cojson-transport-ws@0.18.16
22
+
3
23
  ## 0.18.15
4
24
 
5
25
  ### Patch Changes
@@ -0,0 +1,50 @@
1
+ import { type AdapterDebugLogs, createAdapter } from "better-auth/adapters";
2
+ export interface JazzAdapterConfig {
3
+ /**
4
+ * Helps you debug issues with the adapter.
5
+ */
6
+ debugLogs?: AdapterDebugLogs;
7
+ /**
8
+ * The sync server to use.
9
+ */
10
+ syncServer: string;
11
+ /**
12
+ * The worker account ID to use.
13
+ */
14
+ accountID: string;
15
+ /**
16
+ * The worker account secret to use.
17
+ */
18
+ accountSecret: string;
19
+ }
20
+ /**
21
+ * Creates a Better Auth database adapter that integrates with Jazz framework.
22
+ *
23
+ * This adapter provides a seamless integration between Better Auth and Jazz,
24
+ * allowing you to use Jazz as database for for Better Auth's authentication system.
25
+ *
26
+ * @param config - Configuration object for the Jazz Better Auth adapter
27
+ * @param config.syncServer - The Jazz sync server URL to connect to (e.g., "wss://your-sync-server.com")
28
+ * @param config.accountID - The worker account ID for the Jazz worker that will handle auth operations
29
+ * @param config.accountSecret - The worker account secret for authenticating with the Jazz sync server
30
+ * @param config.debugLogs - Optional debug logging configuration to help troubleshoot adapter issues
31
+ *
32
+ * @returns A Better Auth adapter instance configured to work with Jazz
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * import { JazzBetterAuthDatabaseAdapter } from "jazz-tools/better-auth/database-adapter";
37
+ * import { createAuth } from "better-auth";
38
+ *
39
+ * const auth = createAuth({
40
+ * adapter: JazzBetterAuthDatabaseAdapter({
41
+ * syncServer: "wss://your-jazz-sync-server.com",
42
+ * accountID: "auth-worker-account-id",
43
+ * accountSecret: "your-worker-account-secret",
44
+ * }),
45
+ * // ... other auth configuration
46
+ * });
47
+ * ```
48
+ */
49
+ export declare const JazzBetterAuthDatabaseAdapter: (config: JazzAdapterConfig) => ReturnType<typeof createAdapter>;
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/better-auth/database-adapter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAY5E,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,gBAAgB,CAAC;IAC7B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,eAAO,MAAM,6BAA6B,WAChC,iBAAiB,KACxB,UAAU,CAAC,OAAO,aAAa,CAqK9B,CAAC"}