@tinacms/schema-tools 1.7.3 → 1.8.0

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/dist/index.js CHANGED
@@ -1664,6 +1664,9 @@
1664
1664
  };
1665
1665
  };
1666
1666
  const normalizePath = (filepath) => filepath.replace(/\\/g, "/");
1667
+ const canonicalPath = (filepath) => {
1668
+ return normalizePath(filepath).split("/").filter((name2) => name2 !== "").join("/");
1669
+ };
1667
1670
  class TinaSchema {
1668
1671
  /**
1669
1672
  * Create a schema class from a user defined schema object
@@ -1713,21 +1716,21 @@
1713
1716
  };
1714
1717
  this.getCollectionByFullPath = (filepath) => {
1715
1718
  const fileExtension = filepath.split(".").pop();
1716
- const normalizedPath = filepath.replace(/\\/g, "/");
1719
+ const canonicalFilepath = canonicalPath(filepath);
1717
1720
  const possibleCollections = this.getCollections().filter((collection) => {
1718
1721
  var _a, _b;
1719
- if (!normalizedPath.endsWith(`.gitkeep.${collection.format || "md"}`) && fileExtension !== (collection.format || "md")) {
1722
+ if (!canonicalFilepath.endsWith(`.gitkeep.${collection.format || "md"}`) && fileExtension !== (collection.format || "md")) {
1720
1723
  return false;
1721
1724
  }
1722
1725
  if (((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) || ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude)) {
1723
1726
  const matches = this.getMatches({ collection });
1724
- const match = picomatch$1.isMatch(normalizedPath, matches);
1727
+ const match = picomatch$1.isMatch(canonicalFilepath, matches);
1725
1728
  if (!match) {
1726
1729
  return false;
1727
1730
  }
1728
1731
  }
1729
- const path = collection.path ? collection.path.replace(/\/?$/, "/") : "";
1730
- return normalizedPath.startsWith(path);
1732
+ const collectionPath = canonicalPath(collection.path);
1733
+ return collectionPath === "" || canonicalFilepath.startsWith(`${collectionPath}/`);
1731
1734
  });
1732
1735
  if (possibleCollections.length === 0) {
1733
1736
  throw new Error(`Unable to find collection for file at ${filepath}`);
@@ -2060,16 +2063,16 @@
2060
2063
  }) {
2061
2064
  var _a, _b;
2062
2065
  const collection = typeof collectionOrString === "string" ? this.getCollection(collectionOrString) : collectionOrString;
2063
- const normalPath = normalizePath(collection.path);
2064
- const pathSuffix = normalPath ? "/" : "";
2066
+ const collectionPath = canonicalPath(collection.path);
2067
+ const pathSuffix = collectionPath ? "/" : "";
2065
2068
  const format = collection.format || "md";
2066
2069
  const matches = [];
2067
2070
  if ((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) {
2068
- const match = `${normalPath}${pathSuffix}${collection.match.include}.${format}`;
2071
+ const match = `${collectionPath}${pathSuffix}${collection.match.include}.${format}`;
2069
2072
  matches.push(match);
2070
2073
  }
2071
2074
  if ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude) {
2072
- const exclude = `!(${normalPath}${pathSuffix}${collection.match.exclude}.${format})`;
2075
+ const exclude = `!(${collectionPath}${pathSuffix}${collection.match.exclude}.${format})`;
2073
2076
  matches.push(exclude);
2074
2077
  }
2075
2078
  return matches;
@@ -2262,6 +2265,15 @@
2262
2265
  })
2263
2266
  };
2264
2267
  };
2268
+ const CONTENT_FORMATS = [
2269
+ "mdx",
2270
+ "md",
2271
+ "markdown",
2272
+ "json",
2273
+ "yaml",
2274
+ "yml",
2275
+ "toml"
2276
+ ];
2265
2277
  const parseZodError = ({ zodError }) => {
2266
2278
  var _a, _b, _c, _d;
2267
2279
  const errors = zodError.flatten((issue) => {
@@ -2571,15 +2583,6 @@ ${stringifiedField}`
2571
2583
  const newConfig = tinaConfigZod.parse(config);
2572
2584
  return newConfig;
2573
2585
  };
2574
- const FORMATS = [
2575
- "json",
2576
- "md",
2577
- "markdown",
2578
- "mdx",
2579
- "toml",
2580
- "yaml",
2581
- "yml"
2582
- ];
2583
2586
  const Template = z.z.object({
2584
2587
  label: z.z.string({
2585
2588
  invalid_type_error: "Invalid data type for property `label`. Must be of type `string`",
@@ -2615,7 +2618,7 @@ ${stringifiedField}`
2615
2618
  });
2616
2619
  }
2617
2620
  }),
2618
- format: z.z.enum(FORMATS).optional(),
2621
+ format: z.z.enum(CONTENT_FORMATS).optional(),
2619
2622
  isAuthCollection: z.z.boolean().optional(),
2620
2623
  isDetached: z.z.boolean().optional()
2621
2624
  });
@@ -2734,11 +2737,13 @@ ${stringifiedField}`
2734
2737
  throw new Error(e);
2735
2738
  }
2736
2739
  };
2740
+ exports2.CONTENT_FORMATS = CONTENT_FORMATS;
2737
2741
  exports2.NAMER = NAMER;
2738
2742
  exports2.TINA_HOST = TINA_HOST;
2739
2743
  exports2.TinaSchema = TinaSchema;
2740
2744
  exports2.TinaSchemaValidationError = TinaSchemaValidationError;
2741
2745
  exports2.addNamespaceToSchema = addNamespaceToSchema;
2746
+ exports2.canonicalPath = canonicalPath;
2742
2747
  exports2.normalizePath = normalizePath;
2743
2748
  exports2.parseURL = parseURL;
2744
2749
  exports2.resolveField = resolveField;
package/dist/index.mjs CHANGED
@@ -1646,6 +1646,9 @@ const parseURL = (url) => {
1646
1646
  };
1647
1647
  };
1648
1648
  const normalizePath = (filepath) => filepath.replace(/\\/g, "/");
1649
+ const canonicalPath = (filepath) => {
1650
+ return normalizePath(filepath).split("/").filter((name2) => name2 !== "").join("/");
1651
+ };
1649
1652
  class TinaSchema {
1650
1653
  /**
1651
1654
  * Create a schema class from a user defined schema object
@@ -1695,21 +1698,21 @@ class TinaSchema {
1695
1698
  };
1696
1699
  this.getCollectionByFullPath = (filepath) => {
1697
1700
  const fileExtension = filepath.split(".").pop();
1698
- const normalizedPath = filepath.replace(/\\/g, "/");
1701
+ const canonicalFilepath = canonicalPath(filepath);
1699
1702
  const possibleCollections = this.getCollections().filter((collection) => {
1700
1703
  var _a, _b;
1701
- if (!normalizedPath.endsWith(`.gitkeep.${collection.format || "md"}`) && fileExtension !== (collection.format || "md")) {
1704
+ if (!canonicalFilepath.endsWith(`.gitkeep.${collection.format || "md"}`) && fileExtension !== (collection.format || "md")) {
1702
1705
  return false;
1703
1706
  }
1704
1707
  if (((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) || ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude)) {
1705
1708
  const matches = this.getMatches({ collection });
1706
- const match = picomatch$1.isMatch(normalizedPath, matches);
1709
+ const match = picomatch$1.isMatch(canonicalFilepath, matches);
1707
1710
  if (!match) {
1708
1711
  return false;
1709
1712
  }
1710
1713
  }
1711
- const path = collection.path ? collection.path.replace(/\/?$/, "/") : "";
1712
- return normalizedPath.startsWith(path);
1714
+ const collectionPath = canonicalPath(collection.path);
1715
+ return collectionPath === "" || canonicalFilepath.startsWith(`${collectionPath}/`);
1713
1716
  });
1714
1717
  if (possibleCollections.length === 0) {
1715
1718
  throw new Error(`Unable to find collection for file at ${filepath}`);
@@ -2042,16 +2045,16 @@ class TinaSchema {
2042
2045
  }) {
2043
2046
  var _a, _b;
2044
2047
  const collection = typeof collectionOrString === "string" ? this.getCollection(collectionOrString) : collectionOrString;
2045
- const normalPath = normalizePath(collection.path);
2046
- const pathSuffix = normalPath ? "/" : "";
2048
+ const collectionPath = canonicalPath(collection.path);
2049
+ const pathSuffix = collectionPath ? "/" : "";
2047
2050
  const format = collection.format || "md";
2048
2051
  const matches = [];
2049
2052
  if ((_a = collection == null ? void 0 : collection.match) == null ? void 0 : _a.include) {
2050
- const match = `${normalPath}${pathSuffix}${collection.match.include}.${format}`;
2053
+ const match = `${collectionPath}${pathSuffix}${collection.match.include}.${format}`;
2051
2054
  matches.push(match);
2052
2055
  }
2053
2056
  if ((_b = collection == null ? void 0 : collection.match) == null ? void 0 : _b.exclude) {
2054
- const exclude = `!(${normalPath}${pathSuffix}${collection.match.exclude}.${format})`;
2057
+ const exclude = `!(${collectionPath}${pathSuffix}${collection.match.exclude}.${format})`;
2055
2058
  matches.push(exclude);
2056
2059
  }
2057
2060
  return matches;
@@ -2244,6 +2247,15 @@ const resolveForm = ({
2244
2247
  })
2245
2248
  };
2246
2249
  };
2250
+ const CONTENT_FORMATS = [
2251
+ "mdx",
2252
+ "md",
2253
+ "markdown",
2254
+ "json",
2255
+ "yaml",
2256
+ "yml",
2257
+ "toml"
2258
+ ];
2247
2259
  const parseZodError = ({ zodError }) => {
2248
2260
  var _a, _b, _c, _d;
2249
2261
  const errors = zodError.flatten((issue) => {
@@ -2553,15 +2565,6 @@ const validateTinaCloudSchemaConfig = (config) => {
2553
2565
  const newConfig = tinaConfigZod.parse(config);
2554
2566
  return newConfig;
2555
2567
  };
2556
- const FORMATS = [
2557
- "json",
2558
- "md",
2559
- "markdown",
2560
- "mdx",
2561
- "toml",
2562
- "yaml",
2563
- "yml"
2564
- ];
2565
2568
  const Template = z.object({
2566
2569
  label: z.string({
2567
2570
  invalid_type_error: "Invalid data type for property `label`. Must be of type `string`",
@@ -2597,7 +2600,7 @@ const CollectionBaseSchema = z.object({
2597
2600
  });
2598
2601
  }
2599
2602
  }),
2600
- format: z.enum(FORMATS).optional(),
2603
+ format: z.enum(CONTENT_FORMATS).optional(),
2601
2604
  isAuthCollection: z.boolean().optional(),
2602
2605
  isDetached: z.boolean().optional()
2603
2606
  });
@@ -2717,11 +2720,13 @@ const validateSchema = ({ schema }) => {
2717
2720
  }
2718
2721
  };
2719
2722
  export {
2723
+ CONTENT_FORMATS,
2720
2724
  NAMER,
2721
2725
  TINA_HOST,
2722
2726
  TinaSchema,
2723
2727
  TinaSchemaValidationError,
2724
2728
  addNamespaceToSchema,
2729
+ canonicalPath,
2725
2730
  normalizePath,
2726
2731
  parseURL,
2727
2732
  resolveField,
@@ -1,5 +1,23 @@
1
1
  import type { FC } from 'react';
2
2
  import type React from 'react';
3
+ export declare const CONTENT_FORMATS: readonly ["mdx", "md", "markdown", "json", "yaml", "yml", "toml"];
4
+ export type ContentFormat = (typeof CONTENT_FORMATS)[number];
5
+ export type ContentFrontmatterFormat = 'yaml' | 'toml' | 'json';
6
+ export type Parser = {
7
+ type: 'mdx';
8
+ } | {
9
+ type: 'markdown';
10
+ /**
11
+ * Tina will escape entities like `<` and `[` by default. You can choose to turn
12
+ * off all escaping, or specify HTML, so `<div>` will not be turned into `\<div>`
13
+ */
14
+ skipEscaping?: 'all' | 'html' | 'none';
15
+ } | {
16
+ /**
17
+ * Experimental: Returns the native Slate.js document as JSON. Ideal to retain the pure editor content structure.
18
+ */
19
+ type: 'slatejson';
20
+ };
3
21
  type Meta = {
4
22
  active?: boolean;
5
23
  dirty?: boolean;
@@ -212,16 +230,7 @@ export type RichTextField<WithNamespace extends boolean = false> = (FieldGeneric
212
230
  *
213
231
  * Specify `"markdown"` if you're having problems with Tina parsing your content.
214
232
  */
215
- parser?: {
216
- type: 'markdown';
217
- /**
218
- * Tina will escape entities like `<` and `[` by default. You can choose to turn
219
- * off all escaping, or specify HTML, so `<div>` will not be turned into `\<div>`
220
- */
221
- skipEscaping?: 'all' | 'html' | 'none';
222
- } | {
223
- type: 'mdx';
224
- };
233
+ parser?: Parser;
225
234
  };
226
235
  export type RichTextTemplate<WithNamespace extends boolean = false> = Template<WithNamespace> & {
227
236
  inline?: boolean;
@@ -587,7 +596,7 @@ interface BaseCollection {
587
596
  name: string;
588
597
  path: string;
589
598
  indexes?: IndexType[];
590
- format?: 'json' | 'md' | 'markdown' | 'mdx' | 'yaml' | 'yml' | 'toml';
599
+ format?: ContentFormat;
591
600
  ui?: UICollection;
592
601
  /**
593
602
  * @deprecated - use `ui.defaultItem` on the each `template` instead
@@ -596,7 +605,7 @@ interface BaseCollection {
596
605
  /**
597
606
  * This format will be used to parse the markdown frontmatter
598
607
  */
599
- frontmatterFormat?: 'yaml' | 'toml' | 'json';
608
+ frontmatterFormat?: ContentFrontmatterFormat;
600
609
  /**
601
610
  * The delimiters used to parse the frontmatter.
602
611
  */
@@ -1 +1,9 @@
1
1
  export declare const normalizePath: (filepath: string) => string;
2
+ /**
3
+ * Returns the given path such that:
4
+ * - The path separator is converted from '\' to '/' if necessary.
5
+ * - Duplicate '/' are removed
6
+ * - Leading and trailing '/' are cleared
7
+ * @param filepath Filepath to convert to its canonical form
8
+ */
9
+ export declare const canonicalPath: (filepath: string) => string;
@@ -3,21 +3,21 @@ export declare const CollectionBaseSchema: z.ZodObject<{
3
3
  label: z.ZodOptional<z.ZodString>;
4
4
  name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
5
5
  path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
6
- format: z.ZodOptional<z.ZodEnum<["json", "md", "markdown", "mdx", "toml", "yaml", "yml"]>>;
6
+ format: z.ZodOptional<z.ZodEnum<["mdx", "md", "markdown", "json", "yaml", "yml", "toml"]>>;
7
7
  isAuthCollection: z.ZodOptional<z.ZodBoolean>;
8
8
  isDetached: z.ZodOptional<z.ZodBoolean>;
9
9
  }, "strip", z.ZodTypeAny, {
10
10
  name?: string;
11
11
  label?: string;
12
12
  path?: string;
13
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
13
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
14
14
  isDetached?: boolean;
15
15
  isAuthCollection?: boolean;
16
16
  }, {
17
17
  name?: string;
18
18
  label?: string;
19
19
  path?: string;
20
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
20
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
21
21
  isDetached?: boolean;
22
22
  isAuthCollection?: boolean;
23
23
  }>;
@@ -26,90 +26,90 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
26
26
  label: z.ZodOptional<z.ZodString>;
27
27
  name: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
28
28
  path: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
29
- format: z.ZodOptional<z.ZodEnum<["json", "md", "markdown", "mdx", "toml", "yaml", "yml"]>>;
29
+ format: z.ZodOptional<z.ZodEnum<["mdx", "md", "markdown", "json", "yaml", "yml", "toml"]>>;
30
30
  isAuthCollection: z.ZodOptional<z.ZodBoolean>;
31
31
  isDetached: z.ZodOptional<z.ZodBoolean>;
32
32
  }, {
33
- fields: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodType<import("..").TinaField, z.ZodTypeDef, import("..").TinaField>, "many">>, import("..").TinaField[], import("..").TinaField[]>, import("..").TinaField[], import("..").TinaField[]>, import("..").TinaField[], import("..").TinaField[]>, import("..").TinaField[], import("..").TinaField[]>;
33
+ fields: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodType<import("../types/index").TinaField, z.ZodTypeDef, import("../types/index").TinaField>, "many">>, import("../types/index").TinaField[], import("../types/index").TinaField[]>, import("../types/index").TinaField[], import("../types/index").TinaField[]>, import("../types/index").TinaField[], import("../types/index").TinaField[]>, import("../types/index").TinaField[], import("../types/index").TinaField[]>;
34
34
  templates: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodObject<{
35
35
  label: z.ZodString;
36
36
  name: z.ZodEffects<z.ZodString, string, string>;
37
- fields: z.ZodArray<z.ZodType<import("..").TinaField, z.ZodTypeDef, import("..").TinaField>, "many">;
37
+ fields: z.ZodArray<z.ZodType<import("../types/index").TinaField, z.ZodTypeDef, import("../types/index").TinaField>, "many">;
38
38
  }, "strip", z.ZodTypeAny, {
39
39
  name?: string;
40
- fields?: import("..").TinaField[];
40
+ fields?: import("../types/index").TinaField[];
41
41
  label?: string;
42
42
  }, {
43
43
  name?: string;
44
- fields?: import("..").TinaField[];
44
+ fields?: import("../types/index").TinaField[];
45
45
  label?: string;
46
46
  }>, {
47
47
  name?: string;
48
- fields?: import("..").TinaField[];
48
+ fields?: import("../types/index").TinaField[];
49
49
  label?: string;
50
50
  }, {
51
51
  name?: string;
52
- fields?: import("..").TinaField[];
52
+ fields?: import("../types/index").TinaField[];
53
53
  label?: string;
54
54
  }>, "many">>, {
55
55
  name?: string;
56
- fields?: import("..").TinaField[];
56
+ fields?: import("../types/index").TinaField[];
57
57
  label?: string;
58
58
  }[], {
59
59
  name?: string;
60
- fields?: import("..").TinaField[];
60
+ fields?: import("../types/index").TinaField[];
61
61
  label?: string;
62
62
  }[]>;
63
63
  }>, "strip", z.ZodTypeAny, {
64
64
  name?: string;
65
65
  templates?: {
66
66
  name?: string;
67
- fields?: import("..").TinaField[];
67
+ fields?: import("../types/index").TinaField[];
68
68
  label?: string;
69
69
  }[];
70
- fields?: import("..").TinaField[];
70
+ fields?: import("../types/index").TinaField[];
71
71
  label?: string;
72
72
  path?: string;
73
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
73
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
74
74
  isDetached?: boolean;
75
75
  isAuthCollection?: boolean;
76
76
  }, {
77
77
  name?: string;
78
78
  templates?: {
79
79
  name?: string;
80
- fields?: import("..").TinaField[];
80
+ fields?: import("../types/index").TinaField[];
81
81
  label?: string;
82
82
  }[];
83
- fields?: import("..").TinaField[];
83
+ fields?: import("../types/index").TinaField[];
84
84
  label?: string;
85
85
  path?: string;
86
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
86
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
87
87
  isDetached?: boolean;
88
88
  isAuthCollection?: boolean;
89
89
  }>, {
90
90
  name?: string;
91
91
  templates?: {
92
92
  name?: string;
93
- fields?: import("..").TinaField[];
93
+ fields?: import("../types/index").TinaField[];
94
94
  label?: string;
95
95
  }[];
96
- fields?: import("..").TinaField[];
96
+ fields?: import("../types/index").TinaField[];
97
97
  label?: string;
98
98
  path?: string;
99
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
99
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
100
100
  isDetached?: boolean;
101
101
  isAuthCollection?: boolean;
102
102
  }, {
103
103
  name?: string;
104
104
  templates?: {
105
105
  name?: string;
106
- fields?: import("..").TinaField[];
106
+ fields?: import("../types/index").TinaField[];
107
107
  label?: string;
108
108
  }[];
109
- fields?: import("..").TinaField[];
109
+ fields?: import("../types/index").TinaField[];
110
110
  label?: string;
111
111
  path?: string;
112
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
112
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
113
113
  isDetached?: boolean;
114
114
  isAuthCollection?: boolean;
115
115
  }>, "many">;
@@ -237,13 +237,13 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
237
237
  name?: string;
238
238
  templates?: {
239
239
  name?: string;
240
- fields?: import("..").TinaField[];
240
+ fields?: import("../types/index").TinaField[];
241
241
  label?: string;
242
242
  }[];
243
- fields?: import("..").TinaField[];
243
+ fields?: import("../types/index").TinaField[];
244
244
  label?: string;
245
245
  path?: string;
246
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
246
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
247
247
  isDetached?: boolean;
248
248
  isAuthCollection?: boolean;
249
249
  }[];
@@ -275,13 +275,13 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
275
275
  name?: string;
276
276
  templates?: {
277
277
  name?: string;
278
- fields?: import("..").TinaField[];
278
+ fields?: import("../types/index").TinaField[];
279
279
  label?: string;
280
280
  }[];
281
- fields?: import("..").TinaField[];
281
+ fields?: import("../types/index").TinaField[];
282
282
  label?: string;
283
283
  path?: string;
284
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
284
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
285
285
  isDetached?: boolean;
286
286
  isAuthCollection?: boolean;
287
287
  }[];
