@graphql-markdown/printer-legacy 1.15.0 → 1.16.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 (54) hide show
  1. package/dist/badge.d.ts +10 -3
  2. package/dist/badge.d.ts.map +1 -1
  3. package/dist/badge.js +19 -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 +5 -6
  9. package/dist/const/options.d.ts +3 -7
  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 +1 -8
  18. package/dist/example.d.ts.map +1 -1
  19. package/dist/format-helpers.d.ts.map +1 -1
  20. package/dist/formatter.d.ts.map +1 -1
  21. package/dist/formatter.js +9 -30
  22. package/dist/frontmatter.d.ts.map +1 -1
  23. package/dist/graphql/directive.d.ts +1 -1
  24. package/dist/graphql/directive.d.ts.map +1 -1
  25. package/dist/graphql/enum.d.ts +1 -1
  26. package/dist/graphql/enum.d.ts.map +1 -1
  27. package/dist/graphql/input.d.ts.map +1 -1
  28. package/dist/graphql/input.js +1 -1
  29. package/dist/graphql/interface.d.ts.map +1 -1
  30. package/dist/graphql/interface.js +1 -1
  31. package/dist/graphql/object.d.ts.map +1 -1
  32. package/dist/graphql/operation.d.ts +1 -8
  33. package/dist/graphql/operation.d.ts.map +1 -1
  34. package/dist/graphql/operation.js +2 -3
  35. package/dist/graphql/scalar.d.ts +1 -1
  36. package/dist/graphql/scalar.d.ts.map +1 -1
  37. package/dist/graphql/union.d.ts +1 -1
  38. package/dist/graphql/union.d.ts.map +1 -1
  39. package/dist/group.d.ts +2 -2
  40. package/dist/group.d.ts.map +1 -1
  41. package/dist/index.js +2 -2
  42. package/dist/link.d.ts +5 -13
  43. package/dist/link.d.ts.map +1 -1
  44. package/dist/link.js +2 -3
  45. package/dist/mdx/index.d.ts +1 -1
  46. package/dist/mdx/index.d.ts.map +1 -1
  47. package/dist/printer.d.ts +7 -34
  48. package/dist/printer.d.ts.map +1 -1
  49. package/dist/printer.js +28 -63
  50. package/dist/relation.d.ts +2 -2
  51. package/dist/relation.d.ts.map +1 -1
  52. package/dist/section.d.ts +2 -2
  53. package/dist/section.d.ts.map +1 -1
  54. package/package.json +5 -4
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;AACH,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");
@@ -76,6 +76,23 @@ const printBadge = ({ text, classname }, options) => {
76
76
  return (0, formatter_1.createDefaultFormatter)().formatMDXBadge(badge);
77
77
  };
78
78
  exports.printBadge = printBadge;
79
+ /**
80
+ * Formats an array of badges into a space-joined MDX string.
81
+ * @param badges - Array of badge objects to format
82
+ * @param options - Options containing the formatter for badges
83
+ * @returns Space-joined MDX string of all badges, or empty string if none
84
+ */
85
+ const formatBadges = (badges, options) => {
86
+ if (badges.length === 0) {
87
+ return "";
88
+ }
89
+ return badges
90
+ .map((badge) => {
91
+ return (0, exports.printBadge)(badge, options);
92
+ })
93
+ .join(" ");
94
+ };
95
+ exports.formatBadges = formatBadges;
79
96
  /**
80
97
  * Generates and formats all applicable badges for a GraphQL type.
81
98
  * @param type - The GraphQL type to generate badges for
@@ -88,13 +105,6 @@ const printBadges = (type, options) => {
88
105
  !options.typeBadges) {
89
106
  return "";
90
107
  }
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(" ");
108
+ return (0, exports.formatBadges)((0, exports.getTypeBadges)(type, options.groups), options);
99
109
  };
100
110
  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;AACH,eAAO,MAAM,uBAAuB,SAC5B,OAAO,YACH,gBAAgB,KACzB,MA4BF,CAAC;AAuBF;;;;;GAKG;AACH,eAAO,MAAM,YAAY,oBACN;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,WACzC,gBAAgB,KACxB,MAUF,CAAC;AAEF;;;;;GAKG;AACH,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,7 @@ 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
+ const getCustomDirectivesText = (type, options) => {
20
20
  const constDirectiveMap = (0, graphql_1.getConstDirectiveMap)(type, options?.customDirectives);
21
21
  if ((0, utils_1.isEmpty)(constDirectiveMap)) {
22
22
  return "";
@@ -34,7 +34,7 @@ const printCustomDirectives = (type, options) => {
34
34
  .join(strings_1.MARKDOWN_EOP);
35
35
  return `${strings_1.MARKDOWN_EOP}${content}`;
36
36
  };
37
- exports.printCustomDirectives = printCustomDirectives;
37
+ exports.getCustomDirectivesText = getCustomDirectivesText;
38
38
  /**
39
39
  * Formats a GraphQL type description or falls back to a default message.
40
40
  *
@@ -51,7 +51,6 @@ const formatDescription = (type, replacement = strings_1.NO_DESCRIPTION_TEXT) =>
51
51
  : replacement;
52
52
  return `${strings_1.MARKDOWN_EOP}${(0, utils_1.escapeMDX)(description)}`;
53
53
  };
54
- exports.formatDescription = formatDescription;
55
54
  /**
56
55
  * Generates a warning message block in MDX format.
57
56
  * @param warningConfig - Warning configuration object with `text` and optional `title` properties
@@ -89,8 +88,8 @@ exports.printDeprecation = printDeprecation;
89
88
  * @returns Combined description, deprecation notices, and custom directives as MDX content
90
89
  */
