@hanzo/docs-content-collections 1.2.4 → 1.2.7

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Fumadocs Content Collections
1
+ # @hanzo/docs-content-collections
2
2
 
3
- The Content Collections adapter for Fumadocs.
3
+ The Content Collections adapter for Hanzo Docs.
@@ -1,45 +1,41 @@
1
- import { Meta, Context } from '@content-collections/core';
2
- import { Options } from '@content-collections/mdx';
3
- import * as Plugins from '@hanzo/docs-core/mdx-plugins';
4
- import { StructuredData } from '@hanzo/docs-core/mdx-plugins';
5
- import { z } from 'zod';
6
- import { Pluggable } from 'unified';
1
+ import { Options } from "@content-collections/mdx";
2
+ import * as Plugins from "@hanzo/docs-core/mdx-plugins";
3
+ import { StructuredData } from "@hanzo/docs-core/mdx-plugins";
4
+ import { z } from "zod";
5
+ import { Context, Meta } from "@content-collections/core";
6
+ import { Pluggable } from "unified";
7
7
 
8
+ //#region src/resolve-plugins.d.ts
8
9
  type ResolvePlugins = Pluggable[] | ((v: Pluggable[]) => Pluggable[]);
9
-
10
- /**
11
- * Default configuration
12
- *
13
- * You may copy and modify the code
14
- */
15
-
10
+ //#endregion
11
+ //#region src/configuration.d.ts
16
12
  interface TransformOptions extends Omit<Options, 'remarkPlugins' | 'rehypePlugins'> {
17
- remarkPlugins?: ResolvePlugins;
18
- rehypePlugins?: ResolvePlugins;
19
- /**
20
- * Generate `structuredData`
21
- *
22
- * @defaultValue true
23
- * @deprecated use `remarkStructureOptions` instead
24
- */
25
- generateStructuredData?: boolean;
26
- remarkStructureOptions?: Plugins.StructureOptions | boolean;
27
- remarkHeadingOptions?: Plugins.RemarkHeadingOptions | boolean;
28
- rehypeCodeOptions?: Plugins.RehypeCodeOptions | boolean;
29
- remarkImageOptions?: Plugins.RemarkImageOptions | boolean;
30
- remarkCodeTabOptions?: Plugins.RemarkCodeTabOptions | boolean;
13
+ remarkPlugins?: ResolvePlugins;
14
+ rehypePlugins?: ResolvePlugins;
15
+ /**
16
+ * Generate `structuredData`
17
+ *
18
+ * @defaultValue true
19
+ * @deprecated use `remarkStructureOptions` instead
20
+ */
21
+ generateStructuredData?: boolean;
22
+ remarkStructureOptions?: Plugins.StructureOptions | boolean;
23
+ remarkHeadingOptions?: Plugins.RemarkHeadingOptions | boolean;
24
+ rehypeCodeOptions?: Plugins.RehypeCodeOptions | boolean;
25
+ remarkImageOptions?: Plugins.RemarkImageOptions | boolean;
26
+ remarkCodeTabOptions?: Plugins.RemarkCodeTabOptions | boolean;
31
27
  }
32
28
  /**
33
29
  * The default TOC types support `ReactNode`, which isn't serializable
34
30
  */
35
31
  type SerializableTOC = {
36
- title: string;
37
- url: string;
38
- depth: number;
32
+ title: string;
33
+ url: string;
34
+ depth: number;
39
35
  }[];
40
36
  interface BaseDoc {
41
- _meta: Meta;
42
- content: string;
37
+ _meta: Meta;
38
+ content: string;
43
39
  }
44
40
  /**
45
41
  * We need to convert interface types to object types.
@@ -47,46 +43,45 @@ interface BaseDoc {
47
43
  * Otherwise, `T extends Serializable? true : false` gives us `false`.
48
44
  * Because interface types cannot extend a union type like `Serializable`.
49
45
  */
50
- type InterfaceToObject<T> = T extends object ? {
51
- [K in keyof T]: InterfaceToObject<T[K]>;
52
- } : T;
46
+ type InterfaceToObject<T> = T extends object ? { [K in keyof T]: InterfaceToObject<T[K]> } : T;
53
47
  declare function transformMDX<D extends BaseDoc>(document: D, context: Context, options?: TransformOptions): Promise<D & {
54
- body: string;
55
- toc: SerializableTOC;
56
- /**
57
- * `StructuredData` for search indexes
58
- */
59
- structuredData: InterfaceToObject<StructuredData>;
48
+ body: string;
49
+ toc: SerializableTOC;
50
+ /**
51
+ * `StructuredData` for search indexes
52
+ */
53
+ structuredData: InterfaceToObject<StructuredData>;
60
54
  }>;
