@graphql-markdown/printer-legacy 1.18.0 → 1.19.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.
@@ -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,UACpB,MAAM,SACN,KAAK,CAAC,kBAAkB,CAAC,WACvB,gBAAgB,KACxB,MAQF,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,MAUF,CAAC"}
@@ -15,6 +15,8 @@ const printFrontMatter = (title, props, options) => {
15
15
  if (!options.formatMDXFrontmatter) {
16
16
  return "";
17
17
  }
18
- return options.formatMDXFrontmatter(props, frontMatter);
18
+ return options.formatMDXFrontmatter(props, frontMatter, {
19
+ entity: options.entity,
20
+ });
19
21
  };
20
22
  exports.printFrontMatter = printFrontMatter;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../src/link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,oBAAoB,EACpB,SAAS,EACT,KAAK,EACL,gBAAgB,EAChB,gBAAgB,EAKhB,QAAQ,EACR,UAAU,EACX,MAAM,yBAAyB,CAAC;AAiCjC,eAAO,MAAM,UAAU,EAAE,QAAQ,CAAC,oBAAoB,CAG5C,C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AM,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
@@ -151,6 +151,32 @@ const getLinkDeprecatedFolder = (type, option) => {
151
151
  const isHierarchy = (options, hierarchy) => {
152
152
  return options?.hierarchy?.[hierarchy] !== undefined;
153
153
  };
154
+ /**
155
+ * Resolves the namespace folder segments and final filename slug for an
156
+ * operation link, matching the two layouts `renderer.ts` can write: nested
157
+ * category/namespace folders normally, or — under flat hierarchy, where
158
+ * `renderTypeEntities` writes one file per operation using the full dotted
159
+ * name (e.g. `queries-analytics-aggregate-tournaments.mdx`) — a single
160
+ * flattened filename with no namespace subfolders.
161
+ *
162
+ * @param isFlat - Whether the flat hierarchy option is active
163
+ * @param category - The resolved category, used as a folder (non-flat) or filename prefix (flat)
164
+ * @param name - The full, possibly dotted, operation name
165
+ * @param operationNameParts - `name` split on "." for namespaced operations, empty otherwise
166
+ * @param operationLeafName - The last part of `operationNameParts`, or the type's display name
167
+ * @returns The namespace folder segments (empty under flat hierarchy) and the final leaf slug
168
+ */
169
+ const getOperationPathSegments = (isFlat, category, name, operationNameParts, operationLeafName) => {
170
+ const flatCategoryPrefix = isFlat && category ? `${(0, utils_1.slugify)(category)}-` : "";
171
+ return {
172
+ namespaceFolders: isFlat
173
+ ? []
174
+ : operationNameParts.slice(0, -1).map((folder) => {
175
+ return (0, utils_1.slugify)(folder);
176
+ }),
177
+ leafSegment: `${flatCategoryPrefix}${(0, utils_1.slugify)(isFlat && operationNameParts.length > 0 ? name : operationLeafName)}`,
178
+ };
179
+ };
154
180
  /**
155
181
  * Converts a GraphQL type to a link object.
156
182
  *
@@ -175,15 +201,23 @@ const toLink = (type, name, operation, options) => {
175
201
  // GraphQL overload resolution can include a void branch in this monorepo; runtime value is a named type here.
176
202
  // eslint-disable-next-line @typescript-eslint/no-confusing-void-expression
177
203
  const graphQLNamedType = (0, graphql_1.getNamedType)(type);
178
- let category = "";
204
+ const isFlat = isHierarchy(options, options_1.TypeHierarchy.FLAT);
205
+ // Under flat hierarchy there are no folders to keep same-named entities of
206
+ // different kinds apart (a `type User` and a `Query.user` field both
207
+ // slugify to "user") — `renderer.ts`'s `renderTypeEntities` prefixes the
208
+ // actual filename with the entity kind (e.g. `objects-user.mdx`) to stay
209
+ // unique, so the link generated here has to build the exact same prefix
210
+ // or it would point at a file that doesn't exist.
211
+ let category = (0, exports.getLinkCategoryFolder)(graphQLNamedType, operation);
179
212
  let deprecatedFolder = "";
180
213
  let groupFolder = "";
181
214
  let apiGroupFolder = "";
182
- if (!isHierarchy(options, options_1.TypeHierarchy.FLAT)) {
183
- category = (0, exports.getLinkCategoryFolder)(graphQLNamedType, operation);
184
- if (!category) {
185
- return fallback;
186
- }
215
+ // Arguments, fields and other entities without a category have no page of
216
+ // their own in either layout, so they keep the in-page fallback link.
217
+ if (!category) {
218
+ return fallback;
219
+ }
220
+ if (!isFlat) {
187
221
  deprecatedFolder = options.deprecated
188
222
  ? getLinkDeprecatedFolder(type, options.deprecated)
189
223
  : "";
@@ -205,11 +239,9 @@ const toLink = (type, name, operation, options) => {
205
239
  const operationNameParts = (0, graphql_1.isOperation)(type) && name.includes(".")
206
240
  ? name.split(".").filter(Boolean)
207
241
  : [];
208
- const operationNamespaceFolders = operationNameParts.slice(0, -1);
209
242
  const operationLeafName = operationNameParts.at(-1) ?? text;
210
- const url = utils_1.pathUrl.join(options.basePath, formatFolder(deprecatedFolder), formatFolder(groupFolder), formatFolder(apiGroupFolder), formatFolder(category), ...operationNamespaceFolders.map((folder) => {
211
- return (0, utils_1.slugify)(folder);
212
- }), `${(0, utils_1.slugify)(operationLeafName)}`);
243
+ const { namespaceFolders, leafSegment } = getOperationPathSegments(isFlat, category, name, operationNameParts, operationLeafName);
244
+ const url = utils_1.pathUrl.join(options.basePath, formatFolder(deprecatedFolder), formatFolder(groupFolder), formatFolder(apiGroupFolder), isFlat ? "" : formatFolder(category), ...namespaceFolders, leafSegment);
213
245
  const link = {
214
246
  text,
215
247
  url,
package/dist/printer.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @module printer
8
8
  * @packageDocumentation
9
9
  */
10
- import type { Formatter, GraphQLSchema, IPrinter, Maybe, MDXString, PageSection, PrinterEventEmitter, PrinterInitOptions, PrintTypeOptions } from "@graphql-markdown/types";
10
+ import type { Badge, Formatter, GraphQLSchema, IPrinter, Maybe, MDXString, PageSection, PrinterEventEmitter, PrinterInitOptions, PrintTypeOptions } from "@graphql-markdown/types";
11
11
  import { printDescription } from "./common";
12
12
  import { printDecorators } from "./decorator";
13
13
  /**
@@ -86,6 +86,16 @@ export declare class Printer implements IPrinter {
86
86
  * @returns Formatted code block string with type definition
87
87
  */
88
88
  static readonly printCode: (type: unknown, options: PrintTypeOptions) => string;
89
+ /**
90
+ * Formats a single badge into MDX string format
91
+ *
92
+ * @param badge - Badge object containing text and optional classname
93
+ * @param options - Printer configuration options
94
+ * @returns Formatted MDX string, using the configured formatter's
95
+ * `formatMDXBadge` when set and falling back to the default formatter
96
+ * otherwise
97
+ */
98
+ static readonly printBadge: (badge: Badge, options: PrintTypeOptions) => MDXString;
89
99
  /**
90
100
  * Prints the GraphQL type definition as code block with event emission support.
91
101
  *
@@ -1 +1 @@
1
- {"version":3,"file":"printer.d.ts","sourceRoot":"","sources":["../src/printer.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAEV,SAAS,EACT,aAAa,EACb,QAAQ,EACR,KAAK,EACL,SAAS,EACT,WAAW,EAEX,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAGjB,MAAM,yBAAyB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CHANGED
@@ -38,6 +38,7 @@ const TYPE_PAGE_SECTION_ORDER = [
38
38
  const graphql_1 = require("@graphql-markdown/graphql");
39
39
  const utils_1 = require("@graphql-markdown/utils");
40
40
  const relation_1 = require("./relation");
41
+ const badge_1 = require("./badge");
41
42
  const common_1 = require("./common");
42
43
  const decorator_1 = require("./decorator");
43
44
  const frontmatter_1 = require("./frontmatter");
@@ -244,6 +245,18 @@ class Printer {
244
245
  }
245
246
  return strings_1.MARKDOWN_SOC + code.trim() + strings_1.MARKDOWN_EOC;
246
247
  };
248
+ /**
249
+ * Formats a single badge into MDX string format
250
+ *
251
+ * @param badge - Badge object containing text and optional classname
252
+ * @param options - Printer configuration options
253
+ * @returns Formatted MDX string, using the configured formatter's
254
+ * `formatMDXBadge` when set and falling back to the default formatter
255
+ * otherwise
256
+ */
257
+ static printBadge = (badge, options) => {
258
+ return (0, badge_1.printBadge)(badge, options);
259
+ };
247
260
  /**
248
261
  * Prints the GraphQL type definition as code block with event emission support.
249
262
  *
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.18.0",
8
+ "version": "1.19.0",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",