Compare commits
86 Commits
custom-log
...
sync-tests
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13f6389559 | ||
|
|
f6ea9bcc50 | ||
|
|
f6f2766eac | ||
|
|
f8f63bface | ||
|
|
5ec561fec4 | ||
|
|
277787cbd2 | ||
|
|
dda4336721 | ||
|
|
064d19b48c | ||
|
|
3ea269f4d8 | ||
|
|
c4b8befe27 | ||
|
|
06f667ef2a | ||
|
|
bac3cc7bf8 | ||
|
|
6ad0a9f886 | ||
|
|
9b12932b66 | ||
|
|
82bb0d51d9 | ||
|
|
39dede92e8 | ||
|
|
84f4e6e48d | ||
|
|
e629dea585 | ||
|
|
2faf22ffff | ||
|
|
2273505a13 | ||
|
|
19eb29d831 | ||
|
|
738c4c2bd7 | ||
|
|
64e2273475 | ||
|
|
5a85c89154 | ||
|
|
8898b10e89 | ||
|
|
dc2d4e25f7 | ||
|
|
9275c4f6c0 | ||
|
|
ac3c2df474 | ||
|
|
681f973d4b | ||
|
|
338be7622f | ||
|
|
1227047b03 | ||
|
|
9afde8d0be | ||
|
|
c2ca1feba0 | ||
|
|
98c265304a | ||
|
|
675e3e8046 | ||
|
|
4acba8c990 | ||
|
|
a93adeb1fe | ||
|
|
cf8773f3de | ||
|
|
3be94ae1e7 | ||
|
|
6a8aa06d18 | ||
|
|
dc17889209 | ||
|
|
55f9d8e120 | ||
|
|
15b9457ed8 | ||
|
|
898297e95c | ||
|
|
0fc4f24cd5 | ||
|
|
63b5ad9edf | ||
|
|
873c3264ca | ||
|
|
34f89e48aa | ||
|
|
b01cc1fe9d | ||
|
|
24b3b6afc1 | ||
|
|
c2eed7e2c4 | ||
|
|
f97ef696e3 | ||
|
|
ad65cb8ab5 | ||
|
|
8d8131410a | ||
|
|
7491711b72 | ||
|
|
5933aa59c1 | ||
|
|
da96bec465 | ||
|
|
483422c0e9 | ||
|
|
3df93cc147 | ||
|
|
d686edfa6c | ||
|
|
497b0ade1f | ||
|
|
86acbcd0d6 | ||
|
|
9111c85445 | ||
|
|
1d87879787 | ||
|
|
7c777f2bdf | ||
|
|
aa8067b8d0 | ||
|
|
bd66cdeb78 | ||
|
|
8d29e50669 | ||
|
|
5a7398d242 | ||
|
|
74b984fbe6 | ||
|
|
f8e00204b4 | ||
|
|
76543df765 | ||
|
|
15d4b2a5f7 | ||
|
|
2e67f91fe0 | ||
|
|
0eb21a3471 | ||
|
|
99e88d3497 | ||
|
|
f09ce70d3c | ||
|
|
7d62e2735f | ||
|
|
56d26222e7 | ||
|
|
bd34084104 | ||
|
|
f5e6fe927d | ||
|
|
93c49639c2 | ||
|
|
aabe7bef34 | ||
|
|
789cf66de2 | ||
|
|
efbf3d84ac | ||
|
|
b90393b43e |
@@ -1,8 +0,0 @@
|
||||
---
|
||||
"cojson-storage-sqlite": patch
|
||||
"cojson-transport-ws": patch
|
||||
"cojson-storage": patch
|
||||
"cojson": patch
|
||||
---
|
||||
|
||||
Wrap all the console logs with a logger class to make possible to customize the logger
|
||||
@@ -1,5 +1,101 @@
|
||||
# chat-rn-clerk
|
||||
|
||||
## 1.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react-native@0.9.20
|
||||
- jazz-react-native-auth-clerk@0.9.20
|
||||
- jazz-react-native-media-images@0.9.20
|
||||
|
||||
## 1.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.19
|
||||
- jazz-react-native-auth-clerk@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-react-native-media-images@0.9.19
|
||||
|
||||
## 1.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.18
|
||||
- jazz-react-native-auth-clerk@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-react-native-media-images@0.9.18
|
||||
|
||||
## 1.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react-native@0.9.17
|
||||
- jazz-react-native-auth-clerk@0.9.17
|
||||
- jazz-react-native-media-images@0.9.17
|
||||
|
||||
## 1.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-react-native-auth-clerk@0.9.16
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react-native@0.9.16
|
||||
- jazz-react-native-media-images@0.9.16
|
||||
|
||||
## 1.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react-native@0.9.15
|
||||
- jazz-react-native-auth-clerk@0.9.15
|
||||
- jazz-react-native-media-images@0.9.15
|
||||
|
||||
## 1.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react-native@0.9.14
|
||||
- jazz-react-native-auth-clerk@0.9.14
|
||||
- jazz-react-native-media-images@0.9.14
|
||||
|
||||
## 1.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.13
|
||||
- jazz-react-native-auth-clerk@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-react-native-media-images@0.9.13
|
||||
|
||||
## 1.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.12
|
||||
- jazz-react-native-auth-clerk@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-react-native-media-images@0.9.12
|
||||
|
||||
## 1.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.11
|
||||
- jazz-react-native-auth-clerk@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-react-native-media-images@0.9.11
|
||||
|
||||
## 1.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "chat-rn-clerk",
|
||||
"main": "index.js",
|
||||
"version": "1.0.51",
|
||||
"version": "1.0.61",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
"start": "expo start",
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
import { useClerk, useUser } from "@clerk/clerk-expo";
|
||||
import { JazzProvider, setupKvStore } from "jazz-react-native";
|
||||
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
|
||||
import React, {
|
||||
createContext,
|
||||
PropsWithChildren,
|
||||
useContext,
|
||||
useEffect,
|
||||
useState,
|
||||
} from "react";
|
||||
import React, { createContext, PropsWithChildren, useContext } from "react";
|
||||
import { Text, View } from "react-native";
|
||||
const AuthContext = createContext<{
|
||||
isAuthenticated: boolean;
|
||||
@@ -27,15 +21,7 @@ export function JazzAndAuth({ children }: PropsWithChildren) {
|
||||
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
|
||||
const clerk = useClerk();
|
||||
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
|
||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isSignedIn && isClerkLoaded && auth) {
|
||||
setIsAuthenticated(true);
|
||||
} else {
|
||||
setIsAuthenticated(false);
|
||||
}
|
||||
}, [isSignedIn, isClerkLoaded, auth]);
|
||||
const isAuthenticated = Boolean(isSignedIn && isClerkLoaded && auth);
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# chat-rn
|
||||
|
||||
## 1.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react-native@0.9.20
|
||||
|
||||
## 1.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 1.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 1.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react-native@0.9.17
|
||||
|
||||
## 1.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react-native@0.9.16
|
||||
|
||||
## 1.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react-native@0.9.15
|
||||
|
||||
## 1.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react-native@0.9.14
|
||||
|
||||
## 1.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 1.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 1.0.49
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react-native@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 1.0.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-rn",
|
||||
"version": "1.0.48",
|
||||
"version": "1.0.58",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "expo export -p ios",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# chat-vue
|
||||
|
||||
## 0.0.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser@0.9.20
|
||||
- jazz-vue@0.9.20
|
||||
|
||||
## 0.0.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-vue@0.9.19
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-vue@0.9.18
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser@0.9.17
|
||||
- jazz-vue@0.9.17
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser@0.9.16
|
||||
- jazz-vue@0.9.16
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser@0.9.15
|
||||
- jazz-vue@0.9.15
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser@0.9.14
|
||||
- jazz-vue@0.9.14
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-vue@0.9.13
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-vue@0.9.12
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-vue@0.9.11
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -11,10 +11,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example chat-vue --project-name chat-vue
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example chat-vue --project-name chat-vue
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "chat-vue",
|
||||
"version": "0.0.35",
|
||||
"version": "0.0.45",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# jazz-example-chat
|
||||
|
||||
## 0.0.141
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.140
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.139
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.138
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.137
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.136
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.135
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.134
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.133
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.132
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.131
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example chat --project-name chat
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example chat --project-name chat
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-chat",
|
||||
"private": true,
|
||||
"version": "0.0.131",
|
||||
"version": "0.0.141",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# minimal-auth-clerk
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
- jazz-react-auth-clerk@0.9.20
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-react-auth-clerk@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-react-auth-clerk@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
- jazz-react-auth-clerk@0.9.17
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-react-auth-clerk@0.9.16
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
- jazz-react-auth-clerk@0.9.15
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
- jazz-react-auth-clerk@0.9.14
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-react-auth-clerk@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-react-auth-clerk@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-react-auth-clerk@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -15,11 +15,7 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --start clerk --project-name clerk
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --start clerk --project-name clerk
|
||||
npx create-jazz-app@latest --example clerk --project-name clerk
|
||||
```
|
||||
|
||||
Go to the new project directory.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "clerk",
|
||||
"private": true,
|
||||
"version": "0.0.30",
|
||||
"version": "0.0.40",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -13,7 +13,7 @@
|
||||
"dependencies": {
|
||||
"@clerk/clerk-react": "^5.4.1",
|
||||
"jazz-react": "workspace:*",
|
||||
"jazz-react-auth-clerk": "workspace:0.9.10",
|
||||
"jazz-react-auth-clerk": "workspace:0.9.20",
|
||||
"jazz-tools": "workspace:*",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# file-share-svelte
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-svelte@0.9.20
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-svelte@0.9.17
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-svelte@0.9.16
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-svelte@0.9.15
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-svelte@0.9.14
|
||||
|
||||
## 0.0.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "file-share-svelte",
|
||||
"version": "0.0.15",
|
||||
"version": "0.0.25",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# form
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -28,11 +28,7 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --start form --project-name form
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --start form --project-name form
|
||||
npx create-jazz-app@latest --example form --project-name form
|
||||
```
|
||||
|
||||
Go to the new project directory.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "form",
|
||||
"private": true,
|
||||
"version": "0.0.26",
|
||||
"version": "0.0.36",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# image-upload
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -15,10 +15,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example image-upload --project-name image-upload
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example image-upload --project-name image-upload
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "image-upload",
|
||||
"private": true,
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.38",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
# jazz-example-inspector
|
||||
|
||||
## 0.0.100
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
- cojson-transport-ws@0.9.19
|
||||
|
||||
## 0.0.99
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
- cojson-transport-ws@0.9.18
|
||||
|
||||
## 0.0.98
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson-transport-ws@0.9.13
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.0.97
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson-transport-ws@0.9.12
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.0.96
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
- cojson-transport-ws@0.9.11
|
||||
|
||||
## 0.0.95
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-inspector",
|
||||
"name": "jazz-inspector-app",
|
||||
"private": true,
|
||||
"version": "0.0.95",
|
||||
"version": "0.0.100",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -16,8 +16,8 @@
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"cojson": "workspace:0.9.10",
|
||||
"cojson-transport-ws": "workspace:0.9.10",
|
||||
"cojson": "workspace:0.9.19",
|
||||
"cojson-transport-ws": "workspace:0.9.19",
|
||||
"hash-slash": "workspace:0.2.1",
|
||||
"lucide-react": "^0.274.0",
|
||||
"qrcode": "^1.5.3",
|
||||
|
||||
@@ -1,5 +1,98 @@
|
||||
# jazz-example-musicplayer
|
||||
|
||||
## 0.0.62
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-inspector@0.9.21
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.61
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.9.20
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [2faf22f]
|
||||
- jazz-inspector@0.9.19
|
||||
|
||||
## 0.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.9.18
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-inspector@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-inspector@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-inspector@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-inspector@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.9.13
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.9.12
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-inspector@0.9.11
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example music-player --project-name music-player
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example music-player --project-name music-player
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-music-player",
|
||||
"private": true,
|
||||
"version": "0.0.51",
|
||||
"version": "0.0.62",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -18,8 +18,9 @@
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"jazz-react": "workspace:0.9.10",
|
||||
"jazz-tools": "workspace:0.9.10",
|
||||
"jazz-react": "workspace:0.9.20",
|
||||
"jazz-tools": "workspace:0.9.20",
|
||||
"jazz-inspector": "workspace:*",
|
||||
"lucide-react": "^0.274.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Toaster } from "@/components/ui/toaster";
|
||||
import { JazzInspector } from "jazz-inspector";
|
||||
/* eslint-disable react-refresh/only-export-components */
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom/client";
|
||||
@@ -71,6 +72,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
||||
AccountSchema={MusicaAccount}
|
||||
>
|
||||
{children}
|
||||
<JazzInspector />
|
||||
</JazzProvider>
|
||||
<DemoAuthBasicUI appName="Jazz Music Player" state={state} />
|
||||
</>
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# jazz-example-onboarding
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -11,10 +11,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example onboarding --project-name onboarding
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example onboarding --project-name onboarding
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-onboarding",
|
||||
"private": true,
|
||||
"version": "0.0.32",
|
||||
"version": "0.0.42",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# organization
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -16,10 +16,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example organization --project-name organization
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example organization --project-name organization
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "organization",
|
||||
"private": true,
|
||||
"version": "0.0.24",
|
||||
"version": "0.0.34",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,65 @@
|
||||
# passkey-svelte
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.20
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.19
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.18
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.17
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.16
|
||||
|
||||
## 0.0.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.15
|
||||
|
||||
## 0.0.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.14
|
||||
|
||||
## 0.0.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.13
|
||||
|
||||
## 0.0.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.12
|
||||
|
||||
## 0.0.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-svelte@0.9.11
|
||||
|
||||
## 0.0.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -21,10 +21,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example passkey-svelte --project-name passkey-svelte
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example passkey-svelte --project-name passkey-svelte
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "passkey-svelte",
|
||||
"version": "0.0.19",
|
||||
"version": "0.0.29",
|
||||
"type": "module",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# minimal-auth-passkey
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -15,10 +15,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example passkey --project-name passkey
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example passkey --project-name passkey
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "passkey",
|
||||
"private": true,
|
||||
"version": "0.0.29",
|
||||
"version": "0.0.39",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# jazz-password-manager
|
||||
|
||||
## 0.0.60
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.59
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.52
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.51
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.50
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -15,10 +15,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example password-manager --project-name password-manager
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example password-manager --project-name password-manager
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-password-manager",
|
||||
"private": true,
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.60",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -12,8 +12,8 @@
|
||||
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
|
||||
},
|
||||
"dependencies": {
|
||||
"jazz-react": "workspace:0.9.10",
|
||||
"jazz-tools": "workspace:0.9.10",
|
||||
"jazz-react": "workspace:0.9.20",
|
||||
"jazz-tools": "workspace:0.9.20",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1",
|
||||
"react-hook-form": "^7.41.5",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# jazz-example-pets
|
||||
|
||||
## 0.0.158
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.157
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.156
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.155
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.154
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.153
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.152
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.151
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.150
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example pets --project-name pets
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example pets --project-name pets
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-pets",
|
||||
"private": true,
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.158",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -19,9 +19,9 @@
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"jazz-browser-media-images": "workspace:0.9.10",
|
||||
"jazz-react": "workspace:0.9.10",
|
||||
"jazz-tools": "workspace:0.9.10",
|
||||
"jazz-browser-media-images": "workspace:0.9.20",
|
||||
"jazz-react": "workspace:0.9.20",
|
||||
"jazz-tools": "workspace:0.9.20",
|
||||
"lucide-react": "^0.274.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"react": "^18.3.1",
|
||||
@@ -41,7 +41,7 @@
|
||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||
"autoprefixer": "^10.4.20",
|
||||
"is-ci": "^3.0.1",
|
||||
"jazz-run": "workspace:0.9.10",
|
||||
"jazz-run": "workspace:0.9.20",
|
||||
"postcss": "^8.4.27",
|
||||
"tailwindcss": "^3.4.15",
|
||||
"typescript": "~5.6.2",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# reactions
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser-media-images@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-browser-media-images@0.9.19
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-browser-media-images@0.9.18
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser-media-images@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser-media-images@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser-media-images@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser-media-images@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-browser-media-images@0.9.13
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-browser-media-images@0.9.12
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-browser-media-images@0.9.11
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example reactions --project-name reactions
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example reactions --project-name reactions
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "reactions",
|
||||
"private": true,
|
||||
"version": "0.0.28",
|
||||
"version": "0.0.38",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -1,5 +1,91 @@
|
||||
# todo-vue
|
||||
|
||||
## 0.0.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-browser@0.9.20
|
||||
- jazz-vue@0.9.20
|
||||
|
||||
## 0.0.42
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
- jazz-vue@0.9.19
|
||||
|
||||
## 0.0.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
- jazz-vue@0.9.18
|
||||
|
||||
## 0.0.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-browser@0.9.17
|
||||
- jazz-vue@0.9.17
|
||||
|
||||
## 0.0.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-browser@0.9.16
|
||||
- jazz-vue@0.9.16
|
||||
|
||||
## 0.0.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-browser@0.9.15
|
||||
- jazz-vue@0.9.15
|
||||
|
||||
## 0.0.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-browser@0.9.14
|
||||
- jazz-vue@0.9.14
|
||||
|
||||
## 0.0.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
- jazz-vue@0.9.13
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
- jazz-vue@0.9.12
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-browser@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
- jazz-vue@0.9.11
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -11,10 +11,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example todo-vue --project-name todo-vue
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example todo-vue --project-name todo-vue
|
||||
```
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "todo-vue",
|
||||
"version": "0.0.33",
|
||||
"version": "0.0.43",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# jazz-example-todo
|
||||
|
||||
## 0.0.157
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.156
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.155
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.154
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.153
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.152
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.151
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.150
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.149
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.148
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.147
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example todo --project-name todo
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example todo --project-name todo
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "jazz-example-todo",
|
||||
"private": true,
|
||||
"version": "0.0.147",
|
||||
"version": "0.0.157",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
@@ -16,8 +16,8 @@
|
||||
"@radix-ui/react-toast": "^1.1.4",
|
||||
"class-variance-authority": "^0.7.0",
|
||||
"clsx": "^2.0.0",
|
||||
"jazz-react": "workspace:0.9.10",
|
||||
"jazz-tools": "workspace:0.9.10",
|
||||
"jazz-react": "workspace:0.9.20",
|
||||
"jazz-tools": "workspace:0.9.20",
|
||||
"lucide-react": "^0.274.0",
|
||||
"qrcode": "^1.5.3",
|
||||
"react": "^18.3.1",
|
||||
|
||||
@@ -1,5 +1,81 @@
|
||||
# version-history
|
||||
|
||||
## 0.0.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [b01cc1f]
|
||||
- jazz-tools@0.9.20
|
||||
- jazz-react@0.9.20
|
||||
|
||||
## 0.0.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.19
|
||||
- jazz-tools@0.9.19
|
||||
|
||||
## 0.0.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.18
|
||||
- jazz-tools@0.9.18
|
||||
|
||||
## 0.0.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [c2ca1fe]
|
||||
- Updated dependencies [1227047]
|
||||
- jazz-tools@0.9.17
|
||||
- jazz-react@0.9.17
|
||||
|
||||
## 0.0.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [24b3b6a]
|
||||
- jazz-tools@0.9.16
|
||||
- jazz-react@0.9.16
|
||||
|
||||
## 0.0.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [7491711]
|
||||
- jazz-tools@0.9.15
|
||||
- jazz-react@0.9.15
|
||||
|
||||
## 0.0.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [3df93cc]
|
||||
- jazz-tools@0.9.14
|
||||
- jazz-react@0.9.14
|
||||
|
||||
## 0.0.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.13
|
||||
- jazz-tools@0.9.13
|
||||
|
||||
## 0.0.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.12
|
||||
- jazz-tools@0.9.12
|
||||
|
||||
## 0.0.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- jazz-react@0.9.11
|
||||
- jazz-tools@0.9.11
|
||||
|
||||
## 0.0.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -13,10 +13,6 @@ You can either
|
||||
|
||||
Create a new Jazz project, and use this example as a template.
|
||||
```bash
|
||||
npm create jazz-app@latest --example version-history --project-name version-history
|
||||
```
|
||||
or
|
||||
```bash
|
||||
npx create-jazz-app@latest --example version-history --project-name version-history
|
||||
```
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "version-history",
|
||||
"private": true,
|
||||
"version": "0.0.25",
|
||||
"version": "0.0.35",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -132,7 +132,7 @@ As you develop your app, you'll likely want to
|
||||
- initialise data in a user's `root` and `profile`
|
||||
- add more data to your `root` and `profile` schemas
|
||||
|
||||
You can achieve both by overriding the static `migrate()` method on your `Account` schema class.
|
||||
You can achieve both by overriding the `migrate()` method on your `Account` schema class.
|
||||
|
||||
### When migrations run
|
||||
|
||||
|
||||
@@ -8,14 +8,6 @@ The Jazz docs are currently heavily work in progress, sorry about that!
|
||||
|
||||
Run the following command to create a new Jazz project from one of our example apps:
|
||||
|
||||
<CodeGroup>
|
||||
```sh
|
||||
npm create jazz-app@latest
|
||||
```
|
||||
</CodeGroup>
|
||||
|
||||
or
|
||||
|
||||
<CodeGroup>
|
||||
```sh
|
||||
npx create-jazz-app@latest
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
# cojson-storage-indexeddb
|
||||
|
||||
## 0.9.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
- cojson-storage@0.9.19
|
||||
|
||||
## 0.9.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
- cojson-storage@0.9.18
|
||||
|
||||
## 0.9.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson-storage@0.9.13
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.9.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson-storage@0.9.12
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
- cojson-storage@0.9.11
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cojson-storage-indexeddb",
|
||||
"version": "0.9.10",
|
||||
"version": "0.9.19",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,46 @@
|
||||
# cojson-storage-sqlite
|
||||
|
||||
## 0.8.58
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
- cojson-storage@0.9.19
|
||||
|
||||
## 0.8.57
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
- cojson-storage@0.9.18
|
||||
|
||||
## 0.8.56
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson-storage@0.9.13
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.8.55
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson-storage@0.9.12
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.8.54
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
- cojson-storage@0.9.11
|
||||
|
||||
## 0.8.53
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "cojson-storage-rn-sqlite",
|
||||
"type": "module",
|
||||
"version": "0.8.53",
|
||||
"version": "0.8.58",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
|
||||
@@ -1,5 +1,49 @@
|
||||
# cojson-storage-sqlite
|
||||
|
||||
## 0.9.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
- cojson-storage@0.9.19
|
||||
|
||||
## 0.9.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
- cojson-storage@0.9.18
|
||||
|
||||
## 0.9.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8d29e50: Restore the logger wrapper and adapt the API to pino
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson-storage@0.9.13
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.9.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15d4b2a: Revert the custom logger
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson-storage@0.9.12
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5863bad: Wrap all the console logs with a logger class to make possible to customize the logger
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
- cojson-storage@0.9.11
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "cojson-storage-sqlite",
|
||||
"type": "module",
|
||||
"version": "0.9.10",
|
||||
"version": "0.9.19",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"better-sqlite3": "^11.7.0",
|
||||
"cojson": "workspace:0.9.10",
|
||||
"cojson": "workspace:0.9.19",
|
||||
"cojson-storage": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -28,6 +28,10 @@ export type RawTransactionRow = {
|
||||
tx: string;
|
||||
};
|
||||
|
||||
export function getErrorMessage(error: unknown) {
|
||||
return error instanceof Error ? error.message : "Unknown error";
|
||||
}
|
||||
|
||||
export class SQLiteClient implements DBClientInterface {
|
||||
private readonly db: DatabaseT;
|
||||
private readonly toLocalNode: OutgoingSyncQueue;
|
||||
@@ -53,7 +57,10 @@ export class SQLiteClient implements DBClientInterface {
|
||||
header: parsedHeader,
|
||||
};
|
||||
} catch (e) {
|
||||
logger.warn(coValueId, "Invalid JSON in header", e, coValueRow?.header);
|
||||
const headerValue = coValueRow?.header ?? "";
|
||||
logger.warn("Invalid JSON in header: " + headerValue, {
|
||||
id: coValueId,
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -80,7 +87,7 @@ export class SQLiteClient implements DBClientInterface {
|
||||
tx: JSON.parse(transactionRow.tx) as Transaction,
|
||||
}));
|
||||
} catch (e) {
|
||||
logger.warn("Invalid JSON in transaction", e);
|
||||
logger.warn("Invalid JSON in transaction");
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,15 +49,14 @@ export class SQLiteNode {
|
||||
? v.slice(0, 20) + "..."
|
||||
: v,
|
||||
)}`,
|
||||
e,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
processMessages().catch((e) =>
|
||||
logger.error("Error in processMessages in sqlite", e),
|
||||
);
|
||||
};
|
||||
|
||||
processMessages().catch((e) =>
|
||||
logger.error("Error in processMessages in sqlite", e),
|
||||
);
|
||||
}
|
||||
|
||||
static async asPeer({
|
||||
|
||||
@@ -1,5 +1,44 @@
|
||||
# cojson-storage
|
||||
|
||||
## 0.9.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
|
||||
## 0.9.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
|
||||
## 0.9.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8d29e50: Restore the logger wrapper and adapt the API to pino
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.9.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15d4b2a: Revert the custom logger
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5863bad: Wrap all the console logs with a logger class to make possible to customize the logger
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "cojson-storage",
|
||||
"version": "0.9.10",
|
||||
"version": "0.9.19",
|
||||
"main": "dist/index.js",
|
||||
"type": "module",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,5 +1,44 @@
|
||||
# cojson-transport-nodejs-ws
|
||||
|
||||
## 0.9.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [6ad0a9f]
|
||||
- cojson@0.9.19
|
||||
|
||||
## 0.9.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [8898b10]
|
||||
- cojson@0.9.18
|
||||
|
||||
## 0.9.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8d29e50: Restore the logger wrapper and adapt the API to pino
|
||||
- Updated dependencies [8d29e50]
|
||||
- cojson@0.9.13
|
||||
|
||||
## 0.9.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15d4b2a: Revert the custom logger
|
||||
- Updated dependencies [15d4b2a]
|
||||
- cojson@0.9.12
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 5863bad: Wrap all the console logs with a logger class to make possible to customize the logger
|
||||
- Updated dependencies [efbf3d8]
|
||||
- Updated dependencies [5863bad]
|
||||
- cojson@0.9.11
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "cojson-transport-ws",
|
||||
"type": "module",
|
||||
"version": "0.9.10",
|
||||
"version": "0.9.19",
|
||||
"main": "dist/index.js",
|
||||
"types": "src/index.ts",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"cojson": "workspace:0.9.10",
|
||||
"cojson": "workspace:0.9.19",
|
||||
"typescript": "~5.6.2"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
logger,
|
||||
} from "cojson";
|
||||
import { BatchedOutgoingMessages } from "./BatchedOutgoingMessages.js";
|
||||
import { deserializeMessages } from "./serialization.js";
|
||||
import { deserializeMessages, getErrorMessage } from "./serialization.js";
|
||||
import { AnyWebSocket } from "./types.js";
|
||||
|
||||
export const BUFFER_LIMIT = 100_000;
|
||||
@@ -164,9 +164,7 @@ export function createWebSocketPeer({
|
||||
|
||||
if (!result.ok) {
|
||||
logger.warn(
|
||||
"Error while deserializing messages",
|
||||
event.data,
|
||||
result.error,
|
||||
"Error while deserializing messages: " + getErrorMessage(result.error),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
import { SyncMessage, logger } from "cojson";
|
||||
import { PingMsg } from "./types.js";
|
||||
|
||||
export function getErrorMessage(error: unknown) {
|
||||
return error instanceof Error ? error.message : "Unknown error";
|
||||
}
|
||||
|
||||
export function addMessageToBacklog(backlog: string, message: SyncMessage) {
|
||||
if (!backlog) {
|
||||
return JSON.stringify(message);
|
||||
@@ -24,7 +28,7 @@ export function deserializeMessages(messages: unknown) {
|
||||
| PingMsg[],
|
||||
} as const;
|
||||
} catch (e) {
|
||||
logger.error("Error while deserializing messages", e);
|
||||
logger.error("Error while deserializing messages: " + getErrorMessage(e));
|
||||
return {
|
||||
ok: false,
|
||||
error: e,
|
||||
|
||||
@@ -1,5 +1,36 @@
|
||||
# cojson
|
||||
|
||||
## 0.9.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 6ad0a9f: Export Json types
|
||||
|
||||
## 0.9.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8898b10: Export AccountRole type
|
||||
|
||||
## 0.9.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 8d29e50: Restore the logger wrapper and adapt the API to pino
|
||||
|
||||
## 0.9.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 15d4b2a: Revert the custom logger
|
||||
|
||||
## 0.9.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- efbf3d8: Optimize queue management
|
||||
- 5863bad: Wrap all the console logs with a logger class to make possible to customize the logger
|
||||
|
||||
## 0.9.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
},
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.9.10",
|
||||
"version": "0.9.19",
|
||||
"devDependencies": {
|
||||
"@opentelemetry/sdk-metrics": "^1.29.0",
|
||||
"@types/jest": "^29.5.3",
|
||||
|
||||
@@ -93,7 +93,7 @@ export class PeerState {
|
||||
|
||||
this.processing = true;
|
||||
|
||||
let entry: QueueEntry | undefined;
|
||||
let entry: QueueEntry<SyncMessage> | undefined;
|
||||
while ((entry = this.queue.pull())) {
|
||||
// Awaiting the push to send one message at a time
|
||||
// This way when the peer is "under pressure" we can enqueue all
|
||||
@@ -130,7 +130,7 @@ export class PeerState {
|
||||
}
|
||||
|
||||
private closeQueue() {
|
||||
let entry: QueueEntry | undefined;
|
||||
let entry: QueueEntry<SyncMessage> | undefined;
|
||||
while ((entry = this.queue.pull())) {
|
||||
// Using resolve here to avoid unnecessary noise in the logs
|
||||
entry.resolve();
|
||||
@@ -138,7 +138,10 @@ export class PeerState {
|
||||
}
|
||||
|
||||
gracefulShutdown() {
|
||||
logger.debug("Gracefully closing", this.id);
|
||||
logger.debug("Gracefully closing", {
|
||||
peerId: this.id,
|
||||
peerRole: this.role,
|
||||
});
|
||||
this.closeQueue();
|
||||
this.peer.outgoing.close();
|
||||
this.closed = true;
|
||||
|
||||
@@ -18,11 +18,12 @@ function promiseWithResolvers<R>() {
|
||||
};
|
||||
}
|
||||
|
||||
export type QueueEntry = {
|
||||
msg: SyncMessage;
|
||||
export type QueueEntry<V> = {
|
||||
msg: V;
|
||||
promise: Promise<void>;
|
||||
resolve: () => void;
|
||||
reject: (_: unknown) => void;
|
||||
next: QueueEntry<V> | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -33,10 +34,68 @@ type Tuple<T, N extends number, A extends unknown[] = []> = A extends {
|
||||
}
|
||||
? A
|
||||
: Tuple<T, N, [...A, T]>;
|
||||
type QueueTuple = Tuple<QueueEntry[], 8>;
|
||||
type QueueTuple = Tuple<Queue<SyncMessage>, 8>;
|
||||
|
||||
class Queue<V> {
|
||||
head: QueueEntry<V> | undefined = undefined;
|
||||
tail: QueueEntry<V> | undefined = undefined;
|
||||
|
||||
push(msg: V) {
|
||||
const { promise, resolve, reject } = promiseWithResolvers<void>();
|
||||
const entry: QueueEntry<V> = {
|
||||
msg,
|
||||
promise,
|
||||
resolve,
|
||||
reject,
|
||||
next: undefined,
|
||||
};
|
||||
|
||||
if (this.head === undefined) {
|
||||
this.head = entry;
|
||||
} else {
|
||||
if (this.tail === undefined) {
|
||||
throw new Error("Tail is null but head is not");
|
||||
}
|
||||
|
||||
this.tail.next = entry;
|
||||
}
|
||||
|
||||
this.tail = entry;
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
pull() {
|
||||
const entry = this.head;
|
||||
|
||||
if (entry) {
|
||||
this.head = entry.next;
|
||||
}
|
||||
|
||||
if (this.head === undefined) {
|
||||
this.tail = undefined;
|
||||
}
|
||||
|
||||
return entry;
|
||||
}
|
||||
|
||||
isNonEmpty() {
|
||||
return this.head !== undefined;
|
||||
}
|
||||
}
|
||||
|
||||
export class PriorityBasedMessageQueue {
|
||||
private queues: QueueTuple = [[], [], [], [], [], [], [], []];
|
||||
private queues: QueueTuple = [
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
new Queue(),
|
||||
];
|
||||
|
||||
queueSizeCounter = metrics
|
||||
.getMeter("cojson")
|
||||
.createUpDownCounter("jazz.messagequeue.size", {
|
||||
@@ -52,22 +111,19 @@ export class PriorityBasedMessageQueue {
|
||||
constructor(private defaultPriority: CoValuePriority) {}
|
||||
|
||||
public push(msg: SyncMessage) {
|
||||
const { promise, resolve, reject } = promiseWithResolvers<void>();
|
||||
const entry: QueueEntry = { msg, promise, resolve, reject };
|
||||
|
||||
const priority = "priority" in msg ? msg.priority : this.defaultPriority;
|
||||
|
||||
this.getQueue(priority).push(entry);
|
||||
const entry = this.getQueue(priority).push(msg);
|
||||
|
||||
this.queueSizeCounter.add(1, {
|
||||
priority,
|
||||
});
|
||||
|
||||
return promise;
|
||||
return entry.promise;
|
||||
}
|
||||
|
||||
public pull() {
|
||||
const priority = this.queues.findIndex((queue) => queue.length > 0);
|
||||
const priority = this.queues.findIndex((queue) => queue.isNonEmpty());
|
||||
|
||||
if (priority === -1) {
|
||||
return;
|
||||
@@ -77,6 +133,6 @@ export class PriorityBasedMessageQueue {
|
||||
priority,
|
||||
});
|
||||
|
||||
return this.queues[priority]?.shift();
|
||||
return this.queues[priority]?.pull();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -304,7 +304,10 @@ async function loadCoValueFromPeers(
|
||||
if (coValueEntry.state.type === "loading") {
|
||||
const timeout = setTimeout(() => {
|
||||
if (coValueEntry.state.type === "loading") {
|
||||
logger.warn("Failed to load coValue from peer", peer.id);
|
||||
logger.warn("Failed to load coValue from peer", {
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
});
|
||||
coValueEntry.dispatch({
|
||||
type: "not-found-in-peer",
|
||||
peerId: peer.id,
|
||||
|
||||
@@ -60,7 +60,7 @@ export class RawAccount<
|
||||
);
|
||||
|
||||
if (agents.length !== 1) {
|
||||
logger.warn("Account has " + agents.length + " agents", this.id);
|
||||
logger.warn("Account has " + agents.length + " agents", { id: this.id });
|
||||
}
|
||||
|
||||
this._cachedCurrentAgentID = agents[0];
|
||||
|
||||
@@ -322,7 +322,7 @@ export class RawGroup<
|
||||
const secret = this.core.getReadKey(keyID);
|
||||
|
||||
if (!secret) {
|
||||
logger.error("Can't find key", keyID);
|
||||
logger.error("Can't find key " + keyID);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,7 +193,9 @@ export class PureJSCrypto extends CryptoProvider<Blake3State> {
|
||||
try {
|
||||
return JSON.parse(textDecoder.decode(plaintext));
|
||||
} catch (e) {
|
||||
logger.error("Failed to decrypt/parse sealed message", e);
|
||||
logger.error(
|
||||
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
|
||||
);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -241,8 +241,9 @@ export class WasmCrypto extends CryptoProvider<Uint8Array> {
|
||||
try {
|
||||
return JSON.parse(textDecoder.decode(plaintext));
|
||||
} catch (e) {
|
||||
logger.error("Failed to decrypt/parse sealed message", e);
|
||||
return undefined;
|
||||
logger.error(
|
||||
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ export abstract class CryptoProvider<Blake3State = any> {
|
||||
try {
|
||||
return parseJSON(this.decryptRaw(encrypted, keySecret, nOnceMaterial));
|
||||
} catch (e) {
|
||||
logger.error("Decryption error", e);
|
||||
logger.error("Decryption error: " + (e as Error)?.message);
|
||||
return undefined;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ import { OpID, RawCoList } from "./coValues/coList.js";
|
||||
import { RawCoMap } from "./coValues/coMap.js";
|
||||
import { RawCoPlainText, stringifyOpID } from "./coValues/coPlainText.js";
|
||||
import {
|
||||
BinaryStreamItem,
|
||||
BinaryStreamStart,
|
||||
CoStreamItem,
|
||||
RawBinaryCoStream,
|
||||
RawCoStream,
|
||||
@@ -38,7 +40,7 @@ import {
|
||||
} from "./ids.js";
|
||||
import { Stringified, parseJSON, stableStringify } from "./jsonStringify.js";
|
||||
import { LocalNode } from "./localNode.js";
|
||||
import type { Role } from "./permissions.js";
|
||||
import type { AccountRole, Role } from "./permissions.js";
|
||||
import { Channel, connectedPeers } from "./streamUtils.js";
|
||||
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
|
||||
import { expectGroup } from "./typeUtils/expectGroup.js";
|
||||
@@ -57,7 +59,7 @@ import type {
|
||||
import type { InviteSecret } from "./coValues/group.js";
|
||||
import type { AgentSecret } from "./crypto/crypto.js";
|
||||
import type { AgentID, RawCoID, SessionID } from "./ids.js";
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
import type { JsonObject, JsonValue } from "./jsonValue.js";
|
||||
import type * as Media from "./media.js";
|
||||
import { disablePermissionErrors } from "./permissions.js";
|
||||
import type {
|
||||
@@ -128,6 +130,7 @@ export {
|
||||
ControlledAgent,
|
||||
RawControlledAccount,
|
||||
MAX_RECOMMENDED_TX_SIZE,
|
||||
JsonObject,
|
||||
JsonValue,
|
||||
Peer,
|
||||
BinaryStreamInfo,
|
||||
@@ -143,6 +146,8 @@ export {
|
||||
RawCoPlainText,
|
||||
stringifyOpID,
|
||||
logger,
|
||||
base64URLtoBytes,
|
||||
bytesToBase64url,
|
||||
};
|
||||
|
||||
export type {
|
||||
@@ -157,7 +162,10 @@ export type {
|
||||
CoValueUniqueness,
|
||||
Stringified,
|
||||
CoStreamItem,
|
||||
BinaryStreamItem,
|
||||
BinaryStreamStart,
|
||||
OpID,
|
||||
AccountRole,
|
||||
};
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
|
||||
@@ -231,7 +231,7 @@ export class LocalNode {
|
||||
|
||||
return node;
|
||||
} catch (e) {
|
||||
logger.error("Error withLoadedAccount", e);
|
||||
logger.error("Error withLoadedAccount: " + (e as Error)?.message);
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,9 @@ export class LocalNode {
|
||||
this.syncManager.getServerAndStoragePeers(skipLoadingFromPeer);
|
||||
|
||||
await entry.loadFromPeers(peers).catch((e) => {
|
||||
logger.error("Error loading from peers", id, e);
|
||||
logger.error("Error loading from peers: " + (e as Error)?.message, {
|
||||
id,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -324,7 +326,9 @@ export class LocalNode {
|
||||
unsubscribe = coValue.subscribe(callback);
|
||||
})
|
||||
.catch((e) => {
|
||||
logger.error("Error subscribing to ", id, e);
|
||||
logger.error(
|
||||
"Error subscribing to " + id + ": " + (e as Error)?.message,
|
||||
);
|
||||
});
|
||||
|
||||
return () => {
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { JsonValue } from "./jsonValue.js";
|
||||
|
||||
export enum LogLevel {
|
||||
DEBUG = 0,
|
||||
INFO = 1,
|
||||
@@ -7,25 +9,25 @@ export enum LogLevel {
|
||||
}
|
||||
|
||||
export interface LogSystem {
|
||||
debug(message: string, ...args: any[]): void;
|
||||
info(message: string, ...args: any[]): void;
|
||||
warn(message: string, ...args: any[]): void;
|
||||
error(message: string, ...args: any[]): void;
|
||||
debug(message: string, attributes?: Record<string, JsonValue>): void;
|
||||
info(message: string, attributes?: Record<string, JsonValue>): void;
|
||||
warn(message: string, attributes?: Record<string, JsonValue>): void;
|
||||
error(message: string, attributes?: Record<string, JsonValue>): void;
|
||||
}
|
||||
|
||||
// Default console-based logging system
|
||||
export class ConsoleLogSystem implements LogSystem {
|
||||
debug(message: string, ...args: any[]) {
|
||||
console.debug(message, ...args);
|
||||
debug(message: string, attributes?: Record<string, JsonValue>) {
|
||||
console.debug(message, attributes);
|
||||
}
|
||||
info(message: string, ...args: any[]) {
|
||||
console.info(message, ...args);
|
||||
info(message: string, attributes?: Record<string, JsonValue>) {
|
||||
console.info(message, attributes);
|
||||
}
|
||||
warn(message: string, ...args: any[]) {
|
||||
console.warn(message, ...args);
|
||||
warn(message: string, attributes?: Record<string, JsonValue>) {
|
||||
console.warn(message, attributes);
|
||||
}
|
||||
error(message: string, ...args: any[]) {
|
||||
console.error(message, ...args);
|
||||
error(message: string, attributes?: Record<string, JsonValue>) {
|
||||
console.error(message, attributes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,27 +51,27 @@ export class Logger {
|
||||
this.logSystem = logSystem;
|
||||
}
|
||||
|
||||
debug(message: string, ...args: any[]) {
|
||||
debug(message: string, attributes?: Record<string, JsonValue>) {
|
||||
if (this.level <= LogLevel.DEBUG) {
|
||||
this.logSystem.debug(message, ...args);
|
||||
this.logSystem.debug(message, attributes);
|
||||
}
|
||||
}
|
||||
|
||||
info(message: string, ...args: any[]) {
|
||||
info(message: string, attributes?: Record<string, JsonValue>) {
|
||||
if (this.level <= LogLevel.INFO) {
|
||||
this.logSystem.info(message, ...args);
|
||||
this.logSystem.info(message, attributes);
|
||||
}
|
||||
}
|
||||
|
||||
warn(message: string, ...args: any[]) {
|
||||
warn(message: string, attributes?: Record<string, JsonValue>) {
|
||||
if (this.level <= LogLevel.WARN) {
|
||||
this.logSystem.warn(message, ...args);
|
||||
this.logSystem.warn(message, attributes);
|
||||
}
|
||||
}
|
||||
|
||||
error(message: string, ...args: any[]) {
|
||||
error(message: string, attributes?: Record<string, JsonValue>) {
|
||||
if (this.level <= LogLevel.ERROR) {
|
||||
this.logSystem.error(message, ...args);
|
||||
this.logSystem.error(message, attributes);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,12 +42,15 @@ export function disablePermissionErrors() {
|
||||
logPermissionErrors = false;
|
||||
}
|
||||
|
||||
function logPermissionError(...args: unknown[]) {
|
||||
function logPermissionError(
|
||||
message: string,
|
||||
attributes?: Record<string, JsonValue>,
|
||||
) {
|
||||
if (logPermissionErrors === false) {
|
||||
return;
|
||||
}
|
||||
|
||||
logger.warn("Permission error", ...args);
|
||||
logger.warn("Permission error: " + message, attributes);
|
||||
}
|
||||
|
||||
export function determineValidTransactions(
|
||||
@@ -227,17 +230,10 @@ function determineValidTransactionsForGroup(
|
||||
try {
|
||||
changes = parseJSON(tx.changes);
|
||||
} catch (e) {
|
||||
logPermissionError(
|
||||
coValue.id,
|
||||
"Invalid JSON in transaction",
|
||||
e,
|
||||
logPermissionError("Invalid JSON in transaction", {
|
||||
id: coValue.id,
|
||||
tx,
|
||||
JSON.stringify(tx.changes, (k, v) =>
|
||||
k === "changes" || k === "encryptedChanges"
|
||||
? v.slice(0, 20) + "..."
|
||||
: v,
|
||||
),
|
||||
);
|
||||
});
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,8 +90,9 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
k === "changes" || k === "encryptedChanges"
|
||||
? v.slice(0, 20) + "..."
|
||||
: v,
|
||||
)}`,
|
||||
e,
|
||||
)}
|
||||
Error: ${e instanceof Error ? e.message : "Unknown error"},
|
||||
`,
|
||||
);
|
||||
}
|
||||
nMsg++;
|
||||
@@ -241,7 +242,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
} else {
|
||||
const merged = mergeChunks(coValue, newContentAsChunk);
|
||||
if (merged === "nonContigous") {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
"Non-contigous new content for " + newContent.id,
|
||||
Object.entries(coValue.sessionEntries).map(([session, entries]) =>
|
||||
entries.map((entry) => ({
|
||||
@@ -316,7 +317,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
const merged = mergeChunks(result, nextChunk);
|
||||
|
||||
if (merged === "nonContigous") {
|
||||
logger.warn(
|
||||
console.warn(
|
||||
"Non-contigous chunks while loading " + id,
|
||||
result,
|
||||
nextChunk,
|
||||
@@ -375,7 +376,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
if (existingChunk) {
|
||||
const merged = mergeChunks(existingChunk, chunk);
|
||||
if (merged === "nonContigous") {
|
||||
logger.info(
|
||||
console.log(
|
||||
"Non-contigous chunks in " + chunk.id + ", " + fileName,
|
||||
existingChunk,
|
||||
chunk,
|
||||
@@ -449,7 +450,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
||||
if (existingChunk) {
|
||||
const merged = mergeChunks(existingChunk, chunk);
|
||||
if (merged === "nonContigous") {
|
||||
logger.info(
|
||||
console.log(
|
||||
"Non-contigous chunks in " + entry.id + ", " + blockFile,
|
||||
existingChunk,
|
||||
chunk,
|
||||
|
||||
@@ -23,6 +23,10 @@ export function emptyKnownState(id: RawCoID): CoValueKnownState {
|
||||
};
|
||||
}
|
||||
|
||||
function getErrorMessage(e: unknown) {
|
||||
return e instanceof Error ? e.message : "Unknown error";
|
||||
}
|
||||
|
||||
export type SyncMessage =
|
||||
| LoadMessage
|
||||
| KnownStateMessage
|
||||
@@ -183,7 +187,7 @@ export class SyncManager {
|
||||
|
||||
if (entry.state.type !== "available") {
|
||||
entry.loadFromPeers([peer]).catch((e: unknown) => {
|
||||
logger.error("Error sending load", e);
|
||||
logger.error("Error sending load: " + getErrorMessage(e));
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -200,7 +204,7 @@ export class SyncManager {
|
||||
action: "load",
|
||||
...coValue.knownState(),
|
||||
}).catch((e: unknown) => {
|
||||
logger.error("Error sending load", e);
|
||||
logger.error("Error sending load: " + getErrorMessage(e));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -230,7 +234,7 @@ export class SyncManager {
|
||||
asDependencyOf,
|
||||
...coValue.knownState(),
|
||||
}).catch((e: unknown) => {
|
||||
logger.error("Error sending known state", e);
|
||||
logger.error("Error sending known state: " + getErrorMessage(e));
|
||||
});
|
||||
|
||||
peer.toldKnownState.add(id);
|
||||
@@ -258,7 +262,7 @@ export class SyncManager {
|
||||
let lastYield = performance.now();
|
||||
for (const [_i, piece] of newContentPieces.entries()) {
|
||||
this.trySendToPeer(peer, piece).catch((e: unknown) => {
|
||||
logger.error("Error sending content piece", e);
|
||||
logger.error("Error sending content piece: " + getErrorMessage(e));
|
||||
});
|
||||
|
||||
if (performance.now() - lastYield > 10) {
|
||||
@@ -331,7 +335,10 @@ export class SyncManager {
|
||||
return;
|
||||
}
|
||||
if (msg === "PingTimeout") {
|
||||
logger.error("Ping timeout from peer", peer.id);
|
||||
logger.error("Ping timeout from peer", {
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
});
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@@ -354,13 +361,22 @@ export class SyncManager {
|
||||
processMessages()
|
||||
.then(() => {
|
||||
if (peer.crashOnClose) {
|
||||
logger.warn("Unexepcted close from peer", peer.id);
|
||||
logger.error("Unexepcted close from peer", {
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
});
|
||||
this.local.crashed = new Error("Unexpected close from peer");
|
||||
throw new Error("Unexpected close from peer");
|
||||
}
|
||||
})
|
||||
.catch((e) => {
|
||||
logger.error("Error processing messages from peer", peer.id, e);
|
||||
logger.error(
|
||||
"Error processing messages from peer: " + getErrorMessage(e),
|
||||
{
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
},
|
||||
);
|
||||
if (peer.crashOnClose) {
|
||||
this.local.crashed = e;
|
||||
throw new Error(e);
|
||||
@@ -596,17 +612,11 @@ export class SyncManager {
|
||||
// );
|
||||
|
||||
if (result.isErr()) {
|
||||
logger.error(
|
||||
"Failed to add transactions from",
|
||||
peer.id,
|
||||
result.error,
|
||||
msg.id,
|
||||
newTransactions.length + " new transactions",
|
||||
"after: " + newContentForSession.after,
|
||||
"our last known tx idx initially: " + ourKnownTxIdx,
|
||||
"our last known tx idx now: " +
|
||||
coValue.sessionLogs.get(sessionID)?.transactions.length,
|
||||
);
|
||||
logger.error("Failed to add transactions: " + result.error.type, {
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
id: msg.id,
|
||||
});
|
||||
peer.erroredCoValues.set(msg.id, result.error);
|
||||
continue;
|
||||
}
|
||||
@@ -627,7 +637,13 @@ export class SyncManager {
|
||||
isCorrection: true,
|
||||
...coValue.knownState(),
|
||||
}).catch((e) => {
|
||||
logger.error("Error sending known state correction", e);
|
||||
logger.error(
|
||||
"Error sending known state correction: " + getErrorMessage(e),
|
||||
{
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
},
|
||||
);
|
||||
});
|
||||
} else {
|
||||
/**
|
||||
@@ -641,7 +657,10 @@ export class SyncManager {
|
||||
action: "known",
|
||||
...coValue.knownState(),
|
||||
}).catch((e: unknown) => {
|
||||
logger.error("Error sending known state", e);
|
||||
logger.error("Error sending known state: " + getErrorMessage(e), {
|
||||
peerId: peer.id,
|
||||
peerRole: peer.role,
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ describe("PriorityBasedMessageQueue", () => {
|
||||
const { queue } = setup();
|
||||
expect(queue["defaultPriority"]).toBe(CO_VALUE_PRIORITY.MEDIUM);
|
||||
expect(queue["queues"].length).toBe(8);
|
||||
expect(queue["queues"].every((q) => q.length === 0)).toBe(true);
|
||||
expect(queue["queues"].every((q) => !q.isNonEmpty())).toBe(true);
|
||||
});
|
||||
|
||||
test("should push message with default priority", async () => {
|
||||
|
||||
@@ -1,43 +1,36 @@
|
||||
import { describe, expect, onTestFinished, test, vi } from "vitest";
|
||||
import { beforeEach, describe, expect, onTestFinished, test, vi } from "vitest";
|
||||
import {
|
||||
GlobalSyncStateListenerCallback,
|
||||
PeerSyncStateListenerCallback,
|
||||
} from "../SyncStateManager.js";
|
||||
import { accountHeaderForInitialAgentSecret } from "../coValues/account.js";
|
||||
import { connectedPeers } from "../streamUtils.js";
|
||||
import { emptyKnownState } from "../sync.js";
|
||||
import {
|
||||
blockMessageTypeOnOutgoingPeer,
|
||||
connectNodeToSyncServer,
|
||||
createTestNode,
|
||||
createTwoConnectedNodes,
|
||||
loadCoValueOrFail,
|
||||
setupSyncServer,
|
||||
waitFor,
|
||||
} from "./testUtils.js";
|
||||
|
||||
let jazzCloud = setupSyncServer();
|
||||
|
||||
beforeEach(async () => {
|
||||
jazzCloud = setupSyncServer();
|
||||
});
|
||||
|
||||
describe("SyncStateManager", () => {
|
||||
test("subscribeToUpdates receives updates when peer state changes", async () => {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
const { nodeToServerPeer } = connectNodeToSyncServer(client);
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
// Connect nodes
|
||||
const [clientAsPeer, jazzCloudAsPeer] = connectedPeers(
|
||||
"clientConnection",
|
||||
"jazzCloudConnection",
|
||||
{
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
},
|
||||
);
|
||||
|
||||
client.syncManager.addPeer(jazzCloudAsPeer);
|
||||
jazzCloud.syncManager.addPeer(clientAsPeer);
|
||||
|
||||
const subscriptionManager = client.syncManager.syncState;
|
||||
|
||||
const updateSpy: GlobalSyncStateListenerCallback = vi.fn();
|
||||
@@ -46,21 +39,21 @@ describe("SyncStateManager", () => {
|
||||
await client.syncManager.actuallySyncCoValue(map.core);
|
||||
|
||||
expect(updateSpy).toHaveBeenCalledWith(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
emptyKnownState(map.core.id),
|
||||
{ uploaded: false },
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
return subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
map.core.id,
|
||||
).uploaded;
|
||||
});
|
||||
|
||||
expect(updateSpy).toHaveBeenCalledWith(
|
||||
"jazzCloudConnection",
|
||||
client.syncManager.peers["jazzCloudConnection"]!.knownStates.get(
|
||||
nodeToServerPeer.id,
|
||||
client.syncManager.peers[nodeToServerPeer.id]!.knownStates.get(
|
||||
map.core.id,
|
||||
)!,
|
||||
{ uploaded: true },
|
||||
@@ -73,42 +66,30 @@ describe("SyncStateManager", () => {
|
||||
test("subscribeToPeerUpdates receives updates only for specific peer", async () => {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
const { nodeToServerPeer } = connectNodeToSyncServer(client);
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
// Connect nodes
|
||||
const [clientAsPeer, jazzCloudAsPeer] = connectedPeers(
|
||||
"clientConnection",
|
||||
"jazzCloudConnection",
|
||||
{
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
},
|
||||
);
|
||||
|
||||
const [clientStoragePeer] = connectedPeers("clientStorage", "unusedPeer", {
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
});
|
||||
|
||||
client.syncManager.addPeer(jazzCloudAsPeer);
|
||||
client.syncManager.addPeer(clientStoragePeer);
|
||||
jazzCloud.syncManager.addPeer(clientAsPeer);
|
||||
|
||||
const subscriptionManager = client.syncManager.syncState;
|
||||
|
||||
const updateToJazzCloudSpy: PeerSyncStateListenerCallback = vi.fn();
|
||||
const updateToStorageSpy: PeerSyncStateListenerCallback = vi.fn();
|
||||
const unsubscribe1 = subscriptionManager.subscribeToPeerUpdates(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
updateToJazzCloudSpy,
|
||||
);
|
||||
const unsubscribe2 = subscriptionManager.subscribeToPeerUpdates(
|
||||
"clientStorage",
|
||||
clientStoragePeer.id,
|
||||
updateToStorageSpy,
|
||||
);
|
||||
|
||||
@@ -126,13 +107,13 @@ describe("SyncStateManager", () => {
|
||||
|
||||
await waitFor(() => {
|
||||
return subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
map.core.id,
|
||||
).uploaded;
|
||||
});
|
||||
|
||||
expect(updateToJazzCloudSpy).toHaveBeenLastCalledWith(
|
||||
client.syncManager.peers["jazzCloudConnection"]!.knownStates.get(
|
||||
client.syncManager.peers[nodeToServerPeer.id]!.knownStates.get(
|
||||
map.core.id,
|
||||
)!,
|
||||
{ uploaded: true },
|
||||
@@ -147,80 +128,50 @@ describe("SyncStateManager", () => {
|
||||
test("getIsCoValueFullyUploadedIntoPeer returns correct status", async () => {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
const { nodeToServerPeer } = connectNodeToSyncServer(client);
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
// Connect nodes
|
||||
const [clientAsPeer, jazzCloudAsPeer] = connectedPeers(
|
||||
"clientConnection",
|
||||
"jazzCloudConnection",
|
||||
{
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
},
|
||||
);
|
||||
|
||||
client.syncManager.addPeer(jazzCloudAsPeer);
|
||||
jazzCloud.syncManager.addPeer(clientAsPeer);
|
||||
|
||||
await client.syncManager.actuallySyncCoValue(map.core);
|
||||
|
||||
const subscriptionManager = client.syncManager.syncState;
|
||||
|
||||
expect(
|
||||
subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
map.core.id,
|
||||
).uploaded,
|
||||
subscriptionManager.getCurrentSyncState(nodeToServerPeer.id, map.core.id)
|
||||
.uploaded,
|
||||
).toBe(false);
|
||||
|
||||
await waitFor(() => {
|
||||
return subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
map.core.id,
|
||||
).uploaded;
|
||||
});
|
||||
|
||||
expect(
|
||||
subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
map.core.id,
|
||||
).uploaded,
|
||||
subscriptionManager.getCurrentSyncState(nodeToServerPeer.id, map.core.id)
|
||||
.uploaded,
|
||||
).toBe(true);
|
||||
});
|
||||
|
||||
test("unsubscribe stops receiving updates", async () => {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
const { nodeToServerPeer } = connectNodeToSyncServer(client);
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
// Connect nodes
|
||||
const [clientAsPeer, jazzCloudAsPeer] = connectedPeers(
|
||||
"clientConnection",
|
||||
"jazzCloudConnection",
|
||||
{
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
},
|
||||
);
|
||||
|
||||
client.syncManager.addPeer(jazzCloudAsPeer);
|
||||
jazzCloud.syncManager.addPeer(clientAsPeer);
|
||||
|
||||
const subscriptionManager = client.syncManager.syncState;
|
||||
const anyUpdateSpy = vi.fn();
|
||||
const unsubscribe1 = subscriptionManager.subscribeToUpdates(anyUpdateSpy);
|
||||
const unsubscribe2 = subscriptionManager.subscribeToPeerUpdates(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
anyUpdateSpy,
|
||||
);
|
||||
|
||||
@@ -233,7 +184,7 @@ describe("SyncStateManager", () => {
|
||||
|
||||
await waitFor(() => {
|
||||
return subscriptionManager.getCurrentSyncState(
|
||||
"jazzCloudConnection",
|
||||
nodeToServerPeer.id,
|
||||
map.core.id,
|
||||
).uploaded;
|
||||
});
|
||||
@@ -243,22 +194,21 @@ describe("SyncStateManager", () => {
|
||||
|
||||
test("getCurrentSyncState should return the correct state", async () => {
|
||||
// Setup nodes
|
||||
const clientNode = createTestNode();
|
||||
const serverNode = jazzCloud;
|
||||
const {
|
||||
node1: clientNode,
|
||||
node2: serverNode,
|
||||
node1ToNode2Peer: clientToServerPeer,
|
||||
node2ToNode1Peer: serverToClientPeer,
|
||||
} = await createTwoConnectedNodes("client", "server");
|
||||
|
||||
nodeToServerPeer: clientToServerPeer,
|
||||
serverToNodePeer: serverToClientPeer,
|
||||
} = connectNodeToSyncServer(clientNode);
|
||||
// Create test data
|
||||
const group = clientNode.node.createGroup();
|
||||
const group = clientNode.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
group.addMember("everyone", "writer");
|
||||
|
||||
// Initially should not be synced
|
||||
expect(
|
||||
clientNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
clientNode.syncManager.syncState.getCurrentSyncState(
|
||||
clientToServerPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
@@ -268,13 +218,13 @@ describe("SyncStateManager", () => {
|
||||
await map.core.waitForSync();
|
||||
|
||||
expect(
|
||||
clientNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
clientNode.syncManager.syncState.getCurrentSyncState(
|
||||
clientToServerPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
).toEqual({ uploaded: true });
|
||||
|
||||
const mapOnServer = await loadCoValueOrFail(serverNode.node, map.id);
|
||||
const mapOnServer = await loadCoValueOrFail(serverNode, map.id);
|
||||
|
||||
// Block the content messages so the client won't fully sync immediately
|
||||
const outgoing = blockMessageTypeOnOutgoingPeer(
|
||||
@@ -285,14 +235,14 @@ describe("SyncStateManager", () => {
|
||||
mapOnServer.set("key2", "value2", "trusting");
|
||||
|
||||
expect(
|
||||
clientNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
clientNode.syncManager.syncState.getCurrentSyncState(
|
||||
clientToServerPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
).toEqual({ uploaded: true });
|
||||
|
||||
expect(
|
||||
serverNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
serverNode.syncManager.syncState.getCurrentSyncState(
|
||||
serverToClientPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
@@ -304,14 +254,14 @@ describe("SyncStateManager", () => {
|
||||
await mapOnServer.core.waitForSync();
|
||||
|
||||
expect(
|
||||
clientNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
clientNode.syncManager.syncState.getCurrentSyncState(
|
||||
clientToServerPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
).toEqual({ uploaded: true });
|
||||
|
||||
expect(
|
||||
serverNode.node.syncManager.syncState.getCurrentSyncState(
|
||||
serverNode.syncManager.syncState.getCurrentSyncState(
|
||||
serverToClientPeer.id,
|
||||
map.core.id,
|
||||
),
|
||||
|
||||
@@ -20,8 +20,14 @@ describe("Logger", () => {
|
||||
|
||||
expect(mockLogSystem.debug).not.toHaveBeenCalled();
|
||||
expect(mockLogSystem.info).not.toHaveBeenCalled();
|
||||
expect(mockLogSystem.warn).toHaveBeenCalledWith("Warning message");
|
||||
expect(mockLogSystem.error).toHaveBeenCalledWith("Error message");
|
||||
expect(mockLogSystem.warn).toHaveBeenCalledWith(
|
||||
"Warning message",
|
||||
undefined,
|
||||
);
|
||||
expect(mockLogSystem.error).toHaveBeenCalledWith(
|
||||
"Error message",
|
||||
undefined,
|
||||
);
|
||||
});
|
||||
|
||||
test("should pass additional arguments to log system", () => {
|
||||
@@ -33,14 +39,12 @@ describe("Logger", () => {
|
||||
};
|
||||
|
||||
const logger = new Logger(LogLevel.DEBUG, mockLogSystem);
|
||||
const additionalArgs = [{ foo: "bar" }, 42, "extra"];
|
||||
|
||||
logger.debug("Debug message", ...additionalArgs);
|
||||
logger.debug("Debug message", { foo: "bar" });
|
||||
|
||||
expect(mockLogSystem.debug).toHaveBeenCalledWith(
|
||||
"Debug message",
|
||||
...additionalArgs,
|
||||
);
|
||||
expect(mockLogSystem.debug).toHaveBeenCalledWith("Debug message", {
|
||||
foo: "bar",
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@@ -60,7 +64,7 @@ describe("Logger", () => {
|
||||
|
||||
logger.setLevel(LogLevel.WARN);
|
||||
logger.warn("Warning 2"); // Should log
|
||||
expect(mockLogSystem.warn).toHaveBeenCalledWith("Warning 2");
|
||||
expect(mockLogSystem.warn).toHaveBeenCalledWith("Warning 2", undefined);
|
||||
});
|
||||
|
||||
test("should allow changing log system at runtime", () => {
|
||||
@@ -81,12 +85,12 @@ describe("Logger", () => {
|
||||
const logger = new Logger(LogLevel.INFO, mockLogSystem1);
|
||||
|
||||
logger.info("Message 1");
|
||||
expect(mockLogSystem1.info).toHaveBeenCalledWith("Message 1");
|
||||
expect(mockLogSystem1.info).toHaveBeenCalledWith("Message 1", undefined);
|
||||
expect(mockLogSystem2.info).not.toHaveBeenCalled();
|
||||
|
||||
logger.setLogSystem(mockLogSystem2);
|
||||
logger.info("Message 2");
|
||||
expect(mockLogSystem2.info).toHaveBeenCalledWith("Message 2");
|
||||
expect(mockLogSystem2.info).toHaveBeenCalledWith("Message 2", undefined);
|
||||
expect(mockLogSystem1.info).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
});
|
||||
@@ -103,17 +107,17 @@ describe("Logger", () => {
|
||||
const logger = new Logger();
|
||||
logger.setLevel(LogLevel.DEBUG);
|
||||
const testMessage = "Test message";
|
||||
const testArgs = [{ data: "test" }, 123];
|
||||
const testArgs = { data: "test" };
|
||||
|
||||
logger.debug(testMessage, ...testArgs);
|
||||
logger.info(testMessage, ...testArgs);
|
||||
logger.warn(testMessage, ...testArgs);
|
||||
logger.error(testMessage, ...testArgs);
|
||||
logger.debug(testMessage, testArgs);
|
||||
logger.info(testMessage, testArgs);
|
||||
logger.warn(testMessage, testArgs);
|
||||
logger.error(testMessage, testArgs);
|
||||
|
||||
expect(consoleSpy.debug).toHaveBeenCalledWith(testMessage, ...testArgs);
|
||||
expect(consoleSpy.info).toHaveBeenCalledWith(testMessage, ...testArgs);
|
||||
expect(consoleSpy.warn).toHaveBeenCalledWith(testMessage, ...testArgs);
|
||||
expect(consoleSpy.error).toHaveBeenCalledWith(testMessage, ...testArgs);
|
||||
expect(consoleSpy.debug).toHaveBeenCalledWith(testMessage, testArgs);
|
||||
expect(consoleSpy.info).toHaveBeenCalledWith(testMessage, testArgs);
|
||||
expect(consoleSpy.warn).toHaveBeenCalledWith(testMessage, testArgs);
|
||||
expect(consoleSpy.error).toHaveBeenCalledWith(testMessage, testArgs);
|
||||
|
||||
// Cleanup
|
||||
Object.values(consoleSpy).forEach((spy) => spy.mockRestore());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { afterEach, describe, expect, test, vi } from "vitest";
|
||||
import { afterEach, beforeEach, describe, expect, test, vi } from "vitest";
|
||||
import { expectMap } from "../coValue.js";
|
||||
import type { CoValueHeader } from "../coValueCore.js";
|
||||
import type { RawAccountID } from "../coValues/account.js";
|
||||
@@ -12,17 +12,27 @@ import { connectedPeers, newQueuePair } from "../streamUtils.js";
|
||||
import type { SyncMessage } from "../sync.js";
|
||||
import {
|
||||
blockMessageTypeOnOutgoingPeer,
|
||||
connectNodeToSyncServer,
|
||||
connectTwoPeers,
|
||||
createConnectedTestAgentNode,
|
||||
createConnectedTestNode,
|
||||
createTestMetricReader,
|
||||
createTestNode,
|
||||
loadCoValueOrFail,
|
||||
randomAnonymousAccountAndSessionID,
|
||||
setupSyncServer,
|
||||
tearDownTestMetricReader,
|
||||
waitFor,
|
||||
} from "./testUtils.js";
|
||||
|
||||
const Crypto = await WasmCrypto.create();
|
||||
|
||||
let jazzCloud = setupSyncServer();
|
||||
|
||||
beforeEach(async () => {
|
||||
jazzCloud = setupSyncServer();
|
||||
});
|
||||
|
||||
test("Node replies with initial tx and header to empty subscribe", async () => {
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
const node = new LocalNode(admin, session, Crypto);
|
||||
@@ -861,111 +871,34 @@ test.skip("When loading a coValue on one node, the server node it is requested f
|
||||
});
|
||||
|
||||
test("Can sync a coValue through a server to another client", async () => {
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
|
||||
const client1 = new LocalNode(admin, session, Crypto);
|
||||
const { node: client1 } = await createConnectedTestNode();
|
||||
|
||||
const group = client1.createGroup();
|
||||
|
||||
const map = group.createMap();
|
||||
map.set("hello", "world", "trusting");
|
||||
|
||||
const [serverUser, serverSession] = randomAnonymousAccountAndSessionID();
|
||||
const { node: client2 } = await createConnectedTestNode();
|
||||
|
||||
const server = new LocalNode(serverUser, serverSession, Crypto);
|
||||
const mapOnClient2 = await loadCoValueOrFail(client2, map.id);
|
||||
|
||||
const [serverAsPeerForClient1, client1AsPeer] = connectedPeers(
|
||||
"serverFor1",
|
||||
"client1",
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
// trace: true,
|
||||
},
|
||||
);
|
||||
|
||||
client1.syncManager.addPeer(serverAsPeerForClient1);
|
||||
server.syncManager.addPeer(client1AsPeer);
|
||||
|
||||
const client2 = new LocalNode(
|
||||
admin,
|
||||
Crypto.newRandomSessionID(admin.id),
|
||||
Crypto,
|
||||
);
|
||||
|
||||
const [serverAsPeerForClient2, client2AsPeer] = connectedPeers(
|
||||
"serverFor2",
|
||||
"client2",
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
// trace: true,
|
||||
},
|
||||
);
|
||||
|
||||
client2.syncManager.addPeer(serverAsPeerForClient2);
|
||||
server.syncManager.addPeer(client2AsPeer);
|
||||
|
||||
const mapOnClient2 = await client2.loadCoValueCore(map.core.id);
|
||||
if (mapOnClient2 === "unavailable") {
|
||||
throw new Error("Map is unavailable");
|
||||
}
|
||||
|
||||
expect(expectMap(mapOnClient2.getCurrentContent()).get("hello")).toEqual(
|
||||
"world",
|
||||
);
|
||||
expect(mapOnClient2.get("hello")).toEqual("world");
|
||||
});
|
||||
|
||||
test("Can sync a coValue with private transactions through a server to another client", async () => {
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
|
||||
const client1 = new LocalNode(admin, session, Crypto);
|
||||
const { node: client1 } = await createConnectedTestNode();
|
||||
|
||||
const group = client1.createGroup();
|
||||
|
||||
const map = group.createMap();
|
||||
map.set("hello", "world", "private");
|
||||
group.addMember("everyone", "reader");
|
||||
|
||||
const [serverUser, serverSession] = randomAnonymousAccountAndSessionID();
|
||||
const { node: client2 } = await createConnectedTestNode();
|
||||
|
||||
const server = new LocalNode(serverUser, serverSession, Crypto);
|
||||
const mapOnClient2 = await loadCoValueOrFail(client2, map.id);
|
||||
|
||||
const [serverAsPeer, client1AsPeer] = connectedPeers("server", "client1", {
|
||||
// trace: true,
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
});
|
||||
|
||||
client1.syncManager.addPeer(serverAsPeer);
|
||||
server.syncManager.addPeer(client1AsPeer);
|
||||
|
||||
const client2 = new LocalNode(
|
||||
admin,
|
||||
client1.crypto.newRandomSessionID(admin.id),
|
||||
Crypto,
|
||||
);
|
||||
|
||||
const [serverAsOtherPeer, client2AsPeer] = connectedPeers(
|
||||
"server",
|
||||
"client2",
|
||||
{
|
||||
// trace: true,
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
},
|
||||
);
|
||||
|
||||
client2.syncManager.addPeer(serverAsOtherPeer);
|
||||
server.syncManager.addPeer(client2AsPeer);
|
||||
|
||||
const mapOnClient2 = await client2.loadCoValueCore(map.core.id);
|
||||
if (mapOnClient2 === "unavailable") {
|
||||
throw new Error("Map is unavailable");
|
||||
}
|
||||
|
||||
expect(expectMap(mapOnClient2.getCurrentContent()).get("hello")).toEqual(
|
||||
"world",
|
||||
);
|
||||
expect(mapOnClient2.get("hello")).toEqual("world");
|
||||
});
|
||||
|
||||
test.skip("When a peer's incoming/readable stream closes, we remove the peer", async () => {
|
||||
@@ -1023,111 +956,32 @@ test.skip("When a peer's incoming/readable stream closes, we remove the peer", a
|
||||
*/
|
||||
});
|
||||
|
||||
test.skip("When a peer's outgoing/writable stream closes, we remove the peer", async () => {
|
||||
/*
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
const node = new LocalNode(admin, session, Crypto);
|
||||
|
||||
const group = node.createGroup();
|
||||
|
||||
const [inRx] = await Effect.runPromise(newStreamPair());
|
||||
const [outRx, outTx] = await Effect.runPromise(newStreamPair());
|
||||
|
||||
node.syncManager.addPeer({
|
||||
id: "test",
|
||||
incoming: inRx,
|
||||
outgoing: outTx,
|
||||
role: "server",
|
||||
});
|
||||
|
||||
// expect(yield* Queue.take(outRxQ)).toMatchObject({
|
||||
// action: "load",
|
||||
// id: admin.id,
|
||||
// });
|
||||
expect(yield * Queue.take(outRxQ)).toMatchObject({
|
||||
action: "load",
|
||||
id: group.core.id,
|
||||
});
|
||||
|
||||
const map = group.createMap();
|
||||
|
||||
const mapSubscribeMsg = await reader.read();
|
||||
|
||||
expect(mapSubscribeMsg.value).toEqual({
|
||||
action: "load",
|
||||
...map.core.knownState(),
|
||||
} satisfies SyncMessage);
|
||||
|
||||
// expect(yield* Queue.take(outRxQ)).toMatchObject(admContEx(admin.id));
|
||||
expect(yield * Queue.take(outRxQ)).toMatchObject(groupContentEx(group));
|
||||
|
||||
const mapContentMsg = await reader.read();
|
||||
|
||||
expect(mapContentMsg.value).toEqual({
|
||||
action: "content",
|
||||
id: map.core.id,
|
||||
header: map.core.header,
|
||||
new: {},
|
||||
} satisfies SyncMessage);
|
||||
|
||||
reader.releaseLock();
|
||||
await outRx.cancel();
|
||||
|
||||
map.set("hello", "world", "trusting");
|
||||
|
||||
await new Promise((resolve) => setTimeout(resolve, 100));
|
||||
|
||||
expect(node.syncManager.peers["test"]).toBeUndefined();
|
||||
*/
|
||||
});
|
||||
|
||||
test("If we start loading a coValue before connecting to a peer that has it, it will load it once we connect", async () => {
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
|
||||
const node1 = new LocalNode(admin, session, Crypto);
|
||||
const { node: node1 } = await createConnectedTestNode();
|
||||
|
||||
const group = node1.createGroup();
|
||||
|
||||
const map = group.createMap();
|
||||
map.set("hello", "world", "trusting");
|
||||
|
||||
const node2 = new LocalNode(
|
||||
admin,
|
||||
Crypto.newRandomSessionID(admin.id),
|
||||
Crypto,
|
||||
);
|
||||
const node2 = createTestNode();
|
||||
|
||||
const [node1asPeer, node2asPeer] = connectedPeers("peer1", "peer2", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
// trace: true,
|
||||
});
|
||||
|
||||
node1.syncManager.addPeer(node2asPeer);
|
||||
|
||||
const mapOnNode2Promise = node2.loadCoValueCore(map.core.id);
|
||||
const mapOnNode2Promise = loadCoValueOrFail(node2, map.id);
|
||||
|
||||
expect(node2.coValuesStore.get(map.core.id).state.type).toEqual("unknown");
|
||||
|
||||
node2.syncManager.addPeer(node1asPeer);
|
||||
connectNodeToSyncServer(node2);
|
||||
|
||||
const mapOnNode2 = await mapOnNode2Promise;
|
||||
if (mapOnNode2 === "unavailable") {
|
||||
throw new Error("Map is unavailable");
|
||||
}
|
||||
|
||||
expect(expectMap(mapOnNode2.getCurrentContent()).get("hello")).toEqual(
|
||||
"world",
|
||||
);
|
||||
expect(mapOnNode2.get("hello")).toEqual("world");
|
||||
});
|
||||
|
||||
test("should keep the peer state when the peer closes", async () => {
|
||||
const {
|
||||
client,
|
||||
jazzCloud,
|
||||
jazzCloudConnectionAsPeer,
|
||||
connectionWithClientAsPeer,
|
||||
} = createTwoConnectedNodes();
|
||||
const client = createTestNode();
|
||||
|
||||
const { nodeToServerPeer, serverToNodePeer } =
|
||||
connectNodeToSyncServer(client);
|
||||
|
||||
const group = jazzCloud.createGroup();
|
||||
const map = group.createMap();
|
||||
@@ -1136,25 +990,23 @@ test("should keep the peer state when the peer closes", async () => {
|
||||
await client.loadCoValueCore(map.core.id);
|
||||
|
||||
const syncManager = client.syncManager;
|
||||
const peerState = syncManager.peers[jazzCloudConnectionAsPeer.id];
|
||||
const peerState = syncManager.peers[nodeToServerPeer.id];
|
||||
|
||||
// @ts-expect-error Simulating a peer closing, leveraging the direct connection between the client/server peers
|
||||
await connectionWithClientAsPeer.outgoing.push("Disconnected");
|
||||
await serverToNodePeer.outgoing.push("Disconnected");
|
||||
|
||||
await waitFor(() => peerState?.closed);
|
||||
|
||||
expect(syncManager.peers[jazzCloudConnectionAsPeer.id]).not.toBeUndefined();
|
||||
expect(syncManager.peers[nodeToServerPeer.id]).not.toBeUndefined();
|
||||
});
|
||||
|
||||
test("should delete the peer state when the peer closes if deletePeerStateOnClose is true", async () => {
|
||||
const {
|
||||
client,
|
||||
jazzCloud,
|
||||
jazzCloudConnectionAsPeer,
|
||||
connectionWithClientAsPeer,
|
||||
} = createTwoConnectedNodes();
|
||||
const client = createTestNode();
|
||||
|
||||
jazzCloudConnectionAsPeer.deletePeerStateOnClose = true;
|
||||
const { nodeToServerPeer, serverToNodePeer } =
|
||||
connectNodeToSyncServer(client);
|
||||
|
||||
nodeToServerPeer.deletePeerStateOnClose = true;
|
||||
|
||||
const group = jazzCloud.createGroup();
|
||||
const map = group.createMap();
|
||||
@@ -1164,14 +1016,14 @@ test("should delete the peer state when the peer closes if deletePeerStateOnClos
|
||||
|
||||
const syncManager = client.syncManager;
|
||||
|
||||
const peerState = syncManager.peers[jazzCloudConnectionAsPeer.id];
|
||||
const peerState = syncManager.peers[nodeToServerPeer.id];
|
||||
|
||||
// @ts-expect-error Simulating a peer closing, leveraging the direct connection between the client/server peers
|
||||
await connectionWithClientAsPeer.outgoing.push("Disconnected");
|
||||
await serverToNodePeer.outgoing.push("Disconnected");
|
||||
|
||||
await waitFor(() => peerState?.closed);
|
||||
|
||||
expect(syncManager.peers[jazzCloudConnectionAsPeer.id]).toBeUndefined();
|
||||
expect(syncManager.peers[nodeToServerPeer.id]).toBeUndefined();
|
||||
});
|
||||
|
||||
describe("sync - extra tests", () => {
|
||||
@@ -1624,29 +1476,6 @@ describe("sync - extra tests", () => {
|
||||
});
|
||||
});
|
||||
|
||||
function createTwoConnectedNodes() {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
|
||||
// Connect nodes initially
|
||||
const [connectionWithClientAsPeer, jazzCloudConnectionAsPeer] =
|
||||
connectedPeers("connectionWithClient", "jazzCloudConnection", {
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
});
|
||||
|
||||
client.syncManager.addPeer(jazzCloudConnectionAsPeer);
|
||||
jazzCloud.syncManager.addPeer(connectionWithClientAsPeer);
|
||||
|
||||
return {
|
||||
client,
|
||||
jazzCloud,
|
||||
connectionWithClientAsPeer,
|
||||
jazzCloudConnectionAsPeer,
|
||||
};
|
||||
}
|
||||
|
||||
test("a value created on one node can be loaded on anotehr node even if not directly connected", async () => {
|
||||
const userA = createTestNode();
|
||||
const userB = createTestNode();
|
||||
@@ -1671,7 +1500,7 @@ test("a value created on one node can be loaded on anotehr node even if not dire
|
||||
|
||||
describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
test("knownStates and optimisticKnownStates are the same when the coValue is fully synced", async () => {
|
||||
const { client, jazzCloud } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
@@ -1683,9 +1512,8 @@ describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
// Wait for the full sync to complete
|
||||
await mapOnClient.core.waitForSync();
|
||||
|
||||
const peerStateClient = client.syncManager.peers["jazzCloudConnection"]!;
|
||||
const peerStateJazzCloud =
|
||||
jazzCloud.syncManager.peers["connectionWithClient"]!;
|
||||
const peerStateClient = client.syncManager.getPeers()[0]!;
|
||||
const peerStateJazzCloud = jazzCloud.syncManager.getPeers()[0]!;
|
||||
|
||||
// The optimisticKnownStates should be the same as the knownStates after the full sync is complete
|
||||
expect(
|
||||
@@ -1699,7 +1527,7 @@ describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
});
|
||||
|
||||
test("optimisticKnownStates is updated as new transactions are sent, while knownStates only when the updates are acknowledged", async () => {
|
||||
const { client, jazzCloudConnectionAsPeer } = createTwoConnectedNodes();
|
||||
const { node: client, nodeToServerPeer } = await createConnectedTestNode();
|
||||
|
||||
// Create test data and sync the first change
|
||||
// We want that both the nodes know about the coValue so we can test
|
||||
@@ -1717,7 +1545,7 @@ describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
// while knownStates is only updated when we receive the "known" messages
|
||||
// that are acknowledging the receipt of the content messages
|
||||
const outgoing = blockMessageTypeOnOutgoingPeer(
|
||||
jazzCloudConnectionAsPeer,
|
||||
nodeToServerPeer,
|
||||
"content",
|
||||
);
|
||||
|
||||
@@ -1725,8 +1553,7 @@ describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
|
||||
await client.syncManager.actuallySyncCoValue(map.core);
|
||||
|
||||
const peerState = client.syncManager.peers["jazzCloudConnection"]!;
|
||||
|
||||
const peerState = client.syncManager.peers[nodeToServerPeer.id]!;
|
||||
expect(peerState.optimisticKnownStates.get(map.core.id)).not.toEqual(
|
||||
peerState.knownStates.get(map.core.id),
|
||||
);
|
||||
@@ -1747,7 +1574,7 @@ describe("SyncManager - knownStates vs optimisticKnownStates", () => {
|
||||
|
||||
describe("SyncManager.addPeer", () => {
|
||||
test("new peer gets a copy of previous peer's knownStates when replacing it", async () => {
|
||||
const { client } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
@@ -1759,26 +1586,24 @@ describe("SyncManager.addPeer", () => {
|
||||
// Wait for initial sync
|
||||
await map.core.waitForSync();
|
||||
|
||||
const firstPeerState = client.syncManager.getPeers()[0]!;
|
||||
|
||||
// Store the initial known states
|
||||
const initialKnownStates =
|
||||
client.syncManager.peers["jazzCloudConnection"]!.knownStates;
|
||||
const initialKnownStates = firstPeerState.knownStates;
|
||||
|
||||
// Create new connection with same ID
|
||||
const [jazzCloudConnectionAsPeer2] = connectedPeers(
|
||||
"jazzCloudConnection",
|
||||
"unusedPeer",
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
},
|
||||
);
|
||||
const [secondPeer] = connectedPeers(firstPeerState.id, "unusedPeer", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
});
|
||||
|
||||
// Add new peer with same ID
|
||||
client.syncManager.addPeer(jazzCloudConnectionAsPeer2);
|
||||
client.syncManager.addPeer(secondPeer);
|
||||
|
||||
const newPeerState = client.syncManager.getPeers()[0]!;
|
||||
|
||||
// Verify that the new peer has a copy of the previous known states
|
||||
const newPeerKnownStates =
|
||||
client.syncManager.peers["jazzCloudConnection"]!.knownStates;
|
||||
const newPeerKnownStates = newPeerState.knownStates;
|
||||
|
||||
expect(newPeerKnownStates).not.toBe(initialKnownStates); // Should be a different instance
|
||||
expect(newPeerKnownStates.get(map.core.id)).toEqual(
|
||||
@@ -1787,7 +1612,7 @@ describe("SyncManager.addPeer", () => {
|
||||
});
|
||||
|
||||
test("new peer with new ID starts with empty knownStates", async () => {
|
||||
const { client } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
@@ -1815,23 +1640,19 @@ describe("SyncManager.addPeer", () => {
|
||||
});
|
||||
|
||||
test("when adding a peer with the same ID as a previous peer, the previous peer is closed", async () => {
|
||||
const { client } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Store reference to first peer
|
||||
const firstPeer = client.syncManager.peers["jazzCloudConnection"]!;
|
||||
const firstPeer = client.syncManager.getPeers()[0]!;
|
||||
const closeSpy = vi.spyOn(firstPeer, "gracefulShutdown");
|
||||
|
||||
// Create and add replacement peer
|
||||
const [jazzCloudConnectionAsPeer2] = connectedPeers(
|
||||
"jazzCloudConnection",
|
||||
"unusedPeer",
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
},
|
||||
);
|
||||
const [secondPeer] = connectedPeers(firstPeer.id, "unusedPeer", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
});
|
||||
|
||||
client.syncManager.addPeer(jazzCloudConnectionAsPeer2);
|
||||
client.syncManager.addPeer(secondPeer);
|
||||
|
||||
// Verify thet the first peer had ben closed correctly
|
||||
expect(closeSpy).toHaveBeenCalled();
|
||||
@@ -1839,25 +1660,21 @@ describe("SyncManager.addPeer", () => {
|
||||
});
|
||||
|
||||
test("when adding a peer with the same ID as a previous peer and the previous peer is closed, do not attempt to close it again", async () => {
|
||||
const { client } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Store reference to first peer
|
||||
const firstPeer = client.syncManager.peers["jazzCloudConnection"]!;
|
||||
const firstPeer = client.syncManager.getPeers()[0]!;
|
||||
|
||||
firstPeer.gracefulShutdown();
|
||||
const closeSpy = vi.spyOn(firstPeer, "gracefulShutdown");
|
||||
|
||||
// Create and add replacement peer
|
||||
const [jazzCloudConnectionAsPeer2] = connectedPeers(
|
||||
"jazzCloudConnection",
|
||||
"unusedPeer",
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
},
|
||||
);
|
||||
const [secondPeer] = connectedPeers(firstPeer.id, "unusedPeer", {
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
});
|
||||
|
||||
client.syncManager.addPeer(jazzCloudConnectionAsPeer2);
|
||||
client.syncManager.addPeer(secondPeer);
|
||||
|
||||
// Verify thet the first peer had not been closed again
|
||||
expect(closeSpy).not.toHaveBeenCalled();
|
||||
@@ -1865,24 +1682,15 @@ describe("SyncManager.addPeer", () => {
|
||||
});
|
||||
|
||||
test("when adding a server peer the local coValues should be sent to it", async () => {
|
||||
// Setup nodes
|
||||
const client = createTestNode();
|
||||
const jazzCloud = createTestNode();
|
||||
|
||||
// Connect nodes initially
|
||||
const [connectionWithClientAsPeer, jazzCloudConnectionAsPeer] =
|
||||
connectedPeers("connectionWithClient", "jazzCloudConnection", {
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
});
|
||||
|
||||
jazzCloud.syncManager.addPeer(connectionWithClientAsPeer);
|
||||
const { node: client, addServerPeer } = await createConnectedTestNode({
|
||||
connected: false,
|
||||
});
|
||||
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
client.syncManager.addPeer(jazzCloudConnectionAsPeer);
|
||||
addServerPeer();
|
||||
|
||||
await map.core.waitForSync();
|
||||
|
||||
@@ -1892,18 +1700,8 @@ describe("SyncManager.addPeer", () => {
|
||||
|
||||
describe("loadCoValueCore with retry", () => {
|
||||
test("should load the value if available on the server", async () => {
|
||||
const { client, jazzCloud } = createTwoConnectedNodes();
|
||||
|
||||
const anotherClient = createTestNode();
|
||||
const [
|
||||
connectionWithAnotherClientAsPeer,
|
||||
jazzCloudConnectionAsPeerForAnotherClient,
|
||||
] = connectedPeers("connectionWithAnotherClient", "jazzCloudConnection", {
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
});
|
||||
|
||||
jazzCloud.syncManager.addPeer(connectionWithAnotherClientAsPeer);
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
const { node: anotherClient } = await createConnectedTestNode();
|
||||
|
||||
const group = anotherClient.createGroup();
|
||||
const map = group.createMap();
|
||||
@@ -1911,25 +1709,12 @@ describe("loadCoValueCore with retry", () => {
|
||||
|
||||
const promise = client.loadCoValueCore(map.id);
|
||||
|
||||
anotherClient.syncManager.addPeer(
|
||||
jazzCloudConnectionAsPeerForAnotherClient,
|
||||
);
|
||||
await expect(promise).resolves.not.toBe("unavailable");
|
||||
});
|
||||
|
||||
test("should handle correctly two subsequent loads", async () => {
|
||||
const { client, jazzCloud } = createTwoConnectedNodes();
|
||||
|
||||
const anotherClient = createTestNode();
|
||||
const [
|
||||
connectionWithAnotherClientAsPeer,
|
||||
jazzCloudConnectionAsPeerForAnotherClient,
|
||||
] = connectedPeers("connectionWithAnotherClient", "jazzCloudConnection", {
|
||||
peer1role: "client",
|
||||
peer2role: "server",
|
||||
});
|
||||
|
||||
jazzCloud.syncManager.addPeer(connectionWithAnotherClientAsPeer);
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
const { node: anotherClient } = await createConnectedTestNode();
|
||||
|
||||
const group = anotherClient.createGroup();
|
||||
const map = group.createMap();
|
||||
@@ -1938,10 +1723,6 @@ describe("loadCoValueCore with retry", () => {
|
||||
const promise1 = client.loadCoValueCore(map.id);
|
||||
const promise2 = client.loadCoValueCore(map.id);
|
||||
|
||||
anotherClient.syncManager.addPeer(
|
||||
jazzCloudConnectionAsPeerForAnotherClient,
|
||||
);
|
||||
|
||||
await expect(promise1).resolves.not.toBe("unavailable");
|
||||
await expect(promise2).resolves.not.toBe("unavailable");
|
||||
});
|
||||
@@ -1949,8 +1730,7 @@ describe("loadCoValueCore with retry", () => {
|
||||
|
||||
describe("waitForSyncWithPeer", () => {
|
||||
test("should resolve when the coValue is fully uploaded into the peer", async () => {
|
||||
const { client, jazzCloudConnectionAsPeer: peer } =
|
||||
createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
@@ -1959,21 +1739,32 @@ describe("waitForSyncWithPeer", () => {
|
||||
|
||||
await client.syncManager.actuallySyncCoValue(map.core);
|
||||
|
||||
const peer = client.syncManager.getPeers()[0];
|
||||
|
||||
if (!peer) {
|
||||
throw new Error("No peer found");
|
||||
}
|
||||
|
||||
await expect(
|
||||
client.syncManager.waitForSyncWithPeer(peer.id, map.core.id, 100),
|
||||
).resolves.toBe(true);
|
||||
});
|
||||
|
||||
test("should not resolve when the coValue is not synced", async () => {
|
||||
const { client, jazzCloudConnectionAsPeer: peer } =
|
||||
createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
const peer = client.syncManager.getPeers()[0];
|
||||
|
||||
if (!peer) {
|
||||
throw new Error("No peer found");
|
||||
}
|
||||
|
||||
// Create test data
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("key1", "value1", "trusting");
|
||||
|
||||
vi.spyOn(peer.outgoing, "push").mockImplementation(async () => {
|
||||
vi.spyOn(peer, "pushOutgoingMessage").mockImplementation(async () => {
|
||||
return Promise.resolve();
|
||||
});
|
||||
|
||||
@@ -1986,7 +1777,7 @@ describe("waitForSyncWithPeer", () => {
|
||||
});
|
||||
|
||||
test("Should not crash when syncing an unknown coValue type", async () => {
|
||||
const { client, jazzCloud } = createTwoConnectedNodes();
|
||||
const { node: client } = await createConnectedTestNode();
|
||||
|
||||
const coValue = client.createCoValue({
|
||||
type: "ooops" as any,
|
||||
@@ -1997,8 +1788,10 @@ test("Should not crash when syncing an unknown coValue type", async () => {
|
||||
|
||||
await coValue.waitForSync();
|
||||
|
||||
const { node: anotherClient } = await createConnectedTestNode();
|
||||
|
||||
const coValueOnTheOtherNode = await loadCoValueOrFail(
|
||||
jazzCloud,
|
||||
anotherClient,
|
||||
coValue.getCurrentContent().id,
|
||||
);
|
||||
expect(coValueOnTheOtherNode.id).toBe(coValue.id);
|
||||
@@ -2092,6 +1885,163 @@ describe("metrics", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("sync protocol", () => {
|
||||
test("should have the correct messages exchanged between client and server", async () => {
|
||||
// Creating the account from agent to simplify the messages exchange
|
||||
const { node: client, messages } = await createConnectedTestAgentNode();
|
||||
|
||||
const group = client.createGroup();
|
||||
const map = group.createMap();
|
||||
map.set("hello", "world", "trusting");
|
||||
|
||||
const mapOnJazzCloud = await loadCoValueOrFail(jazzCloud, map.id);
|
||||
expect(mapOnJazzCloud.get("hello")).toEqual("world");
|
||||
|
||||
expect(messages).toEqual([
|
||||
{
|
||||
from: "client",
|
||||
msg: {
|
||||
action: "load",
|
||||
header: true,
|
||||
id: group.id,
|
||||
sessions: {
|
||||
[client.currentSessionID]: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "server",
|
||||
msg: {
|
||||
action: "load",
|
||||
header: false,
|
||||
id: group.id,
|
||||
sessions: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "client",
|
||||
msg: {
|
||||
action: "load",
|
||||
header: true,
|
||||
id: map.id,
|
||||
sessions: {
|
||||
[client.currentSessionID]: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "server",
|
||||
msg: {
|
||||
action: "load",
|
||||
header: false,
|
||||
id: map.id,
|
||||
sessions: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "client",
|
||||
msg: {
|
||||
action: "content",
|
||||
header: {
|
||||
createdAt: expect.any(String),
|
||||
meta: null,
|
||||
ruleset: {
|
||||
initialAdmin: client.account.id,
|
||||
type: "group",
|
||||
},
|
||||
type: "comap",
|
||||
uniqueness: expect.any(String),
|
||||
},
|
||||
id: group.id,
|
||||
new: {
|
||||
[client.currentSessionID]: {
|
||||
after: 0,
|
||||
lastSignature: expect.any(String),
|
||||
newTransactions: expect.any(Array),
|
||||
},
|
||||
},
|
||||
priority: 0,
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "client",
|
||||
msg: {
|
||||
action: "content",
|
||||
header: {
|
||||
createdAt: expect.any(String),
|
||||
meta: null,
|
||||
ruleset: {
|
||||
group: group.id,
|
||||
type: "ownedByGroup",
|
||||
},
|
||||
type: "comap",
|
||||
uniqueness: expect.any(String),
|
||||
},
|
||||
id: map.id,
|
||||
new: {
|
||||
[client.currentSessionID]: {
|
||||
after: 0,
|
||||
lastSignature: expect.any(String),
|
||||
newTransactions: expect.any(Array),
|
||||
},
|
||||
},
|
||||
priority: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
from: "server",
|
||||
msg: {
|
||||
action: "known",
|
||||
header: true,
|
||||
id: group.id,
|
||||
sessions: {
|
||||
[client.currentSessionID]: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
// TODO: This is a redundant message, we should remove it
|
||||
from: "client",
|
||||
msg: {
|
||||
action: "content",
|
||||
header: {
|
||||
createdAt: expect.any(String),
|
||||
meta: null,
|
||||
ruleset: {
|
||||
group: group.id,
|
||||
type: "ownedByGroup",
|
||||
},
|
||||
type: "comap",
|
||||
uniqueness: expect.any(String),
|
||||
},
|
||||
id: map.id,
|
||||
new: {
|
||||
[client.currentSessionID]: {
|
||||
after: 0,
|
||||
lastSignature: expect.any(String),
|
||||
newTransactions: expect.any(Array),
|
||||
},
|
||||
},
|
||||
priority: 3,
|
||||
},
|
||||
},
|
||||
{
|
||||
// TODO: This is a redundant message, we should remove it
|
||||
from: "server",
|
||||
msg: {
|
||||
action: "known",
|
||||
asDependencyOf: undefined,
|
||||
header: true,
|
||||
id: group.id,
|
||||
sessions: {
|
||||
[client.currentSessionID]: 3,
|
||||
},
|
||||
},
|
||||
},
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
function groupContentEx(group: RawGroup) {
|
||||
return {
|
||||
action: "content",
|
||||
@@ -2099,27 +2049,9 @@ function groupContentEx(group: RawGroup) {
|
||||
};
|
||||
}
|
||||
|
||||
function _admContEx(adminID: RawAccountID) {
|
||||
return {
|
||||
action: "content",
|
||||
id: adminID,
|
||||
};
|
||||
}
|
||||
|
||||
function groupStateEx(group: RawGroup) {
|
||||
return {
|
||||
action: "known",
|
||||
id: group.core.id,
|
||||
};
|
||||
}
|
||||
|
||||
function _admStateEx(adminID: RawAccountID) {
|
||||
return {
|
||||
action: "known",
|
||||
id: adminID,
|
||||
};
|
||||
}
|
||||
|
||||
function sleep(ms: number) {
|
||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
@@ -17,6 +17,12 @@ import { expectGroup } from "../typeUtils/expectGroup.js";
|
||||
|
||||
const Crypto = await WasmCrypto.create();
|
||||
|
||||
const syncServer: {
|
||||
current: undefined | LocalNode;
|
||||
} = {
|
||||
current: undefined,
|
||||
};
|
||||
|
||||
export function randomAnonymousAccountAndSessionID(): [
|
||||
ControlledAgent,
|
||||
SessionID,
|
||||
@@ -33,25 +39,6 @@ export function createTestNode() {
|
||||
return new LocalNode(admin, session, Crypto);
|
||||
}
|
||||
|
||||
export function connectTwoPeers(
|
||||
a: LocalNode,
|
||||
b: LocalNode,
|
||||
aRole: "client" | "server",
|
||||
bRole: "client" | "server",
|
||||
) {
|
||||
const [aAsPeer, bAsPeer] = connectedPeers(
|
||||
"peer:" + a.account.id,
|
||||
"peer:" + b.account.id,
|
||||
{
|
||||
peer1role: aRole,
|
||||
peer2role: bRole,
|
||||
},
|
||||
);
|
||||
|
||||
a.syncManager.addPeer(bAsPeer);
|
||||
b.syncManager.addPeer(aAsPeer);
|
||||
}
|
||||
|
||||
export async function createTwoConnectedNodes(
|
||||
node1Role: Peer["role"],
|
||||
node2Role: Peer["role"],
|
||||
@@ -149,6 +136,25 @@ export async function createThreeConnectedNodes(
|
||||
};
|
||||
}
|
||||
|
||||
export function connectTwoPeers(
|
||||
a: LocalNode,
|
||||
b: LocalNode,
|
||||
aRole: "client" | "server",
|
||||
bRole: "client" | "server",
|
||||
) {
|
||||
const [aAsPeer, bAsPeer] = connectedPeers(
|
||||
"peer:" + a.account.id,
|
||||
"peer:" + b.account.id,
|
||||
{
|
||||
peer1role: aRole,
|
||||
peer2role: bRole,
|
||||
},
|
||||
);
|
||||
|
||||
a.syncManager.addPeer(bAsPeer);
|
||||
b.syncManager.addPeer(aAsPeer);
|
||||
}
|
||||
|
||||
export function newGroup() {
|
||||
const [admin, sessionID] = randomAnonymousAccountAndSessionID();
|
||||
|
||||
@@ -368,3 +374,90 @@ export function createTestMetricReader() {
|
||||
export function tearDownTestMetricReader() {
|
||||
metrics.disable();
|
||||
}
|
||||
|
||||
export function setupSyncServer() {
|
||||
syncServer.current = createTestNode();
|
||||
return syncServer.current;
|
||||
}
|
||||
|
||||
export async function createConnectedTestAgentNode(opts = { connected: true }) {
|
||||
if (!syncServer.current) {
|
||||
throw new Error("Sync server not initialized");
|
||||
}
|
||||
|
||||
const [admin, session] = randomAnonymousAccountAndSessionID();
|
||||
const node = new LocalNode(admin, session, Crypto);
|
||||
|
||||
const { nodeToServerPeer, serverToNodePeer, messages, addServerPeer } =
|
||||
connectNodeToSyncServer(node, opts.connected);
|
||||
|
||||
return { node, nodeToServerPeer, serverToNodePeer, messages, addServerPeer };
|
||||
}
|
||||
|
||||
export async function createConnectedTestNode(opts = { connected: true }) {
|
||||
if (!syncServer.current) {
|
||||
throw new Error("Sync server not initialized");
|
||||
}
|
||||
|
||||
const ctx = await LocalNode.withNewlyCreatedAccount({
|
||||
peersToLoadFrom: [],
|
||||
crypto: Crypto,
|
||||
creationProps: { name: "Client" },
|
||||
});
|
||||
|
||||
const { nodeToServerPeer, serverToNodePeer, messages, addServerPeer } =
|
||||
connectNodeToSyncServer(ctx.node, opts.connected);
|
||||
|
||||
return {
|
||||
node: ctx.node,
|
||||
accountID: ctx.accountID,
|
||||
nodeToServerPeer,
|
||||
serverToNodePeer,
|
||||
messages,
|
||||
addServerPeer,
|
||||
};
|
||||
}
|
||||
|
||||
export function connectNodeToSyncServer(node: LocalNode, connected = true) {
|
||||
if (!syncServer.current) {
|
||||
throw new Error("Sync server not initialized");
|
||||
}
|
||||
|
||||
const [nodeToServerPeer, serverToNodePeer] = connectedPeers(
|
||||
syncServer.current.account.id,
|
||||
node.account.id,
|
||||
{
|
||||
peer1role: "server",
|
||||
peer2role: "client",
|
||||
},
|
||||
);
|
||||
|
||||
const messages: {
|
||||
from: "client" | "server";
|
||||
msg: SyncMessage;
|
||||
}[] = [];
|
||||
|
||||
const serverPush = serverToNodePeer.outgoing.push;
|
||||
serverToNodePeer.outgoing.push = (msg) => {
|
||||
messages.push({ from: "server", msg });
|
||||
return serverPush.call(serverToNodePeer.outgoing, msg);
|
||||
};
|
||||
|
||||
const clientPush = nodeToServerPeer.outgoing.push;
|
||||
nodeToServerPeer.outgoing.push = (msg) => {
|
||||
messages.push({ from: "client", msg });
|
||||
return clientPush.call(nodeToServerPeer.outgoing, msg);
|
||||
};
|
||||
|
||||
syncServer.current.syncManager.addPeer(serverToNodePeer);
|
||||
if (connected) {
|
||||
node.syncManager.addPeer(nodeToServerPeer);
|
||||
}
|
||||
|
||||
return {
|
||||
nodeToServerPeer,
|
||||
serverToNodePeer,
|
||||
messages,
|
||||
addServerPeer: () => node.syncManager.addPeer(nodeToServerPeer),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
# create-jazz-app
|
||||
|
||||
## 0.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- 0fc4f24: fix create-jazz-app fails if no starter param
|
||||
|
||||
## 0.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
@@ -17,13 +17,6 @@ You can create a new Jazz app in two ways:
|
||||
### Interactive mode
|
||||
|
||||
Simply run:
|
||||
|
||||
```bash
|
||||
npm create jazz-app@latest
|
||||
```
|
||||
|
||||
or
|
||||
|
||||
```bash
|
||||
npx create-jazz-app@latest
|
||||
```
|
||||
@@ -38,7 +31,7 @@ Then follow the interactive prompts to select your:
|
||||
Or specify all options directly:
|
||||
|
||||
```bash
|
||||
npm create jazz-app@latest -- --starter react-demo-auth --project-name my-app --package-manager npm
|
||||
npx create-jazz-app@latest --starter react-demo-auth --project-name my-app --package-manager npm
|
||||
```
|
||||
|
||||
### Start with an example app
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
"types": "src/index.ts",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"version": "0.1.7",
|
||||
"version": "0.1.8",
|
||||
"bin": {
|
||||
"create-jazz-app": "./dist/index.js"
|
||||
},
|
||||
|
||||
@@ -263,7 +263,8 @@ async function promptUser(
|
||||
return {
|
||||
...answers,
|
||||
...partialOptions,
|
||||
template: partialOptions.starter || partialOptions.example,
|
||||
template:
|
||||
answers.starter || partialOptions.starter || partialOptions.example,
|
||||
} as ScaffoldOptions;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user