@graphql-markdown/formatters 1.0.1 → 1.1.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.
Files changed (52) hide show
  1. package/dist/defaults.d.ts +27 -0
  2. package/dist/defaults.d.ts.map +1 -1
  3. package/dist/defaults.js +34 -1
  4. package/dist/docfx/index.d.ts +3 -7
  5. package/dist/docfx/index.d.ts.map +1 -1
  6. package/dist/docfx/index.js +109 -40
  7. package/dist/docusaurus/index.d.ts +16 -0
  8. package/dist/docusaurus/index.d.ts.map +1 -1
  9. package/dist/docusaurus/index.js +34 -3
  10. package/dist/fumadocs/index.d.ts +13 -3
  11. package/dist/fumadocs/index.d.ts.map +1 -1
  12. package/dist/fumadocs/index.js +19 -9
  13. package/dist/honkit/index.d.ts +3 -1
  14. package/dist/honkit/index.d.ts.map +1 -1
  15. package/dist/honkit/index.js +5 -2
  16. package/dist/hugo/index.d.ts +1 -1
  17. package/dist/hugo/index.d.ts.map +1 -1
  18. package/dist/hugo/index.js +6 -4
  19. package/dist/mdbook/index.d.ts +1 -1
  20. package/dist/mdbook/index.d.ts.map +1 -1
  21. package/dist/mdbook/index.js +7 -9
  22. package/dist/mkdocs/index.d.ts +3 -2
  23. package/dist/mkdocs/index.d.ts.map +1 -1
  24. package/dist/mkdocs/index.js +6 -7
  25. package/dist/output.d.ts +58 -0
  26. package/dist/output.d.ts.map +1 -0
  27. package/dist/output.js +112 -0
  28. package/dist/starlight/index.d.ts +13 -22
  29. package/dist/starlight/index.d.ts.map +1 -1
  30. package/dist/starlight/index.js +14 -34
  31. package/dist/version.d.ts +61 -0
  32. package/dist/version.d.ts.map +1 -0
  33. package/dist/version.js +119 -0
  34. package/dist/vocs/index.d.ts +18 -4
  35. package/dist/vocs/index.d.ts.map +1 -1
  36. package/dist/vocs/index.js +21 -9
  37. package/package.json +192 -192
  38. package/dist/docfx.d.ts +0 -20
  39. package/dist/docfx.d.ts.map +0 -1
  40. package/dist/docfx.js +0 -71
  41. package/dist/docusaurus.d.ts +0 -20
  42. package/dist/docusaurus.d.ts.map +0 -1
  43. package/dist/docusaurus.js +0 -72
  44. package/dist/hugo.d.ts +0 -20
  45. package/dist/hugo.d.ts.map +0 -1
  46. package/dist/hugo.js +0 -68
  47. package/dist/mdbook.d.ts +0 -20
  48. package/dist/mdbook.d.ts.map +0 -1
  49. package/dist/mdbook.js +0 -51
  50. package/dist/mkdocs.d.ts +0 -19
  51. package/dist/mkdocs.d.ts.map +0 -1
  52. package/dist/mkdocs.js +0 -65
