jazz-tools 0.17.13 → 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.
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.17.13 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"}
@@ -100,15 +100,15 @@
100
100
  ESM Build start
101
101
  CLI Cleaning output folder
102
102
  ESM Build start
103
+ ESM dist/worker/index.js 2.31 KB
104
+ ESM dist/worker/index.js.map 4.77 KB
105
+ ESM ⚡️ Build success in 18ms
103
106
  ESM dist/tiptap/index.js 564.00 B
104
107
  ESM dist/tiptap/index.js.map 1.21 KB
105
- ESM ⚡️ Build success in 22ms
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
- ESM ⚡️ Build success in 26ms
109
- ESM dist/worker/index.js 2.31 KB
110
- ESM dist/worker/index.js.map 4.77 KB
111
- ESM ⚡️ Build success in 23ms
111
+ ESM ⚡️ Build success in 24ms
112
112
  ESM dist/media/index.js 236.00 B
113
113
  ESM dist/media/index.browser.js 3.21 KB
114
114
  ESM dist/media/index.native.js 3.53 KB
@@ -117,67 +117,67 @@
117
117
  ESM dist/media/index.browser.js.map 6.02 KB
118
118
  ESM dist/media/index.native.js.map 6.52 KB
119
119
  ESM dist/media/chunk-E5J3WLQW.js.map 15.95 KB
120
- ESM ⚡️ Build success in 30ms
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
123
+ ESM ⚡️ Build success in 29ms
121
124
  ESM dist/react-native/index.js 2.53 KB
122
125
  ESM dist/react-native/testing.js 120.00 B
123
126
  ESM dist/react-native/crypto.js 161.00 B
124
127
  ESM dist/react-native/index.js.map 5.68 KB
125
128
  ESM dist/react-native/testing.js.map 176.00 B
126
129
  ESM dist/react-native/crypto.js.map 197.00 B
127
- ESM ⚡️ Build success in 30ms
130
+ ESM ⚡️ Build success in 25ms
128
131
  ESM dist/react-core/index.js 8.41 KB
129
132
  ESM dist/react-core/testing.js 1.17 KB
130
133
  ESM dist/react-core/chunk-7DYMJ74I.js 279.00 B
131
134
  ESM dist/react-core/index.js.map 20.68 KB
132
135
  ESM dist/react-core/testing.js.map 1.82 KB
133
136
  ESM dist/react-core/chunk-7DYMJ74I.js.map 533.00 B
134
- ESM ⚡️ Build success in 33ms
137
+ ESM ⚡️ Build success in 26ms
135
138
  ESM dist/expo/index.js 4.68 KB
136
139
  ESM dist/expo/testing.js 112.00 B
137
140
  ESM dist/expo/crypto.js 153.00 B
138
141
  ESM dist/expo/index.js.map 10.23 KB
139
142
  ESM dist/expo/testing.js.map 168.00 B
140
143
  ESM dist/expo/crypto.js.map 189.00 B
141
- ESM ⚡️ Build success in 37ms
142
- ESM dist/browser/index.js 13.43 KB
143
- ESM dist/browser/index.js.map 28.65 KB
144
- ESM ⚡️ Build success in 39ms
145
- ESM dist/react/index.js 24.62 KB
146
- ESM dist/react/testing.js 122.00 B
147
- ESM dist/react/testing.js.map 165.00 B
148
- ESM dist/react/index.js.map 52.88 KB
149
- ESM ⚡️ Build success in 39ms
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
153
- ESM dist/react-native-core/testing.js.map 175.00 B
154
148
  ESM dist/react-native-core/index.js.map 36.65 KB
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
- ESM ⚡️ Build success in 43ms
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 49ms
159
+ ESM ⚡️ Build success in 54ms
160
160
  ESM dist/inspector/index.js 61.52 KB
161
161
  ESM dist/inspector/index.js.map 109.97 KB
162
- ESM ⚡️ Build success in 66ms
162
+ ESM ⚡️ Build success in 63ms
163
163
  ESM dist/testing.js 7.10 KB
164
164
  ESM dist/index.js 26.03 KB
165
- ESM dist/chunk-SFP5PBPX.js 154.10 KB
165
+ ESM dist/chunk-LZOF6WP5.js 154.80 KB
166
166
  ESM dist/testing.js.map 14.00 KB
167
167
  ESM dist/index.js.map 52.73 KB
168
- ESM dist/chunk-SFP5PBPX.js.map 369.13 KB
169
- ESM ⚡️ Build success in 86ms
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
172
  ESM dist/inspector/custom-element-ZSNTCECD.js 1.53 MB
173
173
  ESM dist/inspector/custom-element-ZSNTCECD.js.map 2.35 MB
174
- ESM ⚡️ Build success in 121ms
174
+ ESM ⚡️ Build success in 125ms
175
175
 
176
- > jazz-tools@0.17.13 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.13 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,16 @@
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
+
3
14
  ## 0.17.13
4
15
 
5
16
  ### 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