jazz-tools 0.17.12 → 0.17.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/.turbo/turbo-build.log +38 -38
  2. package/CHANGELOG.md +23 -0
  3. package/dist/{chunk-SFP5PBPX.js → chunk-LZOF6WP5.js} +25 -3
  4. package/dist/{chunk-SFP5PBPX.js.map → chunk-LZOF6WP5.js.map} +1 -1
  5. package/dist/expo/auth/clerk/index.d.ts.map +1 -1
  6. package/dist/expo/index.js +6 -2
  7. package/dist/expo/index.js.map +1 -1
  8. package/dist/index.js +4 -2
  9. package/dist/index.js.map +1 -1
  10. package/dist/inspector/{custom-element-I7L56H6B.js → custom-element-ZSNTCECD.js} +50 -9
  11. package/dist/inspector/{custom-element-I7L56H6B.js.map → custom-element-ZSNTCECD.js.map} +1 -1
  12. package/dist/inspector/index.js +49 -8
  13. package/dist/inspector/index.js.map +1 -1
  14. package/dist/inspector/register-custom-element.js +1 -1
  15. package/dist/inspector/viewer/page.d.ts.map +1 -1
  16. package/dist/inspector/viewer/table-viewer.d.ts +2 -1
  17. package/dist/inspector/viewer/table-viewer.d.ts.map +1 -1
  18. package/dist/react/auth/Clerk.d.ts.map +1 -1
  19. package/dist/react/index.js +6 -2
  20. package/dist/react/index.js.map +1 -1
  21. package/dist/testing.js +1 -1
  22. package/dist/tools/auth/clerk/index.d.ts +2 -1
  23. package/dist/tools/auth/clerk/index.d.ts.map +1 -1
  24. package/dist/tools/implementation/zodSchema/zodCo.d.ts.map +1 -1
  25. package/package.json +5 -5
  26. package/src/expo/auth/clerk/index.tsx +6 -2
  27. package/src/inspector/viewer/page.tsx +30 -2
  28. package/src/inspector/viewer/table-viewer.tsx +26 -1
  29. package/src/react/auth/Clerk.tsx +6 -2
  30. package/src/react-core/tests/useCoState.test.ts +1 -1
  31. package/src/tools/auth/clerk/index.ts +2 -0
  32. package/src/tools/auth/clerk/tests/JazzClerkAuth.test.ts +56 -6
  33. package/src/tools/implementation/zodSchema/zodCo.ts +45 -8
  34. package/src/tools/tests/account.test.ts +15 -5
  35. package/src/tools/tests/coMap.test.ts +18 -6
  36. package/src/tools/tests/exportImport.test.ts +6 -6
  37. package/src/tools/tests/load.test.ts +6 -4
  38. package/src/tools/tests/subscribe.test.ts +10 -6
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.17.12 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.17.14 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types && pnpm build:svelte
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -102,51 +102,46 @@
102
102
  ESM Build start
103
103
  ESM dist/worker/index.js 2.31 KB
104
104
  ESM dist/worker/index.js.map 4.77 KB
105
+ ESM ⚡️ Build success in 18ms
106
+ ESM dist/tiptap/index.js 564.00 B
107
+ ESM dist/tiptap/index.js.map 1.21 KB
105
108
  ESM ⚡️ Build success in 20ms
106
109
  ESM dist/react/ssr.js 688.00 B
107
110
  ESM dist/react/ssr.js.map 1.12 KB
108
111
  ESM ⚡️ Build success in 24ms
109
- ESM dist/tiptap/index.js 564.00 B
110
- ESM dist/tiptap/index.js.map 1.21 KB
111
- ESM ⚡️ Build success in 22ms
112
+ ESM dist/media/index.js 236.00 B
112
113
  ESM dist/media/index.browser.js 3.21 KB
113
114
  ESM dist/media/index.native.js 3.53 KB
114
- ESM dist/media/index.js 236.00 B
115
115
  ESM dist/media/chunk-E5J3WLQW.js 6.34 KB
116
+ ESM dist/media/index.js.map 71.00 B
116
117
  ESM dist/media/index.browser.js.map 6.02 KB
117
118
  ESM dist/media/index.native.js.map 6.52 KB
118
119
  ESM dist/media/chunk-E5J3WLQW.js.map 15.95 KB
119
- ESM dist/media/index.js.map 71.00 B
120
+ ESM ⚡️ Build success in 26ms
121
+ ESM dist/browser/index.js 13.43 KB
122
+ ESM dist/browser/index.js.map 28.65 KB
120
123
  ESM ⚡️ Build success in 29ms