@@ -0,0 +1,119 @@
1
+ "use strict";
2
+ /**
3
+ * Helpers for gating formatter output on the target framework version.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.isFrameworkVersionAtLeast = exports.isFrameworkVersion = void 0;
9
+ const VERSION_EXPRESSION = /^\D*(?<major>\d+)(?:\.(?<minor>\d+))?/;
10
+ /**
11
+ * Parses the leading `major[.minor]` of a version string.
12
+ *
13
+ * Any prefix (`v`, `^`, `~`) is ignored, as is anything trailing the minor
14
+ * (patch, prerelease, build metadata).
15
+ *
16
+ * @param version - The version string to parse, eg `"3.10.2"`
17
+ * @returns The parsed version, or `undefined` if the string carries no version
18
+ *
19
+ * @example
20
+ * ```js
21
+ * parseFrameworkVersion("3.10.2"); // { major: 3, minor: 10 }
22
+ * parseFrameworkVersion("next"); // undefined
23
+ * ```
24
+ */
25
+ const parseFrameworkVersion = (version) => {
26
+ const parsed = VERSION_EXPRESSION.exec(version ?? "");
27
+ if (!parsed?.groups) {
28
+ return undefined;
29
+ }
30
+ // an optional group is typed as always present, but is undefined when absent
31
+ return {
32
+ major: Number(parsed.groups.major),
33
+ minor: Number(parsed.groups.minor || 0),
34
+ };
35
+ };
36
+ /**
37
+ * Compares the generator framework version declared in `meta` with `version`.
38
+ *
39
+ * Only the parts carried by `version` are compared, so `{ major: 2 }` matches
40
+ * any `2.x` release.
41
+ *
42
+ * @param meta - Optional metadata carrying the framework name and version
43
+ * @param framework - The expected framework name, eg `"docusaurus"`
44
+ * @param version - The version to compare against
45
+ * @returns A negative number if the framework version is lower, `0` if it
46
+ * matches, a positive number if it is higher, or `undefined` if the framework
47
+ * does not match or carries no parsable version
48
+ */
49
+ const compareFrameworkVersion = (meta, framework, version) => {
50
+ if (meta?.generatorFrameworkName !== framework) {
51
+ return undefined;
52
+ }
53
+ const parsed = parseFrameworkVersion(meta.generatorFrameworkVersion);
54
+ if (!parsed) {
55
+ return undefined;
56
+ }
57
+ if (parsed.major !== version.major) {
58
+ return parsed.major - version.major;
59
+ }
60
+ return typeof version.minor === "number"
61
+ ? (parsed.minor ?? 0) - version.minor
62
+ : 0;
63
+ };
64
+ /**
65
+ * Checks that the generator framework declared in `meta` is `framework`, and
66
+ * that its version matches `version`.
67
+ *
68
+ * Only the parts carried by `version` are compared, so `{ major: 2 }` matches
69
+ * any `2.x` release. An unknown, unparsable or mismatched framework version
70
+ * returns `false`.
71
+ *
72
+ * @param meta - Optional metadata carrying the framework name and version
73
+ * @param framework - The expected framework name, eg `"docusaurus"`
74
+ * @param version - The version to match
75
+ * @returns `true` if the framework and its version match
76
+ *
77
+ * @example
78
+ * ```js
79
+ * const meta = {
80
+ * generatorFrameworkName: "docusaurus",
81
+ * generatorFrameworkVersion: "2.4.3",
82
+ * };
83
+ *
84
+ * isFrameworkVersion(meta, "docusaurus", { major: 2 }); // true
85
+ * isFrameworkVersion(meta, "docusaurus", { major: 3 }); // false
86
+ * ```
87
+ */
88
+ const isFrameworkVersion = (meta, framework, version) => {
89
+ return compareFrameworkVersion(meta, framework, version) === 0;
90
+ };
91
+ exports.isFrameworkVersion = isFrameworkVersion;
92
+ /**
93
+ * Checks that the generator framework declared in `meta` is `framework`, and
94
+ * that its version is `minVersion` or above.
95
+ *
96
+ * An unknown, unparsable or mismatched framework version returns `false`, so
97
+ * callers fall back to the output supported by every version.
98
+ *
99
+ * @param meta - Optional metadata carrying the framework name and version
100
+ * @param framework - The expected framework name, eg `"docusaurus"`
101
+ * @param minVersion - The minimum version required by the caller
102
+ * @returns `true` if the framework matches and its version is high enough
103
+ *
104
+ * @example
105
+ * ```js
106
+ * const meta = {
107
+ * generatorFrameworkName: "docusaurus",
108
+ * generatorFrameworkVersion: "3.10.2",
109
+ * };
110
+ *
111
+ * isFrameworkVersionAtLeast(meta, "docusaurus", { major: 3, minor: 10 }); // true
112
+ * isFrameworkVersionAtLeast(meta, "docusaurus", { major: 4 }); // false
113
+ * ```
114
+ */
115
+ const isFrameworkVersionAtLeast = (meta, framework, minVersion) => {
116
+ const compared = compareFrameworkVersion(meta, framework, minVersion);
117
+ return typeof compared === "number" && compared >= 0;
118
+ };
119
+ exports.isFrameworkVersionAtLeast = isFrameworkVersionAtLeast;
@@ -2,20 +2,34 @@
2
2
  * Vocs formatter for GraphQL documentation output.
