Compare commits
71 Commits
feat/queue
...
jazz-nodej
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
64e2273475 | ||
|
|
5a85c89154 | ||
|
|
8898b10e89 | ||
|
|
dc2d4e25f7 | ||
|
|
ac3c2df474 | ||
|
|
681f973d4b | ||
|
|
338be7622f | ||
|
|
1227047b03 | ||
|
|
9afde8d0be | ||
|
|
c2ca1feba0 | ||
|
|
98c265304a | ||
|
|
675e3e8046 | ||
|
|
4acba8c990 | ||
|
|
a93adeb1fe | ||
|
|
cf8773f3de | ||
|
|
3be94ae1e7 | ||
|
|
6a8aa06d18 | ||
|
|
dc17889209 | ||
|
|
55f9d8e120 | ||
|
|
15b9457ed8 | ||
|
|
898297e95c | ||
|
|
0fc4f24cd5 | ||
|
|
63b5ad9edf | ||
|
|
873c3264ca | ||
|
|
34f89e48aa | ||
|
|
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 | ||
|
|
5863badbb0 | ||
|
|
56d26222e7 | ||
|
|
bd34084104 | ||
|
|
f5e6fe927d | ||
|
|
93c49639c2 | ||
|
|
aabe7bef34 | ||
|
|
909165d813 | ||
|
|
6bee742b65 | ||
|
|
23486d01b9 | ||
|
|
b761d5a730 | ||
|
|
9181e74fc8 | ||
|
|
5e83864f41 | ||
|
|
de5f2d6d5b | ||
|
|
4aa377dea7 | ||
|
|
31ae73fe0e | ||
|
|
7a5adfc4dc | ||
|
|
850e264912 |
@@ -1,7 +0,0 @@
|
|||||||
---
|
|
||||||
"chat-rn-clerk": patch
|
|
||||||
"jazz-react-native": patch
|
|
||||||
"jazz-example-chat": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Fix image handling in react-native
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
---
|
|
||||||
"cojson": patch
|
|
||||||
---
|
|
||||||
|
|
||||||
Optimize queue management
|
|
||||||
@@ -1,5 +1,94 @@
|
|||||||
# chat-rn-clerk
|
# chat-rn-clerk
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- f76274c: Fix image handling in react-native
|
||||||
|
- Updated dependencies [f76274c]
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react-native@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-react-native-auth-clerk@0.9.10
|
||||||
|
- jazz-react-native-media-images@0.9.10
|
||||||
|
|
||||||
## 1.0.50
|
## 1.0.50
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn-clerk",
|
"name": "chat-rn-clerk",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"version": "1.0.50",
|
"version": "1.0.59",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
"start": "expo start",
|
"start": "expo start",
|
||||||
|
|||||||
@@ -1,13 +1,7 @@
|
|||||||
import { useClerk, useUser } from "@clerk/clerk-expo";
|
import { useClerk, useUser } from "@clerk/clerk-expo";
|
||||||
import { JazzProvider, setupKvStore } from "jazz-react-native";
|
import { JazzProvider, setupKvStore } from "jazz-react-native";
|
||||||
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
|
import { useJazzClerkAuth } from "jazz-react-native-auth-clerk";
|
||||||
import React, {
|
import React, { createContext, PropsWithChildren, useContext } from "react";
|
||||||
createContext,
|
|
||||||
PropsWithChildren,
|
|
||||||
useContext,
|
|
||||||
useEffect,
|
|
||||||
useState,
|
|
||||||
} from "react";
|
|
||||||
import { Text, View } from "react-native";
|
import { Text, View } from "react-native";
|
||||||
const AuthContext = createContext<{
|
const AuthContext = createContext<{
|
||||||
isAuthenticated: boolean;
|
isAuthenticated: boolean;
|
||||||
@@ -27,15 +21,7 @@ export function JazzAndAuth({ children }: PropsWithChildren) {
|
|||||||
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
|
const { isSignedIn, isLoaded: isClerkLoaded } = useUser();
|
||||||
const clerk = useClerk();
|
const clerk = useClerk();
|
||||||
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
|
const [auth, state] = useJazzClerkAuth(clerk, kvStore);
|
||||||
const [isAuthenticated, setIsAuthenticated] = useState(false);
|
const isAuthenticated = Boolean(isSignedIn && isClerkLoaded && auth);
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
if (isSignedIn && isClerkLoaded && auth) {
|
|
||||||
setIsAuthenticated(true);
|
|
||||||
} else {
|
|
||||||
setIsAuthenticated(false);
|
|
||||||
}
|
|
||||||
}, [isSignedIn, isClerkLoaded, auth]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<AuthContext.Provider
|
<AuthContext.Provider
|
||||||
|
|||||||
@@ -1,5 +1,75 @@
|
|||||||
# chat-rn
|
# chat-rn
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [f76274c]
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react-native@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 1.0.47
|
## 1.0.47
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-rn",
|
"name": "chat-rn",
|
||||||
"version": "1.0.47",
|
"version": "1.0.56",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "expo export -p ios",
|
"build": "expo export -p ios",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# chat-vue
|
# chat-vue
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser@0.9.10
|
||||||
|
- jazz-vue@0.9.10
|
||||||
|
|
||||||
## 0.0.34
|
## 0.0.34
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example chat-vue --project-name chat-vue
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "chat-vue",
|
"name": "chat-vue",
|
||||||
"version": "0.0.34",
|
"version": "0.0.43",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,84 @@
|
|||||||
# jazz-example-chat
|
# jazz-example-chat
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- f76274c: Fix image handling in react-native
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.130
|
## 0.0.130
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example chat --project-name chat
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example chat --project-name chat
|
npx create-jazz-app@latest --example chat --project-name chat
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-chat",
|
"name": "jazz-example-chat",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.130",
|
"version": "0.0.139",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# minimal-auth-clerk
|
# minimal-auth-clerk
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-react-auth-clerk@0.9.10
|
||||||
|
|
||||||
## 0.0.29
|
## 0.0.29
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -15,11 +15,7 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --start clerk --project-name clerk
|
npx create-jazz-app@latest --example clerk --project-name clerk
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --start clerk --project-name clerk
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Go to the new project directory.
|
Go to the new project directory.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "clerk",
|
"name": "clerk",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.29",
|
"version": "0.0.38",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@clerk/clerk-react": "^5.4.1",
|
"@clerk/clerk-react": "^5.4.1",
|
||||||
"jazz-react": "workspace:*",
|
"jazz-react": "workspace:*",
|
||||||
"jazz-react-auth-clerk": "workspace:0.9.9",
|
"jazz-react-auth-clerk": "workspace:0.9.18",
|
||||||
"jazz-tools": "workspace:*",
|
"jazz-tools": "workspace:*",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1"
|
"react-dom": "^18.3.1"
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# file-share-svelte
|
# file-share-svelte
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-svelte@0.9.10
|
||||||
|
|
||||||
## 0.0.14
|
## 0.0.14
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "file-share-svelte",
|
"name": "file-share-svelte",
|
||||||
"version": "0.0.14",
|
"version": "0.0.23",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# form
|
# form
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.25
|
## 0.0.25
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -28,11 +28,7 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --start form --project-name form
|
npx create-jazz-app@latest --example form --project-name form
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --start form --project-name form
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Go to the new project directory.
|
Go to the new project directory.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "form",
|
"name": "form",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.25",
|
"version": "0.0.34",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# image-upload
|
# image-upload
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.27
|
## 0.0.27
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example image-upload --project-name image-upload
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "image-upload",
|
"name": "image-upload",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.27",
|
"version": "0.0.36",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# jazz-example-inspector
|
# jazz-example-inspector
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
- cojson-transport-ws@0.9.10
|
||||||
|
|
||||||
## 0.0.94
|
## 0.0.94
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-inspector",
|
"name": "jazz-inspector-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.94",
|
"version": "0.0.99",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"cojson": "workspace:0.9.9",
|
"cojson": "workspace:0.9.18",
|
||||||
"cojson-transport-ws": "workspace:0.9.9",
|
"cojson-transport-ws": "workspace:0.9.18",
|
||||||
"hash-slash": "workspace:0.2.1",
|
"hash-slash": "workspace:0.2.1",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
|
|||||||
@@ -1,5 +1,82 @@
|
|||||||
# jazz-example-musicplayer
|
# jazz-example-musicplayer
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.50
|
## 0.0.50
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example music-player --project-name music-player
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-music-player",
|
"name": "jazz-example-music-player",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.50",
|
"version": "0.0.59",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -18,8 +18,9 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"jazz-react": "workspace:0.9.9",
|
"jazz-react": "workspace:0.9.18",
|
||||||
"jazz-tools": "workspace:0.9.9",
|
"jazz-tools": "workspace:0.9.18",
|
||||||
|
"jazz-inspector": "workspace:*",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Toaster } from "@/components/ui/toaster";
|
import { Toaster } from "@/components/ui/toaster";
|
||||||
|
import { JazzInspector } from "jazz-inspector";
|
||||||
/* eslint-disable react-refresh/only-export-components */
|
/* eslint-disable react-refresh/only-export-components */
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import ReactDOM from "react-dom/client";
|
import ReactDOM from "react-dom/client";
|
||||||
@@ -71,6 +72,7 @@ function JazzAndAuth({ children }: { children: React.ReactNode }) {
|
|||||||
AccountSchema={MusicaAccount}
|
AccountSchema={MusicaAccount}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
<JazzInspector />
|
||||||
</JazzProvider>
|
</JazzProvider>
|
||||||
<DemoAuthBasicUI appName="Jazz Music Player" state={state} />
|
<DemoAuthBasicUI appName="Jazz Music Player" state={state} />
|
||||||
</>
|
</>
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# jazz-example-onboarding
|
# jazz-example-onboarding
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.31
|
## 0.0.31
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example onboarding --project-name onboarding
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example onboarding --project-name onboarding
|
npx create-jazz-app@latest --example onboarding --project-name onboarding
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-onboarding",
|
"name": "jazz-example-onboarding",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.31",
|
"version": "0.0.40",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# organization
|
# organization
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.23
|
## 0.0.23
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -16,10 +16,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example organization --project-name organization
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example organization --project-name organization
|
npx create-jazz-app@latest --example organization --project-name organization
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "organization",
|
"name": "organization",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.23",
|
"version": "0.0.32",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,59 @@
|
|||||||
# passkey-svelte
|
# passkey-svelte
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- jazz-svelte@0.9.10
|
||||||
|
|
||||||
## 0.0.18
|
## 0.0.18
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -21,10 +21,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example passkey-svelte --project-name passkey-svelte
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "passkey-svelte",
|
"name": "passkey-svelte",
|
||||||
"version": "0.0.18",
|
"version": "0.0.27",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# minimal-auth-passkey
|
# minimal-auth-passkey
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.28
|
## 0.0.28
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example passkey --project-name passkey
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example passkey --project-name passkey
|
npx create-jazz-app@latest --example passkey --project-name passkey
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "passkey",
|
"name": "passkey",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.28",
|
"version": "0.0.37",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# jazz-password-manager
|
# jazz-password-manager
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.49
|
## 0.0.49
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -15,10 +15,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example password-manager --project-name password-manager
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-password-manager",
|
"name": "jazz-password-manager",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.49",
|
"version": "0.0.58",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
|
"clean-install": "rm -rf node_modules pnpm-lock.yaml && pnpm install"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"jazz-react": "workspace:0.9.9",
|
"jazz-react": "workspace:0.9.18",
|
||||||
"jazz-tools": "workspace:0.9.9",
|
"jazz-tools": "workspace:0.9.18",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
"react-dom": "^18.3.1",
|
"react-dom": "^18.3.1",
|
||||||
"react-hook-form": "^7.41.5",
|
"react-hook-form": "^7.41.5",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# jazz-example-pets
|
# jazz-example-pets
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.147
|
## 0.0.147
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example pets --project-name pets
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example pets --project-name pets
|
npx create-jazz-app@latest --example pets --project-name pets
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-pets",
|
"name": "jazz-example-pets",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.147",
|
"version": "0.0.156",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -19,9 +19,9 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"jazz-browser-media-images": "workspace:0.9.9",
|
"jazz-browser-media-images": "workspace:0.9.18",
|
||||||
"jazz-react": "workspace:0.9.9",
|
"jazz-react": "workspace:0.9.18",
|
||||||
"jazz-tools": "workspace:0.9.9",
|
"jazz-tools": "workspace:0.9.18",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
"@vitejs/plugin-react-swc": "^3.3.2",
|
"@vitejs/plugin-react-swc": "^3.3.2",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"is-ci": "^3.0.1",
|
"is-ci": "^3.0.1",
|
||||||
"jazz-run": "workspace:0.9.9",
|
"jazz-run": "workspace:0.9.18",
|
||||||
"postcss": "^8.4.27",
|
"postcss": "^8.4.27",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^3.4.15",
|
||||||
"typescript": "~5.6.2",
|
"typescript": "~5.6.2",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# reactions
|
# reactions
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser-media-images@0.9.10
|
||||||
|
|
||||||
## 0.0.27
|
## 0.0.27
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example reactions --project-name reactions
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example reactions --project-name reactions
|
npx create-jazz-app@latest --example reactions --project-name reactions
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "reactions",
|
"name": "reactions",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.27",
|
"version": "0.0.36",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,5 +1,83 @@
|
|||||||
# todo-vue
|
# todo-vue
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
- jazz-browser@0.9.10
|
||||||
|
- jazz-vue@0.9.10
|
||||||
|
|
||||||
## 0.0.32
|
## 0.0.32
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -11,10 +11,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example todo-vue --project-name todo-vue
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "todo-vue",
|
"name": "todo-vue",
|
||||||
"version": "0.0.32",
|
"version": "0.0.41",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# jazz-example-todo
|
# jazz-example-todo
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.146
|
## 0.0.146
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```bash
|
||||||
npm create jazz-app@latest --example todo --project-name todo
|
|
||||||
```
|
|
||||||
or
|
|
||||||
```bash
|
|
||||||
npx create-jazz-app@latest --example todo --project-name todo
|
npx create-jazz-app@latest --example todo --project-name todo
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "jazz-example-todo",
|
"name": "jazz-example-todo",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.146",
|
"version": "0.0.155",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
"@radix-ui/react-toast": "^1.1.4",
|
"@radix-ui/react-toast": "^1.1.4",
|
||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.0.0",
|
"clsx": "^2.0.0",
|
||||||
"jazz-react": "workspace:0.9.9",
|
"jazz-react": "workspace:0.9.18",
|
||||||
"jazz-tools": "workspace:0.9.9",
|
"jazz-tools": "workspace:0.9.18",
|
||||||
"lucide-react": "^0.274.0",
|
"lucide-react": "^0.274.0",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"react": "^18.3.1",
|
"react": "^18.3.1",
|
||||||
|
|||||||
@@ -1,5 +1,74 @@
|
|||||||
# version-history
|
# version-history
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [5e83864]
|
||||||
|
- jazz-react@0.9.10
|
||||||
|
- jazz-tools@0.9.10
|
||||||
|
|
||||||
## 0.0.24
|
## 0.0.24
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -13,10 +13,6 @@ You can either
|
|||||||
|
|
||||||
Create a new Jazz project, and use this example as a template.
|
Create a new Jazz project, and use this example as a template.
|
||||||
```bash
|
```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
|
npx create-jazz-app@latest --example version-history --project-name version-history
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "version-history",
|
"name": "version-history",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.24",
|
"version": "0.0.33",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"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`
|
- initialise data in a user's `root` and `profile`
|
||||||
- add more data to your `root` and `profile` schemas
|
- 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
|
### When migrations run
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# cojson-storage-indexeddb
|
# cojson-storage-indexeddb
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
- cojson-storage@0.9.10
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cojson-storage-indexeddb",
|
"name": "cojson-storage-indexeddb",
|
||||||
"version": "0.9.9",
|
"version": "0.9.18",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
|
|||||||
@@ -1,5 +1,46 @@
|
|||||||
# cojson-storage-sqlite
|
# cojson-storage-sqlite
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
- cojson-storage@0.9.10
|
||||||
|
|
||||||
## 0.8.52
|
## 0.8.52
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "cojson-storage-rn-sqlite",
|
"name": "cojson-storage-rn-sqlite",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.8.52",
|
"version": "0.8.57",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -1,5 +1,49 @@
|
|||||||
# cojson-storage-sqlite
|
# cojson-storage-sqlite
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
- cojson-storage@0.9.10
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "cojson-storage-sqlite",
|
"name": "cojson-storage-sqlite",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.9.9",
|
"version": "0.9.18",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"better-sqlite3": "^11.7.0",
|
"better-sqlite3": "^11.7.0",
|
||||||
"cojson": "workspace:0.9.9",
|
"cojson": "workspace:0.9.18",
|
||||||
"cojson-storage": "workspace:*"
|
"cojson-storage": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { Database as DatabaseT } from "better-sqlite3";
|
import { Database as DatabaseT } from "better-sqlite3";
|
||||||
import { CojsonInternalTypes, OutgoingSyncQueue, SessionID } from "cojson";
|
import {
|
||||||
|
CojsonInternalTypes,
|
||||||
|
OutgoingSyncQueue,
|
||||||
|
SessionID,
|
||||||
|
logger,
|
||||||
|
} from "cojson";
|
||||||
import RawCoID = CojsonInternalTypes.RawCoID;
|
import RawCoID = CojsonInternalTypes.RawCoID;
|
||||||
import Signature = CojsonInternalTypes.Signature;
|
import Signature = CojsonInternalTypes.Signature;
|
||||||
import Transaction = CojsonInternalTypes.Transaction;
|
import Transaction = CojsonInternalTypes.Transaction;
|
||||||
@@ -23,6 +28,10 @@ export type RawTransactionRow = {
|
|||||||
tx: string;
|
tx: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export function getErrorMessage(error: unknown) {
|
||||||
|
return error instanceof Error ? error.message : "Unknown error";
|
||||||
|
}
|
||||||
|
|
||||||
export class SQLiteClient implements DBClientInterface {
|
export class SQLiteClient implements DBClientInterface {
|
||||||
private readonly db: DatabaseT;
|
private readonly db: DatabaseT;
|
||||||
private readonly toLocalNode: OutgoingSyncQueue;
|
private readonly toLocalNode: OutgoingSyncQueue;
|
||||||
@@ -48,7 +57,10 @@ export class SQLiteClient implements DBClientInterface {
|
|||||||
header: parsedHeader,
|
header: parsedHeader,
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn(coValueId, "Invalid JSON in header", e, coValueRow?.header);
|
const headerValue = coValueRow?.header ?? "";
|
||||||
|
logger.warn("Invalid JSON in header: " + headerValue, {
|
||||||
|
id: coValueId,
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -75,7 +87,7 @@ export class SQLiteClient implements DBClientInterface {
|
|||||||
tx: JSON.parse(transactionRow.tx) as Transaction,
|
tx: JSON.parse(transactionRow.tx) as Transaction,
|
||||||
}));
|
}));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.warn("Invalid JSON in transaction", e);
|
logger.warn("Invalid JSON in transaction");
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import {
|
|||||||
OutgoingSyncQueue,
|
OutgoingSyncQueue,
|
||||||
Peer,
|
Peer,
|
||||||
cojsonInternals,
|
cojsonInternals,
|
||||||
|
logger,
|
||||||
} from "cojson";
|
} from "cojson";
|
||||||
import { SyncManager, TransactionRow } from "cojson-storage";
|
import { SyncManager, TransactionRow } from "cojson-storage";
|
||||||
import { SQLiteClient } from "./sqliteClient.js";
|
import { SQLiteClient } from "./sqliteClient.js";
|
||||||
@@ -40,24 +41,21 @@ export class SQLiteNode {
|
|||||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
logger.error(
|
||||||
new Error(
|
`Error reading from localNode, handling msg\n\n${JSON.stringify(
|
||||||
`Error reading from localNode, handling msg\n\n${JSON.stringify(
|
msg,
|
||||||
msg,
|
(k, v) =>
|
||||||
(k, v) =>
|
k === "changes" || k === "encryptedChanges"
|
||||||
k === "changes" || k === "encryptedChanges"
|
? v.slice(0, 20) + "..."
|
||||||
? v.slice(0, 20) + "..."
|
: v,
|
||||||
: v,
|
)}`,
|
||||||
)}`,
|
|
||||||
{ cause: e },
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
processMessages().catch((e) =>
|
processMessages().catch((e) =>
|
||||||
console.error("Error in processMessages in sqlite", e),
|
logger.error("Error in processMessages in sqlite", e),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -97,10 +95,7 @@ export class SQLiteNode {
|
|||||||
db.pragma("user_version") as [{ user_version: number }]
|
db.pragma("user_version") as [{ user_version: number }]
|
||||||
)[0].user_version as number;
|
)[0].user_version as number;
|
||||||
|
|
||||||
console.log("DB version", oldVersion);
|
|
||||||
|
|
||||||
if (oldVersion === 0) {
|
if (oldVersion === 0) {
|
||||||
console.log("Migration 0 -> 1: Basic schema");
|
|
||||||
db.prepare(
|
db.prepare(
|
||||||
`CREATE TABLE IF NOT EXISTS transactions (
|
`CREATE TABLE IF NOT EXISTS transactions (
|
||||||
ses INTEGER,
|
ses INTEGER,
|
||||||
@@ -138,15 +133,10 @@ export class SQLiteNode {
|
|||||||
).run();
|
).run();
|
||||||
|
|
||||||
db.pragma("user_version = 1");
|
db.pragma("user_version = 1");
|
||||||
console.log("Migration 0 -> 1: Basic schema - done");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldVersion <= 1) {
|
if (oldVersion <= 1) {
|
||||||
// fix embarrassing off-by-one error for transaction indices
|
// fix embarrassing off-by-one error for transaction indices
|
||||||
console.log(
|
|
||||||
"Migration 1 -> 2: Fix off-by-one error for transaction indices",
|
|
||||||
);
|
|
||||||
|
|
||||||
const txs = db
|
const txs = db
|
||||||
.prepare(`SELECT * FROM transactions`)
|
.prepare(`SELECT * FROM transactions`)
|
||||||
.all() as TransactionRow[];
|
.all() as TransactionRow[];
|
||||||
@@ -163,14 +153,9 @@ export class SQLiteNode {
|
|||||||
}
|
}
|
||||||
|
|
||||||
db.pragma("user_version = 2");
|
db.pragma("user_version = 2");
|
||||||
console.log(
|
|
||||||
"Migration 1 -> 2: Fix off-by-one error for transaction indices - done",
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (oldVersion <= 2) {
|
if (oldVersion <= 2) {
|
||||||
console.log("Migration 2 -> 3: Add signatureAfter");
|
|
||||||
|
|
||||||
db.prepare(
|
db.prepare(
|
||||||
`CREATE TABLE IF NOT EXISTS signatureAfter (
|
`CREATE TABLE IF NOT EXISTS signatureAfter (
|
||||||
ses INTEGER,
|
ses INTEGER,
|
||||||
@@ -185,7 +170,6 @@ export class SQLiteNode {
|
|||||||
).run();
|
).run();
|
||||||
|
|
||||||
db.pragma("user_version = 3");
|
db.pragma("user_version = 3");
|
||||||
console.log("Migration 2 -> 3: Add signatureAfter - done!!");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return new SQLiteNode(db, fromLocalNode, toLocalNode);
|
return new SQLiteNode(db, fromLocalNode, toLocalNode);
|
||||||
|
|||||||
@@ -1,5 +1,44 @@
|
|||||||
# cojson-storage
|
# cojson-storage
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cojson-storage",
|
"name": "cojson-storage",
|
||||||
"version": "0.9.9",
|
"version": "0.9.18",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import {
|
|||||||
SyncMessage,
|
SyncMessage,
|
||||||
cojsonInternals,
|
cojsonInternals,
|
||||||
emptyKnownState,
|
emptyKnownState,
|
||||||
|
logger,
|
||||||
} from "cojson";
|
} from "cojson";
|
||||||
import { collectNewTxs, getDependedOnCoValues } from "./syncUtils.js";
|
import { collectNewTxs, getDependedOnCoValues } from "./syncUtils.js";
|
||||||
import { DBClientInterface, StoredSessionRow } from "./types.js";
|
import { DBClientInterface, StoredSessionRow } from "./types.js";
|
||||||
@@ -314,7 +315,7 @@ export class SyncManager {
|
|||||||
return this.toLocalNode
|
return this.toLocalNode
|
||||||
.push(msg)
|
.push(msg)
|
||||||
.catch((e) =>
|
.catch((e) =>
|
||||||
console.error(`Error sending ${msg.action} state, id ${msg.id}`, e),
|
logger.error(`Error sending ${msg.action} state, id ${msg.id}`, e),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,44 @@
|
|||||||
# cojson-transport-nodejs-ws
|
# cojson-transport-nodejs-ws
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- Updated dependencies [4aa377d]
|
||||||
|
- cojson@0.9.10
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "cojson-transport-ws",
|
"name": "cojson-transport-ws",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.9.9",
|
"version": "0.9.18",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "src/index.ts",
|
"types": "src/index.ts",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cojson": "workspace:0.9.9",
|
"cojson": "workspace:0.9.18",
|
||||||
"typescript": "~5.6.2"
|
"typescript": "~5.6.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ import {
|
|||||||
PingTimeoutError,
|
PingTimeoutError,
|
||||||
SyncMessage,
|
SyncMessage,
|
||||||
cojsonInternals,
|
cojsonInternals,
|
||||||
|
logger,
|
||||||
} from "cojson";
|
} from "cojson";
|
||||||
import { BatchedOutgoingMessages } from "./BatchedOutgoingMessages.js";
|
import { BatchedOutgoingMessages } from "./BatchedOutgoingMessages.js";
|
||||||
import { deserializeMessages } from "./serialization.js";
|
import { deserializeMessages, getErrorMessage } from "./serialization.js";
|
||||||
import { AnyWebSocket } from "./types.js";
|
import { AnyWebSocket } from "./types.js";
|
||||||
|
|
||||||
export const BUFFER_LIMIT = 100_000;
|
export const BUFFER_LIMIT = 100_000;
|
||||||
@@ -136,7 +137,7 @@ export function createWebSocketPeer({
|
|||||||
function handleClose() {
|
function handleClose() {
|
||||||
incoming
|
incoming
|
||||||
.push("Disconnected")
|
.push("Disconnected")
|
||||||
.catch((e) => console.error("Error while pushing disconnect msg", e));
|
.catch((e) => logger.error("Error while pushing disconnect msg", e));
|
||||||
emitClosedEvent();
|
emitClosedEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -145,7 +146,7 @@ export function createWebSocketPeer({
|
|||||||
const pingTimeout = createPingTimeoutListener(expectPings, () => {
|
const pingTimeout = createPingTimeoutListener(expectPings, () => {
|
||||||
incoming
|
incoming
|
||||||
.push("PingTimeout")
|
.push("PingTimeout")
|
||||||
.catch((e) => console.error("Error while pushing ping timeout", e));
|
.catch((e) => logger.error("Error while pushing ping timeout", e));
|
||||||
emitClosedEvent();
|
emitClosedEvent();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -156,17 +157,14 @@ export function createWebSocketPeer({
|
|||||||
|
|
||||||
function handleIncomingMsg(event: { data: unknown }) {
|
function handleIncomingMsg(event: { data: unknown }) {
|
||||||
if (event.data === "") {
|
if (event.data === "") {
|
||||||
console.log("client", id, "sent empty message");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const result = deserializeMessages(event.data);
|
const result = deserializeMessages(event.data);
|
||||||
|
|
||||||
if (!result.ok) {
|
if (!result.ok) {
|
||||||
console.error(
|
logger.warn(
|
||||||
"Error while deserializing messages",
|
"Error while deserializing messages: " + getErrorMessage(result.error),
|
||||||
event.data,
|
|
||||||
result.error,
|
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -184,7 +182,7 @@ export function createWebSocketPeer({
|
|||||||
if (msg && "action" in msg) {
|
if (msg && "action" in msg) {
|
||||||
incoming
|
incoming
|
||||||
.push(msg)
|
.push(msg)
|
||||||
.catch((e) => console.error("Error while pushing incoming msg", e));
|
.catch((e) => logger.error("Error while pushing incoming msg", e));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -197,7 +195,6 @@ export function createWebSocketPeer({
|
|||||||
outgoing: {
|
outgoing: {
|
||||||
push: outgoingMessages.sendMessage,
|
push: outgoingMessages.sendMessage,
|
||||||
close() {
|
close() {
|
||||||
console.log("Trying to close", id, websocket.readyState);
|
|
||||||
outgoingMessages.close();
|
outgoingMessages.close();
|
||||||
|
|
||||||
websocket.removeEventListener("message", handleIncomingMsg);
|
websocket.removeEventListener("message", handleIncomingMsg);
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
import { SyncMessage } from "cojson";
|
import { SyncMessage, logger } from "cojson";
|
||||||
import { PingMsg } from "./types.js";
|
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) {
|
export function addMessageToBacklog(backlog: string, message: SyncMessage) {
|
||||||
if (!backlog) {
|
if (!backlog) {
|
||||||
return JSON.stringify(message);
|
return JSON.stringify(message);
|
||||||
@@ -24,7 +28,7 @@ export function deserializeMessages(messages: unknown) {
|
|||||||
| PingMsg[],
|
| PingMsg[],
|
||||||
} as const;
|
} as const;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error while deserializing messages", e);
|
logger.error("Error while deserializing messages: " + getErrorMessage(e));
|
||||||
return {
|
return {
|
||||||
ok: false,
|
ok: false,
|
||||||
error: e,
|
error: e,
|
||||||
|
|||||||
@@ -1,5 +1,36 @@
|
|||||||
# cojson
|
# cojson
|
||||||
|
|
||||||
|
## 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
|
||||||
|
|
||||||
|
- 4aa377d: Handle unkown coValue content type and optimize content access
|
||||||
|
|
||||||
## 0.9.9
|
## 0.9.9
|
||||||
|
|
||||||
### Patch Changes
|
### Patch Changes
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"version": "0.9.9",
|
"version": "0.9.18",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@opentelemetry/sdk-metrics": "^1.29.0",
|
"@opentelemetry/sdk-metrics": "^1.29.0",
|
||||||
"@types/jest": "^29.5.3",
|
"@types/jest": "^29.5.3",
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import {
|
|||||||
} from "./PriorityBasedMessageQueue.js";
|
} from "./PriorityBasedMessageQueue.js";
|
||||||
import { TryAddTransactionsError } from "./coValueCore.js";
|
import { TryAddTransactionsError } from "./coValueCore.js";
|
||||||
import { RawCoID } from "./ids.js";
|
import { RawCoID } from "./ids.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { CO_VALUE_PRIORITY } from "./priority.js";
|
import { CO_VALUE_PRIORITY } from "./priority.js";
|
||||||
import { Peer, SyncMessage } from "./sync.js";
|
import { Peer, SyncMessage } from "./sync.js";
|
||||||
|
|
||||||
@@ -137,7 +138,10 @@ export class PeerState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
gracefulShutdown() {
|
gracefulShutdown() {
|
||||||
console.debug("Gracefully closing", this.id);
|
logger.debug("Gracefully closing", {
|
||||||
|
peerId: this.id,
|
||||||
|
peerRole: this.role,
|
||||||
|
});
|
||||||
this.closeQueue();
|
this.closeQueue();
|
||||||
this.peer.outgoing.close();
|
this.peer.outgoing.close();
|
||||||
this.closed = true;
|
this.closed = true;
|
||||||
|
|||||||
@@ -43,12 +43,7 @@ export function bytesToBase64url(bytes: Uint8Array) {
|
|||||||
let base64 = decoder.decode(new Uint8Array(encoded.buffer, 0, n));
|
let base64 = decoder.decode(new Uint8Array(encoded.buffer, 0, n));
|
||||||
if (k === 1) base64 += "==";
|
if (k === 1) base64 += "==";
|
||||||
if (k === 2) base64 += "=";
|
if (k === 2) base64 += "=";
|
||||||
// const after = performance.now();
|
|
||||||
// console.log(
|
|
||||||
// "bytesToBase64url bandwidth in MB/s for length",
|
|
||||||
// (1000 * bytes.length / (after - before)) / (1024 * 1024),
|
|
||||||
// bytes.length
|
|
||||||
// );
|
|
||||||
return base64;
|
return base64;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -35,6 +35,43 @@ export interface RawCoValue {
|
|||||||
subscribe(listener: (coValue: this) => void): () => void;
|
subscribe(listener: (coValue: this) => void): () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class RawUnknownCoValue implements RawCoValue {
|
||||||
|
id: CoID<this>;
|
||||||
|
core: CoValueCore;
|
||||||
|
|
||||||
|
constructor(core: CoValueCore) {
|
||||||
|
this.id = core.id as CoID<this>;
|
||||||
|
this.core = core;
|
||||||
|
}
|
||||||
|
|
||||||
|
get type() {
|
||||||
|
return this.core.header.type;
|
||||||
|
}
|
||||||
|
|
||||||
|
get headerMeta() {
|
||||||
|
return this.core.header.meta as JsonObject;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @category 6. Meta */
|
||||||
|
get group(): RawGroup {
|
||||||
|
return this.core.getGroup();
|
||||||
|
}
|
||||||
|
|
||||||
|
toJSON() {
|
||||||
|
return {};
|
||||||
|
}
|
||||||
|
|
||||||
|
atTime() {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
subscribe(listener: (value: this) => void): () => void {
|
||||||
|
return this.core.subscribe((content) => {
|
||||||
|
listener(content as this);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type AnyRawCoValue =
|
export type AnyRawCoValue =
|
||||||
| RawCoMap
|
| RawCoMap
|
||||||
| RawGroup
|
| RawGroup
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ import {
|
|||||||
import { Stringified, parseJSON, stableStringify } from "./jsonStringify.js";
|
import { Stringified, parseJSON, stableStringify } from "./jsonStringify.js";
|
||||||
import { JsonObject, JsonValue } from "./jsonValue.js";
|
import { JsonObject, JsonValue } from "./jsonValue.js";
|
||||||
import { LocalNode, ResolveAccountAgentError } from "./localNode.js";
|
import { LocalNode, ResolveAccountAgentError } from "./localNode.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import {
|
import {
|
||||||
PermissionsDef as RulesetDef,
|
PermissionsDef as RulesetDef,
|
||||||
determineValidTransactions,
|
determineValidTransactions,
|
||||||
@@ -126,10 +127,7 @@ export class CoValueCore {
|
|||||||
.expectCoValueLoaded(header.ruleset.group)
|
.expectCoValueLoaded(header.ruleset.group)
|
||||||
.subscribe((_groupUpdate) => {
|
.subscribe((_groupUpdate) => {
|
||||||
this._cachedContent = undefined;
|
this._cachedContent = undefined;
|
||||||
const newContent = this.getCurrentContent();
|
this.notifyUpdate("immediate");
|
||||||
for (const listener of this.listeners) {
|
|
||||||
listener(newContent);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,16 +210,10 @@ export class CoValueCore {
|
|||||||
.andThen((agent) => {
|
.andThen((agent) => {
|
||||||
const signerID = this.crypto.getAgentSignerID(agent);
|
const signerID = this.crypto.getAgentSignerID(agent);
|
||||||
|
|
||||||
// const beforeHash = performance.now();
|
|
||||||
const { expectedNewHash, newStreamingHash } = this.expectedNewHashAfter(
|
const { expectedNewHash, newStreamingHash } = this.expectedNewHashAfter(
|
||||||
sessionID,
|
sessionID,
|
||||||
newTransactions,
|
newTransactions,
|
||||||
);
|
);
|
||||||
// const afterHash = performance.now();
|
|
||||||
// console.log(
|
|
||||||
// "Hashing took",
|
|
||||||
// afterHash - beforeHash
|
|
||||||
// );
|
|
||||||
|
|
||||||
if (givenExpectedNewHash && givenExpectedNewHash !== expectedNewHash) {
|
if (givenExpectedNewHash && givenExpectedNewHash !== expectedNewHash) {
|
||||||
return err({
|
return err({
|
||||||
@@ -244,11 +236,6 @@ export class CoValueCore {
|
|||||||
signerID,
|
signerID,
|
||||||
} satisfies InvalidSignatureError);
|
} satisfies InvalidSignatureError);
|
||||||
}
|
}
|
||||||
// const afterVerify = performance.now();
|
|
||||||
// console.log(
|
|
||||||
// "Verify took",
|
|
||||||
// afterVerify - beforeVerify
|
|
||||||
// );
|
|
||||||
|
|
||||||
this.doAddTransactions(
|
this.doAddTransactions(
|
||||||
sessionID,
|
sessionID,
|
||||||
@@ -263,138 +250,6 @@ export class CoValueCore {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/*tryAddTransactionsAsync(
|
|
||||||
sessionID: SessionID,
|
|
||||||
newTransactions: Transaction[],
|
|
||||||
givenExpectedNewHash: Hash | undefined,
|
|
||||||
newSignature: Signature,
|
|
||||||
): ResultAsync<true, TryAddTransactionsError> {
|
|
||||||
const currentAsyncAddTransaction = this._currentAsyncAddTransaction;
|
|
||||||
let maybeAwaitPrevious:
|
|
||||||
| ResultAsync<void, TryAddTransactionsError>
|
|
||||||
| undefined;
|
|
||||||
let thisDone = () => {};
|
|
||||||
|
|
||||||
if (currentAsyncAddTransaction) {
|
|
||||||
// eslint-disable-next-line neverthrow/must-use-result
|
|
||||||
maybeAwaitPrevious = ResultAsync.fromSafePromise(
|
|
||||||
currentAsyncAddTransaction,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
// eslint-disable-next-line neverthrow/must-use-result
|
|
||||||
maybeAwaitPrevious = ResultAsync.fromSafePromise(Promise.resolve());
|
|
||||||
this._currentAsyncAddTransaction = new Promise((resolve) => {
|
|
||||||
thisDone = resolve;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return maybeAwaitPrevious
|
|
||||||
.andThen((_previousDone) =>
|
|
||||||
this.node
|
|
||||||
.resolveAccountAgentAsync(
|
|
||||||
accountOrAgentIDfromSessionID(sessionID),
|
|
||||||
"Expected to know signer of transaction",
|
|
||||||
)
|
|
||||||
.andThen((agent) => {
|
|
||||||
const signerID = this.crypto.getAgentSignerID(agent);
|
|
||||||
|
|
||||||
const nTxBefore =
|
|
||||||
this.sessionLogs.get(sessionID)?.transactions
|
|
||||||
.length ?? 0;
|
|
||||||
|
|
||||||
// const beforeHash = performance.now();
|
|
||||||
return ResultAsync.fromSafePromise(
|
|
||||||
this.expectedNewHashAfterAsync(
|
|
||||||
sessionID,
|
|
||||||
newTransactions,
|
|
||||||
),
|
|
||||||
).andThen(({ expectedNewHash, newStreamingHash }) => {
|
|
||||||
// const afterHash = performance.now();
|
|
||||||
// console.log(
|
|
||||||
// "Hashing took",
|
|
||||||
// afterHash - beforeHash
|
|
||||||
// );
|
|
||||||
|
|
||||||
const nTxAfter =
|
|
||||||
this.sessionLogs.get(sessionID)?.transactions
|
|
||||||
.length ?? 0;
|
|
||||||
|
|
||||||
if (nTxAfter !== nTxBefore) {
|
|
||||||
const newTransactionLengthBefore =
|
|
||||||
newTransactions.length;
|
|
||||||
newTransactions = newTransactions.slice(
|
|
||||||
nTxAfter - nTxBefore,
|
|
||||||
);
|
|
||||||
console.warn(
|
|
||||||
"Transactions changed while async hashing",
|
|
||||||
{
|
|
||||||
nTxBefore,
|
|
||||||
nTxAfter,
|
|
||||||
newTransactionLengthBefore,
|
|
||||||
remainingNewTransactions:
|
|
||||||
newTransactions.length,
|
|
||||||
},
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
|
||||||
givenExpectedNewHash &&
|
|
||||||
givenExpectedNewHash !== expectedNewHash
|
|
||||||
) {
|
|
||||||
return err({
|
|
||||||
type: "InvalidHash",
|
|
||||||
id: this.id,
|
|
||||||
expectedNewHash,
|
|
||||||
givenExpectedNewHash,
|
|
||||||
} satisfies InvalidHashError);
|
|
||||||
}
|
|
||||||
|
|
||||||
performance.mark("verifyStart" + this.id);
|
|
||||||
if (
|
|
||||||
!this.crypto.verify(
|
|
||||||
newSignature,
|
|
||||||
expectedNewHash,
|
|
||||||
signerID,
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
return err({
|
|
||||||
type: "InvalidSignature",
|
|
||||||
id: this.id,
|
|
||||||
newSignature,
|
|
||||||
sessionID,
|
|
||||||
signerID,
|
|
||||||
} satisfies InvalidSignatureError);
|
|
||||||
}
|
|
||||||
performance.mark("verifyEnd" + this.id);
|
|
||||||
performance.measure(
|
|
||||||
"verify" + this.id,
|
|
||||||
"verifyStart" + this.id,
|
|
||||||
"verifyEnd" + this.id,
|
|
||||||
);
|
|
||||||
|
|
||||||
this.doAddTransactions(
|
|
||||||
sessionID,
|
|
||||||
newTransactions,
|
|
||||||
newSignature,
|
|
||||||
expectedNewHash,
|
|
||||||
newStreamingHash,
|
|
||||||
"deferred",
|
|
||||||
);
|
|
||||||
|
|
||||||
return ok(true as const);
|
|
||||||
});
|
|
||||||
}),
|
|
||||||
)
|
|
||||||
.map((trueResult) => {
|
|
||||||
thisDone();
|
|
||||||
return trueResult;
|
|
||||||
})
|
|
||||||
.mapErr((err) => {
|
|
||||||
thisDone();
|
|
||||||
return err;
|
|
||||||
});
|
|
||||||
}*/
|
|
||||||
|
|
||||||
private doAddTransactions(
|
private doAddTransactions(
|
||||||
sessionID: SessionID,
|
sessionID: SessionID,
|
||||||
newTransactions: Transaction[],
|
newTransactions: Transaction[],
|
||||||
@@ -432,12 +287,6 @@ export class CoValueCore {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (sizeOfTxsSinceLastInbetweenSignature > MAX_RECOMMENDED_TX_SIZE) {
|
if (sizeOfTxsSinceLastInbetweenSignature > MAX_RECOMMENDED_TX_SIZE) {
|
||||||
// console.log(
|
|
||||||
// "Saving inbetween signature for tx ",
|
|
||||||
// sessionID,
|
|
||||||
// transactions.length - 1,
|
|
||||||
// sizeOfTxsSinceLastInbetweenSignature
|
|
||||||
// );
|
|
||||||
signatureAfter[transactions.length - 1] = newSignature;
|
signatureAfter[transactions.length - 1] = newSignature;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -463,34 +312,40 @@ export class CoValueCore {
|
|||||||
this._cachedDependentOn = undefined;
|
this._cachedDependentOn = undefined;
|
||||||
this._cachedNewContentSinceEmpty = undefined;
|
this._cachedNewContentSinceEmpty = undefined;
|
||||||
|
|
||||||
if (this.listeners.size > 0) {
|
this.notifyUpdate(notifyMode);
|
||||||
if (notifyMode === "immediate") {
|
|
||||||
const content = this.getCurrentContent();
|
|
||||||
for (const listener of this.listeners) {
|
|
||||||
listener(content);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if (!this.nextDeferredNotify) {
|
|
||||||
this.nextDeferredNotify = new Promise((resolve) => {
|
|
||||||
setTimeout(() => {
|
|
||||||
this.nextDeferredNotify = undefined;
|
|
||||||
this.deferredUpdates = 0;
|
|
||||||
const content = this.getCurrentContent();
|
|
||||||
for (const listener of this.listeners) {
|
|
||||||
listener(content);
|
|
||||||
}
|
|
||||||
resolve();
|
|
||||||
}, 0);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.deferredUpdates++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
deferredUpdates = 0;
|
deferredUpdates = 0;
|
||||||
nextDeferredNotify: Promise<void> | undefined;
|
nextDeferredNotify: Promise<void> | undefined;
|
||||||
|
|
||||||
|
notifyUpdate(notifyMode: "immediate" | "deferred") {
|
||||||
|
if (this.listeners.size === 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (notifyMode === "immediate") {
|
||||||
|
const content = this.getCurrentContent();
|
||||||
|
for (const listener of this.listeners) {
|
||||||
|
listener(content);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!this.nextDeferredNotify) {
|
||||||
|
this.nextDeferredNotify = new Promise((resolve) => {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.nextDeferredNotify = undefined;
|
||||||
|
this.deferredUpdates = 0;
|
||||||
|
const content = this.getCurrentContent();
|
||||||
|
for (const listener of this.listeners) {
|
||||||
|
listener(content);
|
||||||
|
}
|
||||||
|
resolve();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.deferredUpdates++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
subscribe(listener: (content?: RawCoValue) => void): () => void {
|
subscribe(listener: (content?: RawCoValue) => void): () => void {
|
||||||
this.listeners.add(listener);
|
this.listeners.add(listener);
|
||||||
listener(this.getCurrentContent());
|
listener(this.getCurrentContent());
|
||||||
@@ -531,7 +386,6 @@ export class CoValueCore {
|
|||||||
streamingHash.update(transaction);
|
streamingHash.update(transaction);
|
||||||
const after = performance.now();
|
const after = performance.now();
|
||||||
if (after - before > 1) {
|
if (after - before > 1) {
|
||||||
// console.log("Hashing blocked for", after - before);
|
|
||||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||||
before = performance.now();
|
before = performance.now();
|
||||||
}
|
}
|
||||||
@@ -680,7 +534,7 @@ export class CoValueCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!decryptedChanges) {
|
if (!decryptedChanges) {
|
||||||
console.error("Failed to decrypt transaction despite having key");
|
logger.error("Failed to decrypt transaction despite having key");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -825,7 +679,7 @@ export class CoValueCore {
|
|||||||
if (secret) {
|
if (secret) {
|
||||||
return secret as KeySecret;
|
return secret as KeySecret;
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
logger.warn(
|
||||||
`Encrypting ${encryptingKeyID} key didn't decrypt ${keyID}`,
|
`Encrypting ${encryptingKeyID} key didn't decrypt ${keyID}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -865,7 +719,7 @@ export class CoValueCore {
|
|||||||
if (secret) {
|
if (secret) {
|
||||||
return secret as KeySecret;
|
return secret as KeySecret;
|
||||||
} else {
|
} else {
|
||||||
console.error(
|
logger.warn(
|
||||||
`Encrypting parent ${parentKey.id} key didn't decrypt ${keyID}`,
|
`Encrypting parent ${parentKey.id} key didn't decrypt ${keyID}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import { PeerState } from "./PeerState.js";
|
import { PeerState } from "./PeerState.js";
|
||||||
import { CoValueCore } from "./coValueCore.js";
|
import { CoValueCore } from "./coValueCore.js";
|
||||||
import { RawCoID } from "./ids.js";
|
import { RawCoID } from "./ids.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { PeerID } from "./sync.js";
|
import { PeerID } from "./sync.js";
|
||||||
|
|
||||||
export const CO_VALUE_LOADING_MAX_RETRIES = 5;
|
export const CO_VALUE_LOADING_MAX_RETRIES = 5;
|
||||||
@@ -282,7 +283,7 @@ async function loadCoValueFromPeers(
|
|||||||
...coValueEntry.state.coValue.knownState(),
|
...coValueEntry.state.coValue.knownState(),
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(`Failed to push load message to peer ${peer.id}`, err);
|
logger.warn(`Failed to push load message to peer ${peer.id}`, err);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
@@ -296,14 +297,17 @@ async function loadCoValueFromPeers(
|
|||||||
sessions: {},
|
sessions: {},
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(`Failed to push load message to peer ${peer.id}`, err);
|
logger.warn(`Failed to push load message to peer ${peer.id}`, err);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (coValueEntry.state.type === "loading") {
|
if (coValueEntry.state.type === "loading") {
|
||||||
const timeout = setTimeout(() => {
|
const timeout = setTimeout(() => {
|
||||||
if (coValueEntry.state.type === "loading") {
|
if (coValueEntry.state.type === "loading") {
|
||||||
console.error("Failed to load coValue from peer", peer.id);
|
logger.warn("Failed to load coValue from peer", {
|
||||||
|
peerId: peer.id,
|
||||||
|
peerRole: peer.role,
|
||||||
|
});
|
||||||
coValueEntry.dispatch({
|
coValueEntry.dispatch({
|
||||||
type: "not-found-in-peer",
|
type: "not-found-in-peer",
|
||||||
peerId: peer.id,
|
peerId: peer.id,
|
||||||
@@ -356,7 +360,7 @@ function sleep(ms: number) {
|
|||||||
function getPeersWithoutErrors(peers: PeerState[], coValueId: RawCoID) {
|
function getPeersWithoutErrors(peers: PeerState[], coValueId: RawCoID) {
|
||||||
return peers.filter((p) => {
|
return peers.filter((p) => {
|
||||||
if (p.erroredCoValues.has(coValueId)) {
|
if (p.erroredCoValues.has(coValueId)) {
|
||||||
console.error(
|
logger.warn(
|
||||||
`Skipping load on errored coValue ${coValueId} from peer ${p.id}`,
|
`Skipping load on errored coValue ${coValueId} from peer ${p.id}`,
|
||||||
);
|
);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ import {
|
|||||||
import { AgentID } from "../ids.js";
|
import { AgentID } from "../ids.js";
|
||||||
import { JsonObject } from "../jsonValue.js";
|
import { JsonObject } from "../jsonValue.js";
|
||||||
import { LocalNode } from "../localNode.js";
|
import { LocalNode } from "../localNode.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import type { AccountRole } from "../permissions.js";
|
import type { AccountRole } from "../permissions.js";
|
||||||
import { RawCoMap } from "./coMap.js";
|
import { RawCoMap } from "./coMap.js";
|
||||||
import { InviteSecret, RawGroup } from "./group.js";
|
import { InviteSecret, RawGroup } from "./group.js";
|
||||||
@@ -59,7 +60,7 @@ export class RawAccount<
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (agents.length !== 1) {
|
if (agents.length !== 1) {
|
||||||
console.warn("Account has " + agents.length + " agents", this.id);
|
logger.warn("Account has " + agents.length + " agents", { id: this.id });
|
||||||
}
|
}
|
||||||
|
|
||||||
this._cachedCurrentAgentID = agents[0];
|
this._cachedCurrentAgentID = agents[0];
|
||||||
|
|||||||
@@ -133,10 +133,6 @@ export class RawCoListView<
|
|||||||
change.before.txIndex
|
change.before.txIndex
|
||||||
]?.[change.before.changeIdx];
|
]?.[change.before.changeIdx];
|
||||||
if (!beforeEntry) {
|
if (!beforeEntry) {
|
||||||
// console.error(
|
|
||||||
// "Insertion before missing op " +
|
|
||||||
// change.before
|
|
||||||
// );
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
beforeEntry.predecessors.splice(0, 0, {
|
beforeEntry.predecessors.splice(0, 0, {
|
||||||
@@ -156,9 +152,6 @@ export class RawCoListView<
|
|||||||
change.after.txIndex
|
change.after.txIndex
|
||||||
]?.[change.after.changeIdx];
|
]?.[change.after.changeIdx];
|
||||||
if (!afterEntry) {
|
if (!afterEntry) {
|
||||||
// console.error(
|
|
||||||
// "Insertion after missing op " + change.after
|
|
||||||
// );
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
afterEntry.successors.push({
|
afterEntry.successors.push({
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import { CoID, RawCoValue } from "../coValue.js";
|
|||||||
import { CoValueCore } from "../coValueCore.js";
|
import { CoValueCore } from "../coValueCore.js";
|
||||||
import { AgentID, SessionID, TransactionID } from "../ids.js";
|
import { AgentID, SessionID, TransactionID } from "../ids.js";
|
||||||
import { JsonObject, JsonValue } from "../jsonValue.js";
|
import { JsonObject, JsonValue } from "../jsonValue.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import { CoValueKnownState } from "../sync.js";
|
import { CoValueKnownState } from "../sync.js";
|
||||||
import { accountOrAgentIDfromSessionID } from "../typeUtils/accountOrAgentIDfromSessionID.js";
|
import { accountOrAgentIDfromSessionID } from "../typeUtils/accountOrAgentIDfromSessionID.js";
|
||||||
import { isAccountID } from "../typeUtils/isAccountID.js";
|
import { isAccountID } from "../typeUtils/isAccountID.js";
|
||||||
@@ -309,7 +310,7 @@ export class RawBinaryCoStreamView<
|
|||||||
const start = items[0];
|
const start = items[0];
|
||||||
|
|
||||||
if (start?.type !== "start") {
|
if (start?.type !== "start") {
|
||||||
console.error("Invalid binary stream start", start);
|
logger.error("Invalid binary stream start", start);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +329,7 @@ export class RawBinaryCoStreamView<
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (item.type !== "chunk") {
|
if (item.type !== "chunk") {
|
||||||
console.error("Invalid binary stream chunk", item);
|
logger.error("Invalid binary stream chunk", item);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -382,7 +383,6 @@ export class RawBinaryCoStream<
|
|||||||
chunk: Uint8Array,
|
chunk: Uint8Array,
|
||||||
privacy: "private" | "trusting" = "private",
|
privacy: "private" | "trusting" = "private",
|
||||||
): void {
|
): void {
|
||||||
// const before = performance.now();
|
|
||||||
this.push(
|
this.push(
|
||||||
{
|
{
|
||||||
type: "chunk",
|
type: "chunk",
|
||||||
@@ -391,11 +391,6 @@ export class RawBinaryCoStream<
|
|||||||
privacy,
|
privacy,
|
||||||
false,
|
false,
|
||||||
);
|
);
|
||||||
// const after = performance.now();
|
|
||||||
// console.log(
|
|
||||||
// "pushBinaryStreamChunk bandwidth in MB/s",
|
|
||||||
// (1000 * chunk.length) / (after - before) / (1024 * 1024)
|
|
||||||
// );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
endBinaryStream(privacy: "private" | "trusting" = "private") {
|
endBinaryStream(privacy: "private" | "trusting" = "private") {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import {
|
|||||||
isParentGroupReference,
|
isParentGroupReference,
|
||||||
} from "../ids.js";
|
} from "../ids.js";
|
||||||
import { JsonObject } from "../jsonValue.js";
|
import { JsonObject } from "../jsonValue.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import { AccountRole, Role } from "../permissions.js";
|
import { AccountRole, Role } from "../permissions.js";
|
||||||
import { expectGroup } from "../typeUtils/expectGroup.js";
|
import { expectGroup } from "../typeUtils/expectGroup.js";
|
||||||
import {
|
import {
|
||||||
@@ -153,7 +154,7 @@ export class RawGroup<
|
|||||||
child.state.type === "unavailable"
|
child.state.type === "unavailable"
|
||||||
) {
|
) {
|
||||||
child.loadFromPeers(peers).catch(() => {
|
child.loadFromPeers(peers).catch(() => {
|
||||||
console.error(`Failed to load child group ${id}`);
|
logger.error(`Failed to load child group ${id}`);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -321,7 +322,7 @@ export class RawGroup<
|
|||||||
const secret = this.core.getReadKey(keyID);
|
const secret = this.core.getReadKey(keyID);
|
||||||
|
|
||||||
if (!secret) {
|
if (!secret) {
|
||||||
console.error("Can't find key", keyID);
|
logger.error("Can't find key " + keyID);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { RawUnknownCoValue } from "./coValue.js";
|
||||||
import type { CoValueCore } from "./coValueCore.js";
|
import type { CoValueCore } from "./coValueCore.js";
|
||||||
import { RawAccount, RawControlledAccount } from "./coValues/account.js";
|
import { RawAccount, RawControlledAccount } from "./coValues/account.js";
|
||||||
import { RawCoList } from "./coValues/coList.js";
|
import { RawCoList } from "./coValues/coList.js";
|
||||||
@@ -38,6 +39,6 @@ export function coreToCoValue(
|
|||||||
return new RawCoStream(core);
|
return new RawCoStream(core);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new Error(`Unknown coValue type ${core.header.type}`);
|
return new RawUnknownCoValue(core);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { base64URLtoBytes, bytesToBase64url } from "../base64url.js";
|
|||||||
import { RawCoID, TransactionID } from "../ids.js";
|
import { RawCoID, TransactionID } from "../ids.js";
|
||||||
import { Stringified, stableStringify } from "../jsonStringify.js";
|
import { Stringified, stableStringify } from "../jsonStringify.js";
|
||||||
import { JsonValue } from "../jsonValue.js";
|
import { JsonValue } from "../jsonValue.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import {
|
import {
|
||||||
CryptoProvider,
|
CryptoProvider,
|
||||||
Encrypted,
|
Encrypted,
|
||||||
@@ -192,7 +193,9 @@ export class PureJSCrypto extends CryptoProvider<Blake3State> {
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(textDecoder.decode(plaintext));
|
return JSON.parse(textDecoder.decode(plaintext));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to decrypt/parse sealed message", e);
|
logger.error(
|
||||||
|
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
|
||||||
|
);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { base64URLtoBytes, bytesToBase64url } from "../base64url.js";
|
|||||||
import { RawCoID, TransactionID } from "../ids.js";
|
import { RawCoID, TransactionID } from "../ids.js";
|
||||||
import { Stringified, stableStringify } from "../jsonStringify.js";
|
import { Stringified, stableStringify } from "../jsonStringify.js";
|
||||||
import { JsonValue } from "../jsonValue.js";
|
import { JsonValue } from "../jsonValue.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import {
|
import {
|
||||||
CryptoProvider,
|
CryptoProvider,
|
||||||
Encrypted,
|
Encrypted,
|
||||||
@@ -240,8 +241,9 @@ export class WasmCrypto extends CryptoProvider<Uint8Array> {
|
|||||||
try {
|
try {
|
||||||
return JSON.parse(textDecoder.decode(plaintext));
|
return JSON.parse(textDecoder.decode(plaintext));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Failed to decrypt/parse sealed message", e);
|
logger.error(
|
||||||
return undefined;
|
"Failed to decrypt/parse sealed message: " + (e as Error)?.message,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import { AgentID, RawCoID, TransactionID } from "../ids.js";
|
|||||||
import { SessionID } from "../ids.js";
|
import { SessionID } from "../ids.js";
|
||||||
import { Stringified, parseJSON, stableStringify } from "../jsonStringify.js";
|
import { Stringified, parseJSON, stableStringify } from "../jsonStringify.js";
|
||||||
import { JsonValue } from "../jsonValue.js";
|
import { JsonValue } from "../jsonValue.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
|
|
||||||
export type SignerSecret = `signerSecret_z${string}`;
|
export type SignerSecret = `signerSecret_z${string}`;
|
||||||
export type SignerID = `signer_z${string}`;
|
export type SignerID = `signer_z${string}`;
|
||||||
@@ -159,7 +160,7 @@ export abstract class CryptoProvider<Blake3State = any> {
|
|||||||
try {
|
try {
|
||||||
return parseJSON(this.decryptRaw(encrypted, keySecret, nOnceMaterial));
|
return parseJSON(this.decryptRaw(encrypted, keySecret, nOnceMaterial));
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Decryption error", e);
|
logger.error("Decryption error: " + (e as Error)?.message);
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -305,10 +306,7 @@ export class StreamingHash {
|
|||||||
|
|
||||||
update(value: JsonValue): Uint8Array {
|
update(value: JsonValue): Uint8Array {
|
||||||
const encoded = textEncoder.encode(stableStringify(value));
|
const encoded = textEncoder.encode(stableStringify(value));
|
||||||
// const before = performance.now();
|
|
||||||
this.state = this.crypto.blake3IncrementalUpdate(this.state, encoded);
|
this.state = this.crypto.blake3IncrementalUpdate(this.state, encoded);
|
||||||
// const after = performance.now();
|
|
||||||
// console.log(`Hashing throughput in MB/s`, 1000 * (encoded.length / (after - before)) / (1024 * 1024));
|
|
||||||
return encoded;
|
return encoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ import {
|
|||||||
} from "./ids.js";
|
} from "./ids.js";
|
||||||
import { Stringified, parseJSON, stableStringify } from "./jsonStringify.js";
|
import { Stringified, parseJSON, stableStringify } from "./jsonStringify.js";
|
||||||
import { LocalNode } from "./localNode.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 { Channel, connectedPeers } from "./streamUtils.js";
|
||||||
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
|
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
|
||||||
import { expectGroup } from "./typeUtils/expectGroup.js";
|
import { expectGroup } from "./typeUtils/expectGroup.js";
|
||||||
@@ -74,6 +74,7 @@ import {
|
|||||||
|
|
||||||
type Value = JsonValue | AnyRawCoValue;
|
type Value = JsonValue | AnyRawCoValue;
|
||||||
|
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { getPriorityFromHeader } from "./priority.js";
|
import { getPriorityFromHeader } from "./priority.js";
|
||||||
import { FileSystem } from "./storage/FileSystem.js";
|
import { FileSystem } from "./storage/FileSystem.js";
|
||||||
import { BlockFilename, LSMStorage, WalFilename } from "./storage/index.js";
|
import { BlockFilename, LSMStorage, WalFilename } from "./storage/index.js";
|
||||||
@@ -141,6 +142,7 @@ export {
|
|||||||
emptyKnownState,
|
emptyKnownState,
|
||||||
RawCoPlainText,
|
RawCoPlainText,
|
||||||
stringifyOpID,
|
stringifyOpID,
|
||||||
|
logger,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
@@ -156,6 +158,7 @@ export type {
|
|||||||
Stringified,
|
Stringified,
|
||||||
CoStreamItem,
|
CoStreamItem,
|
||||||
OpID,
|
OpID,
|
||||||
|
AccountRole,
|
||||||
};
|
};
|
||||||
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import {
|
|||||||
} from "./coValues/group.js";
|
} from "./coValues/group.js";
|
||||||
import { AgentSecret, CryptoProvider } from "./crypto/crypto.js";
|
import { AgentSecret, CryptoProvider } from "./crypto/crypto.js";
|
||||||
import { AgentID, RawCoID, SessionID, isAgentID } from "./ids.js";
|
import { AgentID, RawCoID, SessionID, isAgentID } from "./ids.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { Peer, PeerID, SyncManager } from "./sync.js";
|
import { Peer, PeerID, SyncManager } from "./sync.js";
|
||||||
import { expectGroup } from "./typeUtils/expectGroup.js";
|
import { expectGroup } from "./typeUtils/expectGroup.js";
|
||||||
|
|
||||||
@@ -230,7 +231,7 @@ export class LocalNode {
|
|||||||
|
|
||||||
return node;
|
return node;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error("Error withLoadedAccount", e);
|
logger.error("Error withLoadedAccount: " + (e as Error)?.message);
|
||||||
throw e;
|
throw e;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -269,7 +270,9 @@ export class LocalNode {
|
|||||||
this.syncManager.getServerAndStoragePeers(skipLoadingFromPeer);
|
this.syncManager.getServerAndStoragePeers(skipLoadingFromPeer);
|
||||||
|
|
||||||
await entry.loadFromPeers(peers).catch((e) => {
|
await entry.loadFromPeers(peers).catch((e) => {
|
||||||
console.error("Error loading from peers", id, e);
|
logger.error("Error loading from peers: " + (e as Error)?.message, {
|
||||||
|
id,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,8 +314,6 @@ export class LocalNode {
|
|||||||
let stopped = false;
|
let stopped = false;
|
||||||
let unsubscribe!: () => void;
|
let unsubscribe!: () => void;
|
||||||
|
|
||||||
// console.log("Subscribing to " + id);
|
|
||||||
|
|
||||||
this.load(id)
|
this.load(id)
|
||||||
.then((coValue) => {
|
.then((coValue) => {
|
||||||
if (stopped) {
|
if (stopped) {
|
||||||
@@ -325,11 +326,12 @@ export class LocalNode {
|
|||||||
unsubscribe = coValue.subscribe(callback);
|
unsubscribe = coValue.subscribe(callback);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error("Error subscribing to ", id, e);
|
logger.error(
|
||||||
|
"Error subscribing to " + id + ": " + (e as Error)?.message,
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
console.log("Unsubscribing from " + id);
|
|
||||||
stopped = true;
|
stopped = true;
|
||||||
unsubscribe?.();
|
unsubscribe?.();
|
||||||
};
|
};
|
||||||
@@ -390,9 +392,7 @@ export class LocalNode {
|
|||||||
(existingRole === "reader" && inviteRole === "readerInvite") ||
|
(existingRole === "reader" && inviteRole === "readerInvite") ||
|
||||||
(existingRole && inviteRole === "writeOnlyInvite")
|
(existingRole && inviteRole === "writeOnlyInvite")
|
||||||
) {
|
) {
|
||||||
console.debug(
|
logger.debug("Not accepting invite that would replace or downgrade role");
|
||||||
"Not accepting invite that would replace or downgrade role",
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
80
packages/cojson/src/logger.ts
Normal file
80
packages/cojson/src/logger.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import type { JsonValue } from "./jsonValue.js";
|
||||||
|
|
||||||
|
export enum LogLevel {
|
||||||
|
DEBUG = 0,
|
||||||
|
INFO = 1,
|
||||||
|
WARN = 2,
|
||||||
|
ERROR = 3,
|
||||||
|
NONE = 4,
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface LogSystem {
|
||||||
|
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, attributes?: Record<string, JsonValue>) {
|
||||||
|
console.debug(message, attributes);
|
||||||
|
}
|
||||||
|
info(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
console.info(message, attributes);
|
||||||
|
}
|
||||||
|
warn(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
console.warn(message, attributes);
|
||||||
|
}
|
||||||
|
error(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
console.error(message, attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Logger {
|
||||||
|
private level: LogLevel;
|
||||||
|
private logSystem: LogSystem;
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
level: LogLevel = LogLevel.INFO,
|
||||||
|
logSystem: LogSystem = new ConsoleLogSystem(),
|
||||||
|
) {
|
||||||
|
this.level = level;
|
||||||
|
this.logSystem = logSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLevel(level: LogLevel) {
|
||||||
|
this.level = level;
|
||||||
|
}
|
||||||
|
|
||||||
|
setLogSystem(logSystem: LogSystem) {
|
||||||
|
this.logSystem = logSystem;
|
||||||
|
}
|
||||||
|
|
||||||
|
debug(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
if (this.level <= LogLevel.DEBUG) {
|
||||||
|
this.logSystem.debug(message, attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
info(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
if (this.level <= LogLevel.INFO) {
|
||||||
|
this.logSystem.info(message, attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
warn(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
if (this.level <= LogLevel.WARN) {
|
||||||
|
this.logSystem.warn(message, attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
error(message: string, attributes?: Record<string, JsonValue>) {
|
||||||
|
if (this.level <= LogLevel.ERROR) {
|
||||||
|
this.logSystem.error(message, attributes);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create default logger instance
|
||||||
|
export const logger = new Logger();
|
||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
} from "./ids.js";
|
} from "./ids.js";
|
||||||
import { parseJSON } from "./jsonStringify.js";
|
import { parseJSON } from "./jsonStringify.js";
|
||||||
import { JsonValue } from "./jsonValue.js";
|
import { JsonValue } from "./jsonValue.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
|
import { accountOrAgentIDfromSessionID } from "./typeUtils/accountOrAgentIDfromSessionID.js";
|
||||||
import { expectGroup } from "./typeUtils/expectGroup.js";
|
import { expectGroup } from "./typeUtils/expectGroup.js";
|
||||||
|
|
||||||
@@ -41,12 +42,15 @@ export function disablePermissionErrors() {
|
|||||||
logPermissionErrors = false;
|
logPermissionErrors = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function logPermissionError(...args: unknown[]) {
|
function logPermissionError(
|
||||||
|
message: string,
|
||||||
|
attributes?: Record<string, JsonValue>,
|
||||||
|
) {
|
||||||
if (logPermissionErrors === false) {
|
if (logPermissionErrors === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn(...args);
|
logger.warn("Permission error: " + message, attributes);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function determineValidTransactions(
|
export function determineValidTransactions(
|
||||||
@@ -204,7 +208,6 @@ function determineValidTransactionsForGroup(
|
|||||||
const writeKeys = new Set<string>();
|
const writeKeys = new Set<string>();
|
||||||
|
|
||||||
for (const { sessionID, txIndex, tx } of allTransactionsSorted) {
|
for (const { sessionID, txIndex, tx } of allTransactionsSorted) {
|
||||||
// console.log("before", { memberState, validTransactions });
|
|
||||||
const transactor = accountOrAgentIDfromSessionID(sessionID);
|
const transactor = accountOrAgentIDfromSessionID(sessionID);
|
||||||
|
|
||||||
if (tx.privacy === "private") {
|
if (tx.privacy === "private") {
|
||||||
@@ -227,17 +230,10 @@ function determineValidTransactionsForGroup(
|
|||||||
try {
|
try {
|
||||||
changes = parseJSON(tx.changes);
|
changes = parseJSON(tx.changes);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
logPermissionError(
|
logPermissionError("Invalid JSON in transaction", {
|
||||||
coValue.id,
|
id: coValue.id,
|
||||||
"Invalid JSON in transaction",
|
|
||||||
e,
|
|
||||||
tx,
|
tx,
|
||||||
JSON.stringify(tx.changes, (k, v) =>
|
});
|
||||||
k === "changes" || k === "encryptedChanges"
|
|
||||||
? v.slice(0, 20) + "..."
|
|
||||||
: v,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -458,8 +454,6 @@ function determineValidTransactionsForGroup(
|
|||||||
|
|
||||||
memberState[affectedMember] = change.value;
|
memberState[affectedMember] = change.value;
|
||||||
validTransactions.push({ txID: { sessionID, txIndex }, tx });
|
validTransactions.push({ txID: { sessionID, txIndex }, tx });
|
||||||
|
|
||||||
// console.log("after", { memberState, validTransactions });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return { validTransactions, memberState };
|
return { validTransactions, memberState };
|
||||||
@@ -473,7 +467,7 @@ function agentInAccountOrMemberInGroup(
|
|||||||
return groupAtTime.currentAgentID().match(
|
return groupAtTime.currentAgentID().match(
|
||||||
(agentID) => agentID,
|
(agentID) => agentID,
|
||||||
(e) => {
|
(e) => {
|
||||||
console.error(
|
logger.error(
|
||||||
"Error while determining current agent ID in valid transactions",
|
"Error while determining current agent ID in valid transactions",
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -87,26 +87,15 @@ export async function writeBlock<WH, RH, FS extends FileSystem<WH, RH>>(
|
|||||||
const headerBytes = textEncoder.encode(JSON.stringify(blockHeader));
|
const headerBytes = textEncoder.encode(JSON.stringify(blockHeader));
|
||||||
await fs.append(file, headerBytes);
|
await fs.append(file, headerBytes);
|
||||||
|
|
||||||
// console.log(
|
|
||||||
// "full file",
|
|
||||||
// yield* $(
|
|
||||||
// fs.read(file as unknown as RH, 0, offset + headerBytes.length),
|
|
||||||
// ),
|
|
||||||
// );
|
|
||||||
|
|
||||||
const filename: BlockFilename = `L${level}-${(blockNumber + "").padStart(
|
const filename: BlockFilename = `L${level}-${(blockNumber + "").padStart(
|
||||||
3,
|
3,
|
||||||
"0",
|
"0",
|
||||||
)}-${hash.digest().replace("hash_", "").slice(0, 15)}-H${
|
)}-${hash.digest().replace("hash_", "").slice(0, 15)}-H${
|
||||||
headerBytes.length
|
headerBytes.length
|
||||||
}.jsonl`;
|
}.jsonl`;
|
||||||
// console.log("renaming to" + filename);
|
|
||||||
await fs.closeAndRename(file, filename);
|
await fs.closeAndRename(file, filename);
|
||||||
|
|
||||||
return filename;
|
return filename;
|
||||||
|
|
||||||
// console.log("Wrote block", filename, blockHeader);
|
|
||||||
// console.log("IDs in block", blockHeader.map(e => e.id));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function writeToWal<WH, RH, FS extends FileSystem<WH, RH>>(
|
export async function writeToWal<WH, RH, FS extends FileSystem<WH, RH>>(
|
||||||
@@ -120,6 +109,5 @@ export async function writeToWal<WH, RH, FS extends FileSystem<WH, RH>>(
|
|||||||
...chunk,
|
...chunk,
|
||||||
};
|
};
|
||||||
const bytes = textEncoder.encode(JSON.stringify(walEntry) + "\n");
|
const bytes = textEncoder.encode(JSON.stringify(walEntry) + "\n");
|
||||||
console.log("writing to WAL", handle, id, bytes.length);
|
|
||||||
return fs.append(handle, bytes);
|
return fs.append(handle, bytes);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { CoID, RawCoValue } from "../coValue.js";
|
|||||||
import { CoValueHeader, Transaction } from "../coValueCore.js";
|
import { CoValueHeader, Transaction } from "../coValueCore.js";
|
||||||
import { Signature } from "../crypto/crypto.js";
|
import { Signature } from "../crypto/crypto.js";
|
||||||
import { RawCoID } from "../ids.js";
|
import { RawCoID } from "../ids.js";
|
||||||
|
import { logger } from "../logger.js";
|
||||||
import { connectedPeers } from "../streamUtils.js";
|
import { connectedPeers } from "../streamUtils.js";
|
||||||
import {
|
import {
|
||||||
CoValueKnownState,
|
CoValueKnownState,
|
||||||
@@ -68,7 +69,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
|
|
||||||
const processMessages = async () => {
|
const processMessages = async () => {
|
||||||
for await (const msg of fromLocalNode) {
|
for await (const msg of fromLocalNode) {
|
||||||
console.log("Storage msg start", nMsg);
|
|
||||||
try {
|
try {
|
||||||
if (msg === "Disconnected" || msg === "PingTimeout") {
|
if (msg === "Disconnected" || msg === "PingTimeout") {
|
||||||
throw new Error("Unexpected Disconnected message");
|
throw new Error("Unexpected Disconnected message");
|
||||||
@@ -83,32 +83,30 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
await this.sendNewContent(msg.id, msg, undefined);
|
await this.sendNewContent(msg.id, msg, undefined);
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(
|
logger.error(
|
||||||
new Error(
|
`Error reading from localNode, handling msg\n\n${JSON.stringify(
|
||||||
`Error reading from localNode, handling msg\n\n${JSON.stringify(
|
msg,
|
||||||
msg,
|
(k, v) =>
|
||||||
(k, v) =>
|
k === "changes" || k === "encryptedChanges"
|
||||||
k === "changes" || k === "encryptedChanges"
|
? v.slice(0, 20) + "..."
|
||||||
? v.slice(0, 20) + "..."
|
: v,
|
||||||
: v,
|
)}
|
||||||
)}`,
|
Error: ${e instanceof Error ? e.message : "Unknown error"},
|
||||||
{ cause: e },
|
`,
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
console.log("Storage msg end", nMsg);
|
|
||||||
nMsg++;
|
nMsg++;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
processMessages().catch((e) =>
|
processMessages().catch((e) =>
|
||||||
console.error("Error in processMessages in storage", e),
|
logger.error("Error in processMessages in storage", e),
|
||||||
);
|
);
|
||||||
|
|
||||||
setTimeout(
|
setTimeout(
|
||||||
() =>
|
() =>
|
||||||
this.compact().catch((e) => {
|
this.compact().catch((e) => {
|
||||||
console.error("Error while compacting", e);
|
logger.error("Error while compacting", e);
|
||||||
}),
|
}),
|
||||||
20000,
|
20000,
|
||||||
);
|
);
|
||||||
@@ -134,7 +132,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
sessions: {},
|
sessions: {},
|
||||||
asDependencyOf,
|
asDependencyOf,
|
||||||
})
|
})
|
||||||
.catch((e) => console.error("Error while pushing known", e));
|
.catch((e) => logger.error("Error while pushing known", e));
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -190,13 +188,13 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
...ourKnown,
|
...ourKnown,
|
||||||
asDependencyOf,
|
asDependencyOf,
|
||||||
})
|
})
|
||||||
.catch((e) => console.error("Error while pushing known", e));
|
.catch((e) => logger.error("Error while pushing known", e));
|
||||||
|
|
||||||
for (const message of newContentMessages) {
|
for (const message of newContentMessages) {
|
||||||
if (Object.keys(message.new).length === 0) continue;
|
if (Object.keys(message.new).length === 0) continue;
|
||||||
this.toLocalNode
|
this.toLocalNode
|
||||||
.push(message)
|
.push(message)
|
||||||
.catch((e) => console.error("Error while pushing new content", e));
|
.catch((e) => logger.error("Error while pushing new content", e));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.coValues[id] = coValue;
|
this.coValues[id] = coValue;
|
||||||
@@ -232,14 +230,13 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
|
|
||||||
if (!coValue) {
|
if (!coValue) {
|
||||||
if (newContent.header) {
|
if (newContent.header) {
|
||||||
// console.log("Creating in WAL", newContent.id);
|
|
||||||
await this.withWAL((wal) =>
|
await this.withWAL((wal) =>
|
||||||
writeToWal(wal, this.fs, newContent.id, newContentAsChunk),
|
writeToWal(wal, this.fs, newContent.id, newContentAsChunk),
|
||||||
);
|
);
|
||||||
|
|
||||||
this.coValues[newContent.id] = newContentAsChunk;
|
this.coValues[newContent.id] = newContentAsChunk;
|
||||||
} else {
|
} else {
|
||||||
console.warn("Incontiguous incoming update for " + newContent.id);
|
logger.warn("Incontiguous incoming update for " + newContent.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@@ -264,7 +261,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// console.log("Appending to WAL", newContent.id);
|
|
||||||
await this.withWAL((wal) =>
|
await this.withWAL((wal) =>
|
||||||
writeToWal(wal, this.fs, newContent.id, newContentAsChunk),
|
writeToWal(wal, this.fs, newContent.id, newContentAsChunk),
|
||||||
);
|
);
|
||||||
@@ -301,8 +297,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
|
|
||||||
const { handle, size } = await this.getBlockHandle(blockFile, fs);
|
const { handle, size } = await this.getBlockHandle(blockFile, fs);
|
||||||
|
|
||||||
// console.log("Attempting to load", id, blockFile);
|
|
||||||
|
|
||||||
if (!cachedHeader) {
|
if (!cachedHeader) {
|
||||||
cachedHeader = {};
|
cachedHeader = {};
|
||||||
const header = await readHeader(blockFile, handle, size, fs);
|
const header = await readHeader(blockFile, handle, size, fs);
|
||||||
@@ -317,8 +311,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
}
|
}
|
||||||
const headerEntry = cachedHeader[id];
|
const headerEntry = cachedHeader[id];
|
||||||
|
|
||||||
// console.log("Header entry", id, headerEntry);
|
|
||||||
|
|
||||||
if (headerEntry) {
|
if (headerEntry) {
|
||||||
const nextChunk = await readChunk(handle, headerEntry, fs);
|
const nextChunk = await readChunk(handle, headerEntry, fs);
|
||||||
if (result) {
|
if (result) {
|
||||||
@@ -354,7 +346,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
|
|
||||||
const coValues = new Map<RawCoID, CoValueChunk>();
|
const coValues = new Map<RawCoID, CoValueChunk>();
|
||||||
|
|
||||||
console.log("Compacting WAL files", walFiles);
|
|
||||||
if (walFiles.length === 0) return;
|
if (walFiles.length === 0) return;
|
||||||
|
|
||||||
const oldWal = this.currentWal;
|
const oldWal = this.currentWal;
|
||||||
@@ -411,8 +402,6 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
return acc;
|
return acc;
|
||||||
}, 0);
|
}, 0);
|
||||||
|
|
||||||
console.log([...coValues.keys()], fileNames, highestBlockNumber);
|
|
||||||
|
|
||||||
await writeBlock(coValues, MAX_N_LEVELS, highestBlockNumber + 1, this.fs);
|
await writeBlock(coValues, MAX_N_LEVELS, highestBlockNumber + 1, this.fs);
|
||||||
|
|
||||||
for (const walFile of walFiles) {
|
for (const walFile of walFiles) {
|
||||||
@@ -438,15 +427,11 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
blockFilesByLevelInOrder[level]!.push(blockFile);
|
blockFilesByLevelInOrder[level]!.push(blockFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(blockFilesByLevelInOrder);
|
|
||||||
|
|
||||||
for (let level = MAX_N_LEVELS; level > 0; level--) {
|
for (let level = MAX_N_LEVELS; level > 0; level--) {
|
||||||
const nBlocksDesired = Math.pow(2, level);
|
const nBlocksDesired = Math.pow(2, level);
|
||||||
const blocksInLevel = blockFilesByLevelInOrder[level];
|
const blocksInLevel = blockFilesByLevelInOrder[level];
|
||||||
|
|
||||||
if (blocksInLevel && blocksInLevel.length > nBlocksDesired) {
|
if (blocksInLevel && blocksInLevel.length > nBlocksDesired) {
|
||||||
console.log("Compacting blocks in level", level, blocksInLevel);
|
|
||||||
|
|
||||||
const coValues = new Map<RawCoID, CoValueChunk>();
|
const coValues = new Map<RawCoID, CoValueChunk>();
|
||||||
|
|
||||||
for (const blockFile of blocksInLevel) {
|
for (const blockFile of blocksInLevel) {
|
||||||
@@ -517,7 +502,7 @@ export class LSMStorage<WH, RH, FS extends FileSystem<WH, RH>> {
|
|||||||
setTimeout(
|
setTimeout(
|
||||||
() =>
|
() =>
|
||||||
this.compact().catch((e) => {
|
this.compact().catch((e) => {
|
||||||
console.error("Error while compacting", e);
|
logger.error("Error while compacting", e);
|
||||||
}),
|
}),
|
||||||
5000,
|
5000,
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { CoValueCore } from "./coValueCore.js";
|
|||||||
import { Signature } from "./crypto/crypto.js";
|
import { Signature } from "./crypto/crypto.js";
|
||||||
import { RawCoID, SessionID } from "./ids.js";
|
import { RawCoID, SessionID } from "./ids.js";
|
||||||
import { LocalNode } from "./localNode.js";
|
import { LocalNode } from "./localNode.js";
|
||||||
|
import { logger } from "./logger.js";
|
||||||
import { CoValuePriority } from "./priority.js";
|
import { CoValuePriority } from "./priority.js";
|
||||||
|
|
||||||
export type CoValueKnownState = {
|
export type CoValueKnownState = {
|
||||||
@@ -22,6 +23,10 @@ export function emptyKnownState(id: RawCoID): CoValueKnownState {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getErrorMessage(e: unknown) {
|
||||||
|
return e instanceof Error ? e.message : "Unknown error";
|
||||||
|
}
|
||||||
|
|
||||||
export type SyncMessage =
|
export type SyncMessage =
|
||||||
| LoadMessage
|
| LoadMessage
|
||||||
| KnownStateMessage
|
| KnownStateMessage
|
||||||
@@ -150,7 +155,7 @@ export class SyncManager {
|
|||||||
|
|
||||||
async handleSyncMessage(msg: SyncMessage, peer: PeerState) {
|
async handleSyncMessage(msg: SyncMessage, peer: PeerState) {
|
||||||
if (peer.erroredCoValues.has(msg.id)) {
|
if (peer.erroredCoValues.has(msg.id)) {
|
||||||
console.error(
|
logger.warn(
|
||||||
`Skipping message ${msg.action} on errored coValue ${msg.id} from peer ${peer.id}`,
|
`Skipping message ${msg.action} on errored coValue ${msg.id} from peer ${peer.id}`,
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -182,7 +187,7 @@ export class SyncManager {
|
|||||||
|
|
||||||
if (entry.state.type !== "available") {
|
if (entry.state.type !== "available") {
|
||||||
entry.loadFromPeers([peer]).catch((e: unknown) => {
|
entry.loadFromPeers([peer]).catch((e: unknown) => {
|
||||||
console.error("Error sending load", e);
|
logger.error("Error sending load: " + getErrorMessage(e));
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -199,7 +204,7 @@ export class SyncManager {
|
|||||||
action: "load",
|
action: "load",
|
||||||
...coValue.knownState(),
|
...coValue.knownState(),
|
||||||
}).catch((e: unknown) => {
|
}).catch((e: unknown) => {
|
||||||
console.error("Error sending load", e);
|
logger.error("Error sending load: " + getErrorMessage(e));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -229,7 +234,7 @@ export class SyncManager {
|
|||||||
asDependencyOf,
|
asDependencyOf,
|
||||||
...coValue.knownState(),
|
...coValue.knownState(),
|
||||||
}).catch((e: unknown) => {
|
}).catch((e: unknown) => {
|
||||||
console.error("Error sending known state", e);
|
logger.error("Error sending known state: " + getErrorMessage(e));
|
||||||
});
|
});
|
||||||
|
|
||||||
peer.toldKnownState.add(id);
|
peer.toldKnownState.add(id);
|
||||||
@@ -256,15 +261,8 @@ export class SyncManager {
|
|||||||
const sendPieces = async () => {
|
const sendPieces = async () => {
|
||||||
let lastYield = performance.now();
|
let lastYield = performance.now();
|
||||||
for (const [_i, piece] of newContentPieces.entries()) {
|
for (const [_i, piece] of newContentPieces.entries()) {
|
||||||
// console.log(
|
|
||||||
// `${id} -> ${peer.id}: Sending content piece ${i + 1}/${
|
|
||||||
// newContentPieces.length
|
|
||||||
// } header: ${!!piece.header}`,
|
|
||||||
// // Object.values(piece.new).map((s) => s.newTransactions)
|
|
||||||
// );
|
|
||||||
|
|
||||||
this.trySendToPeer(peer, piece).catch((e: unknown) => {
|
this.trySendToPeer(peer, piece).catch((e: unknown) => {
|
||||||
console.error("Error sending content piece", e);
|
logger.error("Error sending content piece: " + getErrorMessage(e));
|
||||||
});
|
});
|
||||||
|
|
||||||
if (performance.now() - lastYield > 10) {
|
if (performance.now() - lastYield > 10) {
|
||||||
@@ -277,7 +275,7 @@ export class SyncManager {
|
|||||||
};
|
};
|
||||||
|
|
||||||
sendPieces().catch((e) => {
|
sendPieces().catch((e) => {
|
||||||
console.error("Error sending new content piece, retrying", e);
|
logger.error("Error sending new content piece, retrying", e);
|
||||||
peer.optimisticKnownStates.dispatch({
|
peer.optimisticKnownStates.dispatch({
|
||||||
type: "SET",
|
type: "SET",
|
||||||
id,
|
id,
|
||||||
@@ -337,7 +335,10 @@ export class SyncManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (msg === "PingTimeout") {
|
if (msg === "PingTimeout") {
|
||||||
console.error("Ping timeout from peer", peer.id);
|
logger.error("Ping timeout from peer", {
|
||||||
|
peerId: peer.id,
|
||||||
|
peerRole: peer.role,
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
@@ -360,13 +361,22 @@ export class SyncManager {
|
|||||||
processMessages()
|
processMessages()
|
||||||
.then(() => {
|
.then(() => {
|
||||||
if (peer.crashOnClose) {
|
if (peer.crashOnClose) {
|
||||||
console.error("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");
|
this.local.crashed = new Error("Unexpected close from peer");
|
||||||
throw new Error("Unexpected close from peer");
|
throw new Error("Unexpected close from peer");
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.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) {
|
if (peer.crashOnClose) {
|
||||||
this.local.crashed = e;
|
this.local.crashed = e;
|
||||||
throw new Error(e);
|
throw new Error(e);
|
||||||
@@ -406,13 +416,13 @@ export class SyncManager {
|
|||||||
// where we can get informations about the coValue
|
// where we can get informations about the coValue
|
||||||
if (msg.header || Object.keys(msg.sessions).length > 0) {
|
if (msg.header || Object.keys(msg.sessions).length > 0) {
|
||||||
entry.loadFromPeers([peer]).catch((e) => {
|
entry.loadFromPeers([peer]).catch((e) => {
|
||||||
console.error("Error loading coValue in handleLoad", e);
|
logger.error("Error loading coValue in handleLoad", e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.local.loadCoValueCore(msg.id, peer.id).catch((e) => {
|
this.local.loadCoValueCore(msg.id, peer.id).catch((e) => {
|
||||||
console.error("Error loading coValue in handleLoad", e);
|
logger.error("Error loading coValue in handleLoad", e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -439,7 +449,7 @@ export class SyncManager {
|
|||||||
header: false,
|
header: false,
|
||||||
sessions: {},
|
sessions: {},
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error("Error sending known state back", e);
|
logger.error("Error sending known state back", e);
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -449,7 +459,7 @@ export class SyncManager {
|
|||||||
await this.sendNewContentIncludingDependencies(msg.id, peer);
|
await this.sendNewContentIncludingDependencies(msg.id, peer);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error("Error loading coValue in handleLoad loading state", e);
|
logger.error("Error loading coValue in handleLoad loading state", e);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -484,7 +494,7 @@ export class SyncManager {
|
|||||||
peer.role === "storage" ? undefined : peer.id,
|
peer.role === "storage" ? undefined : peer.id,
|
||||||
)
|
)
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.error(
|
logger.error(
|
||||||
`Error loading coValue ${msg.id} to create loading state, as dependency of ${msg.asDependencyOf}`,
|
`Error loading coValue ${msg.id} to create loading state, as dependency of ${msg.asDependencyOf}`,
|
||||||
e,
|
e,
|
||||||
);
|
);
|
||||||
@@ -521,7 +531,7 @@ export class SyncManager {
|
|||||||
|
|
||||||
if (entry.state.type !== "available") {
|
if (entry.state.type !== "available") {
|
||||||
if (!msg.header) {
|
if (!msg.header) {
|
||||||
console.error("Expected header to be sent in first message");
|
logger.error("Expected header to be sent in first message");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -584,7 +594,7 @@ export class SyncManager {
|
|||||||
: t.changes.length,
|
: t.changes.length,
|
||||||
)
|
)
|
||||||
.reduce((a, b) => a + b, 0);
|
.reduce((a, b) => a + b, 0);
|
||||||
console.log(
|
logger.debug(
|
||||||
`Adding incoming transactions took ${(after - before).toFixed(
|
`Adding incoming transactions took ${(after - before).toFixed(
|
||||||
2,
|
2,
|
||||||
)}ms for ${totalTxLength} bytes = bandwidth: ${(
|
)}ms for ${totalTxLength} bytes = bandwidth: ${(
|
||||||
@@ -602,17 +612,11 @@ export class SyncManager {
|
|||||||
// );
|
// );
|
||||||
|
|
||||||
if (result.isErr()) {
|
if (result.isErr()) {
|
||||||
console.error(
|
logger.error("Failed to add transactions: " + result.error.type, {
|
||||||
"Failed to add transactions from",
|
peerId: peer.id,
|
||||||
peer.id,
|
peerRole: peer.role,
|
||||||
result.error,
|
id: msg.id,
|
||||||
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,
|
|
||||||
);
|
|
||||||
peer.erroredCoValues.set(msg.id, result.error);
|
peer.erroredCoValues.set(msg.id, result.error);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -633,7 +637,13 @@ export class SyncManager {
|
|||||||
isCorrection: true,
|
isCorrection: true,
|
||||||
...coValue.knownState(),
|
...coValue.knownState(),
|
||||||
}).catch((e) => {
|
}).catch((e) => {
|
||||||
console.error("Error sending known state correction", e);
|
logger.error(
|
||||||
|
"Error sending known state correction: " + getErrorMessage(e),
|
||||||
|
{
|
||||||
|
peerId: peer.id,
|
||||||
|
peerRole: peer.role,
|
||||||
|
},
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
/**
|
/**
|
||||||
@@ -647,7 +657,10 @@ export class SyncManager {
|
|||||||
action: "known",
|
action: "known",
|
||||||
...coValue.knownState(),
|
...coValue.knownState(),
|
||||||
}).catch((e: unknown) => {
|
}).catch((e: unknown) => {
|
||||||
console.error("Error sending known state", e);
|
logger.error("Error sending known state: " + getErrorMessage(e), {
|
||||||
|
peerId: peer.id,
|
||||||
|
peerRole: peer.role,
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,9 +694,6 @@ export class SyncManager {
|
|||||||
const done = new Promise<void>((resolve) => {
|
const done = new Promise<void>((resolve) => {
|
||||||
queueMicrotask(async () => {
|
queueMicrotask(async () => {
|
||||||
delete this.requestedSyncs[coValue.id];
|
delete this.requestedSyncs[coValue.id];
|
||||||
// if (entry.nRequestsThisTick >= 2) {
|
|
||||||
// console.log("Syncing", coValue.id, "for", entry.nRequestsThisTick, "requests");
|
|
||||||
// }
|
|
||||||
await this.actuallySyncCoValue(coValue);
|
await this.actuallySyncCoValue(coValue);
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -49,12 +49,9 @@ describe("PeerState", () => {
|
|||||||
|
|
||||||
test("should perform graceful shutdown", () => {
|
test("should perform graceful shutdown", () => {
|
||||||
const { mockPeer, peerState } = setup();
|
const { mockPeer, peerState } = setup();
|
||||||
const consoleSpy = vi.spyOn(console, "debug").mockImplementation(() => {});
|
|
||||||
peerState.gracefulShutdown();
|
peerState.gracefulShutdown();
|
||||||
expect(mockPeer.outgoing.close).toHaveBeenCalled();
|
expect(mockPeer.outgoing.close).toHaveBeenCalled();
|
||||||
expect(peerState.closed).toBe(true);
|
expect(peerState.closed).toBe(true);
|
||||||
expect(consoleSpy).toHaveBeenCalledWith("Gracefully closing", "test-peer");
|
|
||||||
consoleSpy.mockRestore();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
test("should empty the queue when closing", async () => {
|
test("should empty the queue when closing", async () => {
|
||||||
|
|||||||
@@ -1,11 +1,14 @@
|
|||||||
import { expect, test, vi } from "vitest";
|
import { expect, test, vi } from "vitest";
|
||||||
import { Transaction } from "../coValueCore.js";
|
import { CoValueCore, Transaction } from "../coValueCore.js";
|
||||||
import { MapOpPayload } from "../coValues/coMap.js";
|
import { MapOpPayload } from "../coValues/coMap.js";
|
||||||
import { WasmCrypto } from "../crypto/WasmCrypto.js";
|
import { WasmCrypto } from "../crypto/WasmCrypto.js";
|
||||||
import { stableStringify } from "../jsonStringify.js";
|
import { stableStringify } from "../jsonStringify.js";
|
||||||
import { LocalNode } from "../localNode.js";
|
import { LocalNode } from "../localNode.js";
|
||||||
import { Role } from "../permissions.js";
|
import { Role } from "../permissions.js";
|
||||||
import { randomAnonymousAccountAndSessionID } from "./testUtils.js";
|
import {
|
||||||
|
createTestNode,
|
||||||
|
randomAnonymousAccountAndSessionID,
|
||||||
|
} from "./testUtils.js";
|
||||||
|
|
||||||
const Crypto = await WasmCrypto.create();
|
const Crypto = await WasmCrypto.create();
|
||||||
|
|
||||||
@@ -191,3 +194,30 @@ test("New transactions in a group correctly update owned values, including subsc
|
|||||||
|
|
||||||
expect(map.core.getValidSortedTransactions().length).toBe(0);
|
expect(map.core.getValidSortedTransactions().length).toBe(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("creating a coValue with a group should't trigger automatically a content creation (performance)", () => {
|
||||||
|
const node = createTestNode();
|
||||||
|
|
||||||
|
const group = node.createGroup();
|
||||||
|
|
||||||
|
const getCurrentContentSpy = vi.spyOn(
|
||||||
|
CoValueCore.prototype,
|
||||||
|
"getCurrentContent",
|
||||||
|
);
|
||||||
|
const groupSpy = vi.spyOn(group.core, "getCurrentContent");
|
||||||
|
|
||||||
|
getCurrentContentSpy.mockClear();
|
||||||
|
|
||||||
|
node.createCoValue({
|
||||||
|
type: "comap",
|
||||||
|
ruleset: { type: "ownedByGroup", group: group.id },
|
||||||
|
meta: null,
|
||||||
|
...Crypto.createdNowUnique(),
|
||||||
|
});
|
||||||
|
|
||||||
|
// It's called once for the group and never for the coValue
|
||||||
|
expect(getCurrentContentSpy).toHaveBeenCalledTimes(1);
|
||||||
|
expect(groupSpy).toHaveBeenCalledTimes(1);
|
||||||
|
|
||||||
|
getCurrentContentSpy.mockRestore();
|
||||||
|
});
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user