@@ -313,13 +313,13 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
313
313
  name?: string;
314
314
  templates?: {
315
315
  name?: string;
316
- fields?: import("..").TinaField[];
316
+ fields?: import("../types/index").TinaField[];
317
317
  label?: string;
318
318
  }[];
319
- fields?: import("..").TinaField[];
319
+ fields?: import("../types/index").TinaField[];
320
320
  label?: string;
321
321
  path?: string;
322
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
322
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
323
323
  isDetached?: boolean;
324
324
  isAuthCollection?: boolean;
325
325
  }[];
@@ -351,13 +351,13 @@ export declare const TinaCloudSchemaZod: z.ZodEffects<z.ZodObject<{
351
351
  name?: string;
352
352
  templates?: {
353
353
  name?: string;
354
- fields?: import("..").TinaField[];
354
+ fields?: import("../types/index").TinaField[];
355
355
  label?: string;
356
356
  }[];
357
- fields?: import("..").TinaField[];
357
+ fields?: import("../types/index").TinaField[];
358
358
  label?: string;
359
359
  path?: string;
360
- format?: "markdown" | "mdx" | "json" | "md" | "yaml" | "yml" | "toml";
360
+ format?: "mdx" | "md" | "markdown" | "json" | "yaml" | "yml" | "toml";
361
361
  isDetached?: boolean;
362
362
  isAuthCollection?: boolean;
363
363
  }[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinacms/schema-tools",
3
- "version": "1.7.3",
3
+ "version": "1.8.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "./dist/index.mjs",
6
6
  "exports": {
@@ -32,7 +32,7 @@
32
32
  "ts-jest": "^29.2.5",
33
33
  "typescript": "^5.7.3",
34
34
  "yup": "^0.32.11",
35
- "@tinacms/scripts": "1.3.4"
35
+ "@tinacms/scripts": "1.3.5"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "react": ">=16.14.0",