91
90
  const printDescription = (type, options, noText) => {
92
- const description = (0, exports.formatDescription)(type, noText);
93
- const customDirectives = (0, exports.printCustomDirectives)(type, options);
91
+ const description = formatDescription(type, noText);
92
+ const customDirectives = (0, exports.getCustomDirectivesText)(type, options);
94
93
  const deprecation = (0, exports.printDeprecation)(type, options);
95
94
  return `${deprecation}${description}${customDirectives}`;
96
95
  };
@@ -5,21 +5,17 @@ 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
20
  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">> & {
25
21
  collapsible: Maybe<CollapsibleOption>;
@@ -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,C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C/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,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;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 cross-package in packages/core/src/renderer.ts and config.ts;
9
+ // fallow can't trace cross-workspace callers when dist/ is excluded.
10
+ // fallow-ignore-next-line unused-enum-member
11
11
  TypeHierarchy["ENTITY"] = "entity";
12
12
  TypeHierarchy["FLAT"] = "flat";
13
13
  })(TypeHierarchy || (exports.TypeHierarchy = TypeHierarchy = {}));
14
14
  var SectionLevels;
15
15
  (function (SectionLevels) {
16
+ /**
17
+ * @deprecated Use `SectionLevels.LEVEL` instead.
18
+ */
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;AACH,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;AACH,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
@@ -103,13 +103,6 @@ exports.getCustomTags = getCustomTags;
103
103
  * @returns Formatted Markdown string of badges or empty string
104
104
  */
105
105
  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(" ");
106
+ return (0, badge_1.formatBadges)((0, exports.getCustomTags)(type, options), options);
114
107
  };
115
108
  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;AACH,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"}
@@ -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"}
@@ -5,7 +5,7 @@
5
5
  * @module
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.printCodeOperation = exports.printOperationMetadata = exports.printOperationType = void 0;
8
+ exports.printCodeOperation = exports.printOperationMetadata = void 0;
9
9
  const graphql_1 = require("@graphql-markdown/graphql");
10
10
  const strings_1 = require("../const/strings");
11
11
  const code_1 = require("../code");
@@ -26,7 +26,6 @@ const printOperationType = (type, options) => {
26
26
  parentTypePrefix: false,
27
27
  });
28
28
  };
29
- exports.printOperationType = printOperationType;
30
29
  /**
31
30
  * Prints the operation metadata including arguments and type information.
32
31
  * @param type - The operation type to print metadata for
@@ -37,7 +36,7 @@ const printOperationMetadata = (type, options) => {
37
36
  if (!(0, graphql_1.isOperation)(type)) {
38
37
  return undefined;
39
38
  }
40
- const response = (0, exports.printOperationType)(type, options);
39
+ const response = printOperationType(type, options);
41
40
  const metadata = (0, section_1.printMetadataSection)(type, type.args, "Arguments", options);
42
41
  return [metadata, response].filter(Boolean);
43
42
  };
@@ -24,5 +24,5 @@ export declare const printScalarMetadata: (type: unknown, options: PrintTypeOpti
24
24
  * @param options - Options for printing type information (unused)
25
25
  * @returns SDL string representation of the scalar type
26
26
  */
27
- export declare const printCodeScalar: (type: unknown, options?: PrintTypeOptions | undefined) => string;
27
+ export declare const printCodeScalar: (type: unknown, options?: PrintTypeOptions) => string;
28
28
  //# sourceMappingURL=scalar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../src/graphql/scalar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAIjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAmB9B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,kEAK/B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,mEAK3B,CAAC"}
