@graphql-markdown/printer-legacy 1.15.0 → 1.16.1

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 (58) hide show
  1. package/dist/badge.d.ts +10 -3
  2. package/dist/badge.d.ts.map +1 -1
  3. package/dist/badge.js +21 -9
  4. package/dist/code.d.ts +1 -1
  5. package/dist/code.d.ts.map +1 -1
  6. package/dist/common.d.ts +5 -13
  7. package/dist/common.d.ts.map +1 -1
  8. package/dist/common.js +11 -6
  9. package/dist/const/options.d.ts +4 -8
  10. package/dist/const/options.d.ts.map +1 -1
  11. package/dist/const/options.js +17 -13
  12. package/dist/const/strings.d.ts +1 -3
  13. package/dist/const/strings.d.ts.map +1 -1
  14. package/dist/const/strings.js +4 -6
  15. package/dist/directive.d.ts +1 -1
  16. package/dist/directive.d.ts.map +1 -1
  17. package/dist/directive.js +5 -8
  18. package/dist/example.d.ts.map +1 -1
  19. package/dist/example.js +2 -0
  20. package/dist/format-helpers.d.ts.map +1 -1
  21. package/dist/formatter.d.ts.map +1 -1
  22. package/dist/formatter.js +9 -30
  23. package/dist/frontmatter.d.ts.map +1 -1
  24. package/dist/graphql/directive.d.ts +1 -1
  25. package/dist/graphql/directive.d.ts.map +1 -1
  26. package/dist/graphql/enum.d.ts +1 -1
  27. package/dist/graphql/enum.d.ts.map +1 -1
  28. package/dist/graphql/input.d.ts.map +1 -1
  29. package/dist/graphql/input.js +1 -1
  30. package/dist/graphql/interface.d.ts.map +1 -1
  31. package/dist/graphql/interface.js +1 -1
  32. package/dist/graphql/object.d.ts.map +1 -1
  33. package/dist/graphql/operation.d.ts +1 -8
  34. package/dist/graphql/operation.d.ts.map +1 -1
  35. package/dist/graphql/operation.js +2 -3
  36. package/dist/graphql/scalar.d.ts +1 -1
  37. package/dist/graphql/scalar.d.ts.map +1 -1
  38. package/dist/graphql/scalar.js +2 -0
  39. package/dist/graphql/union.d.ts +1 -1
  40. package/dist/graphql/union.d.ts.map +1 -1
  41. package/dist/group.d.ts +2 -2
  42. package/dist/group.d.ts.map +1 -1
  43. package/dist/index.js +2 -2
  44. package/dist/link.d.ts +5 -13
  45. package/dist/link.d.ts.map +1 -1
  46. package/dist/link.js +14 -3
  47. package/dist/mdx/index.d.ts +1 -1
  48. package/dist/mdx/index.d.ts.map +1 -1
  49. package/dist/printer.d.ts +10 -35
  50. package/dist/printer.d.ts.map +1 -1
  51. package/dist/printer.js +29 -64
  52. package/dist/relation.d.ts +2 -2
  53. package/dist/relation.d.ts.map +1 -1
  54. package/dist/relation.js +4 -0
  55. package/dist/section.d.ts +2 -2
  56. package/dist/section.d.ts.map +1 -1
  57. package/dist/section.js +4 -0
  58. package/package.json +7 -6
package/dist/badge.d.ts CHANGED
@@ -4,7 +4,7 @@
4
4
  * and their properties like deprecation status, nullability, and relationships.
5
5
  * @module
6
6
  */
