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.
- package/.svelte-kit/__package__/media/image.svelte +104 -98
- package/.svelte-kit/__package__/media/image.svelte.d.ts.map +1 -1
- package/.svelte-kit/__package__/tests/media/image.svelte.test.js +16 -2
- package/.turbo/turbo-build.log +48 -38
- package/CHANGELOG.md +20 -0
- package/dist/better-auth/database-adapter/index.d.ts +50 -0
- package/dist/better-auth/database-adapter/index.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/index.js +920 -0
- package/dist/better-auth/database-adapter/index.js.map +1 -0
- package/dist/better-auth/database-adapter/repository/account.d.ts +24 -0
- package/dist/better-auth/database-adapter/repository/account.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/repository/generic.d.ts +45 -0
- package/dist/better-auth/database-adapter/repository/generic.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/repository/index.d.ts +6 -0
- package/dist/better-auth/database-adapter/repository/index.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/repository/session.d.ts +29 -0
- package/dist/better-auth/database-adapter/repository/session.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/repository/user.d.ts +30 -0
- package/dist/better-auth/database-adapter/repository/user.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/repository/verification.d.ts +18 -0
- package/dist/better-auth/database-adapter/repository/verification.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/schema.d.ts +27 -0
- package/dist/better-auth/database-adapter/schema.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/index.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/index.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/repository/account.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/repository/account.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/repository/generic.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/repository/generic.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/repository/session.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/repository/session.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/repository/user.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/repository/user.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/repository/verification.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/repository/verification.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/sync-utils.d.ts +16 -0
- package/dist/better-auth/database-adapter/tests/sync-utils.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/tests/utils.test.d.ts +2 -0
- package/dist/better-auth/database-adapter/tests/utils.test.d.ts.map +1 -0
- package/dist/better-auth/database-adapter/utils.d.ts +16 -0
- package/dist/better-auth/database-adapter/utils.d.ts.map +1 -0
- package/dist/{chunk-GRN6OAUX.js → chunk-OTWWOZMB.js} +73 -4
- package/dist/chunk-OTWWOZMB.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/react/index.js +2 -0
- package/dist/react/index.js.map +1 -1
- package/dist/react/media/image.d.ts.map +1 -1
- package/dist/react-native-core/index.js +3 -1
- package/dist/react-native-core/index.js.map +1 -1
- package/dist/react-native-core/media/image.d.ts.map +1 -1
- package/dist/svelte/media/image.svelte +104 -98
- package/dist/svelte/media/image.svelte.d.ts.map +1 -1
- package/dist/svelte/tests/media/image.svelte.test.js +16 -2
- package/dist/testing.js +1 -1
- package/dist/tools/implementation/refs.d.ts +1 -1
- package/dist/tools/implementation/refs.d.ts.map +1 -1
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts +4 -0
- package/dist/tools/subscribe/CoValueCoreSubscription.d.ts.map +1 -1
- package/dist/tools/subscribe/SubscriptionScope.d.ts +7 -0
- package/dist/tools/subscribe/SubscriptionScope.d.ts.map +1 -1
- package/dist/tools/subscribe/index.d.ts.map +1 -1
- package/jazz-tools-0.18.6.tgz +0 -0
- package/package.json +10 -5
- package/src/better-auth/database-adapter/index.ts +228 -0
- package/src/better-auth/database-adapter/repository/account.ts +131 -0
- package/src/better-auth/database-adapter/repository/generic.ts +297 -0
- package/src/better-auth/database-adapter/repository/index.ts +5 -0
- package/src/better-auth/database-adapter/repository/session.ts +190 -0
- package/src/better-auth/database-adapter/repository/user.ts +158 -0
- package/src/better-auth/database-adapter/repository/verification.ts +37 -0
- package/src/better-auth/database-adapter/schema.ts +222 -0
- package/src/better-auth/database-adapter/tests/index.test.ts +690 -0
- package/src/better-auth/database-adapter/tests/repository/account.test.ts +149 -0
- package/src/better-auth/database-adapter/tests/repository/generic.test.ts +183 -0
- package/src/better-auth/database-adapter/tests/repository/session.test.ts +419 -0
- package/src/better-auth/database-adapter/tests/repository/user.test.ts +673 -0
- package/src/better-auth/database-adapter/tests/repository/verification.test.ts +101 -0
- package/src/better-auth/database-adapter/tests/sync-utils.ts +127 -0
- package/src/better-auth/database-adapter/tests/utils.test.ts +787 -0
- package/src/better-auth/database-adapter/utils.ts +178 -0
- package/src/react/media/image.tsx +2 -0
- package/src/react/tests/media/image.test.tsx +20 -2
- package/src/react-native-core/media/image.tsx +4 -1
- package/src/svelte/media/image.svelte +104 -98
- package/src/svelte/tests/media/image.svelte.test.ts +18 -2
- package/src/tools/implementation/refs.ts +27 -3
- package/src/tools/subscribe/CoValueCoreSubscription.ts +14 -0
- package/src/tools/subscribe/SubscriptionScope.ts +62 -1
- package/src/tools/subscribe/index.ts +8 -0
- package/tsup.config.ts +7 -0
- 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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
let waitingLazyLoading = $state(rest.loading === "lazy");
|
20
|
-
const lazyPlaceholder = $derived.by(() =>
|
21
|
-
|
22
|
-
);
|
23
|
-
|
24
|
-
const dimensions = $derived.by<{
|
25
|
-
|
26
|
-
|
27
|
-
}>(() => {
|
28
|
-
|
29
|
-
|
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
|
-
|
37
|
-
|
38
|
-
|
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
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
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
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
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
|
-
|
66
|
-
|
67
|
-
|
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
|
71
|
-
|
65
|
+
const src = $derived.by(() => {
|
66
|
+
if (waitingLazyLoading) {
|
67
|
+
return lazyPlaceholder;
|
68
|
+
}
|
72
69
|
|
73
|
-
|
74
|
-
image
|
75
|
-
|
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
|
-
|
80
|
-
if (lastBestImage?.[0] === bestImage.image.$jazz.id) return lastBestImage?.[1];
|
74
|
+
if (!image) return undefined;
|
81
75
|
|
82
|
-
|
76
|
+
const bestImage = highestResAvailable(
|
77
|
+
image,
|
78
|
+
dimensions.width || dimensions.height || 9999,
|
79
|
+
dimensions.height || dimensions.width || 9999,
|
80
|
+
);
|
83
81
|
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
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
|
-
|
92
|
-
});
|
95
|
+
return image.placeholderDataURL;
|
96
|
+
});
|
93
97
|
|
94
|
-
// Cleanup object URL on component destroy
|
95
|
-
onDestroy(() => {
|
96
|
-
|
97
|
-
});
|
98
|
+
// Cleanup object URL on component destroy
|
99
|
+
onDestroy(() => {
|
100
|
+
revokeObjectURL(lastBestImage?.[1]);
|
101
|
+
});
|
98
102
|
|
99
|
-
function revokeObjectURL(url: string | undefined) {
|
100
|
-
|
101
|
-
|
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
|
-
|
108
|
-
|
109
|
-
|
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
|
-
|
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={() => {
|
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;
|
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
|
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 });
|
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.18.
|
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
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -32,6 +32,10 @@
|
|
32
32
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
33
33
|
[34mCLI[39m 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
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
35
|
+
[34mCLI[39m Building entry: {"index":"src/better-auth/database-adapter/index.ts"}
|
36
|
+
[34mCLI[39m Using tsconfig: tsconfig.json
|
37
|
+
[34mCLI[39m tsup v8.5.0
|
38
|
+
[34mCLI[39m Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
|
35
39
|
[34mCLI[39m tsup v8.5.0
|
36
40
|
[34mCLI[39m Using tsup config: /home/runner/_work/jazz/jazz/packages/jazz-tools/tsup.config.ts
|
37
41
|
[34mCLI[39m tsup v8.5.0
|
@@ -77,6 +81,9 @@
|
|
77
81
|
[34mCLI[39m Target: es2021
|
78
82
|
[34mCLI[39m Target: es2021
|
79
83
|
[34mCLI[39m Target: es2021
|
84
|
+
[34mCLI[39m Target: es2021
|
85
|
+
[34mCLI[39m Cleaning output folder
|
86
|
+
[34mESM[39m Build start
|
80
87
|
[34mCLI[39m Cleaning output folder
|
81
88
|
[34mESM[39m Build start
|
82
89
|
[34mCLI[39m Cleaning output folder
|
@@ -109,93 +116,96 @@
|
|
109
116
|
[34mESM[39m Build start
|
110
117
|
[32mESM[39m [1mdist/react/ssr.js [22m[32m688.00 B[39m
|
111
118
|
[32mESM[39m [1mdist/react/ssr.js.map [22m[32m1.12 KB[39m
|
112
|
-
[32mESM[39m ⚡️ Build success in
|
119
|
+
[32mESM[39m ⚡️ Build success in 20ms
|
113
120
|
[32mESM[39m [1mdist/tiptap/index.js [22m[32m564.00 B[39m
|
114
121
|
[32mESM[39m [1mdist/tiptap/index.js.map [22m[32m1.21 KB[39m
|
115
|
-
[32mESM[39m ⚡️ Build success in
|
122
|
+
[32mESM[39m ⚡️ Build success in 15ms
|
116
123
|
[32mESM[39m [1mdist/worker/index.js [22m[32m3.19 KB[39m
|
117
124
|
[32mESM[39m [1mdist/worker/edge-wasm.js [22m[32m215.00 B[39m
|
118
125
|
[32mESM[39m [1mdist/worker/index.js.map [22m[32m6.17 KB[39m
|
119
126
|
[32mESM[39m [1mdist/worker/edge-wasm.js.map [22m[32m434.00 B[39m
|
120
|
-
[32mESM[39m ⚡️ Build success in
|
121
|
-
[32mESM[39m [1mdist/better-auth/auth/client.js [22m[32m4.44 KB[39m
|
122
|
-
[32mESM[39m [1mdist/better-auth/auth/server.js [22m[32m8.36 KB[39m
|
123
|
-
[32mESM[39m [1mdist/better-auth/auth/react.js [22m[32m799.00 B[39m
|
124
|
-
[32mESM[39m [1mdist/better-auth/auth/client.js.map [22m[32m8.24 KB[39m
|
125
|
-
[32mESM[39m [1mdist/better-auth/auth/server.js.map [22m[32m15.29 KB[39m
|
126
|
-
[32mESM[39m [1mdist/better-auth/auth/react.js.map [22m[32m2.04 KB[39m
|
127
|
-
[32mESM[39m ⚡️ Build success in 20ms
|
127
|
+
[32mESM[39m ⚡️ Build success in 16ms
|
128
128
|
[32mESM[39m [1mdist/media/index.js [22m[32m236.00 B[39m
|
129
129
|
[32mESM[39m [1mdist/media/index.browser.js [22m[32m2.79 KB[39m
|
130
|
-
[32mESM[39m [1mdist/media/index.server.js [22m[32m2.95 KB[39m
|
131
130
|
[32mESM[39m [1mdist/media/index.native.js [22m[32m2.90 KB[39m
|
131
|
+
[32mESM[39m [1mdist/media/index.server.js [22m[32m2.95 KB[39m
|
132
132
|
[32mESM[39m [1mdist/media/chunk-W3S526L3.js [22m[32m6.47 KB[39m
|
133
133
|
[32mESM[39m [1mdist/media/index.js.map [22m[32m71.00 B[39m
|
134
134
|
[32mESM[39m [1mdist/media/index.browser.js.map [22m[32m6.15 KB[39m
|
135
|
-
[32mESM[39m [1mdist/media/index.server.js.map [22m[32m6.37 KB[39m
|
136
135
|
[32mESM[39m [1mdist/media/index.native.js.map [22m[32m6.09 KB[39m
|
136
|
+
[32mESM[39m [1mdist/media/index.server.js.map [22m[32m6.37 KB[39m
|
137
137
|
[32mESM[39m [1mdist/media/chunk-W3S526L3.js.map [22m[32m16.57 KB[39m
|
138
|
-
[32mESM[39m ⚡️ Build success in 28ms
|
139
|
-
[32mESM[39m [1mdist/browser/index.js [22m[32m13.64 KB[39m
|
140
|
-
[32mESM[39m [1mdist/browser/index.js.map [22m[32m29.14 KB[39m
|
141
138
|
[32mESM[39m ⚡️ Build success in 31ms
|
139
|
+
[32mESM[39m [1mdist/better-auth/auth/client.js [22m[32m4.44 KB[39m
|
140
|
+
[32mESM[39m [1mdist/better-auth/auth/react.js [22m[32m799.00 B[39m
|
141
|
+
[32mESM[39m [1mdist/better-auth/auth/server.js [22m[32m8.36 KB[39m
|
142
|
+
[32mESM[39m [1mdist/better-auth/auth/client.js.map [22m[32m8.24 KB[39m
|
143
|
+
[32mESM[39m [1mdist/better-auth/auth/react.js.map [22m[32m2.04 KB[39m
|
144
|
+
[32mESM[39m [1mdist/better-auth/auth/server.js.map [22m[32m15.29 KB[39m
|
145
|
+
[32mESM[39m ⚡️ Build success in 27ms
|
142
146
|
[32mESM[39m [1mdist/react-native/index.js [22m[32m2.53 KB[39m
|
143
|
-
[32mESM[39m [1mdist/react-native/testing.js [22m[32m120.00 B[39m
|
144
147
|
[32mESM[39m [1mdist/react-native/crypto.js [22m[32m161.00 B[39m
|
148
|
+
[32mESM[39m [1mdist/react-native/testing.js [22m[32m120.00 B[39m
|
145
149
|
[32mESM[39m [1mdist/react-native/index.js.map [22m[32m5.68 KB[39m
|
146
|
-
[32mESM[39m [1mdist/react-native/testing.js.map [22m[32m176.00 B[39m
|
147
150
|
[32mESM[39m [1mdist/react-native/crypto.js.map [22m[32m197.00 B[39m
|
148
|
-
[32mESM[39m
|
151
|
+
[32mESM[39m [1mdist/react-native/testing.js.map [22m[32m176.00 B[39m
|
152
|
+
[32mESM[39m ⚡️ Build success in 35ms
|
149
153
|
[32mESM[39m [1mdist/react-core/index.js [22m[32m10.72 KB[39m
|
150
154
|
[32mESM[39m [1mdist/react-core/testing.js [22m[32m1.17 KB[39m
|
151
155
|
[32mESM[39m [1mdist/react-core/chunk-7DYMJ74I.js [22m[32m279.00 B[39m
|
152
156
|
[32mESM[39m [1mdist/react-core/index.js.map [22m[32m33.90 KB[39m
|
153
157
|
[32mESM[39m [1mdist/react-core/testing.js.map [22m[32m1.82 KB[39m
|
154
158
|
[32mESM[39m [1mdist/react-core/chunk-7DYMJ74I.js.map [22m[32m533.00 B[39m
|
155
|
-
[32mESM[39m ⚡️ Build success in
|
159
|
+
[32mESM[39m ⚡️ Build success in 32ms
|
156
160
|
[32mESM[39m [1mdist/expo/index.js [22m[32m4.68 KB[39m
|
157
161
|
[32mESM[39m [1mdist/expo/testing.js [22m[32m112.00 B[39m
|
158
162
|
[32mESM[39m [1mdist/expo/crypto.js [22m[32m153.00 B[39m
|
159
163
|
[32mESM[39m [1mdist/expo/index.js.map [22m[32m10.23 KB[39m
|
160
164
|
[32mESM[39m [1mdist/expo/testing.js.map [22m[32m168.00 B[39m
|
161
165
|
[32mESM[39m [1mdist/expo/crypto.js.map [22m[32m189.00 B[39m
|
162
|
-
[32mESM[39m ⚡️ Build success in
|
163
|
-
[32mESM[39m [1mdist/
|
164
|
-
[32mESM[39m [1mdist/
|
166
|
+
[32mESM[39m ⚡️ Build success in 44ms
|
167
|
+
[32mESM[39m [1mdist/browser/index.js [22m[32m13.64 KB[39m
|
168
|
+
[32mESM[39m [1mdist/browser/index.js.map [22m[32m29.14 KB[39m
|
165
169
|
[32mESM[39m ⚡️ Build success in 46ms
|
166
|
-
[32mESM[39m [1mdist/
|
167
|
-
[32mESM[39m [1mdist/
|
168
|
-
[32mESM[39m
|
169
|
-
[32mESM[39m [1mdist/react/index.js
|
170
|
-
[32mESM[39m ⚡️ Build success in 45ms
|
171
|
-
[32mESM[39m [1mdist/react-native-core/index.js [22m[32m18.03 KB[39m
|
170
|
+
[32mESM[39m [1mdist/better-auth/database-adapter/index.js [22m[32m26.34 KB[39m
|
171
|
+
[32mESM[39m [1mdist/better-auth/database-adapter/index.js.map [22m[32m57.62 KB[39m
|
172
|
+
[32mESM[39m ⚡️ Build success in 39ms
|
173
|
+
[32mESM[39m [1mdist/react-native-core/index.js [22m[32m18.13 KB[39m
|
172
174
|
[32mESM[39m [1mdist/react-native-core/crypto.js [22m[32m2.10 KB[39m
|
173
175
|
[32mESM[39m [1mdist/react-native-core/testing.js [22m[32m119.00 B[39m
|
174
|
-
[32mESM[39m [1mdist/react-native-core/index.js.map [22m[32m36.
|
176
|
+
[32mESM[39m [1mdist/react-native-core/index.js.map [22m[32m36.96 KB[39m
|
175
177
|
[32mESM[39m [1mdist/react-native-core/crypto.js.map [22m[32m4.25 KB[39m
|
176
178
|
[32mESM[39m [1mdist/react-native-core/testing.js.map [22m[32m175.00 B[39m
|
177
|
-
[32mESM[39m ⚡️ Build success in
|
179
|
+
[32mESM[39m ⚡️ Build success in 51ms
|
180
|
+
[32mESM[39m [1mdist/react/index.js [22m[32m24.88 KB[39m
|
181
|
+
[32mESM[39m [1mdist/react/testing.js [22m[32m122.00 B[39m
|
182
|
+
[32mESM[39m [1mdist/react/testing.js.map [22m[32m165.00 B[39m
|
183
|
+
[32mESM[39m [1mdist/react/index.js.map [22m[32m53.71 KB[39m
|
184
|
+
[32mESM[39m ⚡️ Build success in 52ms
|
185
|
+
[32mESM[39m [1mdist/prosemirror/index.js [22m[32m77.76 KB[39m
|
186
|
+
[32mESM[39m [1mdist/prosemirror/index.js.map [22m[32m307.20 KB[39m
|
187
|
+
[32mESM[39m ⚡️ Build success in 54ms
|
178
188
|
[32mESM[39m [1mdist/inspector/index.js [22m[32m69.71 KB[39m
|
179
189
|
[32mESM[39m [1mdist/inspector/index.js.map [22m[32m121.38 KB[39m
|
180
190
|
[32mESM[39m ⚡️ Build success in 64ms
|
181
|
-
[32mESM[39m [1mdist/
|
191
|
+
[32mESM[39m [1mdist/chunk-OTWWOZMB.js [22m[32m176.08 KB[39m
|
182
192
|
[32mESM[39m [1mdist/testing.js [22m[32m7.17 KB[39m
|
183
|
-
[32mESM[39m [1mdist/
|
193
|
+
[32mESM[39m [1mdist/index.js [22m[32m26.13 KB[39m
|
194
|
+
[32mESM[39m [1mdist/chunk-OTWWOZMB.js.map [22m[32m419.55 KB[39m
|
184
195
|
[32mESM[39m [1mdist/testing.js.map [22m[32m14.10 KB[39m
|
185
196
|
[32mESM[39m [1mdist/index.js.map [22m[32m52.92 KB[39m
|
186
|
-
[32mESM[39m
|
187
|
-
[32mESM[39m ⚡️ Build success in 77ms
|
197
|
+
[32mESM[39m ⚡️ Build success in 82ms
|
188
198
|
[32mESM[39m [1mdist/inspector/register-custom-element.js [22m[32m218.00 B[39m
|
189
199
|
[32mESM[39m [1mdist/inspector/register-custom-element.js.map [22m[32m314.00 B[39m
|
190
200
|
[32mESM[39m [1mdist/inspector/custom-element-G6SPZEBR.js [22m[32m1.54 MB[39m
|
191
201
|
[32mESM[39m [1mdist/inspector/custom-element-G6SPZEBR.js.map [22m[32m2.36 MB[39m
|
192
|
-
[32mESM[39m ⚡️ Build success in
|
202
|
+
[32mESM[39m ⚡️ Build success in 123ms
|
193
203
|
|
194
|
-
> jazz-tools@0.18.
|
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.
|
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"}
|