jazz-tools 0.15.12 → 0.15.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +31 -31
- package/CHANGELOG.md +9 -0
- package/dist/{chunk-DZFT4EZM.js → chunk-6CCJYSYQ.js} +26 -16
- package/dist/{chunk-DZFT4EZM.js.map → chunk-6CCJYSYQ.js.map} +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +3 -1
- package/dist/react/testing.js +3 -1
- package/dist/react/testing.js.map +1 -1
- package/dist/testing.js +1 -1
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +1 -1
- package/dist/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +27 -12
- package/src/tools/tests/load.test.ts +114 -0
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.15.
|
2
|
+
> jazz-tools@0.15.13 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types && pnpm build:svelte
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -107,85 +107,85 @@
|
|
107
107
|
[34mESM[39m Build start
|
108
108
|
[34mCLI[39m Cleaning output folder
|
109
109
|
[34mESM[39m Build start
|
110
|
-
[32mESM[39m [1mdist/
|
111
|
-
[32mESM[39m [1mdist/
|
112
|
-
[32mESM[39m ⚡️ Build success in
|
110
|
+
[32mESM[39m [1mdist/worker/index.js [22m[32m2.34 KB[39m
|
111
|
+
[32mESM[39m [1mdist/worker/index.js.map [22m[32m4.82 KB[39m
|
112
|
+
[32mESM[39m ⚡️ Build success in 15ms
|
113
113
|
[32mESM[39m [1mdist/tiptap/index.js [22m[32m564.00 B[39m
|
114
114
|
[32mESM[39m [1mdist/tiptap/index.js.map [22m[32m1.21 KB[39m
|
115
|
+
[32mESM[39m ⚡️ Build success in 15ms
|
116
|
+
[32mESM[39m [1mdist/browser-media-images/index.js [22m[32m2.55 KB[39m
|
117
|
+
[32mESM[39m [1mdist/browser-media-images/index.js.map [22m[32m5.44 KB[39m
|
115
118
|
[32mESM[39m ⚡️ Build success in 22ms
|
116
119
|
[32mESM[39m [1mdist/react-native-media-images/index.js [22m[32m6.19 KB[39m
|
117
120
|
[32mESM[39m [1mdist/react-native-media-images/index.js.map [22m[32m10.96 KB[39m
|
118
|
-
[32mESM[39m ⚡️ Build success in
|
119
|
-
[32mESM[39m [1mdist/worker/index.js [22m[32m2.34 KB[39m
|
120
|
-
[32mESM[39m [1mdist/worker/index.js.map [22m[32m4.82 KB[39m
|
121
|
-
[32mESM[39m ⚡️ Build success in 21ms
|
122
|
-
[32mESM[39m [1mdist/react-core/index.js [22m[32m8.37 KB[39m
|
121
|
+
[32mESM[39m ⚡️ Build success in 19ms
|
123
122
|
[32mESM[39m [1mdist/react-core/testing.js [22m[32m1.17 KB[39m
|
123
|
+
[32mESM[39m [1mdist/react-core/index.js [22m[32m8.37 KB[39m
|
124
124
|
[32mESM[39m [1mdist/react-core/chunk-7DYMJ74I.js [22m[32m279.00 B[39m
|
125
125
|
[32mESM[39m [1mdist/react-core/testing.js.map [22m[32m1.82 KB[39m
|
126
126
|
[32mESM[39m [1mdist/react-core/index.js.map [22m[32m16.39 KB[39m
|
127
127
|
[32mESM[39m [1mdist/react-core/chunk-7DYMJ74I.js.map [22m[32m533.00 B[39m
|
128
|
-
[32mESM[39m ⚡️ Build success in
|
128
|
+
[32mESM[39m ⚡️ Build success in 22ms
|
129
129
|
[32mESM[39m [1mdist/react-native/index.js [22m[32m2.53 KB[39m
|
130
|
-
[32mESM[39m [1mdist/react-native/testing.js [22m[32m120.00 B[39m
|
131
130
|
[32mESM[39m [1mdist/react-native/crypto.js [22m[32m117.00 B[39m
|
131
|
+
[32mESM[39m [1mdist/react-native/testing.js [22m[32m120.00 B[39m
|
132
132
|
[32mESM[39m [1mdist/react-native/index.js.map [22m[32m5.68 KB[39m
|
133
|
-
[32mESM[39m [1mdist/react-native/testing.js.map [22m[32m176.00 B[39m
|
134
133
|
[32mESM[39m [1mdist/react-native/crypto.js.map [22m[32m174.00 B[39m
|
135
|
-
[32mESM[39m
|
134
|
+
[32mESM[39m [1mdist/react-native/testing.js.map [22m[32m176.00 B[39m
|
135
|
+
[32mESM[39m ⚡️ Build success in 24ms
|
136
136
|
[32mESM[39m [1mdist/browser/index.js [22m[32m13.43 KB[39m
|
137
137
|
[32mESM[39m [1mdist/browser/index.js.map [22m[32m28.67 KB[39m
|
138
|
-
[32mESM[39m ⚡️ Build success in
|
138
|
+
[32mESM[39m ⚡️ Build success in 31ms
|
139
139
|
[32mESM[39m [1mdist/expo/index.js [22m[32m4.65 KB[39m
|
140
140
|
[32mESM[39m [1mdist/expo/testing.js [22m[32m112.00 B[39m
|
141
141
|
[32mESM[39m [1mdist/expo/crypto.js [22m[32m109.00 B[39m
|
142
|
+
[32mESM[39m [1mdist/expo/index.js.map [22m[32m10.17 KB[39m
|
142
143
|
[32mESM[39m [1mdist/expo/testing.js.map [22m[32m168.00 B[39m
|
143
144
|
[32mESM[39m [1mdist/expo/crypto.js.map [22m[32m166.00 B[39m
|
144
|
-
[32mESM[39m
|
145
|
-
[32mESM[39m ⚡️ Build success in 43ms
|
146
|
-
[32mESM[39m [1mdist/react/testing.js [22m[32m122.00 B[39m
|
147
|
-
[32mESM[39m [1mdist/react/index.js [22m[32m20.70 KB[39m
|
148
|
-
[32mESM[39m [1mdist/react/testing.js.map [22m[32m165.00 B[39m
|
149
|
-
[32mESM[39m [1mdist/react/index.js.map [22m[32m34.13 KB[39m
|
150
|
-
[32mESM[39m ⚡️ Build success in 51ms
|
145
|
+
[32mESM[39m ⚡️ Build success in 38ms
|
151
146
|
[32mESM[39m [1mdist/react/index.js [22m[32m20.68 KB[39m
|
152
147
|
[32mESM[39m [1mdist/react/testing.js [22m[32m107.00 B[39m
|
153
148
|
[32mESM[39m [1mdist/react/ssr.js [22m[32m688.00 B[39m
|
154
149
|
[32mESM[39m [1mdist/react/index.js.map [22m[32m34.13 KB[39m
|
155
150
|
[32mESM[39m [1mdist/react/testing.js.map [22m[32m163.00 B[39m
|
156
151
|
[32mESM[39m [1mdist/react/ssr.js.map [22m[32m1.12 KB[39m
|
157
|
-
[32mESM[39m ⚡️ Build success in
|
152
|
+
[32mESM[39m ⚡️ Build success in 41ms
|
158
153
|
[32mESM[39m [1mdist/react-native-core/index.js [22m[32m16.95 KB[39m
|
159
154
|
[32mESM[39m [1mdist/react-native-core/testing.js [22m[32m119.00 B[39m
|
160
155
|
[32mESM[39m [1mdist/react-native-core/crypto.js [22m[32m2.10 KB[39m
|
161
156
|
[32mESM[39m [1mdist/react-native-core/index.js.map [22m[32m33.57 KB[39m
|
162
157
|
[32mESM[39m [1mdist/react-native-core/testing.js.map [22m[32m175.00 B[39m
|
163
158
|
[32mESM[39m [1mdist/react-native-core/crypto.js.map [22m[32m4.25 KB[39m
|
164
|
-
[32mESM[39m ⚡️ Build success in
|
159
|
+
[32mESM[39m ⚡️ Build success in 40ms
|
165
160
|
[32mESM[39m [1mdist/prosemirror/index.js [22m[32m76.90 KB[39m
|
166
161
|
[32mESM[39m [1mdist/prosemirror/index.js.map [22m[32m305.53 KB[39m
|
167
|
-
[32mESM[39m ⚡️ Build success in
|
162
|
+
[32mESM[39m ⚡️ Build success in 50ms
|
163
|
+
[32mESM[39m [1mdist/react/index.js [22m[32m20.70 KB[39m
|
164
|
+
[32mESM[39m [1mdist/react/testing.js [22m[32m122.00 B[39m
|
165
|
+
[32mESM[39m [1mdist/react/index.js.map [22m[32m34.13 KB[39m
|
166
|
+
[32mESM[39m [1mdist/react/testing.js.map [22m[32m165.00 B[39m
|
167
|
+
[32mESM[39m ⚡️ Build success in 50ms
|
168
168
|
[32mESM[39m [1mdist/inspector/index.js [22m[32m60.37 KB[39m
|
169
169
|
[32mESM[39m [1mdist/inspector/index.js.map [22m[32m107.85 KB[39m
|
170
|
-
[32mESM[39m ⚡️ Build success in
|
170
|
+
[32mESM[39m ⚡️ Build success in 68ms
|
171
171
|
[32mESM[39m [1mdist/index.js [22m[32m16.19 KB[39m
|
172
172
|
[32mESM[39m [1mdist/testing.js [22m[32m6.72 KB[39m
|
173
|
-
[32mESM[39m [1mdist/chunk-
|
173
|
+
[32mESM[39m [1mdist/chunk-6CCJYSYQ.js [22m[32m146.58 KB[39m
|
174
174
|
[32mESM[39m [1mdist/index.js.map [22m[32m29.03 KB[39m
|
175
175
|
[32mESM[39m [1mdist/testing.js.map [22m[32m13.03 KB[39m
|
176
|
-
[32mESM[39m [1mdist/chunk-
|
177
|
-
[32mESM[39m ⚡️ Build success in
|
176
|
+
[32mESM[39m [1mdist/chunk-6CCJYSYQ.js.map [22m[32m356.50 KB[39m
|
177
|
+
[32mESM[39m ⚡️ Build success in 78ms
|
178
178
|
[32mESM[39m [1mdist/inspector/register-custom-element.js [22m[32m218.00 B[39m
|
179
179
|
[32mESM[39m [1mdist/inspector/register-custom-element.js.map [22m[32m314.00 B[39m
|
180
180
|
[32mESM[39m [1mdist/inspector/custom-element-TUXKXSZU.js [22m[32m1.53 MB[39m
|
181
181
|
[32mESM[39m [1mdist/inspector/custom-element-TUXKXSZU.js.map [22m[32m2.35 MB[39m
|
182
|
-
[32mESM[39m ⚡️ Build success in
|
182
|
+
[32mESM[39m ⚡️ Build success in 122ms
|
183
183
|
|
184
|
-
> jazz-tools@0.15.
|
184
|
+
> jazz-tools@0.15.13 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
185
185
|
> tsc --outDir dist
|
186
186
|
|
187
187
|
|
188
|
-
> jazz-tools@0.15.
|
188
|
+
> jazz-tools@0.15.13 build:svelte /home/runner/_work/jazz/jazz/packages/jazz-tools
|
189
189
|
> rm -rf dist/svelte && svelte-package -i src/svelte -o dist/svelte --tsconfig tsconfig.svelte.json
|
190
190
|
|
191
191
|
src/svelte -> dist/svelte
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.15.13
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 6c76ff8: Fix load failures when loading a missing ref declared with z.optional and Schema.optional
|
8
|
+
- cojson@0.15.13
|
9
|
+
- cojson-storage-indexeddb@0.15.13
|
10
|
+
- cojson-transport-ws@0.15.13
|
11
|
+
|
3
12
|
## 0.15.12
|
4
13
|
|
5
14
|
### Patch Changes
|
@@ -3839,27 +3839,31 @@ function isUnionOfPrimitivesDeeply(schema) {
|
|
3839
3839
|
}
|
3840
3840
|
|
3841
3841
|
// src/tools/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts
|
3842
|
-
function schemaFieldToCoFieldDef(schema) {
|
3842
|
+
function schemaFieldToCoFieldDef(schema, isOptional = false) {
|
3843
3843
|
if (isCoValueClass(schema)) {
|
3844
|
-
|
3844
|
+
if (isOptional) {
|
3845
|
+
return coField.ref(schema, { optional: true });
|
3846
|
+
} else {
|
3847
|
+
return coField.ref(schema);
|
3848
|
+
}
|
3845
3849
|
} else if (isCoValueSchema(schema)) {
|
3846
3850
|
if (isAnyCoOptionalSchema(schema)) {
|
3847
3851
|
return coField.ref(schema.getCoValueClass(), {
|
3848
3852
|
optional: true
|
3849
3853
|
});
|
3850
3854
|
}
|
3851
|
-
|
3855
|
+
if (isOptional) {
|
3856
|
+
return coField.ref(schema.getCoValueClass(), { optional: true });
|
3857
|
+
} else {
|
3858
|
+
return coField.ref(schema.getCoValueClass());
|
3859
|
+
}
|
3852
3860
|
} else {
|
3853
3861
|
if ("_zod" in schema) {
|
3854
3862
|
if (schema._zod.def.type === "optional") {
|
3855
3863
|
const inner = zodSchemaToCoSchemaOrKeepPrimitive(
|
3856
3864
|
schema._zod.def.innerType
|
3857
3865
|
);
|
3858
|
-
|
3859
|
-
return coField.ref(inner, { optional: true });
|
3860
|
-
} else {
|
3861
|
-
return schemaFieldToCoFieldDef(inner);
|
3862
|
-
}
|
3866
|
+
return schemaFieldToCoFieldDef(inner, true);
|
3863
3867
|
} else if (schema._zod.def.type === "string") {
|
3864
3868
|
return coField.string;
|
3865
3869
|
} else if (schema._zod.def.type === "number") {
|
@@ -3872,7 +3876,8 @@ function schemaFieldToCoFieldDef(schema) {
|
|
3872
3876
|
return coField.string;
|
3873
3877
|
} else if (schema._zod.def.type === "readonly") {
|
3874
3878
|
return schemaFieldToCoFieldDef(
|
3875
|
-
schema.def.innerType
|
3879
|
+
schema.def.innerType,
|
3880
|
+
isOptional
|
3876
3881
|
);
|
3877
3882
|
} else if (schema._zod.def.type === "date") {
|
3878
3883
|
return coField.optional.Date;
|
@@ -3880,14 +3885,16 @@ function schemaFieldToCoFieldDef(schema) {
|
|
3880
3885
|
return coField.string;
|
3881
3886
|
} else if (schema._zod.def.type === "lazy") {
|
3882
3887
|
return schemaFieldToCoFieldDef(
|
3883
|
-
schema.unwrap()
|
3888
|
+
schema.unwrap(),
|
3889
|
+
isOptional
|
3884
3890
|
);
|
3885
3891
|
} else if (schema._zod.def.type === "default" || schema._zod.def.type === "catch") {
|
3886
3892
|
console.warn(
|
3887
3893
|
"z.default()/z.catch() are not supported in collaborative schemas. They will be ignored."
|
3888
3894
|
);
|
3889
3895
|
return schemaFieldToCoFieldDef(
|
3890
|
-
schema.def.innerType
|
3896
|
+
schema.def.innerType,
|
3897
|
+
isOptional
|
3891
3898
|
);
|
3892
3899
|
} else if (schema._zod.def.type === "literal") {
|
3893
3900
|
if (schema._zod.def.values.some(
|
@@ -3908,7 +3915,7 @@ function schemaFieldToCoFieldDef(schema) {
|
|
3908
3915
|
return coField.json();
|
3909
3916
|
} else if (schema._zod.def.type === "custom") {
|
3910
3917
|
if ("builtin" in schema) {
|
3911
|
-
return schemaFieldToCoFieldDef(schema.builtin);
|
3918
|
+
return schemaFieldToCoFieldDef(schema.builtin, isOptional);
|
3912
3919
|
} else {
|
3913
3920
|
throw new Error(`Unsupported custom zod type`);
|
3914
3921
|
}
|
@@ -3916,9 +3923,12 @@ function schemaFieldToCoFieldDef(schema) {
|
|
3916
3923
|
if (isUnionOfPrimitivesDeeply(schema)) {
|
3917
3924
|
return coField.json();
|
3918
3925
|
} else if (isUnionOfCoMapsDeeply(schema)) {
|
3919
|
-
|
3920
|
-
|
3921
|
-
|
3926
|
+
const result = schemaUnionDiscriminatorFor(schema);
|
3927
|
+
if (isOptional) {
|
3928
|
+
return coField.ref(result, { optional: true });
|
3929
|
+
} else {
|
3930
|
+
return coField.ref(result);
|
3931
|
+
}
|
3922
3932
|
} else {
|
3923
3933
|
throw new Error(
|
3924
3934
|
"z.union()/z.discriminatedUnion() of mixed collaborative and non-collaborative types is not supported"
|
@@ -5105,4 +5115,4 @@ export {
|
|
5105
5115
|
JazzContextManager
|
5106
5116
|
};
|
5107
5117
|
/* istanbul ignore file -- @preserve */
|
5108
|
-
//# sourceMappingURL=chunk-
|
5118
|
+
//# sourceMappingURL=chunk-6CCJYSYQ.js.map
|