121
- ESM dist/expo/index.js 4.65 KB
122
- ESM dist/expo/testing.js 112.00 B
123
- ESM dist/expo/crypto.js 153.00 B
124
- ESM dist/expo/index.js.map 10.17 KB
125
- ESM dist/expo/testing.js.map 168.00 B
126
- ESM dist/expo/crypto.js.map 189.00 B
127
- ESM ⚡️ Build success in 34ms
128
124
  ESM dist/react-native/index.js 2.53 KB
129
125
  ESM dist/react-native/testing.js 120.00 B
130
126
  ESM dist/react-native/crypto.js 161.00 B
131
127
  ESM dist/react-native/index.js.map 5.68 KB
132
- ESM dist/react-native/crypto.js.map 197.00 B
133
128
  ESM dist/react-native/testing.js.map 176.00 B
134
- ESM ⚡️ Build success in 30ms
129
+ ESM dist/react-native/crypto.js.map 197.00 B
130
+ ESM ⚡️ Build success in 25ms
135
131
  ESM dist/react-core/index.js 8.41 KB
136
132
  ESM dist/react-core/testing.js 1.17 KB
137
133
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
138
134
  ESM dist/react-core/index.js.map 20.68 KB
139
135
  ESM dist/react-core/testing.js.map 1.82 KB
140
136
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
141
- ESM ⚡️ Build success in 32ms
142
- ESM dist/browser/index.js 13.43 KB
143
- ESM dist/browser/index.js.map 28.65 KB
144
- ESM ⚡️ Build success in 36ms
145
- ESM dist/react/index.js 24.59 KB
146
- ESM dist/react/testing.js 122.00 B
147
- ESM dist/react/index.js.map 52.82 KB
148
- ESM dist/react/testing.js.map 165.00 B
149
- ESM ⚡️ Build success in 36ms
137
+ ESM ⚡️ Build success in 26ms
138
+ ESM dist/expo/index.js 4.68 KB
139
+ ESM dist/expo/testing.js 112.00 B
140
+ ESM dist/expo/crypto.js 153.00 B
141
+ ESM dist/expo/index.js.map 10.23 KB
142
+ ESM dist/expo/testing.js.map 168.00 B
143
+ ESM dist/expo/crypto.js.map 189.00 B
144
+ ESM ⚡️ Build success in 35ms
150
145
  ESM dist/react-native-core/index.js 17.90 KB
151
146
  ESM dist/react-native-core/testing.js 119.00 B
152
147
  ESM dist/react-native-core/crypto.js 2.10 KB
@@ -154,30 +149,35 @@
154
149
  ESM dist/react-native-core/testing.js.map 175.00 B
155
150
  ESM dist/react-native-core/crypto.js.map 4.25 KB
156
151
  ESM ⚡️ Build success in 38ms
152
+ ESM dist/react/index.js 24.62 KB
153
+ ESM dist/react/testing.js 122.00 B
154
+ ESM dist/react/testing.js.map 165.00 B
155
+ ESM dist/react/index.js.map 52.88 KB
156
+ ESM ⚡️ Build success in 40ms
157
157
  ESM dist/prosemirror/index.js 77.61 KB
158
158
  ESM dist/prosemirror/index.js.map 306.96 KB
159
- ESM ⚡️ Build success in 43ms
160
- ESM dist/inspector/index.js 60.40 KB
161
- ESM dist/inspector/index.js.map 107.91 KB
162
- ESM ⚡️ Build success in 57ms
159
+ ESM ⚡️ Build success in 54ms
160
+ ESM dist/inspector/index.js 61.52 KB
161
+ ESM dist/inspector/index.js.map 109.97 KB
162
+ ESM ⚡️ Build success in 63ms
163
163
  ESM dist/testing.js 7.10 KB
164
- ESM dist/index.js 25.96 KB
165
- ESM dist/chunk-SFP5PBPX.js 154.10 KB
164
+ ESM dist/index.js 26.03 KB
165
+ ESM dist/chunk-LZOF6WP5.js 154.80 KB
166
166
  ESM dist/testing.js.map 14.00 KB
167
- ESM dist/index.js.map 52.62 KB
168
- ESM dist/chunk-SFP5PBPX.js.map 369.13 KB
169
- ESM ⚡️ Build success in 73ms
167
+ ESM dist/index.js.map 52.73 KB
168
+ ESM dist/chunk-LZOF6WP5.js.map 370.75 KB
169
+ ESM ⚡️ Build success in 82ms
170
170
  ESM dist/inspector/register-custom-element.js 218.00 B
171
171
  ESM dist/inspector/register-custom-element.js.map 314.00 B