3
3
  *
4
4
  * Produces MDX compatible with Vite/Vocs using its native callout syntax
5
- * and Material UI Chip components for badges.
6
5
  *
7
6
  * @packageDocumentation
8
7
  */
9
8
  import type { AdmonitionType, Badge, Formatter, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
9
+ import { formatMDXEscapedPermalink } from "../defaults";
10
+ /**
11
+ * Formats a permalink for a section header, using the classic `{#id}` syntax
12
+ * escaped to remain valid MDX.
13
+ *
14
+ * Vocs has no custom header id syntax, so the permalink is inert unless a
15
+ * remark plugin is configured. Turn it off with
16
+ * `docOptions.sectionHeaderId: false`.
17
+ *
18
+ * @see https://vocs.dev/docs/markdown
19
+ *
20
+ * @param id - The ID of the section header
21
+ * @returns Formatted permalink string
22
+ */
23
+ export declare const formatMDXPermalink: typeof formatMDXEscapedPermalink;
10
24
  /** MDX import statement and inline component definitions prepended to every generated file. */
11
25
  export declare const mdxDeclaration: MDXString;
12
26
  /** File extension used for generated pages. */
13
27
  export declare const mdxExtension: ".mdx";
14
28
  /**
15
- * Formats a badge using the Material UI `<Chip>` component.
16
- * Maps `DEPRECATED` classname to `warning` color; all others use `info`.
29
+ * Formats a badge using Vocs native text directive (`:badge[...]`).
30
+ * Maps `DEPRECATED` classname to `warning` color; all others use default.
17
31
  * @param badge - Badge data containing text and optional classname
18
- * @returns Formatted MUI Chip component string
32
+ * @returns Formatted Vocs badge string
19
33
  */
20
34
  export declare const formatMDXBadge: ({ text, classname }: Badge) => MDXString;
21
35
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vocs/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,SAIf,CAAC;AAEf,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,qBAAgB,SAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAKvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAKF,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAW5D,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vocs/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,SAAS,EACT,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EAEL,yBAAyB,EAG1B,MAAM,aAAa,CAAC;AAErB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,kCAA4B,CAAC;AAE5D,+FAA+F;AAC/F,eAAO,MAAM,cAAc,EAAE,SAEf,CAAC;AAEf,+CAA+C;AAC/C,eAAO,MAAM,YAAY,EAAG,MAAe,CAAC;AAE5C;;;;;GAKG;AACH,eAAO,MAAM,cAAc,wBAAyB,KAAK,KAAG,SAG3D,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAGF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,qBAAgB,SAE3C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,aAAa,kBAAmB,QAAQ,KAAG,QAKvD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAKF,CAAC;AAEF,OAAO,EACL,gBAAgB,EAChB,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAErB;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAY5D,CAAC"}
@@ -3,32 +3,43 @@
3
3
  * Vocs formatter for GraphQL documentation output.
4
4
  *
5
5
  * Produces MDX compatible with Vite/Vocs using its native callout syntax
6
- * and Material UI Chip components for badges.
7
6
  *
8
7
  * @packageDocumentation
9
8
  */
10
9
  Object.defineProperty(exports, "__esModule", { value: true });
11
- exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxExtension = exports.mdxDeclaration = void 0;
10
+ exports.createMDXFormatter = exports.formatMDXSpecifiedByLink = exports.formatMDXFrontmatter = exports.formatMDXDetails = exports.formatMDXNameEntity = exports.formatMDXLink = exports.formatMDXBullet = exports.formatMDXAdmonition = exports.formatMDXBadge = exports.mdxExtension = exports.mdxDeclaration = exports.formatMDXPermalink = void 0;
12
11
  const helpers_1 = require("@graphql-markdown/helpers");
13
12
  const utils_1 = require("@graphql-markdown/utils");
14
13
  const defaults_1 = require("../defaults");
14
+ /**
15
+ * Formats a permalink for a section header, using the classic `{#id}` syntax
16
+ * escaped to remain valid MDX.
17
+ *
18
+ * Vocs has no custom header id syntax, so the permalink is inert unless a
19
+ * remark plugin is configured. Turn it off with
20
+ * `docOptions.sectionHeaderId: false`.
21
+ *
22
+ * @see https://vocs.dev/docs/markdown
23
+ *
24
+ * @param id - The ID of the section header
25
+ * @returns Formatted permalink string
26
+ */
27
+ exports.formatMDXPermalink = defaults_1.formatMDXEscapedPermalink;
15
28
  /** MDX import statement and inline component definitions prepended to every generated file. */
16
29
  exports.mdxDeclaration = `
17
- import Chip from '@mui/material/Chip';
18
-
19
30
  export const Bullet = () => <><span style={{ fontWeight: 'normal', fontSize: '.5em' }}>&nbsp;●&nbsp;</span></>
20
31
  `;
21
32
  /** File extension used for generated pages. */
22
33
  exports.mdxExtension = ".mdx";
23
34
  /**
24
- * Formats a badge using the Material UI `<Chip>` component.
25
- * Maps `DEPRECATED` classname to `warning` color; all others use `info`.
35
+ * Formats a badge using Vocs native text directive (`:badge[...]`).
36
+ * Maps `DEPRECATED` classname to `warning` color; all others use default.
26
37
  * @param badge - Badge data containing text and optional classname
27
- * @returns Formatted MUI Chip component string
38
+ * @returns Formatted Vocs badge string
28
39
  */
29
40
  const formatMDXBadge = ({ text, classname }) => {
30
- const color = classname === "DEPRECATED" ? "warning" : "info";
31
- return `<Chip color="${color}" label="${text}" size="small" variant="outlined"/>`;
41
+ const badgeType = classname === "DEPRECATED" ? "{warning}" : "";
42
+ return `:badge[${text}]${badgeType}`;
32
43
  };
33
44
  exports.formatMDXBadge = formatMDXBadge;
34
45
  /**
@@ -95,6 +106,7 @@ const createMDXFormatter = (_meta) => {
95
106
  formatMDXFrontmatter: defaults_1.formatMDXFrontmatter,
96
107
  formatMDXLink: exports.formatMDXLink,
97
108
  formatMDXNameEntity: exports.formatMDXNameEntity,
109
+ formatMDXPermalink: exports.formatMDXPermalink,
98
110
  formatMDXSpecifiedByLink: defaults_1.formatMDXSpecifiedByLink,
99
111
  };
100
112
  };
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "bugs": {
6
6
  "url": "https://github.com/graphql-markdown/graphql-markdown/issues"
7
7
  },
8
- "version": "1.0.1",
8
+ "version": "1.1.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -35,197 +35,197 @@
35
35
  "exports": {
36
36
  ".": {
37
37
  "require": {
38
- "types": "./dist/index.d.ts",
39
- "default": "./dist/index.js"
38
+ "types": "./dist/index.d.ts",
39
+ "default": "./dist/index.js"
40
+ },
41
+ "import": {
42
+ "types": "./dist/index.d.ts",
43
+ "default": "./dist/index.js"
44
+ },
45
+ "default": {
46
+ "types": "./dist/index.d.ts",
47
+ "default": "./dist/index.js"
48
+ }
40
49
  },
41
- "import": {
42
- "types": "./dist/index.d.ts",
43
- "default": "./dist/index.js"
50
+ "./docusaurus": {
51
+ "require": {
52
+ "types": "./dist/docusaurus/index.d.ts",
53
+ "default": "./dist/docusaurus/index.js"
54
+ },
55
+ "import": {
56
+ "types": "./dist/docusaurus/index.d.ts",
57
+ "default": "./dist/docusaurus/index.js"
58
+ },
59
+ "default": {
60
+ "types": "./dist/docusaurus/index.d.ts",
61
+ "default": "./dist/docusaurus/index.js"
62
+ }
63
+ },
64
+ "./docfx": {
65
+ "require": {
66
+ "types": "./dist/docfx/index.d.ts",
67
+ "default": "./dist/docfx/index.js"
68
+ },
69
+ "import": {
70
+ "types": "./dist/docfx/index.d.ts",
71
+ "default": "./dist/docfx/index.js"
72
+ },
73
+ "default": {
74
+ "types": "./dist/docfx/index.d.ts",
75
+ "default": "./dist/docfx/index.js"
76
+ }
77
+ },
78
+ "./fumadocs": {
79
+ "require": {
80
+ "types": "./dist/fumadocs/index.d.ts",
81
+ "default": "./dist/fumadocs/index.js"
82
+ },
83
+ "import": {
84
+ "types": "./dist/fumadocs/index.d.ts",
85
+ "default": "./dist/fumadocs/index.js"
86
+ },
87
+ "default": {
88
+ "types": "./dist/fumadocs/index.d.ts",
89
+ "default": "./dist/fumadocs/index.js"
90
+ }
91
+ },
92
+ "./honkit": {
93
+ "require": {
94
+ "types": "./dist/honkit/index.d.ts",
95
+ "default": "./dist/honkit/index.js"
96
+ },
97
+ "import": {
98
+ "types": "./dist/honkit/index.d.ts",
99
+ "default": "./dist/honkit/index.js"
100
+ },
101
+ "default": {
102
+ "types": "./dist/honkit/index.d.ts",
103
+ "default": "./dist/honkit/index.js"
104
+ }
105
+ },
106
+ "./hugo": {
107
+ "require": {
108
+ "types": "./dist/hugo/index.d.ts",
109
+ "default": "./dist/hugo/index.js"
110
+ },
111
+ "import": {
112
+ "types": "./dist/hugo/index.d.ts",
113
+ "default": "./dist/hugo/index.js"
114
+ },
115
+ "default": {
116
+ "types": "./dist/hugo/index.d.ts",
117
+ "default": "./dist/hugo/index.js"
118
+ }
119
+ },
120
+ "./mdbook": {
121
+ "require": {
122
+ "types": "./dist/mdbook/index.d.ts",
123
+ "default": "./dist/mdbook/index.js"
124
+ },
125
+ "import": {
126
+ "types": "./dist/mdbook/index.d.ts",
127
+ "default": "./dist/mdbook/index.js"
128
+ },
129
+ "default": {
130
+ "types": "./dist/mdbook/index.d.ts",
131
+ "default": "./dist/mdbook/index.js"
132
+ }
133
+ },
134
+ "./mkdocs": {
135
+ "require": {
136
+ "types": "./dist/mkdocs/index.d.ts",
137
+ "default": "./dist/mkdocs/index.js"
138
+ },
139
+ "import": {
140
+ "types": "./dist/mkdocs/index.d.ts",
141
+ "default": "./dist/mkdocs/index.js"
142
+ },
143
+ "default": {
144
+ "types": "./dist/mkdocs/index.d.ts",
145
+ "default": "./dist/mkdocs/index.js"
146
+ }
147
+ },
148
+ "./starlight": {
149
+ "require": {
150
+ "types": "./dist/starlight/index.d.ts",
151
+ "default": "./dist/starlight/index.js"
152
+ },
153
+ "import": {
154
+ "types": "./dist/starlight/index.d.ts",
155
+ "default": "./dist/starlight/index.js"
156
+ },
157
+ "default": {
158
+ "types": "./dist/starlight/index.d.ts",
159
+ "default": "./dist/starlight/index.js"
160
+ }
161
+ },
162
+ "./vocs": {
163
+ "require": {
164
+ "types": "./dist/vocs/index.d.ts",
165
+ "default": "./dist/vocs/index.js"
166
+ },
167
+ "import": {
168
+ "types": "./dist/vocs/index.d.ts",
169
+ "default": "./dist/vocs/index.js"
170
+ },
171
+ "default": {
172
+ "types": "./dist/vocs/index.d.ts",
173
+ "default": "./dist/vocs/index.js"
174
+ }
175
+ },
176
+ "./defaults": {
177
+ "require": {
178
+ "types": "./dist/defaults.d.ts",
179
+ "default": "./dist/defaults.js"
180
+ },
181
+ "import": {
182
+ "types": "./dist/defaults.d.ts",
183
+ "default": "./dist/defaults.js"
184
+ },
185
+ "default": {
186
+ "types": "./dist/defaults.d.ts",
187
+ "default": "./dist/defaults.js"
188
+ }
189
+ },
190
+ "./package.json": "./package.json"
44
191
  },
45
- "default": {
46
- "types": "./dist/index.d.ts",
47
- "default": "./dist/index.js"
48
- }
49
- },
50
- "./docusaurus": {
51
- "require": {
52
- "types": "./dist/docusaurus/index.d.ts",
53
- "default": "./dist/docusaurus/index.js"
54
- },
55
- "import": {
56
- "types": "./dist/docusaurus/index.d.ts",
57
- "default": "./dist/docusaurus/index.js"
58
- },
59
- "default": {
60
- "types": "./dist/docusaurus/index.d.ts",
61
- "default": "./dist/docusaurus/index.js"
62
- }
63
- },
64
- "./docfx": {
65
- "require": {
66
- "types": "./dist/docfx/index.d.ts",
67
- "default": "./dist/docfx/index.js"
68
- },
69
- "import": {
70
- "types": "./dist/docfx/index.d.ts",
71
- "default": "./dist/docfx/index.js"
72
- },
73
- "default": {
74
- "types": "./dist/docfx/index.d.ts",
75
- "default": "./dist/docfx/index.js"
76
- }
77
- },
78
- "./fumadocs": {
79
- "require": {
80
- "types": "./dist/fumadocs/index.d.ts",
81
- "default": "./dist/fumadocs/index.js"
82
- },
83
- "import": {
84
- "types": "./dist/fumadocs/index.d.ts",
85
- "default": "./dist/fumadocs/index.js"
86
- },
87
- "default": {
88
- "types": "./dist/fumadocs/index.d.ts",
89
- "default": "./dist/fumadocs/index.js"
90
- }
91
- },
92
- "./honkit": {
93
- "require": {
94
- "types": "./dist/honkit/index.d.ts",
95
- "default": "./dist/honkit/index.js"
96
- },
97
- "import": {
98
- "types": "./dist/honkit/index.d.ts",
99
- "default": "./dist/honkit/index.js"
100
- },
101
- "default": {
102
- "types": "./dist/honkit/index.d.ts",
103
- "default": "./dist/honkit/index.js"
104
- }
105
- },
106
- "./hugo": {
107
- "require": {
108
- "types": "./dist/hugo/index.d.ts",
109
- "default": "./dist/hugo/index.js"
110
- },
111
- "import": {
112
- "types": "./dist/hugo/index.d.ts",
113
- "default": "./dist/hugo/index.js"
114
- },
115
- "default": {
116
- "types": "./dist/hugo/index.d.ts",
117
- "default": "./dist/hugo/index.js"
118
- }
119
- },
120
- "./mdbook": {
121
- "require": {
122
- "types": "./dist/mdbook/index.d.ts",
123
- "default": "./dist/mdbook/index.js"
124
- },
125
- "import": {
126
- "types": "./dist/mdbook/index.d.ts",
127
- "default": "./dist/mdbook/index.js"
128
- },
129
- "default": {
130
- "types": "./dist/mdbook/index.d.ts",
131
- "default": "./dist/mdbook/index.js"
132
- }
133
- },
134
- "./mkdocs": {
135
- "require": {
136
- "types": "./dist/mkdocs/index.d.ts",
137
- "default": "./dist/mkdocs/index.js"
138
- },
139
- "import": {
140
- "types": "./dist/mkdocs/index.d.ts",
141
- "default": "./dist/mkdocs/index.js"
142
- },
143
- "default": {
144
- "types": "./dist/mkdocs/index.d.ts",
145
- "default": "./dist/mkdocs/index.js"
146
- }
147
- },
148
- "./starlight": {
149
- "require": {
150
- "types": "./dist/starlight/index.d.ts",
151
- "default": "./dist/starlight/index.js"
152
- },
153
- "import": {
154
- "types": "./dist/starlight/index.d.ts",
155
- "default": "./dist/starlight/index.js"
156
- },
157
- "default": {
158
- "types": "./dist/starlight/index.d.ts",
159
- "default": "./dist/starlight/index.js"
160
- }
161
- },
162
- "./vocs": {
163
- "require": {
164
- "types": "./dist/vocs/index.d.ts",
165
- "default": "./dist/vocs/index.js"
166
- },
167
- "import": {
168
- "types": "./dist/vocs/index.d.ts",
169
- "default": "./dist/vocs/index.js"
170
- },
171
- "default": {
172
- "types": "./dist/vocs/index.d.ts",
173
- "default": "./dist/vocs/index.js"
174
- }
175
- },
176
- "./defaults": {
177
- "require": {
178
- "types": "./dist/defaults.d.ts",
179
- "default": "./dist/defaults.js"
180
- },
181
- "import": {
182
- "types": "./dist/defaults.d.ts",
183
- "default": "./dist/defaults.js"
184
- },
185
- "default": {
186
- "types": "./dist/defaults.d.ts",
187
- "default": "./dist/defaults.js"
188
- }
189
- },
190
- "./package.json": "./package.json"
191
- },
192
- "scripts": {
193
- "stryker": "stryker run",
194
- "clean": "tsgo --build --clean && rm -rf ./dist",
195
- "docs": "typedoc --options typedoc.config.mjs",
196
- "build": "tsgo --build",
197
- "lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
198
- "lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
199
- "prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --check",
200
- "prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --write",
201
- "ts:check": "tsgo --noEmit",
202
- "test": "jest",
203
- "test:unit": "jest --passWithNoTests --testPathPatterns=tests/unit",
204
- "test:integration": "jest --passWithNoTests --testPathPatterns=tests/integration",
205
- "test:ci": "jest --passWithNoTests --ci --silent --randomize --runInBand",
206
- "test:watch": "jest --watch"
207
- },
208
- "dependencies": {
209
- "@graphql-markdown/helpers": "",
210
- "@graphql-markdown/types": "",
211
- "@graphql-markdown/utils": ""
212
- },
213
- "devDependencies": {
214
- "@graphql-markdown/tooling-config": ""
215
- },
216
- "directories": {
217
- "test": "tests"
218
- },
219
- "engines": {
220
- "node": ">=22.12.0"
221
- },
222
- "publishConfig": {
223
- "access": "public"
224
- },
225
- "typescript": {
226
- "definition": "dist/index.d.ts"
227
- },
228
- "files": [
229
- "dist"
230
- ]
192
+ "scripts": {
193
+ "stryker": "stryker run",
194
+ "clean": "tsgo --build --clean && rm -rf ./dist",
195
+ "docs": "typedoc --options typedoc.config.mjs",
196
+ "build": "tsgo --build",
197
+ "lint": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\"",
198
+ "lint:fix": "eslint --config ../../packages/tooling-config/eslint/config.ts \"{src,tests}/**/*.{ts,js,json,gql}\" --fix",
199
+ "prettier": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --check",
200
+ "prettier:fix": "prettier \"{src,tests}/**/*.{ts,js,json,md,gql}\" --write",
201
+ "ts:check": "tsgo --noEmit",
202
+ "test": "vitest run --passWithNoTests",
203
+ "test:unit": "vitest run --passWithNoTests tests/unit",
204
+ "test:integration": "vitest run --passWithNoTests tests/integration",
205
+ "test:ci": "vitest run --passWithNoTests --silent --sequence.shuffle",
206
+ "test:watch": "vitest --watch"
207
+ },
208
+ "dependencies": {
209
+ "@graphql-markdown/helpers": "",
210
+ "@graphql-markdown/types": "",
211
+ "@graphql-markdown/utils": ""
212
+ },
213
+ "devDependencies": {
214
+ "@graphql-markdown/tooling-config": ""
215
+ },
216
+ "directories": {
217
+ "test": "tests"
218
+ },
219
+ "engines": {
220
+ "node": ">=22.12.0"
221
+ },
222
+ "publishConfig": {
223
+ "access": "public"
224
+ },
225
+ "typescript": {
226
+ "definition": "dist/index.d.ts"
227
+ },
228
+ "files": [
229
+ "dist"
230
+ ]
231
231
  }