7
- import type { Badge, MDXString, Maybe, PrintTypeOptions, SchemaEntity } from "@graphql-markdown/types";
7
+ import type { Badge, MDXString, Maybe, PrintTypeOptions, SchemaEntitiesGroupMap } from "@graphql-markdown/types";
8
8
  export declare const CSS_BADGE_CLASSNAME: {
9
9
  DEPRECATED: string;
10
10
  RELATION: string;
@@ -16,7 +16,7 @@ export declare const CSS_BADGE_CLASSNAME: {
16
16
  * @param groups - Optional map of schema entities to their groups
17
17
  * @returns Array of Badge objects containing text and optional classnames
18
18
  */
19
- export declare const getTypeBadges: (type: unknown, groups?: Maybe<Partial<Record<SchemaEntity, Record<string, Maybe<string>>>>>) => Badge[];
19
+ export declare const getTypeBadges: (type: unknown, groups?: Maybe<SchemaEntitiesGroupMap>) => Badge[];
20
20
  /**
21
21
  * Formats a single badge into MDX string format.
22
22
  * @param badge - The badge object containing text and optional classname
@@ -24,11 +24,18 @@ export declare const getTypeBadges: (type: unknown, groups?: Maybe<Partial<Recor
24
24
  * @returns Formatted MDX string representation of the badge
25
25
  */
26
26
  export declare const printBadge: ({ text, classname }: Badge, options: PrintTypeOptions) => MDXString;
27
+ /**
28
+ * Formats an array of badges into a space-joined MDX string.
29
+ * @param badges - Array of badge objects to format
30
+ * @param options - Options containing the formatter for badges
31
+ * @returns Space-joined MDX string of all badges, or empty string if none
32
+ */
33
+ export declare const formatBadges: (badges: Badge[], options: PrintTypeOptions) => MDXString | string;
27
34
  /**
28
35
  * Generates and formats all applicable badges for a GraphQL type.
29
36
  * @param type - The GraphQL type to generate badges for
30
37
  * @param options - Options for printing/formatting the badges
31
38
  * @returns Formatted MDX string containing all badges, or empty string if no badges or badges disabled
32
39
  */
33
- export declare const printBadges: (type: unknown, options: PrintTypeOptions) => string | MDXString;
40
+ export declare const printBadges: (type: unknown, options: PrintTypeOptions) => MDXString | string;
34
41
  //# sourceMappingURL=badge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../src/badge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,KAAK,EAEL,SAAS,EACT,KAAK,EACL,gBAAgB,EAEhB,YAAY,EACb,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,0GA6CzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,sEActB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,kEAsBvB,CAAC"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../src/badge.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,KAAK,EAEL,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,sBAAsB,EAEvB,MAAM,yBAAyB,CAAC;AAgBjC,eAAO,MAAM,mBAAmB;IAC9B,UAAU;IACV,QAAQ;IACR,QAAQ;CACT,CAAC;AAEF;;;;;GAKG;AAGH,eAAO,MAAM,aAAa,SAClB,OAAO,WACJ,KAAK,CAAC,sBAAsB,CAAC,KACrC,KAAK,EA0CP,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,wBACA,KAAK,WACjB,gBAAgB,KACxB,SAWF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,WACf,KAAK,EAAE,WACN,gBAAgB,KACxB,SAAS,GAAG,MASd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,SAChB,OAAO,WACJ,gBAAgB,KACxB,SAAS,GAAG,MAUd,CAAC"}
package/dist/badge.js CHANGED
@@ -6,7 +6,7 @@
6
6
  * @module
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.printBadges = exports.printBadge = exports.getTypeBadges = exports.CSS_BADGE_CLASSNAME = void 0;
9
+ exports.printBadges = exports.formatBadges = exports.printBadge = exports.getTypeBadges = exports.CSS_BADGE_CLASSNAME = void 0;
10
10
  const utils_1 = require("@graphql-markdown/utils");
11
11
  const graphql_1 = require("@graphql-markdown/graphql");
12
12
  const link_1 = require("./link");
@@ -24,6 +24,8 @@ exports.CSS_BADGE_CLASSNAME = {
24
24
  * @param groups - Optional map of schema entities to their groups
25
25
  * @returns Array of Badge objects containing text and optional classnames
26
26
  */
27
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
28
+ // fallow-ignore-next-line unused-export
27
29
  const getTypeBadges = (type, groups) => {
28
30
  if (typeof type !== "object" || type === null) {
29
31
  return [];
@@ -76,6 +78,23 @@ const printBadge = ({ text, classname }, options) => {
76
78
  return (0, formatter_1.createDefaultFormatter)().formatMDXBadge(badge);
77
79
  };
78
80
  exports.printBadge = printBadge;
81
+ /**
82
+ * Formats an array of badges into a space-joined MDX string.
83
+ * @param badges - Array of badge objects to format
84
+ * @param options - Options containing the formatter for badges
85
+ * @returns Space-joined MDX string of all badges, or empty string if none
86
+ */
87
+ const formatBadges = (badges, options) => {
88
+ if (badges.length === 0) {
89
+ return "";
90
+ }
91
+ return badges
92
+ .map((badge) => {
93
+ return (0, exports.printBadge)(badge, options);
94
+ })
95
+ .join(" ");
96
+ };
97
+ exports.formatBadges = formatBadges;
79
98
  /**
80
99
  * Generates and formats all applicable badges for a GraphQL type.
81
100
  * @param type - The GraphQL type to generate badges for
@@ -88,13 +107,6 @@ const printBadges = (type, options) => {
88
107
  !options.typeBadges) {
89
108
  return "";
90
109
  }
91
- const badges = (0, exports.getTypeBadges)(type, options.groups);
92
- if (badges.length === 0) {
93
- return "";
94
- }
95
- const formattedBadges = badges.map((badge) => {
96
- return (0, exports.printBadge)(badge, options);
97
- });
98
- return formattedBadges.join(" ");
110
+ return (0, exports.formatBadges)((0, exports.getTypeBadges)(type, options.groups), options);
99
111
  };
100
112
  exports.printBadges = printBadges;
package/dist/code.d.ts CHANGED
@@ -38,5 +38,5 @@ export declare const printCodeArguments: (type: unknown, indentationLevel?: numb
38
38
  * // ): User!
39
39
  * ```
40
40
  */
41
- export declare const printCodeField: (type: unknown, options?: PrintTypeOptions | undefined, indentationLevel?: number) => string | MDXString;
41
+ export declare const printCodeField: (type: unknown, options?: PrintTypeOptions, indentationLevel?: number) => MDXString | string;
42
42
  //# sourceMappingURL=code.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAiB3E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,sDA4B9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,0GAwB1B,CAAC"}
1
+ {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["../src/code.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAiB3E;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,qBACK,MAAM,KACvB,MAyBF,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,YACH,gBAAgB,qBACR,MAAM,KACvB,SAAS,GAAG,MAoBd,CAAC"}
package/dist/common.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Common printer utility functions for handling descriptions, directives, and warnings.
3
3
  * @module
4
4
  */
5
- import type { Maybe, MDXString, PrintTypeOptions } from "@graphql-markdown/types";
5
+ import type { MDXString, PrintTypeOptions } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Prints documentation for custom directives applied to a type.
8
8
  *
@@ -10,15 +10,7 @@ import type { Maybe, MDXString, PrintTypeOptions } from "@graphql-markdown/types
10
10
  * @param options - Printer configuration options
11
11
  * @returns Formatted directive documentation string
12
12
  */
13
- export declare const printCustomDirectives: (type: unknown, options?: PrintTypeOptions | undefined) => string;
14
- /**
15
- * Formats a GraphQL type description or falls back to a default message.
16
- *
17
- * @param type - GraphQL type to get description from
18
- * @param replacement - Optional fallback text if no description exists
19
- * @returns Formatted description string or MDX content
20
- */
21
- export declare const formatDescription: (type: unknown, replacement?: Maybe<string>) => string | MDXString;
13
+ export declare const getCustomDirectivesText: (type: unknown, options?: PrintTypeOptions) => string;
22
14
  /**
23
15
  * Generates a warning message block in MDX format.
24
16
  * @param warningConfig - Warning configuration object with `text` and optional `title` properties
@@ -26,8 +18,8 @@ export declare const formatDescription: (type: unknown, replacement?: Maybe<stri
26
18
  * @returns Formatted warning message as MDX string
27
19
  */
28
20
  export declare const printWarning: ({ text, title }: {
29
- text?: string | undefined;
30
- title?: string | undefined;
21
+ text?: string;
22
+ title?: string;
31
23
  }, options: PrintTypeOptions) => string;
32
24
  /**
33
25
  * Prints deprecation information for a GraphQL type if it is deprecated.
@@ -43,5 +35,5 @@ export declare const printDeprecation: (type: unknown, options: PrintTypeOptions
43
35
  * @param noText - Optional text to display when no description exists
44
36
  * @returns Combined description, deprecation notices, and custom directives as MDX content
45
37
  */
46
- export declare const printDescription: (type: unknown, options: PrintTypeOptions, noText?: string | undefined) => string | MDXString;
38
+ export declare const printDescription: (type: unknown, options: PrintTypeOptions, noText?: string) => MDXString | string;
47
39
  //# sourceMappingURL=common.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAGV,KAAK,EACL,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAcjC;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,mEA+BjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,oEAY7B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,YAAY;;;uCAaxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,sDAiB5B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,+FAS5B,CAAC"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../src/common.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAIV,SAAS,EACT,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAcjC;;;;;;GAMG;AAGH,eAAO,MAAM,uBAAuB,SAC5B,OAAO,YACH,gBAAgB,KACzB,MA4BF,CAAC;AAuBF;;;;;GAKG;AAGH,eAAO,MAAM,YAAY,oBACN;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,WACzC,gBAAgB,KACxB,MAUF,CAAC;AAEF;;;;;GAKG;AAGH,eAAO,MAAM,gBAAgB,SACrB,OAAO,WACJ,gBAAgB,KACxB,MAcF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,SACrB,OAAO,WACJ,gBAAgB,WAChB,MAAM,KACd,SAAS,GAAG,MAKd,CAAC"}
package/dist/common.js CHANGED
@@ -4,7 +4,7 @@
4
4
  * @module
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.printDescription = exports.printDeprecation = exports.printWarning = exports.formatDescription = exports.printCustomDirectives = void 0;
7
+ exports.printDescription = exports.printDeprecation = exports.printWarning = exports.getCustomDirectivesText = void 0;
8
8
  const utils_1 = require("@graphql-markdown/utils");
9
9
  const graphql_1 = require("@graphql-markdown/graphql");
10
10
  const strings_1 = require("./const/strings");
@@ -16,7 +16,9 @@ const directive_1 = require("./directive");
16
16
  * @param options - Printer configuration options
17
17
  * @returns Formatted directive documentation string
18
18
  */
19
- const printCustomDirectives = (type, options) => {
19
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
20
+ // fallow-ignore-next-line unused-export
21
+ const getCustomDirectivesText = (type, options) => {
20
22
  const constDirectiveMap = (0, graphql_1.getConstDirectiveMap)(type, options?.customDirectives);
21
23
  if ((0, utils_1.isEmpty)(constDirectiveMap)) {
22
24
  return "";
@@ -34,7 +36,7 @@ const printCustomDirectives = (type, options) => {
34
36
  .join(strings_1.MARKDOWN_EOP);
35
37
  return `${strings_1.MARKDOWN_EOP}${content}`;
36
38
  };
37
- exports.printCustomDirectives = printCustomDirectives;
39
+ exports.getCustomDirectivesText = getCustomDirectivesText;
38
40
  /**
39
41
  * Formats a GraphQL type description or falls back to a default message.
40
42
  *
@@ -51,13 +53,14 @@ const formatDescription = (type, replacement = strings_1.NO_DESCRIPTION_TEXT) =>
51
53
  : replacement;
52
54
  return `${strings_1.MARKDOWN_EOP}${(0, utils_1.escapeMDX)(description)}`;
53
55
  };
54
- exports.formatDescription = formatDescription;
55
56
  /**
56
57
  * Generates a warning message block in MDX format.
57
58
  * @param warningConfig - Warning configuration object with `text` and optional `title` properties
58
59
  * @param options - Configuration options for printing
59
60
  * @returns Formatted warning message as MDX string
60
61
  */
62
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
63
+ // fallow-ignore-next-line unused-export
61
64
  const printWarning = ({ text, title }, options) => {
62
65
  const formattedText = typeof text !== "string" || text.trim() === ""
63
66
  ? strings_1.MARKDOWN_EOP
@@ -71,6 +74,8 @@ exports.printWarning = printWarning;
71
74
  * @param options - Configuration options for printing
72
75
  * @returns Formatted deprecation warning as MDX string, or empty string if not deprecated
73
76
  */
77
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
78
+ // fallow-ignore-next-line unused-export
74
79
  const printDeprecation = (type, options) => {
75
80
  if (typeof type !== "object" || type === null || !(0, graphql_1.isDeprecated)(type)) {
76
81
  return "";
@@ -89,8 +94,8 @@ exports.printDeprecation = printDeprecation;
89
94
  * @returns Combined description, deprecation notices, and custom directives as MDX content
90
95
  */
91
96
  const printDescription = (type, options, noText) => {
92
- const description = (0, exports.formatDescription)(type, noText);
93
- const customDirectives = (0, exports.printCustomDirectives)(type, options);
97
+ const description = formatDescription(type, noText);
98
+ const customDirectives = (0, exports.getCustomDirectivesText)(type, options);
94
99
  const deprecation = (0, exports.printDeprecation)(type, options);
95
100
  return `${deprecation}${description}${customDirectives}`;
96
101
  };
@@ -5,23 +5,19 @@ export declare enum TypeHierarchy {
5
5
  FLAT = "flat"
6
6
  }
7
7
  export declare enum SectionLevels {
8
+ /**
9
+ * @deprecated Use `SectionLevels.LEVEL` instead.
10
+ */
8
11
  NONE = "",
9
12
  LEVEL = "#"
10
13
  }
11
- export declare const PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS: {
12
- codeSection: true;
13
- exampleSection: false;
14
- relatedTypeSection: true;
15
- };
16
14
  export declare const PRINT_TYPE_DEFAULT_OPTIONS: Required<Omit<PrinterConfigPrintTypeOptions, "exampleSection">> & {
17
15
  exampleSection: PrintTypeOptions["exampleSection"];
18
16
  };
19
17
  /**
20
18
  * Clean runtime options passed through the printer.
21
- *
22
- * Deprecated section toggles are excluded and handled via backward-compat paths.
23
19
  */
24
- export declare const DEFAULT_OPTIONS: Required<Omit<PrintTypeOptions, "afterDiffCheckHook" | "afterGenerateIndexMetafileHook" | "afterRenderHomepageHook" | "afterRenderRootTypesHook" | "afterRenderTypeEntitiesHook" | "afterSchemaLoadHook" | "beforeDiffCheckHook" | "beforeGenerateIndexMetafileHook" | "beforeRenderHomepageHook" | "beforeRenderRootTypesHook" | "beforeRenderTypeEntitiesHook" | "beforeSchemaLoadHook" | "collapsible" | "exampleSection" | "formatCategoryFolderName" | "groups" | "level" | "meta" | "onlyDocDirectives" | "parentType" | "schema" | "skipDocDirectives">> & {
20
+ export declare const DEFAULT_OPTIONS: Required<Omit<PrintTypeOptions, "collapsible" | "exampleSection" | "formatCategoryFolderName" | "groups" | "level" | "meta" | "onlyDocDirectives" | "parentType" | "schema" | "skipDocDirectives">> & {
25
21
  collapsible: Maybe<CollapsibleOption>;
26
22
  exampleSection: PrintTypeOptions["exampleSection"];
27
23
  groups: Maybe<SchemaEntitiesGroupMap>;
@@ -1 +1 @@
1
- {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/const/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EAGjB,gBAAgB,EAChB,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAIjC,oBAAY,aAAa;IACvB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,aAAa;IACvB,IAAI,KAAK;IACT,KAAK,MAAM;CACZ;AAED,eAAO,MAAM,qCAAqC;;;;CAOjD,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAC/C,IAAI,CAAC,6BAA6B,EAAE,gBAAgB,CAAC,CACtD,GAAG;IACF,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;CAQpD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CACpC,IAAI,CACF,gBAAgB,EACd,oBAAoB,GACpB,gCAAgC,GAChC,yBAAyB,GACzB,0BAA0B,GAC1B,6BAA6B,GAC7B,qBAAqB,GACrB,qBAAqB,GACrB,iCAAiC,GACjC,0BAA0B,GAC1B,2BAA2B,GAC3B,8BAA8B,GAC9B,sBAAsB,GACtB,aAAa,GACb,gBAAgB,GAChB,0BAA0B,GAC1B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,mBAAmB,GACnB,YAAY,GACZ,QAAQ,GACR,mBAAmB,CACtB,CACF,GAAG;IACF,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACtC,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CAsBvC,CAAC"}
1
+ {"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../src/const/options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,KAAK,EACL,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,yBAAyB,CAAC;AAajC,oBAAY,aAAa;IACvB,GAAG,QAAQ;IAGX,MAAM,WAAW;IACjB,IAAI,SAAS;CACd;AAED,oBAAY,aAAa;IACvB;;OAEG;IAGH,IAAI,KAAK;IACT,KAAK,MAAM;CACZ;AAED,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAC/C,IAAI,CAAC,6BAA6B,EAAE,gBAAgB,CAAC,CACtD,GAAG;IACF,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;CAQpD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CACpC,IAAI,CACF,gBAAgB,EACd,aAAa,GACb,gBAAgB,GAChB,0BAA0B,GAC1B,QAAQ,GACR,OAAO,GACP,MAAM,GACN,mBAAmB,GACnB,YAAY,GACZ,QAAQ,GACR,mBAAmB,CACtB,CACF,GAAG;IACF,WAAW,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACtC,cAAc,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACnD,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,CAAC;IACtC,KAAK,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChC,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IACtC,UAAU,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC1B,MAAM,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;IAC7B,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;CA6BvC,CAAC"}
@@ -1,26 +1,25 @@
1
1
  "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
2
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.DEFAULT_OPTIONS = exports.PRINT_TYPE_DEFAULT_OPTIONS = exports.PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS = exports.SectionLevels = exports.TypeHierarchy = void 0;
7
- const mdx_1 = __importDefault(require("../mdx"));
3
+ exports.DEFAULT_OPTIONS = exports.PRINT_TYPE_DEFAULT_OPTIONS = exports.SectionLevels = exports.TypeHierarchy = void 0;
4
+ const defaults_1 = require("@graphql-markdown/formatters/defaults");
8
5
  var TypeHierarchy;
9
6
  (function (TypeHierarchy) {
10
7
  TypeHierarchy["API"] = "api";
8
+ // Used only by unit tests for direct whitebox coverage.
9
+ // fallow-ignore-next-line unused-enum-member
11
10
  TypeHierarchy["ENTITY"] = "entity";
12
11
  TypeHierarchy["FLAT"] = "flat";
13
12
  })(TypeHierarchy || (exports.TypeHierarchy = TypeHierarchy = {}));
14
13
  var SectionLevels;
15
14
  (function (SectionLevels) {
15
+ /**
16
+ * @deprecated Use `SectionLevels.LEVEL` instead.
17
+ */
18
+ // Reserved for future usage.
19
+ // fallow-ignore-next-line unused-enum-member
16
20
  SectionLevels["NONE"] = "";
17
21
  SectionLevels["LEVEL"] = "#";
18
22
  })(SectionLevels || (exports.SectionLevels = SectionLevels = {}));
19
- exports.PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS = {
20
- codeSection: true,
21
- exampleSection: false,
22
- relatedTypeSection: true,
23
- };
24
23
  exports.PRINT_TYPE_DEFAULT_OPTIONS = {
25
24
  deprecated: "default",
26
25
  exampleSection: undefined,
@@ -31,8 +30,6 @@ exports.PRINT_TYPE_DEFAULT_OPTIONS = {
31
30
  };
32
31
  /**
33
32
  * Clean runtime options passed through the printer.
34
- *
35
- * Deprecated section toggles are excluded and handled via backward-compat paths.
36
33
  */
37
34
  exports.DEFAULT_OPTIONS = {
38
35
  deprecated: exports.PRINT_TYPE_DEFAULT_OPTIONS.deprecated,
@@ -54,5 +51,12 @@ exports.DEFAULT_OPTIONS = {
54
51
  withAttributes: false,
55
52
  sectionHeaderId: true,
56
53
  hierarchy: exports.PRINT_TYPE_DEFAULT_OPTIONS.hierarchy,
57
- ...mdx_1.default,
54
+ formatMDXAdmonition: defaults_1.formatMDXAdmonition,
55
+ formatMDXBadge: defaults_1.formatMDXBadge,
56
+ formatMDXBullet: defaults_1.formatMDXBullet,
57
+ formatMDXDetails: defaults_1.formatMDXDetails,
58
+ formatMDXFrontmatter: defaults_1.formatMDXFrontmatter,
59
+ formatMDXLink: defaults_1.formatMDXLink,
60
+ formatMDXNameEntity: defaults_1.formatMDXNameEntity,
61
+ formatMDXSpecifiedByLink: defaults_1.formatMDXSpecifiedByLink,
58
62
  };
@@ -5,7 +5,7 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  import type { RootTypeLocale } from "@graphql-markdown/types";
8
- export { FRONT_MATTER_DELIMITER, MARKDOWN_CODE_INDENTATION, MARKDOWN_CODE_SNIPPET, MARKDOWN_EOL, MARKDOWN_EOP, } from "@graphql-markdown/utils";
8
+ export { MARKDOWN_CODE_INDENTATION, MARKDOWN_EOL, MARKDOWN_EOP, } from "@graphql-markdown/utils";
9
9
  /**
10
10
  * Human-readable labels for each GraphQL root type used when rendering copy or badges.
11
11
  */
@@ -14,8 +14,6 @@ export declare const ROOT_TYPE_LOCALE: RootTypeLocale;
14
14
  export declare const DEPRECATED: "deprecated";
15
15
  /** Copy fragment describing a non-null GraphQL modifier. */
16
16
  export declare const NON_NULL: "non-null";
17
- /** Short identifier for the GraphQL language tag used in fenced blocks. */
18
- export declare const GRAPHQL: "graphql";
19
17
  /** Default placeholder when no schema description is provided. */
20
18
  export declare const NO_DESCRIPTION_TEXT: "No description";
21
19
  /** Helper for inserting the code-block end delimiter in generated Markdown. */
@@ -1 +1 @@
1
- {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/const/strings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAYrB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,UAAU,cAAwB,CAAC;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,YAAsB,CAAC;AAE5C,2EAA2E;AAC3E,eAAO,MAAM,OAAO,WAAqB,CAAC;AAE1C,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,kBAA4B,CAAC;AAE7D,+EAA+E;AAC/E,eAAO,MAAM,YAAY,WAC0C,CAAC;AAEpE,oFAAoF;AACpF,eAAO,MAAM,YAAY,kBACoD,CAAC"}
1
+ {"version":3,"file":"strings.d.ts","sourceRoot":"","sources":["../../src/const/strings.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,EACL,yBAAyB,EACzB,YAAY,EACZ,YAAY,GACb,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,cAYrB,CAAC;AAEX,iEAAiE;AACjE,eAAO,MAAM,UAAU,EAAG,YAAqB,CAAC;AAEhD,4DAA4D;AAC5D,eAAO,MAAM,QAAQ,EAAG,UAAmB,CAAC;AAK5C,kEAAkE;AAClE,eAAO,MAAM,mBAAmB,EAAG,gBAAyB,CAAC;AAE7D,+EAA+E;AAC/E,eAAO,MAAM,YAAY,WAC0C,CAAC;AAEpE,oFAAoF;AACpF,eAAO,MAAM,YAAY,kBACoD,CAAC"}
@@ -1,11 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MARKDOWN_SOC = exports.MARKDOWN_EOC = exports.NO_DESCRIPTION_TEXT = exports.GRAPHQL = exports.NON_NULL = exports.DEPRECATED = exports.ROOT_TYPE_LOCALE = exports.MARKDOWN_EOP = exports.MARKDOWN_EOL = exports.MARKDOWN_CODE_SNIPPET = exports.MARKDOWN_CODE_INDENTATION = exports.FRONT_MATTER_DELIMITER = void 0;
3
+ exports.MARKDOWN_SOC = exports.MARKDOWN_EOC = exports.NO_DESCRIPTION_TEXT = exports.NON_NULL = exports.DEPRECATED = exports.ROOT_TYPE_LOCALE = exports.MARKDOWN_EOP = exports.MARKDOWN_EOL = exports.MARKDOWN_CODE_INDENTATION = void 0;
4
4
  const utils_1 = require("@graphql-markdown/utils");
5
- const utils_2 = require("@graphql-markdown/utils");
6
- Object.defineProperty(exports, "FRONT_MATTER_DELIMITER", { enumerable: true, get: function () { return utils_2.FRONT_MATTER_DELIMITER; } });
5
+ var utils_2 = require("@graphql-markdown/utils");
7
6
  Object.defineProperty(exports, "MARKDOWN_CODE_INDENTATION", { enumerable: true, get: function () { return utils_2.MARKDOWN_CODE_INDENTATION; } });
8
- Object.defineProperty(exports, "MARKDOWN_CODE_SNIPPET", { enumerable: true, get: function () { return utils_2.MARKDOWN_CODE_SNIPPET; } });
9
7
  Object.defineProperty(exports, "MARKDOWN_EOL", { enumerable: true, get: function () { return utils_2.MARKDOWN_EOL; } });
10
8
  Object.defineProperty(exports, "MARKDOWN_EOP", { enumerable: true, get: function () { return utils_2.MARKDOWN_EOP; } });
11
9
  /**
@@ -29,10 +27,10 @@ exports.DEPRECATED = "deprecated";
29
27
  /** Copy fragment describing a non-null GraphQL modifier. */
30
28
  exports.NON_NULL = "non-null";
31
29
  /** Short identifier for the GraphQL language tag used in fenced blocks. */
32
- exports.GRAPHQL = "graphql";
30
+ const GRAPHQL = "graphql";
33
31
  /** Default placeholder when no schema description is provided. */
34
32
  exports.NO_DESCRIPTION_TEXT = "No description";
35
33
  /** Helper for inserting the code-block end delimiter in generated Markdown. */
36
34
  exports.MARKDOWN_EOC = `${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_CODE_SNIPPET}${utils_1.MARKDOWN_EOL}`;
37
35
  /** Helper for inserting the code-block start delimiter targeting GraphQL syntax. */
38
- exports.MARKDOWN_SOC = `${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_CODE_SNIPPET}${exports.GRAPHQL}${utils_1.MARKDOWN_EOL}`;
36
+ exports.MARKDOWN_SOC = `${utils_1.MARKDOWN_EOL}${utils_1.MARKDOWN_CODE_SNIPPET}${GRAPHQL}${utils_1.MARKDOWN_EOL}`;
@@ -40,5 +40,5 @@ export declare const getCustomTags: (type: unknown, options: PrintTypeOptions) =
40
40
  * @param options - General printing options
41
41
  * @returns Formatted Markdown string of badges or empty string
42
42
  */
43
- export declare const printCustomTags: (type: unknown, options: PrintTypeOptions) => string | MDXString;
43
+ export declare const printCustomTags: (type: unknown, options: PrintTypeOptions) => MDXString | string;
44
44
  //# sourceMappingURL=directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../src/directive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AASjC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,6IAiBtC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,2GAoBhC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,kEAgCjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,aAAa,uDAwBzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,kEAc3B,CAAC"}
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../src/directive.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,gBAAgB,EAChB,SAAS,EACT,sBAAsB,EACtB,uBAAuB,EACvB,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AASjC;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,aAC3B,uBAAuB,QAC3B,OAAO,wBACS,sBAAsB,aACjC,KAAK,CAAC,MAAM,CAAC,KACvB,KAAK,CAAC,MAAM,CAYd,CAAC;AAEF;;;;;;GAMG;AAGH,eAAO,MAAM,oBAAoB,SACzB,OAAO,wBACS,sBAAsB,WACnC,gBAAgB,KACxB,KAAK,CAAC,MAAM,CAgBd,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,SAC1B,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CA6BnB,CAAC;AAEF;;;;;GAKG;AAGH,eAAO,MAAM,aAAa,SAClB,OAAO,WACJ,gBAAgB,KACxB,KAAK,EAqBP,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,WACJ,gBAAgB,KACxB,SAAS,GAAG,MAEd,CAAC"}
package/dist/directive.js CHANGED
@@ -33,6 +33,8 @@ exports.getCustomDirectiveResolver = getCustomDirectiveResolver;
33
33
  * @param options - General printing options
34
34
  * @returns Formatted Markdown string for the directive or `undefined`
35
35
  */
36
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
37
+ // fallow-ignore-next-line unused-export
36
38
  const printCustomDirective = (type, constDirectiveOption, options) => {
37
39
  const typeNameLink = (0, link_1.printLink)(constDirectiveOption.type, {
38
40
  ...options,
@@ -80,6 +82,8 @@ exports.printCustomDirectives = printCustomDirectives;
80
82
  * @param options - General printing options
81
83
  * @returns Array of badge configurations from directive tags
82
84
  */
85
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
86
+ // fallow-ignore-next-line unused-export
83
87
  const getCustomTags = (type, options) => {
84
88
  const constDirectiveMap = (0, graphql_1.getConstDirectiveMap)(type, options.customDirectives);
85
89
  if (typeof constDirectiveMap !== "object" ||
@@ -103,13 +107,6 @@ exports.getCustomTags = getCustomTags;
103
107
  * @returns Formatted Markdown string of badges or empty string
104
108
  */
105
109
  const printCustomTags = (type, options) => {
106
- const badges = (0, exports.getCustomTags)(type, options);
107
- if (badges.length === 0) {
108
- return "";
109
- }
110
- const formattedBadges = badges.map((badge) => {
111
- return (0, badge_1.printBadge)(badge, options);
112
- });
113
- return formattedBadges.join(" ");
110
+ return (0, badge_1.formatBadges)((0, exports.getCustomTags)(type, options), options);
114
111
  };
115
112
  exports.printCustomTags = printCustomTags;
@@ -1 +1 @@
1
- {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAIV,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAwBjC;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,gFAgCrC,CAAC;AAiKF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,6DAmBxB,CAAC"}
1
+ {"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAIV,KAAK,EACL,gBAAgB,EAChB,oBAAoB,EACrB,MAAM,yBAAyB,CAAC;AAwBjC;;;;;GAKG;AAGH,eAAO,MAAM,yBAAyB,gCAGnC,gBAAgB,KAAG,KAAK,CAAC,oBAAoB,CA6B/C,CAAC;AAiKF;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,YAAY,SACjB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,MAAM,CAgBd,CAAC"}
package/dist/example.js CHANGED
@@ -15,6 +15,8 @@ const link_1 = require("./link");
15
15
  * @param options - Configuration options
16
16
  * @returns The directive example configuration if valid, otherwise `undefined`
17
17
  */
18
+ // Used only by unit tests for direct whitebox coverage; not part of the production public API.
19
+ // fallow-ignore-next-line unused-export
18
20
  const getDirectiveExampleOption = ({ exampleSection, schema, }) => {
19
21
  let directiveName = "example", argName = "value", parserFunc = undefined;
20
22
  if (exampleSection && typeof exampleSection === "object") {
@@ -1 +1 @@
1
- {"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../src/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC;;GAEG;AACH,eAAO,MAAM,cAAc,6BAE1B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,oFAK/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,8BAE3B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,iDAI5B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,8EAShC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,8BAEzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,yDAQ/B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,4BAEpC,CAAC"}
1
+ {"version":3,"file":"format-helpers.d.ts","sourceRoot":"","sources":["../src/format-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EACV,cAAc,EACd,KAAK,EACL,iBAAiB,EACjB,kBAAkB,EAClB,KAAK,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACT,MAAM,yBAAyB,CAAC;AASjC;;GAEG;AACH,eAAO,MAAM,cAAc,UAAW,KAAK,KAAG,SAE7C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCACD,cAAc,SACpC,KAAK,CAAC,QAAQ,CAAC,KACrB,SAEF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,qBAAgB,SAE3C,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,gBAAgB,kBAE1B,iBAAiB,KAAG,SAEtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,WACvB,KAAK,CAAC,kBAAkB,CAAC,aACtB,KAAK,CAAC,MAAM,EAAE,CAAC,KACzB,SAMF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,SAAU,QAAQ,KAAG,QAE9C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,SACxB,MAAM,eACC,KAAK,CAAC,MAAM,CAAC,KACzB,SAKF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,QAAS,MAAM,KAAG,SAEtD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAIV,SAAS,EAMV,MAAM,yBAAyB,CAAC;AAQjC;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,iBAkDlC,CAAC"}
1
+ {"version":3,"file":"formatter.d.ts","sourceRoot":"","sources":["../src/formatter.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAazD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,sBAAsB,QAAO,SAWzC,CAAC"}
package/dist/formatter.js CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
  Object.defineProperty(exports, "__esModule", { value: true });
11
11
  exports.createDefaultFormatter = void 0;
12
- const strings_1 = require("./const/strings");
12
+ const defaults_1 = require("@graphql-markdown/formatters/defaults");
13
13
  /**
14
14
  * Creates a default formatter for documentation output.
15
15
  *
@@ -29,35 +29,14 @@ const strings_1 = require("./const/strings");
29
29
  */
30
30
  const createDefaultFormatter = () => {
31
31
  return {
32
- formatMDXBadge: (badge) => {
33
- return `<mark class="gqlmd-mdx-badge">${badge.text}</mark>`;
34
- },
35
- formatMDXAdmonition: ({ text, title, type, icon }, _meta) => {
36
- return `${strings_1.MARKDOWN_EOP}<fieldset class="gqlmd-mdx-admonition-fieldset">${strings_1.MARKDOWN_EOL}<legend class="gqlmd-mdx-admonition-legend"><span class="gqlmd-mdx-admonition-legend-type gqlmd-mdx-admonition-legend-type-${type.toLocaleLowerCase()}">${icon ?? type.toUpperCase()} ${title}</span></legend>${strings_1.MARKDOWN_EOL}<span>${text}</span>${strings_1.MARKDOWN_EOL}</fieldset>`;
37
- },
38
- formatMDXBullet: (text = "") => {
39
- return `<span class="gqlmd-mdx-bullet">&nbsp;●&nbsp;</span>${text}`;
40
- },
41
- formatMDXDetails: ({ dataOpen }) => {
42
- return `${strings_1.MARKDOWN_EOP}<details class="gqlmd-mdx-details">${strings_1.MARKDOWN_EOL}<summary class="gqlmd-mdx-details-summary"><span className="gqlmd-mdx-details-summary-open">${dataOpen.toUpperCase()}</span></summary>${strings_1.MARKDOWN_EOL}\r${strings_1.MARKDOWN_EOL}</details>${strings_1.MARKDOWN_EOP}`;
43
- },
44
- formatMDXFrontmatter: (_props, formatted) => {
45
- return formatted
46
- ? [strings_1.FRONT_MATTER_DELIMITER, ...formatted, strings_1.FRONT_MATTER_DELIMITER].join(strings_1.MARKDOWN_EOL)
47
- : "";
48
- },
49
- formatMDXLink: (link) => {
50
- return link;
51
- },
52
- formatMDXNameEntity: (name, parentType) => {
53
- const parentName = parentType
54
- ? `<code class="gqlmd-mdx-entity-parent">${parentType}</code>.`
55
- : "";
56
- return `<span class="gqlmd-mdx-entity">${parentName}<code class="gqlmd-mdx-entity-name">${name}</code></span>`;
57
- },
58
- formatMDXSpecifiedByLink: (url) => {
59
- return `<span class="gqlmd-mdx-specifiedby">Specification<a class="gqlmd-mdx-specifiedby-link" target="_blank" href="${url}" title="Specified by ${url}">⎘</a></span>`;
60
- },
32
+ formatMDXAdmonition: defaults_1.formatMDXAdmonition,
33
+ formatMDXBadge: defaults_1.formatMDXBadge,
34
+ formatMDXBullet: defaults_1.formatMDXBullet,
35
+ formatMDXDetails: defaults_1.formatMDXDetails,
36
+ formatMDXFrontmatter: defaults_1.formatMDXFrontmatter,
37
+ formatMDXLink: defaults_1.formatMDXLink,
38
+ formatMDXNameEntity: defaults_1.formatMDXNameEntity,
39
+ formatMDXSpecifiedByLink: defaults_1.formatMDXSpecifiedByLink,
61
40
  };
62
41
  };
63
42
  exports.createDefaultFormatter = createDefaultFormatter;
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,wFAY5B,CAAC"}
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../src/frontmatter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EACV,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAGjC;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,UACpB,MAAM,SACN,KAAK,CAAC,kBAAkB,CAAC,WACvB,gBAAgB,KACxB,MAQF,CAAC"}
@@ -21,5 +21,5 @@ export declare const printDirectiveMetadata: (type: GraphQLDirective, options: P
21
21
  * @param options - Configuration options for printing the directive (optional)
22
22
  * @returns A formatted string containing the complete directive definition
23
23
  */
24
- export declare const printCodeDirective: (type: GraphQLDirective, options?: PrintDirectiveOptions | undefined) => string;
24
+ export declare const printCodeDirective: (type: GraphQLDirective, options?: PrintDirectiveOptions) => string;
25
25
  //# sourceMappingURL=directive.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../src/graphql/directive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AA4BjC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,gFASlC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,iFAU9B,CAAC"}
1
+ {"version":3,"file":"directive.d.ts","sourceRoot":"","sources":["../../src/graphql/directive.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,qBAAqB,EACrB,gBAAgB,EAChB,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AA4BjC;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,SAC3B,gBAAgB,WACb,qBAAqB,KAC7B,KAAK,CAAC,WAAW,CAMnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,gBAAgB,YAEZ,qBAAqB,KAC9B,MAMF,CAAC"}
@@ -18,5 +18,5 @@ export declare const printEnumMetadata: (type: unknown, options: PrintTypeOption
18
18
  * @param options - Optional printing options that control directive handling
19
19
  * @returns A string containing the enum type definition in GraphQL SDL, or empty string if type is not an enum
20
20
  */
21
- export declare const printCodeEnum: (type: unknown, options?: PrintTypeOptions | undefined) => string;
21
+ export declare const printCodeEnum: (type: unknown, options?: PrintTypeOptions) => string;
22
22
  //# sourceMappingURL=enum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/graphql/enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAYjC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,kEAS7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,mEA0BzB,CAAC"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../src/graphql/enum.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AAYjC;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,SACtB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAMnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAClB,OAAO,YACH,gBAAgB,KACzB,MAuBF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/graphql/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,sDAK1B,CAAC"}
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/graphql/input.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAErE;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.printCodeInput = exports.printInputMetadata = void 0;
4
4
  const object_1 = require("./object");
5
- const object_2 = require("./object");
5
+ var object_2 = require("./object");
6
6
  Object.defineProperty(exports, "printInputMetadata", { enumerable: true, get: function () { return object_2.printObjectMetadata; } });
7
7
  /**
8
8
  * Renders the Markdown code snippet for a GraphQL `input` type by delegating
@@ -1 +1 @@
1
- {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/graphql/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,sDAK9B,CAAC"}
1
+ {"version":3,"file":"interface.d.ts","sourceRoot":"","sources":["../../src/graphql/interface.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAIhE;;;GAGG;AACH,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAEzE;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -10,7 +10,7 @@ const object_1 = require("./object");
10
10
  * Prints metadata for a GraphQL interface type.
11
11
  * This is an alias for {@link printObjectMetadata}.
12
12
  */
13
- const object_2 = require("./object");
13
+ var object_2 = require("./object");
14
14
  Object.defineProperty(exports, "printInterfaceMetadata", { enumerable: true, get: function () { return object_2.printObjectMetadata; } });
15
15
  /**
16
16
  * Generates a code block representation of a GraphQL interface type.
@@ -1 +1 @@
1
- {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/graphql/object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA8BjC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,oEAa/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,sEAgCzB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,sDAK3B,CAAC"}
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["../../src/graphql/object.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,gBAAgB,EACjB,MAAM,yBAAyB,CAAC;AA8BjC;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,SACxB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,EAAE,CAUrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,SAClB,OAAO,UACL,MAAM,WACL,gBAAgB,KACxB,MA4BF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,WACJ,gBAAgB,KACxB,MAEF,CAAC"}
@@ -4,13 +4,6 @@
4
4
  * @module
5
5
  */
6
6
  import type { PrintTypeOptions, MDXString, Maybe, PageSection } from "@graphql-markdown/types";
7
- /**
8
- * Prints the operation type information.
9
- * @param type - The operation type to print
10
- * @param options - Print type options for customizing output
11
- * @returns A "Type" PageSection, or undefined when `type` is not an operation
12
- */
13
- export declare const printOperationType: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection>;
14
7
  /**
15
8
  * Prints the operation metadata including arguments and type information.
16
9
  * @param type - The operation type to print metadata for
@@ -21,5 +14,5 @@ export declare const printOperationMetadata: (type: unknown, options: PrintTypeO
21
14
  /**
22
15
  * Prints the code representation of an operation.
23
16
  */
24
- export declare const printCodeOperation: (type: unknown, options?: PrintTypeOptions | undefined) => string | MDXString;
17
+ export declare const printCodeOperation: (type: unknown, options?: PrintTypeOptions) => MDXString | string;
25
18
  //# sourceMappingURL=operation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/graphql/operation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAa9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,oEAYlC,CAAC;AAkCF;;GAEG;AACH,eAAO,MAAM,kBAAkB,+EAc9B,CAAC"}
1
+ {"version":3,"file":"operation.d.ts","sourceRoot":"","sources":["../../src/graphql/operation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAChB,SAAS,EACT,KAAK,EACL,WAAW,EACZ,MAAM,yBAAyB,CAAC;AA2BjC;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,SAC3B,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,EAAE,CASrB,CAAC;AAkCF;;GAEG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,YACH,gBAAgB,KACzB,SAAS,GAAG,MAWd,CAAC"}