1
+ {"version":3,"file":"scalar.d.ts","sourceRoot":"","sources":["../../src/graphql/scalar.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,gBAAgB,EAChB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAIjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAgBnB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,SACxB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAEnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,YACH,gBAAgB,KACzB,MAEF,CAAC"}
@@ -16,5 +16,5 @@ export declare const printUnionMetadata: (type: unknown, options: PrintTypeOptio
16
16
  * @param options - Configuration options for printing (unused)
17
17
  * @returns SDL string representation of the union type
18
18
  */
19
- export declare const printCodeUnion: (type: unknown, options?: PrintTypeOptions | undefined) => string;
19
+ export declare const printCodeUnion: (type: unknown, options?: PrintTypeOptions) => string;
20
20
  //# sourceMappingURL=union.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/graphql/union.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,kEAY9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,mEAiB1B,CAAC"}
1
+ {"version":3,"file":"union.d.ts","sourceRoot":"","sources":["../../src/graphql/union.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SACvB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,WAAW,CASnB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,YACH,gBAAgB,KACzB,MAcF,CAAC"}
package/dist/group.d.ts CHANGED
@@ -2,7 +2,7 @@
2
2
  * Utility module for handling GraphQL schema entity grouping.
3
3
  * @module
4
4
  */
5
- import type { SchemaEntity, Maybe } from "@graphql-markdown/types";
5
+ import type { SchemaEntitiesGroupMap, SchemaEntity, Maybe } from "@graphql-markdown/types";
6
6
  /**
7
7
  * Retrieves the group name for a given GraphQL type based on its category and group mapping.
8
8
  *
@@ -11,5 +11,5 @@ import type { SchemaEntity, Maybe } from "@graphql-markdown/types";
11
11
  * @param typeCategory - The category of the schema entity
12
12
  * @returns The slugified group name or empty string if no group is found
13
13
  */
14
- export declare const getGroup: (type: unknown, groups: Maybe<Partial<Record<SchemaEntity, Record<string, Maybe<string>>>>>, typeCategory: Maybe<SchemaEntity>) => string;
14
+ export declare const getGroup: (type: unknown, groups: Maybe<SchemaEntitiesGroupMap>, typeCategory: Maybe<SchemaEntity>) => string;
15
15
  //# sourceMappingURL=group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAEV,YAAY,EAEZ,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,2IA6BpB,CAAC"}
1
+ {"version":3,"file":"group.d.ts","sourceRoot":"","sources":["../src/group.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EACV,sBAAsB,EACtB,YAAY,EAEZ,KAAK,EACN,MAAM,yBAAyB,CAAC;AAMjC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,SACb,OAAO,UACL,KAAK,CAAC,sBAAsB,CAAC,gBACvB,KAAK,CAAC,YAAY,CAAC,KAChC,MAyBF,CAAC"}
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BeforeComposePageTypeEvent = exports.PrintTypeEvent = exports.PrintCodeEvent = exports.Printer = void 0;
4
- const printer_1 = require("./printer");
4
+ var printer_1 = require("./printer");
5
5
  Object.defineProperty(exports, "Printer", { enumerable: true, get: function () { return printer_1.Printer; } });
6
- const events_1 = require("./events");
6
+ var events_1 = require("./events");
7
7
  Object.defineProperty(exports, "PrintCodeEvent", { enumerable: true, get: function () { return events_1.PrintCodeEvent; } });
8
8
  Object.defineProperty(exports, "PrintTypeEvent", { enumerable: true, get: function () { return events_1.PrintTypeEvent; } });
9
9
  Object.defineProperty(exports, "BeforeComposePageTypeEvent", { enumerable: true, get: function () { return events_1.BeforeComposePageTypeEvent; } });
package/dist/link.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  * Provides utilities for creating, formatting, and managing links to GraphQL types and operations.
4
4
  * @packageDocumentation
5
5
  */
6
- import type { ApiGroupOverrideType, MDXString, Maybe, PrintLinkOptions, PrintTypeOptions, TypeDeprecatedOption, TypeLink, TypeLocale } from "@graphql-markdown/types";
6
+ import type { ApiGroupOverrideType, MDXString, Maybe, PrintLinkOptions, PrintTypeOptions, TypeLink, TypeLocale } from "@graphql-markdown/types";
7
7
  export declare const API_GROUPS: Required<ApiGroupOverrideType>;
8
8
  /**
9
9
  * Checks if a type has printable directives based on the provided options.
@@ -12,7 +12,7 @@ export declare const API_GROUPS: Required<ApiGroupOverrideType>;
12
12
  * @param options - Configuration options for directive printing (`deprecated`, `onlyDocDirectives`, `skipDocDirectives`)
13
13
  * @returns `true` if the type should be printed, `false` otherwise
14
14
  */
15
- export declare const hasPrintableDirective: (type: unknown, options?: Pick<PrintTypeOptions, "deprecated" | "onlyDocDirectives" | "skipDocDirectives"> | undefined) => boolean;
15
+ export declare const hasPrintableDirective: (type: unknown, options?: Pick<PrintTypeOptions, "deprecated" | "onlyDocDirectives" | "skipDocDirectives">) => boolean;
16
16
  /**
17
17
  * Gets the locale category for a given GraphQL type.
18
18
  *
@@ -49,15 +49,7 @@ export declare const hasOptionParentType: (options: PrintLinkOptions) => boolean
49
49
  * @param groups - The group options
50
50
  * @returns The folder name for the API group
51
51
  */
52
- export declare const getLinkApiGroupFolder: (type: unknown, groups?: Maybe<boolean | ApiGroupOverrideType>) => string;
53
- /**
54
- * Gets the folder name for deprecated types based on the GraphQL type and deprecation option.
55
- *
56
- * @param type - The GraphQL type to get the folder name for
57
- * @param option - The deprecation option
58
- * @returns The folder name for deprecated types
59
- */
60
- export declare const getLinkDeprecatedFolder: (type: unknown, option: Maybe<TypeDeprecatedOption>) => string;
52
+ export declare const getLinkApiGroupFolder: (type: unknown, groups?: Maybe<ApiGroupOverrideType | boolean>) => string;
61
53
  /**
62
54
  * Converts a GraphQL type to a link object.
63
55
  *
@@ -92,7 +84,7 @@ export declare const printLinkAttributes: (type: unknown, text?: Maybe<string>)
92
84
  * @param options - Configuration options for link generation
93
85
  * @returns The formatted link as a string
94
86
  */
95
- export declare const printLink: <T>(arg: T | Maybe<TypeLink>, options: PrintLinkOptions) => string;
87
+ export declare const printLink: <T>(arg: Maybe<TypeLink> | T, options: PrintLinkOptions) => string;
96
88
  /**
97
89
  * Prints a parent link for a GraphQL type based on the provided options.
98
90
  *
@@ -100,5 +92,5 @@ export declare const printLink: <T>(arg: T | Maybe<TypeLink>, options: PrintLink
100
92
  * @param options - Configuration options for link generation
101
93
  * @returns The formatted parent link as a string or MDX string
102
94
  */
103
- export declare const printParentLink: (type: unknown, options: PrintLinkOptions) => string | MDXString;
95
+ export declare const printParentLink: (type: unknown, options: PrintLinkOptions) => MDXString | string;
104
96
  //# sourceMappingURL=link.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,oBAAoB,EAEpB,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAEhB,oBAAoB,EAGpB,QAAQ,EACR,UAAU,EACX,MAAM,yBAAyB,CAAC;AAgCjC,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAG5C,CAAC;AAEX;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,oIA+BjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,sCAoB7B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,uEAuBjC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,uBAAuB,wCAEnC,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,wCAO/B,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,2EASjC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,gEAKnC,CAAC;AASF;;;;;;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eAAO,MAAM,MAAM,SACX,OAAO,QACP,MAAM,aACD,KAAK,CAAC,UAAU,CAAC,WACnB,gBAAgB,KACxB,QAkFF,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,aAChB,KAAK,CAAC,UAAU,CAAC,QACrB,OAAO,WACJ,gBAAgB,KACxB,KAAK,CAAC,QAAQ,CAUhB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,SACxB,OAAO,SACP,KAAK,CAAC,MAAM,CAAC,KAClB,MAkBF,CAAC;AAoBF;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,CAAC,OACpB,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,WACf,gBAAgB,KACxB,MAgCF,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,SACpB,OAAO,WACJ,gBAAgB,KACxB,SAAS,GAAG,MAWd,CAAC"}
package/dist/link.js CHANGED
@@ -5,7 +5,7 @@
5
5
  * @packageDocumentation
6
6
  */
7
7
  Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.printParentLink = exports.printLink = exports.printLinkAttributes = exports.getRelationLink = exports.toLink = exports.getLinkDeprecatedFolder = exports.getLinkApiGroupFolder = exports.hasOptionParentType = exports.hasOptionWithAttributes = exports.getLinkCategoryFolder = exports.getCategoryLocale = exports.hasPrintableDirective = exports.API_GROUPS = void 0;
8
+ exports.printParentLink = exports.printLink = exports.printLinkAttributes = exports.getRelationLink = exports.toLink = exports.getLinkApiGroupFolder = exports.hasOptionParentType = exports.hasOptionWithAttributes = exports.getLinkCategoryFolder = exports.getCategoryLocale = exports.hasPrintableDirective = exports.API_GROUPS = void 0;
9
9
  const graphql_1 = require("@graphql-markdown/graphql");
10
10
  const utils_1 = require("@graphql-markdown/utils");
11
11
  const group_1 = require("./group");
@@ -143,7 +143,6 @@ exports.getLinkApiGroupFolder = getLinkApiGroupFolder;
143
143
  const getLinkDeprecatedFolder = (type, option) => {
144
144
  return option === "group" && (0, graphql_1.isDeprecated)(type) ? strings_1.DEPRECATED : "";
145
145
  };
146
- exports.getLinkDeprecatedFolder = getLinkDeprecatedFolder;
147
146
  const isHierarchy = (options, hierarchy) => {
148
147
  return options?.hierarchy?.[hierarchy] !== undefined;
149
148
  };
@@ -181,7 +180,7 @@ const toLink = (type, name, operation, options) => {
181
180
  return fallback;
182
181
  }
183
182
  deprecatedFolder = options.deprecated
184
- ? (0, exports.getLinkDeprecatedFolder)(type, options.deprecated)
183
+ ? getLinkDeprecatedFolder(type, options.deprecated)
185
184
  : "";
186
185
  groupFolder = options.groups
187
186
  ? (0, group_1.getGroup)(type, options.groups, category)
@@ -14,6 +14,6 @@
14
14
  import type { MDXSupportType } from "@graphql-markdown/types";
15
15
  export declare const mdxDeclaration = "";
16
16
  declare const defaultModule: MDXSupportType;
17
- export declare const mdxModule: (mdxPackage?: Record<string, unknown> | undefined) => Promise<Readonly<MDXSupportType>>;
17
+ export declare const mdxModule: (mdxPackage?: Record<string, unknown>) => Promise<Readonly<MDXSupportType>>;
18
18
  export default defaultModule;
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAOV,cAAc,EAGf,MAAM,yBAAyB,CAAC;AA0KjC,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,QAAA,MAAM,aAAa,gBASA,CAAC;AAEpB,eAAO,MAAM,SAAS,yFAoBrB,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/mdx/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAOV,cAAc,EAGf,MAAM,yBAAyB,CAAC;AA0KjC,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,QAAA,MAAM,aAAa,EASd,cAAc,CAAC;AAEpB,eAAO,MAAM,SAAS,gBACP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KACnC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC,CAkBlC,CAAC;eAEa,aAAa"}
package/dist/printer.d.ts CHANGED
@@ -7,10 +7,7 @@
7
7
  * @module printer
8
8
  * @packageDocumentation
9
9
  */
10
- import type { CustomDirectiveMap, DeprecatedPrintTypeOptions, Formatter, GraphQLDirective, GraphQLSchema, IPrinter, Maybe, MDXString, MetaInfo, PageSection, PrinterConfigPrintTypeOptions, PrinterEventEmitter, PrintTypeOptions, SchemaEntitiesGroupMap, TypeDeprecatedOption } from "@graphql-markdown/types";
11
- type InitPrintTypeOptions = DeprecatedPrintTypeOptions & Omit<PrinterConfigPrintTypeOptions, "exampleSection"> & {
12
- exampleSection?: DeprecatedPrintTypeOptions["exampleSection"] | PrinterConfigPrintTypeOptions["exampleSection"];
13
- };
10
+ import type { Formatter, GraphQLSchema, IPrinter, Maybe, MDXString, PageSection, PrinterEventEmitter, PrinterInitOptions, PrintTypeOptions } from "@graphql-markdown/types";
14
11
  /**
15
12
  * The Printer class implements the core functionality for generating Markdown documentation
16
13
  * from GraphQL schema types.
@@ -33,7 +30,7 @@ export declare class Printer implements IPrinter {
33
30
  /**
34
31
  * Prints type descriptions
35
32
  */
36
- static readonly printDescription: (type: unknown, options: PrintTypeOptions, noText?: string | undefined) => string | MDXString;
33
+ static readonly printDescription: (type: unknown, options: PrintTypeOptions, noText?: string) => MDXString | string;
37
34
  /**
38
35
  * Prints custom directives
39
36
  */
@@ -41,21 +38,14 @@ export declare class Printer implements IPrinter {
41
38
  /**
42
39
  * Prints custom tags
43
40
  */
44
- static readonly printCustomTags: (type: unknown, options: PrintTypeOptions) => string | MDXString;
41
+ static readonly printCustomTags: (type: unknown, options: PrintTypeOptions) => MDXString | string;
45
42
  private static _eventEmitter;
46
43
  private static _options;
47
- private static _deprecatedOptions;
48
44
  private static _mdxDeclaration;
49
45
  /**
50
46
  * Global printer configuration options
51
47
  */
52
48
  static get options(): Readonly<Maybe<PrintTypeOptions>>;
53
- /**
54
- * Backward-compat section toggles extracted from legacy config options.
55
- *
56
- * These flags are applied only during section order composition.
57
- */
58
- static get deprecatedOptions(): Readonly<Maybe<DeprecatedPrintTypeOptions>>;
59
49
  /**
60
50
  * Optional event emitter for print events.
61
51
  * When set, the printer will emit events before/after printCode and printType,
@@ -80,17 +70,7 @@ export declare class Printer implements IPrinter {
80
70
  * @param mdxDeclaration - Optional MDX import declaration
81
71
  * @param eventEmitter - Optional event emitter for print events interception
82
72
  */
83
- static init(schema: Maybe<GraphQLSchema>, baseURL?: Maybe<string>, linkRoot?: Maybe<string>, { customDirectives, groups, meta, metatags, onlyDocDirectives, printTypeOptions, skipDocDirectives, sectionHeaderId }?: {
84
- customDirectives?: CustomDirectiveMap;
85
- deprecated?: TypeDeprecatedOption;
86
- groups?: SchemaEntitiesGroupMap;
87
- meta?: Maybe<MetaInfo>;
88
- metatags?: Record<string, string>[];
89
- onlyDocDirectives?: GraphQLDirective[];
90
- printTypeOptions?: InitPrintTypeOptions;
91
- skipDocDirectives?: GraphQLDirective[];
92
- sectionHeaderId?: boolean;
93
- }, formatter?: Partial<Formatter>, mdxDeclaration?: Maybe<string>, eventEmitter?: Maybe<PrinterEventEmitter>): Promise<void>;
73
+ static init(schema: Maybe<GraphQLSchema>, baseURL?: Maybe<string>, linkRoot?: Maybe<string>, { customDirectives, deprecated, groups, meta, metatags, onlyDocDirectives, printTypeOptions, skipDocDirectives, sectionHeaderId, }?: PrinterInitOptions, formatter?: Partial<Formatter>, mdxDeclaration?: Maybe<string>, eventEmitter?: Maybe<PrinterEventEmitter>): Promise<void>;
94
74
  /**
95
75
  * Prints the header section of a type documentation
96
76
  *
@@ -142,7 +122,7 @@ export declare class Printer implements IPrinter {
142
122
  * @param options - Printer configuration options
143
123
  * @returns Metadata section (or section list) for supported types, otherwise undefined
144
124
  */
145
- static readonly printTypeMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection[] | PageSection>;
125
+ static readonly printTypeMetadata: (type: unknown, options: PrintTypeOptions) => Maybe<PageSection | PageSection[]>;
146
126
  /**
147
127
  * Prints related type information
148
128
  *
@@ -150,7 +130,7 @@ export declare class Printer implements IPrinter {
150
130
  * @param options - Printer configuration options
151
131
  * @returns Formatted relations section as MDX or plain string
152
132
  */
153
- static readonly printRelations: (type: unknown, options: PrintTypeOptions) => string | MDXString;
133
+ static readonly printRelations: (type: unknown, options: PrintTypeOptions) => MDXString | string;
154
134
  /**
155
135
  * Prints HTML meta tags for the documentation
156
136
  *
@@ -158,7 +138,7 @@ export declare class Printer implements IPrinter {
158
138
  * @param options - Printer configuration options containing metatags
159
139
  * @returns Formatted HTML meta tags string
160
140
  */
161
- static readonly printMetaTags: (_type: unknown, { metatags }: PrintTypeOptions) => string | MDXString;
141
+ static readonly printMetaTags: (_type: unknown, { metatags }: PrintTypeOptions) => MDXString | string;
162
142
  /**
163
143
  * Main method to print complete documentation for a GraphQL type
164
144
  *
@@ -195,12 +175,6 @@ export declare class Printer implements IPrinter {
195
175
  * Renders a page section, optionally prefixing a heading when a title is present.
196
176
  */
197
177
  private static readonly renderPageSection;
198
- /**
199
- * Returns the default content section order for type pages.
200
- *
201
- * Applies backward-compatibility toggles from deprecated section flags.
202
- */
203
- private static readonly getDeprecatedTypePageSectionOrder;
204
178
  /**
205
179
  * Runtime guard for built-in page content section keys.
206
180
  */
@@ -220,5 +194,4 @@ export declare class Printer implements IPrinter {
220
194
  */
221
195
  private static readonly normalizePageSection;
222
196
  }
223
- export {};
224
197
  //# sourceMappingURL=printer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../src/printer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,0BAA0B,EAC1B,SAAS,EACT,gBAAgB,EAEhB,aAAa,EACb,QAAQ,EACR,KAAK,EACL,SA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AQ,CAAC,uBAAuB,CAO7C;IAEF;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAA4B,CAgBlD;IAEF;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAY1C;CACH"}
package/dist/printer.js CHANGED
@@ -58,6 +58,24 @@ const DEFAULT_INIT_OPTIONS = {
58
58
  groups: undefined,
59
59
  sectionHeaderId: true,
60
60
  };
61
+ const normalizeHierarchy = (hierarchy) => {
62
+ if (!hierarchy) {
63
+ return undefined;
64
+ }
65
+ if (typeof hierarchy !== "string") {
66
+ return hierarchy;
67
+ }
68
+ switch (hierarchy.toLowerCase()) {
69
+ case "entity":
70
+ return { entity: {} };
71
+ case "flat":
72
+ return { flat: {} };
73
+ case "api":
74
+ return { api: {} };
75
+ default:
76
+ return undefined;
77
+ }
78
+ };
61
79
  /**
62
80
  * The Printer class implements the core functionality for generating Markdown documentation
63
81
  * from GraphQL schema types.
@@ -91,7 +109,6 @@ class Printer {
91
109
  static printCustomTags = directive_1.printCustomTags;
92
110
  static _eventEmitter;
93
111
  static _options;
94
- static _deprecatedOptions;
95
112
  static _mdxDeclaration;
96
113
  /**
97
114
  * Global printer configuration options
@@ -99,14 +116,6 @@ class Printer {
99
116
  static get options() {
100
117
  return Printer._options;
101
118
  }
102
- /**
103
- * Backward-compat section toggles extracted from legacy config options.
104
- *
105
- * These flags are applied only during section order composition.
106
- */
107
- static get deprecatedOptions() {
108
- return Printer._deprecatedOptions;
109
- }
110
119
  /**
111
120
  * Optional event emitter for print events.
112
121
  * When set, the printer will emit events before/after printCode and printType,
@@ -141,7 +150,7 @@ class Printer {
141
150
  * @param mdxDeclaration - Optional MDX import declaration
142
151
  * @param eventEmitter - Optional event emitter for print events interception
143
152
  */
144
- static async init(schema, baseURL = "schema", linkRoot = "/", { customDirectives, groups, meta, metatags, onlyDocDirectives, printTypeOptions, skipDocDirectives, sectionHeaderId, } = DEFAULT_INIT_OPTIONS, formatter, mdxDeclaration, eventEmitter) {
153
+ static async init(schema, baseURL = "schema", linkRoot = "/", { customDirectives, deprecated, groups, meta, metatags, onlyDocDirectives, printTypeOptions, skipDocDirectives, sectionHeaderId, } = DEFAULT_INIT_OPTIONS, formatter, mdxDeclaration, eventEmitter) {
145
154
  // Always update eventEmitter regardless of initialization state
146
155
  Printer.eventEmitter = eventEmitter ?? null;
147
156
  if (Printer.options === undefined) {
@@ -155,38 +164,22 @@ class Printer {
155
164
  groups,
156
165
  parentTypePrefix: printTypeOptions?.parentTypePrefix ??
157
166
  options_1.PRINT_TYPE_DEFAULT_OPTIONS.parentTypePrefix,
158
- deprecated: printTypeOptions?.deprecated ?? options_1.PRINT_TYPE_DEFAULT_OPTIONS.deprecated,
167
+ deprecated: printTypeOptions?.deprecated ??
168
+ deprecated ??
169
+ options_1.PRINT_TYPE_DEFAULT_OPTIONS.deprecated,
159
170
  schema,
160
171
  onlyDocDirectives: onlyDocDirectives ?? [],
161
172
  skipDocDirectives: skipDocDirectives ?? [],
162
173
  sectionHeaderId: sectionHeaderId ?? options_1.DEFAULT_OPTIONS.sectionHeaderId,
163
174
  typeBadges: printTypeOptions?.typeBadges ?? options_1.PRINT_TYPE_DEFAULT_OPTIONS.typeBadges,
164
175
  metatags: metatags ?? [],
165
- hierarchy: printTypeOptions?.hierarchy ?? options_1.PRINT_TYPE_DEFAULT_OPTIONS.hierarchy,
176
+ hierarchy: normalizeHierarchy(printTypeOptions?.hierarchy) ??
177
+ options_1.PRINT_TYPE_DEFAULT_OPTIONS.hierarchy,
166
178
  meta: meta,
167
179
  // Merge formatter functions: default formatter with any overrides
168
180
  ...(0, formatter_1.createDefaultFormatter)(),
169
181
  ...formatter,
170
182
  };
171
- const initExampleSection = printTypeOptions?.exampleSection;
172
- let deprecatedExampleSection;
173
- if (typeof initExampleSection === "boolean") {
174
- deprecatedExampleSection = initExampleSection;
175
- }
176
- else if (initExampleSection === undefined) {
177
- deprecatedExampleSection =
178
- options_1.PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS.exampleSection;
179
- }
180
- else {
181
- deprecatedExampleSection = true;
182
- }
183
- Printer._deprecatedOptions = {
184
- codeSection: printTypeOptions?.codeSection ??
185
- options_1.PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS.codeSection,
186
- exampleSection: deprecatedExampleSection,
187
- relatedTypeSection: printTypeOptions?.relatedTypeSection ??
188
- options_1.PRINT_TYPE_DEFAULT_DEPRECATED_OPTIONS.relatedTypeSection,
189
- };
190
183
  Printer.mdxDeclaration = mdxDeclaration ?? "";
191
184
  }
192
185
  }
@@ -395,12 +388,6 @@ class Printer {
395
388
  ...Printer.options,
396
389
  ...options,
397
390
  };
398
- const deprecatedOptions = {
399
- ...Printer.deprecatedOptions,
400
- exampleSection: printTypeOptions.exampleSection
401
- ? true
402
- : Printer.deprecatedOptions?.exampleSection,
403
- };
404
391
  if (!name || !(0, link_1.hasPrintableDirective)(type, printTypeOptions)) {
405
392
  return undefined;
406
393
  }
@@ -418,12 +405,9 @@ class Printer {
418
405
  const header = Printer.printHeader(name, (0, graphql_1.getTypeName)(type), printTypeOptions);
419
406
  const metatags = Printer.printMetaTags(type, printTypeOptions);
420
407
  const description = Printer.printDescription(type, printTypeOptions);
421
- // Generate all sections unconditionally to support event hooks that might re-add
422
- // sections excluded by deprecated toggles. This is a performance trade-off:
423
- // sections excluded by deprecated flags (codeSection, exampleSection, relatedTypeSection)
424
- // are still generated and print events emitted, even if they won't be rendered.
425
- // TODO(perf): Implement lazy section generation based on final composed order
426
- // when no BEFORE_COMPOSE_PAGE_TYPE listeners are registered.
408
+ // Generate all sections unconditionally so that BEFORE_COMPOSE_PAGE_TYPE hooks
409
+ // can add, remove, or reorder them at will.
410
+ // See: https://github.com/graphql-markdown/graphql-markdown/issues/2954
427
411
  const code = await Printer.printCodeAsync(type, name, printTypeOptions);
428
412
  const customDirectives = Printer.printCustomDirectives(type, printTypeOptions);
429
413
  const tags = Printer.printCustomTags(type, printTypeOptions);
@@ -443,7 +427,7 @@ class Printer {
443
427
  example: Printer.normalizePageSection(example),
444
428
  relations: Printer.normalizePageSection(relations),
445
429
  };
446
- let sectionOrder = Printer.getDeprecatedTypePageSectionOrder([...TYPE_PAGE_SECTION_ORDER], deprecatedOptions);
430
+ let sectionOrder = [...TYPE_PAGE_SECTION_ORDER];
447
431
  // Emit BEFORE_COMPOSE_PAGE_TYPE event if emitter is configured
448
432
  if (Printer.eventEmitter) {
449
433
  const beforeComposeEvent = new events_1.BeforeComposePageTypeEvent({ type, name, options: printTypeOptions, sections }, sectionOrder);
@@ -521,25 +505,6 @@ class Printer {
521
505
  }
522
506
  return `${title}${content}`;
523
507
  };
524
- /**
525
- * Returns the default content section order for type pages.
526
- *
527
- * Applies backward-compatibility toggles from deprecated section flags.
528
- */
529
- static getDeprecatedTypePageSectionOrder = (sections, deprecatedOptions) => {
530
- return sections.filter((section) => {
531
- if (section === "code") {
532
- return deprecatedOptions.codeSection !== false;
533
- }
534
- if (section === "example") {
535
- return deprecatedOptions.exampleSection !== false;
536
- }
537
- if (section === "relations") {
538
- return deprecatedOptions.relatedTypeSection !== false;
539
- }
540
- return true;
541
- });
542
- };
543
508
  /**
544
509
  * Runtime guard for built-in page content section keys.
545
510
  */
@@ -28,7 +28,7 @@ export declare const getRootTypeLocaleFromString: (text: string) => Maybe<TypeLo
28
28
  * const mdx = printRelationOf(type, "Member Of", getRelationOfField, options);
29
29
  * ```
30
30
  */
31
- export declare const printRelationOf: <T>(type: unknown, section: unknown, getRelation: Maybe<IGetRelation<T>>, options: PrintTypeOptions) => string | MDXString;
31
+ export declare const printRelationOf: <T>(type: unknown, section: unknown, getRelation: Maybe<IGetRelation<T>>, options: PrintTypeOptions) => MDXString | string;
32
32
  /**
33
33
  * Prints all relations (return types, member fields, and implementations) for a given type
34
34
  * @param type - The GraphQL type to get all relations for
@@ -40,5 +40,5 @@ export declare const printRelationOf: <T>(type: unknown, section: unknown, getRe
40
40
  * const relations = printRelations(myType, { schema, formatMDXBullet: () => "* " });
41
41
  * ```
42
42
  */
43
- export declare const printRelations: (type: unknown, options: PrintTypeOptions) => string | MDXString;
43
+ export declare const printRelations: (type: unknown, options: PrintTypeOptions) => MDXString | string;
44
44
  //# sourceMappingURL=relation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../src/relation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,gBAAgB,EAGhB,UAAU,EACX,MAAM,yBAAyB,CAAC;AAgBjC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,qCASvC,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,wHAwDhC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,kEAmB1B,CAAC"}
1
+ {"version":3,"file":"relation.d.ts","sourceRoot":"","sources":["../src/relation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,KAAK,EACL,gBAAgB,EAGhB,UAAU,EACX,MAAM,yBAAyB,CAAC;AAgBjC;;;;;;;;GAQG;AACH,eAAO,MAAM,2BAA2B,SAChC,MAAM,KACX,KAAK,CAAC,UAAU,CAOlB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,GAAI,CAAC,QACzB,OAAO,WACJ,OAAO,eACH,KAAK,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,WAC1B,gBAAgB,KACxB,SAAS,GAAG,MAmDd,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,SACnB,OAAO,WACJ,gBAAgB,KACxB,SAAS,GAAG,MAgBd,CAAC"}
package/dist/section.d.ts CHANGED
@@ -13,7 +13,7 @@ import type { Maybe, MDXString, PageSection, PrintTypeOptions } from "@graphql-m
13
13
  *
14
14
  * @template T - Type of the GraphQL element being printed
15
15
  */
16
- export declare const printSectionItem: <T>(type: T, options: PrintTypeOptions) => string | MDXString;
16
+ export declare const printSectionItem: <T>(type: T, options: PrintTypeOptions) => MDXString | string;
17
17
  /**
18
18
  * Prints an array of section items with consistent formatting.
19
19
  *
@@ -23,7 +23,7 @@ export declare const printSectionItem: <T>(type: T, options: PrintTypeOptions) =
23
23
  *
24
24
  * @template V - Type of the values being printed
25
25
  */
26
- export declare const printSectionItems: <V>(values: V | V[], options: PrintTypeOptions) => string | MDXString;
26
+ export declare const printSectionItems: <V>(values: V | V[], options: PrintTypeOptions) => MDXString | string;
27
27
  /**
28
28
  * Prints a complete section with title and content.
29
29
  *
@@ -1 +1 @@
1
- {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../src/section.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,KAAK,EACL,SAAS,EACT,WAAW,EACX,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAuBjC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,2DAmDjC,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,mEAoBlC,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,+FAyC7B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,CAAC,4GA0ExC,CAAC"}
1
+ {"version":3,"file":"section.d.ts","sourceRoot":"","sources":["../src/section.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAEV,KAAK,EACL,SAAS,EACT,WAAW,EACX,gBAAgB,EAEjB,MAAM,yBAAyB,CAAC;AAuBjC;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,GAAI,CAAC,QAC1B,CAAC,WACE,gBAAgB,KACxB,SAAS,GAAG,MAgDd,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,UACzB,CAAC,GAAG,CAAC,EAAE,WACN,gBAAgB,KACxB,SAAS,GAAG,MAiBd,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,YAAY,GAAI,CAAC,UACpB,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,WACjB,MAAM,WACN,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAmCnB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,EAAE,CAAC,QACjC,CAAC,UACC,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,EAAE,WACrB,MAAM,WACN,gBAAgB,KACxB,KAAK,CAAC,WAAW,CAqEnB,CAAC"}
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.15.0",
8
+ "version": "1.16.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -65,9 +65,10 @@
65
65
  "test:watch": "jest --watch"
66
66
  },
67
67
  "dependencies": {
68
- "@graphql-markdown/graphql": "^1.2.1",
69
- "@graphql-markdown/types": "^1.12.0",
70
- "@graphql-markdown/utils": "^1.11.0"
68
+ "@graphql-markdown/formatters": "^1.0.0",
69
+ "@graphql-markdown/graphql": "^1.2.2",
70
+ "@graphql-markdown/types": "^1.13.0",
71
+ "@graphql-markdown/utils": "^1.12.0"
71
72
  },
72
73
  "devDependencies": {
73
74
  "@graphql-markdown/tooling-config": "^1.0.0"