package/dist/docfx.d.ts DELETED
@@ -1,20 +0,0 @@
1
- /**
2
- * DocFX formatter for GraphQL documentation output.
3
- *
4
- * Produces Markdown compatible with Microsoft DocFX.
5
- * Uses DocFX alert syntax for admonitions and injects the required
6
- * `uid` front matter field for cross-reference resolution.
7
- *
8
- * @packageDocumentation
9
- */
10
- import type { AdmonitionType, Badge, CollapsibleOption, Formatter, FrontMatterOptions, Maybe, MDXString, MetaInfo, TypeLink } from "@graphql-markdown/types";
11
- export declare const formatMDXBadge: ({ text }: Badge) => MDXString;
12
- export declare const formatMDXAdmonition: ({ text, title, type }: AdmonitionType, _meta: Maybe<MetaInfo>) => MDXString;
13
- export declare const formatMDXBullet: (text?: string) => MDXString;
14
- export declare const formatMDXDetails: ({ dataOpen, dataClose, }: CollapsibleOption) => MDXString;
15
- export declare const formatMDXFrontmatter: (props: Maybe<FrontMatterOptions>, formatted: Maybe<string[]>) => MDXString;
16
- export declare const formatMDXLink: (link: TypeLink) => TypeLink;
17
- export declare const formatMDXNameEntity: (name: string, parentType?: Maybe<string>) => MDXString;
18
- export declare const formatMDXSpecifiedByLink: (url: string) => MDXString;
19
- export declare const createMDXFormatter: (_meta?: Maybe<MetaInfo>) => Formatter;
20
- //# sourceMappingURL=docfx.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"docfx.d.ts","sourceRoot":"","sources":["../src/docfx.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,SAAS,EACT,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AAyBjC,eAAO,MAAM,cAAc,aAAc,KAAK,KAAG,SACwB,CAAC;AAE1E,eAAO,MAAM,mBAAmB,0BACP,cAAc,SAC9B,KAAK,CAAC,QAAQ,CAAC,KACrB,SAIF,CAAC;AAEF,eAAO,MAAM,eAAe,qBAAgB,SACR,CAAC;AAErC,eAAO,MAAM,gBAAgB,6BAG1B,iBAAiB,KAAG,SAC0L,CAAC;AAElN,eAAO,MAAM,oBAAoB,UACxB,KAAK,CAAC,kBAAkB,CAAC,aACrB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAaF,CAAC;AAEF,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAAgB,CAAC;AAEhE,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAGF,CAAC;AAEF,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SACb,CAAC;AAE3C,eAAO,MAAM,kBAAkB,WAAY,KAAK,CAAC,QAAQ,CAAC,KAAG,SAS3D,CAAC"}