61
55
  declare const metaSchema: z.ZodObject<{
62
- title: z.ZodOptional<z.ZodString>;
63
- pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
- description: z.ZodOptional<z.ZodString>;
65
- root: z.ZodOptional<z.ZodBoolean>;
66
- defaultOpen: z.ZodOptional<z.ZodBoolean>;
67
- icon: z.ZodOptional<z.ZodString>;
56
+ title: z.ZodOptional<z.ZodString>;
57
+ pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
58
+ description: z.ZodOptional<z.ZodString>;
59
+ root: z.ZodOptional<z.ZodBoolean>;
60
+ defaultOpen: z.ZodOptional<z.ZodBoolean>;
61
+ icon: z.ZodOptional<z.ZodString>;
68
62
  }, z.core.$strip>;
69
63
  declare const frontmatterSchema: z.ZodObject<{
70
- title: z.ZodString;
71
- description: z.ZodOptional<z.ZodString>;
72
- icon: z.ZodOptional<z.ZodString>;
73
- full: z.ZodOptional<z.ZodBoolean>;
74
- _openapi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
64
+ title: z.ZodString;
65
+ description: z.ZodOptional<z.ZodString>;
66
+ icon: z.ZodOptional<z.ZodString>;
67
+ full: z.ZodOptional<z.ZodBoolean>;
68
+ _openapi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
75
69
  }, z.core.$strip>;
76
70
  declare function createDocSchema(z: typeof z): {
77
- title: z.ZodString;
78
- description: z.ZodOptional<z.ZodString>;
79
- icon: z.ZodOptional<z.ZodString>;
80
- full: z.ZodOptional<z.ZodBoolean>;
81
- _openapi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
71
+ title: z.ZodString;
72
+ description: z.ZodOptional<z.ZodString>;
73
+ icon: z.ZodOptional<z.ZodString>;
74
+ full: z.ZodOptional<z.ZodBoolean>;
75
+ _openapi: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
82
76
  };
83
77
  declare function createMetaSchema(z: typeof z): {
84
- title: z.ZodOptional<z.ZodString>;
85
- description: z.ZodOptional<z.ZodString>;
86
- pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
87
- icon: z.ZodOptional<z.ZodString>;
88
- root: z.ZodOptional<z.ZodBoolean>;
89
- defaultOpen: z.ZodOptional<z.ZodBoolean>;
78
+ title: z.ZodOptional<z.ZodString>;
79
+ description: z.ZodOptional<z.ZodString>;
80
+ pages: z.ZodOptional<z.ZodArray<z.ZodString>>;
81
+ icon: z.ZodOptional<z.ZodString>;
82
+ root: z.ZodOptional<z.ZodBoolean>;
83
+ defaultOpen: z.ZodOptional<z.ZodBoolean>;
90
84
  };
91
-
92
- export { type SerializableTOC, type TransformOptions, createDocSchema, createMetaSchema, frontmatterSchema, metaSchema, transformMDX };
85
+ //#endregion
86
+ export { SerializableTOC, TransformOptions, createDocSchema, createMetaSchema, frontmatterSchema, metaSchema, transformMDX };
87
+ //# sourceMappingURL=configuration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.d.ts","names":[],"sources":["../src/resolve-plugins.ts","../src/configuration.ts"],"mappings":";;;;;;;;KAEY,cAAA,GAAiB,SAAA,OAAgB,CAAA,EAAG,SAAA,OAAgB,SAAA;;;UCU/C,gBAAA,SAAyB,IAAA,CAAK,OAAA;EAC7C,aAAA,GAAgB,cAAA;EAChB,aAAA,GAAgB,cAAA;EDZuD;;;;;;ECoBvE,sBAAA;EAEA,sBAAA,GAAyB,OAAA,CAAQ,gBAAA;EACjC,oBAAA,GAAuB,OAAA,CAAQ,oBAAA;EAC/B,iBAAA,GAAoB,OAAA,CAAQ,iBAAA;EAC5B,kBAAA,GAAqB,OAAA,CAAQ,kBAAA;EAC7B,oBAAA,GAAuB,OAAA,CAAQ,oBAAA;AAAA;;;;KAMrB,eAAA;EACV,KAAA;EACA,GAAA;EACA,KAAA;AAAA;AAAA,UAGQ,OAAA;EACR,KAAA,EAAO,IAAA;EACP,OAAA;AAAA;;;;;;;KASG,iBAAA,MAAuB,CAAA,gCAEV,CAAA,GAAI,iBAAA,CAAkB,CAAA,CAAE,CAAA,OAEtC,CAAA;AAAA,iBAEkB,YAAA,WAAuB,OAAA,CAAA,CAC3C,QAAA,EAAU,CAAA,EACV,OAAA,EAAS,OAAA,EACT,OAAA,GAAS,gBAAA,GACR,OAAA,CACD,CAAA;EACE,IAAA;EACA,GAAA,EAAK,eAAA;EAvCwB;;;EA2C7B,cAAA,EAAgB,iBAAA,CAAkB,cAAA;AAAA;AAAA,cAmEzB,UAAA,EAAU,CAAA,CAAA,SAAA;;;;;;;;cASV,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;iBAUd,eAAA,CAAgB,CAAA,SAAU,CAAA;;;;;;;iBAW1B,gBAAA,CAAiB,CAAA,SAAU,CAAA"}