jazz-tools 0.14.8 → 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.
Files changed (66) hide show
  1. package/.turbo/turbo-build.log +7 -7
  2. package/CHANGELOG.md +6 -0
  3. package/dist/{chunk-PA6UHG6Q.js → chunk-ORL6R2EV.js} +107 -40
  4. package/dist/chunk-ORL6R2EV.js.map +1 -0
  5. package/dist/coValues/extensions/imageDef.d.ts +1 -1
  6. package/dist/coValues/extensions/imageDef.d.ts.map +1 -1
  7. package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts +1 -1
  8. package/dist/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.d.ts.map +1 -1
  9. package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts +1 -1
  10. package/dist/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.d.ts.map +1 -1
  11. package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts +1 -1
  12. package/dist/implementation/zodSchema/schemaTypes/AccountSchema.d.ts.map +1 -1
  13. package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts +1 -1
  14. package/dist/implementation/zodSchema/schemaTypes/CoFeedSchema.d.ts.map +1 -1
  15. package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts +1 -1
  16. package/dist/implementation/zodSchema/schemaTypes/CoListSchema.d.ts.map +1 -1
  17. package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts +1 -1
  18. package/dist/implementation/zodSchema/schemaTypes/CoMapSchema.d.ts.map +1 -1
  19. package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts +1 -1
  20. package/dist/implementation/zodSchema/schemaTypes/CoRecordSchema.d.ts.map +1 -1
  21. package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts +1 -1
  22. package/dist/implementation/zodSchema/schemaTypes/FileStreamSchema.d.ts.map +1 -1
  23. package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts +1 -1
  24. package/dist/implementation/zodSchema/schemaTypes/PlainTextSchema.d.ts.map +1 -1
  25. package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts +1 -1
  26. package/dist/implementation/zodSchema/schemaTypes/RichTextSchema.d.ts.map +1 -1
  27. package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts +1 -1
  28. package/dist/implementation/zodSchema/typeConverters/InstanceOfSchema.d.ts.map +1 -1
  29. package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts +1 -1
  30. package/dist/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.d.ts.map +1 -1
  31. package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts +1 -1
  32. package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.d.ts.map +1 -1
  33. package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts +1 -1
  34. package/dist/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.d.ts.map +1 -1
  35. package/dist/implementation/zodSchema/unionUtils.d.ts +1 -1
  36. package/dist/implementation/zodSchema/unionUtils.d.ts.map +1 -1
  37. package/dist/implementation/zodSchema/zodCo.d.ts +1 -1
  38. package/dist/implementation/zodSchema/zodCo.d.ts.map +1 -1
  39. package/dist/implementation/zodSchema/zodReExport.d.ts +1 -1
  40. package/dist/implementation/zodSchema/zodReExport.d.ts.map +1 -1
  41. package/dist/implementation/zodSchema/zodSchema.d.ts +1 -1
  42. package/dist/implementation/zodSchema/zodSchema.d.ts.map +1 -1
  43. package/dist/index.js +4 -75
  44. package/dist/index.js.map +1 -1
  45. package/dist/testing.js +1 -1
  46. package/package.json +2 -2
  47. package/src/coValues/extensions/imageDef.ts +1 -1
  48. package/src/implementation/zodSchema/runtimeConverters/zodFieldToCoFieldDef.ts +1 -5
  49. package/src/implementation/zodSchema/runtimeConverters/zodSchemaToCoSchema.ts +1 -1
  50. package/src/implementation/zodSchema/schemaTypes/AccountSchema.ts +1 -1
  51. package/src/implementation/zodSchema/schemaTypes/CoFeedSchema.ts +1 -1
  52. package/src/implementation/zodSchema/schemaTypes/CoListSchema.ts +1 -1
  53. package/src/implementation/zodSchema/schemaTypes/CoMapSchema.ts +1 -1
  54. package/src/implementation/zodSchema/schemaTypes/CoRecordSchema.ts +1 -1
  55. package/src/implementation/zodSchema/schemaTypes/FileStreamSchema.ts +1 -1
  56. package/src/implementation/zodSchema/schemaTypes/PlainTextSchema.ts +1 -1
  57. package/src/implementation/zodSchema/schemaTypes/RichTextSchema.ts +1 -1
  58. package/src/implementation/zodSchema/typeConverters/InstanceOfSchema.ts +1 -1
  59. package/src/implementation/zodSchema/typeConverters/InstanceOfSchemaCoValuesNullable.ts +1 -1
  60. package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchema.ts +1 -1
  61. package/src/implementation/zodSchema/typeConverters/InstanceOrPrimitiveOfSchemaCoValuesNullable.ts +1 -1
  62. package/src/implementation/zodSchema/unionUtils.ts +1 -1
  63. package/src/implementation/zodSchema/zodCo.ts +1 -1
  64. package/src/implementation/zodSchema/zodReExport.ts +5 -1
  65. package/src/implementation/zodSchema/zodSchema.ts +1 -1
  66. package/dist/chunk-PA6UHG6Q.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
 
