jazz-tools 0.14.7 → 0.14.9
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 +7 -7
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-RTUIFVYF.js → chunk-ORL6R2EV.js} +107 -40
- package/dist/chunk-ORL6R2EV.js.map +1 -0
- package/dist/coValues/extensions/imageDef.d.ts +1 -1
- package/dist/coValues/extensions/imageDef.d.ts.map +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +1 -1
- package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts +1 -1
- package/dist/implementation/zodSchema/unionUtils.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodCo.d.ts +1 -1
- package/dist/implementation/zodSchema/zodCo.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts +1 -1
- package/dist/implementation/zodSchema/zodReExport.d.ts.map +1 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts +1 -1
- package/dist/implementation/zodSchema/zodSchema.d.ts.map +1 -1
- package/dist/index.js +4 -75
- package/dist/index.js.map +1 -1
- package/dist/testing.js +1 -1
- package/package.json +2 -2
- package/src/coValues/extensions/imageDef.ts +1 -1
- package/src/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +1 -1
- package/src/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/AccountSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoFeedSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoListSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoMapSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/CoRecordSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/FileStreamSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/PlainTextSchema.ts +1 -1
- package/src/implementation/zodSchema/schemaTypes/RichTextSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOfSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +1 -1
- package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +1 -1
- package/src/implementation/zodSchema/unionUtils.ts +1 -1
- package/src/implementation/zodSchema/zodCo.ts +1 -1
- package/src/implementation/zodSchema/zodReExport.ts +4 -0
- package/src/implementation/zodSchema/zodSchema.ts +1 -3
- package/src/tests/coMap.test-d.ts +1 -1
- package/src/tests/coMap.test.ts +1 -1
- package/src/tests/schemaUnion.test.ts +5 -2
- package/dist/chunk-RTUIFVYF.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
> jazz-tools@0.14.
|
2
|
+
> jazz-tools@0.14.9 build /home/runner/_work/jazz/jazz/packages/jazz-tools
|
3
3
|
> tsup && pnpm types
|
4
4
|
|
5
5
|
[34mCLI[39m Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
|
@@ -9,14 +9,14 @@
|
|
9
9
|
[34mCLI[39m Target: es2021
|
10
10
|
[34mCLI[39m Cleaning output folder
|
11
11
|
[34mESM[39m Build start
|
12
|
+
[32mESM[39m [1mdist/index.js [22m[32m11.07 KB[39m
|
12
13
|
[32mESM[39m [1mdist/testing.js [22m[32m6.31 KB[39m
|
13
|
-
[32mESM[39m [1mdist/
|
14
|
-
[32mESM[39m [1mdist/
|
14
|
+
[32mESM[39m [1mdist/chunk-ORL6R2EV.js [22m[32m132.69 KB[39m
|
15
|
+
[32mESM[39m [1mdist/index.js.map [22m[32m18.38 KB[39m
|
15
16
|
[32mESM[39m [1mdist/testing.js.map [22m[32m12.57 KB[39m
|
16
|
-
[32mESM[39m [1mdist/
|
17
|
-
[32mESM[39m
|
18
|
-
[32mESM[39m ⚡️ Build success in 48ms
|
17
|
+
[32mESM[39m [1mdist/chunk-ORL6R2EV.js.map [22m[32m307.06 KB[39m
|
18
|
+
[32mESM[39m ⚡️ Build success in 75ms
|
19
19
|
|
20
|
-
> jazz-tools@0.14.
|
20
|
+
> jazz-tools@0.14.9 types /home/runner/_work/jazz/jazz/packages/jazz-tools
|
21
21
|
> tsc --outDir dist
|
22
22
|
|
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# jazz-tools
|
2
2
|
|
3
|
+
## 0.14.9
|
4
|
+
|
5
|
+
### Patch Changes
|
6
|
+
|
7
|
+
- 22c2600: Move back to zod as dependency and clean up zod re-export
|
8
|
+
|
9
|
+
## 0.14.8
|
10
|
+
|
11
|
+
### Patch Changes
|
12
|
+
|
13
|
+
- 637ae13: Use our Zod v4 fork with the React Native fixes
|
14
|
+
|
3
15
|
## 0.14.7
|
4
16
|
|
5
17
|
### Patch Changes
|
@@ -4,6 +4,79 @@ var __export = (target, all) => {
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
5
5
|
};
|
6
6
|
|
7
|
+
// src/implementation/zodSchema/zodReExport.ts
|
8
|
+
var zodReExport_exports = {};
|
9
|
+
__export(zodReExport_exports, {
|
10
|
+
array: () => array,
|
11
|
+
base64: () => base64,
|
12
|
+
base64url: () => base64url,
|
13
|
+
boolean: () => boolean,
|
14
|
+
cidrv4: () => cidrv4,
|
15
|
+
cidrv6: () => cidrv6,
|
16
|
+
cuid: () => cuid,
|
17
|
+
cuid2: () => cuid2,
|
18
|
+
date: () => date,
|
19
|
+
discriminatedUnion: () => discriminatedUnion,
|
20
|
+
email: () => email,
|
21
|
+
emoji: () => emoji,
|
22
|
+
enum: () => enum2,
|
23
|
+
int: () => int,
|
24
|
+
int32: () => int32,
|
25
|
+
ipv4: () => ipv4,
|
26
|
+
ipv6: () => ipv6,
|
27
|
+
iso: () => iso,
|
28
|
+
json: () => json,
|
29
|
+
literal: () => literal,
|
30
|
+
nanoid: () => nanoid,
|
31
|
+
number: () => number,
|
32
|
+
object: () => object,
|
33
|
+
optional: () => optional,
|
34
|
+
strictObject: () => strictObject,
|
35
|
+
string: () => string,
|
36
|
+
templateLiteral: () => templateLiteral,
|
37
|
+
tuple: () => tuple,
|
38
|
+
ulid: () => ulid,
|
39
|
+
union: () => union,
|
40
|
+
url: () => url,
|
41
|
+
uuid: () => uuid,
|
42
|
+
z: () => z
|
43
|
+
});
|
44
|
+
import {
|
45
|
+
string,
|
46
|
+
number,
|
47
|
+
boolean,
|
48
|
+
union,
|
49
|
+
object,
|
50
|
+
array,
|
51
|
+
templateLiteral,
|
52
|
+
json,
|
53
|
+
tuple,
|
54
|
+
date,
|
55
|
+
emoji,
|
56
|
+
base64,
|
57
|
+
base64url,
|
58
|
+
nanoid,
|
59
|
+
cuid,
|
60
|
+
cuid2,
|
61
|
+
ulid,
|
62
|
+
ipv4,
|
63
|
+
ipv6,
|
64
|
+
email,
|
65
|
+
url,
|
66
|
+
uuid,
|
67
|
+
literal,
|
68
|
+
enum as enum2,
|
69
|
+
cidrv4,
|
70
|
+
cidrv6,
|
71
|
+
iso,
|
72
|
+
int32,
|
73
|
+
strictObject,
|
74
|
+
discriminatedUnion,
|
75
|
+
int,
|
76
|
+
optional,
|
77
|
+
z
|
78
|
+
} from "zod/v4";
|
79
|
+
|
7
80
|
// src/coValues/CoValueBase.ts
|
8
81
|
import { ControlledAccount, RawAccount } from "cojson";
|
9
82
|
var CoValueBase = class {
|
@@ -2560,7 +2633,7 @@ var Encoders = {
|
|
2560
2633
|
decode: (value) => value === null ? void 0 : new Date(value)
|
2561
2634
|
}
|
2562
2635
|
};
|
2563
|
-
var
|
2636
|
+
var optional2 = {
|
2564
2637
|
ref: optionalRef,
|
2565
2638
|
json() {
|
2566
2639
|
return { [SchemaInit]: "json" };
|
@@ -2614,7 +2687,7 @@ var coField = {
|
|
2614
2687
|
},
|
2615
2688
|
ref,
|
2616
2689
|
items: ItemsSym,
|
2617
|
-
optional
|
2690
|
+
optional: optional2
|
2618
2691
|
};
|
2619
2692
|
function optionalRef(arg) {
|
2620
2693
|
return ref(arg, { optional: true });
|
@@ -3368,7 +3441,6 @@ function getDef(schema) {
|
|
3368
3441
|
}
|
3369
3442
|
|
3370
3443
|
// src/implementation/zodSchema/zodCo.ts
|
3371
|
-
import z from "zod/v4";
|
3372
3444
|
var coMapDefiner = (shape) => {
|
3373
3445
|
const objectSchema = z.object(shape).meta({
|
3374
3446
|
collaborative: true
|
@@ -3564,12 +3636,8 @@ __export(coExport_exports, {
|
|
3564
3636
|
richText: () => coRichTextDefiner
|
3565
3637
|
});
|
3566
3638
|
|
3567
|
-
// src/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts
|
3568
|
-
import z3 from "zod/v4";
|
3569
|
-
|
3570
3639
|
// src/implementation/zodSchema/unionUtils.ts
|
3571
3640
|
import { RawCoList } from "cojson";
|
3572
|
-
import z2 from "zod/v4";
|
3573
3641
|
function schemaUnionDiscriminatorFor(schema) {
|
3574
3642
|
if (isUnionOfCoMapsDeeply(schema)) {
|
3575
3643
|
if (!schema._zod.disc || schema._zod.disc.size == 0) {
|
@@ -3655,23 +3723,23 @@ function schemaUnionDiscriminatorFor(schema) {
|
|
3655
3723
|
}
|
3656
3724
|
}
|
3657
3725
|
function isUnionOfCoMapsDeeply(schema) {
|
3658
|
-
if (schema instanceof
|
3726
|
+
if (schema instanceof z.core.$ZodUnion) {
|
3659
3727
|
return schema._zod.def.options.every(isCoMapOrUnionOfCoMapsDeeply);
|
3660
3728
|
} else {
|
3661
3729
|
return false;
|
3662
3730
|
}
|
3663
3731
|
}
|
3664
3732
|
function isCoMapOrUnionOfCoMapsDeeply(schema) {
|
3665
|
-
if (schema instanceof
|
3733
|
+
if (schema instanceof z.core.$ZodObject && "collaborative" in schema && schema.collaborative) {
|
3666
3734
|
return true;
|
3667
|
-
} else if (schema instanceof
|
3735
|
+
} else if (schema instanceof z.core.$ZodUnion) {
|
3668
3736
|
return schema._zod.def.options.every(isCoMapOrUnionOfCoMapsDeeply);
|
3669
3737
|
} else {
|
3670
3738
|
return false;
|
3671
3739
|
}
|
3672
3740
|
}
|
3673
3741
|
function isUnionOfPrimitivesDeeply(schema) {
|
3674
|
-
if (schema instanceof
|
3742
|
+
if (schema instanceof z.core.$ZodUnion) {
|
3675
3743
|
return schema._zod.def.options.every(isUnionOfPrimitivesDeeply);
|
3676
3744
|
} else {
|
3677
3745
|
return !("collaborative" in schema);
|
@@ -3717,14 +3785,14 @@ function zodFieldToCoFieldDef(schema) {
|
|
3717
3785
|
);
|
3718
3786
|
} else if (schema._zod.def.type === "literal") {
|
3719
3787
|
if (schema._zod.def.values.some(
|
3720
|
-
(
|
3788
|
+
(literal2) => typeof literal2 === "undefined"
|
3721
3789
|
)) {
|
3722
3790
|
throw new Error("z.literal() with undefined is not supported");
|
3723
3791
|
}
|
3724
|
-
if (schema._zod.def.values.some((
|
3792
|
+
if (schema._zod.def.values.some((literal2) => literal2 === null)) {
|
3725
3793
|
throw new Error("z.literal() with null is not supported");
|
3726
3794
|
}
|
3727
|
-
if (schema._zod.def.values.some((
|
3795
|
+
if (schema._zod.def.values.some((literal2) => typeof literal2 === "bigint")) {
|
3728
3796
|
throw new Error("z.literal() with bigint is not supported");
|
3729
3797
|
}
|
3730
3798
|
return coField.literal(
|
@@ -3838,7 +3906,7 @@ function tryZodSchemaToCoSchema(schema) {
|
|
3838
3906
|
`Unsupported zod CoValue type for top-level schema: ${schema._zod?.def?.type || JSON.stringify(schema, void 0, 2)}`
|
3839
3907
|
);
|
3840
3908
|
}
|
3841
|
-
} else if (schema instanceof
|
3909
|
+
} else if (schema instanceof z.core.$ZodDiscriminatedUnion) {
|
3842
3910
|
if (isUnionOfCoMapsDeeply(schema)) {
|
3843
3911
|
return SchemaUnion.Of(
|
3844
3912
|
schemaUnionDiscriminatorFor(schema)
|
@@ -3877,10 +3945,9 @@ function zodSchemaToCoSchemaOrKeepPrimitive(schema) {
|
|
3877
3945
|
}
|
3878
3946
|
|
3879
3947
|
// src/coValues/extensions/imageDef.ts
|
3880
|
-
import z4 from "zod/v4";
|
3881
3948
|
var ImageDefinitionBase = coMapDefiner({
|
3882
|
-
originalSize:
|
3883
|
-
placeholderDataURL:
|
3949
|
+
originalSize: z.tuple([z.number(), z.number()]),
|
3950
|
+
placeholderDataURL: z.string().optional()
|
3884
3951
|
}).catchall(coFileStreamDefiner());
|
3885
3952
|
var ImageDefinition = ImageDefinitionBase.withHelpers((Self) => ({
|
3886
3953
|
highestResAvailable(imageDef, options) {
|
@@ -4255,23 +4322,23 @@ function createResolvablePromise() {
|
|
4255
4322
|
// src/implementation/devtoolsFormatters.ts
|
4256
4323
|
globalThis.devtoolsFormatters = [
|
4257
4324
|
{
|
4258
|
-
header: (
|
4259
|
-
if (
|
4260
|
-
return ["div", {}, ["span", {},
|
4261
|
-
} else if (
|
4325
|
+
header: (object2) => {
|
4326
|
+
if (object2._type === "CoMap") {
|
4327
|
+
return ["div", {}, ["span", {}, object2.constructor.name]];
|
4328
|
+
} else if (object2._type === "CoList") {
|
4262
4329
|
return [
|
4263
4330
|
"div",
|
4264
4331
|
{},
|
4265
|
-
["span", {},
|
4332
|
+
["span", {}, object2.constructor.name + "(" + object2.length + ") "]
|
4266
4333
|
];
|
4267
|
-
} else if (
|
4334
|
+
} else if (object2._type === "Account") {
|
4268
4335
|
return [
|
4269
4336
|
"div",
|
4270
4337
|
{},
|
4271
4338
|
[
|
4272
4339
|
"span",
|
4273
4340
|
{},
|
4274
|
-
|
4341
|
+
object2.constructor.name + "(" + object2._refs.profile.value?.name + (object2.isMe ? " ME" : "") + ")"
|
4275
4342
|
]
|
4276
4343
|
];
|
4277
4344
|
} else {
|
@@ -4281,44 +4348,44 @@ globalThis.devtoolsFormatters = [
|
|
4281
4348
|
hasBody: function() {
|
4282
4349
|
return true;
|
4283
4350
|
},
|
4284
|
-
body: function(
|
4285
|
-
if (
|
4351
|
+
body: function(object2) {
|
4352
|
+
if (object2._type === "CoMap" || object2._type === "Account") {
|
4286
4353
|
return [
|
4287
4354
|
"div",
|
4288
4355
|
{ style: "margin-left: 15px" },
|
4289
|
-
["div", "id: ", ["object", { object:
|
4290
|
-
...Object.entries(
|
4356
|
+
["div", "id: ", ["object", { object: object2.id }]],
|
4357
|
+
...Object.entries(object2).map(([k, v]) => [
|
4291
4358
|
"div",
|
4292
4359
|
{ style: "white-space: nowrap;" },
|
4293
4360
|
["span", { style: "font-weight: bold; opacity: 0.6" }, k, ": "],
|
4294
4361
|
["object", { object: v }],
|
4295
|
-
...typeof
|
4362
|
+
...typeof object2._schema[k] === "function" ? v === null ? [
|
4296
4363
|
[
|
4297
4364
|
"span",
|
4298
4365
|
{ style: "opacity: 0.5" },
|
4299
|
-
` (pending ${
|
4300
|
-
["object", { object:
|
4366
|
+
` (pending ${object2._schema[k].name} `,
|
4367
|
+
["object", { object: object2._refs[k] }],
|
4301
4368
|
")"
|
4302
4369
|
]
|
4303
4370
|
] : [] : []
|
4304
4371
|
])
|
4305
4372
|
];
|
4306
|
-
} else if (
|
4373
|
+
} else if (object2._type === "CoList") {
|
4307
4374
|
return [
|
4308
4375
|
"div",
|
4309
4376
|
{ style: "margin-left: 15px" },
|
4310
|
-
["div", "id: ", ["object", { object:
|
4311
|
-
...
|
4377
|
+
["div", "id: ", ["object", { object: object2.id }]],
|
4378
|
+
...object2.map((v, i) => [
|
4312
4379
|
"div",
|
4313
4380
|
{ style: "white-space: nowrap;" },
|
4314
4381
|
["span", { style: "font-weight: bold; opacity: 0.6" }, i, ": "],
|
4315
4382
|
["object", { object: v }],
|
4316
|
-
...typeof
|
4383
|
+
...typeof object2._schema[ItemsSym] === "function" ? v === null ? [
|
4317
4384
|
[
|
4318
4385
|
"span",
|
4319
4386
|
{ style: "opacity: 0.5" },
|
4320
|
-
` (pending ${
|
4321
|
-
["object", { object:
|
4387
|
+
` (pending ${object2._schema[ItemsSym].name} `,
|
4388
|
+
["object", { object: object2._refs[i] }],
|
4322
4389
|
")"
|
4323
4390
|
]
|
4324
4391
|
] : [] : []
|
@@ -4531,7 +4598,7 @@ function parseGroupCreateOptions(options) {
|
|
4531
4598
|
}
|
4532
4599
|
|
4533
4600
|
export {
|
4534
|
-
|
4601
|
+
zodReExport_exports,
|
4535
4602
|
loadCoValue,
|
4536
4603
|
subscribeToCoValue,
|
4537
4604
|
createCoValueObservable,
|
@@ -4568,4 +4635,4 @@ export {
|
|
4568
4635
|
JazzContextManager
|
4569
4636
|
};
|
4570
4637
|
/* istanbul ignore file -- @preserve */
|
4571
|
-
//# sourceMappingURL=chunk-
|
4638
|
+
//# sourceMappingURL=chunk-ORL6R2EV.js.map
|