172
- ESM dist/inspector/custom-element-I7L56H6B.js 1.53 MB
173
- ESM dist/inspector/custom-element-I7L56H6B.js.map 2.35 MB
174
- ESM ⚡️ Build success in 120ms
172
+ ESM dist/inspector/custom-element-ZSNTCECD.js 1.53 MB
173
+ ESM dist/inspector/custom-element-ZSNTCECD.js.map 2.35 MB
174
+ ESM ⚡️ Build success in 125ms
175
175
 
176
- > jazz-tools@0.17.12 types /home/runner/_work/jazz/jazz/packages/jazz-tools
176
+ > jazz-tools@0.17.14 types /home/runner/_work/jazz/jazz/packages/jazz-tools
177
177
  > tsc --outDir dist
178
178
 
179
179
 
180
- > jazz-tools@0.17.12 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
180
+ > jazz-tools@0.17.14 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
181
181
  > rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
182
182
 
183
183
  src/svelte -> dist/svelte
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # jazz-tools
2
2
 
3
+ ## 0.17.14
4
+
5
+ ### Patch Changes
6
+
7
+ - cc2f774: Detect incompatible Zod schemas when creating `co.map`s and `co.profile`s
8
+ - Updated dependencies [1094b7c]
9
+ - Updated dependencies [6378ad5]
10
+ - cojson@0.17.14
11
+ - cojson-storage-indexeddb@0.17.14
12
+ - cojson-transport-ws@0.17.14
13
+
14
+ ## 0.17.13
15
+
16
+ ### Patch Changes
17
+
18
+ - d208cd1: Add remove action for CoList table in the inspector
19
+ - 7821a8b: fix: sign out Jazz account when signing out from Clerk
20
+ - Updated dependencies [7dc3160]
21
+ - Updated dependencies [474881d]
22
+ - cojson@0.17.13
23
+ - cojson-storage-indexeddb@0.17.13
24
+ - cojson-transport-ws@0.17.13
25
+
3
26
  ## 0.17.12
4
27
 
5
28
  ### Patch Changes
@@ -4014,12 +4014,27 @@ var RichTextSchema = class {
4014
4014
  };
4015
4015
 
4016
4016
  // src/tools/implementation/zodSchema/zodCo.ts
4017
- var coMapDefiner = (shape) => {
4017
+ var isZodV4Schema = (schema) => {
4018
+ return typeof schema === "object" && schema !== null && "_zod" in schema;
4019
+ };
4020
+ var isValidShape = (shape) => {
4021
+ return Object.values(removeGetters(shape)).every(
4022
+ (schema) => isZodV4Schema(schema) || isAnyCoValueSchema2(schema) || isCoValueClass(schema)
4023
+ );
4024
+ };
4025
+ var validateCoMapShape = (shape) => {
4018
4026
  if (isAnyCoValueSchema2(shape)) {
4019
4027
  throw new Error(
4020
4028
  "co.map() expects an object as its argument, not a CoValue schema"
4021
4029
  );
4030
+ } else if (!isValidShape(shape)) {
4031
+ throw new Error(
4032
+ "co.map() supports only Zod v4 schemas and CoValue schemas"
4033
+ );
4022
4034
  }
4035
+ };
4036
+ var coMapDefiner = (shape) => {
4037
+ validateCoMapShape(shape);
4023
4038
  const coreSchema = createCoreCoMapSchema(shape);
4024
4039
  return hydrateCoreCoValueSchema(coreSchema);
4025
4040
  };
@@ -4041,12 +4056,19 @@ var coListDefiner = (element) => {
4041
4056
  const coreSchema = createCoreCoListSchema(element);
4042
4057
  return hydrateCoreCoValueSchema(coreSchema);
4043
4058
  };
4044
- var coProfileDefiner = (shape = {}) => {
4059
+ var validateProfileShape = (shape) => {
4045
4060
  if (isAnyCoValueSchema2(shape)) {
4046
4061
  throw new Error(
4047
4062
  "co.profile() expects an object as its argument, not a CoValue schema"
4048
4063
  );
4064
+ } else if (!isValidShape(shape)) {
4065
+ throw new Error(
4066
+ "co.profile() supports only Zod v4 schemas and CoValue schemas"
4067
+ );
4049
4068
  }
4069
+ };
4070
+ var coProfileDefiner = (shape = {}) => {
4071
+ validateProfileShape(shape);
4050
4072
  const ehnancedShape = Object.assign(shape, {
4051
4073
  name: z.string(),
4052
4074
  inbox: z.optional(z.string()),
@@ -5390,4 +5412,4 @@ export {
5390
5412
  JazzContextManager
5391
5413
  };
5392
5414
  /* istanbul ignore file -- @preserve */
5393
- //# sourceMappingURL=chunk-SFP5PBPX.js.map
5415
+ //# sourceMappingURL=chunk-LZOF6WP5.js.map