2
- > jazz-tools@0.14.8 build /home/runner/_work/jazz/jazz/packages/jazz-tools
2
+ > jazz-tools@0.14.9 build /home/runner/_work/jazz/jazz/packages/jazz-tools
3
3
  > tsup && pnpm types
4
4
 
5
5
  CLI Building entry: {"index":"src/index.ts","testing":"src/testing.ts"}
@@ -9,14 +9,14 @@
9
9
  CLI Target: es2021
10
10
  CLI Cleaning output folder
11
11
  ESM Build start
12
- ESM dist/index.js 12.29 KB
12
+ ESM dist/index.js 11.07 KB
13
13
  ESM dist/testing.js 6.31 KB
14
- ESM dist/chunk-PA6UHG6Q.js 131.68 KB
15
- ESM dist/index.js.map 19.42 KB
14
+ ESM dist/chunk-ORL6R2EV.js 132.69 KB
15
+ ESM dist/index.js.map 18.38 KB
16
16
  ESM dist/testing.js.map 12.57 KB
17
- ESM dist/chunk-PA6UHG6Q.js.map 306.05 KB
18
- ESM ⚡️ Build success in 58ms
17
+ ESM dist/chunk-ORL6R2EV.js.map 307.06 KB
18
+ ESM ⚡️ Build success in 75ms
19
19
 
20
- > jazz-tools@0.14.8 types /home/runner/_work/jazz/jazz/packages/jazz-tools
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,11 @@
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
+
3
9
  ## 0.14.8
4
10
 
5
11
  ### 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 optional = {
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 "jazz-tools-zod-v4-rn-patch/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 "jazz-tools-zod-v4-rn-patch/v4";
3569
-
3570
3639
  // src/implementation/zodSchema/unionUtils.ts
3571
3640
  import { RawCoList } from "cojson";
3572
- import z2 from "jazz-tools-zod-v4-rn-patch/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 z2.core.$ZodUnion) {
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 z2.core.$ZodObject && "collaborative" in schema && schema.collaborative) {
3733
+ if (schema instanceof z.core.$ZodObject && "collaborative" in schema && schema.collaborative) {
3666
3734
  return true;
3667
- } else if (schema instanceof z2.core.$ZodUnion) {
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 z2.core.$ZodUnion) {
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
- (literal) => typeof literal === "undefined"
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((literal) => literal === null)) {
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((literal) => typeof literal === "bigint")) {
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 z3.core.$ZodDiscriminatedUnion) {
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 "jazz-tools-zod-v4-rn-patch/v4";
3881
3948
  var ImageDefinitionBase = coMapDefiner({
3882
- originalSize: z4.tuple([z4.number(), z4.number()]),
3883
- placeholderDataURL: z4.string().optional()
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: (object) => {
4259
- if (object._type === "CoMap") {
4260
- return ["div", {}, ["span", {}, object.constructor.name]];
4261
- } else if (object._type === "CoList") {
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", {}, object.constructor.name + "(" + object.length + ") "]
4332
+ ["span", {}, object2.constructor.name + "(" + object2.length + ") "]
4266
4333
  ];
4267
- } else if (object._type === "Account") {
4334
+ } else if (object2._type === "Account") {
4268
4335
  return [
4269
4336
  "div",
4270
4337
  {},
4271
4338
  [
4272
4339
  "span",
4273
4340
  {},
4274
- object.constructor.name + "(" + object._refs.profile.value?.name + (object.isMe ? " ME" : "") + ")"
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(object) {
4285
- if (object._type === "CoMap" || object._type === "Account") {
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: object.id }]],
4290
- ...Object.entries(object).map(([k, v]) => [
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 object._schema[k] === "function" ? v === null ? [
4362
+ ...typeof object2._schema[k] === "function" ? v === null ? [
4296
4363
  [
4297
4364
  "span",
4298
4365
  { style: "opacity: 0.5" },
4299
- ` (pending ${object._schema[k].name} `,
4300
- ["object", { object: object._refs[k] }],
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 (object._type === "CoList") {
4373
+ } else if (object2._type === "CoList") {
4307
4374
  return [
4308
4375
  "div",
4309
4376
  { style: "margin-left: 15px" },
4310
- ["div", "id: ", ["object", { object: object.id }]],
4311
- ...object.map((v, i) => [
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 object._schema[ItemsSym] === "function" ? v === null ? [
4383
+ ...typeof object2._schema[ItemsSym] === "function" ? v === null ? [
4317
4384
  [
4318
4385
  "span",
4319
4386
  { style: "opacity: 0.5" },
4320
- ` (pending ${object._schema[ItemsSym].name} `,
4321
- ["object", { object: object._refs[i] }],
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
- __export,
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-PA6UHG6Q.js.map
4638
+ //# sourceMappingURL=chunk-ORL6R2EV.js.map